Skip to content

Commit

Permalink
Fix misc type compilation errors in editor and block editor packages (#…
Browse files Browse the repository at this point in the history
…67410)

Co-authored-by: ramonjd <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
3 people authored Nov 29, 2024
1 parent 9ffbd9c commit 9defe9f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

- Upgraded `@ariakit/react` (v0.4.13) and `@ariakit/test` (v0.4.5) ([#65907](https://github.com/WordPress/gutenberg/pull/65907)).
- Upgraded `@ariakit/react` (v0.4.15) and `@ariakit/test` (v0.4.7) ([#67404](https://github.com/WordPress/gutenberg/pull/67404)).
- Exported the `WPCompleter` type as it was being used in block-editor/autocompleters ([#67410](https://github.com/WordPress/gutenberg/pull/67410)).

### Bug Fixes

Expand Down
1 change: 1 addition & 0 deletions packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export { Heading as __experimentalHeading } from './heading';
export { HStack as __experimentalHStack } from './h-stack';
export { default as Icon } from './icon';
export type { IconType } from './icon';
export type { WPCompleter } from './autocomplete/types.ts';
export { default as IconButton } from './button/deprecated';
export {
ItemGroup as __experimentalItemGroup,
Expand Down
7 changes: 4 additions & 3 deletions packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1462,11 +1462,11 @@ Wrapper component that renders its children only if the post can trashed.
_Parameters_

- _props_ `Object`: - The component props.
- _props.children_ `React.ReactEl`: - The child components to render.
- _props.children_ `React.ReactNode`: - The child components to render.

_Returns_

- `React.ReactElement`: The rendered child components or null if the post can not trashed.
- `React.ReactNode`: The rendered child components or null if the post can not trashed.

### PostTypeSupportCheck

Expand Down Expand Up @@ -1494,7 +1494,8 @@ _Usage_

_Parameters_

- _onClose_ `Function`: Callback function to be executed when the popover is closed.
- _props_ `{ onClose: () => void }`: The props for the component.
- _props.onClose_ `() => void`: Callback function to be executed when the popover is closed.

_Returns_

Expand Down
6 changes: 3 additions & 3 deletions packages/editor/src/components/post-trash/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { GLOBAL_POST_TYPES } from '../../store/constants';
/**
* Wrapper component that renders its children only if the post can trashed.
*
* @param {Object} props - The component props.
* @param {React.ReactEl} props.children - The child components to render.
* @param {Object} props - The component props.
* @param {React.ReactNode} props.children - The child components to render.
*
* @return {React.ReactElement} The rendered child components or null if the post can not trashed.
* @return {React.ReactNode} The rendered child components or null if the post can not trashed.
*/
export default function PostTrashCheck( { children } ) {
const { canTrashPost } = useSelect( ( select ) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/editor/src/components/post-url/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ import { store as editorStore } from '../../store';
* <PostURL />
* ```
*
* @param {Function} onClose Callback function to be executed when the popover is closed.
* @param {{ onClose: () => void }} props The props for the component.
* @param {() => void} props.onClose Callback function to be executed when the popover is closed.
*
* @return {React.ReactNode} The rendered PostURL component.
*/
Expand Down

0 comments on commit 9defe9f

Please sign in to comment.