From b6595afad8e14d204aa6310612fd7094e600075d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Thu, 25 Jun 2020 20:23:35 +0200 Subject: [PATCH] Docs: Update ESNext usage in public API (#23475) --- packages/edit-post/README.md | 20 +++++++++---------- .../plugin-block-settings-menu-item.js | 4 ++-- .../plugin-document-setting-panel/index.js | 4 ++-- .../plugin-post-publish-panel/index.js | 4 ++-- .../sidebar/plugin-post-status-info/index.js | 4 ++-- .../sidebar/plugin-pre-publish-panel/index.js | 4 ++-- packages/plugins/README.md | 4 ++-- packages/plugins/src/api/index.js | 2 +- .../src/components/plugin-area/index.js | 2 +- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/edit-post/README.md b/packages/edit-post/README.md index e18f8d5c8387f..bf34491f1bd06 100644 --- a/packages/edit-post/README.md +++ b/packages/edit-post/README.md @@ -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 = () => ( @@ -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 = () => ( ( ( * ESNext * ```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. diff --git a/packages/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js b/packages/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js index c83b42f2bee57..9f036edee62c7 100644 --- a/packages/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js +++ b/packages/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js @@ -89,8 +89,8 @@ const PluginDocumentSettingFill = ( { * ESNext * ```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 = () => ( * diff --git a/packages/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js b/packages/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js index 73fabe8a32f48..5a54525cf5ca2 100644 --- a/packages/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js +++ b/packages/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js @@ -59,8 +59,8 @@ const PluginPostPublishPanelFill = ( { * ESNext * ```jsx * // Using ESNext syntax - * const { __ } = wp.i18n; - * const { PluginPostPublishPanel } = wp.editPost; + * import { __ } from '@wordpress/i18n'; + * import { PluginPostPublishPanel } from '@wordpress/edit-post'; * * const MyPluginPostPublishPanel = () => ( * ESNext * ```jsx * // Using ESNext syntax - * const { __ } = wp.i18n; - * const { PluginPostStatusInfo } = wp.editPost; + * import { __ } from '@wordpress/i18n'; + * import { PluginPostStatusInfo } from '@wordpress/edit-post'; * * const MyPluginPostStatusInfo = () => ( * ESNext * ```jsx * // Using ESNext syntax - * const { __ } = wp.i18n; - * const { PluginPrePublishPanel } = wp.editPost; + * import { __ } from '@wordpress/i18n'; + * import { PluginPrePublishPanel } from '@wordpress/edit-post'; * * const MyPluginPrePublishPanel = () => ( * (
@@ -167,7 +167,7 @@ unregisterPlugin( 'plugin-name' ); ```js // Using ESNext syntax -const { unregisterPlugin } = wp.plugins; +import { unregisterPlugin } from '@wordpress/plugins'; unregisterPlugin( 'plugin-name' ); ``` diff --git a/packages/plugins/src/api/index.js b/packages/plugins/src/api/index.js index 61c6e6695304e..8a844b311cefd 100644 --- a/packages/plugins/src/api/index.js +++ b/packages/plugins/src/api/index.js @@ -168,7 +168,7 @@ export function registerPlugin( name, settings ) { * ESNext * ```js * // Using ESNext syntax - * const { unregisterPlugin } = wp.plugins; + * import { unregisterPlugin } from '@wordpress/plugins'; * * unregisterPlugin( 'plugin-name' ); * ``` diff --git a/packages/plugins/src/components/plugin-area/index.js b/packages/plugins/src/components/plugin-area/index.js index 445ded2e68d9b..4caa4827cfd48 100644 --- a/packages/plugins/src/components/plugin-area/index.js +++ b/packages/plugins/src/components/plugin-area/index.js @@ -39,7 +39,7 @@ import { getPlugins } from '../../api'; * ESNext * ```js * // Using ESNext syntax - * const { PluginArea } = wp.plugins; + * import { PluginArea } from '@wordpress/plugins'; * * const Layout = () => ( *