From f6e73c62378a64411f986c239ce6728124e34ed0 Mon Sep 17 00:00:00 2001 From: margolisj Date: Wed, 27 Sep 2023 10:46:37 -0400 Subject: [PATCH 01/10] Swaps file type. --- .../components/src/confirm-dialog/test/{index.js => index.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/components/src/confirm-dialog/test/{index.js => index.tsx} (100%) diff --git a/packages/components/src/confirm-dialog/test/index.js b/packages/components/src/confirm-dialog/test/index.tsx similarity index 100% rename from packages/components/src/confirm-dialog/test/index.js rename to packages/components/src/confirm-dialog/test/index.tsx From 119cba47cd021d65172cc518108ecddac2c27deb Mon Sep 17 00:00:00 2001 From: margolisj Date: Wed, 27 Sep 2023 10:47:01 -0400 Subject: [PATCH 02/10] Can't remember what point this served. --- packages/components/src/confirm-dialog/component.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/src/confirm-dialog/component.tsx b/packages/components/src/confirm-dialog/component.tsx index 4a8efd06e139c..c0e1beeb5102f 100644 --- a/packages/components/src/confirm-dialog/component.tsx +++ b/packages/components/src/confirm-dialog/component.tsx @@ -122,4 +122,5 @@ function ConfirmDialog( ); } -export default contextConnect( ConfirmDialog, 'ConfirmDialog' ); +const ConfirmDialogControl = contextConnect( ConfirmDialog, 'ConfirmDialog' ); +export default ConfirmDialogControl; From e3ebdea530f1240af287ef779fc4bbe8cd541ea4 Mon Sep 17 00:00:00 2001 From: margolisj Date: Sat, 30 Sep 2023 18:34:27 -0400 Subject: [PATCH 03/10] Attempting w/ functional component --- packages/components/src/confirm-dialog/component.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/components/src/confirm-dialog/component.tsx b/packages/components/src/confirm-dialog/component.tsx index c0e1beeb5102f..fa5ede6955175 100644 --- a/packages/components/src/confirm-dialog/component.tsx +++ b/packages/components/src/confirm-dialog/component.tsx @@ -23,10 +23,10 @@ import { VStack } from '../v-stack'; import * as styles from './styles'; import { useCx } from '../utils/hooks/use-cx'; -function ConfirmDialog( - props: WordPressComponentProps< OwnProps, 'div', false >, +const ConfirmDialog = ( + props: WordPressComponentProps< OwnProps, 'div' >, forwardedRef: ForwardedRef< any > -) { +) => { const { isOpen: isOpenProp, onConfirm, @@ -120,7 +120,7 @@ function ConfirmDialog( ) } ); -} +}; -const ConfirmDialogControl = contextConnect( ConfirmDialog, 'ConfirmDialog' ); -export default ConfirmDialogControl; +const ConnectedConfirmDialog = contextConnect( ConfirmDialog, 'ConfirmDialog' ); +export default ConnectedConfirmDialog; From 518a8bea290bcbe031bd39df1917876f54007218 Mon Sep 17 00:00:00 2001 From: margolisj Date: Mon, 2 Oct 2023 11:03:01 -0400 Subject: [PATCH 04/10] Updates types wrt to PR notes, js -> TSX for storybook, fixes null check in tests. --- .../src/confirm-dialog/component.tsx | 20 ++++++++--------- .../{index.story.js => index.story.tsx} | 22 ++++++++++++++----- .../src/confirm-dialog/test/index.tsx | 20 +++++++++++++++++ .../components/src/confirm-dialog/types.ts | 14 ++---------- 4 files changed, 47 insertions(+), 29 deletions(-) rename packages/components/src/confirm-dialog/stories/{index.story.js => index.story.tsx} (83%) diff --git a/packages/components/src/confirm-dialog/component.tsx b/packages/components/src/confirm-dialog/component.tsx index fa5ede6955175..21d55515f9651 100644 --- a/packages/components/src/confirm-dialog/component.tsx +++ b/packages/components/src/confirm-dialog/component.tsx @@ -1,8 +1,3 @@ -/** - * External dependencies - */ -import type { ForwardedRef, KeyboardEvent } from 'react'; - /** * WordPress dependencies */ @@ -13,7 +8,7 @@ import { useCallback, useEffect, useRef, useState } from '@wordpress/element'; * Internal dependencies */ import Modal from '../modal'; -import type { OwnProps, DialogInputEvent } from './types'; +import type { ConfirmDialogProps, DialogInputEvent } from './types'; import type { WordPressComponentProps } from '../context'; import { useContextSystem, contextConnect } from '../context'; import { Flex } from '../flex'; @@ -23,9 +18,9 @@ import { VStack } from '../v-stack'; import * as styles from './styles'; import { useCx } from '../utils/hooks/use-cx'; -const ConfirmDialog = ( - props: WordPressComponentProps< OwnProps, 'div' >, - forwardedRef: ForwardedRef< any > +const UnconnectedConfirmDialog = ( + props: WordPressComponentProps< ConfirmDialogProps, 'div', false >, + forwardedRef: React.ForwardedRef< any > ) => { const { isOpen: isOpenProp, @@ -67,7 +62,7 @@ const ConfirmDialog = ( ); const handleEnter = useCallback( - ( event: KeyboardEvent< HTMLDivElement > ) => { + ( event: React.KeyboardEvent< HTMLDivElement > ) => { // Avoid triggering the 'confirm' action when a button is focused, // as this can cause a double submission. const isConfirmOrCancelButton = @@ -122,5 +117,8 @@ const ConfirmDialog = ( ); }; -const ConnectedConfirmDialog = contextConnect( ConfirmDialog, 'ConfirmDialog' ); +const ConnectedConfirmDialog = contextConnect( + UnconnectedConfirmDialog, + 'ConfirmDialog' +); export default ConnectedConfirmDialog; diff --git a/packages/components/src/confirm-dialog/stories/index.story.js b/packages/components/src/confirm-dialog/stories/index.story.tsx similarity index 83% rename from packages/components/src/confirm-dialog/stories/index.story.js rename to packages/components/src/confirm-dialog/stories/index.story.tsx index ea561ff297c43..3eb72b2829e5c 100644 --- a/packages/components/src/confirm-dialog/stories/index.story.js +++ b/packages/components/src/confirm-dialog/stories/index.story.tsx @@ -1,3 +1,8 @@ +/** + * External dependencies + */ +import type { Meta, StoryFn } from '@storybook/react'; + /** * WordPress dependencies */ @@ -8,8 +13,9 @@ import { useState } from '@wordpress/element'; */ import Button from '../../button'; import { ConfirmDialog } from '..'; +import type { ConfirmDialogProps, DialogInputEvent } from '../types'; -const meta = { +const meta: Meta< typeof ConfirmDialog > = { component: ConfirmDialog, title: 'Components (Experimental)/ConfirmDialog', argTypes: { @@ -38,16 +44,20 @@ const meta = { export default meta; -const Template = ( { onConfirm, onCancel, ...args } ) => { +const Template: StoryFn< typeof ConfirmDialog > = ( { + onConfirm, + onCancel, + ...args +}: ConfirmDialogProps ) => { const [ isOpen, setIsOpen ] = useState( false ); - const handleConfirm = ( ...confirmArgs ) => { - onConfirm( ...confirmArgs ); + const handleConfirm = ( confirmArgs: DialogInputEvent ) => { + onConfirm( confirmArgs ); setIsOpen( false ); }; - const handleCancel = ( ...cancelArgs ) => { - onCancel( ...cancelArgs ); + const handleCancel = ( cancelArgs: DialogInputEvent ) => { + onCancel?.( cancelArgs ); setIsOpen( false ); }; diff --git a/packages/components/src/confirm-dialog/test/index.tsx b/packages/components/src/confirm-dialog/test/index.tsx index adf19b292898f..5f05005208035 100644 --- a/packages/components/src/confirm-dialog/test/index.tsx +++ b/packages/components/src/confirm-dialog/test/index.tsx @@ -142,6 +142,17 @@ describe( 'Confirm', () => { const confirmDialog = screen.getByRole( 'dialog' ); + // TODO: Is there a better way you'd like this checked? + // const parent = screen.findByParent( confirmDialog ); + // expect( parent ).toBeDefined(); + // eslint-disable-next-line testing-library/no-node-access + if ( confirmDialog.parentElement === null ) { + // fail( 'Expected confirmDialog.parentElement not found' ); + throw new Error( + 'Expected confirmDialog.parentElement not found' + ); + } + // Disable reason: Semantic queries can’t reach the overlay. // eslint-disable-next-line testing-library/no-node-access await user.click( confirmDialog.parentElement ); @@ -323,6 +334,15 @@ describe( 'Confirm', () => { const confirmDialog = screen.getByRole( 'dialog' ); + // TODO: Is there a better way you'd like this checked? + // eslint-disable-next-line testing-library/no-node-access + if ( confirmDialog.parentElement === null ) { + // fail( 'Expected confirmDialog.parentElement not found' ); + throw new Error( + 'Expected confirmDialog.parentElement not found' + ); + } + // Disable reason: Semantic queries can’t reach the overlay. // eslint-disable-next-line testing-library/no-node-access await user.click( confirmDialog.parentElement ); diff --git a/packages/components/src/confirm-dialog/types.ts b/packages/components/src/confirm-dialog/types.ts index 72fef59dc2009..1dd6bf77dad3a 100644 --- a/packages/components/src/confirm-dialog/types.ts +++ b/packages/components/src/confirm-dialog/types.ts @@ -13,21 +13,11 @@ export type DialogInputEvent = | KeyboardEvent< HTMLDivElement > | MouseEvent< HTMLButtonElement >; -type BaseProps = { +export type ConfirmDialogProps = { children: ReactNode; onConfirm: ( event: DialogInputEvent ) => void; confirmButtonText?: string; cancelButtonText?: string; -}; - -type ControlledProps = BaseProps & { - onCancel: ( event: DialogInputEvent ) => void; - isOpen: boolean; -}; - -type UncontrolledProps = BaseProps & { onCancel?: ( event: DialogInputEvent ) => void; - isOpen?: never; + isOpen?: boolean; }; - -export type OwnProps = ControlledProps | UncontrolledProps; From a62ef1245d65cd8a4ab9a6103f83020d9c5d1095 Mon Sep 17 00:00:00 2001 From: margolisj Date: Mon, 2 Oct 2023 11:14:54 -0400 Subject: [PATCH 05/10] Adds JSDocs to types and long form to component. --- .../components/src/confirm-dialog/README.md | 2 +- .../src/confirm-dialog/component.tsx | 67 +++++++++++++++++++ .../components/src/confirm-dialog/types.ts | 30 +++++++++ 3 files changed, 98 insertions(+), 1 deletion(-) diff --git a/packages/components/src/confirm-dialog/README.md b/packages/components/src/confirm-dialog/README.md index 86d38bccdec3c..4b0f37f5d35b3 100644 --- a/packages/components/src/confirm-dialog/README.md +++ b/packages/components/src/confirm-dialog/README.md @@ -137,4 +137,4 @@ The optional custom text to display as the confirmation button's label - Required: No - Default: "Cancel" -The optional custom text to display as the cancelation button's label +The optional custom text to display as the cancellation button's label diff --git a/packages/components/src/confirm-dialog/component.tsx b/packages/components/src/confirm-dialog/component.tsx index 21d55515f9651..ff46d77c05507 100644 --- a/packages/components/src/confirm-dialog/component.tsx +++ b/packages/components/src/confirm-dialog/component.tsx @@ -117,6 +117,73 @@ const UnconnectedConfirmDialog = ( ); }; +/** + * `ConfirmDialog` is built of top of [`Modal`](/packages/components/src/modal/README.md) + * and displays a confirmation dialog, with _confirm_ and _cancel_ buttons. + * The dialog is confirmed by clicking the _confirm_ button or by pressing the `Enter` key. + * It is cancelled (closed) by clicking the _cancel_ button, by pressing the `ESC` key, or by + * clicking outside the dialog focus (i.e, the overlay). + * + * `ConfirmDialog` has two main implicit modes: controlled and uncontrolled. + * + * UnControlled: + * + * Allows the component to be used standalone, just by declaring it as part of another React's component render method: + * - It will be automatically open (displayed) upon mounting; + * - It will be automatically closed when clicking the _cancel_ button, by pressing the `ESC` key, or by clicking outside the dialog focus (i.e, the overlay); + * - `onCancel` is not mandatory but can be passed. Even if passed, the dialog will still be able to close itself. + * + * Activating this mode is as simple as omitting the `isOpen` prop. The only mandatory prop, in this case, is the `onConfirm` callback. The message is passed as the `children`. You can pass any JSX you'd like, which allows to further format the message or include sub-component if you'd like: + * + * ```jsx + * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components'; + * + * function Example() { + * return ( + * console.debug( ' Confirmed! ' ) }> + * Are you sure? This action cannot be undone! + * + * ); + * } + * ``` + * + * + * Controlled mode: + * Let the parent component control when the dialog is open/closed. It's activated when a + * boolean value is passed to `isOpen`: + * - It will not be automatically closed. You need to let it know when to open/close by updating the value of the `isOpen` prop; + * - Both `onConfirm` and the `onCancel` callbacks are mandatory props in this mode; + * - You'll want to update the state that controls `isOpen` by updating it from the `onCancel` and `onConfirm` callbacks. + * + *```jsx + * import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components'; + * import { useState } from '@wordpress/element'; + * + * function Example() { + * const [ isOpen, setIsOpen ] = useState( true ); + * + * const handleConfirm = () => { + * console.debug( 'Confirmed!' ); + * setIsOpen( false ); + * }; + * + * const handleCancel = () => { + * console.debug( 'Cancelled!' ); + * setIsOpen( false ); + * }; + * + * return ( + * + * Are you sure? This action cannot be undone! + * + * ); + * } + * ``` + */ const ConnectedConfirmDialog = contextConnect( UnconnectedConfirmDialog, 'ConfirmDialog' diff --git a/packages/components/src/confirm-dialog/types.ts b/packages/components/src/confirm-dialog/types.ts index 1dd6bf77dad3a..b456b9bc4df19 100644 --- a/packages/components/src/confirm-dialog/types.ts +++ b/packages/components/src/confirm-dialog/types.ts @@ -14,10 +14,40 @@ export type DialogInputEvent = | MouseEvent< HTMLButtonElement >; export type ConfirmDialogProps = { + /** + * The actual message for the dialog. It's passed as children and any valid `ReactNode` is accepted. + */ children: ReactNode; + /** + * The callback that's called when the user confirms. + * A confirmation can happen when the `OK` button is clicked or when `Enter` is pressed. + */ onConfirm: ( event: DialogInputEvent ) => void; + /** + * The optional custom text to display as the confirmation button's label. + */ confirmButtonText?: string; + /** + * The optional custom text to display as the cancellation button's label. + */ cancelButtonText?: string; + /** + * The callback that's called when the user cancels. A cancellation can happen + * when the `Cancel` button is clicked, when the `ESC` key is pressed, or when + * a click outside of the dialog focus is detected (i.e. in the overlay). + * + * It's not required if `isOpen` is not set (uncontrolled mode), as the component + * will take care of closing itself, but you can still pass a callback if something + * must be done upon cancelling (the component will still close itself in this case). + * + * If `isOpen` is set (controlled mode), then it's required, and you need to set + * the state that defines `isOpen` to `false` as part of this callback if you want the + * dialog to close when the user cancels. + */ onCancel?: ( event: DialogInputEvent ) => void; + /** + * Defines if the dialog is open (displayed) or closed (not rendered/displayed). + * It also implicitly toggles the controlled mode if set or the uncontrolled mode if it's not set. + */ isOpen?: boolean; }; From d327db64e6aae578ce1d17027029d51e4f84a6d5 Mon Sep 17 00:00:00 2001 From: margolisj Date: Mon, 2 Oct 2023 11:19:56 -0400 Subject: [PATCH 06/10] Adds changelog. --- packages/components/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 779c1b4238290..a22b9a049e850 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -35,6 +35,7 @@ - `Components`: move `ui/utils` to `utils` and remove `ui/` folder ([#54922](https://github.com/WordPress/gutenberg/pull/54922)). - Ensure `@types/` dependencies used by final type files are included in the main dependency field ([#50231](https://github.com/WordPress/gutenberg/pull/50231)). - `Text`: Migrate to TypeScript. ([#54953](https://github.com/WordPress/gutenberg/pull/54953)). +- `ConfirmDialog`: Migrate to TypeScript. ([#54954](https://github.com/WordPress/gutenberg/pull/54954)). ## 25.8.0 (2023-09-20) From 0c79b8746b0456797689a6853efb2f01d717b581 Mon Sep 17 00:00:00 2001 From: margolisj Date: Tue, 3 Oct 2023 09:53:37 -0400 Subject: [PATCH 07/10] Skips null check in test --- .../src/confirm-dialog/test/index.tsx | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/packages/components/src/confirm-dialog/test/index.tsx b/packages/components/src/confirm-dialog/test/index.tsx index 5f05005208035..27e1af66ce742 100644 --- a/packages/components/src/confirm-dialog/test/index.tsx +++ b/packages/components/src/confirm-dialog/test/index.tsx @@ -113,7 +113,7 @@ describe( 'Confirm', () => { expect( onCancel ).toHaveBeenCalled(); } ); - it( 'should be dismissable even if an `onCancel` callback is not provided', async () => { + it( 'should be dismissible even if an `onCancel` callback is not provided', async () => { const user = userEvent.setup(); render( @@ -142,20 +142,9 @@ describe( 'Confirm', () => { const confirmDialog = screen.getByRole( 'dialog' ); - // TODO: Is there a better way you'd like this checked? - // const parent = screen.findByParent( confirmDialog ); - // expect( parent ).toBeDefined(); - // eslint-disable-next-line testing-library/no-node-access - if ( confirmDialog.parentElement === null ) { - // fail( 'Expected confirmDialog.parentElement not found' ); - throw new Error( - 'Expected confirmDialog.parentElement not found' - ); - } - // Disable reason: Semantic queries can’t reach the overlay. // eslint-disable-next-line testing-library/no-node-access - await user.click( confirmDialog.parentElement ); + await user.click( confirmDialog.parentElement! ); expect( confirmDialog ).not.toBeInTheDocument(); expect( onCancel ).toHaveBeenCalled(); @@ -334,18 +323,9 @@ describe( 'Confirm', () => { const confirmDialog = screen.getByRole( 'dialog' ); - // TODO: Is there a better way you'd like this checked? - // eslint-disable-next-line testing-library/no-node-access - if ( confirmDialog.parentElement === null ) { - // fail( 'Expected confirmDialog.parentElement not found' ); - throw new Error( - 'Expected confirmDialog.parentElement not found' - ); - } - // Disable reason: Semantic queries can’t reach the overlay. // eslint-disable-next-line testing-library/no-node-access - await user.click( confirmDialog.parentElement ); + await user.click( confirmDialog.parentElement! ); expect( onCancel ).toHaveBeenCalled(); } ); From 7767d1e49caf382bd06ab1515b4abff5806e577e Mon Sep 17 00:00:00 2001 From: margolisj Date: Thu, 5 Oct 2023 11:16:36 -0400 Subject: [PATCH 08/10] Exports and imports the correct one and edits the configs. --- .../src/confirm-dialog/component.tsx | 4 +-- .../confirm-dialog/stories/index.story.tsx | 33 ++++++++----------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/packages/components/src/confirm-dialog/component.tsx b/packages/components/src/confirm-dialog/component.tsx index ff46d77c05507..750e7030de13c 100644 --- a/packages/components/src/confirm-dialog/component.tsx +++ b/packages/components/src/confirm-dialog/component.tsx @@ -184,8 +184,8 @@ const UnconnectedConfirmDialog = ( * } * ``` */ -const ConnectedConfirmDialog = contextConnect( +export const ConfirmDialog = contextConnect( UnconnectedConfirmDialog, 'ConfirmDialog' ); -export default ConnectedConfirmDialog; +export default ConfirmDialog; diff --git a/packages/components/src/confirm-dialog/stories/index.story.tsx b/packages/components/src/confirm-dialog/stories/index.story.tsx index 3eb72b2829e5c..7663d39c88197 100644 --- a/packages/components/src/confirm-dialog/stories/index.story.tsx +++ b/packages/components/src/confirm-dialog/stories/index.story.tsx @@ -12,32 +12,24 @@ import { useState } from '@wordpress/element'; * Internal dependencies */ import Button from '../../button'; -import { ConfirmDialog } from '..'; -import type { ConfirmDialogProps, DialogInputEvent } from '../types'; +import { ConfirmDialog } from '../component'; const meta: Meta< typeof ConfirmDialog > = { component: ConfirmDialog, title: 'Components (Experimental)/ConfirmDialog', argTypes: { - children: { - control: { type: 'text' }, - }, - confirmButtonText: { - control: { type: 'text' }, - }, - cancelButtonText: { - control: { type: 'text' }, - }, isOpen: { control: { type: null }, }, - onConfirm: { action: 'onConfirm' }, - onCancel: { action: 'onCancel' }, }, args: { children: 'Would you like to privately publish the post now?', }, parameters: { + actions: { argTypesRegex: '^on.*' }, + controls: { + expanded: true, + }, docs: { canvas: { sourceState: 'shown' } }, }, }; @@ -48,15 +40,15 @@ const Template: StoryFn< typeof ConfirmDialog > = ( { onConfirm, onCancel, ...args -}: ConfirmDialogProps ) => { +} ) => { const [ isOpen, setIsOpen ] = useState( false ); - const handleConfirm = ( confirmArgs: DialogInputEvent ) => { + const handleConfirm: typeof onConfirm = ( confirmArgs ) => { onConfirm( confirmArgs ); setIsOpen( false ); }; - const handleCancel = ( cancelArgs: DialogInputEvent ) => { + const handleCancel: typeof onCancel = ( cancelArgs ) => { onCancel?.( cancelArgs ); setIsOpen( false ); }; @@ -80,7 +72,7 @@ const Template: StoryFn< typeof ConfirmDialog > = ( { }; // Simplest usage: just declare the component with the required `onConfirm` prop. Note: the `onCancel` prop is optional here, unless you'd like to render the component in Controlled mode (see below) -export const _default = Template.bind( {} ); +export const Default = Template.bind( {} ); const _defaultSnippet = `() => { const [ isOpen, setIsOpen ] = useState( false ); const [ confirmVal, setConfirmVal ] = useState(''); @@ -113,8 +105,10 @@ const _defaultSnippet = `() => { ); };`; -_default.args = {}; -_default.parameters = { +Default.args = { + children: 'Would you like to privately publish the post now?', +}; +Default.parameters = { docs: { source: { code: _defaultSnippet, @@ -127,6 +121,7 @@ _default.parameters = { // To customize button text, pass the `cancelButtonText` and/or `confirmButtonText` props. export const WithCustomButtonLabels = Template.bind( {} ); WithCustomButtonLabels.args = { + ...Default.args, cancelButtonText: 'No thanks', confirmButtonText: 'Yes please!', }; From 0d9c1dc3461bc47e538697570af511d3aa2f06d1 Mon Sep 17 00:00:00 2001 From: margolisj Date: Thu, 5 Oct 2023 11:34:04 -0400 Subject: [PATCH 09/10] New changelog entry --- packages/components/CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index a22b9a049e850..ed70be5493ff3 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Internal + +- `ConfirmDialog`: Migrate to TypeScript. ([#54954](https://github.com/WordPress/gutenberg/pull/54954)). + ## 25.9.0 (2023-10-05) ### Enhancements @@ -35,7 +39,6 @@ - `Components`: move `ui/utils` to `utils` and remove `ui/` folder ([#54922](https://github.com/WordPress/gutenberg/pull/54922)). - Ensure `@types/` dependencies used by final type files are included in the main dependency field ([#50231](https://github.com/WordPress/gutenberg/pull/50231)). - `Text`: Migrate to TypeScript. ([#54953](https://github.com/WordPress/gutenberg/pull/54953)). -- `ConfirmDialog`: Migrate to TypeScript. ([#54954](https://github.com/WordPress/gutenberg/pull/54954)). ## 25.8.0 (2023-09-20) From 2091199acd9880b4bdb53ef019800511d8b65a6b Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Fri, 6 Oct 2023 14:59:19 +0200 Subject: [PATCH 10/10] Update packages/components/src/confirm-dialog/stories/index.story.tsx --- packages/components/src/confirm-dialog/stories/index.story.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/components/src/confirm-dialog/stories/index.story.tsx b/packages/components/src/confirm-dialog/stories/index.story.tsx index 7663d39c88197..85636c0ddc81e 100644 --- a/packages/components/src/confirm-dialog/stories/index.story.tsx +++ b/packages/components/src/confirm-dialog/stories/index.story.tsx @@ -22,9 +22,6 @@ const meta: Meta< typeof ConfirmDialog > = { control: { type: null }, }, }, - args: { - children: 'Would you like to privately publish the post now?', - }, parameters: { actions: { argTypesRegex: '^on.*' }, controls: {