@wordpress/edit-post 8.0.0 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/back-button/index.js +3 -1
  3. package/build/components/back-button/index.js.map +1 -1
  4. package/build/components/init-pattern-modal/index.js +1 -1
  5. package/build/components/init-pattern-modal/index.js.map +1 -1
  6. package/build/components/layout/index.js +7 -14
  7. package/build/components/layout/index.js.map +1 -1
  8. package/build/components/preferences-modal/enable-custom-fields.js +1 -0
  9. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  10. package/build/deprecated.js +29 -0
  11. package/build/deprecated.js.map +1 -1
  12. package/build/lock-unlock.js +1 -1
  13. package/build/lock-unlock.js.map +1 -1
  14. package/build-module/components/back-button/index.js +3 -1
  15. package/build-module/components/back-button/index.js.map +1 -1
  16. package/build-module/components/init-pattern-modal/index.js +1 -1
  17. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  18. package/build-module/components/layout/index.js +7 -14
  19. package/build-module/components/layout/index.js.map +1 -1
  20. package/build-module/components/preferences-modal/enable-custom-fields.js +1 -0
  21. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  22. package/build-module/deprecated.js +29 -0
  23. package/build-module/deprecated.js.map +1 -1
  24. package/build-module/lock-unlock.js +1 -1
  25. package/build-module/lock-unlock.js.map +1 -1
  26. package/package.json +31 -30
  27. package/src/components/back-button/index.js +13 -6
  28. package/src/components/init-pattern-modal/index.js +1 -4
  29. package/src/components/layout/index.js +10 -14
  30. package/src/components/preferences-modal/enable-custom-fields.js +1 -0
  31. package/src/deprecated.js +32 -0
  32. package/src/lock-unlock.js +1 -1
package/src/deprecated.js CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  PluginSidebar as EditorPluginSidebar,
13
13
  PluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem,
14
14
  } from '@wordpress/editor';
15
+ import { getPath } from '@wordpress/url';
15
16
  import deprecated from '@wordpress/deprecated';
16
17
 
17
18
  /**
@@ -20,6 +21,10 @@ import deprecated from '@wordpress/deprecated';
20
21
  import { unlock } from './lock-unlock';
21
22
  const { PluginPostExcerpt } = unlock( editorPrivateApis );
22
23
 
24
+ const isSiteEditor = getPath( window.location.href )?.includes(
25
+ 'site-editor.php'
26
+ );
27
+
23
28
  const deprecateSlot = ( name ) => {
24
29
  deprecated( `wp.editPost.${ name }`, {
25
30
  since: '6.6',
@@ -32,6 +37,9 @@ const deprecateSlot = ( name ) => {
32
37
  * @see PluginBlockSettingsMenuItem in @wordpress/editor package.
33
38
  */
34
39
  export function PluginBlockSettingsMenuItem( props ) {
40
+ if ( isSiteEditor ) {
41
+ return null;
42
+ }
35
43
  deprecateSlot( 'PluginBlockSettingsMenuItem' );
36
44
  return <EditorPluginBlockSettingsMenuItem { ...props } />;
37
45
  }
@@ -40,6 +48,9 @@ export function PluginBlockSettingsMenuItem( props ) {
40
48
  * @see PluginDocumentSettingPanel in @wordpress/editor package.
41
49
  */
42
50
  export function PluginDocumentSettingPanel( props ) {
51
+ if ( isSiteEditor ) {
52
+ return null;
53
+ }
43
54
  deprecateSlot( 'PluginDocumentSettingPanel' );
44
55
  return <EditorPluginDocumentSettingPanel { ...props } />;
45
56
  }
@@ -48,6 +59,9 @@ export function PluginDocumentSettingPanel( props ) {
48
59
  * @see PluginMoreMenuItem in @wordpress/editor package.
49
60
  */
50
61
  export function PluginMoreMenuItem( props ) {
62
+ if ( isSiteEditor ) {
63
+ return null;
64
+ }
51
65
  deprecateSlot( 'PluginMoreMenuItem' );
52
66
  return <EditorPluginMoreMenuItem { ...props } />;
53
67
  }
@@ -56,6 +70,9 @@ export function PluginMoreMenuItem( props ) {
56
70
  * @see PluginPrePublishPanel in @wordpress/editor package.
57
71
  */
58
72
  export function PluginPrePublishPanel( props ) {
73
+ if ( isSiteEditor ) {
74
+ return null;
75
+ }
59
76
  deprecateSlot( 'PluginPrePublishPanel' );
60
77
  return <EditorPluginPrePublishPanel { ...props } />;
61
78
  }
@@ -64,6 +81,9 @@ export function PluginPrePublishPanel( props ) {
64
81
  * @see PluginPostPublishPanel in @wordpress/editor package.
65
82
  */
66
83
  export function PluginPostPublishPanel( props ) {
84
+ if ( isSiteEditor ) {
85
+ return null;
86
+ }
67
87
  deprecateSlot( 'PluginPostPublishPanel' );
68
88
  return <EditorPluginPostPublishPanel { ...props } />;
69
89
  }
@@ -72,6 +92,9 @@ export function PluginPostPublishPanel( props ) {
72
92
  * @see PluginPostStatusInfo in @wordpress/editor package.
73
93
  */
74
94
  export function PluginPostStatusInfo( props ) {
95
+ if ( isSiteEditor ) {
96
+ return null;
97
+ }
75
98
  deprecateSlot( 'PluginPostStatusInfo' );
76
99
  return <EditorPluginPostStatusInfo { ...props } />;
77
100
  }
@@ -80,6 +103,9 @@ export function PluginPostStatusInfo( props ) {
80
103
  * @see PluginSidebar in @wordpress/editor package.
81
104
  */
82
105
  export function PluginSidebar( props ) {
106
+ if ( isSiteEditor ) {
107
+ return null;
108
+ }
83
109
  deprecateSlot( 'PluginSidebar' );
84
110
  return <EditorPluginSidebar { ...props } />;
85
111
  }
@@ -88,6 +114,9 @@ export function PluginSidebar( props ) {
88
114
  * @see PluginSidebarMoreMenuItem in @wordpress/editor package.
89
115
  */
90
116
  export function PluginSidebarMoreMenuItem( props ) {
117
+ if ( isSiteEditor ) {
118
+ return null;
119
+ }
91
120
  deprecateSlot( 'PluginSidebarMoreMenuItem' );
92
121
  return <EditorPluginSidebarMoreMenuItem { ...props } />;
93
122
  }
@@ -96,6 +125,9 @@ export function PluginSidebarMoreMenuItem( props ) {
96
125
  * @see PluginPostExcerpt in @wordpress/editor package.
97
126
  */
98
127
  export function __experimentalPluginPostExcerpt() {
128
+ if ( isSiteEditor ) {
129
+ return null;
130
+ }
99
131
  deprecated( 'wp.editPost.__experimentalPluginPostExcerpt', {
100
132
  since: '6.6',
101
133
  hint: 'Core and custom panels can be access programmatically using their panel name.',
@@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri
5
5
 
6
6
  export const { lock, unlock } =
7
7
  __dangerousOptInToUnstableAPIsOnlyForCoreModules(
8
- 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
8
+ 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',
9
9
  '@wordpress/edit-post'
10
10
  );