From 2c7f0b9bf8cdc7717ffc1021dd1592afe73f0fa9 Mon Sep 17 00:00:00 2001 From: Christian Gastrell Date: Mon, 18 May 2026 11:47:15 -0300 Subject: [PATCH 1/5] Componentry: migrate ContextualUpgradeTrigger to @wordpress/ui Notice --- .../changelog/change-migrate-cut-wp-ui | 4 ++ .../contextual-upgrade-trigger/index.tsx | 15 ++++ .../scan/changelog/change-migrate-cut-wp-ui | 4 ++ .../threat-modal/threat-fix-details.tsx | 21 +++--- .../toggles/social-module-toggle/index.tsx | 52 ++++++++------ .../social-module-toggle/styles.module.scss | 12 ++++ .../changelog/change-migrate-cut-wp-ui | 4 ++ .../search/changelog/change-migrate-cut-wp-ui | 4 ++ .../pages/sections/plan-usage-section.jsx | 21 +++--- .../sections/test/plan-usage-section.test.jsx | 20 +++--- .../dashboard/pages/dashboard-page.test.jsx | 1 - .../changelog/change-migrate-cut-wp-ui | 4 ++ .../admin/components/admin-page/index.tsx | 14 ++-- .../changelog/change-migrate-cut-wp-ui | 4 ++ .../js/components/threats-list/free-list.jsx | 5 +- .../js/components/upgrade-notice/index.tsx | 71 +++++++++++++++++++ .../protect/src/js/routes/firewall/index.jsx | 4 +- .../src/js/routes/scan/scan-footer.jsx | 4 +- 18 files changed, 200 insertions(+), 64 deletions(-) create mode 100644 projects/js-packages/components/changelog/change-migrate-cut-wp-ui create mode 100644 projects/js-packages/scan/changelog/change-migrate-cut-wp-ui create mode 100644 projects/packages/publicize/changelog/change-migrate-cut-wp-ui create mode 100644 projects/packages/search/changelog/change-migrate-cut-wp-ui create mode 100644 projects/packages/videopress/changelog/change-migrate-cut-wp-ui create mode 100644 projects/plugins/protect/changelog/change-migrate-cut-wp-ui create mode 100644 projects/plugins/protect/src/js/components/upgrade-notice/index.tsx diff --git a/projects/js-packages/components/changelog/change-migrate-cut-wp-ui b/projects/js-packages/components/changelog/change-migrate-cut-wp-ui new file mode 100644 index 000000000000..ec760138cee1 --- /dev/null +++ b/projects/js-packages/components/changelog/change-migrate-cut-wp-ui @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Mark ContextualUpgradeTrigger as @deprecated. Use Notice from @wordpress/ui instead. The implementation is unchanged. diff --git a/projects/js-packages/components/components/contextual-upgrade-trigger/index.tsx b/projects/js-packages/components/components/contextual-upgrade-trigger/index.tsx index 2c43bd797ed2..ecd0f75f1ba9 100644 --- a/projects/js-packages/components/components/contextual-upgrade-trigger/index.tsx +++ b/projects/js-packages/components/components/contextual-upgrade-trigger/index.tsx @@ -6,6 +6,21 @@ import styles from './style.module.scss'; import { CutBaseProps } from './types.ts'; import type { FC } from 'react'; +/** + * ContextualUpgradeTrigger component. + * + * @deprecated Use `Notice` from `@wordpress/ui` instead. Compose with `Notice.Root` (`intent="info"`), `Notice.Description` for the body, and `Notice.Actions` + `Notice.ActionLink` / `Notice.ActionButton` for the CTA. See https://github.com/Automattic/jetpack/issues/48160 for migration guidance. + * + * @param props - The component properties. + * @param props.description - The body copy describing the upgrade context. + * @param props.cta - The CTA label. + * @param props.onClick - Click handler when rendered as a button. + * @param props.href - When provided, renders as an anchor instead of a button. + * @param props.openInNewTab - Whether to open the link in a new tab. + * @param props.className - Optional class for the root element. + * @param props.tooltipText - Optional tooltip body shown next to the description. + * @return The rendered upgrade trigger. + */ const ContextualUpgradeTrigger: FC< CutBaseProps > = ( { description, cta, diff --git a/projects/js-packages/scan/changelog/change-migrate-cut-wp-ui b/projects/js-packages/scan/changelog/change-migrate-cut-wp-ui new file mode 100644 index 000000000000..b25b23aae75c --- /dev/null +++ b/projects/js-packages/scan/changelog/change-migrate-cut-wp-ui @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Replace internal ContextualUpgradeTrigger upgrade prompts with @wordpress/ui Notice composition. Internal refactor with a Notice-style visual refresh. diff --git a/projects/js-packages/scan/src/components/threat-modal/threat-fix-details.tsx b/projects/js-packages/scan/src/components/threat-modal/threat-fix-details.tsx index eb5a2b00d9ef..466f6490bad3 100644 --- a/projects/js-packages/scan/src/components/threat-modal/threat-fix-details.tsx +++ b/projects/js-packages/scan/src/components/threat-modal/threat-fix-details.tsx @@ -1,5 +1,6 @@ -import { ContextualUpgradeTrigger, Text } from '@automattic/jetpack-components'; +import { Text } from '@automattic/jetpack-components'; import { __, sprintf } from '@wordpress/i18n'; +import { Notice } from '@wordpress/ui'; import { useMemo, useContext } from 'react'; import { getFixerDescription } from '@automattic/jetpack-scan'; import { ThreatModalContext } from './index.tsx'; @@ -48,14 +49,16 @@ const ThreatFixDetails = (): JSX.Element => { { title } { fix } { handleUpgradeClick && ( - + + + { __( 'Looking for advanced scan results and one-click fixes?', 'jetpack-scan' ) } + + + + { __( 'Upgrade Jetpack now', 'jetpack-scan' ) } + + + ) } ); diff --git a/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/index.tsx b/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/index.tsx index 186e89b5e69e..0713f28cab4e 100644 --- a/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/index.tsx +++ b/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/index.tsx @@ -1,13 +1,9 @@ -import { - ContextualUpgradeTrigger, - Text, - getRedirectUrl, - useBreakpointMatch, -} from '@automattic/jetpack-components'; +import { Text, getRedirectUrl, useBreakpointMatch } from '@automattic/jetpack-components'; import { getScriptData, isWpcomPlatformSite } from '@automattic/jetpack-script-data'; import { useSelect, useDispatch } from '@wordpress/data'; import { __, _x } from '@wordpress/i18n'; -import { Link } from '@wordpress/ui'; +import { Icon, info } from '@wordpress/icons'; +import { Link, Notice, Tooltip } from '@wordpress/ui'; import clsx from 'clsx'; import { useCallback } from 'react'; import { store as socialStore } from '../../../../social-store'; @@ -93,19 +89,35 @@ const SocialModuleToggle: FC = () => { { ! isWpcomPlatformSite() && ! hasSocialPaidFeatures() ? ( - + + + { __( 'Unlock advanced sharing options', 'jetpack-publicize-pkg' ) }{ ' ' } + + + + + + { __( + 'Share custom images and videos that capture attention, use our powerful Social Image Generator to create stunning visuals, and access priority support for expert help whenever you need it.', + 'jetpack-publicize-pkg' + ) } + + + + + + { __( 'Power up Jetpack Social', 'jetpack-publicize-pkg' ) } + + + ) : null } { isModuleEnabled && } { renderConnectionManagement() } diff --git a/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/styles.module.scss b/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/styles.module.scss index 39ab329a136b..6adef18e0758 100644 --- a/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/styles.module.scss +++ b/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/styles.module.scss @@ -44,3 +44,15 @@ .learn { text-wrap: nowrap; } + +.upgrade-tooltip-trigger { + display: inline-flex; + align-items: center; + vertical-align: middle; + padding: 0; + margin: 0; + background: transparent; + border: 0; + color: inherit; + cursor: help; +} diff --git a/projects/packages/publicize/changelog/change-migrate-cut-wp-ui b/projects/packages/publicize/changelog/change-migrate-cut-wp-ui new file mode 100644 index 000000000000..b25b23aae75c --- /dev/null +++ b/projects/packages/publicize/changelog/change-migrate-cut-wp-ui @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Replace internal ContextualUpgradeTrigger upgrade prompts with @wordpress/ui Notice composition. Internal refactor with a Notice-style visual refresh. diff --git a/projects/packages/search/changelog/change-migrate-cut-wp-ui b/projects/packages/search/changelog/change-migrate-cut-wp-ui new file mode 100644 index 000000000000..b25b23aae75c --- /dev/null +++ b/projects/packages/search/changelog/change-migrate-cut-wp-ui @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Replace internal ContextualUpgradeTrigger upgrade prompts with @wordpress/ui Notice composition. Internal refactor with a Notice-style visual refresh. diff --git a/projects/packages/search/src/dashboard/components/pages/sections/plan-usage-section.jsx b/projects/packages/search/src/dashboard/components/pages/sections/plan-usage-section.jsx index 51ea85ecedb3..149081c6843e 100644 --- a/projects/packages/search/src/dashboard/components/pages/sections/plan-usage-section.jsx +++ b/projects/packages/search/src/dashboard/components/pages/sections/plan-usage-section.jsx @@ -1,7 +1,6 @@ -import { ContextualUpgradeTrigger, ThemeProvider } from '@automattic/jetpack-components'; import { createInterpolateElement } from '@wordpress/element'; import { __, sprintf } from '@wordpress/i18n'; -import { Link } from '@wordpress/ui'; +import { Link, Notice } from '@wordpress/ui'; import { useState, useCallback, useMemo } from 'react'; import DonutMeterContainer, { formatNumber } from '../../donut-meter-container'; import PlanSummary from './plan-summary'; @@ -300,17 +299,17 @@ const getUpgradeMessages = () => { }; const UpgradeTrigger = ( { upgradeMessage, ctaCallback } ) => { - // const upgradeMessage = type && getUpgradeMessages()[ type ]; - const triggerData = upgradeMessage && { ...upgradeMessage, onClick: ctaCallback }; + if ( ! upgradeMessage ) { + return null; + } return ( - <> - { triggerData && ( - - - - ) } - + + { upgradeMessage.description } + + { upgradeMessage.cta } + + ); }; diff --git a/projects/packages/search/src/dashboard/components/pages/sections/test/plan-usage-section.test.jsx b/projects/packages/search/src/dashboard/components/pages/sections/test/plan-usage-section.test.jsx index 6bfc782d8f10..66f887120bdc 100644 --- a/projects/packages/search/src/dashboard/components/pages/sections/test/plan-usage-section.test.jsx +++ b/projects/packages/search/src/dashboard/components/pages/sections/test/plan-usage-section.test.jsx @@ -1,18 +1,18 @@ import { render, screen } from '@testing-library/react'; import PlanUsageSection from '../plan-usage-section'; -jest.mock( '@automattic/jetpack-components', () => ( { - ContextualUpgradeTrigger: ( { description, cta } ) => ( -
- { description } - { cta } -
- ), - ThemeProvider: ( { children } ) => <>{ children }, -} ) ); - jest.mock( '@wordpress/ui', () => ( { Link: ( { children, href } ) => { children }, + Notice: { + Root: ( { children } ) =>
{ children }
, + Description: ( { children } ) => { children }, + Actions: ( { children } ) =>
{ children }
, + ActionButton: ( { children, onClick } ) => ( + + ), + }, } ) ); jest.mock( '../../../donut-meter-container', () => { diff --git a/projects/packages/search/tests/js/dashboard/pages/dashboard-page.test.jsx b/projects/packages/search/tests/js/dashboard/pages/dashboard-page.test.jsx index 2007a5cf78f0..e5b983735cd7 100644 --- a/projects/packages/search/tests/js/dashboard/pages/dashboard-page.test.jsx +++ b/projects/packages/search/tests/js/dashboard/pages/dashboard-page.test.jsx @@ -8,7 +8,6 @@ jest.mock( Button: ( { children, ...rest } ) => , Container: ( { children } ) =>
{ children }
, Col: ( { children } ) =>
{ children }
, - ContextualUpgradeTrigger: ( { children } ) =>
{ children }
, DonutMeter: () =>
, Gridicon: () => , IconTooltip: ( { children } ) =>
{ children }
, diff --git a/projects/packages/videopress/changelog/change-migrate-cut-wp-ui b/projects/packages/videopress/changelog/change-migrate-cut-wp-ui new file mode 100644 index 000000000000..b25b23aae75c --- /dev/null +++ b/projects/packages/videopress/changelog/change-migrate-cut-wp-ui @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Replace internal ContextualUpgradeTrigger upgrade prompts with @wordpress/ui Notice composition. Internal refactor with a Notice-style visual refresh. diff --git a/projects/packages/videopress/src/client/admin/components/admin-page/index.tsx b/projects/packages/videopress/src/client/admin/components/admin-page/index.tsx index 3e8f9272b994..ea63b60545ec 100644 --- a/projects/packages/videopress/src/client/admin/components/admin-page/index.tsx +++ b/projects/packages/videopress/src/client/admin/components/admin-page/index.tsx @@ -10,7 +10,6 @@ import { Button, Col, useBreakpointMatch, - ContextualUpgradeTrigger, } from '@automattic/jetpack-components'; import { useProductCheckoutWorkflow, @@ -19,6 +18,7 @@ import { } from '@automattic/jetpack-connection'; import { FormFileUpload } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; +import { Notice } from '@wordpress/ui'; import clsx from 'clsx'; import { useState } from 'react'; /** @@ -246,11 +246,11 @@ const UpgradeTrigger = ( { hasUsedVideo = false }: { hasUsedVideo: boolean } ) = ); return ( - + + { description && { description } } + + { cta } + + ); }; diff --git a/projects/plugins/protect/changelog/change-migrate-cut-wp-ui b/projects/plugins/protect/changelog/change-migrate-cut-wp-ui new file mode 100644 index 000000000000..b25b23aae75c --- /dev/null +++ b/projects/plugins/protect/changelog/change-migrate-cut-wp-ui @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Replace internal ContextualUpgradeTrigger upgrade prompts with @wordpress/ui Notice composition. Internal refactor with a Notice-style visual refresh. diff --git a/projects/plugins/protect/src/js/components/threats-list/free-list.jsx b/projects/plugins/protect/src/js/components/threats-list/free-list.jsx index 76cde0a0e02b..68e220ccfe81 100644 --- a/projects/plugins/protect/src/js/components/threats-list/free-list.jsx +++ b/projects/plugins/protect/src/js/components/threats-list/free-list.jsx @@ -1,9 +1,10 @@ -import { Text, Button, ContextualUpgradeTrigger } from '@automattic/jetpack-components'; +import { Text, Button } from '@automattic/jetpack-components'; import { __, sprintf } from '@wordpress/i18n'; import { useCallback } from 'react'; import useAnalyticsTracks from '../../hooks/use-analytics-tracks'; import usePlan from '../../hooks/use-plan'; import FreeAccordion, { FreeAccordionItem } from '../free-accordion'; +import UpgradeNotice from '../upgrade-notice'; import Pagination from './pagination'; import styles from './styles.module.scss'; @@ -65,7 +66,7 @@ const ThreatAccordionItem = ( { sprintf( __( 'Update to %1$s %2$s', 'jetpack-protect' ), name, fixedIn ) } - ; + /** + * Optional href. When set, renders an ActionLink instead of an ActionButton. + */ + href?: string; + /** + * Whether to open the link in a new tab. Only applies when `href` is set. + */ + openInNewTab?: boolean; + /** + * Forwarded to the underlying Notice.Root for layout overrides. + */ + className?: string; +} + +/** + * Package-local upgrade-notice helper, built on `@wordpress/ui` `Notice`. + * + * Wraps the `Notice.Root` + `Notice.Description` + `Notice.Actions` composition so the + * three Protect upgrade-trigger sites stay terse. Replaces the deprecated + * `ContextualUpgradeTrigger` from `@automattic/jetpack-components`. + * + * @param props - Component properties. + * @param props.description - Body copy describing the upgrade context. + * @param props.cta - CTA label for the action. + * @param props.onClick - Click handler for the CTA (used when `href` is unset). + * @param props.href - Optional href. When set, renders an ActionLink. + * @param props.openInNewTab - Whether to open the link in a new tab. Only applies when `href` is set. + * @param props.className - Optional class forwarded to the underlying Notice.Root. + * @return The rendered upgrade notice. + */ +const UpgradeNotice: FC< UpgradeNoticeProps > = ( { + description, + cta, + onClick, + href, + openInNewTab = false, + className, +} ) => { + return ( + + { description } + + { href !== undefined ? ( + + { cta } + + ) : ( + { cta } + ) } + + + ); +}; + +export default UpgradeNotice; diff --git a/projects/plugins/protect/src/js/routes/firewall/index.jsx b/projects/plugins/protect/src/js/routes/firewall/index.jsx index b261029e3119..1a6015eacef3 100644 --- a/projects/plugins/protect/src/js/routes/firewall/index.jsx +++ b/projects/plugins/protect/src/js/routes/firewall/index.jsx @@ -4,7 +4,6 @@ import { Container, Text, ToggleControl, - ContextualUpgradeTrigger, useBreakpointMatch, } from '@automattic/jetpack-components'; import { Popover } from '@wordpress/components'; @@ -15,6 +14,7 @@ import { Notice } from '@wordpress/ui'; import moment from 'moment'; import { useCallback, useEffect, useState, useMemo } from 'react'; import Textarea from '../../components/textarea'; +import UpgradeNotice from '../../components/upgrade-notice'; import { FREE_PLUGIN_SUPPORT_URL, PAID_PLUGIN_SUPPORT_URL } from '../../constants'; import useWafUpgradeSeenMutation from '../../data/waf/use-waf-upgrade-seen-mutation'; import useAnalyticsTracks from '../../hooks/use-analytics-tracks'; @@ -350,7 +350,7 @@ const FirewallPage = () => {
{ ! hasPlan && (
- { ) } - Date: Mon, 18 May 2026 15:02:42 -0300 Subject: [PATCH 2/5] Publicize: register wp-build-polyfills before social-admin-page enqueue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CUT → Notice migration in social-module-toggle pulled in @wordpress/ui's Tooltip composition, which transitively chains through @wordpress/theme's private-apis. social-admin-page.asset.php now declares wp-theme and wp-private-apis as deps — neither is in WP core, both are polyfilled by wp-build-polyfills. class-social-admin-page.php was enqueuing social-admin-page directly without first registering the polyfills, so the new handles 404'd and the browser threw 'SyntaxError: Unexpected token <' parsing the HTML error page as JS. React tree never mounted, Social e2e times out at the onboarding 'Get Started' button. Pattern matches what videopress / forms / scan / podcast / newsletter / backup already do. --- projects/packages/publicize/composer.json | 1 + .../publicize/src/class-social-admin-page.php | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/projects/packages/publicize/composer.json b/projects/packages/publicize/composer.json index 3715b0fe75f2..148bc7d09e03 100644 --- a/projects/packages/publicize/composer.json +++ b/projects/packages/publicize/composer.json @@ -10,6 +10,7 @@ "automattic/jetpack-autoloader": "@dev", "automattic/jetpack-config": "@dev", "automattic/jetpack-assets": "@dev", + "automattic/jetpack-wp-build-polyfills": "@dev", "automattic/jetpack-redirect": "@dev", "automattic/jetpack-plans": "@dev", "automattic/jetpack-post-media": "@dev", diff --git a/projects/packages/publicize/src/class-social-admin-page.php b/projects/packages/publicize/src/class-social-admin-page.php index 27048fb14820..581d681d9517 100644 --- a/projects/packages/publicize/src/class-social-admin-page.php +++ b/projects/packages/publicize/src/class-social-admin-page.php @@ -13,6 +13,7 @@ use Automattic\Jetpack\Current_Plan; use Automattic\Jetpack\Publicize\Publicize_Utils as Utils; use Automattic\Jetpack\Status\Host; +use Automattic\Jetpack\WP_Build_Polyfills\WP_Build_Polyfills; /** * The class to handle the Social Admin Page. @@ -129,6 +130,16 @@ public function enqueue_admin_scripts() { wp_dequeue_script( 'jetpack-social' ); wp_dequeue_style( 'jetpack-social' ); + // Register polyfills for WP < 7.0 (must run before enqueue). + // social-admin-page now depends on wp-theme and wp-private-apis via @wordpress/ui's Tooltip composition. + WP_Build_Polyfills::register( + 'jetpack-publicize', + array_merge( + WP_Build_Polyfills::SCRIPT_HANDLES, + WP_Build_Polyfills::MODULE_IDS + ) + ); + Assets::register_script( 'social-admin-page', '../build/social-admin-page.js', From ec52b40c633115ce9f79ad3e2eb6c10c5ba0bd15 Mon Sep 17 00:00:00 2001 From: Christian Gastrell Date: Mon, 18 May 2026 15:09:33 -0300 Subject: [PATCH 3/5] Lockfile: regenerate consumer composer.lock after publicize wp-build-polyfills dep --- .../changelog/change-migrate-cut-wp-ui | 4 + projects/plugins/jetpack/composer.lock | 29 +++--- .../social/changelog/change-migrate-cut-wp-ui | 4 + projects/plugins/social/composer.lock | 91 ++++++++++++++++--- 4 files changed, 100 insertions(+), 28 deletions(-) create mode 100644 projects/plugins/jetpack/changelog/change-migrate-cut-wp-ui create mode 100644 projects/plugins/social/changelog/change-migrate-cut-wp-ui diff --git a/projects/plugins/jetpack/changelog/change-migrate-cut-wp-ui b/projects/plugins/jetpack/changelog/change-migrate-cut-wp-ui new file mode 100644 index 000000000000..d3d7af02823a --- /dev/null +++ b/projects/plugins/jetpack/changelog/change-migrate-cut-wp-ui @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Lockfile: regenerate after publicize gained wp-build-polyfills dep for social-admin-page. diff --git a/projects/plugins/jetpack/composer.lock b/projects/plugins/jetpack/composer.lock index 104d08f1893f..05747c8d73cd 100644 --- a/projects/plugins/jetpack/composer.lock +++ b/projects/plugins/jetpack/composer.lock @@ -2913,7 +2913,7 @@ "dist": { "type": "path", "url": "../../packages/publicize", - "reference": "2747f5de7472b6f15e6a19a4ae630129019f8800" + "reference": "8b4013a361a742707ccc1491dd90eafe72142470" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -2925,6 +2925,7 @@ "automattic/jetpack-post-media": "@dev", "automattic/jetpack-redirect": "@dev", "automattic/jetpack-status": "@dev", + "automattic/jetpack-wp-build-polyfills": "@dev", "php": ">=7.2" }, "require-dev": { @@ -4736,16 +4737,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.5.24", + "version": "12.5.25", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "d75dd30597caa80e72fad2ef7904601a30ef1046" + "reference": "792c2980442dfce319226b88fa845b8b6de3b333" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d75dd30597caa80e72fad2ef7904601a30ef1046", - "reference": "d75dd30597caa80e72fad2ef7904601a30ef1046", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/792c2980442dfce319226b88fa845b8b6de3b333", + "reference": "792c2980442dfce319226b88fa845b8b6de3b333", "shasum": "" }, "require": { @@ -4814,7 +4815,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.24" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.25" }, "funding": [ { @@ -4822,27 +4823,27 @@ "type": "other" } ], - "time": "2026-05-01T04:21:04+00:00" + "time": "2026-05-13T03:56:57+00:00" }, { "name": "sebastian/cli-parser", - "version": "4.2.0", + "version": "4.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04" + "reference": "7d05781b13f7dec9043a629a21d086ed74582a15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/90f41072d220e5c40df6e8635f5dafba2d9d4d04", - "reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/7d05781b13f7dec9043a629a21d086ed74582a15", + "reference": "7d05781b13f7dec9043a629a21d086ed74582a15", "shasum": "" }, "require": { "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^12.5.25" }, "type": "library", "extra": { @@ -4871,7 +4872,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.0" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.1" }, "funding": [ { @@ -4891,7 +4892,7 @@ "type": "tidelift" } ], - "time": "2025-09-14T09:36:45+00:00" + "time": "2026-05-17T05:29:34+00:00" }, { "name": "sebastian/comparator", diff --git a/projects/plugins/social/changelog/change-migrate-cut-wp-ui b/projects/plugins/social/changelog/change-migrate-cut-wp-ui new file mode 100644 index 000000000000..6709885af28e --- /dev/null +++ b/projects/plugins/social/changelog/change-migrate-cut-wp-ui @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Lockfile: regenerate after publicize gained wp-build-polyfills dep for social-admin-page. diff --git a/projects/plugins/social/composer.lock b/projects/plugins/social/composer.lock index 4ba09870934c..0f658b4e246d 100644 --- a/projects/plugins/social/composer.lock +++ b/projects/plugins/social/composer.lock @@ -1704,7 +1704,7 @@ "dist": { "type": "path", "url": "../../packages/publicize", - "reference": "2747f5de7472b6f15e6a19a4ae630129019f8800" + "reference": "8b4013a361a742707ccc1491dd90eafe72142470" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -1716,6 +1716,7 @@ "automattic/jetpack-post-media": "@dev", "automattic/jetpack-redirect": "@dev", "automattic/jetpack-status": "@dev", + "automattic/jetpack-wp-build-polyfills": "@dev", "php": ">=7.2" }, "require-dev": { @@ -2028,6 +2029,68 @@ "transport-options": { "relative": true } + }, + { + "name": "automattic/jetpack-wp-build-polyfills", + "version": "dev-trunk", + "dist": { + "type": "path", + "url": "../../packages/wp-build-polyfills", + "reference": "b3add2c04a4cd1844f5686cbc8515404cbe6d83d" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "automattic/jetpack-test-environment": "@dev", + "automattic/phpunit-select-config": "@dev", + "yoast/phpunit-polyfills": "^4.0.0" + }, + "type": "jetpack-library", + "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-wp-build-polyfills", + "textdomain": "jetpack-wp-build-polyfills", + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-wp-build-polyfills/compare/v${old}...v${new}" + }, + "branch-alias": { + "dev-trunk": "0.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "build-production": [ + "pnpm run build-production" + ], + "build-development": [ + "pnpm run build" + ], + "phpunit": [ + "phpunit-select-config phpunit.#.xml.dist --colors=always" + ], + "test-coverage": [ + "php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"$COVERAGE_DIR/php.cov\"" + ], + "test-php": [ + "@composer phpunit" + ], + "test-js": [ + "pnpm run build", + "pnpm run test" + ] + }, + "license": [ + "GPL-2.0-or-later" + ], + "description": "Polyfills for WordPress Core packages not available in WP < 7.0", + "transport-options": { + "relative": true + } } ], "packages-dev": [ @@ -2979,16 +3042,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.5.24", + "version": "12.5.25", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "d75dd30597caa80e72fad2ef7904601a30ef1046" + "reference": "792c2980442dfce319226b88fa845b8b6de3b333" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d75dd30597caa80e72fad2ef7904601a30ef1046", - "reference": "d75dd30597caa80e72fad2ef7904601a30ef1046", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/792c2980442dfce319226b88fa845b8b6de3b333", + "reference": "792c2980442dfce319226b88fa845b8b6de3b333", "shasum": "" }, "require": { @@ -3057,7 +3120,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.24" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.25" }, "funding": [ { @@ -3065,27 +3128,27 @@ "type": "other" } ], - "time": "2026-05-01T04:21:04+00:00" + "time": "2026-05-13T03:56:57+00:00" }, { "name": "sebastian/cli-parser", - "version": "4.2.0", + "version": "4.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04" + "reference": "7d05781b13f7dec9043a629a21d086ed74582a15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/90f41072d220e5c40df6e8635f5dafba2d9d4d04", - "reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/7d05781b13f7dec9043a629a21d086ed74582a15", + "reference": "7d05781b13f7dec9043a629a21d086ed74582a15", "shasum": "" }, "require": { "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^12.5.25" }, "type": "library", "extra": { @@ -3114,7 +3177,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.0" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.1" }, "funding": [ { @@ -3134,7 +3197,7 @@ "type": "tidelift" } ], - "time": "2025-09-14T09:36:45+00:00" + "time": "2026-05-17T05:29:34+00:00" }, { "name": "sebastian/comparator", From b3ceac300e2cd7b179f16cdc4fb8db01e05c5bfa Mon Sep 17 00:00:00 2001 From: Christian Gastrell Date: Mon, 18 May 2026 18:06:26 -0300 Subject: [PATCH 4/5] Publicize: use IconTooltip from jetpack-components instead of @wordpress/ui Tooltip The wp-theme polyfill registration approach didn't take effect in publicize's older Assets::register_script pipeline. After diagnosis: no consumer in the codebase has shipped a working @wordpress/ui Tooltip in a non-wp-build plugin yet. Boost (the closest precedent) keeps IconTooltip from jetpack-components for the same reason. Revert the wp-build-polyfills wiring + lockfile regen. Use IconTooltip in social-module-toggle's upgrade Notice. Preserves click-toggle UX from the original CUT tooltipText. IconTooltip migration becomes a separate slice later (item #7 in the shadow analysis priority). --- .../toggles/social-module-toggle/index.tsx | 24 +++-- .../social-module-toggle/styles.module.scss | 11 --- projects/packages/publicize/composer.json | 1 - .../publicize/src/class-social-admin-page.php | 11 --- .../changelog/change-migrate-cut-wp-ui | 4 - projects/plugins/jetpack/composer.lock | 29 +++--- .../social/changelog/change-migrate-cut-wp-ui | 4 - projects/plugins/social/composer.lock | 91 +++---------------- 8 files changed, 39 insertions(+), 136 deletions(-) delete mode 100644 projects/plugins/jetpack/changelog/change-migrate-cut-wp-ui delete mode 100644 projects/plugins/social/changelog/change-migrate-cut-wp-ui diff --git a/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/index.tsx b/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/index.tsx index 0713f28cab4e..e5d1aa3cca0b 100644 --- a/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/index.tsx +++ b/projects/packages/publicize/_inc/components/admin-page/toggles/social-module-toggle/index.tsx @@ -1,9 +1,13 @@ -import { Text, getRedirectUrl, useBreakpointMatch } from '@automattic/jetpack-components'; +import { + IconTooltip, + Text, + getRedirectUrl, + useBreakpointMatch, +} from '@automattic/jetpack-components'; import { getScriptData, isWpcomPlatformSite } from '@automattic/jetpack-script-data'; import { useSelect, useDispatch } from '@wordpress/data'; import { __, _x } from '@wordpress/i18n'; -import { Icon, info } from '@wordpress/icons'; -import { Link, Notice, Tooltip } from '@wordpress/ui'; +import { Link, Notice } from '@wordpress/ui'; import clsx from 'clsx'; import { useCallback } from 'react'; import { store as socialStore } from '../../../../social-store'; @@ -92,20 +96,14 @@ const SocialModuleToggle: FC = () => { { __( 'Unlock advanced sharing options', 'jetpack-publicize-pkg' ) }{ ' ' } - - - - - + + { __( 'Share custom images and videos that capture attention, use our powerful Social Image Generator to create stunning visuals, and access priority support for expert help whenever you need it.', 'jetpack-publicize-pkg' ) } - - + + =7.2" }, "require-dev": { @@ -4737,16 +4736,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.5.25", + "version": "12.5.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "792c2980442dfce319226b88fa845b8b6de3b333" + "reference": "d75dd30597caa80e72fad2ef7904601a30ef1046" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/792c2980442dfce319226b88fa845b8b6de3b333", - "reference": "792c2980442dfce319226b88fa845b8b6de3b333", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d75dd30597caa80e72fad2ef7904601a30ef1046", + "reference": "d75dd30597caa80e72fad2ef7904601a30ef1046", "shasum": "" }, "require": { @@ -4815,7 +4814,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.25" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.24" }, "funding": [ { @@ -4823,27 +4822,27 @@ "type": "other" } ], - "time": "2026-05-13T03:56:57+00:00" + "time": "2026-05-01T04:21:04+00:00" }, { "name": "sebastian/cli-parser", - "version": "4.2.1", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "7d05781b13f7dec9043a629a21d086ed74582a15" + "reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/7d05781b13f7dec9043a629a21d086ed74582a15", - "reference": "7d05781b13f7dec9043a629a21d086ed74582a15", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/90f41072d220e5c40df6e8635f5dafba2d9d4d04", + "reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04", "shasum": "" }, "require": { "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { @@ -4872,7 +4871,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.0" }, "funding": [ { @@ -4892,7 +4891,7 @@ "type": "tidelift" } ], - "time": "2026-05-17T05:29:34+00:00" + "time": "2025-09-14T09:36:45+00:00" }, { "name": "sebastian/comparator", diff --git a/projects/plugins/social/changelog/change-migrate-cut-wp-ui b/projects/plugins/social/changelog/change-migrate-cut-wp-ui deleted file mode 100644 index 6709885af28e..000000000000 --- a/projects/plugins/social/changelog/change-migrate-cut-wp-ui +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: changed - -Lockfile: regenerate after publicize gained wp-build-polyfills dep for social-admin-page. diff --git a/projects/plugins/social/composer.lock b/projects/plugins/social/composer.lock index 0f658b4e246d..4ba09870934c 100644 --- a/projects/plugins/social/composer.lock +++ b/projects/plugins/social/composer.lock @@ -1704,7 +1704,7 @@ "dist": { "type": "path", "url": "../../packages/publicize", - "reference": "8b4013a361a742707ccc1491dd90eafe72142470" + "reference": "2747f5de7472b6f15e6a19a4ae630129019f8800" }, "require": { "automattic/jetpack-admin-ui": "@dev", @@ -1716,7 +1716,6 @@ "automattic/jetpack-post-media": "@dev", "automattic/jetpack-redirect": "@dev", "automattic/jetpack-status": "@dev", - "automattic/jetpack-wp-build-polyfills": "@dev", "php": ">=7.2" }, "require-dev": { @@ -2029,68 +2028,6 @@ "transport-options": { "relative": true } - }, - { - "name": "automattic/jetpack-wp-build-polyfills", - "version": "dev-trunk", - "dist": { - "type": "path", - "url": "../../packages/wp-build-polyfills", - "reference": "b3add2c04a4cd1844f5686cbc8515404cbe6d83d" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "automattic/jetpack-test-environment": "@dev", - "automattic/phpunit-select-config": "@dev", - "yoast/phpunit-polyfills": "^4.0.0" - }, - "type": "jetpack-library", - "extra": { - "autotagger": true, - "mirror-repo": "Automattic/jetpack-wp-build-polyfills", - "textdomain": "jetpack-wp-build-polyfills", - "changelogger": { - "link-template": "https://github.com/Automattic/jetpack-wp-build-polyfills/compare/v${old}...v${new}" - }, - "branch-alias": { - "dev-trunk": "0.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "scripts": { - "build-production": [ - "pnpm run build-production" - ], - "build-development": [ - "pnpm run build" - ], - "phpunit": [ - "phpunit-select-config phpunit.#.xml.dist --colors=always" - ], - "test-coverage": [ - "php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"$COVERAGE_DIR/php.cov\"" - ], - "test-php": [ - "@composer phpunit" - ], - "test-js": [ - "pnpm run build", - "pnpm run test" - ] - }, - "license": [ - "GPL-2.0-or-later" - ], - "description": "Polyfills for WordPress Core packages not available in WP < 7.0", - "transport-options": { - "relative": true - } } ], "packages-dev": [ @@ -3042,16 +2979,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.5.25", + "version": "12.5.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "792c2980442dfce319226b88fa845b8b6de3b333" + "reference": "d75dd30597caa80e72fad2ef7904601a30ef1046" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/792c2980442dfce319226b88fa845b8b6de3b333", - "reference": "792c2980442dfce319226b88fa845b8b6de3b333", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d75dd30597caa80e72fad2ef7904601a30ef1046", + "reference": "d75dd30597caa80e72fad2ef7904601a30ef1046", "shasum": "" }, "require": { @@ -3120,7 +3057,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.25" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.24" }, "funding": [ { @@ -3128,27 +3065,27 @@ "type": "other" } ], - "time": "2026-05-13T03:56:57+00:00" + "time": "2026-05-01T04:21:04+00:00" }, { "name": "sebastian/cli-parser", - "version": "4.2.1", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "7d05781b13f7dec9043a629a21d086ed74582a15" + "reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/7d05781b13f7dec9043a629a21d086ed74582a15", - "reference": "7d05781b13f7dec9043a629a21d086ed74582a15", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/90f41072d220e5c40df6e8635f5dafba2d9d4d04", + "reference": "90f41072d220e5c40df6e8635f5dafba2d9d4d04", "shasum": "" }, "require": { "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { @@ -3177,7 +3114,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.0" }, "funding": [ { @@ -3197,7 +3134,7 @@ "type": "tidelift" } ], - "time": "2026-05-17T05:29:34+00:00" + "time": "2025-09-14T09:36:45+00:00" }, { "name": "sebastian/comparator", From 5b6e9723d93cf741b86d32a0ead05f14b3d0f1cf Mon Sep 17 00:00:00 2001 From: Christian Gastrell Date: Mon, 18 May 2026 19:40:34 -0300 Subject: [PATCH 5/5] Publicize: update social-module-toggle test for @wordpress/ui Notice's a11y speak The Notice composition triggers @wordpress/a11y speak() which renders the description text into a visually-hidden .a11y-speak-region in document.body. The existing getByText/queryByText assertions matched both the visible Notice and the speak region, causing 'multiple elements found' on the positive case and 'expected not in document, found' on the negative case (because the speak region persists across jsdom renders). Fix: pass the testing-library ignore option to text queries so they target the visible Notice DOM only. Test-only change; no production code touched. --- .../admin-page/test/social-module-toggle.test.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/packages/publicize/_inc/components/admin-page/test/social-module-toggle.test.jsx b/projects/packages/publicize/_inc/components/admin-page/test/social-module-toggle.test.jsx index e1a065361d64..2f10b52ecfa3 100644 --- a/projects/packages/publicize/_inc/components/admin-page/test/social-module-toggle.test.jsx +++ b/projects/packages/publicize/_inc/components/admin-page/test/social-module-toggle.test.jsx @@ -16,6 +16,11 @@ describe( 'SocialModuleToggle', () => { clearMockedScriptData(); } ); + // @wordpress/ui Notice triggers @wordpress/a11y speak() which renders the + // same description text into a visually-hidden .a11y-speak-region. Exclude + // that region from text queries so the assertions target the visible Notice. + const ignoreA11ySpeak = { ignore: 'script, style, .a11y-speak-region' }; + it( 'should render connection management component by default', () => { render( ); @@ -25,7 +30,9 @@ describe( 'SocialModuleToggle', () => { it( 'should show upgrade trigger when no paid features', () => { render( ); - expect( screen.getByText( /Unlock advanced sharing options/i ) ).toBeInTheDocument(); + expect( + screen.getByText( /Unlock advanced sharing options/i, ignoreA11ySpeak ) + ).toBeInTheDocument(); } ); it( 'should not show upgrade trigger with paid features', () => { @@ -40,6 +47,8 @@ describe( 'SocialModuleToggle', () => { } ); render( ); - expect( screen.queryByText( /Unlock advanced sharing options/i ) ).not.toBeInTheDocument(); + expect( + screen.queryByText( /Unlock advanced sharing options/i, ignoreA11ySpeak ) + ).not.toBeInTheDocument(); } ); } );