From dc99bc97171cd33e06e26c2fb87d9b245f35d5f7 Mon Sep 17 00:00:00 2001 From: Eason Su Date: Wed, 2 Aug 2023 18:14:08 +0800 Subject: [PATCH 1/4] Externalize the `NavigableMenu` component imported from `@wordpress/components`. --- js/src/components/app-sub-nav/index.js | 2 +- js/src/components/app-tab-nav/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/components/app-sub-nav/index.js b/js/src/components/app-sub-nav/index.js index 114694b60e..e1b4ee2179 100644 --- a/js/src/components/app-sub-nav/index.js +++ b/js/src/components/app-sub-nav/index.js @@ -2,7 +2,7 @@ * External dependencies */ import { Fragment } from '@wordpress/element'; -import { NavigableMenu } from '@wordpress/components'; +import { NavigableMenu } from 'extracted/@wordpress/components'; import { Link } from '@woocommerce/components'; import classnames from 'classnames'; diff --git a/js/src/components/app-tab-nav/index.js b/js/src/components/app-tab-nav/index.js index 3fd7b58f75..a68421bde5 100644 --- a/js/src/components/app-tab-nav/index.js +++ b/js/src/components/app-tab-nav/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { NavigableMenu } from '@wordpress/components'; +import { NavigableMenu } from 'extracted/@wordpress/components'; import { Link } from '@woocommerce/components'; import classnames from 'classnames'; From ccda46181eb8ba3a579db69d61e1b9bddc6a73fd Mon Sep 17 00:00:00 2001 From: Eason Su Date: Wed, 2 Aug 2023 18:14:25 +0800 Subject: [PATCH 2/4] Externalize the `Dropdown` component imported from `@wordpress/components`. --- js/src/external-components/woocommerce/filter-picker/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/src/external-components/woocommerce/filter-picker/index.js b/js/src/external-components/woocommerce/filter-picker/index.js index a43723b362..c70ceba50b 100644 --- a/js/src/external-components/woocommerce/filter-picker/index.js +++ b/js/src/external-components/woocommerce/filter-picker/index.js @@ -8,8 +8,7 @@ * External dependencies */ import { __ } from '@wordpress/i18n'; -import { Dropdown } from '@wordpress/components'; -import { Button } from 'extracted/@wordpress/components'; +import { Dropdown, Button } from 'extracted/@wordpress/components'; import { focus } from '@wordpress/dom'; import classnames from 'classnames'; import { Component } from '@wordpress/element'; From 8f5d63aec16cbd38dadfa8383c4d09ec87512f6a Mon Sep 17 00:00:00 2001 From: Eason Su Date: Wed, 2 Aug 2023 18:14:53 +0800 Subject: [PATCH 3/4] Externalize the `Modal` component imported from `@wordpress/components`. --- js/src/components/app-modal/index.js | 2 +- js/src/external-components/wordpress/guide/index.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/js/src/components/app-modal/index.js b/js/src/components/app-modal/index.js index a8da4114b1..0012d47b2f 100644 --- a/js/src/components/app-modal/index.js +++ b/js/src/components/app-modal/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Modal } from '@wordpress/components'; +import { Modal } from 'extracted/@wordpress/components'; import classnames from 'classnames'; /** diff --git a/js/src/external-components/wordpress/guide/index.js b/js/src/external-components/wordpress/guide/index.js index 4e249bfb46..06f06a1f74 100644 --- a/js/src/external-components/wordpress/guide/index.js +++ b/js/src/external-components/wordpress/guide/index.js @@ -11,8 +11,11 @@ import classnames from 'classnames'; import { useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; -import { Modal } from '@wordpress/components'; -import { Button, KeyboardShortcuts } from 'extracted/@wordpress/components'; +import { + Modal, + Button, + KeyboardShortcuts, +} from 'extracted/@wordpress/components'; /** * Internal dependencies From de3a88952bebf5c2c708c7b0e6efa3f83f88fce8 Mon Sep 17 00:00:00 2001 From: Eason Su Date: Fri, 4 Aug 2023 15:07:44 +0800 Subject: [PATCH 4/4] Remove an invalid CSS hack that had fixed the Tooltip position within a Modal before. Currently, the minimum supported version of this extension is WP 5.9. - This hack doesn't work for WP 5.9 and 6.0. - WP >= 6.1 itself has already fixed this issue, so it's no longer needed. --- js/src/css/shared/_gutenberg-components.scss | 21 -------------------- 1 file changed, 21 deletions(-) diff --git a/js/src/css/shared/_gutenberg-components.scss b/js/src/css/shared/_gutenberg-components.scss index 9c0e39243a..b2109d7908 100644 --- a/js/src/css/shared/_gutenberg-components.scss +++ b/js/src/css/shared/_gutenberg-components.scss @@ -62,24 +62,3 @@ .components-input-control__suffix { margin-right: $grid-unit; } - -// Hack to fix the Tooltip position of the top-right side close button in a Modal component. -// The follow up can be found here: https://github.com/woocommerce/google-listings-and-ads/issues/203 -.components-modal { - &__screen-overlay { - display: flex; - justify-content: center; - align-items: center; - } - - &__frame { - @include break-small { - transform: initial; - position: relative; - top: 0; - bottom: 0; - left: 0; - right: 0; - } - } -}