@wordpress/edit-post 7.33.0 → 7.34.0

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 (121) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +22 -36
  3. package/build/components/header/index.js +17 -48
  4. package/build/components/header/index.js.map +1 -1
  5. package/build/components/header/more-menu/index.js +17 -43
  6. package/build/components/header/more-menu/index.js.map +1 -1
  7. package/build/components/header/more-menu/manage-patterns-menu-item.js +40 -0
  8. package/build/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
  9. package/build/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
  10. package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
  11. package/build/components/keyboard-shortcuts/index.js +0 -88
  12. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  13. package/build/components/layout/index.js +18 -11
  14. package/build/components/layout/index.js.map +1 -1
  15. package/build/components/preferences-modal/index.js +2 -11
  16. package/build/components/preferences-modal/index.js.map +1 -1
  17. package/build/components/sidebar/post-status/index.js +29 -6
  18. package/build/components/sidebar/post-status/index.js.map +1 -1
  19. package/build/components/sidebar/settings-sidebar/index.js +40 -10
  20. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  21. package/build/deprecated.js +132 -0
  22. package/build/deprecated.js.map +1 -0
  23. package/build/index.js +19 -58
  24. package/build/index.js.map +1 -1
  25. package/build-module/components/header/index.js +20 -51
  26. package/build-module/components/header/index.js.map +1 -1
  27. package/build-module/components/header/more-menu/index.js +17 -43
  28. package/build-module/components/header/more-menu/index.js.map +1 -1
  29. package/build-module/components/header/more-menu/manage-patterns-menu-item.js +33 -0
  30. package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
  31. package/build-module/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
  32. package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
  33. package/build-module/components/keyboard-shortcuts/index.js +1 -89
  34. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  35. package/build-module/components/layout/index.js +18 -11
  36. package/build-module/components/layout/index.js.map +1 -1
  37. package/build-module/components/preferences-modal/index.js +3 -12
  38. package/build-module/components/preferences-modal/index.js.map +1 -1
  39. package/build-module/components/sidebar/post-status/index.js +30 -7
  40. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  41. package/build-module/components/sidebar/settings-sidebar/index.js +43 -13
  42. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  43. package/build-module/deprecated.js +116 -0
  44. package/build-module/deprecated.js.map +1 -0
  45. package/build-module/index.js +2 -15
  46. package/build-module/index.js.map +1 -1
  47. package/build-style/style-rtl.css +6 -141
  48. package/build-style/style.css +6 -141
  49. package/package.json +31 -31
  50. package/src/components/header/index.js +24 -69
  51. package/src/components/header/more-menu/index.js +27 -42
  52. package/src/components/header/more-menu/manage-patterns-menu-item.js +33 -0
  53. package/src/components/header/style.scss +0 -79
  54. package/src/components/keyboard-shortcuts/index.js +1 -106
  55. package/src/components/layout/index.js +12 -6
  56. package/src/components/layout/style.scss +7 -80
  57. package/src/components/preferences-modal/index.js +2 -22
  58. package/src/components/sidebar/post-status/index.js +57 -17
  59. package/src/components/sidebar/settings-sidebar/index.js +60 -24
  60. package/src/deprecated.js +107 -0
  61. package/src/index.js +3 -24
  62. package/build/components/header/post-publish-button-or-toggle.js +0 -94
  63. package/build/components/header/post-publish-button-or-toggle.js.map +0 -1
  64. package/build/components/header/preferences-menu-item/index.js +0 -39
  65. package/build/components/header/preferences-menu-item/index.js.map +0 -1
  66. package/build/components/header/tools-more-menu-group/index.js +0 -26
  67. package/build/components/header/tools-more-menu-group/index.js.map +0 -1
  68. package/build/components/header/writing-menu/index.js +0 -71
  69. package/build/components/header/writing-menu/index.js.map +0 -1
  70. package/build/components/layout/actions-panel.js +0 -86
  71. package/build/components/layout/actions-panel.js.map +0 -1
  72. package/build/components/preferences-modal/enable-publish-sidebar.js +0 -38
  73. package/build/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
  74. package/build/components/sidebar/plugin-post-publish-panel/index.js +0 -39
  75. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
  76. package/build/components/sidebar/plugin-pre-publish-panel/index.js +0 -43
  77. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
  78. package/build/plugins/copy-content-menu-item/index.js +0 -39
  79. package/build/plugins/copy-content-menu-item/index.js.map +0 -1
  80. package/build/plugins/index.js +0 -69
  81. package/build/plugins/index.js.map +0 -1
  82. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -44
  83. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
  84. package/build/plugins/welcome-guide-menu-item/index.js.map +0 -1
  85. package/build-module/components/header/post-publish-button-or-toggle.js +0 -86
  86. package/build-module/components/header/post-publish-button-or-toggle.js.map +0 -1
  87. package/build-module/components/header/preferences-menu-item/index.js +0 -32
  88. package/build-module/components/header/preferences-menu-item/index.js.map +0 -1
  89. package/build-module/components/header/tools-more-menu-group/index.js +0 -19
  90. package/build-module/components/header/tools-more-menu-group/index.js.map +0 -1
  91. package/build-module/components/header/writing-menu/index.js +0 -64
  92. package/build-module/components/header/writing-menu/index.js.map +0 -1
  93. package/build-module/components/layout/actions-panel.js +0 -78
  94. package/build-module/components/layout/actions-panel.js.map +0 -1
  95. package/build-module/components/preferences-modal/enable-publish-sidebar.js +0 -31
  96. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
  97. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +0 -32
  98. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
  99. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +0 -36
  100. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
  101. package/build-module/plugins/copy-content-menu-item/index.js +0 -32
  102. package/build-module/plugins/copy-content-menu-item/index.js.map +0 -1
  103. package/build-module/plugins/index.js +0 -65
  104. package/build-module/plugins/index.js.map +0 -1
  105. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -36
  106. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
  107. package/build-module/plugins/welcome-guide-menu-item/index.js.map +0 -1
  108. package/src/components/header/post-publish-button-or-toggle.js +0 -97
  109. package/src/components/header/preferences-menu-item/index.js +0 -31
  110. package/src/components/header/test/index.js +0 -63
  111. package/src/components/header/tools-more-menu-group/index.js +0 -20
  112. package/src/components/header/writing-menu/index.js +0 -73
  113. package/src/components/layout/actions-panel.js +0 -103
  114. package/src/components/preferences-modal/enable-publish-sidebar.js +0 -32
  115. package/src/components/preferences-modal/test/index.js +0 -28
  116. package/src/components/sidebar/plugin-post-publish-panel/index.js +0 -28
  117. package/src/components/sidebar/plugin-pre-publish-panel/index.js +0 -32
  118. package/src/plugins/copy-content-menu-item/index.js +0 -29
  119. package/src/plugins/index.js +0 -85
  120. package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -36
  121. /package/src/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +0 -0
