Skip to content

Commit d3c9b16

Browse files
noahtallenarthur791004tyxla
authored
Update wordpress packages to a recent version (#78711)
* Add script which updates package.json resolutions field * Update @WordPress packages to latest versions in package.json resolutions * Update all @WordPress packages to the latest version * Update internal @wordpress/data peer dependency versions * Resolve most peer dependency issues * Use ComponentProps for some WP component type imports * Rework submenu popover to remove legacy offset props * Fix all Button variant type issues * Remove uneeded button wrapper component in info-tooltip * Fix type for close modal event in page pattern modal * Add ts expect error for ExternalLink required children prop * Add onChange type definition for CustomSelectControl for language-picker * Remove unused @types/wordpress__ packages * Remove uneeded entries in yarnrc.yml * Change another case of isPrimary to variant * Fix global styles package for new WordPress package versions (#78715) * @automattic/global-styles: Replace @wordpress/edit-site apis with new ones * Use fixed version of private-apis package to make __private symbol consistent * Use ExperimentalBlockEditorProvider to initialize Iframe * Fix unable to get fontFamilies * Fix styles * Fix style variation preview * Fix types * Replace mergeWith with deepmerge * Get rid of isEmpty and mapValues in global-stypes pkg * Add comments * Revert some changes * cleanEmptyObject: Fix type * transformStyles: Fix type * WP components: Fix types * Move EditorStyles into the children of the Iframe --------- Co-authored-by: arthur <arthur.chu@automattic.com> * Delete several @WordPress module declarations that duplicate bundled types * Remove uneeded HTMLElement override * Remove Global Styles wp components type declaration override * Remove manage purchases renew toggle wp components type override * Add back html element hotfix * Remove imports of deleted type patch files * Fix type errors related to re-declaring Button prop types * Fix type errors related to ExternalLink requiring children * Fix type errors related to Modal isOpen prop * Remove registerPlugin override * Remove target blank from ExternalLink, because it isn't used by the component internally * Fix several prop issues related to ExternalLink (remove target, include children) * Add missing @types/wordpress__block-library package * Fix type errors related to Modal open prop * Remove size prop in a couple cases because it doesn't do anything * Fix type errors related to importing component prop types * Fix useState types for date time picker example * yarn dedupe * Fix type issue with NavigatorButton wrapper class name * Remove another wp components type override file * Update onNavigatorPathChange argument which is sometimes undefined * Fix a type issue with global styles context * Fix eslint issues with hooks in modified files * Remove unused translate import * Fix type issue where reader button couldn't be disabled * Remove disabled from a Button instance which is a link * Fix state type related to FontSizePicker * Fix odd issue with query control types * Fix issue with SlotFill not being typed * Remove broken types from ToolbarGroup as it's just an example * Fix issue with arr.includes undefined * Fix issue with combobox onchange arg type * Remove disabled from another button link * Cast translateresult to string for input to label * Cast string to more specific type for log tab * Fix onChange type for another combobox * Add missing onhover prop to component * Fix issue with Token value types * Add missing labels to notification toggles * Remove useless wrapper component * Add types to callback args * Remove uneeded ts expect err and update component props for combobox control * fix color type definition for global styles * Remove uneeded types in callback * Remove useless component wrapper * Utilize useLocalizeUrl() where necessary * Fix some test snapshots * Fix composite checkout tests by introducing field reset * dedupe * Fix most of the remaining TS errors * Remove uneeded wrapper components * Add expect-error to incorrect .then error * Assembler: Fix the main layout is broken (#79275) * Comment out wrapperClassName which causes a type error * Change a few HStack props from alignItems to alignment * Assembler: Fix the styles of the navigator button (#79338) * Lock file update * Make Button variants more consistent with trunk * Use better approach for picking anchor button types --------- Co-authored-by: arthur <arthur.chu@automattic.com> Co-authored-by: Marin Atanasov <tyxla@abv.bg>
1 parent bf9c5d1 commit d3c9b16

200 files changed

Lines changed: 2962 additions & 2269 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.yarnrc.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ logFilters:
4343
- level: discard
4444
pattern: "calypso@workspace:client provides +(react|react-dom) (*) with version 18.2.0, which doesn't satisfy what reakit and some of its descendants request"
4545

46-
# TODO: Remove this once the react-easy-crop transitive dependency can be removed. (Likely after updating @wordpress/block-editor to a newer version.)
46+
# TODO: Remove this once the react-autosize-textarea transitive dependency has been fixed/updated to a version with React 18 support.
4747
- level: discard
4848
pattern: "calypso@workspace:client provides +(react|react-dom) (*) with version 18.2.0, which doesn't satisfy what @automattic/block-renderer and some of its descendants request"
4949

@@ -62,21 +62,27 @@ packageExtensions:
6262
"@signal-noise/stylelint-scales@2.0.3":
6363
peerDependencies:
6464
postcss: "*"
65-
"@types/wordpress__components@23.0.1":
65+
"@wordpress/commands@0.6.2":
6666
peerDependencies:
67-
react: "*"
68-
"@types/wordpress__plugins@3.0.0":
67+
react-dom: "*"
68+
"@wordpress/core-commands@0.4.2":
6969
peerDependencies:
70-
react: "*"
71-
"@wordpress/data-controls@2.23.0":
70+
react-dom: "*"
71+
"@wordpress/data-controls@3.4.0":
7272
peerDependencies:
7373
react: "*"
74-
"@wordpress/notices@3.23.0":
74+
"@wordpress/notices@4.3.0":
7575
peerDependencies:
7676
react: "*"
77-
"@wordpress/stylelint-config@21.6.0":
77+
"@wordpress/plugins@6.3.0":
78+
peerDependencies:
79+
react-dom: "*"
80+
"@wordpress/stylelint-config@21.19.0":
7881
peerDependencies:
7982
postcss: "*"
83+
"deepsignal@1.3.3":
84+
peerDependencies:
85+
react: "*"
8086
fake-indexeddb@3.1.7:
8187
peerDependencies:
8288
core-js-bundle: "*"

apps/blaze-dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@automattic/webpack-extensive-lodash-replacement-plugin": "workspace:^",
5454
"@automattic/webpack-inline-constant-exports-plugin": "workspace:^",
5555
"@automattic/wp-babel-makepot": "workspace:^",
56-
"@wordpress/dependency-extraction-webpack-plugin": "^4.5.0",
56+
"@wordpress/dependency-extraction-webpack-plugin": "^4.19.0",
5757
"autoprefixer": "^10.2.5",
5858
"gettext-parser": "^6.0.0",
5959
"html-webpack-plugin": "^5.0.0-beta.4",

apps/editing-toolkit/editing-toolkit-plugin/wpcom-block-editor-nav-sidebar/src/attach-sidebar.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { START_WRITING_FLOW, DESIGN_FIRST_FLOW } from '@automattic/onboarding';
22
import { useDispatch, useSelect } from '@wordpress/data';
33
import { __experimentalMainDashboardButton as MainDashboardButton } from '@wordpress/edit-post';
44
import { useEffect, createPortal, useState } from '@wordpress/element';
5-
import { registerPlugin as originalRegisterPlugin, PluginSettings } from '@wordpress/plugins';
5+
import { registerPlugin } from '@wordpress/plugins';
66
import useSiteIntent from '../../dotcom-fse/lib/site-intent/use-site-intent';
77
import WpcomBlockEditorNavSidebar from './components/nav-sidebar';
88
import ToggleSidebarButton from './components/toggle-sidebar-button';
@@ -11,9 +11,6 @@ type CoreEditPostPlaceholder = {
1111
isFeatureActive: ( ...args: unknown[] ) => boolean;
1212
};
1313

14-
const registerPlugin = ( name: string, settings: Omit< PluginSettings, 'icon' > ) =>
15-
originalRegisterPlugin( name, settings as PluginSettings );
16-
1714
if ( typeof MainDashboardButton !== 'undefined' ) {
1815
registerPlugin( 'a8c-full-site-editing-nav-sidebar', {
1916
render: function NavSidebar() {

apps/editing-toolkit/editing-toolkit-plugin/wpcom-block-editor-nav-sidebar/src/components/create-page/index.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { recordTracksEvent } from '@automattic/calypso-analytics';
2-
import { Button as OriginalButton } from '@wordpress/components';
2+
import { Button } from '@wordpress/components';
33
import { applyFilters } from '@wordpress/hooks';
44
import { __ } from '@wordpress/i18n';
55
import { plus } from '@wordpress/icons';
@@ -8,13 +8,6 @@ import { get } from 'lodash';
88

99
import './style.scss';
1010

11-
const Button = ( {
12-
children,
13-
...rest
14-
}: OriginalButton.Props & { icon?: unknown; iconSize?: number } ) => (
15-
<OriginalButton { ...rest }>{ children }</OriginalButton>
16-
);
17-
1811
interface Props {
1912
postType: { slug: string };
2013
}
@@ -47,7 +40,7 @@ export default function CreatePage( { postType }: Props ) {
4740
target={
4841
applyFilters( 'a8c.WpcomBlockEditorNavSidebar.linkTarget', undefined ) as string | undefined
4942
}
50-
isPrimary
43+
variant="primary"
5144
className="wpcom-block-editor-nav-sidebar-create-page"
5245
href={ url }
5346
icon={ plus }

apps/editing-toolkit/editing-toolkit-plugin/wpcom-block-editor-nav-sidebar/src/components/nav-sidebar/index.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,8 @@ type CorePlaceholder = {
3535
};
3636

3737
const Button = forwardRef(
38-
(
39-
{
40-
children,
41-
...rest
42-
}: OriginalButton.Props & { icon?: unknown; iconSize?: number; showTooltip?: boolean },
43-
ref
44-
) => (
45-
<OriginalButton
46-
ref={ ref as string | ( ( instance: HTMLElement | null ) => void ) }
47-
{ ...rest }
48-
>
38+
( { children, ...rest }: React.ComponentProps< typeof OriginalButton >, ref ) => (
39+
<OriginalButton ref={ ref } { ...rest }>
4940
{ children }
5041
</OriginalButton>
5142
)

apps/editing-toolkit/editing-toolkit-plugin/wpcom-block-editor-nav-sidebar/src/components/toggle-sidebar-button/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
import { recordTracksEvent } from '@automattic/calypso-analytics';
2-
import { Button as OriginalButton } from '@wordpress/components';
2+
import { Button } from '@wordpress/components';
33
import { useDispatch, useSelect } from '@wordpress/data';
44
import { __ } from '@wordpress/i18n';
55
import classnames from 'classnames';
66
import { store } from '../../store';
77
import SiteIcon from '../site-icon';
88
import './style.scss';
99

10-
const Button = ( {
11-
children,
12-
...rest
13-
}: OriginalButton.Props & { icon?: unknown; iconSize?: number; showTooltip?: boolean } ) => (
14-
<OriginalButton { ...rest }>{ children }</OriginalButton>
15-
);
16-
1710
export default function ToggleSidebarButton() {
1811
const { toggleSidebar } = useDispatch( store );
1912
const isSidebarOpen = useSelect( ( select ) => select( store ).isSidebarOpened(), [] );

apps/editing-toolkit/editing-toolkit-plugin/wpcom-block-editor-nux/src/first-post-published-modal/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ const FirstPostPublishedModal: React.FC = () => {
9090
imageSrc={ postPublishedImage }
9191
actionButtons={
9292
<>
93-
<Button isPrimary onClick={ handleViewPostClick }>
93+
<Button variant="primary" onClick={ handleViewPostClick }>
9494
{ __( 'View Post', 'full-site-editing' ) }
9595
</Button>
9696
{ launchpadScreenOption === 'full' && siteIntentOption === 'write' && (
97-
<Button isSecondary onClick={ handleNextStepsClick }>
97+
<Button variant="secondary" onClick={ handleNextStepsClick }>
9898
{ __( 'Next Steps', 'full-site-editing' ) }
9999
</Button>
100100
) }

apps/editing-toolkit/editing-toolkit-plugin/wpcom-block-editor-nux/src/nux-modal/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ const NuxModal: React.FC< Props > = ( {
4242
return (
4343
<Modal
4444
className={ classnames( 'wpcom-block-editor-nux-modal', className ) }
45-
open={ isOpen }
4645
title=""
4746
onRequestClose={ onRequestClose }
4847
>

apps/editing-toolkit/editing-toolkit-plugin/wpcom-block-editor-nux/src/sharing-modal/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ const SharingModal: React.FC = () => {
178178
return (
179179
<Modal
180180
className="wpcom-block-editor-post-published-sharing-modal"
181-
open={ isOpen }
182181
title=""
183182
onRequestClose={ closeModal }
184183
>
@@ -195,9 +194,9 @@ const SharingModal: React.FC = () => {
195194
{
196195
a: (
197196
<ExternalLink
197+
children={ null }
198198
href={ subscribersUrl }
199199
onClick={ trackSubscribersClick }
200-
target="_blank"
201200
/>
202201
),
203202
}

apps/editing-toolkit/editing-toolkit-plugin/wpcom-block-editor-nux/src/welcome-tour/tour-steps.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ function getTourSteps(
9999
<ExternalLink
100100
href={ siteEditorCourseUrl }
101101
onClick={ onSiteEditorCourseLinkClick }
102+
children={ null }
102103
/>
103104
),
104105
}
@@ -322,7 +323,6 @@ function getTourSteps(
322323
'https://wordpress.com/support/video-tutorials-add-payments-features-to-your-site-with-our-guides/#how-to-use-the-payments-block-video',
323324
localeSlug
324325
) }
325-
target="_blank"
326326
rel="noopener noreferrer"
327327
>
328328
{ __( 'Learn more', 'full-site-editing' ) }
@@ -359,6 +359,7 @@ function getTourSteps(
359359
'https://wordpress.com/support/full-site-editing/',
360360
localeSlug
361361
) }
362+
children={ null }
362363
/>
363364
),
364365
}
@@ -396,6 +397,7 @@ function getTourSteps(
396397
'https://wordpress.com/support/settings/privacy-settings/#launch-your-site',
397398
localeSlug
398399
) }
400+
children={ null }
399401
/>
400402
),
401403
link_to_editor_docs: (
@@ -404,6 +406,7 @@ function getTourSteps(
404406
'https://wordpress.com/support/wordpress-editor/',
405407
localeSlug
406408
) }
409+
children={ null }
407410
/>
408411
),
409412
}

0 commit comments

Comments
 (0)