diff --git a/packages/fields/README.md b/packages/fields/README.md index 41a11b72f772d4..6e96143f0f380e 100644 --- a/packages/fields/README.md +++ b/packages/fields/README.md @@ -53,7 +53,11 @@ Undocumented declaration. ### duplicateTemplatePart -Undocumented declaration. +This action is used to duplicate a template part. + +_Type_ + +- `Action< TemplatePart >` ### exportPattern diff --git a/packages/fields/src/actions/duplicate-template-part.tsx b/packages/fields/src/actions/duplicate-template-part.tsx index e92cbff74726f8..5632f9b15d4eab 100644 --- a/packages/fields/src/actions/duplicate-template-part.tsx +++ b/packages/fields/src/actions/duplicate-template-part.tsx @@ -16,6 +16,9 @@ import type { Post, TemplatePart } from '../types'; import { CreateTemplatePartModalContents } from '../components/create-template-part-modal'; import { getItemTitle } from './utils'; +/** + * This action is used to duplicate a template part. + */ const duplicateTemplatePart: Action< TemplatePart > = { id: 'duplicate-template-part', label: _x( 'Duplicate', 'action label' ), diff --git a/packages/fields/src/components/create-template-part-modal/index.tsx b/packages/fields/src/components/create-template-part-modal/index.tsx index cab00b99ccdd7c..03b39a8fdcdf39 100644 --- a/packages/fields/src/components/create-template-part-modal/index.tsx +++ b/packages/fields/src/components/create-template-part-modal/index.tsx @@ -29,7 +29,6 @@ import { } from '@wordpress/icons'; import { store as noticesStore } from '@wordpress/notices'; // @ts-ignore -// @ts-ignore import { serialize } from '@wordpress/blocks'; /** @@ -128,7 +127,7 @@ export function CreateTemplatePartModalContents( { const defaultTemplatePartAreas = useSelect( ( select ) => { const areas = - // @ts-expect-error The default_template_part_areas is not part of the core store type. + // @ts-expect-error getEntityRecord is not typed with unstableBase as argument. select( coreStore ).getEntityRecord< { default_template_part_areas: Array< { area: string;