From 0e55e1063e32ece09843fdf6d96ac9f5af545e1e Mon Sep 17 00:00:00 2001 From: Ryan Welcher Date: Mon, 1 Jul 2019 16:35:51 -0400 Subject: [PATCH 01/25] Adds priority to context --- .../sidebar/plugin-sidebar/index.js | 170 ++++++++++++++++++ .../src/components/plugin-context/index.js | 36 ++++ 2 files changed, 206 insertions(+) create mode 100644 packages/edit-post/src/components/sidebar/plugin-sidebar/index.js create mode 100644 packages/plugins/src/components/plugin-context/index.js diff --git a/packages/edit-post/src/components/sidebar/plugin-sidebar/index.js b/packages/edit-post/src/components/sidebar/plugin-sidebar/index.js new file mode 100644 index 0000000000000..91e16e6d606ad --- /dev/null +++ b/packages/edit-post/src/components/sidebar/plugin-sidebar/index.js @@ -0,0 +1,170 @@ +/** + * WordPress dependencies + */ +import { Button, Panel } from '@wordpress/components'; +import { withDispatch, withSelect } from '@wordpress/data'; +import { __ } from '@wordpress/i18n'; +import { withPluginContext } from '@wordpress/plugins'; +import { compose } from '@wordpress/compose'; + +/** + * Internal dependencies + */ +import PinnedPlugins from '../../header/pinned-plugins'; +import Sidebar from '../'; +import SidebarHeader from '../sidebar-header'; + +function PluginSidebar( props ) { + const { + children, + className, + icon, + isActive, + isPinnable = true, + isPinned, + sidebarName, + title, + togglePin, + toggleSidebar, + } = props; + + return ( + <> + { isPinnable && ( + + { isPinned &&