Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/plugin document setting panel docs #16620

Merged
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
10f2155
Merge remote-tracking branch 'upstream/master'
Oct 25, 2018
1e71527
Merge branch 'master' of github.com:ryanwelcher/gutenberg
Oct 26, 2018
1f84880
Merge remote-tracking branch 'upstream/master'
Oct 29, 2018
1b8abb5
Merge remote-tracking branch 'upstream/master'
Oct 30, 2018
4e157e3
Merge remote-tracking branch 'upstream/master'
Jan 17, 2019
80d16f9
Merge remote-tracking branch 'upstream/master'
Feb 12, 2019
44df501
Merge remote-tracking branch 'upstream/master'
Feb 12, 2019
60ecdbf
Merge remote-tracking branch 'upstream/master'
Apr 22, 2019
becc99e
Merge remote-tracking branch 'upstream/master'
Apr 29, 2019
baabb3d
Merge remote-tracking branch 'upstream/master'
May 6, 2019
7875f9c
Merge remote-tracking branch 'upstream/master'
May 6, 2019
47b6603
Merge remote-tracking branch 'upstream/master'
May 7, 2019
d406e81
Merge remote-tracking branch 'upstream/master'
May 20, 2019
ae92d91
Merge remote-tracking branch 'upstream/master'
May 22, 2019
88e5faf
Merge remote-tracking branch 'upstream/master'
May 23, 2019
642b80f
Merge remote-tracking branch 'upstream/master'
May 24, 2019
25a396e
Merge remote-tracking branch 'upstream/master'
Jun 4, 2019
ac92347
Merge remote-tracking branch 'upstream/master'
Jun 13, 2019
30e4692
Merge remote-tracking branch 'upstream/master'
Jun 15, 2019
c78138a
Merge remote-tracking branch 'upstream/master'
Jun 21, 2019
9e36834
Merge remote-tracking branch 'upstream/master'
Jul 1, 2019
58709fa
Merge remote-tracking branch 'upstream/master'
Jul 3, 2019
2078d23
Merge remote-tracking branch 'upstream/master'
Jul 3, 2019
0941bd4
Merge remote-tracking branch 'upstream/master'
Jul 9, 2019
2c96740
Merge remote-tracking branch 'upstream/master'
Jul 10, 2019
9b1d4b7
Merge remote-tracking branch 'upstream/master'
Jul 16, 2019
c6f59c6
Adds Documentation for the PluginDocumentSettingPanel SlotFill
Jul 16, 2019
c199dfa
Getting the name right on the docs is a good idea
Jul 16, 2019
3b1e60c
Regenerate docs
Jul 16, 2019
dbe8aa2
Closing example code block and regenerate docs
Jul 16, 2019
57e442a
Adds new SlotFill to the list
Jul 16, 2019
4b6082a
Merge remote-tracking branch 'upstream/master'
Jul 19, 2019
cf35bd3
Merge branch 'master' into fix/plugin-document-setting-panel-docs
Jul 19, 2019
9a63c5b
Changes to SlotFill description as per @youknowriad
Jul 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,25 @@
# PluginDocumentSettingPanel

This SlotFill allows adding items below the Status & Availability panel in the Document Sidebar.
ryanwelcher marked this conversation as resolved.
Show resolved Hide resolved

## Available Props
* __name__ `string`: A string identifying the panel.
* __className__ `string`: An optional class name added to the sidebar body.
* __title__ `string`: Title displayed at the top of the sidebar.
* __icon__ `(string|Element)`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.

## Example
```js
const { registerPlugin } = wp.plugins;
const { PluginDocumentSettingPanel } = wp.editPost;

const PluginDocumentSettingPanelDemo = () => (
<PluginDocumentSettingPanel
name="custom-panel"
title="Custom Panel"
className="custom-panel"
>
Custom Panel Contents
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe an example to edit a document setting (a meta field for instance) could be more valuable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion - perhaps we should apply this feedback to the other docs for SlotFill as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense.

Also, I feel having a "slotfills" category/section in the docs is also a bit misleading. I'd personally prefer extensibility options organized in a more "semantic way".

Instead of SlotFills section, we could have:

  • Block extensibilty APIs
  • Publishing flow extensibiltiy APIs
  • Document extensibility APIs

we could continue these adaptations separately.

Thanks for the update on this one 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there is an automated way to do that, via some kind of jsdoc tag to move slotfills into a more self-documented approach? (Just a musing!)

</PluginDocumentSettingPanel>
);
registerPlugin( 'plugin-document-setting-panel-demo', { render: PluginDocumentSettingPanelDemo, icon: 'palmtree' } );
ryanwelcher marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 6 additions & 0 deletions docs/manifest-devhub.json
Expand Up @@ -101,6 +101,12 @@
"markdown_source": "../docs/designers-developers/developers/slotfills/plugin-block-settings-menu-item.md",
"parent": "slotfills"
},
{
"title": "PluginDocumentSettingPanel",
"slug": "plugin-document-setting-panel",
"markdown_source": "../docs/designers-developers/developers/slotfills/plugin-document-setting-panel.md",
"parent": "slotfills"
},
{
"title": "PluginMoreMenuItem",
"slug": "plugin-more-menu-item",
Expand Down
1 change: 1 addition & 0 deletions docs/toc.json
Expand Up @@ -18,6 +18,7 @@
] },
{"docs/designers-developers/developers/slotfills/README.md": [
{ "docs/designers-developers/developers/slotfills/plugin-block-settings-menu-item.md": [] },
{ "docs/designers-developers/developers/slotfills/plugin-document-setting-panel.md": [] },
{ "docs/designers-developers/developers/slotfills/plugin-more-menu-item.md": [] },
{ "docs/designers-developers/developers/slotfills/plugin-post-publish-panel.md": [] },
{ "docs/designers-developers/developers/slotfills/plugin-post-status-info.md": [] },
Expand Down