@@ -0,0 +1,107 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ privateApis as editorPrivateApis,
6
+ PluginBlockSettingsMenuItem as EditorPluginBlockSettingsMenuItem,
7
+ PluginDocumentSettingPanel as EditorPluginDocumentSettingPanel,
8
+ PluginMoreMenuItem as EditorPluginMoreMenuItem,
9
+ PluginPrePublishPanel as EditorPluginPrePublishPanel,
10
+ PluginPostPublishPanel as EditorPluginPostPublishPanel,
11
+ PluginPostStatusInfo as EditorPluginPostStatusInfo,
12
+ PluginSidebar as EditorPluginSidebar,
13
+ PluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem,
14
+ } from '@wordpress/editor';
15
+ import deprecated from '@wordpress/deprecated';
16
+
17
+ /**
18
+ * Internal dependencies
19
+ */
20
+ import { unlock } from './lock-unlock';
21
+ const { PluginPostExcerpt } = unlock( editorPrivateApis );
22
+
23
+ const deprecateSlot = ( name ) => {
24
+ deprecated( `wp.editPost.${ name }`, {
25
+ since: '6.6',
26
+ alternative: `wp.editor.${ name }`,
27
+ } );
28
+ };
29
+
30
+ /* eslint-disable jsdoc/require-param */
31
+ /**
32
+ * @see PluginBlockSettingsMenuItem in @wordpress/editor package.
33
+ */
34
+ export function PluginBlockSettingsMenuItem( props ) {
35
+ deprecateSlot( 'PluginBlockSettingsMenuItem' );
36
+ return <EditorPluginBlockSettingsMenuItem { ...props } />;
37
+ }
38
+
39
+ /**
40
+ * @see PluginDocumentSettingPanel in @wordpress/editor package.
41
+ */
42
+ export function PluginDocumentSettingPanel( props ) {
43
+ deprecateSlot( 'PluginDocumentSettingPanel' );
44
+ return <EditorPluginDocumentSettingPanel { ...props } />;
45
+ }
46
+
47
+ /**
48
+ * @see PluginMoreMenuItem in @wordpress/editor package.
49
+ */
50
+ export function PluginMoreMenuItem( props ) {
51
+ deprecateSlot( 'PluginMoreMenuItem' );
52
+ return <EditorPluginMoreMenuItem { ...props } />;
53
+ }
54
+
55
+ /**
56
+ * @see PluginPrePublishPanel in @wordpress/editor package.
57
+ */
58
+ export function PluginPrePublishPanel( props ) {
59
+ deprecateSlot( 'PluginPrePublishPanel' );
60
+ return <EditorPluginPrePublishPanel { ...props } />;
61
+ }
62
+
63
+ /**
64
+ * @see PluginPostPublishPanel in @wordpress/editor package.
65
+ */
66
+ export function PluginPostPublishPanel( props ) {
67
+ deprecateSlot( 'PluginPostPublishPanel' );
68
+ return <EditorPluginPostPublishPanel { ...props } />;
69
+ }
70
+
71
+ /**
72
+ * @see PluginPostStatusInfo in @wordpress/editor package.
73
+ */
74
+ export function PluginPostStatusInfo( props ) {
75
+ deprecateSlot( 'PluginPostStatusInfo' );
76
+ return <EditorPluginPostStatusInfo { ...props } />;
77
+ }
78
+
79
+ /**
80
+ * @see PluginSidebar in @wordpress/editor package.
81
+ */
82
+ export function PluginSidebar( props ) {
83
+ deprecateSlot( 'PluginSidebar' );
84
+ return <EditorPluginSidebar { ...props } />;
85
+ }
86
+
87
+ /**
88
+ * @see PluginSidebarMoreMenuItem in @wordpress/editor package.
89
+ */
90
+ export function PluginSidebarMoreMenuItem( props ) {
91
+ deprecateSlot( 'PluginSidebarMoreMenuItem' );
92
+ return <EditorPluginSidebarMoreMenuItem { ...props } />;
93
+ }
94
+
95
+ /**
96
+ * @see PluginPostExcerpt in @wordpress/editor package.
97
+ */
98
+ export function __experimentalPluginPostExcerpt() {
99
+ deprecated( 'wp.editPost.__experimentalPluginPostExcerpt', {
100
+ since: '6.6',
101
+ hint: 'Core and custom panels can be access programmatically using their panel name.',
102
+ link: 'https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically',
103
+ } );
104
+ return PluginPostExcerpt;
105
+ }
106
+
107
+ /* eslint-enable jsdoc/require-param */
package/src/index.js CHANGED
@@ -14,27 +14,13 @@ import {
14
14
  registerLegacyWidgetBlock,
15
15
  registerWidgetGroupBlock,
16
16
  } from '@wordpress/widgets';
