diff --git a/packages/edit-post/README.md b/packages/edit-post/README.md index 20a6ae17cf2c59..de3c7d904ac607 100644 --- a/packages/edit-post/README.md +++ b/packages/edit-post/README.md @@ -41,61 +41,7 @@ _Parameters_ ### PluginBlockSettingsMenuItem -Renders a new item in the block settings menu. - -_Usage_ - -```js -// Using ES5 syntax -var __ = wp.i18n.__; -var PluginBlockSettingsMenuItem = wp.editPost.PluginBlockSettingsMenuItem; - -function doOnClick() { - // To be called when the user clicks the menu item. -} - -function MyPluginBlockSettingsMenuItem() { - return React.createElement( PluginBlockSettingsMenuItem, { - allowedBlocks: [ 'core/paragraph' ], - icon: 'dashicon-name', - label: __( 'Menu item text' ), - onClick: doOnClick, - } ); -} -``` - -```jsx -// Using ESNext syntax -import { __ } from '@wordpress/i18n'; -import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post'; - -const doOnClick = () => { - // To be called when the user clicks the menu item. -}; - -const MyPluginBlockSettingsMenuItem = () => ( - -); -``` - -_Parameters_ - -- _props_ `Object`: Component props. -- _props.allowedBlocks_ `[Array]`: An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list. -- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element. -- _props.label_ `string`: The menu item text. -- _props.onClick_ `Function`: Callback function to be executed when the user click the menu item. -- _props.small_ `[boolean]`: Whether to render the label or not. -- _props.role_ `[string]`: The ARIA role for the menu item. - -_Returns_ - -- `Component`: The component to be rendered. +Undocumented declaration. ### PluginDocumentSettingPanel diff --git a/packages/edit-post/src/index.js b/packages/edit-post/src/index.js index 1be83cbd81379c..ef4e772ccbb42d 100644 --- a/packages/edit-post/src/index.js +++ b/packages/edit-post/src/index.js @@ -15,6 +15,7 @@ import { registerWidgetGroupBlock, } from '@wordpress/widgets'; import { + PluginBlockSettingsMenuItem, PluginDocumentSettingPanel, privateApis as editorPrivateApis, store as editorStore, @@ -161,7 +162,7 @@ export function reinitializeEditor() { } ); } -export { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item'; +export { PluginBlockSettingsMenuItem }; export { PluginDocumentSettingPanel }; export { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item'; export { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel'; diff --git a/packages/edit-post/src/components/block-settings-menu/plugin-block-settings-menu-item.js b/packages/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js similarity index 95% rename from packages/edit-post/src/components/block-settings-menu/plugin-block-settings-menu-item.js rename to packages/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js index 322aa07db80f86..59c9e9c32d4a4b 100644 --- a/packages/edit-post/src/components/block-settings-menu/plugin-block-settings-menu-item.js +++ b/packages/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js @@ -38,7 +38,7 @@ const shouldRenderItem = ( selectedBlocks, allowedBlocks ) => * ```js * // Using ES5 syntax * var __ = wp.i18n.__; - * var PluginBlockSettingsMenuItem = wp.editPost.PluginBlockSettingsMenuItem; + * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem; * * function doOnClick(){ * // To be called when the user clicks the menu item. @@ -61,7 +61,7 @@ const shouldRenderItem = ( selectedBlocks, allowedBlocks ) => * ```jsx * // Using ESNext syntax * import { __ } from '@wordpress/i18n'; - * import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post'; + * import { PluginBlockSettingsMenuItem } from '@wordpress/editor'; * * const doOnClick = ( ) => { * // To be called when the user clicks the menu item. diff --git a/packages/editor/src/components/index.js b/packages/editor/src/components/index.js index 0b503435098f56..773a8936af092c 100644 --- a/packages/editor/src/components/index.js +++ b/packages/editor/src/components/index.js @@ -27,6 +27,7 @@ export { default as PageAttributesPanel } from './page-attributes/panel'; export { default as PageAttributesParent } from './page-attributes/parent'; export { default as PageTemplate } from './post-template/classic-theme'; export { default as PluginDocumentSettingPanel } from './plugin-document-setting-panel'; +export { default as PluginBlockSettingsMenuItem } from './block-settings-menu/plugin-block-settings-menu-item'; export { default as PostTemplatePanel } from './post-template/panel'; export { default as PostAuthor } from './post-author'; export { default as PostAuthorCheck } from './post-author/check';