From 5927dd63bc9fafecd5194dc915fd1b5f50a94576 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 23 Oct 2024 16:43:27 -0400 Subject: [PATCH 01/22] cli: Fix `jetpack changelog add` on a release branch (#39869) When running `jetpack changelog add` while on a release branch, the script should not throw an error about attempting to access `.length` on `undefined`. --- tools/cli/commands/changelog.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/cli/commands/changelog.js b/tools/cli/commands/changelog.js index 9319a3e1c6843..5b24a6c7237f5 100644 --- a/tools/cli/commands/changelog.js +++ b/tools/cli/commands/changelog.js @@ -311,7 +311,8 @@ async function changelogAdd( argv ) { return; } - let changelogInfo, needChangelog; + let changelogInfo, + needChangelog = []; if ( argv.project ) { needChangelog = [ argv.project ]; @@ -695,7 +696,11 @@ async function checkChangelogFiles() { const branchReg = /\/branch-/; // match example: jetpack/branch-1.2.3 if ( currentBranch.match( branchReg ) ) { console.log( chalk.green( 'Release branch detected. No changelog required.' ) ); - return []; + return { + touched: [], + files: new Map(), + need: [], + }; } const re1 = /^projects\/([^/]+\/[^/]+)\//; // regex matches project file path, ie 'project/packages/connection/..' From 07e18c23a06b9bc8afe4a5323c5de4b72ce2354b Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 23 Oct 2024 16:45:10 -0400 Subject: [PATCH 02/22] changlogger: When amending, do not preserve default link (#39868) When doing `changelogger write --amend`, we normally preserve the prologue, epilogue, and link unless these are overridden on the command line. An edge case is when you're amending version 1.2.3-beta to turn it into 1.2.3 release, and the link is the default link like `https://example.com/diff/1.2.2...1.2.3-beta`. In this situation we don't want to keep that link, we want to replace it with the new default `https://example.com/diff/1.2.2...1.2.3`. Also, when building changelogger, we have to install before trying to run it. --- .../fix-changelogger-amend-default-link | 4 ++ .../changelogger/src/WriteCommand.php | 6 ++- .../tests/php/tests/src/WriteCommandTest.php | 48 +++++++++++++++++++ tools/cli/commands/build.js | 9 ++++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 projects/packages/changelogger/changelog/fix-changelogger-amend-default-link diff --git a/projects/packages/changelogger/changelog/fix-changelogger-amend-default-link b/projects/packages/changelogger/changelog/fix-changelogger-amend-default-link new file mode 100644 index 0000000000000..09dc0989a5b9c --- /dev/null +++ b/projects/packages/changelogger/changelog/fix-changelogger-amend-default-link @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +When amending, do not preserve a default link. We'll want the link to be updated to the new default. diff --git a/projects/packages/changelogger/src/WriteCommand.php b/projects/packages/changelogger/src/WriteCommand.php index 900167f64d328..1a23cbdf38090 100644 --- a/projects/packages/changelogger/src/WriteCommand.php +++ b/projects/packages/changelogger/src/WriteCommand.php @@ -412,7 +412,11 @@ protected function doAmendChanges( InputInterface $input, OutputInterface $outpu $input->setOption( 'epilogue', $latest->getEpilogue() ); } if ( $input->getOption( 'link' ) === null ) { - $input->setOption( 'link', $latest->getLink() ); + $oldLink = $latest->getLink(); + $defaultLink = $changelog->getLatestEntry() ? Config::link( $changelog->getLatestEntry()->getVersion(), $latest->getVersion() ) : null; + if ( $oldLink !== $defaultLink ) { + $input->setOption( 'link', $latest->getLink() ); + } } } else { $output->writeln( 'No version to amend, ignoring --amend.', OutputInterface::VERBOSITY_DEBUG ); diff --git a/projects/packages/changelogger/tests/php/tests/src/WriteCommandTest.php b/projects/packages/changelogger/tests/php/tests/src/WriteCommandTest.php index ebb2e105351a6..1ea6e7d0c1f6d 100644 --- a/projects/packages/changelogger/tests/php/tests/src/WriteCommandTest.php +++ b/projects/packages/changelogger/tests/php/tests/src/WriteCommandTest.php @@ -749,6 +749,54 @@ public function provideExecute() { true, "# Changelog\n\n## 1.0.1 - $date\n\nPrologue for v1.0.1\n\n### Added\n- Stuff.\n- ZZZ.\n\n### Removed\n- Other stuff.\n- Broken stuff.\n\nEpilogue for v1.0.1\n\n## 1.0.0 - 2021-02-23\n\n- Initial release.\n", ), + 'Amend, beta to release' => array( + array( '--amend' => true ), + array( + 'composer.json' => array( 'link-template' => 'https://example.org/diff/${old}..${new}' ), + 'changes' => array(), + 'changelog' => "# Changelog\n\n## [1.0.1-beta] - $date\n\nPrologue for v1.0.1\n\n### Added\n- New stuff.\n- Stuff.\n- ZZZ.\n\n### Removed\n- Other stuff.\n\n### Fixed\n- Broken stuff.\n\nEpilogue for v1.0.1\n\n## 1.0.0 - 2021-02-23\n\n- Initial release.\n\n[1.0.1-beta]: https://example.org/new-link\n", + ), + array( 'Y' ), + 0, + array( + '{^No changes were found! Proceed\? \[y/N\] $}m', + ), + true, + "# Changelog\n\n## [1.0.1] - $date\n\nPrologue for v1.0.1\n\n### Added\n- New stuff.\n- Stuff.\n- ZZZ.\n\n### Removed\n- Other stuff.\n\n### Fixed\n- Broken stuff.\n\nEpilogue for v1.0.1\n\n## 1.0.0 - 2021-02-23\n\n- Initial release.\n\n[1.0.1]: https://example.org/new-link\n", + ), + 'Amend, ignore default link' => array( + array( '--amend' => true ), + array( + 'composer.json' => array( 'link-template' => 'https://example.org/diff/${old}..${new}' ), + 'changes' => array(), + 'changelog' => "# Changelog\n\n## [1.0.1-beta] - $date\n\nPrologue for v1.0.1\n\n### Added\n- New stuff.\n- Stuff.\n- ZZZ.\n\n### Removed\n- Other stuff.\n\n### Fixed\n- Broken stuff.\n\nEpilogue for v1.0.1\n\n## 1.0.0 - 2021-02-23\n\n- Initial release.\n\n[1.0.1-beta]: https://example.org/diff/1.0.0..1.0.1-beta\n", + ), + array( 'Y' ), + 0, + array( + '{^No changes were found! Proceed\? \[y/N\] $}m', + ), + true, + "# Changelog\n\n## [1.0.1] - $date\n\nPrologue for v1.0.1\n\n### Added\n- New stuff.\n- Stuff.\n- ZZZ.\n\n### Removed\n- Other stuff.\n\n### Fixed\n- Broken stuff.\n\nEpilogue for v1.0.1\n\n## 1.0.0 - 2021-02-23\n\n- Initial release.\n\n[1.0.1]: https://example.org/diff/1.0.0..1.0.1\n", + ), + 'Amend, manually override default link' => array( + array( + '--amend' => true, + '--link' => 'https://example.org/new-link', + ), + array( + 'composer.json' => array( 'link-template' => 'https://example.org/diff/${old}..${new}' ), + 'changes' => array(), + 'changelog' => "# Changelog\n\n## [1.0.1-beta] - $date\n\nPrologue for v1.0.1\n\n### Added\n- New stuff.\n- Stuff.\n- ZZZ.\n\n### Removed\n- Other stuff.\n\n### Fixed\n- Broken stuff.\n\nEpilogue for v1.0.1\n\n## 1.0.0 - 2021-02-23\n\n- Initial release.\n\n[1.0.1-beta]: https://example.org/diff/1.0.0..1.0.1-beta\n", + ), + array( 'Y' ), + 0, + array( + '{^No changes were found! Proceed\? \[y/N\] $}m', + ), + true, + "# Changelog\n\n## [1.0.1] - $date\n\nPrologue for v1.0.1\n\n### Added\n- New stuff.\n- Stuff.\n- ZZZ.\n\n### Removed\n- Other stuff.\n\n### Fixed\n- Broken stuff.\n\nEpilogue for v1.0.1\n\n## 1.0.0 - 2021-02-23\n\n- Initial release.\n\n[1.0.1]: https://example.org/new-link\n", + ), '--use-version invalid' => array( array( '--use-version' => '2.0' ), diff --git a/tools/cli/commands/build.js b/tools/cli/commands/build.js index 41d25232bf875..1e85a759326f9 100644 --- a/tools/cli/commands/build.js +++ b/tools/cli/commands/build.js @@ -612,6 +612,15 @@ async function buildProject( t ) { () => false ) ) { + // If we're building changelogger itself, we need to install before we can run it. + if ( t.project === 'packages/changelogger' ) { + await t.execa( 'composer', await getInstallArgs( t.project, 'composer', t.argv ), { + cwd: t.cwd, + stdio: [ 'ignore', 'inherit', 'inherit' ], + buffer: false, + } ); + } + let prerelease = 'alpha'; if ( composerJson.extra?.[ 'dev-releases' ] ) { const m = ( From 4f62ae4f60e73f0efc1bab71b0d65418446ff3df Mon Sep 17 00:00:00 2001 From: Jasper Kang Date: Thu, 24 Oct 2024 17:39:35 +1300 Subject: [PATCH 03/22] Stats: Use option value instead of transient for cache buster (#39887) --- ...date-use-option-value-instead-of-transient | 4 + .../stats-admin/src/class-odyssey-assets.php | 40 ++++++-- .../stats-admin/tests/php/class-test-case.php | 2 + .../tests/php/test-odyssey-assets.php | 96 ++++++++++++++++++- 4 files changed, 132 insertions(+), 10 deletions(-) create mode 100644 projects/packages/stats-admin/changelog/update-use-option-value-instead-of-transient diff --git a/projects/packages/stats-admin/changelog/update-use-option-value-instead-of-transient b/projects/packages/stats-admin/changelog/update-use-option-value-instead-of-transient new file mode 100644 index 0000000000000..6e6660e388644 --- /dev/null +++ b/projects/packages/stats-admin/changelog/update-use-option-value-instead-of-transient @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Odyssey Stats cache busting: use optioin instead of transient diff --git a/projects/packages/stats-admin/src/class-odyssey-assets.php b/projects/packages/stats-admin/src/class-odyssey-assets.php index 8117e650ae5fa..98d59fc3bb3ad 100644 --- a/projects/packages/stats-admin/src/class-odyssey-assets.php +++ b/projects/packages/stats-admin/src/class-odyssey-assets.php @@ -75,36 +75,58 @@ public function load_admin_scripts( $asset_handle, $asset_name, $options = array /** * Returns cache buster string for assets. * Development mode doesn't need this, as it's handled by `Assets` class. + * + * @return string */ protected function get_cdn_asset_cache_buster() { + $now_in_ms = floor( microtime( true ) * 1000 ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_GET['force_refresh'] ) ) { - set_transient( self::ODYSSEY_STATS_CACHE_BUSTER_CACHE_KEY, floor( microtime( true ) * 1000 ), 15 * MINUTE_IN_SECONDS ); + update_option( self::ODYSSEY_STATS_CACHE_BUSTER_CACHE_KEY, $this->get_cache_buster_option_value( $now_in_ms ), false ); } // Use cached cache buster in production. - $remote_asset_version = get_transient( self::ODYSSEY_STATS_CACHE_BUSTER_CACHE_KEY ); + $remote_asset_version = get_option( self::ODYSSEY_STATS_CACHE_BUSTER_CACHE_KEY ); if ( ! empty( $remote_asset_version ) ) { - return $remote_asset_version; + $remote_asset_version = json_decode( $remote_asset_version, true ); + // If cache buster is cached and not expired (valid in 15 min), return it. + if ( ! empty( $remote_asset_version['cache_buster'] ) && $remote_asset_version['cached_at'] > $now_in_ms - MINUTE_IN_SECONDS * 1000 * 15 ) { + return $remote_asset_version['cache_buster']; + } } // If no cached cache buster, we fetch it from CDN and set to transient. - $response = wp_remote_get( sprintf( self::ODYSSEY_CDN_URL, self::ODYSSEY_STATS_VERSION, 'build_meta.json?t=' . time() ), array( 'timeout' => 5 ) ); + $response = wp_remote_get( sprintf( self::ODYSSEY_CDN_URL, self::ODYSSEY_STATS_VERSION, 'build_meta.json?t=' . $now_in_ms ), array( 'timeout' => 5 ) ); if ( is_wp_error( $response ) ) { - // fallback to the package version. - return Main::VERSION; + // fallback to current timestamp. + return (string) $now_in_ms; } $build_meta = json_decode( wp_remote_retrieve_body( $response ), true ); if ( ! empty( $build_meta['cache_buster'] ) ) { // Cache the cache buster for 15 mins. - set_transient( self::ODYSSEY_STATS_CACHE_BUSTER_CACHE_KEY, $build_meta['cache_buster'], 15 * MINUTE_IN_SECONDS ); + update_option( self::ODYSSEY_STATS_CACHE_BUSTER_CACHE_KEY, $this->get_cache_buster_option_value( $build_meta['cache_buster'] ), false ); return $build_meta['cache_buster']; } - // fallback to the package version. - return Main::VERSION; + // fallback to current timestamp. + return (string) $now_in_ms; + } + + /** + * Get the cache buster option value. + * + * @param string|int|float $cache_buster The cache buster. + * @return string|false + */ + protected function get_cache_buster_option_value( $cache_buster ) { + return wp_json_encode( + array( + 'cache_buster' => (string) $cache_buster, + 'cached_at' => floor( microtime( true ) * 1000 ), // milliseconds. + ) + ); } } diff --git a/projects/packages/stats-admin/tests/php/class-test-case.php b/projects/packages/stats-admin/tests/php/class-test-case.php index e6b919b204a4f..0d21e264cf842 100644 --- a/projects/packages/stats-admin/tests/php/class-test-case.php +++ b/projects/packages/stats-admin/tests/php/class-test-case.php @@ -60,6 +60,7 @@ public function set_up() { add_filter( 'jetpack_options', array( $this, 'mock_jetpack_site_connection_options' ), 10, 2 ); add_filter( 'pre_http_request', array( $this, 'plan_http_response_fixture' ), 10, 3 ); + delete_option( Odyssey_Assets::ODYSSEY_STATS_CACHE_BUSTER_CACHE_KEY ); } /** @@ -76,6 +77,7 @@ public function tear_down() { remove_filter( 'pre_http_request', array( $this, 'plan_http_response_fixture' ) ); remove_filter( 'jetpack_options', array( $this, 'mock_jetpack_site_connection_options' ) ); + delete_option( Odyssey_Assets::ODYSSEY_STATS_CACHE_BUSTER_CACHE_KEY ); } /** diff --git a/projects/packages/stats-admin/tests/php/test-odyssey-assets.php b/projects/packages/stats-admin/tests/php/test-odyssey-assets.php index f99eca36ad1fe..14e1fb5c3bec9 100644 --- a/projects/packages/stats-admin/tests/php/test-odyssey-assets.php +++ b/projects/packages/stats-admin/tests/php/test-odyssey-assets.php @@ -2,6 +2,7 @@ namespace Automattic\Jetpack\Stats_Admin; use Automattic\Jetpack\Stats_Admin\Test_Case as Stats_Test_Case; +use WP_Error; /** * Unit tests for the Odyssey_Assets class. @@ -9,13 +10,106 @@ * @package automattic/jetpack-stats-admin */ class Test_Odyssey_Assets extends Stats_Test_Case { + /** * Test remote cache buster. */ public function test_get_cdn_asset_cache_buster() { + $this->assertEquals( 'calypso-4917-8664-g72a154d63a', $this->get_cdn_asset_cache_buster_callable() ); + } + + /** + * Test remote cache buster remote error. + */ + public function test_get_cdn_asset_cache_buster_remote_error() { + add_filter( 'pre_http_request', array( $this, 'break_cdn_cache_buster_request' ), 15, 3 ); + $this->assertEquals( time(), floor( $this->get_cdn_asset_cache_buster_callable() / 1000 ) ); + remove_filter( 'pre_http_request', array( $this, 'break_cdn_cache_buster_request' ), 15 ); + } + + /** + * Test already cached cache buster. + */ + public function test_get_cdn_asset_cache_buster_already_cached() { + update_option( + Odyssey_Assets::ODYSSEY_STATS_CACHE_BUSTER_CACHE_KEY, + wp_json_encode( + array( + 'cache_buster' => 'calypso-4917-8664-123456', + 'cached_at' => floor( microtime( true ) * 1000 ), // milliseconds. + ) + ), + false + ); + $this->assertEquals( 'calypso-4917-8664-123456', $this->get_cdn_asset_cache_buster_callable() ); + } + + /** + * Test already cached cache buster expired. + */ + public function test_get_cdn_asset_cache_buster_already_cached_expired() { + update_option( + Odyssey_Assets::ODYSSEY_STATS_CACHE_BUSTER_CACHE_KEY, + wp_json_encode( + array( + 'cache_buster' => 'calypso-4917-8664-123456', + 'cached_at' => floor( microtime( true ) * 1000 - MINUTE_IN_SECONDS * 1000 * 20 ), // milliseconds. + ) + ), + false + ); + $this->assertEquals( 'calypso-4917-8664-g72a154d63a', $this->get_cdn_asset_cache_buster_callable() ); + } + + /** + * Test already cached cache buster expired and failed to fetch new one. + */ + public function test_get_cdn_asset_cache_buster_failed_to_fetch() { + add_filter( 'pre_http_request', array( $this, 'break_cdn_cache_buster_request' ), 15, 3 ); + update_option( + Odyssey_Assets::ODYSSEY_STATS_CACHE_BUSTER_CACHE_KEY, + wp_json_encode( + array( + 'cache_buster' => 'calypso-4917-8664-123456', + 'cached_at' => floor( microtime( true ) * 1000 - MINUTE_IN_SECONDS * 1000 * 20 ), // milliseconds. + ) + ), + false + ); + $this->assertEquals( time(), floor( $this->get_cdn_asset_cache_buster_callable() / 1000 ) ); + remove_filter( 'pre_http_request', array( $this, 'break_cdn_cache_buster_request' ), 15 ); + } + + /** + * Test force refresh cache buster. + */ + public function test_get_cdn_asset_cache_buster_force_refresh_expired() { + $_GET['force_refresh'] = 1; + $this->assertEquals( time(), floor( $this->get_cdn_asset_cache_buster_callable() / 1000 ) ); + } + + /** + * Test remote cache buster. + * + * @param mixed $response The response array. + * @param mixed $parsed_args The parsed args. + * @param mixed $url The URL. + * @return WP_Error | void + */ + public function break_cdn_cache_buster_request( $response, $parsed_args, $url ) { + if ( strpos( $url, '/build_meta.json' ) !== false ) { + return new WP_Error( 500, 'Internal Server Error' ); + } + } + + /** + * Get CDN asset cache buster. + */ + protected function get_cdn_asset_cache_buster_callable() { $odyssey_assets = new Odyssey_Assets(); $get_cdn_asset_cache_buster = new \ReflectionMethod( $odyssey_assets, 'get_cdn_asset_cache_buster' ); $get_cdn_asset_cache_buster->setAccessible( true ); - $this->assertEquals( 'calypso-4917-8664-g72a154d63a', $get_cdn_asset_cache_buster->invoke( $odyssey_assets ) ); + + return $get_cdn_asset_cache_buster->invoke( $odyssey_assets ); } } From cf5f21b9812d5c5ce3d6170e83accfdf51c39c18 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Wed, 23 Oct 2024 23:46:26 -0700 Subject: [PATCH 04/22] Initial State: Migrate `hasPaidFeatures` with feature check on front-end (#39838) * Initial State: Migrate `hasPaidFeatures` with feature check on front-end * Replace hasPaidPlan by hasSocialPaidFeatures --- .../update-social-replace-has-paid-features-check | 5 +++++ .../src/components/form/enhanced-features-nudge.tsx | 7 ++----- .../src/social-store/reducer/index.js | 1 - .../src/social-store/selectors/index.js | 1 - .../publicize-components/src/utils/script-data.ts | 11 ++++++++++- .../plugins/jetpack/_inc/client/sharing/index.jsx | 7 +++++-- .../update-social-replace-has-paid-features-check | 5 +++++ .../update-social-replace-has-paid-features-check | 5 +++++ .../social/src/js/components/admin-page/index.jsx | 9 +++++---- .../src/js/components/social-module-toggle/index.tsx | 5 ++--- .../social/src/js/components/support-section/index.js | 6 ++---- .../plugins/social/src/js/components/types/types.ts | 1 - 12 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 projects/js-packages/publicize-components/changelog/update-social-replace-has-paid-features-check create mode 100644 projects/plugins/jetpack/changelog/update-social-replace-has-paid-features-check create mode 100644 projects/plugins/social/changelog/update-social-replace-has-paid-features-check diff --git a/projects/js-packages/publicize-components/changelog/update-social-replace-has-paid-features-check b/projects/js-packages/publicize-components/changelog/update-social-replace-has-paid-features-check new file mode 100644 index 0000000000000..bf9a130af83ec --- /dev/null +++ b/projects/js-packages/publicize-components/changelog/update-social-replace-has-paid-features-check @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Initial State: Migrated hasPaidFeatures flag with feature check on front-end + + diff --git a/projects/js-packages/publicize-components/src/components/form/enhanced-features-nudge.tsx b/projects/js-packages/publicize-components/src/components/form/enhanced-features-nudge.tsx index ce90b960e33a2..b66bab3557fad 100644 --- a/projects/js-packages/publicize-components/src/components/form/enhanced-features-nudge.tsx +++ b/projects/js-packages/publicize-components/src/components/form/enhanced-features-nudge.tsx @@ -5,20 +5,17 @@ import { isSimpleSite, } from '@automattic/jetpack-shared-extension-utils'; import { Button, PanelRow } from '@wordpress/components'; -import { useSelect } from '@wordpress/data'; import { _x } from '@wordpress/i18n'; -import { store as socialStore } from '../../social-store'; +import { hasSocialPaidFeatures } from '../../utils'; import styles from './styles.module.scss'; import { useAutoSaveAndRedirect } from './use-auto-save-and-redirect'; export const EnhancedFeaturesNudge: React.FC = () => { - const hasPaidFeatures = useSelect( select => select( socialStore ).hasPaidFeatures(), [] ); - const autosaveAndRedirect = useAutoSaveAndRedirect(); const isWpcom = isSimpleSite() || isAtomicSite(); - if ( isWpcom || hasPaidFeatures ) { + if ( isWpcom || hasSocialPaidFeatures() ) { return null; } diff --git a/projects/js-packages/publicize-components/src/social-store/reducer/index.js b/projects/js-packages/publicize-components/src/social-store/reducer/index.js index 502e34d256f73..957ba28a507f8 100644 --- a/projects/js-packages/publicize-components/src/social-store/reducer/index.js +++ b/projects/js-packages/publicize-components/src/social-store/reducer/index.js @@ -12,7 +12,6 @@ const reducer = combineReducers( { socialImageGeneratorSettings, shareStatus, hasPaidPlan: ( state = false ) => state, - hasPaidFeatures: ( state = false ) => state, } ); export default reducer; diff --git a/projects/js-packages/publicize-components/src/social-store/selectors/index.js b/projects/js-packages/publicize-components/src/social-store/selectors/index.js index 9841e282af43e..6cf378df068eb 100644 --- a/projects/js-packages/publicize-components/src/social-store/selectors/index.js +++ b/projects/js-packages/publicize-components/src/social-store/selectors/index.js @@ -10,7 +10,6 @@ const selectors = { ...jetpackSettingSelectors, ...socialImageGeneratorSettingsSelectors, ...shareStatusSelectors, - hasPaidFeatures: state => state.hasPaidFeatures, }; export default selectors; diff --git a/projects/js-packages/publicize-components/src/utils/script-data.ts b/projects/js-packages/publicize-components/src/utils/script-data.ts index 4db102747a639..25561a8b726f2 100644 --- a/projects/js-packages/publicize-components/src/utils/script-data.ts +++ b/projects/js-packages/publicize-components/src/utils/script-data.ts @@ -1,4 +1,4 @@ -import { getScriptData } from '@automattic/jetpack-script-data'; +import { getScriptData, siteHasFeature } from '@automattic/jetpack-script-data'; import { SocialScriptData } from '../types/types'; /** @@ -9,3 +9,12 @@ import { SocialScriptData } from '../types/types'; export function getSocialScriptData(): SocialScriptData { return getScriptData().social; } + +/** + * Check if the site has social paid features. + * + * @return {boolean} Whether the site has social paid features. + */ +export function hasSocialPaidFeatures() { + return siteHasFeature( 'social-enhanced-publishing' ); +} diff --git a/projects/plugins/jetpack/_inc/client/sharing/index.jsx b/projects/plugins/jetpack/_inc/client/sharing/index.jsx index 196f8cd178b05..ba0f0e9b64409 100644 --- a/projects/plugins/jetpack/_inc/client/sharing/index.jsx +++ b/projects/plugins/jetpack/_inc/client/sharing/index.jsx @@ -1,4 +1,7 @@ -import { getSocialScriptData } from '@automattic/jetpack-publicize-components'; +import { + getSocialScriptData, + hasSocialPaidFeatures, +} from '@automattic/jetpack-publicize-components'; import { __ } from '@wordpress/i18n'; import QuerySite from 'components/data/query-site'; import React, { Component } from 'react'; @@ -97,7 +100,7 @@ export default connect( state => { blogID: getSiteId( state ), siteAdminUrl: getSiteAdminUrl( state ), activeFeatures: getActiveFeatures( state ), - hasPaidFeatures: siteHasFeature( state, 'social-enhanced-publishing' ), + hasPaidFeatures: hasSocialPaidFeatures(), hasSocialImageGenerator: siteHasFeature( state, 'social-image-generator' ), userCanManageModules: userCanManageModules( state ), isAtomicSite: isAtomicSite( state ), diff --git a/projects/plugins/jetpack/changelog/update-social-replace-has-paid-features-check b/projects/plugins/jetpack/changelog/update-social-replace-has-paid-features-check new file mode 100644 index 0000000000000..a2339eaccb346 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-social-replace-has-paid-features-check @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Initial State: Migrated hasPaidFeatures flag with feature check on front-end + + diff --git a/projects/plugins/social/changelog/update-social-replace-has-paid-features-check b/projects/plugins/social/changelog/update-social-replace-has-paid-features-check new file mode 100644 index 0000000000000..bf9a130af83ec --- /dev/null +++ b/projects/plugins/social/changelog/update-social-replace-has-paid-features-check @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Initial State: Migrated hasPaidFeatures flag with feature check on front-end + + diff --git a/projects/plugins/social/src/js/components/admin-page/index.jsx b/projects/plugins/social/src/js/components/admin-page/index.jsx index fcb351364013c..4f97dd0656bca 100644 --- a/projects/plugins/social/src/js/components/admin-page/index.jsx +++ b/projects/plugins/social/src/js/components/admin-page/index.jsx @@ -7,7 +7,10 @@ import { GlobalNotices, } from '@automattic/jetpack-components'; import { useConnection } from '@automattic/jetpack-connection'; -import { store as socialStore } from '@automattic/jetpack-publicize-components'; +import { + hasSocialPaidFeatures, + store as socialStore, +} from '@automattic/jetpack-publicize-components'; import { useSelect, useDispatch } from '@wordpress/data'; import { useState, useCallback, useEffect, useRef } from '@wordpress/element'; import React from 'react'; @@ -34,7 +37,6 @@ const Admin = () => { const { isModuleEnabled, showPricingPage, - hasPaidFeatures, pluginVersion, isSocialImageGeneratorAvailable, isUpdatingJetpackSettings, @@ -43,7 +45,6 @@ const Admin = () => { return { isModuleEnabled: store.isModuleEnabled(), showPricingPage: store.showPricingPage(), - hasPaidFeatures: store.hasPaidFeatures(), pluginVersion: store.getPluginVersion(), isSocialImageGeneratorAvailable: store.isSocialImageGeneratorAvailable(), isUpdatingJetpackSettings: store.isUpdatingJetpackSettings(), @@ -76,7 +77,7 @@ const Admin = () => { return ( }> - { ( ! hasPaidFeatures && showPricingPage ) || forceDisplayPricingPage ? ( + { ( ! hasSocialPaidFeatures() && showPricingPage ) || forceDisplayPricingPage ? ( diff --git a/projects/plugins/social/src/js/components/social-module-toggle/index.tsx b/projects/plugins/social/src/js/components/social-module-toggle/index.tsx index 77345ba97de14..6d955bc2f817d 100644 --- a/projects/plugins/social/src/js/components/social-module-toggle/index.tsx +++ b/projects/plugins/social/src/js/components/social-module-toggle/index.tsx @@ -9,6 +9,7 @@ import { ConnectionManagement, SOCIAL_STORE_ID, getSocialScriptData, + hasSocialPaidFeatures, } from '@automattic/jetpack-publicize-components'; import { ExternalLink } from '@wordpress/components'; import { useSelect, useDispatch } from '@wordpress/data'; @@ -26,7 +27,6 @@ const SocialModuleToggle: React.FC = () => { isUpdating, siteSuffix, blogID, - hasPaidFeatures, } = useSelect( select => { const store = select( SOCIAL_STORE_ID ) as SocialStoreSelectors; return { @@ -34,7 +34,6 @@ const SocialModuleToggle: React.FC = () => { isUpdating: store.isUpdatingJetpackSettings(), siteSuffix: store.getSiteSuffix(), blogID: store.getBlogID(), - hasPaidFeatures: store.hasPaidFeatures(), }; }, [] ); @@ -97,7 +96,7 @@ const SocialModuleToggle: React.FC = () => { { __( 'Learn more', 'jetpack-social' ) } - { ! hasPaidFeatures ? ( + { ! hasSocialPaidFeatures() ? ( { const [ isAtLeastMedium ] = useBreakpointMatch( 'md', '>=' ); - const hasPaidPlan = useSelect( select => select( SOCIAL_STORE_ID ).hasPaidPlan() ); - if ( ! hasPaidPlan ) { + if ( ! hasSocialPaidFeatures() ) { return null; } diff --git a/projects/plugins/social/src/js/components/types/types.ts b/projects/plugins/social/src/js/components/types/types.ts index 9ce1d062591fb..bfc950e1d7677 100644 --- a/projects/plugins/social/src/js/components/types/types.ts +++ b/projects/plugins/social/src/js/components/types/types.ts @@ -8,7 +8,6 @@ type JetpackSettingsSelectors = { showPricingPage: () => boolean; isUpdatingJetpackSettings: () => boolean; hasPaidPlan: () => boolean; - hasPaidFeatures: () => boolean; }; type ConnectionDataSelectors = { From 2431e96706c47e3e8f6d2f991274592092cdab81 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Thu, 24 Oct 2024 01:45:14 -0700 Subject: [PATCH 05/22] Initial State: Nuke hasPaidPlan flag (#39839) --- .../changelog/update-social-nuke-has-paid-plan | 5 +++++ .../src/hooks/use-publicize-config/index.js | 7 ------- .../publicize-components/src/social-store/reducer/index.js | 1 - .../src/social-store/selectors/jetpack-settings.js | 1 - .../publicize-components/src/social-store/types.ts | 2 -- .../js-packages/publicize-components/src/types/types.ts | 1 - .../social/changelog/update-social-nuke-has-paid-plan | 5 +++++ .../src/js/components/admin-page/test/index.test.jsx | 1 - projects/plugins/social/src/js/components/types/types.ts | 1 - 9 files changed, 10 insertions(+), 14 deletions(-) create mode 100644 projects/js-packages/publicize-components/changelog/update-social-nuke-has-paid-plan create mode 100644 projects/plugins/social/changelog/update-social-nuke-has-paid-plan diff --git a/projects/js-packages/publicize-components/changelog/update-social-nuke-has-paid-plan b/projects/js-packages/publicize-components/changelog/update-social-nuke-has-paid-plan new file mode 100644 index 0000000000000..59e08c72626b5 --- /dev/null +++ b/projects/js-packages/publicize-components/changelog/update-social-nuke-has-paid-plan @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Initial state: Removed unused hasPaidPlan flag + + diff --git a/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js b/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js index bb991a44dd85e..e7827d27afd78 100644 --- a/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js +++ b/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js @@ -80,12 +80,6 @@ export default function usePublicizeConfig() { */ const hidePublicizeFeature = isPostPublished && ! isRePublicizeFeatureAvailable; - /** - * hasPaidPlan: - * Whether the site has a paid plan. This could be either the Basic or the Advanced plan. - */ - const hasPaidPlan = !! getJetpackData()?.social?.hasPaidPlan; - /**\ * Returns true if the post type is a Jetpack Social Note. */ @@ -102,7 +96,6 @@ export default function usePublicizeConfig() { isRePublicizeUpgradableViaUpsell, hidePublicizeFeature, isPostAlreadyShared, - hasPaidPlan, isSocialImageGeneratorAvailable: !! getJetpackData()?.social?.isSocialImageGeneratorAvailable && ! isJetpackSocialNote, isSocialImageGeneratorEnabled: !! getJetpackData()?.social?.isSocialImageGeneratorEnabled, diff --git a/projects/js-packages/publicize-components/src/social-store/reducer/index.js b/projects/js-packages/publicize-components/src/social-store/reducer/index.js index 957ba28a507f8..6bae3be245474 100644 --- a/projects/js-packages/publicize-components/src/social-store/reducer/index.js +++ b/projects/js-packages/publicize-components/src/social-store/reducer/index.js @@ -11,7 +11,6 @@ const reducer = combineReducers( { jetpackSettings, socialImageGeneratorSettings, shareStatus, - hasPaidPlan: ( state = false ) => state, } ); export default reducer; diff --git a/projects/js-packages/publicize-components/src/social-store/selectors/jetpack-settings.js b/projects/js-packages/publicize-components/src/social-store/selectors/jetpack-settings.js index 1eb9be3e6e729..09d99b3937a34 100644 --- a/projects/js-packages/publicize-components/src/social-store/selectors/jetpack-settings.js +++ b/projects/js-packages/publicize-components/src/social-store/selectors/jetpack-settings.js @@ -3,7 +3,6 @@ const jetpackSettingSelectors = { isModuleEnabled: state => state.jetpackSettings.publicize_active, showPricingPage: state => state.jetpackSettings.show_pricing_page, isUpdatingJetpackSettings: state => state.jetpackSettings.is_updating, - hasPaidPlan: state => ! ( state.jetpackSettings?.showNudge ?? true ), getDismissedNotices: state => state.jetpackSettings?.dismissedNotices, isSocialNotesEnabled: state => state.jetpackSettings?.social_notes_enabled, isSocialNotesSettingsUpdating: state => state.jetpackSettings?.social_notes_is_updating, diff --git a/projects/js-packages/publicize-components/src/social-store/types.ts b/projects/js-packages/publicize-components/src/social-store/types.ts index afe11754eb291..b0ed6db4cf0c7 100644 --- a/projects/js-packages/publicize-components/src/social-store/types.ts +++ b/projects/js-packages/publicize-components/src/social-store/types.ts @@ -67,8 +67,6 @@ export type ShareStatus = { // TODO we should have a consistent structure across all the pages - editor, dashboard, admin page etc. export type SocialStoreState = { connectionData: ConnectionData; - // on post editor - hasPaidPlan?: boolean; // on Jetack Social admin page jetpackSettings?: JetpackSettings; shareStatus?: ShareStatus; diff --git a/projects/js-packages/publicize-components/src/types/types.ts b/projects/js-packages/publicize-components/src/types/types.ts index 8264d46782842..041b0bd18f8f4 100644 --- a/projects/js-packages/publicize-components/src/types/types.ts +++ b/projects/js-packages/publicize-components/src/types/types.ts @@ -47,7 +47,6 @@ type JetpackSettingsSelectors = { isModuleEnabled: () => boolean; showPricingPage: () => boolean; isUpdatingJetpackSettings: () => boolean; - hasPaidPlan: () => boolean; }; type ConnectionDataSelectors = { diff --git a/projects/plugins/social/changelog/update-social-nuke-has-paid-plan b/projects/plugins/social/changelog/update-social-nuke-has-paid-plan new file mode 100644 index 0000000000000..59e08c72626b5 --- /dev/null +++ b/projects/plugins/social/changelog/update-social-nuke-has-paid-plan @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Initial state: Removed unused hasPaidPlan flag + + diff --git a/projects/plugins/social/src/js/components/admin-page/test/index.test.jsx b/projects/plugins/social/src/js/components/admin-page/test/index.test.jsx index fe6184c585049..e24423098cdb0 100644 --- a/projects/plugins/social/src/js/components/admin-page/test/index.test.jsx +++ b/projects/plugins/social/src/js/components/admin-page/test/index.test.jsx @@ -13,7 +13,6 @@ describe( 'load the app', () => { let storeSelect; renderHook( () => useSelect( select => ( storeSelect = select( SOCIAL_STORE_ID ) ) ) ); jest.spyOn( storeSelect, 'showPricingPage' ).mockReset().mockReturnValue( true ); - jest.spyOn( storeSelect, 'hasPaidPlan' ).mockReset().mockReturnValue( true ); jest.spyOn( storeSelect, 'getPluginVersion' ).mockReset().mockReturnValue( version ); render( ); expect( screen.getByText( `Jetpack Social ${ version }` ) ).toBeInTheDocument(); diff --git a/projects/plugins/social/src/js/components/types/types.ts b/projects/plugins/social/src/js/components/types/types.ts index bfc950e1d7677..a7047318cfcd5 100644 --- a/projects/plugins/social/src/js/components/types/types.ts +++ b/projects/plugins/social/src/js/components/types/types.ts @@ -7,7 +7,6 @@ type JetpackSettingsSelectors = { isModuleEnabled: () => boolean; showPricingPage: () => boolean; isUpdatingJetpackSettings: () => boolean; - hasPaidPlan: () => boolean; }; type ConnectionDataSelectors = { From 37925d995c63376465aa6c41282887662a93ba64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20M=C3=A1rk=20Juh=C3=A1sz?= <36671565+gmjuhasz@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:55:31 +0200 Subject: [PATCH 06/22] Social: Fix Bluesky profile name connection management (#39889) * Default to external_name if display is not available * changelog --- .../fix-social-bsky-profile-name-connection-management | 4 ++++ .../src/components/connection-management/connection-name.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 projects/js-packages/publicize-components/changelog/fix-social-bsky-profile-name-connection-management diff --git a/projects/js-packages/publicize-components/changelog/fix-social-bsky-profile-name-connection-management b/projects/js-packages/publicize-components/changelog/fix-social-bsky-profile-name-connection-management new file mode 100644 index 0000000000000..c33f654b62b79 --- /dev/null +++ b/projects/js-packages/publicize-components/changelog/fix-social-bsky-profile-name-connection-management @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fixed Bsky conneciton management profile name diff --git a/projects/js-packages/publicize-components/src/components/connection-management/connection-name.tsx b/projects/js-packages/publicize-components/src/components/connection-management/connection-name.tsx index 858d1c6bffebe..230366360cc2b 100644 --- a/projects/js-packages/publicize-components/src/components/connection-management/connection-name.tsx +++ b/projects/js-packages/publicize-components/src/components/connection-management/connection-name.tsx @@ -32,7 +32,7 @@ export function ConnectionName( { connection }: ConnectionNameProps ) { ) : ( - { connection.display_name || connection.external_display } + { connection.display_name || connection.external_display || connection.external_name } ) } { isUpdating ? ( From be3804c4e21ade1d97137b4a28ad200b18feee72 Mon Sep 17 00:00:00 2001 From: Karen Attfield Date: Thu, 24 Oct 2024 13:45:00 +0100 Subject: [PATCH 07/22] Hooks: Ensure translation loading is not triggered too early. (#39841) --- ...update-hooks-prevent-doing-it-wrong-notice | 4 + projects/packages/sync/src/class-actions.php | 2 +- ...update-hooks-prevent-doing-it-wrong-notice | 4 + .../videopress/src/class-admin-ui.php | 24 ++- projects/plugins/jetpack/.phan/baseline.php | 2 +- ...update-hooks-prevent-doing-it-wrong-notice | 4 + projects/plugins/jetpack/class.jetpack.php | 3 +- .../class-jetpack-contact-info-block.php | 120 ------------ .../blocks/contact-info/contact-info.php | 179 +++++++++++++++--- .../blocks/tiled-gallery/tiled-gallery.php | 2 +- .../php/general/test_jetpack-admin-menu.php | 19 +- 11 files changed, 190 insertions(+), 173 deletions(-) create mode 100644 projects/packages/sync/changelog/update-hooks-prevent-doing-it-wrong-notice create mode 100644 projects/packages/videopress/changelog/update-hooks-prevent-doing-it-wrong-notice create mode 100644 projects/plugins/jetpack/changelog/update-hooks-prevent-doing-it-wrong-notice delete mode 100644 projects/plugins/jetpack/extensions/blocks/contact-info/class-jetpack-contact-info-block.php diff --git a/projects/packages/sync/changelog/update-hooks-prevent-doing-it-wrong-notice b/projects/packages/sync/changelog/update-hooks-prevent-doing-it-wrong-notice new file mode 100644 index 0000000000000..f319fb6812720 --- /dev/null +++ b/projects/packages/sync/changelog/update-hooks-prevent-doing-it-wrong-notice @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Hooks: Hook init_sync_cron_jobs into init to ensure translation loading within the function is not triggered too early. diff --git a/projects/packages/sync/src/class-actions.php b/projects/packages/sync/src/class-actions.php index 2769030b4e68e..fb09385827392 100644 --- a/projects/packages/sync/src/class-actions.php +++ b/projects/packages/sync/src/class-actions.php @@ -116,7 +116,7 @@ public static function init() { } if ( self::sync_via_cron_allowed() ) { - self::init_sync_cron_jobs(); + add_action( 'init', array( __CLASS__, 'init_sync_cron_jobs' ), 1 ); } elseif ( wp_next_scheduled( 'jetpack_sync_cron' ) ) { self::clear_sync_cron_jobs(); } diff --git a/projects/packages/videopress/changelog/update-hooks-prevent-doing-it-wrong-notice b/projects/packages/videopress/changelog/update-hooks-prevent-doing-it-wrong-notice new file mode 100644 index 0000000000000..18dbc98c689ab --- /dev/null +++ b/projects/packages/videopress/changelog/update-hooks-prevent-doing-it-wrong-notice @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Admin: Changed initialization load order for menu items to prevent translation error. diff --git a/projects/packages/videopress/src/class-admin-ui.php b/projects/packages/videopress/src/class-admin-ui.php index ef5182a691076..e934b7cd4a4ba 100644 --- a/projects/packages/videopress/src/class-admin-ui.php +++ b/projects/packages/videopress/src/class-admin-ui.php @@ -34,6 +34,23 @@ class Admin_UI { * @return void */ public static function init() { + + add_action( 'admin_menu', array( __CLASS__, 'enable_menu' ) ); + + add_action( 'admin_footer-upload.php', array( __CLASS__, 'attachment_details_two_column_template' ) ); + add_action( 'admin_footer-post.php', array( __CLASS__, 'attachment_details_template' ), 20 ); + + add_filter( 'get_edit_post_link', array( __CLASS__, 'edit_video_link' ), 10, 3 ); + + add_action( 'admin_init', array( __CLASS__, 'remove_jetpack_hooks' ) ); + } + + /** + * Enable the menu, separately to init due to translations needing to run early for the page suffix. + * + * @return void + */ + public static function enable_menu() { $page_suffix = Admin_Menu::add_menu( __( 'Jetpack VideoPress', 'jetpack-videopress-pkg' ), _x( 'VideoPress', 'The Jetpack VideoPress product name, without the Jetpack prefix', 'jetpack-videopress-pkg' ), @@ -43,13 +60,6 @@ public static function init() { 3 ); add_action( 'load-' . $page_suffix, array( __CLASS__, 'admin_init' ) ); - - add_action( 'admin_footer-upload.php', array( __CLASS__, 'attachment_details_two_column_template' ) ); - add_action( 'admin_footer-post.php', array( __CLASS__, 'attachment_details_template' ), 20 ); - - add_filter( 'get_edit_post_link', array( __CLASS__, 'edit_video_link' ), 10, 3 ); - - add_action( 'admin_init', array( __CLASS__, 'remove_jetpack_hooks' ) ); } /** diff --git a/projects/plugins/jetpack/.phan/baseline.php b/projects/plugins/jetpack/.phan/baseline.php index 73b08dec3ed91..7120701294027 100644 --- a/projects/plugins/jetpack/.phan/baseline.php +++ b/projects/plugins/jetpack/.phan/baseline.php @@ -178,7 +178,7 @@ 'extensions/blocks/blog-stats/blog-stats.php' => ['PhanTypeMismatchReturnProbablyReal'], 'extensions/blocks/blogroll/blogroll-item/blogroll-item.php' => ['PhanPluginDuplicateConditionalNullCoalescing'], 'extensions/blocks/calendly/calendly.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchReturnProbablyReal'], - 'extensions/blocks/contact-info/class-jetpack-contact-info-block.php' => ['PhanTypeMismatchReturn'], + 'extensions/blocks/contact-info/contact-info.php' => ['PhanTypeMismatchReturn'], 'extensions/blocks/cookie-consent/cookie-consent.php' => ['PhanParamTooMany'], 'extensions/blocks/donations/donations.php' => ['PhanTypeMismatchArgument'], 'extensions/blocks/gif/gif.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanTypeMismatchReturnProbablyReal'], diff --git a/projects/plugins/jetpack/changelog/update-hooks-prevent-doing-it-wrong-notice b/projects/plugins/jetpack/changelog/update-hooks-prevent-doing-it-wrong-notice new file mode 100644 index 0000000000000..850d659cbcc69 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-hooks-prevent-doing-it-wrong-notice @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Hooks: Change several action priorities to ensure translation loading is not triggered too early. diff --git a/projects/plugins/jetpack/class.jetpack.php b/projects/plugins/jetpack/class.jetpack.php index 4f9a306cd26b9..dda2deb3cf61a 100644 --- a/projects/plugins/jetpack/class.jetpack.php +++ b/projects/plugins/jetpack/class.jetpack.php @@ -867,8 +867,7 @@ function ( $methods ) { * @action plugins_loaded */ public function late_initialization() { - add_action( 'plugins_loaded', array( 'Jetpack', 'load_modules' ), 100 ); - + add_action( 'after_setup_theme', array( 'Jetpack', 'load_modules' ), 1 ); My_Jetpack_Initializer::init(); // Initialize Boost Speed Score diff --git a/projects/plugins/jetpack/extensions/blocks/contact-info/class-jetpack-contact-info-block.php b/projects/plugins/jetpack/extensions/blocks/contact-info/class-jetpack-contact-info-block.php deleted file mode 100644 index 9c961dc8e2f2d..0000000000000 --- a/projects/plugins/jetpack/extensions/blocks/contact-info/class-jetpack-contact-info-block.php +++ /dev/null @@ -1,120 +0,0 @@ - $value ) { - if ( ! in_array( $attribute, $omit, true ) && ! empty( $value ) ) { - return true; - } - } - - return false; - } - - /** - * Adds email schema attributes. - * - * @param array $attr Array containing the email block attributes. - * @param string $content String containing the email block content. - * - * @return string - */ - public static function render_email( $attr, $content ) { - $content = self::has_attributes( $attr, array( 'className' ) ) ? - str_replace( 'href="mailto:', 'itemprop="email" href="mailto:', $content ) : - ''; - return $content; - } - - /** - * Adds phone schema attributes. Also wraps the tel link in a span so that - * it's recognized as a telephone number in Google's Structured Data. - * - * @param array $attr Array containing the phone block attributes. - * @param string $content String containing the phone block content. - * - * @return string - */ - public static function render_phone( $attr, $content ) { - if ( self::has_attributes( $attr, array( 'className' ) ) ) { - return str_replace( - array( ' $value ) { + if ( ! in_array( $attribute, $omit, true ) && ! empty( $value ) ) { + return true; + } + } + + return false; +} + +/** + * Adds email schema attributes. + * + * @param array $attr Array containing the email block attributes. + * @param string $content String containing the email block content. + * + * @return string + */ +function render_email( $attr, $content ) { + $content = has_attributes( $attr, array( 'className' ) ) ? + str_replace( 'href="mailto:', 'itemprop="email" href="mailto:', $content ) : + ''; + return $content; +} + +/** + * Adds phone schema attributes. Also wraps the tel link in a span so that + * it's recognized as a telephone number in Google's Structured Data. + * + * @param array $attr Array containing the phone block attributes. + * @param string $content String containing the phone block content. + * + * @return string + */ +function render_phone( $attr, $content ) { + if ( has_attributes( $attr, array( 'className' ) ) ) { + return str_replace( + array( ' Date: Thu, 24 Oct 2024 15:38:21 +0100 Subject: [PATCH 13/22] Contact Info: Rearranging how the Contact Info block register process is required. (#39892) --- projects/plugins/jetpack/.phan/baseline.php | 1 - .../update-contact-info-block-loading | 4 + .../class-jetpack-contact-info-block.php | 161 ++++++++++++++++++ .../blocks/contact-info/contact-info.php | 149 +--------------- 4 files changed, 168 insertions(+), 147 deletions(-) create mode 100644 projects/plugins/jetpack/changelog/update-contact-info-block-loading create mode 100644 projects/plugins/jetpack/extensions/blocks/contact-info/class-jetpack-contact-info-block.php diff --git a/projects/plugins/jetpack/.phan/baseline.php b/projects/plugins/jetpack/.phan/baseline.php index 7120701294027..b8589a544e1db 100644 --- a/projects/plugins/jetpack/.phan/baseline.php +++ b/projects/plugins/jetpack/.phan/baseline.php @@ -178,7 +178,6 @@ 'extensions/blocks/blog-stats/blog-stats.php' => ['PhanTypeMismatchReturnProbablyReal'], 'extensions/blocks/blogroll/blogroll-item/blogroll-item.php' => ['PhanPluginDuplicateConditionalNullCoalescing'], 'extensions/blocks/calendly/calendly.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchReturnProbablyReal'], - 'extensions/blocks/contact-info/contact-info.php' => ['PhanTypeMismatchReturn'], 'extensions/blocks/cookie-consent/cookie-consent.php' => ['PhanParamTooMany'], 'extensions/blocks/donations/donations.php' => ['PhanTypeMismatchArgument'], 'extensions/blocks/gif/gif.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanTypeMismatchReturnProbablyReal'], diff --git a/projects/plugins/jetpack/changelog/update-contact-info-block-loading b/projects/plugins/jetpack/changelog/update-contact-info-block-loading new file mode 100644 index 0000000000000..6c6e7cb31a30d --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-contact-info-block-loading @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Contact Info: Change block registration code - move back to two files. diff --git a/projects/plugins/jetpack/extensions/blocks/contact-info/class-jetpack-contact-info-block.php b/projects/plugins/jetpack/extensions/blocks/contact-info/class-jetpack-contact-info-block.php new file mode 100644 index 0000000000000..9ec393ac0b548 --- /dev/null +++ b/projects/plugins/jetpack/extensions/blocks/contact-info/class-jetpack-contact-info-block.php @@ -0,0 +1,161 @@ + __NAMESPACE__ . '\render', + ) + ); + + Blocks::jetpack_register_block( + 'jetpack/address', + array( + 'parent' => array( 'jetpack/contact-info' ), + 'render_callback' => __NAMESPACE__ . '\render_adress', + ) + ); + + Blocks::jetpack_register_block( + 'jetpack/email', + array( + 'parent' => array( 'jetpack/contact-info' ), + 'render_callback' => __NAMESPACE__ . '\render_email', + ) + ); + + Blocks::jetpack_register_block( + 'jetpack/phone', + array( + 'parent' => array( 'jetpack/contact-info' ), + 'render_callback' => __NAMESPACE__ . '\render_phone', + ) + ); + } + + /** + * Adds contact info schema attributes. + * + * @param array $attr Array containing the contact info block attributes. + * @param string $content String containing the contact info block content. + * + * @return string + */ + public static function render( $attr, $content ) { + Jetpack_Gutenberg::load_assets_as_required( __DIR__ ); + return str_replace( + 'class="wp-block-jetpack-contact-info', // Closing " intentionally ommited to that the user can also add the className as expected. + 'itemprop="location" itemscope itemtype="http://schema.org/Organization" class="wp-block-jetpack-contact-info', + $content + ); + } + + /** + * Adds address schema attributes. + * + * @param array $attr Array containing the address block attributes. + * @param string $content String containing the address block content. + * + * @return string + */ + public static function render_address( $attr, $content ) { + // Returns empty content if the only attribute set is linkToGoogleMaps. + if ( ! self::has_attributes( $attr, array( 'linkToGoogleMaps', 'className' ) ) ) { + return ''; + } + $find = array( + 'class="wp-block-jetpack-address"', + 'class="jetpack-address__address', + // Closing " left out on purpose - there are multiple address fields and they all need to be updated with the same itemprop. + 'class="jetpack-address__region"', + 'class="jetpack-address__city"', + 'class="jetpack-address__postal"', + 'class="jetpack-address__country"', + ); + $replace = array( + 'itemprop="address" itemscope itemtype="http://schema.org/PostalAddress" class="wp-block-jetpack-address" ', + 'itemprop="streetAddress" class="jetpack-address__address', // Closing " left out on purpose. + 'itemprop="addressRegion" class="jetpack-address__region"', + 'itemprop="addressLocality" class="jetpack-address__city"', + 'itemprop="postalCode" class="jetpack-address__postal"', + 'itemprop="addressCountry" class="jetpack-address__country"', + ); + + return str_replace( $find, $replace, $content ); + } + + /** + * Helper function that lets us determine if a block has any valid attributes. + * + * @param array $attr Array containing the block attributes. + * @param array $omit Array containing the block attributes that we ignore. + * + * @return bool + */ + public static function has_attributes( $attr, $omit = array() ) { + foreach ( $attr as $attribute => $value ) { + if ( ! in_array( $attribute, $omit, true ) && ! empty( $value ) ) { + return true; + } + } + + return false; + } + + /** + * Adds email schema attributes. + * + * @param array $attr Array containing the email block attributes. + * @param string $content String containing the email block content. + * + * @return string + */ + public static function render_email( $attr, $content ) { + $content = self::has_attributes( $attr, array( 'className' ) ) ? + str_replace( 'href="mailto:', 'itemprop="email" href="mailto:', $content ) : + ''; + return $content; + } + + /** + * Adds phone schema attributes. Also wraps the tel link in a span so that + * it's recognized as a telephone number in Google's Structured Data. + * + * @param array $attr Array containing the phone block attributes. + * @param string $content String containing the phone block content. + * + * @return string + */ + public static function render_phone( $attr, $content ) { + if ( self::has_attributes( $attr, array( 'className' ) ) ) { + return str_replace( + array( ' $value ) { - if ( ! in_array( $attribute, $omit, true ) && ! empty( $value ) ) { - return true; - } - } - - return false; -} - -/** - * Adds email schema attributes. - * - * @param array $attr Array containing the email block attributes. - * @param string $content String containing the email block content. - * - * @return string - */ -function render_email( $attr, $content ) { - $content = has_attributes( $attr, array( 'className' ) ) ? - str_replace( 'href="mailto:', 'itemprop="email" href="mailto:', $content ) : - ''; - return $content; -} - -/** - * Adds phone schema attributes. Also wraps the tel link in a span so that - * it's recognized as a telephone number in Google's Structured Data. - * - * @param array $attr Array containing the phone block attributes. - * @param string $content String containing the phone block content. - * - * @return string - */ -function render_phone( $attr, $content ) { - if ( has_attributes( $attr, array( 'className' ) ) ) { - return str_replace( - array( '; } diff --git a/projects/plugins/jetpack/_inc/client/state/connection/reducer.js b/projects/plugins/jetpack/_inc/client/state/connection/reducer.js index 3062aaff5c056..4550f2180f236 100644 --- a/projects/plugins/jetpack/_inc/client/state/connection/reducer.js +++ b/projects/plugins/jetpack/_inc/client/state/connection/reducer.js @@ -73,9 +73,10 @@ export const user = ( state = window.Initial_State.userData || {}, action ) => { case USER_CONNECTION_DATA_FETCH_SUCCESS: return assign( {}, state, action.userConnectionData ); - case UNLINK_USER_SUCCESS: + case UNLINK_USER_SUCCESS: { const currentUser = assign( {}, state.currentUser, { isConnected: false } ); return assign( {}, state, { currentUser } ); + } case MOCK_SWITCH_USER_PERMISSIONS: return merge( {}, state, action.initialState ); diff --git a/projects/plugins/jetpack/_inc/client/state/modules/reducer.js b/projects/plugins/jetpack/_inc/client/state/modules/reducer.js index 5599dc44292ba..70de9bc934250 100644 --- a/projects/plugins/jetpack/_inc/client/state/modules/reducer.js +++ b/projects/plugins/jetpack/_inc/client/state/modules/reducer.js @@ -31,7 +31,7 @@ export const items = ( state = {}, action ) => { return assign( {}, state, { [ action.module ]: assign( {}, state[ action.module ], { activated: false } ), } ); - case JETPACK_MODULE_UPDATE_OPTIONS_SUCCESS: + case JETPACK_MODULE_UPDATE_OPTIONS_SUCCESS: { const updatedModule = assign( {}, state[ action.module ] ); Object.keys( action.newOptionValues ).forEach( key => { updatedModule.options[ key ].current_value = action.newOptionValues[ key ]; @@ -39,6 +39,7 @@ export const items = ( state = {}, action ) => { return assign( {}, state, { [ action.module ]: updatedModule, } ); + } default: return state; } @@ -84,7 +85,7 @@ export const requests = ( state = initialRequestsState, action ) => { [ action.module ]: false, } ), } ); - case JETPACK_MODULE_UPDATE_OPTIONS: + case JETPACK_MODULE_UPDATE_OPTIONS: { const updatingOption = assign( {}, state.updatingOption ); updatingOption[ action.module ] = assign( {}, updatingOption[ action.module ] ); Object.keys( action.newOptionValues ).forEach( key => { @@ -93,8 +94,9 @@ export const requests = ( state = initialRequestsState, action ) => { return assign( {}, state, { updatingOption: assign( {}, state.updatingOption, updatingOption ), } ); + } case JETPACK_MODULE_UPDATE_OPTIONS_FAIL: - case JETPACK_MODULE_UPDATE_OPTIONS_SUCCESS: + case JETPACK_MODULE_UPDATE_OPTIONS_SUCCESS: { const _updatingOption = assign( {}, state.updatingOption ); _updatingOption[ action.module ] = assign( {}, _updatingOption[ action.module ] ); Object.keys( action.newOptionValues ).forEach( key => { @@ -103,6 +105,7 @@ export const requests = ( state = initialRequestsState, action ) => { return assign( {}, state, { updatingOption: assign( {}, state.updatingOption, _updatingOption ), } ); + } default: return state; } diff --git a/projects/plugins/jetpack/_inc/client/state/settings/reducer.js b/projects/plugins/jetpack/_inc/client/state/settings/reducer.js index bb6f2d05225f6..ed91a0c41fcf0 100644 --- a/projects/plugins/jetpack/_inc/client/state/settings/reducer.js +++ b/projects/plugins/jetpack/_inc/client/state/settings/reducer.js @@ -21,11 +21,12 @@ export const items = ( state = {}, action ) => { return assign( {}, state, action.initialState.settings ); case JETPACK_SETTINGS_FETCH_RECEIVE: return assign( {}, action.settings ); - case JETPACK_SETTING_UPDATE_SUCCESS: + case JETPACK_SETTING_UPDATE_SUCCESS: { const key = Object.keys( action.updatedOption )[ 0 ]; return assign( {}, state, { [ key ]: action.updatedOption[ key ], } ); + } case JETPACK_SETTINGS_UPDATE_SUCCESS: return assign( {}, state, action.updatedOptions ); default: diff --git a/projects/plugins/jetpack/_inc/client/writing/composing.jsx b/projects/plugins/jetpack/_inc/client/writing/composing.jsx index 90b5b46d5e535..955bc07d37f7d 100644 --- a/projects/plugins/jetpack/_inc/client/writing/composing.jsx +++ b/projects/plugins/jetpack/_inc/client/writing/composing.jsx @@ -21,7 +21,7 @@ export class Composing extends React.Component { * @return {*} the updated value */ updateFormStateByMarkdown = module => { - if ( !! this.props.getSettingCurrentValue( 'wpcom_publish_comments_with_markdown', module ) ) { + if ( this.props.getSettingCurrentValue( 'wpcom_publish_comments_with_markdown', module ) ) { return this.props.updateFormStateModuleOption( module, 'wpcom_publish_posts_with_markdown' ); } return this.props.updateFormStateModuleOption( diff --git a/projects/plugins/jetpack/_inc/jetpack-deactivate-dialog.js b/projects/plugins/jetpack/_inc/jetpack-deactivate-dialog.js index 294ffae1e3338..9c89b0bdba2cd 100644 --- a/projects/plugins/jetpack/_inc/jetpack-deactivate-dialog.js +++ b/projects/plugins/jetpack/_inc/jetpack-deactivate-dialog.js @@ -30,11 +30,12 @@ $( '#TB_window' ).addClass( 'jetpack-disconnect-modal' ); deactivationModalCentralize(); - $( '#TB_closeWindowButton, #TB_overlay' ).on( 'click', function ( e ) { + $( '#TB_closeWindowButton, #TB_overlay' ).on( 'click', function () { deactivationModalTrackCloseEvent(); } ); document.onkeyup = function ( e ) { + var keycode; if ( e === null ) { // ie keycode = event.keyCode; @@ -42,7 +43,7 @@ // mozilla keycode = e.which; } - if ( keycode == 27 ) { + if ( keycode === 27 ) { // close deactivationModalTrackCloseEvent(); } @@ -77,12 +78,12 @@ deactivateLinkElem.attr( 'title', deactivate_dialog.title ); deactivateLinkElem.addClass( 'thickbox' ); deactivateLinkElem.html( deactivate_dialog.deactivate_label ); - deactivateLinkElem.on( 'click', function ( e ) { + deactivateLinkElem.on( 'click', function () { observer.observe( body, { childList: true } ); analytics.tracks.recordEvent( 'jetpack_termination_dialog_open', tracksProps ); } ); - $( '#jetpack_deactivation_dialog_content__button-cancel' ).on( 'click', function ( e ) { + $( '#jetpack_deactivation_dialog_content__button-cancel' ).on( 'click', function () { tb_remove(); deactivationModalTrackCloseEvent(); } ); diff --git a/projects/plugins/jetpack/_inc/jetpack-modules.js b/projects/plugins/jetpack/_inc/jetpack-modules.js index 18c90b9e3ab81..dbb654d44ec66 100644 --- a/projects/plugins/jetpack/_inc/jetpack-modules.js +++ b/projects/plugins/jetpack/_inc/jetpack-modules.js @@ -1,19 +1,10 @@ ( function ( window, $, items, models, views, i18n, modalinfo, nonces ) { 'use strict'; - var modules, - list_table, - handle_module_tag_click, - $the_table, - $the_filters, - $the_search, - $jp_frame, - $bulk_button; - - $the_table = $( '.wp-list-table.jetpack-modules' ); + var modules, list_table, handle_module_tag_click, $the_filters, $the_search, $bulk_button; + $the_filters = $( '.navbar-form' ); $the_search = $( '#srch-term-search-input' ); - $jp_frame = $( '.jp-frame' ); $bulk_button = $( '#doaction' ); modules = new models.Modules( { diff --git a/projects/plugins/jetpack/changelog/fix-various-eslint-lints b/projects/plugins/jetpack/changelog/fix-various-eslint-lints new file mode 100644 index 0000000000000..85fe0d31b9f57 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-various-eslint-lints @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Fix various eslint lints. Should be no change to functionality, although it's possible some obscure React bugs got fixed. + + diff --git a/projects/plugins/jetpack/extensions/blocks/eventbrite/utils.js b/projects/plugins/jetpack/extensions/blocks/eventbrite/utils.js index 41c497f8cb9b8..71ddc4b55ad4e 100644 --- a/projects/plugins/jetpack/extensions/blocks/eventbrite/utils.js +++ b/projects/plugins/jetpack/extensions/blocks/eventbrite/utils.js @@ -24,7 +24,7 @@ export function eventIdFromUrl( url ) { return null; } - const match = url.match( /(\d+)\/?(?:\?[^\/]*)?\s*$/ ); + const match = url.match( /(\d+)\/?(?:\?[^/]*)?\s*$/ ); return match && match[ 1 ] ? parseInt( match[ 1 ], 10 ) : null; } diff --git a/projects/plugins/jetpack/extensions/blocks/image-compare/edit.js b/projects/plugins/jetpack/extensions/blocks/image-compare/edit.js index 8f564c170dd4c..82b90463813a2 100644 --- a/projects/plugins/jetpack/extensions/blocks/image-compare/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/image-compare/edit.js @@ -14,34 +14,30 @@ import './view.js'; const Edit = ( { attributes, clientId, isSelected, setAttributes } ) => { const { align, imageBefore, imageAfter, caption, orientation } = attributes; - // Check for useResizeObserver, not available in older Gutenberg. - let resizeListener = null; - let sizes = null; const blockProps = useBlockProps(); const juxtaposeRef = useRef( undefined ); - if ( useResizeObserver ) { - // Let's look for resize so we can trigger the thing. - [ resizeListener, sizes ] = useResizeObserver(); - useDebounce( - sz => { - if ( sz > 0 ) { - if ( typeof juxtapose !== 'undefined' && juxtapose.sliders ) { - // only update for *this* slide - juxtapose.sliders.forEach( elem => { - const parentElem = elem.wrapper.parentElement; - if ( parentElem.id === clientId ) { - elem.optimizeWrapper( sz ); - } - } ); - } + // Let's look for resize so we can trigger the thing. + const [ resizeListener, sizes ] = useResizeObserver(); + + useDebounce( + sz => { + if ( sz > 0 ) { + if ( typeof juxtapose !== 'undefined' && juxtapose.sliders ) { + // only update for *this* slide + juxtapose.sliders.forEach( elem => { + const parentElem = elem.wrapper.parentElement; + if ( parentElem.id === clientId ) { + elem.optimizeWrapper( sz ); + } + } ); } - }, - 200, - sizes.width - ); - } + } + }, + 200, + sizes.width + ); // Initial state if attributes already set or not. // If both images are set, add juxtapose class, which is picked up by the library. diff --git a/projects/plugins/jetpack/extensions/blocks/opentable/edit.js b/projects/plugins/jetpack/extensions/blocks/opentable/edit.js index 1ca50c37925c0..4ac453c675c73 100644 --- a/projects/plugins/jetpack/extensions/blocks/opentable/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/opentable/edit.js @@ -119,7 +119,7 @@ function OpenTableEdit( { // Need to force attribute to be updated after switch to using block styles // so it still meets frontend rendering expectations. setAttributes( { style } ); - }, [ style ] ); + }, [ align, style, prevStyle, setAttributes ] ); const parseEmbedCode = embedCode => { const newAttributes = getAttributesFromEmbedCode( embedCode ); diff --git a/projects/plugins/jetpack/extensions/blocks/opentable/restaurant-picker.js b/projects/plugins/jetpack/extensions/blocks/opentable/restaurant-picker.js index dd57dcce1c536..4d157ff17fcda 100644 --- a/projects/plugins/jetpack/extensions/blocks/opentable/restaurant-picker.js +++ b/projects/plugins/jetpack/extensions/blocks/opentable/restaurant-picker.js @@ -11,7 +11,7 @@ export default function RestaurantPicker( props ) { const { restaurants, hasRequestFailed } = useRestaurantSearch( input, MAX_SUGGESTIONS ); const [ selectedRestaurants, setSelectedRestaurants ] = useState( props.rids || [] ); - const idRegex = /^(\d+)$|\(\#(\d+)\)$/; + const idRegex = /^(\d+)$|\(#(\d+)\)$/; const onChange = selected => { const selectedIds = selected.map( restaurant => { diff --git a/projects/plugins/jetpack/extensions/blocks/opentable/use-restaurant-search.js b/projects/plugins/jetpack/extensions/blocks/opentable/use-restaurant-search.js index 38896d0765e44..9b1ff32638d1d 100644 --- a/projects/plugins/jetpack/extensions/blocks/opentable/use-restaurant-search.js +++ b/projects/plugins/jetpack/extensions/blocks/opentable/use-restaurant-search.js @@ -1,38 +1,42 @@ -import { useState, useEffect, useCallback } from '@wordpress/element'; +import { useState, useEffect, useCallback, useMemo } from '@wordpress/element'; import { unionBy, throttle, isEmpty } from 'lodash'; -export const possibleEmbed = /^\s*(http[s]?:\/\/|\ { - setHasRequestFailed( false ); + const searchRestaurants = useCallback( + ( input = '' ) => { + setHasRequestFailed( false ); - fetch( - 'https://www.opentable.com/widget/reservation/restaurant-search?pageSize=' + - maxResults + - '&query=' + - encodeURIComponent( input ) - ) - .then( result => result.json() ) - .then( restaurantResponse => { - setHasRequestFailed( false ); - setRestaurants( unionBy( restaurants, restaurantResponse.items, 'rid' ) ); - } ) - .catch( () => setHasRequestFailed( true ) ); - }; + fetch( + 'https://www.opentable.com/widget/reservation/restaurant-search?pageSize=' + + maxResults + + '&query=' + + encodeURIComponent( input ) + ) + .then( result => result.json() ) + .then( restaurantResponse => { + setHasRequestFailed( false ); + setRestaurants( unionBy( restaurants, restaurantResponse.items, 'rid' ) ); + } ) + .catch( () => setHasRequestFailed( true ) ); + }, + [ restaurants, maxResults ] + ); - const throttledSearchRestaurants = useCallback( throttle( searchRestaurants, 500 ), [ - restaurants, - ] ); + const throttledSearchRestaurants = useMemo( + () => throttle( searchRestaurants, 500 ), + [ searchRestaurants ] + ); useEffect( () => { if ( ! isEmpty( searchTerm ) && ! possibleEmbed.test( searchTerm ) ) { throttledSearchRestaurants( searchTerm ); } - }, [ searchTerm ] ); + }, [ searchTerm, throttledSearchRestaurants ] ); return { restaurants, hasRequestFailed }; } diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/edit.js b/projects/plugins/jetpack/extensions/blocks/subscriptions/edit.js index a80575a492478..73d732bf87bc0 100644 --- a/projects/plugins/jetpack/extensions/blocks/subscriptions/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/edit.js @@ -39,6 +39,7 @@ import SubscriptionSkeletonLoader from './subscription-skeleton-loader'; const { getComputedStyle } = window; const isGradientAvailable = !! useGradient; +const useGradientIfAvailable = isGradientAvailable ? useGradient : () => ( {} ); const name = metadata.name.replace( 'jetpack/', '' ); const applyFallbackStyles = withFallbackStyles( ( node, ownProps ) => { @@ -125,18 +126,14 @@ export function SubscriptionEdit( props ) { }; } ); - const emailFieldGradient = isGradientAvailable - ? useGradient( { - gradientAttribute: 'emailFieldGradient', - customGradientAttribute: 'customEmailFieldGradient', - } ) - : {}; - const buttonGradient = isGradientAvailable - ? useGradient( { - gradientAttribute: 'buttonGradient', - customGradientAttribute: 'customButtonGradient', - } ) - : {}; + const emailFieldGradient = useGradientIfAvailable( { + gradientAttribute: 'emailFieldGradient', + customGradientAttribute: 'customEmailFieldGradient', + } ); + const buttonGradient = useGradientIfAvailable( { + gradientAttribute: 'buttonGradient', + customGradientAttribute: 'customButtonGradient', + } ); const sharedClasses = { 'no-border-radius': borderRadius === 0, diff --git a/projects/plugins/jetpack/extensions/shared/components/block-styles-selector/index.js b/projects/plugins/jetpack/extensions/shared/components/block-styles-selector/index.js index 65d34b7dedd98..2de9e7a75a05e 100644 --- a/projects/plugins/jetpack/extensions/shared/components/block-styles-selector/index.js +++ b/projects/plugins/jetpack/extensions/shared/components/block-styles-selector/index.js @@ -51,13 +51,10 @@ export default function BlockStylesSelector( { viewportWidth, title, } ) { - let block; - if ( useSelect ) { - block = useSelect( select => { - const { getBlock } = select( 'core/block-editor' ); - return getBlock( clientId ); - } ); - } + const block = useSelect( select => { + const { getBlock } = select( 'core/block-editor' ); + return getBlock( clientId ); + } ); return ( <> @@ -105,8 +102,7 @@ export default function BlockStylesSelector( {
{ styleOption.preview ? styleOption.preview - : useSelect && - block && ( + : block && ( { - if ( undefined !== typeof window && window.location ) { + if ( window?.location ) { const queryParams = new URLSearchParams( window.location.search ); if ( queryParams.get( 'plan_upgraded' ) ) { diff --git a/projects/plugins/jetpack/modules/.eslintrc.js b/projects/plugins/jetpack/modules/.eslintrc.js index 25a20196d8d6e..ed838f1bb2eec 100644 --- a/projects/plugins/jetpack/modules/.eslintrc.js +++ b/projects/plugins/jetpack/modules/.eslintrc.js @@ -26,7 +26,7 @@ module.exports = { 'no-unused-vars': 'warn', 'no-useless-escape': 0, 'no-control-regex': 0, - 'no-unused-expressions': 'warn', + 'no-unused-expressions': [ 'warn', { allowShortCircuit: true, allowTernary: true } ], 'no-caller': 'error', 'no-cond-assign': [ 'error', 'except-parens' ], diff --git a/projects/plugins/jetpack/modules/infinite-scroll/infinity.js b/projects/plugins/jetpack/modules/infinite-scroll/infinity.js index e880c15bfc9c4..10ee02978bed9 100644 --- a/projects/plugins/jetpack/modules/infinite-scroll/infinity.js +++ b/projects/plugins/jetpack/modules/infinite-scroll/infinity.js @@ -2,17 +2,17 @@ ( function () { // Open closure. // Local vars. - var Scroller, ajaxurl, stats, type, text, totop, loading_text; + var Scroller, stats, type, text, totop, loading_text; // IE requires special handling - var isIE = -1 != navigator.userAgent.search( 'MSIE' ); + var isIE = -1 !== navigator.userAgent.search( 'MSIE' ); if ( isIE ) { var IEVersion = navigator.userAgent.match( /MSIE\s?(\d+)\.?\d*;/ ); IEVersion = parseInt( IEVersion[ 1 ] ); } // HTTP ajaxurl when site is HTTPS causes Access-Control-Allow-Origin failure in Desktop and iOS Safari - if ( 'https:' == document.location.protocol ) { + if ( 'https:' === document.location.protocol ) { infiniteScroll.settings.ajaxurl = infiniteScroll.settings.ajaxurl.replace( 'http://', 'https://' @@ -63,7 +63,7 @@ // We have two type of infinite scroll // cases 'scroll' and 'click' - if ( type == 'scroll' ) { + if ( type === 'scroll' ) { // Bind refresh to the scroll event // Throttle to check for such case every 300ms @@ -90,7 +90,7 @@ // Ensure that enough posts are loaded to fill the initial viewport, to compensate for short posts and large displays. self.ensureFilledViewport(); this.body.addEventListener( 'is.post-load', self.checkViewportOnLoadBound ); - } else if ( type == 'click' ) { + } else if ( type === 'click' ) { if ( this.click_handle ) { this.element.appendChild( this.handle ); } @@ -488,7 +488,7 @@ self.render.call( self, response ); // If 'click' type and there are still posts to fetch, add back the handle - if ( type == 'click' ) { + if ( type === 'click' ) { // add focus to new posts, only in button mode as we know where page focus currently is and only if we have a wrapper if ( infiniteScroll.settings.wrapper ) { document @@ -805,7 +805,7 @@ self.history.parameters; } - if ( window.location.href != pageSlug ) { + if ( window.location.href !== pageSlug ) { history.pushState( null, null, pageSlug ); } }; @@ -875,9 +875,6 @@ } } ); - // Set ajaxurl (for brevity) - ajaxurl = infiniteScroll.settings.ajaxurl; - // Set stats, used for tracking stats stats = infiniteScroll.settings.stats; @@ -895,7 +892,7 @@ /** * Monitor user scroll activity to update URL to correspond to archive page for current set of IS posts */ - if ( type == 'click' ) { + if ( type === 'click' ) { var timer = null; window.addEventListener( 'scroll', function () { // run the real scroll handler once every 250 ms. diff --git a/projects/plugins/jetpack/modules/plugin-search/plugin-search.js b/projects/plugins/jetpack/modules/plugin-search/plugin-search.js index a306b1e44cc85..87eda471adc1b 100644 --- a/projects/plugins/jetpack/modules/plugin-search/plugin-search.js +++ b/projects/plugins/jetpack/modules/plugin-search/plugin-search.js @@ -3,7 +3,7 @@ * of the card with customized content. */ -/* global jetpackPluginSearch, JSON, jpTracksAJAX */ +/* global jetpackPluginSearch, jpTracksAJAX */ var JetpackPSH = {}; diff --git a/projects/plugins/jetpack/modules/scan/admin-bar-notice.js b/projects/plugins/jetpack/modules/scan/admin-bar-notice.js index 4a226bc4d9309..1580169806a53 100644 --- a/projects/plugins/jetpack/modules/scan/admin-bar-notice.js +++ b/projects/plugins/jetpack/modules/scan/admin-bar-notice.js @@ -1,6 +1,6 @@ ( function ( localized ) { function ready( fn ) { - if ( document.readyState != 'loading' ) { + if ( document.readyState !== 'loading' ) { fn(); } else { document.addEventListener( 'DOMContentLoaded', fn ); @@ -11,7 +11,7 @@ var xhrRequest = new XMLHttpRequest(); xhrRequest.open( 'GET', localized.scan_endpoint, true ); xhrRequest.onload = function () { - if ( this.status == 200 ) { + if ( this.status === 200 ) { // Success! var body = JSON.parse( this.response ); if ( body && body.data ) { @@ -45,7 +45,7 @@ return; } - var textLabel = numberOfThreats == 1 ? localized.singular : localized.multiple; + var textLabel = numberOfThreats === 1 ? localized.singular : localized.multiple; element.innerHTML = '' + textLabel + ''; } diff --git a/projects/plugins/jetpack/modules/videopress/js/videopress-plupload.js b/projects/plugins/jetpack/modules/videopress/js/videopress-plupload.js index 1418b16c57ea1..4ccb5ddf50789 100644 --- a/projects/plugins/jetpack/modules/videopress/js/videopress-plupload.js +++ b/projects/plugins/jetpack/modules/videopress/js/videopress-plupload.js @@ -1,4 +1,4 @@ -/* global pluploadL10n, plupload, _wpPluploadSettings, JSON */ +/* global pluploadL10n, plupload, _wpPluploadSettings */ window.wp = window.wp || {}; diff --git a/projects/plugins/jetpack/modules/wpgroho.js b/projects/plugins/jetpack/modules/wpgroho.js index 33c79d5afc90f..ae683793d1e51 100644 --- a/projects/plugins/jetpack/modules/wpgroho.js +++ b/projects/plugins/jetpack/modules/wpgroho.js @@ -4,10 +4,14 @@ out = out || {}; for ( var i = 1; i < arguments.length; i++ ) { - if ( ! arguments[ i ] ) continue; + if ( ! arguments[ i ] ) { + continue; + } for ( var key in arguments[ i ] ) { - if ( Object.hasOwn( arguments[ i ], key ) ) out[ key ] = arguments[ i ][ key ]; + if ( Object.hasOwn( arguments[ i ], key ) ) { + out[ key ] = arguments[ i ][ key ]; + } } } diff --git a/tools/eslint-excludelist.json b/tools/eslint-excludelist.json index e89841313592a..fda4bf3612853 100644 --- a/tools/eslint-excludelist.json +++ b/tools/eslint-excludelist.json @@ -24,7 +24,6 @@ "projects/plugins/jetpack/_inc/client/mixins/emitter/index.js", "projects/plugins/jetpack/_inc/client/my-plan/index.jsx", "projects/plugins/jetpack/_inc/client/notices/index.js", - "projects/plugins/jetpack/_inc/client/pro-status/index.jsx", "projects/plugins/jetpack/_inc/client/state/connection/reducer.js", "projects/plugins/jetpack/_inc/client/state/dev-version/reducer.js", "projects/plugins/jetpack/_inc/client/state/disconnect-survey/reducer.js", @@ -47,30 +46,15 @@ "projects/plugins/jetpack/_inc/jetpack-deactivate-dialog.js", "projects/plugins/jetpack/_inc/jetpack-modules.js", "projects/plugins/jetpack/_inc/twitter-timeline.js", - "projects/plugins/jetpack/extensions/blocks/eventbrite/utils.js", - "projects/plugins/jetpack/extensions/blocks/image-compare/edit.js", "projects/plugins/jetpack/extensions/blocks/image-compare/use-debounce.js", - "projects/plugins/jetpack/extensions/blocks/opentable/edit.js", - "projects/plugins/jetpack/extensions/blocks/opentable/restaurant-picker.js", - "projects/plugins/jetpack/extensions/blocks/opentable/use-restaurant-search.js", "projects/plugins/jetpack/extensions/blocks/pinterest/utils.js", "projects/plugins/jetpack/extensions/blocks/podcast-player/utils.js", "projects/plugins/jetpack/extensions/blocks/slideshow/transforms.js", - "projects/plugins/jetpack/extensions/blocks/subscriptions/edit.js", "projects/plugins/jetpack/extensions/shared/block-styles.js", - "projects/plugins/jetpack/extensions/shared/components/block-styles-selector/index.js", "projects/plugins/jetpack/extensions/shared/currencies.js", - "projects/plugins/jetpack/extensions/shared/external-media/sources/google-photos/filter-request.js", "projects/plugins/jetpack/extensions/shared/get-validated-attributes.js", - "projects/plugins/jetpack/extensions/shared/plan-upgrade-notification.js", "projects/plugins/jetpack/modules/infinite-scroll/infinity-customizer.js", - "projects/plugins/jetpack/modules/infinite-scroll/infinity.js", - "projects/plugins/jetpack/modules/plugin-search/plugin-search.js", - "projects/plugins/jetpack/modules/scan/admin-bar-notice.js", "projects/plugins/jetpack/modules/videopress/js/gutenberg-video-upload.js", - "projects/plugins/jetpack/modules/videopress/js/videopress-plupload.js", "projects/plugins/jetpack/modules/widgets/customizer-utils.js", - "projects/plugins/jetpack/modules/widgets/milestone/admin.js", - "projects/plugins/jetpack/modules/widgets/simple-payments/customizer.js", - "projects/plugins/jetpack/modules/wpgroho.js" + "projects/plugins/jetpack/modules/widgets/simple-payments/customizer.js" ] From 7b79cd0faf13cdadc0490b23850479de32f6abab Mon Sep 17 00:00:00 2001 From: Mike Watson Date: Thu, 24 Oct 2024 12:30:42 -0400 Subject: [PATCH 15/22] AI Assistant: Write Brief should not flag words like '2nd' and '100th' as spelling errors. (#39880) * AI Assistant: Write Brief should not flag words like '2nd' and '100th' as spelling errors. * changelog * Typescript expects isNaN to be passed a number --- .../changelog/fix-write-brief-spellcheck-numbers | 4 ++++ .../breve/features/spelling-mistakes/index.ts | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 projects/plugins/jetpack/changelog/fix-write-brief-spellcheck-numbers diff --git a/projects/plugins/jetpack/changelog/fix-write-brief-spellcheck-numbers b/projects/plugins/jetpack/changelog/fix-write-brief-spellcheck-numbers new file mode 100644 index 0000000000000..28a48a83cba5d --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-write-brief-spellcheck-numbers @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +AI Assistant: Write Brief should not flag words like '2nd' and '100th' as spelling errors. diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/features/spelling-mistakes/index.ts b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/features/spelling-mistakes/index.ts index 44e5ac13094a2..78ce2847dcb0c 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/features/spelling-mistakes/index.ts +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/features/spelling-mistakes/index.ts @@ -185,9 +185,9 @@ export default function spellingMistakes( text: string ): Array< HighlightedText // \p{M} matches any Unicode mark (combining characters) // The regex has three main parts: // 1. [@#+$/]{0,1} - Optionally matches a single special character at the start - // 2. [\p{L}\p{M}'-]+ - Matches one or more letters, marks, apostrophes, or hyphens - // 3. (?:\/[\p{L}\p{M}'-]+)* - Optionally matches additional parts separated by slashes - const wordRegex = new RegExp( /[@#+$/]{0,1}[\p{L}\p{M}'-]+(?:\/[\p{L}\p{M}'-]+)*/gu ); + // 2. [\p{L}\p{M}\p{N}'-]+ - Matches one or more letters, marks, numbers, apostrophes, or hyphens + // 3. (?:\/[\p{L}\p{M}\p{N}'-]+)* - Optionally matches additional parts separated by slashes + const wordRegex = new RegExp( /[@#+$/]{0,1}[\p{L}\p{M}\p{N}'-]+(?:\/[\p{L}\p{M}\p{N}'-]+)*/gu ); const matches = Array.from( text.matchAll( wordRegex ) ); matches.forEach( match => { @@ -199,6 +199,11 @@ export default function spellingMistakes( text: string ): Array< HighlightedText return; } + // Skip anything that is a valid number + if ( ! isNaN( Number( word ) ) ) { + return; + } + // Split words by hyphens and slashes const subWords = word.split( /[-/]/ ); From e8c70af6d9b0484cf412f120a136ceb370e4e2fa Mon Sep 17 00:00:00 2001 From: Calypso Bot Date: Thu, 24 Oct 2024 18:48:12 +0200 Subject: [PATCH 16/22] Update dependency svgicons2svgfont to v14 (#39893) * Update dependency svgicons2svgfont to v14 * Update svg-to-font for new svgicons2svgfont version --------- Co-authored-by: Renovate Bot Co-authored-by: Brad Jorsch --- pnpm-lock.yaml | 117 ++++++++++++++---- .../changelog/renovate-svgicons2svgfont-14.x | 4 + .../js-packages/social-logos/package.json | 2 +- projects/js-packages/social-logos/tools/build | 2 +- .../tools/{svg-to-font.js => svg-to-font.mjs} | 26 ++-- 5 files changed, 111 insertions(+), 40 deletions(-) create mode 100644 projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x rename projects/js-packages/social-logos/tools/{svg-to-font.js => svg-to-font.mjs} (86%) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d20a403bb87c6..573fa8ff3aeff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1343,8 +1343,8 @@ importers: specifier: ^6.0.3 version: 6.0.3 svgicons2svgfont: - specifier: ^12.0.0 - version: 12.0.0 + specifier: ^14.0.0 + version: 14.0.2 svgo: specifier: ^3.3.2 version: 3.3.2 @@ -7461,6 +7461,9 @@ packages: '@types/retry@0.12.0': resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} + '@types/sax@1.2.7': + resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} + '@types/seed-random@2.2.4': resolution: {integrity: sha512-M4wSiHb23w6oRFo69SrjWiYMXocfhRyzX5kuGkAJmLrYJDD//8zmhsY+9t6t87RLYhyIcE4h3feYwqOFdaslHw==} @@ -10096,15 +10099,15 @@ packages: engines: {node: '>=16 || 14 >=14.18'} hasBin: true + glob@11.0.0: + resolution: {integrity: sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==} + engines: {node: 20 || >=22} + hasBin: true + glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported - glob@8.1.0: - resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} - engines: {node: '>=12'} - deprecated: Glob versions prior to v9 are no longer supported - global-modules@0.2.3: resolution: {integrity: sha512-JeXuCbvYzYXcwE6acL9V2bAOeSIGl4dD+iwLY9iUx2VBJJ80R18HCn+JCwHM9Oegdfya3lEkGCdaRkSyc10hDA==} engines: {node: '>=0.10.0'} @@ -10680,6 +10683,10 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jackspeak@4.0.2: + resolution: {integrity: sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==} + engines: {node: 20 || >=22} + jake@10.9.2: resolution: {integrity: sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==} engines: {node: '>=10'} @@ -11165,6 +11172,10 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lru-cache@11.0.1: + resolution: {integrity: sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==} + engines: {node: 20 || >=22} + lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} @@ -11423,6 +11434,10 @@ packages: peerDependencies: webpack: ^5.0.0 + minimatch@10.0.1: + resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==} + engines: {node: 20 || >=22} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -11731,6 +11746,9 @@ packages: resolution: {integrity: sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==} engines: {node: '>=8'} + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + param-case@3.0.4: resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} @@ -11815,6 +11833,10 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-scurry@2.0.0: + resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} + engines: {node: 20 || >=22} + path-to-regexp@0.1.10: resolution: {integrity: sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==} @@ -13315,17 +13337,17 @@ packages: svg-parser@2.0.4: resolution: {integrity: sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==} - svg-pathdata@6.0.3: - resolution: {integrity: sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==} - engines: {node: '>=12.0.0'} + svg-pathdata@7.1.0: + resolution: {integrity: sha512-wrvKHXZSYZyODOj5E1l1bMTIo8sR7YCH0E4SA8IgLgMsZq4RypslpYvNSsrdg4ThD6du2KWPyVeKinkqUelGhg==} + engines: {node: '>=20.11.1'} svg2ttf@6.0.3: resolution: {integrity: sha512-CgqMyZrbOPpc+WqH7aga4JWkDPso23EgypLsbQ6gN3uoPWwwiLjXvzgrwGADBExvCRJrWFzAeK1bSoSpE7ixSQ==} hasBin: true - svgicons2svgfont@12.0.0: - resolution: {integrity: sha512-fjyDkhiG0M1TPBtZzD12QV3yDcG2fUgiqHPOCYzf7hHE40Hl3GhnE6P1njsJCCByhwM7MiufyDW3L7IOR5dg9w==} - engines: {node: '>=16.15.0'} + svgicons2svgfont@14.0.2: + resolution: {integrity: sha512-NwbAbOMZvLN/3ycAnaDA8RRbovgtjoVqjW6bnGVaNHTG3dcnNLwRXGD/e11V37Tv48SlAjBTEWCNJRf+qdS1nA==} + engines: {node: '>=20.11.1'} hasBin: true svgo@3.3.2: @@ -13493,6 +13515,10 @@ packages: resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} engines: {node: '>=12'} + transformation-matrix-js@2.7.6: + resolution: {integrity: sha512-1CxDIZmCQ3vA0GGnkdMQqxUXVm3xXAFmglPYRS1hr37LzSg22TC7QAWOT38OmdUvMEs/rqcnkFoAsqvzdiluDg==} + deprecated: Package no longer supported. Contact support@npmjs.com for more info. + tree-kill@1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true @@ -14157,6 +14183,10 @@ packages: yauzl@2.10.0: resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} + yerror@8.0.0: + resolution: {integrity: sha512-FemWD5/UqNm8ffj8oZIbjWXIF2KE0mZssggYpdaQkWDDgXBQ/35PNIxEuz6/YLn9o0kOxDBNJe8x8k9ljD7k/g==} + engines: {node: '>=18.16.0'} + yjs@13.6.19: resolution: {integrity: sha512-GNKw4mEUn5yWU2QPHRx8jppxmCm9KzbBhB4qJLUJFiiYD0g/tDVgXQ7aPkyh01YO28kbs2J/BEbWBagjuWyejw==} engines: {node: '>=16.0.0', npm: '>=8.0.0'} @@ -17411,6 +17441,10 @@ snapshots: '@types/retry@0.12.0': {} + '@types/sax@1.2.7': + dependencies: + '@types/node': 20.16.10 + '@types/seed-random@2.2.4': {} '@types/semver@7.5.8': {} @@ -22003,6 +22037,15 @@ snapshots: minipass: 7.1.2 path-scurry: 1.11.1 + glob@11.0.0: + dependencies: + foreground-child: 3.3.0 + jackspeak: 4.0.2 + minimatch: 10.0.1 + minipass: 7.1.2 + package-json-from-dist: 1.0.1 + path-scurry: 2.0.0 + glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -22012,14 +22055,6 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 - glob@8.1.0: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 5.1.0 - once: 1.4.0 - global-modules@0.2.3: dependencies: global-prefix: 0.1.5 @@ -22607,6 +22642,10 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jackspeak@4.0.2: + dependencies: + '@isaacs/cliui': 8.0.2 + jake@10.9.2: dependencies: async: 3.2.6 @@ -23389,6 +23428,8 @@ snapshots: lru-cache@10.4.3: {} + lru-cache@11.0.1: {} + lru-cache@5.1.1: dependencies: yallist: 3.1.1 @@ -23817,6 +23858,10 @@ snapshots: tapable: 2.2.1 webpack: 5.94.0(webpack-cli@4.9.1) + minimatch@10.0.1: + dependencies: + brace-expansion: 2.0.1 + minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -24135,6 +24180,8 @@ snapshots: lodash.flattendeep: 4.4.0 release-zalgo: 1.0.0 + package-json-from-dist@1.0.1: {} + param-case@3.0.4: dependencies: dot-case: 3.0.4 @@ -24212,6 +24259,11 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 + path-scurry@2.0.0: + dependencies: + lru-cache: 11.0.1 + minipass: 7.1.2 + path-to-regexp@0.1.10: {} path-to-regexp@1.9.0: @@ -25848,7 +25900,9 @@ snapshots: svg-parser@2.0.4: {} - svg-pathdata@6.0.3: {} + svg-pathdata@7.1.0: + dependencies: + yerror: 8.0.0 svg2ttf@6.0.3: dependencies: @@ -25859,12 +25913,19 @@ snapshots: microbuffer: 1.0.0 svgpath: 2.6.0 - svgicons2svgfont@12.0.0: + svgicons2svgfont@14.0.2: dependencies: - commander: 9.3.0 - glob: 8.1.0 + '@types/sax': 1.2.7 + commander: 12.1.0 + debug: 4.3.7 + glob: 11.0.0 + punycode: 2.3.1 sax: 1.4.1 - svg-pathdata: 6.0.3 + svg-pathdata: 7.1.0 + transformation-matrix-js: 2.7.6 + yerror: 8.0.0 + transitivePeerDependencies: + - supports-color svgo@3.3.2: dependencies: @@ -26027,6 +26088,8 @@ snapshots: dependencies: punycode: 2.3.1 + transformation-matrix-js@2.7.6: {} + tree-kill@1.2.2: {} triple-beam@1.4.1: {} @@ -26783,6 +26846,8 @@ snapshots: buffer-crc32: 0.2.13 fd-slicer: 1.1.0 + yerror@8.0.0: {} + yjs@13.6.19: dependencies: lib0: 0.2.98 diff --git a/projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x b/projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/js-packages/social-logos/package.json b/projects/js-packages/social-logos/package.json index c8ed32af63311..862f576b7ace7 100644 --- a/projects/js-packages/social-logos/package.json +++ b/projects/js-packages/social-logos/package.json @@ -38,7 +38,7 @@ "@types/react-dom": "18.3.0", "glob": "10.4.1", "svg2ttf": "^6.0.3", - "svgicons2svgfont": "^12.0.0", + "svgicons2svgfont": "^14.0.0", "svgo": "^3.3.2", "svgstore": "^3.0.1", "typescript": "5.0.4", diff --git a/projects/js-packages/social-logos/tools/build b/projects/js-packages/social-logos/tools/build index 33c3adcdac5ca..eee9aed604e9d 100755 --- a/projects/js-packages/social-logos/tools/build +++ b/projects/js-packages/social-logos/tools/build @@ -20,7 +20,7 @@ if ./tools/clean && # Disabling this for now until we figure out the proper place for it. # ./tools/svg-to-php && ./tools/svg-to-sprite.js && -./tools/svg-to-font.js && +./tools/svg-to-font.mjs && ./tools/svg-to-react-data.js && ./tools/build-react; then echo 'Build complete.' diff --git a/projects/js-packages/social-logos/tools/svg-to-font.js b/projects/js-packages/social-logos/tools/svg-to-font.mjs similarity index 86% rename from projects/js-packages/social-logos/tools/svg-to-font.js rename to projects/js-packages/social-logos/tools/svg-to-font.mjs index 8e6dee559bad0..ca95004e5f640 100755 --- a/projects/js-packages/social-logos/tools/svg-to-font.js +++ b/projects/js-packages/social-logos/tools/svg-to-font.mjs @@ -1,4 +1,15 @@ #!/usr/bin/env node + +import { spawnSync } from 'child_process'; +import fs from 'fs'; +import path from 'path'; +import process from 'process'; +import { fileURLToPath } from 'url'; +import { glob } from 'glob'; +import svg2ttf from 'svg2ttf'; +import { SVGIcons2SVGFontStream } from 'svgicons2svgfont'; +import wawoff2 from 'wawoff2'; + /* eslint-disable no-console */ const svgDir = 'build/svg-clean'; const srcSvgDir = 'src/svg'; @@ -7,17 +18,8 @@ const destFontDir = 'build/font'; const cssFile = destFontDir + '/social-logos.css'; const woff2FontFile = destFontDir + '/social-logos.woff2'; -const { spawnSync } = require( 'child_process' ); -const fs = require( 'fs' ); -const path = require( 'path' ); -const process = require( 'process' ); -const { glob } = require( 'glob' ); -const svg2ttf = require( 'svg2ttf' ); -const SVGIcons2SVGFontStream = require( 'svgicons2svgfont' ); -const wawoff2 = require( 'wawoff2' ); - // Start in the right folder. -const rootDir = __dirname + '/..'; +const rootDir = fileURLToPath( new URL( '..', import.meta.url ) ); process.chdir( rootDir ); const getCodepoint = name => { @@ -93,7 +95,7 @@ ${ cssCodepoints }*/`; // Make destination dir as needed. fs.mkdirSync( destFontDir, { recursive: true } ); -const codepoints = require( path.resolve( codepointsFile ) ); +const codepoints = JSON.parse( fs.readFileSync( path.resolve( codepointsFile ) ) ); let maxCodepoint = Math.max( ...Object.values( codepoints ) ); let fontBuffer = Buffer.alloc( 0 ); @@ -109,7 +111,7 @@ const fontStream = new SVGIcons2SVGFontStream( { fontStream .on( 'data', data => { // This concats to the font buffer each time a glyph is written. - fontBuffer = Buffer.concat( [ fontBuffer, data ] ); + fontBuffer = Buffer.concat( [ fontBuffer, Buffer.from( data ) ] ); } ) .on( 'finish', async function () { const woff2Buffer = await svg2woff2( fontBuffer ); From 4372e5d7202012856e6e4a67268f19e0d9858daa Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Thu, 24 Oct 2024 13:08:30 -0400 Subject: [PATCH 17/22] Verbum Comments: Fix iframe resize logic (#39791) * Add changes to fix Verbum comments resize logic * changelog --- .../fix-verbum-comments-resize-logic | 4 +++ .../verbum-comments/class-verbum-comments.php | 2 ++ .../fix-verbum-comments-resize-logic | 4 +++ .../jetpack/modules/comments/comments.php | 25 ++++++++++++++++--- 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/fix-verbum-comments-resize-logic create mode 100644 projects/plugins/jetpack/changelog/fix-verbum-comments-resize-logic diff --git a/projects/packages/jetpack-mu-wpcom/changelog/fix-verbum-comments-resize-logic b/projects/packages/jetpack-mu-wpcom/changelog/fix-verbum-comments-resize-logic new file mode 100644 index 0000000000000..1ddd3df5cd6c6 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/fix-verbum-comments-resize-logic @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Update Verbum Comments resize logic diff --git a/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/class-verbum-comments.php b/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/class-verbum-comments.php index b7f9a707def63..397838493877c 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/class-verbum-comments.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/verbum-comments/class-verbum-comments.php @@ -175,6 +175,7 @@ public function enqueue_assets() { $jetpack_username = isset( $__get['hc_username'] ) && is_string( $__get['hc_username'] ) ? $__get['hc_username'] : ''; $jetpack_user_id = isset( $__get['hc_userid'] ) && is_numeric( $__get['hc_userid'] ) ? (int) $__get['hc_userid'] : 0; $jetpack_signature = isset( $__get['sig'] ) && is_string( $__get['sig'] ) ? $__get['sig'] : ''; + $iframe_unique_id = isset( $__get['iframe_unique_id'] ) && is_numeric( $__get['iframe_unique_id'] ) ? (int) $__get['iframe_unique_id'] : 0; list( $jetpack_avatar ) = wpcom_get_avatar_url( "$email_hash@md5.gravatar.com" ); $comment_registration_enabled = boolval( get_blog_option( $this->blog_id, 'comment_registration' ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended @@ -255,6 +256,7 @@ public function enqueue_assets() { 'verbumBundleUrl' => plugins_url( 'dist/index.js', __FILE__ ), 'isRTL' => is_rtl( $locale ), 'vbeCacheBuster' => $vbe_cache_buster, + 'iframeUniqueId' => $iframe_unique_id, ) ), 'before' diff --git a/projects/plugins/jetpack/changelog/fix-verbum-comments-resize-logic b/projects/plugins/jetpack/changelog/fix-verbum-comments-resize-logic new file mode 100644 index 0000000000000..a6a79b1897ec6 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-verbum-comments-resize-logic @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Update Verbum Comments resize logic diff --git a/projects/plugins/jetpack/modules/comments/comments.php b/projects/plugins/jetpack/modules/comments/comments.php index f7cd5fac70061..5378eb8c80ae5 100644 --- a/projects/plugins/jetpack/modules/comments/comments.php +++ b/projects/plugins/jetpack/modules/comments/comments.php @@ -394,6 +394,7 @@ public function comment_form_after() { 'color_scheme' => get_option( 'jetpack_comment_form_color_scheme', $this->default_color_scheme ), 'lang' => get_locale(), 'jetpack_version' => JETPACK__VERSION, + 'iframe_unique_id' => wp_unique_id(), ); // Extra parameters for logged in user. @@ -594,12 +595,30 @@ function tellFrameNewParent ( commentParentValue ) { document.querySelector('#comment-reply-js')?.addEventListener( 'load', watchReply ); + + const commentIframes = document.getElementsByClassName('jetpack_remote_comment'); - window.addEventListener( 'message', function ( event ) { - if ( event.origin !== 'https://jetpack.wordpress.com' ) { + window.addEventListener('message', function(event) { + if (event.origin !== 'https://jetpack.wordpress.com') { return; } - iframe.style.height = event.data + 'px'; + + if (!event?.data?.iframeUniqueId && !event?.data?.height) { + return; + } + + const eventDataUniqueId = event.data.iframeUniqueId; + + // Change height for the matching comment iframe + for (let i = 0; i < commentIframes.length; i++) { + const iframe = commentIframes[i]; + const url = new URL(iframe.src); + const iframeUniqueIdParam = url.searchParams.get('iframe_unique_id'); + if (iframeUniqueIdParam == event.data.iframeUniqueId) { + iframe.style.height = event.data.height + 'px'; + return; + } + } }); })(); From c2b7dc0bb3122f16779379f46c95212b25cc2098 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Thu, 24 Oct 2024 15:57:09 -0400 Subject: [PATCH 18/22] Add `<9.12.0` to `.engines.pnpm` (#39897) We're waiting on updating to pnpm 9.12+ due to the regression of pnpm/pnpm#3935. Update `.engines.pnpm` so Renovate stops trying to use 9.12 and then failing the "Lock files are up to date" check. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c45b68de818b3..61aea19924cbf 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,6 @@ }, "engines": { "node": "^22.9.0", - "pnpm": "^9.3.0" + "pnpm": "^9.3.0 <9.12.0" } } From 48f074e41b6f7ef342dc1aada25bfa3041e8b402 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Fri, 25 Oct 2024 01:52:54 -0700 Subject: [PATCH 19/22] Initial State: Replace `isSocialImageGeneratorAvailable` with feature check (#39836) * Initial State: Replace isSocialImageGeneratorAvailable with feature check * Use constants instead of strings --- .../changelog/update-social-sig-feature-check | 5 +++ .../js-packages/publicize-components/index.ts | 1 + .../src/hooks/use-post-can-use-sig/index.ts | 21 ++++++++++ .../src/hooks/use-publicize-config/index.js | 9 ----- .../social-image-generator-settings.js | 1 - .../publicize-components/src/types/types.ts | 1 - .../src/utils/constants.ts | 1 + .../publicize-components/src/utils/index.js | 1 + .../changelog/update-social-sig-feature-check | 5 +++ .../extensions/plugins/publicize/index.js | 8 ++-- .../plugins/publicize/pre-publish.js | 6 ++- .../changelog/update-social-sig-feature-check | 5 +++ .../src/js/components/admin-page/index.jsx | 39 ++++++++++--------- .../social/src/js/components/types/types.ts | 1 - projects/plugins/social/src/js/editor.js | 10 +++-- 15 files changed, 73 insertions(+), 41 deletions(-) create mode 100644 projects/js-packages/publicize-components/changelog/update-social-sig-feature-check create mode 100644 projects/js-packages/publicize-components/src/hooks/use-post-can-use-sig/index.ts create mode 100644 projects/plugins/jetpack/changelog/update-social-sig-feature-check create mode 100644 projects/plugins/social/changelog/update-social-sig-feature-check diff --git a/projects/js-packages/publicize-components/changelog/update-social-sig-feature-check b/projects/js-packages/publicize-components/changelog/update-social-sig-feature-check new file mode 100644 index 0000000000000..96580bab97529 --- /dev/null +++ b/projects/js-packages/publicize-components/changelog/update-social-sig-feature-check @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Initial state: Migrated isSocialImageGeneratorAvailable to feature check + + diff --git a/projects/js-packages/publicize-components/index.ts b/projects/js-packages/publicize-components/index.ts index 36f1fab810ff0..f10e54078ec65 100644 --- a/projects/js-packages/publicize-components/index.ts +++ b/projects/js-packages/publicize-components/index.ts @@ -32,6 +32,7 @@ export * from './src/components/share-post'; export * from './src/hooks/use-sync-post-data-to-store'; export * from './src/hooks/use-saving-post'; export * from './src/hooks/use-post-meta'; +export * from './src/hooks/use-post-can-use-sig'; export * from './src/components/share-buttons'; export * from './src/components/manage-connections-modal'; export * from './src/utils/script-data'; diff --git a/projects/js-packages/publicize-components/src/hooks/use-post-can-use-sig/index.ts b/projects/js-packages/publicize-components/src/hooks/use-post-can-use-sig/index.ts new file mode 100644 index 0000000000000..5602ca0709d00 --- /dev/null +++ b/projects/js-packages/publicize-components/src/hooks/use-post-can-use-sig/index.ts @@ -0,0 +1,21 @@ +import { siteHasFeature } from '@automattic/jetpack-script-data'; +import { useSelect } from '@wordpress/data'; +import { store as editorStore } from '@wordpress/editor'; +import { features } from '../../utils/constants'; + +/** + * When a post can use the Social Image Generator (SIG). + * + * @return {boolean} Whether the post can use the Social Image Generator. + */ +export function usePostCanUseSig() { + const isJetpackSocialNote = useSelect( select => { + const currentPostType = select( editorStore ) + // @ts-expect-error -- `@wordpress/editor` is a nightmare to work with TypeScript - getCurrentPostType exists on the editor store + .getCurrentPostType(); + + return 'jetpack-social-note' === currentPostType; + }, [] ); + + return ! isJetpackSocialNote && siteHasFeature( features.IMAGE_GENERATOR ); +} diff --git a/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js b/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js index e7827d27afd78..d55353f871995 100644 --- a/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js +++ b/projects/js-packages/publicize-components/src/hooks/use-publicize-config/index.js @@ -25,7 +25,6 @@ export default function usePublicizeConfig() { const isRePublicizeFeatureAvailable = isJetpackSite || getJetpackExtensionAvailability( republicizeFeatureName )?.available; const isPostPublished = useSelect( select => select( editorStore ).isCurrentPostPublished(), [] ); - const currentPostType = useSelect( select => select( editorStore ).getCurrentPostType(), [] ); const { isUserConnected } = useConnection(); const { urls } = getSocialScriptData(); @@ -80,11 +79,6 @@ export default function usePublicizeConfig() { */ const hidePublicizeFeature = isPostPublished && ! isRePublicizeFeatureAvailable; - /**\ - * Returns true if the post type is a Jetpack Social Note. - */ - const isJetpackSocialNote = 'jetpack-social-note' === currentPostType; - const needsUserConnection = ! isUserConnected && ! isSimpleSite(); return { @@ -96,11 +90,8 @@ export default function usePublicizeConfig() { isRePublicizeUpgradableViaUpsell, hidePublicizeFeature, isPostAlreadyShared, - isSocialImageGeneratorAvailable: - !! getJetpackData()?.social?.isSocialImageGeneratorAvailable && ! isJetpackSocialNote, isSocialImageGeneratorEnabled: !! getJetpackData()?.social?.isSocialImageGeneratorEnabled, connectionsPageUrl: urls.connectionsManagementPage, - isJetpackSocialNote, needsUserConnection, }; } diff --git a/projects/js-packages/publicize-components/src/social-store/selectors/social-image-generator-settings.js b/projects/js-packages/publicize-components/src/social-store/selectors/social-image-generator-settings.js index 25cf39b9dedd8..c7ea88783996c 100644 --- a/projects/js-packages/publicize-components/src/social-store/selectors/social-image-generator-settings.js +++ b/projects/js-packages/publicize-components/src/social-store/selectors/social-image-generator-settings.js @@ -1,6 +1,5 @@ const socialImageGeneratorSettingsSelectors = { getSocialImageGeneratorSettings: state => state.socialImageGeneratorSettings, - isSocialImageGeneratorAvailable: state => state.socialImageGeneratorSettings.available, isSocialImageGeneratorEnabled: state => state.socialImageGeneratorSettings.enabled, isUpdatingSocialImageGeneratorSettings: state => state.socialImageGeneratorSettings.isUpdating, getSocialImageGeneratorDefaultTemplate: state => state.socialImageGeneratorSettings.template, diff --git a/projects/js-packages/publicize-components/src/types/types.ts b/projects/js-packages/publicize-components/src/types/types.ts index 041b0bd18f8f4..667f33f90a64d 100644 --- a/projects/js-packages/publicize-components/src/types/types.ts +++ b/projects/js-packages/publicize-components/src/types/types.ts @@ -67,7 +67,6 @@ type SocialImageGeneratorSettingsSelectors = { template: string; }; }; - isSocialImageGeneratorAvailable: () => boolean; isSocialImageGeneratorEnabled: () => boolean; isUpdatingSocialImageGeneratorSettings: () => boolean; getSocialImageGeneratorDefaultTemplate: () => string; diff --git a/projects/js-packages/publicize-components/src/utils/constants.ts b/projects/js-packages/publicize-components/src/utils/constants.ts index 9ac40038d75b8..49cedf5633358 100644 --- a/projects/js-packages/publicize-components/src/utils/constants.ts +++ b/projects/js-packages/publicize-components/src/utils/constants.ts @@ -1,3 +1,4 @@ export const features = { ENHANCED_PUBLISHING: 'social-enhanced-publishing', + IMAGE_GENERATOR: 'social-image-generator', }; diff --git a/projects/js-packages/publicize-components/src/utils/index.js b/projects/js-packages/publicize-components/src/utils/index.js index 6e0284f7b9870..bfc461305ff8a 100644 --- a/projects/js-packages/publicize-components/src/utils/index.js +++ b/projects/js-packages/publicize-components/src/utils/index.js @@ -3,3 +3,4 @@ export * from './get-supported-additional-connections'; export * from './request-external-access'; export * from './types'; export * from './script-data'; +export * from './constants'; diff --git a/projects/plugins/jetpack/changelog/update-social-sig-feature-check b/projects/plugins/jetpack/changelog/update-social-sig-feature-check new file mode 100644 index 0000000000000..82aa474998f99 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-social-sig-feature-check @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Initial state: Migrated isSocialImageGeneratorAvailable to feature check + + diff --git a/projects/plugins/jetpack/extensions/plugins/publicize/index.js b/projects/plugins/jetpack/extensions/plugins/publicize/index.js index 0a73e5629f843..5d705f0638dd2 100644 --- a/projects/plugins/jetpack/extensions/plugins/publicize/index.js +++ b/projects/plugins/jetpack/extensions/plugins/publicize/index.js @@ -10,7 +10,7 @@ import { PublicizePanel, SocialImageGeneratorPanel, - usePublicizeConfig, + usePostCanUseSig, PostPublishPanels, GlobalModals, } from '@automattic/jetpack-publicize-components'; @@ -29,7 +29,7 @@ export const name = 'publicize'; const PublicizeSettings = () => { const { isLoadingModules, isChangingStatus, isModuleActive, changeStatus } = useModuleStatus( name ); - const { isSocialImageGeneratorAvailable } = usePublicizeConfig(); + const postCanUseSig = usePostCanUseSig(); let children = null; let panels = null; @@ -50,12 +50,12 @@ const PublicizeSettings = () => { - { isSocialImageGeneratorAvailable && } + { postCanUseSig && } ); panels = ( <> - + diff --git a/projects/plugins/jetpack/extensions/plugins/publicize/pre-publish.js b/projects/plugins/jetpack/extensions/plugins/publicize/pre-publish.js index e0ba6ac7cbeb2..559c9edff032d 100644 --- a/projects/plugins/jetpack/extensions/plugins/publicize/pre-publish.js +++ b/projects/plugins/jetpack/extensions/plugins/publicize/pre-publish.js @@ -3,16 +3,18 @@ import { SocialImageGeneratorPanel, useSyncPostDataToStore, useSocialMediaConnections, + usePostCanUseSig, } from '@automattic/jetpack-publicize-components'; import { JetpackEditorPanelLogo } from '@automattic/jetpack-shared-extension-utils'; import { PluginPrePublishPanel } from '@wordpress/edit-post'; import { __ } from '@wordpress/i18n'; import UpsellNotice from './components/upsell'; -const PrePublishPanels = ( { isSocialImageGeneratorAvailable } ) => { +const PrePublishPanels = () => { useSyncPostDataToStore(); const { hasEnabledConnections } = useSocialMediaConnections(); + const postCanUseSig = usePostCanUseSig(); return ( <> @@ -31,7 +33,7 @@ const PrePublishPanels = ( { isSocialImageGeneratorAvailable } ) => { - { isSocialImageGeneratorAvailable && ( + { postCanUseSig && ( { const onPricingPageDismiss = useCallback( () => setForceDisplayPricingPage( false ), [] ); - const { - isModuleEnabled, - showPricingPage, - pluginVersion, - isSocialImageGeneratorAvailable, - isUpdatingJetpackSettings, - } = useSelect( select => { - const store = select( socialStore ); - return { - isModuleEnabled: store.isModuleEnabled(), - showPricingPage: store.showPricingPage(), - pluginVersion: store.getPluginVersion(), - isSocialImageGeneratorAvailable: store.isSocialImageGeneratorAvailable(), - isUpdatingJetpackSettings: store.isUpdatingJetpackSettings(), - }; - } ); + const { isModuleEnabled, showPricingPage, pluginVersion, isUpdatingJetpackSettings } = useSelect( + select => { + const store = select( socialStore ); + return { + isModuleEnabled: store.isModuleEnabled(), + showPricingPage: store.showPricingPage(), + pluginVersion: store.getPluginVersion(), + isUpdatingJetpackSettings: store.isUpdatingJetpackSettings(), + }; + } + ); const hasEnabledModule = useRef( isModuleEnabled ); useEffect( () => { - if ( isModuleEnabled && ! hasEnabledModule.current && isSocialImageGeneratorAvailable ) { + if ( + isModuleEnabled && + ! hasEnabledModule.current && + siteHasFeature( features.IMAGE_GENERATOR ) + ) { hasEnabledModule.current = true; refreshJetpackSocialSettings(); } - }, [ isModuleEnabled, isSocialImageGeneratorAvailable, refreshJetpackSocialSettings ] ); + }, [ isModuleEnabled, refreshJetpackSocialSettings ] ); const moduleName = `Jetpack Social ${ pluginVersion }`; @@ -93,7 +94,7 @@ const Admin = () => { { isModuleEnabled && } - { isModuleEnabled && isSocialImageGeneratorAvailable && ( + { isModuleEnabled && siteHasFeature( features.IMAGE_GENERATOR ) && ( ) } diff --git a/projects/plugins/social/src/js/components/types/types.ts b/projects/plugins/social/src/js/components/types/types.ts index a7047318cfcd5..bd349bbd106f3 100644 --- a/projects/plugins/social/src/js/components/types/types.ts +++ b/projects/plugins/social/src/js/components/types/types.ts @@ -29,7 +29,6 @@ type SocialImageGeneratorSettingsSelectors = { template: string; }; }; - isSocialImageGeneratorAvailable: () => boolean; isSocialImageGeneratorEnabled: () => boolean; isUpdatingSocialImageGeneratorSettings: () => boolean; getSocialImageGeneratorDefaultTemplate: () => string; diff --git a/projects/plugins/social/src/js/editor.js b/projects/plugins/social/src/js/editor.js index 2966d8d49ae34..ed12f1e5c4f18 100644 --- a/projects/plugins/social/src/js/editor.js +++ b/projects/plugins/social/src/js/editor.js @@ -9,6 +9,7 @@ import { useSyncPostDataToStore, PostPublishPanels, GlobalModals, + usePostCanUseSig, } from '@automattic/jetpack-publicize-components'; import { JetpackEditorPanelLogo } from '@automattic/jetpack-shared-extension-utils'; import { PanelBody } from '@wordpress/components'; @@ -51,8 +52,9 @@ const JetpackSocialSidebar = () => { const closeModal = useCallback( () => setIsModalOpened( false ), [] ); const { hasConnections, hasEnabledConnections } = useSocialMediaConnections(); - const { isPublicizeEnabled, hidePublicizeFeature, isSocialImageGeneratorAvailable } = - usePublicizeConfig(); + const { isPublicizeEnabled, hidePublicizeFeature } = usePublicizeConfig(); + const postCanUseSig = usePostCanUseSig(); + const isPostPublished = useSelect( select => select( editorStore ).isCurrentPostPublished(), [] ); const PanelDescription = () => ( { - { isSocialImageGeneratorAvailable && } + { postCanUseSig && } @@ -95,7 +97,7 @@ const JetpackSocialSidebar = () => { - { isSocialImageGeneratorAvailable && ( + { postCanUseSig && ( Date: Fri, 25 Oct 2024 13:38:51 +0200 Subject: [PATCH 20/22] Changelog and readme.txt edits. (#39903) --- .../js-packages/publicize-components/CHANGELOG.md | 10 ++++++++++ ...cial-bluesky-custom-domain-handles-not-working | 4 ---- ...al-bluesky-reconnection-for-broken-connections | 4 ---- ...social-bsky-profile-name-connection-management | 4 ---- .../update-enhances-publishing-feature-check | 4 ---- .../changelog/update-social-nuke-has-paid-plan | 5 ----- .../update-social-replace-has-paid-features-check | 5 ----- .../changelog/update-social-sig-feature-check | 5 ----- .../js-packages/publicize-components/package.json | 2 +- projects/js-packages/social-logos/CHANGELOG.md | 5 +++++ .../changelog/renovate-svgicons2svgfont-14.x | 4 ---- projects/js-packages/social-logos/package.json | 2 +- projects/packages/changelogger/CHANGELOG.md | 5 +++++ .../changelog/fix-changelogger-amend-default-link | 4 ---- .../packages/changelogger/src/Application.php | 2 +- projects/packages/connection/CHANGELOG.md | 5 +++++ .../fix-jetpack-story-block-connection-assets | 5 ----- .../connection/src/class-package-version.php | 2 +- projects/packages/publicize/CHANGELOG.md | 5 +++++ .../changelog/fix-social-bsky-profile-url | 4 ---- projects/packages/publicize/composer.json | 2 +- projects/packages/publicize/package.json | 2 +- projects/packages/sync/CHANGELOG.md | 5 +++++ .../revert-39658-update-jetpack-sync-whitelist | 5 ----- .../update-hooks-prevent-doing-it-wrong-notice | 4 ---- .../packages/sync/src/class-package-version.php | 2 +- .../{social => jetpack}/changelog/prerelease | 2 +- projects/plugins/jetpack/composer.lock | 4 ++-- projects/plugins/social/CHANGELOG.md | 15 +++++++++++++++ .../changelog/add-bluesky-to-social-previews | 4 ---- .../add-dependency-extraction-auto-polyfill | 4 ---- .../changelog/add-reply-to-support-social-notes | 4 ---- .../fix-jetpack-social-notes-clobber-other-cpts | 5 ----- .../changelog/fix-social-og-tags-jetpack-dev-path | 4 ---- .../fix-social-share-status-tooltip-text-overflow | 4 ---- .../social/changelog/fix-sync-filter-null-array | 5 ----- .../changelog/renovate-lock-file-maintenance | 4 ---- .../changelog/renovate-lock-file-maintenance#2 | 5 ----- .../social/changelog/renovate-wordpress-monorepo | 4 ---- .../changelog/renovate-wordpress-monorepo#2 | 4 ---- ...ial-initial-state-migrate-urls-on-social-admin | 4 ---- .../changelog/update-social-nuke-has-paid-plan | 5 ----- .../update-social-replace-has-paid-features-check | 5 ----- .../changelog/update-social-sig-feature-check | 5 ----- .../plugins/social/changelog/update-tested-to-6-7 | 4 ---- projects/plugins/social/composer.json | 2 +- projects/plugins/social/composer.lock | 4 ++-- projects/plugins/social/jetpack-social.php | 2 +- projects/plugins/social/readme.txt | 15 +++++++++++++-- projects/plugins/social/src/class-note.php | 2 +- 50 files changed, 78 insertions(+), 144 deletions(-) delete mode 100644 projects/js-packages/publicize-components/changelog/fix-social-bluesky-custom-domain-handles-not-working delete mode 100644 projects/js-packages/publicize-components/changelog/fix-social-bluesky-reconnection-for-broken-connections delete mode 100644 projects/js-packages/publicize-components/changelog/fix-social-bsky-profile-name-connection-management delete mode 100644 projects/js-packages/publicize-components/changelog/update-enhances-publishing-feature-check delete mode 100644 projects/js-packages/publicize-components/changelog/update-social-nuke-has-paid-plan delete mode 100644 projects/js-packages/publicize-components/changelog/update-social-replace-has-paid-features-check delete mode 100644 projects/js-packages/publicize-components/changelog/update-social-sig-feature-check delete mode 100644 projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x delete mode 100644 projects/packages/changelogger/changelog/fix-changelogger-amend-default-link delete mode 100644 projects/packages/connection/changelog/fix-jetpack-story-block-connection-assets delete mode 100644 projects/packages/publicize/changelog/fix-social-bsky-profile-url delete mode 100644 projects/packages/sync/changelog/revert-39658-update-jetpack-sync-whitelist delete mode 100644 projects/packages/sync/changelog/update-hooks-prevent-doing-it-wrong-notice rename projects/plugins/{social => jetpack}/changelog/prerelease (79%) delete mode 100644 projects/plugins/social/changelog/add-bluesky-to-social-previews delete mode 100644 projects/plugins/social/changelog/add-dependency-extraction-auto-polyfill delete mode 100644 projects/plugins/social/changelog/add-reply-to-support-social-notes delete mode 100644 projects/plugins/social/changelog/fix-jetpack-social-notes-clobber-other-cpts delete mode 100644 projects/plugins/social/changelog/fix-social-og-tags-jetpack-dev-path delete mode 100644 projects/plugins/social/changelog/fix-social-share-status-tooltip-text-overflow delete mode 100644 projects/plugins/social/changelog/fix-sync-filter-null-array delete mode 100644 projects/plugins/social/changelog/renovate-lock-file-maintenance delete mode 100644 projects/plugins/social/changelog/renovate-lock-file-maintenance#2 delete mode 100644 projects/plugins/social/changelog/renovate-wordpress-monorepo delete mode 100644 projects/plugins/social/changelog/renovate-wordpress-monorepo#2 delete mode 100644 projects/plugins/social/changelog/update-social-initial-state-migrate-urls-on-social-admin delete mode 100644 projects/plugins/social/changelog/update-social-nuke-has-paid-plan delete mode 100644 projects/plugins/social/changelog/update-social-replace-has-paid-features-check delete mode 100644 projects/plugins/social/changelog/update-social-sig-feature-check delete mode 100644 projects/plugins/social/changelog/update-tested-to-6-7 diff --git a/projects/js-packages/publicize-components/CHANGELOG.md b/projects/js-packages/publicize-components/CHANGELOG.md index a47006d9fe0db..43c07a78f6e22 100644 --- a/projects/js-packages/publicize-components/CHANGELOG.md +++ b/projects/js-packages/publicize-components/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.71.4] - 2024-10-25 +### Changed +- Initial state: Migrated isEnhancedPublishingEnabled to feature check [#39835] + +### Fixed +- Fixed Bsky conneciton management profile name [#39889] +- Fixed reconnection for broken Bluesky connections [#39844] +- Social: Fixed Bluesky custom domain handle not being accepted [#39872] + ## [0.71.3] - 2024-10-21 ### Changed - Initial state: Migrated URLs in the editor to the new script data. [#39799] [#39797] @@ -978,6 +987,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Updated package dependencies. [#24470] +[0.71.4]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.71.3...v0.71.4 [0.71.3]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.71.2...v0.71.3 [0.71.2]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.71.1...v0.71.2 [0.71.1]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.71.0...v0.71.1 diff --git a/projects/js-packages/publicize-components/changelog/fix-social-bluesky-custom-domain-handles-not-working b/projects/js-packages/publicize-components/changelog/fix-social-bluesky-custom-domain-handles-not-working deleted file mode 100644 index 5857f3006fd35..0000000000000 --- a/projects/js-packages/publicize-components/changelog/fix-social-bluesky-custom-domain-handles-not-working +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: fixed - -Social: Fixed Bluesky custom domain handle not being accepted diff --git a/projects/js-packages/publicize-components/changelog/fix-social-bluesky-reconnection-for-broken-connections b/projects/js-packages/publicize-components/changelog/fix-social-bluesky-reconnection-for-broken-connections deleted file mode 100644 index eb4d17f671962..0000000000000 --- a/projects/js-packages/publicize-components/changelog/fix-social-bluesky-reconnection-for-broken-connections +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: fixed - -Fixed reconnection for broken Bluesky connections diff --git a/projects/js-packages/publicize-components/changelog/fix-social-bsky-profile-name-connection-management b/projects/js-packages/publicize-components/changelog/fix-social-bsky-profile-name-connection-management deleted file mode 100644 index c33f654b62b79..0000000000000 --- a/projects/js-packages/publicize-components/changelog/fix-social-bsky-profile-name-connection-management +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: fixed - -Fixed Bsky conneciton management profile name diff --git a/projects/js-packages/publicize-components/changelog/update-enhances-publishing-feature-check b/projects/js-packages/publicize-components/changelog/update-enhances-publishing-feature-check deleted file mode 100644 index e1af3f96c5a7e..0000000000000 --- a/projects/js-packages/publicize-components/changelog/update-enhances-publishing-feature-check +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -Initial state: Migrated isEnhancedPublishingEnabled to feature check diff --git a/projects/js-packages/publicize-components/changelog/update-social-nuke-has-paid-plan b/projects/js-packages/publicize-components/changelog/update-social-nuke-has-paid-plan deleted file mode 100644 index 59e08c72626b5..0000000000000 --- a/projects/js-packages/publicize-components/changelog/update-social-nuke-has-paid-plan +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Initial state: Removed unused hasPaidPlan flag - - diff --git a/projects/js-packages/publicize-components/changelog/update-social-replace-has-paid-features-check b/projects/js-packages/publicize-components/changelog/update-social-replace-has-paid-features-check deleted file mode 100644 index bf9a130af83ec..0000000000000 --- a/projects/js-packages/publicize-components/changelog/update-social-replace-has-paid-features-check +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Initial State: Migrated hasPaidFeatures flag with feature check on front-end - - diff --git a/projects/js-packages/publicize-components/changelog/update-social-sig-feature-check b/projects/js-packages/publicize-components/changelog/update-social-sig-feature-check deleted file mode 100644 index 96580bab97529..0000000000000 --- a/projects/js-packages/publicize-components/changelog/update-social-sig-feature-check +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Initial state: Migrated isSocialImageGeneratorAvailable to feature check - - diff --git a/projects/js-packages/publicize-components/package.json b/projects/js-packages/publicize-components/package.json index 54856e9583755..b3eb34b40227b 100644 --- a/projects/js-packages/publicize-components/package.json +++ b/projects/js-packages/publicize-components/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-publicize-components", - "version": "0.71.3", + "version": "0.71.4", "description": "A library of JS components required by the Publicize editor plugin", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/publicize-components/#readme", "bugs": { diff --git a/projects/js-packages/social-logos/CHANGELOG.md b/projects/js-packages/social-logos/CHANGELOG.md index fadc43298865a..7b5bb36820788 100644 --- a/projects/js-packages/social-logos/CHANGELOG.md +++ b/projects/js-packages/social-logos/CHANGELOG.md @@ -1,3 +1,7 @@ +## [3.1.10] - 2024-10-25 +### Changed +- Updated package dependencies. [#39893] + ## [3.1.9] - 2024-10-14 ### Fixed - Add `key` in React example to make it more correct. [#39709] @@ -157,6 +161,7 @@ - Build: Refactored (aligned build system with Gridicons). +[3.1.10]: https://github.com/Automattic/social-logos/compare/v3.1.9...v3.1.10 [3.1.9]: https://github.com/Automattic/social-logos/compare/v3.1.8...v3.1.9 [3.1.8]: https://github.com/Automattic/social-logos/compare/v3.1.7...v3.1.8 [3.1.7]: https://github.com/Automattic/social-logos/compare/v3.1.6...v3.1.7 diff --git a/projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x b/projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x deleted file mode 100644 index c47cb18e82997..0000000000000 --- a/projects/js-packages/social-logos/changelog/renovate-svgicons2svgfont-14.x +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -Updated package dependencies. diff --git a/projects/js-packages/social-logos/package.json b/projects/js-packages/social-logos/package.json index 862f576b7ace7..7d4ed4cc6ef71 100644 --- a/projects/js-packages/social-logos/package.json +++ b/projects/js-packages/social-logos/package.json @@ -1,6 +1,6 @@ { "name": "social-logos", - "version": "3.1.9", + "version": "3.1.10", "description": "A repository of all the social logos used on WordPress.com.", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/social-logos/", "bugs": { diff --git a/projects/packages/changelogger/CHANGELOG.md b/projects/packages/changelogger/CHANGELOG.md index 8fada1afe9231..156ceae5c1cfd 100644 --- a/projects/packages/changelogger/CHANGELOG.md +++ b/projects/packages/changelogger/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.2.7] - 2024-10-25 +### Fixed +- When amending, do not preserve a default link. We'll want the link to be updated to the new default. [#39868] + ## [4.2.6] - 2024-08-22 ### Changed - Updated package dependencies. [#39004] @@ -244,6 +248,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Added - Initial version. +[4.2.7]: https://github.com/Automattic/jetpack-changelogger/compare/4.2.6...4.2.7 [4.2.6]: https://github.com/Automattic/jetpack-changelogger/compare/4.2.5...4.2.6 [4.2.5]: https://github.com/Automattic/jetpack-changelogger/compare/4.2.4...4.2.5 [4.2.4]: https://github.com/Automattic/jetpack-changelogger/compare/4.2.3...4.2.4 diff --git a/projects/packages/changelogger/changelog/fix-changelogger-amend-default-link b/projects/packages/changelogger/changelog/fix-changelogger-amend-default-link deleted file mode 100644 index 09dc0989a5b9c..0000000000000 --- a/projects/packages/changelogger/changelog/fix-changelogger-amend-default-link +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: fixed - -When amending, do not preserve a default link. We'll want the link to be updated to the new default. diff --git a/projects/packages/changelogger/src/Application.php b/projects/packages/changelogger/src/Application.php index d70b65acc2f0b..69ea521e20354 100644 --- a/projects/packages/changelogger/src/Application.php +++ b/projects/packages/changelogger/src/Application.php @@ -19,7 +19,7 @@ */ class Application extends SymfonyApplication { - const VERSION = '4.2.6'; + const VERSION = '4.2.7'; /** * Constructor. diff --git a/projects/packages/connection/CHANGELOG.md b/projects/packages/connection/CHANGELOG.md index 01ae992f43f27..afb4d5b98596d 100644 --- a/projects/packages/connection/CHANGELOG.md +++ b/projects/packages/connection/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.1.5] - 2024-10-25 +### Changed +- Internal updates. + ## [5.1.4] - 2024-10-21 ### Changed - SSO: optimize 'admin_notices' action callback. [#39811] @@ -1230,6 +1234,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Separate the connection library into its own package. +[5.1.5]: https://github.com/Automattic/jetpack-connection/compare/v5.1.4...v5.1.5 [5.1.4]: https://github.com/Automattic/jetpack-connection/compare/v5.1.3...v5.1.4 [5.1.3]: https://github.com/Automattic/jetpack-connection/compare/v5.1.2...v5.1.3 [5.1.2]: https://github.com/Automattic/jetpack-connection/compare/v5.1.1...v5.1.2 diff --git a/projects/packages/connection/changelog/fix-jetpack-story-block-connection-assets b/projects/packages/connection/changelog/fix-jetpack-story-block-connection-assets deleted file mode 100644 index 4652d98b066f2..0000000000000 --- a/projects/packages/connection/changelog/fix-jetpack-story-block-connection-assets +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: added -Comment: PHPDoc comment change. - - diff --git a/projects/packages/connection/src/class-package-version.php b/projects/packages/connection/src/class-package-version.php index 0ed481101c11e..9797fa57d5dfc 100644 --- a/projects/packages/connection/src/class-package-version.php +++ b/projects/packages/connection/src/class-package-version.php @@ -12,7 +12,7 @@ */ class Package_Version { - const PACKAGE_VERSION = '5.1.4'; + const PACKAGE_VERSION = '5.1.5'; const PACKAGE_SLUG = 'connection'; diff --git a/projects/packages/publicize/CHANGELOG.md b/projects/packages/publicize/CHANGELOG.md index 2e9b7805d534b..53a9ad0cba00b 100644 --- a/projects/packages/publicize/CHANGELOG.md +++ b/projects/packages/publicize/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.55.0] - 2024-10-25 +### Fixed +- Social: Fix Bsky profile URL [#39849] + ## [0.54.4] - 2024-10-21 ### Changed - Initial State: Migrated URLs to script data. [#39797] @@ -736,6 +740,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated package dependencies. - Update package.json metadata. +[0.55.0]: https://github.com/Automattic/jetpack-publicize/compare/v0.54.4...v0.55.0 [0.54.4]: https://github.com/Automattic/jetpack-publicize/compare/v0.54.3...v0.54.4 [0.54.3]: https://github.com/Automattic/jetpack-publicize/compare/v0.54.2...v0.54.3 [0.54.2]: https://github.com/Automattic/jetpack-publicize/compare/v0.54.1...v0.54.2 diff --git a/projects/packages/publicize/changelog/fix-social-bsky-profile-url b/projects/packages/publicize/changelog/fix-social-bsky-profile-url deleted file mode 100644 index ebe3332ec44de..0000000000000 --- a/projects/packages/publicize/changelog/fix-social-bsky-profile-url +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: fixed - -Social: Fix Bsky profile URL diff --git a/projects/packages/publicize/composer.json b/projects/packages/publicize/composer.json index 7eca829441cb7..b3f71236d8419 100644 --- a/projects/packages/publicize/composer.json +++ b/projects/packages/publicize/composer.json @@ -68,7 +68,7 @@ "link-template": "https://github.com/Automattic/jetpack-publicize/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "0.54.x-dev" + "dev-trunk": "0.55.x-dev" } }, "config": { diff --git a/projects/packages/publicize/package.json b/projects/packages/publicize/package.json index 7df4d2ac41402..0ae20c479ae66 100644 --- a/projects/packages/publicize/package.json +++ b/projects/packages/publicize/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-publicize", - "version": "0.54.4", + "version": "0.55.0", "description": "Publicize makes it easy to share your site’s posts on several social media networks automatically when you publish a new post.", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/publicize/#readme", "bugs": { diff --git a/projects/packages/sync/CHANGELOG.md b/projects/packages/sync/CHANGELOG.md index 963e67ed56760..3eb956e5ec6e5 100644 --- a/projects/packages/sync/CHANGELOG.md +++ b/projects/packages/sync/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.14.3] - 2024-10-25 +### Fixed +- Hooks: Hook init_sync_cron_jobs into init to ensure translation loading within the function is not triggered too early. [#39841] + ## [3.14.2] - 2024-10-15 ### Changed - Jetpack Sync: Update default Post Type Blacklist [#39770] @@ -1318,6 +1322,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Packages: Move sync to a classmapped package +[3.14.3]: https://github.com/Automattic/jetpack-sync/compare/v3.14.2...v3.14.3 [3.14.2]: https://github.com/Automattic/jetpack-sync/compare/v3.14.1...v3.14.2 [3.14.1]: https://github.com/Automattic/jetpack-sync/compare/v3.14.0...v3.14.1 [3.14.0]: https://github.com/Automattic/jetpack-sync/compare/v3.13.2...v3.14.0 diff --git a/projects/packages/sync/changelog/revert-39658-update-jetpack-sync-whitelist b/projects/packages/sync/changelog/revert-39658-update-jetpack-sync-whitelist deleted file mode 100644 index 59df2569689e4..0000000000000 --- a/projects/packages/sync/changelog/revert-39658-update-jetpack-sync-whitelist +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: removed -Comment: Revert "Jetpack Sync: Add 'woocommerce_analytics_first_activation' in options' whitelist" - - diff --git a/projects/packages/sync/changelog/update-hooks-prevent-doing-it-wrong-notice b/projects/packages/sync/changelog/update-hooks-prevent-doing-it-wrong-notice deleted file mode 100644 index f319fb6812720..0000000000000 --- a/projects/packages/sync/changelog/update-hooks-prevent-doing-it-wrong-notice +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: fixed - -Hooks: Hook init_sync_cron_jobs into init to ensure translation loading within the function is not triggered too early. diff --git a/projects/packages/sync/src/class-package-version.php b/projects/packages/sync/src/class-package-version.php index d028b2ae59613..ac647f5064ad9 100644 --- a/projects/packages/sync/src/class-package-version.php +++ b/projects/packages/sync/src/class-package-version.php @@ -12,7 +12,7 @@ */ class Package_Version { - const PACKAGE_VERSION = '3.14.2'; + const PACKAGE_VERSION = '3.14.3'; const PACKAGE_SLUG = 'sync'; diff --git a/projects/plugins/social/changelog/prerelease b/projects/plugins/jetpack/changelog/prerelease similarity index 79% rename from projects/plugins/social/changelog/prerelease rename to projects/plugins/jetpack/changelog/prerelease index 9aa70e3ec1f75..a1c1831fa1ef7 100644 --- a/projects/plugins/social/changelog/prerelease +++ b/projects/plugins/jetpack/changelog/prerelease @@ -1,5 +1,5 @@ Significance: patch -Type: changed +Type: other Comment: Updated composer.lock. diff --git a/projects/plugins/jetpack/composer.lock b/projects/plugins/jetpack/composer.lock index 5df2b3221306d..6d59b8cc740a6 100644 --- a/projects/plugins/jetpack/composer.lock +++ b/projects/plugins/jetpack/composer.lock @@ -2225,7 +2225,7 @@ "dist": { "type": "path", "url": "../../packages/publicize", - "reference": "b8abac09471222cd803a35a623b5e9b7d4049c0d" + "reference": "1fc54eab768a14c867ab64b3a5b169c662bb6b77" }, "require": { "automattic/jetpack-assets": "@dev", @@ -2253,7 +2253,7 @@ "link-template": "https://github.com/Automattic/jetpack-publicize/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "0.54.x-dev" + "dev-trunk": "0.55.x-dev" } }, "autoload": { diff --git a/projects/plugins/social/CHANGELOG.md b/projects/plugins/social/CHANGELOG.md index 0eaa0d3f74a52..158d7ee767b35 100644 --- a/projects/plugins/social/CHANGELOG.md +++ b/projects/plugins/social/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 5.5.0 - 2024-10-25 +### Added +- Added Bluesky to social previews [#39659] +- Social Notes: add support for the ActivityPub Reply-To block. [#39738] + +### Changed +- General: indicate compatibility with the upcoming version of WordPress - 6.7. [#39786] +- Initial State: Migrated URLs to script data [#39797] +- Only include `wp-polyfill` as a script dependency when needed. [#39629] +- Updated package dependencies. [#39594] [#39653] [#39707] + +### Fixed +- Added Jetpack Beta's slug to Social OG conflicting plugins [#39792] +- Social: Fixed share status tooltip text overflow [#39599] + ## 5.4.1 - 2024-10-02 ### Changed - Internal updates. diff --git a/projects/plugins/social/changelog/add-bluesky-to-social-previews b/projects/plugins/social/changelog/add-bluesky-to-social-previews deleted file mode 100644 index 73211c933517d..0000000000000 --- a/projects/plugins/social/changelog/add-bluesky-to-social-previews +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: added - -Added Bluesky to social previews diff --git a/projects/plugins/social/changelog/add-dependency-extraction-auto-polyfill b/projects/plugins/social/changelog/add-dependency-extraction-auto-polyfill deleted file mode 100644 index f4cd286e166af..0000000000000 --- a/projects/plugins/social/changelog/add-dependency-extraction-auto-polyfill +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -Only include `wp-polyfill` as a script dependency when needed. diff --git a/projects/plugins/social/changelog/add-reply-to-support-social-notes b/projects/plugins/social/changelog/add-reply-to-support-social-notes deleted file mode 100644 index 9e7a0738be21b..0000000000000 --- a/projects/plugins/social/changelog/add-reply-to-support-social-notes +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: added - -Social Notes: add support for the ActivityPub Reply-To block. diff --git a/projects/plugins/social/changelog/fix-jetpack-social-notes-clobber-other-cpts b/projects/plugins/social/changelog/fix-jetpack-social-notes-clobber-other-cpts deleted file mode 100644 index 8aac5c2fdff3e..0000000000000 --- a/projects/plugins/social/changelog/fix-jetpack-social-notes-clobber-other-cpts +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: fixed -Comment: Resolves a bug in an unreleased feature - - diff --git a/projects/plugins/social/changelog/fix-social-og-tags-jetpack-dev-path b/projects/plugins/social/changelog/fix-social-og-tags-jetpack-dev-path deleted file mode 100644 index 79af3f25d3565..0000000000000 --- a/projects/plugins/social/changelog/fix-social-og-tags-jetpack-dev-path +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: fixed - -Added Jetpack Beta's slug to Social OG conflicting plugins diff --git a/projects/plugins/social/changelog/fix-social-share-status-tooltip-text-overflow b/projects/plugins/social/changelog/fix-social-share-status-tooltip-text-overflow deleted file mode 100644 index 9a6eda0cf22bb..0000000000000 --- a/projects/plugins/social/changelog/fix-social-share-status-tooltip-text-overflow +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: fixed - -Social: Fixed share status tooltip text overflow diff --git a/projects/plugins/social/changelog/fix-sync-filter-null-array b/projects/plugins/social/changelog/fix-sync-filter-null-array deleted file mode 100644 index 3f56c90b3a7bf..0000000000000 --- a/projects/plugins/social/changelog/fix-sync-filter-null-array +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: fixed -Comment: Sync: update filter parameter to avoid conflicts with other plugins. - - diff --git a/projects/plugins/social/changelog/renovate-lock-file-maintenance b/projects/plugins/social/changelog/renovate-lock-file-maintenance deleted file mode 100644 index c47cb18e82997..0000000000000 --- a/projects/plugins/social/changelog/renovate-lock-file-maintenance +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -Updated package dependencies. diff --git a/projects/plugins/social/changelog/renovate-lock-file-maintenance#2 b/projects/plugins/social/changelog/renovate-lock-file-maintenance#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/social/changelog/renovate-lock-file-maintenance#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - diff --git a/projects/plugins/social/changelog/renovate-wordpress-monorepo b/projects/plugins/social/changelog/renovate-wordpress-monorepo deleted file mode 100644 index c47cb18e82997..0000000000000 --- a/projects/plugins/social/changelog/renovate-wordpress-monorepo +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -Updated package dependencies. diff --git a/projects/plugins/social/changelog/renovate-wordpress-monorepo#2 b/projects/plugins/social/changelog/renovate-wordpress-monorepo#2 deleted file mode 100644 index c47cb18e82997..0000000000000 --- a/projects/plugins/social/changelog/renovate-wordpress-monorepo#2 +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -Updated package dependencies. diff --git a/projects/plugins/social/changelog/update-social-initial-state-migrate-urls-on-social-admin b/projects/plugins/social/changelog/update-social-initial-state-migrate-urls-on-social-admin deleted file mode 100644 index c23ee0fbdc59a..0000000000000 --- a/projects/plugins/social/changelog/update-social-initial-state-migrate-urls-on-social-admin +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -Initial State: Migrated URLs to script data diff --git a/projects/plugins/social/changelog/update-social-nuke-has-paid-plan b/projects/plugins/social/changelog/update-social-nuke-has-paid-plan deleted file mode 100644 index 59e08c72626b5..0000000000000 --- a/projects/plugins/social/changelog/update-social-nuke-has-paid-plan +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Initial state: Removed unused hasPaidPlan flag - - diff --git a/projects/plugins/social/changelog/update-social-replace-has-paid-features-check b/projects/plugins/social/changelog/update-social-replace-has-paid-features-check deleted file mode 100644 index bf9a130af83ec..0000000000000 --- a/projects/plugins/social/changelog/update-social-replace-has-paid-features-check +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Initial State: Migrated hasPaidFeatures flag with feature check on front-end - - diff --git a/projects/plugins/social/changelog/update-social-sig-feature-check b/projects/plugins/social/changelog/update-social-sig-feature-check deleted file mode 100644 index 96580bab97529..0000000000000 --- a/projects/plugins/social/changelog/update-social-sig-feature-check +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Initial state: Migrated isSocialImageGeneratorAvailable to feature check - - diff --git a/projects/plugins/social/changelog/update-tested-to-6-7 b/projects/plugins/social/changelog/update-tested-to-6-7 deleted file mode 100644 index 9c1d5b4fabb5f..0000000000000 --- a/projects/plugins/social/changelog/update-tested-to-6-7 +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -General: indicate compatibility with the upcoming version of WordPress - 6.7. diff --git a/projects/plugins/social/composer.json b/projects/plugins/social/composer.json index 83f2a82e3643d..bdd956a7d1584 100644 --- a/projects/plugins/social/composer.json +++ b/projects/plugins/social/composer.json @@ -84,6 +84,6 @@ "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true }, - "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_socialⓥ5_4_1" + "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_socialⓥ5_5_0" } } diff --git a/projects/plugins/social/composer.lock b/projects/plugins/social/composer.lock index 7da20bcbcf2d6..71abf37eef397 100644 --- a/projects/plugins/social/composer.lock +++ b/projects/plugins/social/composer.lock @@ -1497,7 +1497,7 @@ "dist": { "type": "path", "url": "../../packages/publicize", - "reference": "b8abac09471222cd803a35a623b5e9b7d4049c0d" + "reference": "1fc54eab768a14c867ab64b3a5b169c662bb6b77" }, "require": { "automattic/jetpack-assets": "@dev", @@ -1525,7 +1525,7 @@ "link-template": "https://github.com/Automattic/jetpack-publicize/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "0.54.x-dev" + "dev-trunk": "0.55.x-dev" } }, "autoload": { diff --git a/projects/plugins/social/jetpack-social.php b/projects/plugins/social/jetpack-social.php index a7d6093d591a1..227b32ff741de 100644 --- a/projects/plugins/social/jetpack-social.php +++ b/projects/plugins/social/jetpack-social.php @@ -4,7 +4,7 @@ * Plugin Name: Jetpack Social * Plugin URI: https://wordpress.org/plugins/jetpack-social * Description: Share your site’s posts on several social media networks automatically when you publish a new post. - * Version: 5.4.1 + * Version: 5.5.0 * Author: Automattic - Jetpack Social team * Author URI: https://jetpack.com/social/ * License: GPLv2 or later diff --git a/projects/plugins/social/readme.txt b/projects/plugins/social/readme.txt index d8d7e67b23062..dd42a1fd30aba 100644 --- a/projects/plugins/social/readme.txt +++ b/projects/plugins/social/readme.txt @@ -102,9 +102,20 @@ The easiest way is to use the Custom Message option in the publishing options bo 6. Managing Social media accounts in the post editor == Changelog == -### 5.4.1 - 2024-10-02 +### 5.5.0 - 2024-10-25 +#### Added +- Added Bluesky to social previews +- Social Notes: add support for the ActivityPub Reply-To block. + #### Changed -- Internal updates. +- General: indicate compatibility with the upcoming version of WordPress - 6.7. +- Initial State: Migrated URLs to script data +- Only include `wp-polyfill` as a script dependency when needed. +- Updated package dependencies. + +#### Fixed +- Added Jetpack Beta's slug to Social OG conflicting plugins +- Social: Fixed share status tooltip text overflow == Upgrade Notice == diff --git a/projects/plugins/social/src/class-note.php b/projects/plugins/social/src/class-note.php index 73aa53395f6cd..b03256fd62a83 100644 --- a/projects/plugins/social/src/class-note.php +++ b/projects/plugins/social/src/class-note.php @@ -170,7 +170,7 @@ public function restrict_blocks_for_social_note( $allowed_blocks, $post ) { * * Default is ['core/paragraph', 'core/post-featured-image'] * - * @since $$next-version$$ + * @since 5.5.0 * * @param array $allowed_blocks A linear array of blocks allowed by the CPT. */ From 4282bc0ae4bfcea6ac04edaf752d78032351eda3 Mon Sep 17 00:00:00 2001 From: Calypso Bot Date: Fri, 25 Oct 2024 16:31:52 +0200 Subject: [PATCH 21/22] Update Eslint packages (#39898) Co-authored-by: Renovate Bot --- package.json | 2 +- pnpm-lock.yaml | 388 +++++++++--------- .../changelog/renovate-eslint-packages | 4 + .../js-packages/boost-score-api/package.json | 2 +- .../changelog/renovate-eslint-packages | 4 + .../eslint-config-target-es/package.json | 2 +- .../changelog/renovate-eslint-packages | 4 + projects/js-packages/image-guide/package.json | 2 +- .../changelog/renovate-eslint-packages#2 | 4 + .../svelte-data-sync-client/package.json | 2 +- tools/js-tools/package.json | 16 +- 11 files changed, 233 insertions(+), 197 deletions(-) create mode 100644 projects/js-packages/boost-score-api/changelog/renovate-eslint-packages create mode 100644 projects/js-packages/eslint-config-target-es/changelog/renovate-eslint-packages create mode 100644 projects/js-packages/image-guide/changelog/renovate-eslint-packages create mode 100644 projects/js-packages/svelte-data-sync-client/changelog/renovate-eslint-packages#2 diff --git a/package.json b/package.json index 61aea19924cbf..b7d34e0aa51d2 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "version-packages": "bash ./tools/version-packages.sh" }, "devDependencies": { - "eslint": "8.57.0", + "eslint": "8.57.1", "husky": "8.0.3", "jetpack-cli": "workspace:*", "jetpack-js-tools": "workspace:*" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 573fa8ff3aeff..7e731de4d338a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,8 +11,8 @@ importers: .: devDependencies: eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: 8.57.1 + version: 8.57.1 husky: specifier: 8.0.3 version: 8.0.3 @@ -262,10 +262,10 @@ importers: version: link:../webpack-config '@typescript-eslint/parser': specifier: 6.21.0 - version: 6.21.0(eslint@8.57.0)(typescript@5.0.4) + version: 6.21.0(eslint@8.57.1)(typescript@5.0.4) eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: 8.57.1 + version: 8.57.1 jest: specifier: 29.7.0 version: 29.7.0 @@ -626,11 +626,11 @@ importers: specifier: 6.9.0 version: 6.9.0 eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: 8.57.1 + version: 8.57.1 eslint-plugin-es-x: specifier: 7.8.0 - version: 7.8.0(eslint@8.57.0) + version: 7.8.0(eslint@8.57.1) globals: specifier: 15.4.0 version: 15.4.0 @@ -771,10 +771,10 @@ importers: version: 12.1.0(rollup@3.29.5)(tslib@2.5.0)(typescript@5.0.4) '@typescript-eslint/parser': specifier: 6.21.0 - version: 6.21.0(eslint@8.57.0)(typescript@5.0.4) + version: 6.21.0(eslint@8.57.1)(typescript@5.0.4) eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: 8.57.1 + version: 8.57.1 jest: specifier: 29.7.0 version: 29.7.0 @@ -1525,10 +1525,10 @@ importers: version: link:../webpack-config '@typescript-eslint/parser': specifier: 6.21.0 - version: 6.21.0(eslint@8.57.0)(typescript@5.0.4) + version: 6.21.0(eslint@8.57.1)(typescript@5.0.4) eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: 8.57.1 + version: 8.57.1 jest: specifier: 29.7.0 version: 29.7.0 @@ -4805,8 +4805,8 @@ importers: specifier: 7.24.7 version: 7.24.7 '@babel/eslint-parser': - specifier: 7.24.7 - version: 7.24.7(@babel/core@7.24.7)(eslint@8.57.0) + specifier: 7.25.9 + version: 7.25.9(@babel/core@7.24.7)(eslint@8.57.1) '@babel/preset-react': specifier: 7.24.7 version: 7.24.7(@babel/core@7.24.7) @@ -4827,13 +4827,13 @@ importers: version: 6.5.0 '@typescript-eslint/eslint-plugin': specifier: 6.21.0 - version: 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4) + version: 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4) '@typescript-eslint/parser': specifier: 6.21.0 - version: 6.21.0(eslint@8.57.0)(typescript@5.0.4) + version: 6.21.0(eslint@8.57.1)(typescript@5.0.4) '@wordpress/eslint-plugin': specifier: 21.2.0 - version: 21.2.0(2g4wiqq3ubewvaaot6et2pay5m) + version: 21.2.0(3zgehwu3uz4mcmtrtsv3cr4muy) '@wordpress/jest-console': specifier: 8.9.0 version: 8.9.0(jest@29.7.0) @@ -4850,53 +4850,53 @@ importers: specifier: 2.4.1 version: 2.4.1 eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: 8.57.1 + version: 8.57.1 eslint-config-prettier: specifier: 9.1.0 - version: 9.1.0(eslint@8.57.0) + version: 9.1.0(eslint@8.57.1) eslint-import-resolver-exports: specifier: 1.0.0-beta.5 - version: 1.0.0-beta.5(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0))(eslint@8.57.0) + version: 1.0.0-beta.5(eslint-plugin-import@2.31.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1))(eslint@8.57.1) eslint-plugin-es-x: specifier: 7.8.0 - version: 7.8.0(eslint@8.57.0) + version: 7.8.0(eslint@8.57.1) eslint-plugin-import: - specifier: 2.29.1 - version: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0) + specifier: 2.31.0 + version: 2.31.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1) eslint-plugin-jest: specifier: 27.9.0 - version: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(jest@29.7.0)(typescript@5.0.4) + version: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(jest@29.7.0)(typescript@5.0.4) eslint-plugin-jest-dom: specifier: 5.4.0 - version: 5.4.0(eslint@8.57.0) + version: 5.4.0(eslint@8.57.1) eslint-plugin-jsdoc: - specifier: 48.8.3 - version: 48.8.3(eslint@8.57.0) + specifier: 48.11.0 + version: 48.11.0(eslint@8.57.1) eslint-plugin-jsx-a11y: - specifier: 6.9.0 - version: 6.9.0(eslint@8.57.0) + specifier: 6.10.1 + version: 6.10.1(eslint@8.57.1) eslint-plugin-lodash: specifier: 7.4.0 - version: 7.4.0(eslint@8.57.0) + version: 7.4.0(eslint@8.57.1) eslint-plugin-playwright: specifier: 0.22.2 - version: 0.22.2(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(jest@29.7.0)(typescript@5.0.4))(eslint@8.57.0) + version: 0.22.2(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(jest@29.7.0)(typescript@5.0.4))(eslint@8.57.1) eslint-plugin-prettier: specifier: 5.2.1 - version: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(wp-prettier@3.0.3) + version: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(wp-prettier@3.0.3) eslint-plugin-react: - specifier: 7.35.0 - version: 7.35.0(eslint@8.57.0) + specifier: 7.37.2 + version: 7.37.2(eslint@8.57.1) eslint-plugin-react-hooks: specifier: 4.6.2 - version: 4.6.2(eslint@8.57.0) + version: 4.6.2(eslint@8.57.1) eslint-plugin-svelte: - specifier: 2.43.0 - version: 2.43.0(eslint@8.57.0)(svelte@4.2.19) + specifier: 2.46.0 + version: 2.46.0(eslint@8.57.1)(svelte@4.2.19) eslint-plugin-testing-library: - specifier: 6.3.0 - version: 6.3.0(eslint@8.57.0)(typescript@5.0.4) + specifier: 6.4.0 + version: 6.4.0(eslint@8.57.1)(typescript@5.0.4) glob: specifier: 10.4.1 version: 10.4.1 @@ -5053,8 +5053,8 @@ packages: resolution: {integrity: sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==} engines: {node: '>=6.9.0'} - '@babel/eslint-parser@7.24.7': - resolution: {integrity: sha512-SO5E3bVxDuxyNxM5agFv480YA2HO6ohZbGxbazZdIk3KQOPOGVNw6q78I9/lbviIf95eq6tPozeYnJLbjnC8IA==} + '@babel/eslint-parser@7.25.9': + resolution: {integrity: sha512-5UXfgpK0j0Xr/xIdgdLEhOFxaDZ0bRPWJJchRpqOSur/3rZoPbqqki5mm0p4NE2cs28krBEiSM2MB7//afRSQQ==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} peerDependencies: '@babel/core': ^7.11.0 @@ -6072,8 +6072,8 @@ packages: resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@eslint/js@8.57.0': - resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} + '@eslint/js@8.57.1': + resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} '@fastify/busboy@2.1.1': @@ -6101,8 +6101,8 @@ packages: '@hapi/topo@5.1.0': resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} - '@humanwhocodes/config-array@0.11.14': - resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} + '@humanwhocodes/config-array@0.13.0': + resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} engines: {node: '>=10.10.0'} deprecated: Use @eslint/config-array instead @@ -6695,6 +6695,9 @@ packages: rollup: optional: true + '@rtsao/scc@1.1.0': + resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} + '@rushstack/eslint-patch@1.3.3': resolution: {integrity: sha512-0xd7qez0AQ+MbHatZTlI1gu5vkG8r7MYRUJAHPAHJBmGLs16zpkrpAVLvjQKQOqaXPDUBwOiJzNc00znHSCVBw==} @@ -8356,9 +8359,6 @@ packages: axios@1.7.4: resolution: {integrity: sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==} - axobject-query@3.1.1: - resolution: {integrity: sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==} - axobject-query@4.1.0: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} @@ -9424,8 +9424,8 @@ packages: es-get-iterator@1.1.3: resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} - es-iterator-helpers@1.0.19: - resolution: {integrity: sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==} + es-iterator-helpers@1.1.0: + resolution: {integrity: sha512-/SurEfycdyssORP/E+bj4sEu1CWw4EmLDsHynHwSXQ7utgbrMRWW195pTrCjFgFCddf/UkYm3oqKPRq5i8bJbw==} engines: {node: '>= 0.4'} es-module-lexer@1.5.4: @@ -9545,12 +9545,12 @@ packages: peerDependencies: eslint: '>=8' - eslint-plugin-import@2.29.1: - resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} + eslint-plugin-import@2.31.0: + resolution: {integrity: sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9 peerDependenciesMeta: '@typescript-eslint/parser': optional: true @@ -9578,17 +9578,17 @@ packages: jest: optional: true - eslint-plugin-jsdoc@48.8.3: - resolution: {integrity: sha512-AtIvwwW9D17MRkM0Z0y3/xZYaa9mdAvJrkY6fU/HNUwGbmMtHVvK4qRM9CDixGVtfNrQitb8c6zQtdh6cTOvLg==} + eslint-plugin-jsdoc@48.11.0: + resolution: {integrity: sha512-d12JHJDPNo7IFwTOAItCeJY1hcqoIxE0lHA8infQByLilQ9xkqrRa6laWCnsuCrf+8rUnvxXY1XuTbibRBNylA==} engines: {node: '>=18'} peerDependencies: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 - eslint-plugin-jsx-a11y@6.9.0: - resolution: {integrity: sha512-nOFOCaJG2pYqORjK19lqPqxMO/JpvdCZdPtNdxY3kvom3jTvkAbOvQvD8wuD0G8BYR0IGAGYDlzqWJOh/ybn2g==} + eslint-plugin-jsx-a11y@6.10.1: + resolution: {integrity: sha512-zHByM9WTUMnfsDTafGXRiqxp6lFtNoSOWBY6FonVRn3A+BUwN1L/tdBXT40BcBJi0cZjOGTXZ0eD/rTG9fEJ0g==} engines: {node: '>=4.0'} peerDependencies: - eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9 eslint-plugin-lodash@7.4.0: resolution: {integrity: sha512-Tl83UwVXqe1OVeBRKUeWcfg6/pCW1GTRObbdnbEJgYwjxp5Q92MEWQaH9+dmzbRt6kvYU1Mp893E79nJiCSM8A==} @@ -9625,27 +9625,27 @@ packages: peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 - eslint-plugin-react@7.35.0: - resolution: {integrity: sha512-v501SSMOWv8gerHkk+IIQBkcGRGrO2nfybfj5pLxuJNFTPxxA3PSryhXTK+9pNbtkggheDdsC0E9Q8CuPk6JKA==} + eslint-plugin-react@7.37.2: + resolution: {integrity: sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w==} engines: {node: '>=4'} peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 - eslint-plugin-svelte@2.43.0: - resolution: {integrity: sha512-REkxQWvg2pp7QVLxQNa+dJ97xUqRe7Y2JJbSWkHSuszu0VcblZtXkPBPckkivk99y5CdLw4slqfPylL2d/X4jQ==} + eslint-plugin-svelte@2.46.0: + resolution: {integrity: sha512-1A7iEMkzmCZ9/Iz+EAfOGYL8IoIG6zeKEq1SmpxGeM5SXmoQq+ZNnCpXFVJpsxPWYx8jIVGMerQMzX20cqUl0g==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0-0 || ^9.0.0-0 - svelte: ^3.37.0 || ^4.0.0 || ^5.0.0-next.191 + svelte: ^3.37.0 || ^4.0.0 || ^5.0.0 peerDependenciesMeta: svelte: optional: true - eslint-plugin-testing-library@6.3.0: - resolution: {integrity: sha512-GYcEErTt6EGwE0bPDY+4aehfEBpB2gDBFKohir8jlATSUvzStEyzCx8QWB/14xeKc/AwyXkzScSzMHnFojkWrA==} + eslint-plugin-testing-library@6.4.0: + resolution: {integrity: sha512-yeWF+YgCgvNyPNI9UKnG0FjeE2sk93N/3lsKqcmR8dSfeXJwFT5irnWo7NjLf152HkRzfoFjh3LsBUrhvFz4eA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'} peerDependencies: - eslint: ^7.5.0 || ^8.0.0 + eslint: ^7.5.0 || ^8.0.0 || ^9.0.0 eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} @@ -9663,12 +9663,20 @@ packages: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint@8.57.0: - resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} + eslint-visitor-keys@4.1.0: + resolution: {integrity: sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + eslint@8.57.1: + resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true + espree@10.2.0: + resolution: {integrity: sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -10677,8 +10685,9 @@ packages: resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} engines: {node: '>=8'} - iterator.prototype@1.1.2: - resolution: {integrity: sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==} + iterator.prototype@1.1.3: + resolution: {integrity: sha512-FW5iMbeQ6rBGm/oKgzq2aW4KvAGpxPzYES8N4g4xNXUKpL1mclMvOe+76AcLDTvD+Ze+sOpVhgdAQEKF4L9iGQ==} + engines: {node: '>= 0.4'} jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} @@ -10977,8 +10986,8 @@ packages: resolution: {integrity: sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==} engines: {node: '>= 8'} - known-css-properties@0.34.0: - resolution: {integrity: sha512-tBECoUqNFbyAY4RrbqsBQqDFpGXAEbdD5QKr8kACx3+rnArmuuR22nKQWKazvp07N9yjTyDZaw/20UIH8tL9DQ==} + known-css-properties@0.35.0: + resolution: {integrity: sha512-a/RAk2BfKk+WFGhhOCAYqSiFLc34k8Mt/6NWRI4joER0EYUzXIcFivjjnoD3+XU1DggLn/tZc3DOAgke7l8a4A==} kuler@2.0.0: resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} @@ -13153,8 +13162,9 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} - string.prototype.includes@2.0.0: - resolution: {integrity: sha512-E34CkBgyeqNDcrbU76cDjL5JLcVrtSdYq0MEh/B10r17pRP4ciHLwTgnuLV8Ay6cgEMLkcBkFCKyFZ43YldYzg==} + string.prototype.includes@2.0.1: + resolution: {integrity: sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==} + engines: {node: '>= 0.4'} string.prototype.matchall@4.0.11: resolution: {integrity: sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==} @@ -13284,11 +13294,11 @@ packages: svelte: optional: true - svelte-eslint-parser@0.41.1: - resolution: {integrity: sha512-08ndI6zTghzI8SuJAFpvMbA/haPSGn3xz19pjre19yYMw8Nw/wQJ2PrZBI/L8ijGTgtkWCQQiLLy+Z1tfaCwNA==} + svelte-eslint-parser@0.43.0: + resolution: {integrity: sha512-GpU52uPKKcVnh8tKN5P4UZpJ/fUDndmq7wfsvoVXsyP+aY0anol7Yqo01fyrlaWGMFfm4av5DyrjlaXdLRJvGA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: - svelte: ^3.37.0 || ^4.0.0 || ^5.0.0-next.191 + svelte: ^3.37.0 || ^4.0.0 || ^5.0.0 peerDependenciesMeta: svelte: optional: true @@ -14384,11 +14394,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/eslint-parser@7.24.7(@babel/core@7.24.7)(eslint@8.57.0)': + '@babel/eslint-parser@7.25.9(@babel/core@7.24.7)(eslint@8.57.1)': dependencies: '@babel/core': 7.24.7 '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 - eslint: 8.57.0 + eslint: 8.57.1 eslint-visitor-keys: 2.1.0 semver: 6.3.1 @@ -15520,9 +15530,9 @@ snapshots: '@esbuild/win32-x64@0.23.1': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@8.57.1)': dependencies: - eslint: 8.57.0 + eslint: 8.57.1 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.11.1': {} @@ -15541,7 +15551,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@8.57.0': {} + '@eslint/js@8.57.1': {} '@fastify/busboy@2.1.1': {} @@ -15568,7 +15578,7 @@ snapshots: dependencies: '@hapi/hoek': 9.3.0 - '@humanwhocodes/config-array@0.11.14': + '@humanwhocodes/config-array@0.13.0': dependencies: '@humanwhocodes/object-schema': 2.0.3 debug: 4.3.4 @@ -16447,6 +16457,8 @@ snapshots: optionalDependencies: rollup: 3.29.5 + '@rtsao/scc@1.1.0': {} + '@rushstack/eslint-patch@1.3.3': {} '@samverschueren/stream-to-observable@0.3.1(rxjs@6.6.7)': @@ -17557,16 +17569,16 @@ snapshots: '@types/node': 20.16.10 optional: true - '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4)': + '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4)': dependencies: '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.0.4) + '@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@5.0.4) '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.0)(typescript@5.0.4) - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.0.4) + '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.1)(typescript@5.0.4) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.0.4) '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.4 - eslint: 8.57.0 + eslint: 8.57.1 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 @@ -17577,14 +17589,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4)': + '@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4)': dependencies: '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.0.4) '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.4 - eslint: 8.57.0 + eslint: 8.57.1 optionalDependencies: typescript: 5.0.4 transitivePeerDependencies: @@ -17600,12 +17612,12 @@ snapshots: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0 - '@typescript-eslint/type-utils@6.21.0(eslint@8.57.0)(typescript@5.0.4)': + '@typescript-eslint/type-utils@6.21.0(eslint@8.57.1)(typescript@5.0.4)': dependencies: '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.0.4) - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.0.4) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.0.4) debug: 4.3.4 - eslint: 8.57.0 + eslint: 8.57.1 ts-api-utils: 1.3.0(typescript@5.0.4) optionalDependencies: typescript: 5.0.4 @@ -17645,30 +17657,30 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.0.4)': + '@typescript-eslint/utils@5.62.0(eslint@8.57.1)(typescript@5.0.4)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.0.4) - eslint: 8.57.0 + eslint: 8.57.1 eslint-scope: 5.1.1 semver: 7.5.2 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.0.4)': + '@typescript-eslint/utils@6.21.0(eslint@8.57.1)(typescript@5.0.4)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.0.4) - eslint: 8.57.0 + eslint: 8.57.1 semver: 7.6.3 transitivePeerDependencies: - supports-color @@ -18904,25 +18916,25 @@ snapshots: dependencies: '@babel/runtime': 7.24.7 - '@wordpress/eslint-plugin@21.2.0(2g4wiqq3ubewvaaot6et2pay5m)': + '@wordpress/eslint-plugin@21.2.0(3zgehwu3uz4mcmtrtsv3cr4muy)': dependencies: '@babel/core': 7.24.7 - '@babel/eslint-parser': 7.24.7(@babel/core@7.24.7)(eslint@8.57.0) - '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4) - '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.0.4) + '@babel/eslint-parser': 7.25.9(@babel/core@7.24.7)(eslint@8.57.1) + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4) + '@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@5.0.4) '@wordpress/babel-preset-default': 8.9.0 '@wordpress/prettier-config': 4.9.0(wp-prettier@3.0.3) cosmiconfig: 7.1.0 - eslint: 8.57.0 - eslint-config-prettier: 9.1.0(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0) - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(jest@29.7.0)(typescript@5.0.4) - eslint-plugin-jsdoc: 48.8.3(eslint@8.57.0) - eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.0) - eslint-plugin-playwright: 0.22.2(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(jest@29.7.0)(typescript@5.0.4))(eslint@8.57.0) - eslint-plugin-prettier: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(wp-prettier@3.0.3) - eslint-plugin-react: 7.35.0(eslint@8.57.0) - eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) + eslint: 8.57.1 + eslint-config-prettier: 9.1.0(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(jest@29.7.0)(typescript@5.0.4) + eslint-plugin-jsdoc: 48.11.0(eslint@8.57.1) + eslint-plugin-jsx-a11y: 6.10.1(eslint@8.57.1) + eslint-plugin-playwright: 0.22.2(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(jest@29.7.0)(typescript@5.0.4))(eslint@8.57.1) + eslint-plugin-prettier: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(wp-prettier@3.0.3) + eslint-plugin-react: 7.37.2(eslint@8.57.1) + eslint-plugin-react-hooks: 4.6.2(eslint@8.57.1) globals: 13.24.0 requireindex: 1.2.0 optionalDependencies: @@ -19893,10 +19905,6 @@ snapshots: transitivePeerDependencies: - debug - axobject-query@3.1.1: - dependencies: - deep-equal: 2.2.3 - axobject-query@4.1.0: {} b4a@1.6.7: {} @@ -21166,7 +21174,7 @@ snapshots: isarray: 2.0.5 stop-iteration-iterator: 1.0.0 - es-iterator-helpers@1.0.19: + es-iterator-helpers@1.1.0: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 @@ -21180,7 +21188,7 @@ snapshots: has-proto: 1.0.3 has-symbols: 1.0.3 internal-slot: 1.0.7 - iterator.prototype: 1.1.2 + iterator.prototype: 1.1.3 safe-array-concat: 1.1.2 es-module-lexer@1.5.4: {} @@ -21294,19 +21302,19 @@ snapshots: optionalDependencies: source-map: 0.6.1 - eslint-compat-utils@0.5.1(eslint@8.57.0): + eslint-compat-utils@0.5.1(eslint@8.57.1): dependencies: - eslint: 8.57.0 + eslint: 8.57.1 semver: 7.6.3 - eslint-config-prettier@9.1.0(eslint@8.57.0): + eslint-config-prettier@9.1.0(eslint@8.57.1): dependencies: - eslint: 8.57.0 + eslint: 8.57.1 - eslint-import-resolver-exports@1.0.0-beta.5(eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0))(eslint@8.57.0): + eslint-import-resolver-exports@1.0.0-beta.5(eslint-plugin-import@2.31.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1))(eslint@8.57.1): dependencies: - eslint: 8.57.0 - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0) + eslint: 8.57.1 + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1) resolve.exports: 2.0.2 eslint-import-resolver-node@0.3.9: @@ -21317,34 +21325,35 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + eslint-module-utils@2.12.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.0.4) - eslint: 8.57.0 + '@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@5.0.4) + eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-es-x@7.8.0(eslint@8.57.0): + eslint-plugin-es-x@7.8.0(eslint@8.57.1): dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) '@eslint-community/regexpp': 4.11.1 - eslint: 8.57.0 - eslint-compat-utils: 0.5.1(eslint@8.57.0) + eslint: 8.57.1 + eslint-compat-utils: 0.5.1(eslint@8.57.1) - eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1): dependencies: + '@rtsao/scc': 1.1.0 array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 array.prototype.flatmap: 1.3.2 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.57.0 + eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -21353,39 +21362,41 @@ snapshots: object.groupby: 1.0.3 object.values: 1.2.0 semver: 6.3.1 + string.prototype.trimend: 1.0.8 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.0.4) + '@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@5.0.4) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest-dom@5.4.0(eslint@8.57.0): + eslint-plugin-jest-dom@5.4.0(eslint@8.57.1): dependencies: '@babel/runtime': 7.24.7 - eslint: 8.57.0 + eslint: 8.57.1 requireindex: 1.2.0 - eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(jest@29.7.0)(typescript@5.0.4): + eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(jest@29.7.0)(typescript@5.0.4): dependencies: - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.0.4) - eslint: 8.57.0 + '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@5.0.4) + eslint: 8.57.1 optionalDependencies: - '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4) + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4) jest: 29.7.0 transitivePeerDependencies: - supports-color - typescript - eslint-plugin-jsdoc@48.8.3(eslint@8.57.0): + eslint-plugin-jsdoc@48.11.0(eslint@8.57.1): dependencies: '@es-joy/jsdoccomment': 0.46.0 are-docs-informative: 0.0.2 comment-parser: 1.4.1 debug: 4.3.7 escape-string-regexp: 4.0.0 - eslint: 8.57.0 + eslint: 8.57.1 + espree: 10.2.0 esquery: 1.6.0 parse-imports: 2.2.1 semver: 7.6.3 @@ -21394,60 +21405,60 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-jsx-a11y@6.9.0(eslint@8.57.0): + eslint-plugin-jsx-a11y@6.10.1(eslint@8.57.1): dependencies: - aria-query: 5.1.3 + aria-query: 5.3.2 array-includes: 3.1.8 array.prototype.flatmap: 1.3.2 ast-types-flow: 0.0.8 axe-core: 4.10.0 - axobject-query: 3.1.1 + axobject-query: 4.1.0 damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 - es-iterator-helpers: 1.0.19 - eslint: 8.57.0 + es-iterator-helpers: 1.1.0 + eslint: 8.57.1 hasown: 2.0.2 jsx-ast-utils: 3.3.5 language-tags: 1.0.9 minimatch: 3.1.2 object.fromentries: 2.0.8 safe-regex-test: 1.0.3 - string.prototype.includes: 2.0.0 + string.prototype.includes: 2.0.1 - eslint-plugin-lodash@7.4.0(eslint@8.57.0): + eslint-plugin-lodash@7.4.0(eslint@8.57.1): dependencies: - eslint: 8.57.0 + eslint: 8.57.1 lodash: 4.17.21 - eslint-plugin-playwright@0.22.2(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(jest@29.7.0)(typescript@5.0.4))(eslint@8.57.0): + eslint-plugin-playwright@0.22.2(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(jest@29.7.0)(typescript@5.0.4))(eslint@8.57.1): dependencies: - eslint: 8.57.0 + eslint: 8.57.1 globals: 13.24.0 optionalDependencies: - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(jest@29.7.0)(typescript@5.0.4) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(typescript@5.0.4))(eslint@8.57.1)(jest@29.7.0)(typescript@5.0.4) - eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(wp-prettier@3.0.3): + eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(wp-prettier@3.0.3): dependencies: - eslint: 8.57.0 + eslint: 8.57.1 prettier: wp-prettier@3.0.3 prettier-linter-helpers: 1.0.0 synckit: 0.9.2 optionalDependencies: - eslint-config-prettier: 9.1.0(eslint@8.57.0) + eslint-config-prettier: 9.1.0(eslint@8.57.1) - eslint-plugin-react-hooks@4.6.2(eslint@8.57.0): + eslint-plugin-react-hooks@4.6.2(eslint@8.57.1): dependencies: - eslint: 8.57.0 + eslint: 8.57.1 - eslint-plugin-react@7.35.0(eslint@8.57.0): + eslint-plugin-react@7.37.2(eslint@8.57.1): dependencies: array-includes: 3.1.8 array.prototype.findlast: 1.2.5 array.prototype.flatmap: 1.3.2 array.prototype.tosorted: 1.1.4 doctrine: 2.1.0 - es-iterator-helpers: 1.0.19 - eslint: 8.57.0 + es-iterator-helpers: 1.1.0 + eslint: 8.57.1 estraverse: 5.3.0 hasown: 2.0.2 jsx-ast-utils: 3.3.5 @@ -21461,29 +21472,29 @@ snapshots: string.prototype.matchall: 4.0.11 string.prototype.repeat: 1.0.0 - eslint-plugin-svelte@2.43.0(eslint@8.57.0)(svelte@4.2.19): + eslint-plugin-svelte@2.46.0(eslint@8.57.1)(svelte@4.2.19): dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) '@jridgewell/sourcemap-codec': 1.5.0 - eslint: 8.57.0 - eslint-compat-utils: 0.5.1(eslint@8.57.0) + eslint: 8.57.1 + eslint-compat-utils: 0.5.1(eslint@8.57.1) esutils: 2.0.3 - known-css-properties: 0.34.0 + known-css-properties: 0.35.0 postcss: 8.4.47 postcss-load-config: 3.1.4(postcss@8.4.47) postcss-safe-parser: 6.0.0(postcss@8.4.47) postcss-selector-parser: 6.1.2 semver: 7.6.3 - svelte-eslint-parser: 0.41.1(svelte@4.2.19) + svelte-eslint-parser: 0.43.0(svelte@4.2.19) optionalDependencies: svelte: 4.2.19 transitivePeerDependencies: - ts-node - eslint-plugin-testing-library@6.3.0(eslint@8.57.0)(typescript@5.0.4): + eslint-plugin-testing-library@6.4.0(eslint@8.57.1)(typescript@5.0.4): dependencies: - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.0.4) - eslint: 8.57.0 + '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@5.0.4) + eslint: 8.57.1 transitivePeerDependencies: - supports-color - typescript @@ -21502,13 +21513,15 @@ snapshots: eslint-visitor-keys@3.4.3: {} - eslint@8.57.0: + eslint-visitor-keys@4.1.0: {} + + eslint@8.57.1: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) '@eslint-community/regexpp': 4.11.1 '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.0 - '@humanwhocodes/config-array': 0.11.14 + '@eslint/js': 8.57.1 + '@humanwhocodes/config-array': 0.13.0 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 '@ungap/structured-clone': 1.2.0 @@ -21545,6 +21558,12 @@ snapshots: transitivePeerDependencies: - supports-color + espree@10.2.0: + dependencies: + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) + eslint-visitor-keys: 4.1.0 + espree@9.6.1: dependencies: acorn: 8.12.1 @@ -22628,7 +22647,7 @@ snapshots: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 - iterator.prototype@1.1.2: + iterator.prototype@1.1.3: dependencies: define-properties: 1.2.1 get-intrinsic: 1.2.4 @@ -23217,7 +23236,7 @@ snapshots: klona@2.0.6: {} - known-css-properties@0.34.0: {} + known-css-properties@0.35.0: {} kuler@2.0.0: {} @@ -25724,8 +25743,9 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 - string.prototype.includes@2.0.0: + string.prototype.includes@2.0.1: dependencies: + call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 @@ -25862,7 +25882,7 @@ snapshots: optionalDependencies: svelte: 4.2.19 - svelte-eslint-parser@0.41.1(svelte@4.2.19): + svelte-eslint-parser@0.43.0(svelte@4.2.19): dependencies: eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 diff --git a/projects/js-packages/boost-score-api/changelog/renovate-eslint-packages b/projects/js-packages/boost-score-api/changelog/renovate-eslint-packages new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/js-packages/boost-score-api/changelog/renovate-eslint-packages @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/js-packages/boost-score-api/package.json b/projects/js-packages/boost-score-api/package.json index 6aaa7889bafc4..7d1e968103ec8 100644 --- a/projects/js-packages/boost-score-api/package.json +++ b/projects/js-packages/boost-score-api/package.json @@ -26,7 +26,7 @@ "devDependencies": { "@automattic/jetpack-webpack-config": "workspace:*", "@typescript-eslint/parser": "6.21.0", - "eslint": "8.57.0", + "eslint": "8.57.1", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "typescript": "5.0.4", diff --git a/projects/js-packages/eslint-config-target-es/changelog/renovate-eslint-packages b/projects/js-packages/eslint-config-target-es/changelog/renovate-eslint-packages new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/js-packages/eslint-config-target-es/changelog/renovate-eslint-packages @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/js-packages/eslint-config-target-es/package.json b/projects/js-packages/eslint-config-target-es/package.json index 689e82c091855..d72c9716cf066 100644 --- a/projects/js-packages/eslint-config-target-es/package.json +++ b/projects/js-packages/eslint-config-target-es/package.json @@ -24,7 +24,7 @@ }, "devDependencies": { "@wordpress/browserslist-config": "6.9.0", - "eslint": "8.57.0", + "eslint": "8.57.1", "eslint-plugin-es-x": "7.8.0", "globals": "15.4.0", "jest": "29.7.0" diff --git a/projects/js-packages/image-guide/changelog/renovate-eslint-packages b/projects/js-packages/image-guide/changelog/renovate-eslint-packages new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/js-packages/image-guide/changelog/renovate-eslint-packages @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/js-packages/image-guide/package.json b/projects/js-packages/image-guide/package.json index d6144e403ce7c..f3c57482e6940 100644 --- a/projects/js-packages/image-guide/package.json +++ b/projects/js-packages/image-guide/package.json @@ -44,7 +44,7 @@ "@rollup/plugin-terser": "0.4.3", "@rollup/plugin-typescript": "12.1.0", "@typescript-eslint/parser": "6.21.0", - "eslint": "8.57.0", + "eslint": "8.57.1", "jest": "29.7.0", "postcss": "8.4.31", "rollup": "3.29.5", diff --git a/projects/js-packages/svelte-data-sync-client/changelog/renovate-eslint-packages#2 b/projects/js-packages/svelte-data-sync-client/changelog/renovate-eslint-packages#2 new file mode 100644 index 0000000000000..c47cb18e82997 --- /dev/null +++ b/projects/js-packages/svelte-data-sync-client/changelog/renovate-eslint-packages#2 @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Updated package dependencies. diff --git a/projects/js-packages/svelte-data-sync-client/package.json b/projects/js-packages/svelte-data-sync-client/package.json index 4eb9fc7fd00df..2f9d27cf28c85 100644 --- a/projects/js-packages/svelte-data-sync-client/package.json +++ b/projects/js-packages/svelte-data-sync-client/package.json @@ -26,7 +26,7 @@ "devDependencies": { "@automattic/jetpack-webpack-config": "workspace:*", "@typescript-eslint/parser": "6.21.0", - "eslint": "8.57.0", + "eslint": "8.57.1", "jest": "29.7.0", "svelte": "4.2.19", "tslib": "2.5.0", diff --git a/tools/js-tools/package.json b/tools/js-tools/package.json index 0e238c864e288..ea9398358565d 100644 --- a/tools/js-tools/package.json +++ b/tools/js-tools/package.json @@ -13,7 +13,7 @@ "@automattic/eslint-changed": "workspace:*", "@automattic/eslint-config-target-es": "workspace:*", "@babel/core": "7.24.7", - "@babel/eslint-parser": "7.24.7", + "@babel/eslint-parser": "7.25.9", "@babel/preset-react": "7.24.7", "@babel/preset-typescript": "7.24.7", "@octokit/auth-token": "5.1.1", @@ -28,22 +28,22 @@ "chalk": "4.1.2", "debug": "4.3.4", "enquirer": "2.4.1", - "eslint": "8.57.0", + "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", "eslint-import-resolver-exports": "1.0.0-beta.5", "eslint-plugin-es-x": "7.8.0", - "eslint-plugin-import": "2.29.1", + "eslint-plugin-import": "2.31.0", "eslint-plugin-jest": "27.9.0", "eslint-plugin-jest-dom": "5.4.0", - "eslint-plugin-jsdoc": "48.8.3", - "eslint-plugin-jsx-a11y": "6.9.0", + "eslint-plugin-jsdoc": "48.11.0", + "eslint-plugin-jsx-a11y": "6.10.1", "eslint-plugin-lodash": "7.4.0", "eslint-plugin-playwright": "0.22.2", "eslint-plugin-prettier": "5.2.1", - "eslint-plugin-react": "7.35.0", + "eslint-plugin-react": "7.37.2", "eslint-plugin-react-hooks": "4.6.2", - "eslint-plugin-svelte": "2.43.0", - "eslint-plugin-testing-library": "6.3.0", + "eslint-plugin-svelte": "2.46.0", + "eslint-plugin-testing-library": "6.4.0", "glob": "10.4.1", "ignore": "5.1.8", "jest": "29.7.0", From 4f0039e6904701cb4ce7546f9e551b6cadb8a679 Mon Sep 17 00:00:00 2001 From: Christian Gastrell Date: Fri, 25 Oct 2024 11:36:56 -0300 Subject: [PATCH 22/22] Jetpack AI: decouple modal prompt input for reusability (#39864) * decouple prompt input from prompt component, export it to make it available for other modals * allow passing down CTA button label as prop * implement AiModalPromptInput on GP image generation modal * changelog * fix wee css issue --- ...change-jetpack-ai-modal-prompt-input-reuse | 4 + .../src/logo-generator/components/prompt.tsx | 142 +++++++++++------- .../ai-client/src/logo-generator/index.ts | 1 + ...change-jetpack-ai-modal-prompt-input-reuse | 4 + .../ai-image/components/ai-image-modal.scss | 1 - .../ai-image/components/ai-image-modal.tsx | 77 ++-------- 6 files changed, 108 insertions(+), 121 deletions(-) create mode 100644 projects/js-packages/ai-client/changelog/change-jetpack-ai-modal-prompt-input-reuse create mode 100644 projects/plugins/jetpack/changelog/change-jetpack-ai-modal-prompt-input-reuse diff --git a/projects/js-packages/ai-client/changelog/change-jetpack-ai-modal-prompt-input-reuse b/projects/js-packages/ai-client/changelog/change-jetpack-ai-modal-prompt-input-reuse new file mode 100644 index 0000000000000..c4a38f6eb8440 --- /dev/null +++ b/projects/js-packages/ai-client/changelog/change-jetpack-ai-modal-prompt-input-reuse @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +AI Client: decouple prompt input as component and export it for reusability diff --git a/projects/js-packages/ai-client/src/logo-generator/components/prompt.tsx b/projects/js-packages/ai-client/src/logo-generator/components/prompt.tsx index 643bd0e3eb9fa..13a83c5a14140 100644 --- a/projects/js-packages/ai-client/src/logo-generator/components/prompt.tsx +++ b/projects/js-packages/ai-client/src/logo-generator/components/prompt.tsx @@ -7,6 +7,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { Icon, info } from '@wordpress/icons'; import debugFactory from 'debug'; import { useCallback, useEffect, useState, useRef } from 'react'; +import { Dispatch, SetStateAction } from 'react'; /** * Internal dependencies */ @@ -37,6 +38,81 @@ type PromptProps = { initialPrompt?: string; }; +export const AiModalPromptInput = ( { + prompt = '', + setPrompt = () => {}, + disabled = false, + generateHandler = () => {}, + placeholder = '', + buttonLabel = '', +}: { + prompt: string; + setPrompt: Dispatch< SetStateAction< string > >; + disabled: boolean; + generateHandler: () => void; + placeholder?: string; + buttonLabel?: string; +} ) => { + const inputRef = useRef< HTMLDivElement | null >( null ); + const hasPrompt = prompt?.length >= MINIMUM_PROMPT_LENGTH; + + const onPromptInput = ( event: React.ChangeEvent< HTMLInputElement > ) => { + setPrompt( event.target.textContent || '' ); + }; + + const onPromptPaste = ( event: React.ClipboardEvent< HTMLInputElement > ) => { + event.preventDefault(); + + const selection = event.currentTarget.ownerDocument.getSelection(); + if ( ! selection || ! selection.rangeCount ) { + return; + } + + // Paste plain text only + const text = event.clipboardData.getData( 'text/plain' ); + + selection.deleteFromDocument(); + const range = selection.getRangeAt( 0 ); + range.insertNode( document.createTextNode( text ) ); + selection.collapseToEnd(); + + setPrompt( inputRef.current?.textContent || '' ); + }; + + const onKeyDown = ( event: React.KeyboardEvent ) => { + if ( event.key === 'Enter' ) { + event.preventDefault(); + generateHandler(); + } + }; + + return ( +
+
+ +
+ ); +}; + export const Prompt = ( { initialPrompt = '' }: PromptProps ) => { const { tracks } = useAnalytics(); const { recordEvent: recordTracksEvent } = tracks; @@ -143,29 +219,6 @@ export const Prompt = ( { initialPrompt = '' }: PromptProps ) => { } }, [ context, generateLogo, prompt, style ] ); - const onPromptInput = ( event: React.ChangeEvent< HTMLInputElement > ) => { - setPrompt( event.target.textContent || '' ); - }; - - const onPromptPaste = ( event: React.ClipboardEvent< HTMLInputElement > ) => { - event.preventDefault(); - - const selection = event.currentTarget.ownerDocument.getSelection(); - if ( ! selection || ! selection.rangeCount ) { - return; - } - - // Paste plain text only - const text = event.clipboardData.getData( 'text/plain' ); - - selection.deleteFromDocument(); - const range = selection.getRangeAt( 0 ); - range.insertNode( document.createTextNode( text ) ); - selection.collapseToEnd(); - - setPrompt( inputRef.current?.textContent || '' ); - }; - const onUpgradeClick = () => { recordTracksEvent( EVENT_UPGRADE, { context, placement: EVENT_PLACEMENT_INPUT_FOOTER } ); }; @@ -179,13 +232,6 @@ export const Prompt = ( { initialPrompt = '' }: PromptProps ) => { [ context, setStyle, recordTracksEvent ] ); - const onKeyDown = ( event: React.KeyboardEvent ) => { - if ( event.key === 'Enter' ) { - event.preventDefault(); - onGenerate(); - } - }; - return (
@@ -212,32 +258,16 @@ export const Prompt = ( { initialPrompt = '' }: PromptProps ) => { /> ) }
-
-
- -
+
{ ! isUnlimited && ! requireUpgrade && (
diff --git a/projects/js-packages/ai-client/src/logo-generator/index.ts b/projects/js-packages/ai-client/src/logo-generator/index.ts index e6a9b9dec67ce..fab7b12e9442f 100644 --- a/projects/js-packages/ai-client/src/logo-generator/index.ts +++ b/projects/js-packages/ai-client/src/logo-generator/index.ts @@ -1 +1,2 @@ export * from './components/generator-modal.js'; +export { AiModalPromptInput } from './components/prompt.js'; diff --git a/projects/plugins/jetpack/changelog/change-jetpack-ai-modal-prompt-input-reuse b/projects/plugins/jetpack/changelog/change-jetpack-ai-modal-prompt-input-reuse new file mode 100644 index 0000000000000..958a637ead149 --- /dev/null +++ b/projects/plugins/jetpack/changelog/change-jetpack-ai-modal-prompt-input-reuse @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Jetpack AI: use new exported component for AI generation modal on GP image generation diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/ai-image-modal.scss b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/ai-image-modal.scss index 0f914277191bc..c47eb5e218245 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/ai-image-modal.scss +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/ai-image-modal.scss @@ -15,7 +15,6 @@ &__actions { width: 100%; display: flex; - justify-content: center; } &__user-prompt { diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/ai-image-modal.tsx b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/ai-image-modal.tsx index 12572e7df2284..ec2868aaabdd3 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/ai-image-modal.tsx +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/ai-image-modal.tsx @@ -1,9 +1,10 @@ /** * External dependencies */ -import { Button, Tooltip, KeyboardShortcuts } from '@wordpress/components'; +import { AiModalPromptInput } from '@automattic/jetpack-ai-client'; +import { Button } from '@wordpress/components'; import { useCallback, useRef, useState, useEffect } from '@wordpress/element'; -import { __, sprintf } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { Icon, external } from '@wordpress/icons'; /** * Internal dependencies @@ -34,13 +35,11 @@ export default function AiImageModal( { isUnlimited = false, upgradeDescription = null, hasError = false, - postContent = null, handlePreviousImage = () => {}, handleNextImage = () => {}, acceptButton = null, autoStart = false, autoStartAction = null, - generateButtonLabel = null, instructionsPlaceholder = null, }: { title: string; @@ -72,13 +71,6 @@ export default function AiImageModal( { const [ userPrompt, setUserPrompt ] = useState( '' ); const triggeredAutoGeneration = useRef( false ); - const handleUserPromptChange = useCallback( - ( e: React.ChangeEvent< HTMLTextAreaElement > ) => { - setUserPrompt( e.target.value.trim() ); - }, - [ setUserPrompt ] - ); - const handleTryAgain = useCallback( () => { onTryAgain?.( { userPrompt } ); }, [ onTryAgain, userPrompt ] ); @@ -87,37 +79,13 @@ export default function AiImageModal( { onGenerate?.( { userPrompt } ); }, [ onGenerate, userPrompt ] ); - const costTooltipTextSingular = __( '1 request per image', 'jetpack' ); - - const costTooltipTextPlural = sprintf( - // Translators: %d is the cost of generating one image. - __( '%d requests per image', 'jetpack' ), - cost - ); - - const costTooltipText = cost === 1 ? costTooltipTextSingular : costTooltipTextPlural; - // Controllers const instructionsDisabled = notEnoughRequests || generating || requireUpgrade; const upgradePromptVisible = ( requireUpgrade || notEnoughRequests ) && ! generating; const counterVisible = Boolean( ! isUnlimited && cost && currentLimit ); - const tryAgainButtonDisabled = ! userPrompt && ! postContent; - const generateButtonDisabled = - notEnoughRequests || generating || ( ! userPrompt && ! postContent ); - const tryAgainButton = ( - - ); - - const generateButton = ( - - - - ); + const generateLabel = __( 'Generate', 'jetpack' ); + const tryAgainLabel = __( 'Try again', 'jetpack' ); /** * Trigger image generation automatically. @@ -136,28 +104,14 @@ export default function AiImageModal( { { open && (
-
-
- { - if ( ! generateButtonDisabled ) { - handleGenerate(); - } - }, - } } - > - - -
-
+ { upgradePromptVisible && ( ) }
-
-
- { hasError ? tryAgainButton : generateButton } -
-