17
- import {
18
- PluginBlockSettingsMenuItem,
19
- PluginDocumentSettingPanel,
20
- PluginMoreMenuItem,
21
- PluginPostStatusInfo,
22
- PluginSidebar,
23
- PluginSidebarMoreMenuItem,
24
- privateApis as editorPrivateApis,
25
- store as editorStore,
26
- } from '@wordpress/editor';
17
+ import { store as editorStore } from '@wordpress/editor';
27
18
 
28
19
  /**
29
20
  * Internal dependencies
30
21
  */
31
22
  import './hooks';
32
- import './plugins';
33
23
  import Editor from './editor';
34
- import { unlock } from './lock-unlock';
35
-
36
- const { PluginPostExcerpt: __experimentalPluginPostExcerpt } =
37
- unlock( editorPrivateApis );
38
24
 
39
25
  /**
40
26
  * Initializes and returns an instance of Editor.
@@ -166,15 +152,8 @@ export function reinitializeEditor() {
166
152
  } );
167
153
  }
168
154
 
169
- export { PluginBlockSettingsMenuItem };
170
- export { PluginDocumentSettingPanel };
171
- export { PluginMoreMenuItem };
172
- export { PluginPostStatusInfo };
173
- export { PluginSidebar };
174
- export { PluginSidebarMoreMenuItem };
175
- export { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';
176
- export { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';
177
155
  export { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';
178
156
  export { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';
179
- export { __experimentalPluginPostExcerpt };
157
+
180
158
  export { store } from './store';
159
+ export * from './deprecated';
@@ -1,94 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PostPublishButtonOrToggle = PostPublishButtonOrToggle;
7
- exports.default = void 0;
8
- var _react = require("react");
9
- var _compose = require("@wordpress/compose");
10
- var _data = require("@wordpress/data");
11
- var _editor = require("@wordpress/editor");
12
- /**
13
- * WordPress dependencies
14
- */
15
-
16
- function PostPublishButtonOrToggle({
17
- forceIsDirty,
18
- hasPublishAction,
19
- isBeingScheduled,
20
- isPending,
21
- isPublished,
22
- isPublishSidebarEnabled,
23
- isPublishSidebarOpened,
24
- isScheduled,
25
- togglePublishSidebar,
26
- setEntitiesSavedStatesCallback,
27
- postStatusHasChanged,
28
- postStatus
29
- }) {
30
- const IS_TOGGLE = 'toggle';
31
- const IS_BUTTON = 'button';
32
- const isSmallerThanMediumViewport = (0, _compose.useViewportMatch)('medium', '<');
33
- let component;
34
-
35
- /**
36
- * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):
37
- *
38
- * 1) We want to show a BUTTON when the post status is at the _final stage_
39
- * for a particular role (see https://wordpress.org/documentation/article/post-status/):
40
- *
41
- * - is published
42
- * - post status has changed explicitely to something different than 'future' or 'publish'
43
- * - is scheduled to be published
44
- * - is pending and can't be published (but only for viewports >= medium).
45
- * Originally, we considered showing a button for pending posts that couldn't be published
46
- * (for example, for an author with the contributor role). Some languages can have
47
- * long translations for "Submit for review", so given the lack of UI real estate available
48
- * we decided to take into account the viewport in that case.
49
- * See: https://github.com/WordPress/gutenberg/issues/10475
50
- *
51
- * 2) Then, in small viewports, we'll show a TOGGLE.
52
- *
53
- * 3) Finally, we'll use the publish sidebar status to decide:
54
- *
55
- * - if it is enabled, we show a TOGGLE
56
- * - if it is disabled, we show a BUTTON
57
- */
58
- if (isPublished || postStatusHasChanged && !['future', 'publish'].includes(postStatus) || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) {
59
- component = IS_BUTTON;
60
- } else if (isSmallerThanMediumViewport || isPublishSidebarEnabled) {
61
- component = IS_TOGGLE;
62
- } else {
63
- component = IS_BUTTON;
64
- }
65
- return (0, _react.createElement)(_editor.PostPublishButton, {
66
- forceIsDirty: forceIsDirty,
67
- isOpen: isPublishSidebarOpened,
68
- isToggle: component === IS_TOGGLE,
69
- onToggle: togglePublishSidebar,
70
- setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
71
- });
72
- }
73
- var _default = exports.default = (0, _compose.compose)((0, _data.withSelect)(select => {
74
- var _select$getCurrentPos;
75
- return {
76
- hasPublishAction: (_select$getCurrentPos = select(_editor.store).getCurrentPost()?._links?.['wp:action-publish']) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false,
77
- isBeingScheduled: select(_editor.store).isEditedPostBeingScheduled(),
78
- isPending: select(_editor.store).isCurrentPostPending(),
79
- isPublished: select(_editor.store).isCurrentPostPublished(),
80
- isPublishSidebarEnabled: select(_editor.store).isPublishSidebarEnabled(),
81
- isPublishSidebarOpened: select(_editor.store).isPublishSidebarOpened(),
82
- isScheduled: select(_editor.store).isCurrentPostScheduled(),
83
- postStatus: select(_editor.store).getEditedPostAttribute('status'),
84
- postStatusHasChanged: select(_editor.store).getPostEdits()?.status
85
- };
86
- }), (0, _data.withDispatch)(dispatch => {
87
- const {
88
- togglePublishSidebar
89
- } = dispatch(_editor.store);
90
- return {
91
- togglePublishSidebar
92
- };
93
- }))(PostPublishButtonOrToggle);
94
- //# sourceMappingURL=post-publish-button-or-toggle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_compose","require","_data","_editor","PostPublishButtonOrToggle","forceIsDirty","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","postStatusHasChanged","postStatus","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","useViewportMatch","component","includes","_react","createElement","PostPublishButton","isOpen","isToggle","onToggle","_default","exports","default","compose","withSelect","select","_select$getCurrentPos","editorStore","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","isCurrentPostScheduled","getEditedPostAttribute","getPostEdits","status","withDispatch","dispatch"],"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch, compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { PostPublishButton, store as editorStore } from '@wordpress/editor';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\thasPublishAction,\n\tisBeingScheduled,\n\tisPending,\n\tisPublished,\n\tisPublishSidebarEnabled,\n\tisPublishSidebarOpened,\n\tisScheduled,\n\ttogglePublishSidebar,\n\tsetEntitiesSavedStatesCallback,\n\tpostStatusHasChanged,\n\tpostStatus,\n} ) {\n\tconst IS_TOGGLE = 'toggle';\n\tconst IS_BUTTON = 'button';\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tlet component;\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - post status has changed explicitely to something different than 'future' or 'publish'\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport || isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\thasPublishAction:\n\t\t\tselect( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false,\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled:\n\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened: select( editorStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t\tpostStatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tpostStatusHasChanged: select( editorStore ).getPostEdits()?.status,\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editorStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKO,SAASG,yBAAyBA,CAAE;EAC1CC,YAAY;EACZC,gBAAgB;EAChBC,gBAAgB;EAChBC,SAAS;EACTC,WAAW;EACXC,uBAAuB;EACvBC,sBAAsB;EACtBC,WAAW;EACXC,oBAAoB;EACpBC,8BAA8B;EAC9BC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,2BAA2B,GAAG,IAAAC,yBAAgB,EAAE,QAAQ,EAAE,GAAI,CAAC;EACrE,IAAIC,SAAS;;EAEb;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,IACCZ,WAAW,IACTM,oBAAoB,IACrB,CAAE,CAAE,QAAQ,EAAE,SAAS,CAAE,CAACO,QAAQ,CAAEN,UAAW,CAAG,IACjDJ,WAAW,IAAIL,gBAAkB,IACjCC,SAAS,IAAI,CAAEF,gBAAgB,IAAI,CAAEa,2BAA6B,EACnE;IACDE,SAAS,GAAGH,SAAS;EACtB,CAAC,MAAM,IAAKC,2BAA2B,IAAIT,uBAAuB,EAAG;IACpEW,SAAS,GAAGJ,SAAS;EACtB,CAAC,MAAM;IACNI,SAAS,GAAGH,SAAS;EACtB;EAEA,OACC,IAAA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AAM;IAAElC;EAAqB,CAAC,GAAGkC,QAAQ,CAAEX,aAAY,CAAC;EACxD,OAAO;IACNvB;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAET,yBAA0B,CAAC","ignoreList":[]}
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = PreferencesMenuItem;
7
- var _react = require("react");
8
- var _data = require("@wordpress/data");
9
- var _i18n = require("@wordpress/i18n");
10
- var _components = require("@wordpress/components");
11
- var _editor = require("@wordpress/editor");
12
- var _lockUnlock = require("../../../lock-unlock");
13
- /**
14
- * WordPress dependencies
15
- */
16
-
17
- /**
18
- * Internal dependencies
19
- */
20
-
21
- const {
22
- interfaceStore
23
- } = (0, _lockUnlock.unlock)(_editor.privateApis);
24
-
25
- /**
26
- * Internal dependencies
27
- */
28
-
29
- function PreferencesMenuItem() {
30
- const {
31
- openModal
32
- } = (0, _data.useDispatch)(interfaceStore);
33
- return (0, _react.createElement)(_components.MenuItem, {
34
- onClick: () => {
35
- openModal('editor/preferences');
36
- }
37
- }, (0, _i18n.__)('Preferences'));
38
- }
39
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_data","require","_i18n","_components","_editor","_lockUnlock","interfaceStore","unlock","editorPrivateApis","PreferencesMenuItem","openModal","useDispatch","_react","createElement","MenuItem","onClick","__"],"sources":["@wordpress/edit-post/src/components/header/preferences-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\n/**\n * Internal dependencies\n */\n\nexport default function PreferencesMenuItem() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( 'editor/preferences' );\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Preferences' ) }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAM;EAAEK;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAEtD;AACA;AACA;;AAEe,SAASC,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,iBAAW,EAAEL,cAAe,CAAC;EACnD,OACC,IAAAM,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAW,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACfL,SAAS,CAAE,oBAAqB,CAAC;IAClC;EAAG,GAED,IAAAM,QAAE,EAAE,aAAc,CACX,CAAC;AAEb","ignoreList":[]}
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _components = require("@wordpress/components");
9
- var _i18n = require("@wordpress/i18n");
10
- /**
11
- * WordPress dependencies
12
- */
13
-
14
- const {
15
- Fill: ToolsMoreMenuGroup,
16
- Slot
17
- } = (0, _components.createSlotFill)('ToolsMoreMenuGroup');
18
- ToolsMoreMenuGroup.Slot = ({
19
- fillProps
20
- }) => (0, _react.createElement)(Slot, {
21
- fillProps: fillProps
22
- }, fills => fills.length > 0 && (0, _react.createElement)(_components.MenuGroup, {
23
- label: (0, _i18n.__)('Tools')
24
- }, fills));
25
- var _default = exports.default = ToolsMoreMenuGroup;
26
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","_i18n","Fill","ToolsMoreMenuGroup","Slot","createSlotFill","fillProps","_react","createElement","fills","length","MenuGroup","label","__","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, MenuGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } =\n\tcreateSlotFill( 'ToolsMoreMenuGroup' );\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) =>\n\t\t\tfills.length > 0 && (\n\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>\n\t\t\t)\n\t\t}\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAM;EAAEE,IAAI,EAAEC,kBAAkB;EAAEC;AAAK,CAAC,GACvC,IAAAC,0BAAc,EAAE,oBAAqB,CAAC;AAEvCF,kBAAkB,CAACC,IAAI,GAAG,CAAE;EAAEE;AAAU,CAAC,KACxC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,IAAI;EAACE,SAAS,EAAGA;AAAW,GACxBG,KAAK,IACRA,KAAK,CAACC,MAAM,GAAG,CAAC,IACf,IAAAH,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAY,SAAS;EAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,OAAQ;AAAG,GAAGJ,KAAkB,CAGpD,CACN;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEab,kBAAkB","ignoreList":[]}
@@ -1,71 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _data = require("@wordpress/data");
9
- var _components = require("@wordpress/components");
10
- var _i18n = require("@wordpress/i18n");
11
- var _compose = require("@wordpress/compose");
12
- var _keycodes = require("@wordpress/keycodes");
13
- var _preferences = require("@wordpress/preferences");
14
- var _editor = require("@wordpress/editor");
15
- /**
16
- * WordPress dependencies
17
- */
18
-
19
- function WritingMenu() {
20
- const {
21
- set: setPreference
22
- } = (0, _data.useDispatch)(_preferences.store);
23
- const {
24
- toggleDistractionFree
25
- } = (0, _data.useDispatch)(_editor.store);
26
- const turnOffDistractionFree = () => {
27
- setPreference('core', 'distractionFree', false);
28
- };
29
- const isLargeViewport = (0, _compose.useViewportMatch)('medium');
30
- if (!isLargeViewport) {
31
- return null;
32
- }
33
- return (0, _react.createElement)(_components.MenuGroup, {
34
- label: (0, _i18n._x)('View', 'noun')
35
- }, (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
36
- scope: "core",
37
- name: "fixedToolbar",
38
- onToggle: turnOffDistractionFree,
39
- label: (0, _i18n.__)('Top toolbar'),
40
- info: (0, _i18n.__)('Access all block and document tools in a single place'),
41
- messageActivated: (0, _i18n.__)('Top toolbar activated'),
42
- messageDeactivated: (0, _i18n.__)('Top toolbar deactivated')
43
- }), (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
44
- scope: "core",
45
- name: "distractionFree",
46
- handleToggling: false,
47
- onToggle: toggleDistractionFree,
48
- label: (0, _i18n.__)('Distraction free'),
49
- info: (0, _i18n.__)('Write with calmness'),
50
- messageActivated: (0, _i18n.__)('Distraction free mode activated'),
51
- messageDeactivated: (0, _i18n.__)('Distraction free mode deactivated'),
52
- shortcut: _keycodes.displayShortcut.primaryShift('\\')
53
- }), (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
54
- scope: "core",
55
- name: "focusMode",
56
- label: (0, _i18n.__)('Spotlight mode'),
57
- info: (0, _i18n.__)('Focus on one block at a time'),
58
- messageActivated: (0, _i18n.__)('Spotlight mode activated'),
59
- messageDeactivated: (0, _i18n.__)('Spotlight mode deactivated')
60
- }), (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
61
- scope: "core/edit-post",
62
- name: "fullscreenMode",
63
- label: (0, _i18n.__)('Fullscreen mode'),
64
- info: (0, _i18n.__)('Show and hide the admin user interface'),
65
- messageActivated: (0, _i18n.__)('Fullscreen mode activated'),
66
- messageDeactivated: (0, _i18n.__)('Fullscreen mode deactivated'),
67
- shortcut: _keycodes.displayShortcut.secondary('f')
68
- }));
69
- }
70
- var _default = exports.default = WritingMenu;
71
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_data","require","_components","_i18n","_compose","_keycodes","_preferences","_editor","WritingMenu","set","setPreference","useDispatch","preferencesStore","toggleDistractionFree","editorStore","turnOffDistractionFree","isLargeViewport","useViewportMatch","_react","createElement","MenuGroup","label","_x","PreferenceToggleMenuItem","scope","name","onToggle","__","info","messageActivated","messageDeactivated","handleToggling","shortcut","displayShortcut","primaryShift","secondary","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/writing-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { MenuGroup } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\nfunction WritingMenu() {\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tif ( ! isLargeViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\tinfo={ __(\n\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t) }\n\t\t\t\tmessageActivated={ __( 'Top toolbar activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Top toolbar deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"distractionFree\"\n\t\t\t\thandleToggling={ false }\n\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\tmessageActivated={ __( 'Distraction free mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Distraction free mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.primaryShift( '\\\\' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"focusMode\"\n\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\tmessageActivated={ __( 'Spotlight mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Spotlight mode deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Fullscreen mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default WritingMenu;\n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0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ActionsPanelFill = void 0;
7
- exports.default = ActionsPanel;
8
- var _react = require("react");
9
- var _editor = require("@wordpress/editor");
10
- var _data = require("@wordpress/data");
11
- var _components = require("@wordpress/components");
12
- var _i18n = require("@wordpress/i18n");
13
- var _element = require("@wordpress/element");
14
- var _store = require("../../store");
15
- /**
16
- * WordPress dependencies
17
- */
18
-
19
- /**
20
- * Internal dependencies
21
- */
22
-
23
- const {
24
- Fill,
25
- Slot
26
- } = (0, _components.createSlotFill)('ActionsPanel');
27
- const ActionsPanelFill = exports.ActionsPanelFill = Fill;
28
- function ActionsPanel({
29
- setEntitiesSavedStatesCallback,
30
- closeEntitiesSavedStates,
31
- isEntitiesSavedStatesOpen
32
- }) {
33
- const {
34
- closePublishSidebar,
35
- togglePublishSidebar
36
- } = (0, _data.useDispatch)(_editor.store);
37
- const {
38
- publishSidebarOpened,
39
- hasActiveMetaboxes,
40
- hasNonPostEntityChanges
41
- } = (0, _data.useSelect)(select => ({
42
- publishSidebarOpened: select(_editor.store).isPublishSidebarOpened(),
43
- hasActiveMetaboxes: select(_store.store).hasMetaBoxes(),
44
- hasNonPostEntityChanges: select(_editor.store).hasNonPostEntityChanges()
45
- }), []);
46
- const openEntitiesSavedStates = (0, _element.useCallback)(() => setEntitiesSavedStatesCallback(true), []);
47
-
48
- // It is ok for these components to be unmounted when not in visual use.
49
- // We don't want more than one present at a time, decide which to render.
50
- let unmountableContent;
51
- if (publishSidebarOpened) {
52
- unmountableContent = (0, _react.createElement)(_editor.PostPublishPanel, {
53
- onClose: closePublishSidebar,
54
- forceIsDirty: hasActiveMetaboxes,
55
- PrePublishExtension: _editor.PluginPrePublishPanel.Slot,
56
- PostPublishExtension: _editor.PluginPostPublishPanel.Slot
57
- });
58
- } else if (hasNonPostEntityChanges) {
59
- unmountableContent = (0, _react.createElement)("div", {
60
- className: "edit-post-layout__toggle-entities-saved-states-panel"
61
- }, (0, _react.createElement)(_components.Button, {
62
- variant: "secondary",
63
- className: "edit-post-layout__toggle-entities-saved-states-panel-button",
64
- onClick: openEntitiesSavedStates,
65
- "aria-expanded": false
66
- }, (0, _i18n.__)('Open save panel')));
67
- } else {
68
- unmountableContent = (0, _react.createElement)("div", {
69
- className: "edit-post-layout__toggle-publish-panel"
70
- }, (0, _react.createElement)(_components.Button, {
71
- variant: "secondary",
72
- className: "edit-post-layout__toggle-publish-panel-button",
73
- onClick: togglePublishSidebar,
74
- "aria-expanded": false
75
- }, (0, _i18n.__)('Open publish panel')));
76
- }
77
-
78
- // Since EntitiesSavedStates controls its own panel, we can keep it
79
- // always mounted to retain its own component state (such as checkboxes).
80
- return (0, _react.createElement)(_react.Fragment, null, isEntitiesSavedStatesOpen && (0, _react.createElement)(_editor.EntitiesSavedStates, {
81
- close: closeEntitiesSavedStates
82
- }), (0, _react.createElement)(Slot, {
83
- bubblesVirtually: true
84
- }), !isEntitiesSavedStatesOpen && unmountableContent);
85
- }
86
- //# sourceMappingURL=actions-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_editor","require","_data","_components","_i18n","_element","_store","Fill","Slot","createSlotFill","ActionsPanelFill","exports","ActionsPanel","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","closePublishSidebar","togglePublishSidebar","useDispatch","editorStore","publishSidebarOpened","hasActiveMetaboxes","hasNonPostEntityChanges","useSelect","select","isPublishSidebarOpened","editPostStore","hasMetaBoxes","openEntitiesSavedStates","useCallback","unmountableContent","_react","createElement","PostPublishPanel","onClose","forceIsDirty","PrePublishExtension","PluginPrePublishPanel","PostPublishExtension","PluginPostPublishPanel","className","Button","variant","onClick","__","Fragment","EntitiesSavedStates","close","bubblesVirtually"],"sources":["@wordpress/edit-post/src/components/layout/actions-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tEntitiesSavedStates,\n\tPostPublishPanel,\n\tPluginPrePublishPanel,\n\tPluginPostPublishPanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function ActionsPanel( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\thasActiveMetaboxes,\n\t\thasNonPostEntityChanges,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\tpublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( hasNonPostEntityChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-entities-saved-states-panel-button\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-publish-panel-button\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAlBA;AACA;AACA;;AAaA;AACA;AACA;;AAGA,MAAM;EAAEM,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EAAE,cAAe,CAAC;AAEhD,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGH,IAAI;AAErB,SAASK,YAAYA,CAAE;EACrCC,8BAA8B;EAC9BC,wBAAwB;EACx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IAAAC,MAAA,CAAAC,aAAA;MAAKQ,SAAS,EAAC;IAAwC,GACtD,IAAAT,MAAA,CAAAC,aAAA,EAAC7B,WAAA,CAAAsC,MAAM;MACNC,OAAO,EAAC,WAAW;MACnBF,SAAS,EAAC,+CAA+C;MACzDG,OAAO,EAAG1B,oBAAsB;MAChC,iBAAgB;IAAO,GAErB,IAAA2B,QAAE,EAAE,oBAAqB,CACpB,CACJ,CACL;EACF;;EAEA;EACA;EACA,OACC,IAAAb,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAc,QAAA,QACG9B,yBAAyB,IAC1B,IAAAgB,MAAA,CAAAC,aAAA,EAAChC,OAAA,CAAA8C,mBAAmB;IAACC,KAAK,EAAGjC;EAA0B,CAAE,CACzD,EACD,IAAAiB,MAAA,CAAAC,aAAA,EAACxB,IAAI;IAACwC,gBAAgB;EAAA,CAAE,CAAC,EACvB,CAAEjC,yBAAyB,IAAIe,kBAChC,CAAC;AAEL","ignoreList":[]}
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _compose = require("@wordpress/compose");
8
- var _data = require("@wordpress/data");
9
- var _viewport = require("@wordpress/viewport");
10
- var _editor = require("@wordpress/editor");
11
- var _preferences = require("@wordpress/preferences");
12
- var _lockUnlock = require("../../lock-unlock");
13
- /**
14
- * WordPress dependencies
15
- */
16
-
17
- /**
18
- * Internal dependencies
19
- */
20
-
21
- const {
22
- PreferenceBaseOption
23
- } = (0, _lockUnlock.unlock)(_preferences.privateApis);
24
- var _default = exports.default = (0, _compose.compose)((0, _data.withSelect)(select => ({
25
- isChecked: select(_editor.store).isPublishSidebarEnabled()
26
- })), (0, _data.withDispatch)(dispatch => {
27
- const {
28
- enablePublishSidebar,
29
- disablePublishSidebar
30
- } = dispatch(_editor.store);
31
- return {
32
- onChange: isEnabled => isEnabled ? enablePublishSidebar() : disablePublishSidebar()
33
- };
34
- }),
35
- // In < medium viewports we override this option and always show the publish sidebar.
36
- // See the edit-post's header component for the specific logic.
37
- (0, _viewport.ifViewportMatches)('medium'))(PreferenceBaseOption);
38
- //# sourceMappingURL=enable-publish-sidebar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_compose","require","_data","_viewport","_editor","_preferences","_lockUnlock","PreferenceBaseOption","unlock","preferencesPrivateApis","_default","exports","default","compose","withSelect","select","isChecked","editorStore","isPublishSidebarEnabled","withDispatch","dispatch","enablePublishSidebar","disablePublishSidebar","onChange","isEnabled","ifViewportMatches"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-publish-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ifViewportMatches } from '@wordpress/viewport';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\tisChecked: select( editorStore ).isPublishSidebarEnabled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { enablePublishSidebar, disablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonChange: ( isEnabled ) =>\n\t\t\t\tisEnabled ? enablePublishSidebar() : disablePublishSidebar(),\n\t\t};\n\t} ),\n\t// In < medium viewports we override this option and always show the publish sidebar.\n\t// See the edit-post's header component for the specific logic.\n\tifViewportMatches( 'medium' )\n)( PreferenceBaseOption );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEM;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEnD,IAAAC,gBAAO,EACrB,IAAAC,gBAAU,EAAIC,MAAM,KAAQ;EAC3BC,SAAS,EAAED,MAAM,CAAEE,aAAY,CAAC,CAACC,uBAAuB,CAAC;AAC1D,CAAC,CAAG,CAAC,EACL,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC,oBAAoB;IAAEC;EAAsB,CAAC,GACpDF,QAAQ,CAAEH,aAAY,CAAC;EACxB,OAAO;IACNM,QAAQ,EAAIC,SAAS,IACpBA,SAAS,GAAGH,oBAAoB,CAAC,CAAC,GAAGC,qBAAqB,CAAC;EAC7D,CAAC;AACF,CAAE,CAAC;AACH;AACA;AACA,IAAAG,2BAAiB,EAAE,QAAS,CAC7B,CAAC,CAAElB,oBAAqB,CAAC","ignoreList":[]}
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = EditPostPluginPostPublishPanel;
8
- var _react = require("react");
9
- var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
10
- var _editor = require("@wordpress/editor");
11
- /**
12
- * WordPress dependencies
13
- */
14
-
15
- /**
16
- * Renders provided content to the post-publish panel in the publish flow
17
- * (side panel that opens after a user publishes the post).
18
- *
19
- * @deprecated since 6.6, use `wp.editor.PluginPostPublishPanel` instead.
20
- *
21
- * @param {Object} props Component properties.
22
- * @param {string} [props.className] An optional class name added to the panel.
23
- * @param {string} [props.title] Title displayed at the top of the panel.
24
- * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.
25
- * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
26
- * @param {Element} props.children Children to be rendered
27
- * @return {Component} The component to be rendered.
28
- */
29
- function EditPostPluginPostPublishPanel(props) {
30
- (0, _deprecated.default)('wp.editPost.PluginPostPublishPanel', {
31
- since: '6.6',
32
- version: '6.8',
33
- alternative: 'wp.editor.PluginPostPublishPanel'
34
- });
35
- return (0, _react.createElement)(_editor.PluginPostPublishPanel, {
36
- ...props
37
- });
38
- }
39
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_deprecated","_interopRequireDefault","require","_editor","EditPostPluginPostPublishPanel","props","deprecated","since","version","alternative","_react","createElement","PluginPostPublishPanel"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { PluginPostPublishPanel } from '@wordpress/editor';\n\n/**\n * Renders provided content to the post-publish panel in the publish flow\n * (side panel that opens after a user publishes the post).\n *\n * @deprecated since 6.6, use `wp.editor.PluginPostPublishPanel` instead.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the panel.\n * @param {string} [props.title] Title displayed at the top of the panel.\n * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n * @return {Component} The component to be rendered.\n */\nexport default function EditPostPluginPostPublishPanel( props ) {\n\tdeprecated( 'wp.editPost.PluginPostPublishPanel', {\n\t\tsince: '6.6',\n\t\tversion: '6.8',\n\t\talternative: 'wp.editor.PluginPostPublishPanel',\n\t} );\n\treturn <PluginPostPublishPanel { ...props } />;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,8BAA8BA,CAAEC,KAAK,EAAG;EAC/D,IAAAC,mBAAU,EAAE,oCAAoC,EAAE;IACjDC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,KAAK;IACdC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAS,sBAAsB;IAAA,GAAMP;EAAK,CAAI,CAAC;AAC/C","ignoreList":[]}