Skip to content

Commit

Permalink
Docs: Update ESNext usage in public API (#23475)
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo authored Jun 25, 2020
1 parent 6bddbd1 commit b6595af
Showing 9 changed files with 24 additions and 24 deletions.
20 changes: 10 additions & 10 deletions packages/edit-post/README.md
Original file line number Diff line number Diff line change
@@ -72,8 +72,8 @@ function MyPluginBlockSettingsMenuItem() {

```jsx
// Using ESNext syntax
import { __ } from wp.i18n;
import { PluginBlockSettingsMenuItem } from wp.editPost;
import { __ } from '@wordpress/i18n';
import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post';

const doOnClick = ( ) => {
// To be called when the user clicks the menu item.
@@ -133,8 +133,8 @@ registerPlugin( 'my-document-setting-plugin', {

```jsx
// Using ESNext syntax
const { registerPlugin } = wp.plugins;
const { PluginDocumentSettingPanel } = wp.editPost;
import { registerPlugin } from '@wordpress/plugins';
import { PluginDocumentSettingPanel } from '@wordpress/edit-post';

const MyDocumentSettingTest = () => (
<PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel">
@@ -245,8 +245,8 @@ function MyPluginPostPublishPanel() {

```jsx
// Using ESNext syntax
const { __ } = wp.i18n;
const { PluginPostPublishPanel } = wp.editPost;
import { __ } from '@wordpress/i18n';
import { PluginPostPublishPanel } from '@wordpress/edit-post';

const MyPluginPostPublishPanel = () => (
<PluginPostPublishPanel
@@ -297,8 +297,8 @@ function MyPluginPostStatusInfo() {

```jsx
// Using ESNext syntax
const { __ } = wp.i18n;
const { PluginPostStatusInfo } = wp.editPost;
import { __ } from '@wordpress/i18n';
import { PluginPostStatusInfo } from '@wordpress/edit-post';

const MyPluginPostStatusInfo = () => (
<PluginPostStatusInfo
@@ -346,8 +346,8 @@ function MyPluginPrePublishPanel() {

```jsx
// Using ESNext syntax
const { __ } = wp.i18n;
const { PluginPrePublishPanel } = wp.editPost;
import { __ } from '@wordpress/i18n';
import { PluginPrePublishPanel } from '@wordpress/edit-post';

const MyPluginPrePublishPanel = () => (
<PluginPrePublishPanel
Original file line number Diff line number Diff line change
@@ -68,8 +68,8 @@ const shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>
* <caption>ESNext</caption>
* ```jsx
* // Using ESNext syntax
* import { __ } from wp.i18n;
* import { PluginBlockSettingsMenuItem } from wp.editPost;
* import { __ } from '@wordpress/i18n';
* import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post';
*
* const doOnClick = ( ) => {
* // To be called when the user clicks the menu item.
Original file line number Diff line number Diff line change
@@ -89,8 +89,8 @@ const PluginDocumentSettingFill = ( {
* <caption>ESNext</caption>
* ```jsx
* // Using ESNext syntax
* const { registerPlugin } = wp.plugins;
* const { PluginDocumentSettingPanel } = wp.editPost;
* import { registerPlugin } from '@wordpress/plugins';
* import { PluginDocumentSettingPanel } from '@wordpress/edit-post';
*
* const MyDocumentSettingTest = () => (
* <PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel">
Original file line number Diff line number Diff line change
@@ -59,8 +59,8 @@ const PluginPostPublishPanelFill = ( {
* <caption>ESNext</caption>
* ```jsx
* // Using ESNext syntax
* const { __ } = wp.i18n;
* const { PluginPostPublishPanel } = wp.editPost;
* import { __ } from '@wordpress/i18n';
* import { PluginPostPublishPanel } from '@wordpress/edit-post';
*
* const MyPluginPostPublishPanel = () => (
* <PluginPostPublishPanel
Original file line number Diff line number Diff line change
@@ -40,8 +40,8 @@ export const { Fill, Slot } = createSlotFill( 'PluginPostStatusInfo' );
* <caption>ESNext</caption>
* ```jsx
* // Using ESNext syntax
* const { __ } = wp.i18n;
* const { PluginPostStatusInfo } = wp.editPost;
* import { __ } from '@wordpress/i18n';
* import { PluginPostStatusInfo } from '@wordpress/edit-post';
*
* const MyPluginPostStatusInfo = () => (
* <PluginPostStatusInfo
Original file line number Diff line number Diff line change
@@ -62,8 +62,8 @@ const PluginPrePublishPanelFill = ( {
* <caption>ESNext</caption>
* ```jsx
* // Using ESNext syntax
* const { __ } = wp.i18n;
* const { PluginPrePublishPanel } = wp.editPost;
* import { __ } from '@wordpress/i18n';
* import { PluginPrePublishPanel } from '@wordpress/edit-post';
*
* const MyPluginPrePublishPanel = () => (
* <PluginPrePublishPanel
4 changes: 2 additions & 2 deletions packages/plugins/README.md
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ function Layout() {

```js
// Using ESNext syntax
const { PluginArea } = wp.plugins;
import { PluginArea } from '@wordpress/plugins';

const Layout = () => (
<div>
@@ -167,7 +167,7 @@ unregisterPlugin( 'plugin-name' );

```js
// Using ESNext syntax
const { unregisterPlugin } = wp.plugins;
import { unregisterPlugin } from '@wordpress/plugins';

unregisterPlugin( 'plugin-name' );
```
2 changes: 1 addition & 1 deletion packages/plugins/src/api/index.js
Original file line number Diff line number Diff line change
@@ -168,7 +168,7 @@ export function registerPlugin( name, settings ) {
* <caption>ESNext</caption>
* ```js
* // Using ESNext syntax
* const { unregisterPlugin } = wp.plugins;
* import { unregisterPlugin } from '@wordpress/plugins';
*
* unregisterPlugin( 'plugin-name' );
* ```
2 changes: 1 addition & 1 deletion packages/plugins/src/components/plugin-area/index.js
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ import { getPlugins } from '../../api';
* <caption>ESNext</caption>
* ```js
* // Using ESNext syntax
* const { PluginArea } = wp.plugins;
* import { PluginArea } from '@wordpress/plugins';
*
* const Layout = () => (
* <div>

0 comments on commit b6595af

Please sign in to comment.