From 1237f0be20615158136d3246bffc3d6c6bd12330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Mon, 16 Jul 2018 12:18:10 +0200 Subject: [PATCH] Rename components to follow the PluginFeatureThatExtend name pattern. --- editor/components/block-settings-menu/index.js | 4 ++-- ...ns-group.js => plugin-block-settings-menu-group.js} | 10 +++++----- ...gins-item.js => plugin-block-settings-menu-item.js} | 10 +++++----- editor/components/index.js | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) rename editor/components/block-settings-menu/{block-settings-menu-plugins-group.js => plugin-block-settings-menu-group.js} (63%) rename editor/components/block-settings-menu/{block-settings-menu-plugins-item.js => plugin-block-settings-menu-item.js} (83%) diff --git a/editor/components/block-settings-menu/index.js b/editor/components/block-settings-menu/index.js index 68c9d9e8c99200..d22ee5bf0125f8 100644 --- a/editor/components/block-settings-menu/index.js +++ b/editor/components/block-settings-menu/index.js @@ -24,7 +24,7 @@ import SharedBlockDeleteButton from './shared-block-delete-button'; import BlockHTMLConvertButton from './block-html-convert-button'; import BlockUnknownConvertButton from './block-unknown-convert-button'; import _BlockSettingsMenuFirstItem from './block-settings-menu-first-item'; -import BlockSettingsMenuPluginsGroup from './block-settings-menu-plugins-group'; +import PluginBlockSettingsMenuGroup from './plugin-block-settings-menu-group'; export class BlockSettingsMenu extends Component { constructor() { @@ -100,7 +100,7 @@ export class BlockSettingsMenu extends Component { { count === 1 && } { count === 1 && } - +
{ count === 1 && } diff --git a/editor/components/block-settings-menu/block-settings-menu-plugins-group.js b/editor/components/block-settings-menu/plugin-block-settings-menu-group.js similarity index 63% rename from editor/components/block-settings-menu/block-settings-menu-plugins-group.js rename to editor/components/block-settings-menu/plugin-block-settings-menu-group.js index 41c8aaf113ed70..d523807b1aaf95 100644 --- a/editor/components/block-settings-menu/block-settings-menu-plugins-group.js +++ b/editor/components/block-settings-menu/plugin-block-settings-menu-group.js @@ -10,9 +10,9 @@ import { createSlotFill } from '@wordpress/components'; import { Fragment } from '@wordpress/element'; import { withSelect } from '@wordpress/data'; -const { Fill: BlockSettingsMenuPluginsGroup, Slot } = createSlotFill( 'BlockSettingsMenuPluginsGroup' ); +const { Fill: PluginBlockSettingsMenuGroup, Slot } = createSlotFill( 'PluginBlockSettingsMenuGroup' ); -const BlockSettingsMenuPluginsGroupSlot = ( { fillProps, selectedBlocks } ) => { +const PluginBlockSettingsMenuGroupSlot = ( { fillProps, selectedBlocks } ) => { selectedBlocks = map( selectedBlocks, ( block ) => block.name ); return ( @@ -26,8 +26,8 @@ const BlockSettingsMenuPluginsGroupSlot = ( { fillProps, selectedBlocks } ) => { ); }; -BlockSettingsMenuPluginsGroup.Slot = withSelect( ( select, { fillProps: { uids } } ) => ( { +PluginBlockSettingsMenuGroup.Slot = withSelect( ( select, { fillProps: { uids } } ) => ( { selectedBlocks: select( 'core/editor' ).getBlocksByUID( uids ), -} ) )( BlockSettingsMenuPluginsGroupSlot ); +} ) )( PluginBlockSettingsMenuGroupSlot ); -export default BlockSettingsMenuPluginsGroup; +export default PluginBlockSettingsMenuGroup; diff --git a/editor/components/block-settings-menu/block-settings-menu-plugins-item.js b/editor/components/block-settings-menu/plugin-block-settings-menu-item.js similarity index 83% rename from editor/components/block-settings-menu/block-settings-menu-plugins-item.js rename to editor/components/block-settings-menu/plugin-block-settings-menu-item.js index e20e7da782eaf3..9fd8b376c1478c 100644 --- a/editor/components/block-settings-menu/block-settings-menu-plugins-item.js +++ b/editor/components/block-settings-menu/plugin-block-settings-menu-item.js @@ -12,7 +12,7 @@ import { compose } from '@wordpress/element'; /** * Internal dependencies */ -import BlockSettingsMenuPluginsGroup from './block-settings-menu-plugins-group'; +import PluginBlockSettingsMenuGroup from './plugin-block-settings-menu-group'; const isEverySelectedBlockAllowed = ( selected, allowed ) => difference( selected, allowed ).length === 0; @@ -30,8 +30,8 @@ const isEverySelectedBlockAllowed = ( selected, allowed ) => difference( selecte const shouldRenderItem = ( selectedBlockNames, allowedBlockNames ) => ! Array.isArray( allowedBlockNames ) || isEverySelectedBlockAllowed( selectedBlockNames, allowedBlockNames ); -const BlockSettingsMenuPluginsItem = ( { allowedBlocks, icon, label, onClick, small, role } ) => ( - +const PluginBlockSettingsMenuItem = ( { allowedBlocks, icon, label, onClick, small, role } ) => ( + { ( { selectedBlocks, onClose } ) => { if ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) { return null; @@ -46,7 +46,7 @@ const BlockSettingsMenuPluginsItem = ( { allowedBlocks, icon, label, onClick, sm { ! small && label } ); } } - + ); -export default BlockSettingsMenuPluginsItem; +export default PluginBlockSettingsMenuItem; diff --git a/editor/components/index.js b/editor/components/index.js index 5e450f87272b8b..a28c17ed370239 100644 --- a/editor/components/index.js +++ b/editor/components/index.js @@ -83,8 +83,8 @@ export { default as BlockMover } from './block-mover'; export { default as BlockSelectionClearer } from './block-selection-clearer'; export { default as BlockSettingsMenu } from './block-settings-menu'; export { default as _BlockSettingsMenuFirstItem } from './block-settings-menu/block-settings-menu-first-item'; -export { default as BlockSettingsMenuPluginsGroup } from './block-settings-menu/block-settings-menu-plugins-group'; -export { default as BlockSettingsMenuPluginsItem } from './block-settings-menu/block-settings-menu-plugins-item'; +export { default as PluginBlockSettingsMenuGroup } from './block-settings-menu/plugin-block-settings-menu-group'; +export { default as PluginBlockSettingsMenuItem } from './block-settings-menu/plugin-block-settings-menu-item'; export { default as BlockTitle } from './block-title'; export { default as BlockToolbar } from './block-toolbar'; export { default as CopyHandler } from './copy-handler';