Skip to content

Commit

Permalink
Editor: Cleanup edit-post classnames and docs (#61240)
Browse files Browse the repository at this point in the history
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
  • Loading branch information
3 people committed May 2, 2024
1 parent 9bf67c4 commit 563b3b9
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This slot allows for injecting items into the bottom of the post-publish panel t

```js
import { registerPlugin } from '@wordpress/plugins';
import { PluginPostPublishPanel } from '@wordpress/edit-post';
import { PluginPostPublishPanel } from '@wordpress/editor';

const PluginPostPublishPanelTest = () => (
<PluginPostPublishPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This slot allows for injecting items into the bottom of the pre-publish panel th

```js
import { registerPlugin } from '@wordpress/plugins';
import { PluginPrePublishPanel } from '@wordpress/edit-post';
import { PluginPrePublishPanel } from '@wordpress/editor';

const PluginPrePublishPanelTest = () => (
<PluginPrePublishPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { blockDefault } from '@wordpress/icons';
import CompactList from '../../components/compact-list';
import { store as blockDirectoryStore } from '../../store';

// We shouldn't import the edit-post package directly
// because it would include the wp-edit-post in all pages loading the block-directory script.
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 ?? {};

export default function InstalledBlocksPrePublishPanel() {
const newBlockTypes = useSelect(
Expand Down
6 changes: 3 additions & 3 deletions packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ _Usage_
```jsx
// Using ESNext syntax
import { __ } from '@wordpress/i18n';
import { PluginPostPublishPanel } from '@wordpress/edit-post';
import { PluginPostPublishPanel } from '@wordpress/editor';

const MyPluginPostPublishPanel = () => (
<PluginPostPublishPanel
Expand Down Expand Up @@ -755,7 +755,7 @@ _Usage_
```jsx
// Using ESNext syntax
import { __ } from '@wordpress/i18n';
import { PluginPrePublishPanel } from '@wordpress/edit-post';
import { PluginPrePublishPanel } from '@wordpress/editor';

const MyPluginPrePublishPanel = () => (
<PluginPrePublishPanel
Expand Down Expand Up @@ -822,7 +822,7 @@ function MyPluginSidebar() {
// Using ESNext syntax
import { __ } from '@wordpress/i18n';
import { PanelBody } from '@wordpress/components';
import { PluginSidebar } from '@wordpress/edit-post';
import { PluginSidebar } from '@wordpress/editor';
import { more } from '@wordpress/icons';

const MyPluginSidebar = () => (
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/components/list-view-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default function ListViewSidebar() {
// can be rendered internally.
defaultTabId="list-view"
>
<div className="edit-post-editor__document-overview-panel__header">
<div className="editor-list-view-sidebar__header">
<Button
className="editor-list-view-sidebar__close-button"
icon={ closeSmall }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// @see packages/block-editor/src/components/inserter/style.scss
width: 350px;
}
.edit-post-editor__document-overview-panel__header {
.editor-list-view-sidebar__header {
display: flex;
border-bottom: $border-width solid $gray-300;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPostPublishPanel' );
* ```jsx
* // Using ESNext syntax
* import { __ } from '@wordpress/i18n';
* import { PluginPostPublishPanel } from '@wordpress/edit-post';
* import { PluginPostPublishPanel } from '@wordpress/editor';
*
* const MyPluginPostPublishPanel = () => (
* <PluginPostPublishPanel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPrePublishPanel' );
* ```jsx
* // Using ESNext syntax
* import { __ } from '@wordpress/i18n';
* import { PluginPrePublishPanel } from '@wordpress/edit-post';
* import { PluginPrePublishPanel } from '@wordpress/editor';
*
* const MyPluginPrePublishPanel = () => (
* <PluginPrePublishPanel
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/components/plugin-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import { store as editorStore } from '../../store';
* // Using ESNext syntax
* import { __ } from '@wordpress/i18n';
* import { PanelBody } from '@wordpress/components';
* import { PluginSidebar } from '@wordpress/edit-post';
* import { PluginSidebar } from '@wordpress/editor';
* import { more } from '@wordpress/icons';
*
* const MyPluginSidebar = () => (
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/components/post-excerpt/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );
* ```js
* // Using ES5 syntax
* var __ = wp.i18n.__;
* var PluginPostExcerpt = wp.editPost.PluginPostExcerpt;
* var PluginPostExcerpt = wp.editPost.__experimentalPluginPostExcerpt;
*
* function MyPluginPostExcerpt() {
* return React.createElement(
Expand All @@ -37,7 +37,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );
* ```jsx
* // Using ESNext syntax
* import { __ } from '@wordpress/i18n';
* import { PluginPostExcerpt } from '@wordpress/edit-post';
* import { __experimentalPluginPostExcerpt as PluginPostExcerpt } from '@wordpress/edit-post';
*
* const MyPluginPostExcerpt = () => (
* <PluginPostExcerpt className="my-plugin-post-excerpt">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function PostTemplateToggle( { isOpen, onClick } ) {
return (
<Button
__next40pxDefaultSize
className="edit-post-post-template__toggle"
variant="tertiary"
aria-expanded={ isOpen }
aria-label={ __( 'Template options' ) }
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/components/post-text-editor/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.edit-post-text-editor__body textarea.editor-post-text-editor {
textarea.editor-post-text-editor {
border: $border-width solid $gray-600;
border-radius: 0;
display: block;
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/components/post-title/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Raw Text Variant
.edit-post-text-editor__body .editor-post-title.is-raw-text {
.editor-post-title.is-raw-text {
margin-bottom: $grid-unit-30;
margin-top: 2px; // space for focus outline to appear.
max-width: none;
Expand Down

1 comment on commit 563b3b9

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 563b3b9.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8920998508
📝 Reported issues:

Please sign in to comment.