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

Update PublishPanel docs and internal usage to editor package #60628

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

gaambo
Copy link
Contributor

@gaambo gaambo commented Apr 10, 2024

What?

This updates documentation to reflecht the changes form #60344

Why?

PluginPostPublishPanel and PluginPrePublishPanel where moved to @wordpress/editor (from @wordpress/edit-post). They are still available in the old package, but being deprecated there.

How?

  • Update example usage docs in those components/slot fills
  • update slotfill reference docs with new location
  • add notice that this change is only for gutenberg 18.1+ / wp 6.6+ - so not to confuse developers when looking at the docs now.
  • change the internal use of those components/slots to the new package

Testing Instructions

Docs:
nothing

Internal usage
The panel was used internally in the editor when installing a block directly in the editor and then publishing a post.

  1. Create an empty post
  2. Click the block inserter and search for a block which is not installed (e.g. icon block)
  3. Install the block
  4. Publish the post
  5. The PrePublishPanel should show Installed 1 Block

Testing Instructions for Keyboard

Screenshots or screencast

Copy link

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@gaambo
Copy link
Contributor Author

gaambo commented Apr 10, 2024

@ntsekouras do you mind taking a look at this, since the original changes were coming from you.

Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Thanks for handling this! Everything looks good besides my small comment.

@ntsekouras ntsekouras added the [Type] Developer Documentation Documentation for developers label Apr 10, 2024
const { PluginPrePublishPanel } = window?.wp?.editPost ?? {};
// We shouldn't import the editor package directly
// because it would include the wp-editor in all pages loading the block-directory script.
const { PluginPrePublishPanel } = window?.wp?.editor ?? {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm.. It seems I missed that in my PR.

I guess it's fine to just import from @wordpress/editor and remove this line and comments.

--cc @youknowriad if I missing something from #45895

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, that comment is a bit unclear to me.

@@ -99,8 +99,11 @@ The following SlotFills are available in the `edit-post` package. Please refer t
- [PluginBlockSettingsMenuItem](/docs/reference-guides/slotfills/plugin-block-settings-menu-item.md)
- [PluginDocumentSettingPanel](/docs/reference-guides/slotfills/plugin-document-setting-panel.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

The two above are also in the editor package.

@@ -2,11 +2,15 @@

This slot allows for injecting items into the bottom of the pre-publish panel that appears to confirm publishing after the user clicks "Publish".

<div class="callout callout-info">
`PluginPrePublishPanel` was moved from the `@wordpress/edit-post` package to `@wordpress/editor` in Gutenberg 18.1 (to be included in WordPress 6.6). The deprecated export will be removed with WordPress 6.8.
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if we should keep these callouts. We shouldn't remember to remove them later.

If we keep them, we should be doing the same for the other slots that moved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants