-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document Outline: Implement the document outline as a plugin
- Loading branch information
1 parent
488aa8d
commit ef24693
Showing
9 changed files
with
37 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
edit-post/components/sidebar/document-outline-panel/index.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { Fragment } from '@wordpress/element'; | ||
import { registerPlugin } from '@wordpress/plugins'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { TableOfContentsPanel } from '@wordpress/editor'; | ||
import { PanelBody } from '@wordpress/components'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import PluginSidebar from '../../components/sidebar/plugin-sidebar'; | ||
import PluginSidebarMoreMenuItem from '../../components/header/plugin-sidebar-more-menu-item'; | ||
|
||
function DocumentOutlinePlugin() { | ||
return ( | ||
<Fragment> | ||
<PluginSidebar name="core/document-outline" title={ __( 'Content Structure' ) }> | ||
<PanelBody><TableOfContentsPanel /></PanelBody> | ||
</PluginSidebar> | ||
|
||
<PluginSidebarMoreMenuItem target="core/document-outline" icon="info-outline"> | ||
{ __( 'Content Structure' ) } | ||
</PluginSidebarMoreMenuItem> | ||
</Fragment> | ||
); | ||
} | ||
|
||
registerPlugin( 'core-document-outline', { | ||
render: DocumentOutlinePlugin, | ||
} ); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import './document-outline'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters