diff --git a/packages/edit-post/src/components/options-modal/index.js b/packages/edit-post/src/components/options-modal/index.js index a7e2cc2f395cc..bb3f613539062 100644 --- a/packages/edit-post/src/components/options-modal/index.js +++ b/packages/edit-post/src/components/options-modal/index.js @@ -23,6 +23,7 @@ import { */ import Section from './section'; import { + EnablePluginDocumentSettingPanelOption, EnablePublishSidebarOption, EnableTipsOption, EnablePanelOption, @@ -48,6 +49,7 @@ export function OptionsModal( { isModalActive, isViewable, closeModal } ) {
+ { isViewable && ( ) } diff --git a/packages/edit-post/src/components/options-modal/options/enable-plugin-document-setting-panel.js b/packages/edit-post/src/components/options-modal/options/enable-plugin-document-setting-panel.js new file mode 100644 index 0000000000000..ac979c357ad78 --- /dev/null +++ b/packages/edit-post/src/components/options-modal/options/enable-plugin-document-setting-panel.js @@ -0,0 +1,24 @@ +/** + * WordPress dependencies + */ +import { createSlotFill } from '@wordpress/components'; + +/** + * Internal dependencies + */ +import { EnablePanelOption } from './index'; + +const { Fill, Slot } = createSlotFill( 'EnablePluginDocumentSettingPanelOption' ); + +const EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => ( + + + +); + +EnablePluginDocumentSettingPanelOption.Slot = Slot; + +export default EnablePluginDocumentSettingPanelOption; diff --git a/packages/edit-post/src/components/options-modal/options/index.js b/packages/edit-post/src/components/options-modal/options/index.js index 7961206caba4e..e1263f9f68474 100644 --- a/packages/edit-post/src/components/options-modal/options/index.js +++ b/packages/edit-post/src/components/options-modal/options/index.js @@ -1,4 +1,5 @@ export { default as EnableCustomFieldsOption } from './enable-custom-fields'; export { default as EnablePanelOption } from './enable-panel'; +export { default as EnablePluginDocumentSettingPanelOption } from './enable-plugin-document-setting-panel'; export { default as EnablePublishSidebarOption } from './enable-publish-sidebar'; export { default as EnableTipsOption } from './enable-tips'; diff --git a/packages/edit-post/src/components/options-modal/test/__snapshots__/index.js.snap b/packages/edit-post/src/components/options-modal/test/__snapshots__/index.js.snap index a81252b32b95f..c2907a26e3001 100644 --- a/packages/edit-post/src/components/options-modal/test/__snapshots__/index.js.snap +++ b/packages/edit-post/src/components/options-modal/test/__snapshots__/index.js.snap @@ -19,6 +19,7 @@ exports[`OptionsModal should match snapshot when the modal is active 1`] = `
+ diff --git a/packages/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js b/packages/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js index 16ca9af32466b..ef10b4ed77ef3 100644 --- a/packages/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js +++ b/packages/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js @@ -10,24 +10,34 @@ import { compose } from '@wordpress/compose'; import { withPluginContext } from '@wordpress/plugins'; import { withDispatch, withSelect } from '@wordpress/data'; +/** + * Internal dependencies + */ +import { EnablePluginDocumentSettingPanelOption } from '../../options-modal/options'; + export const { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' ); -const PluginDocumentSettingFill = ( { isEnabled, opened, onToggle, className, title, icon, children } ) => { - if ( ! isEnabled ) { - return null; - } +const PluginDocumentSettingFill = ( { isEnabled, panelName, opened, onToggle, className, title, icon, children } ) => { return ( - - - { children } - - + <> + + + { isEnabled && ( + + { children } + + ) } + + ); }; @@ -104,4 +114,5 @@ const PluginDocumentSettingPanel = compose( )( PluginDocumentSettingFill ); PluginDocumentSettingPanel.Slot = Slot; + export default PluginDocumentSettingPanel;