@wordpress/edit-post 7.25.0 → 7.26.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 (199) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE.md +1 -1
  3. package/build/components/browser-url/index.js +3 -2
  4. package/build/components/browser-url/index.js.map +1 -1
  5. package/build/components/header/index.js +25 -25
  6. package/build/components/header/index.js.map +1 -1
  7. package/build/components/header/writing-menu/index.js +11 -8
  8. package/build/components/header/writing-menu/index.js.map +1 -1
  9. package/build/components/keyboard-shortcuts/index.js +1 -20
  10. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  11. package/build/components/layout/index.js +33 -26
  12. package/build/components/layout/index.js.map +1 -1
  13. package/build/components/layout/index.native.js +3 -1
  14. package/build/components/layout/index.native.js.map +1 -1
  15. package/build/components/meta-boxes/meta-box-visibility.js +2 -6
  16. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  17. package/build/components/preferences-modal/index.js +25 -8
  18. package/build/components/preferences-modal/index.js.map +1 -1
  19. package/build/components/preferences-modal/options/enable-feature.js +23 -23
  20. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  21. package/build/components/preferences-modal/options/enable-panel.js +3 -6
  22. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  23. package/build/components/sidebar/plugin-document-setting-panel/index.js +3 -3
  24. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  25. package/build/components/sidebar/plugin-sidebar/index.js +2 -10
  26. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  27. package/build/components/sidebar/post-status/index.js +2 -3
  28. package/build/components/sidebar/post-status/index.js.map +1 -1
  29. package/build/components/sidebar/settings-sidebar/index.js +1 -7
  30. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  31. package/build/editor.js +19 -28
  32. package/build/editor.js.map +1 -1
  33. package/build/editor.native.js +3 -10
  34. package/build/editor.native.js.map +1 -1
  35. package/build/hooks/commands/use-common-commands.js +16 -12
  36. package/build/hooks/commands/use-common-commands.js.map +1 -1
  37. package/build/hooks/use-post-history.js +79 -0
  38. package/build/hooks/use-post-history.js.map +1 -0
  39. package/build/index.js +19 -16
  40. package/build/index.js.map +1 -1
  41. package/build/index.native.js +7 -1
  42. package/build/index.native.js.map +1 -1
  43. package/build/store/actions.js +59 -73
  44. package/build/store/actions.js.map +1 -1
  45. package/build/store/reducer.js +1 -62
  46. package/build/store/reducer.js.map +1 -1
  47. package/build/store/selectors.js +66 -38
  48. package/build/store/selectors.js.map +1 -1
  49. package/build-module/components/browser-url/index.js +3 -2
  50. package/build-module/components/browser-url/index.js.map +1 -1
  51. package/build-module/components/header/index.js +25 -25
  52. package/build-module/components/header/index.js.map +1 -1
  53. package/build-module/components/header/writing-menu/index.js +11 -8
  54. package/build-module/components/header/writing-menu/index.js.map +1 -1
  55. package/build-module/components/keyboard-shortcuts/index.js +1 -20
  56. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  57. package/build-module/components/layout/index.js +33 -25
  58. package/build-module/components/layout/index.js.map +1 -1
  59. package/build-module/components/layout/index.native.js +4 -2
  60. package/build-module/components/layout/index.native.js.map +1 -1
  61. package/build-module/components/meta-boxes/meta-box-visibility.js +2 -6
  62. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  63. package/build-module/components/preferences-modal/index.js +25 -8
  64. package/build-module/components/preferences-modal/index.js.map +1 -1
  65. package/build-module/components/preferences-modal/options/enable-feature.js +22 -23
  66. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  67. package/build-module/components/preferences-modal/options/enable-panel.js +3 -7
  68. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  69. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +3 -3
  70. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  71. package/build-module/components/sidebar/plugin-sidebar/index.js +2 -10
  72. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  73. package/build-module/components/sidebar/post-status/index.js +3 -4
  74. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  75. package/build-module/components/sidebar/settings-sidebar/index.js +2 -8
  76. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  77. package/build-module/editor.js +19 -28
  78. package/build-module/editor.js.map +1 -1
  79. package/build-module/editor.native.js +3 -10
  80. package/build-module/editor.native.js.map +1 -1
  81. package/build-module/hooks/commands/use-common-commands.js +16 -12
  82. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  83. package/build-module/hooks/use-post-history.js +73 -0
  84. package/build-module/hooks/use-post-history.js.map +1 -0
  85. package/build-module/index.js +17 -11
  86. package/build-module/index.js.map +1 -1
  87. package/build-module/index.native.js +7 -1
  88. package/build-module/index.native.js.map +1 -1
  89. package/build-module/store/actions.js +55 -69
  90. package/build-module/store/actions.js.map +1 -1
  91. package/build-module/store/reducer.js +1 -60
  92. package/build-module/store/reducer.js.map +1 -1
  93. package/build-module/store/selectors.js +58 -29
  94. package/build-module/store/selectors.js.map +1 -1
  95. package/build-style/style-rtl.css +13 -284
  96. package/build-style/style.css +13 -284
  97. package/package.json +32 -32
  98. package/src/components/browser-url/index.js +4 -2
  99. package/src/components/header/index.js +24 -40
  100. package/src/components/header/style.scss +3 -3
  101. package/src/components/header/writing-menu/index.js +10 -8
  102. package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -15
  103. package/src/components/keyboard-shortcuts/index.js +1 -23
  104. package/src/components/layout/index.js +18 -27
  105. package/src/components/layout/index.native.js +9 -1
  106. package/src/components/meta-boxes/meta-box-visibility.js +2 -8
  107. package/src/components/preferences-modal/index.js +27 -9
  108. package/src/components/preferences-modal/options/enable-feature.js +26 -21
  109. package/src/components/preferences-modal/options/enable-panel.js +3 -7
  110. package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +187 -175
  111. package/src/components/sidebar/plugin-document-setting-panel/index.js +3 -3
  112. package/src/components/sidebar/plugin-sidebar/index.js +1 -9
  113. package/src/components/sidebar/post-status/index.js +3 -3
  114. package/src/components/sidebar/settings-sidebar/index.js +15 -13
  115. package/src/components/text-editor/style.scss +0 -6
  116. package/src/editor.js +34 -33
  117. package/src/editor.native.js +2 -17
  118. package/src/hooks/commands/use-common-commands.js +14 -16
  119. package/src/hooks/use-post-history.js +73 -0
  120. package/src/index.js +22 -12
  121. package/src/index.native.js +8 -1
  122. package/src/store/actions.js +48 -85
  123. package/src/store/reducer.js +0 -60
  124. package/src/store/selectors.js +74 -46
  125. package/src/store/test/actions.js +10 -103
  126. package/src/store/test/reducer.js +1 -108
  127. package/src/store/test/selectors.js +0 -50
  128. package/src/style.scss +1 -5
  129. package/src/test/editor.native.js +17 -0
  130. package/build/components/header/header-toolbar/index.js +0 -160
  131. package/build/components/header/header-toolbar/index.js.map +0 -1
  132. package/build/components/secondary-sidebar/inserter-sidebar.js +0 -73
  133. package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  134. package/build/components/secondary-sidebar/list-view-outline.js +0 -112
  135. package/build/components/secondary-sidebar/list-view-outline.js.map +0 -1
  136. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -148
  137. package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  138. package/build/components/sidebar/discussion-panel/index.js +0 -59
  139. package/build/components/sidebar/discussion-panel/index.js.map +0 -1
  140. package/build/components/sidebar/featured-image/index.js +0 -70
  141. package/build/components/sidebar/featured-image/index.js.map +0 -1
  142. package/build/components/sidebar/last-revision/index.js +0 -21
  143. package/build/components/sidebar/last-revision/index.js.map +0 -1
  144. package/build/components/sidebar/page-attributes/index.js +0 -65
  145. package/build/components/sidebar/page-attributes/index.js.map +0 -1
  146. package/build/components/sidebar/plugin-post-excerpt/index.js +0 -72
  147. package/build/components/sidebar/plugin-post-excerpt/index.js.map +0 -1
  148. package/build/components/sidebar/post-excerpt/index.js +0 -54
  149. package/build/components/sidebar/post-excerpt/index.js.map +0 -1
  150. package/build/components/sidebar/post-taxonomies/index.js +0 -30
  151. package/build/components/sidebar/post-taxonomies/index.js.map +0 -1
  152. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -56
  153. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +0 -1
  154. package/build/components/view-link/index.js +0 -53
  155. package/build/components/view-link/index.js.map +0 -1
  156. package/build-module/components/header/header-toolbar/index.js +0 -152
  157. package/build-module/components/header/header-toolbar/index.js.map +0 -1
  158. package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -66
  159. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  160. package/build-module/components/secondary-sidebar/list-view-outline.js +0 -105
  161. package/build-module/components/secondary-sidebar/list-view-outline.js.map +0 -1
  162. package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -140
  163. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  164. package/build-module/components/sidebar/discussion-panel/index.js +0 -52
  165. package/build-module/components/sidebar/discussion-panel/index.js.map +0 -1
  166. package/build-module/components/sidebar/featured-image/index.js +0 -63
  167. package/build-module/components/sidebar/featured-image/index.js.map +0 -1
  168. package/build-module/components/sidebar/last-revision/index.js +0 -13
  169. package/build-module/components/sidebar/last-revision/index.js.map +0 -1
  170. package/build-module/components/sidebar/page-attributes/index.js +0 -57
  171. package/build-module/components/sidebar/page-attributes/index.js.map +0 -1
  172. package/build-module/components/sidebar/plugin-post-excerpt/index.js +0 -64
  173. package/build-module/components/sidebar/plugin-post-excerpt/index.js.map +0 -1
  174. package/build-module/components/sidebar/post-excerpt/index.js +0 -47
  175. package/build-module/components/sidebar/post-excerpt/index.js.map +0 -1
  176. package/build-module/components/sidebar/post-taxonomies/index.js +0 -21
  177. package/build-module/components/sidebar/post-taxonomies/index.js.map +0 -1
  178. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -48
  179. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +0 -1
  180. package/build-module/components/view-link/index.js +0 -46
  181. package/build-module/components/view-link/index.js.map +0 -1
  182. package/src/components/header/header-toolbar/index.js +0 -186
  183. package/src/components/header/header-toolbar/style.scss +0 -116
  184. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +0 -929
  185. package/src/components/secondary-sidebar/inserter-sidebar.js +0 -71
  186. package/src/components/secondary-sidebar/list-view-outline.js +0 -98
  187. package/src/components/secondary-sidebar/list-view-sidebar.js +0 -170
  188. package/src/components/secondary-sidebar/style.scss +0 -120
  189. package/src/components/sidebar/discussion-panel/index.js +0 -62
  190. package/src/components/sidebar/featured-image/index.js +0 -67
  191. package/src/components/sidebar/last-revision/index.js +0 -17
  192. package/src/components/sidebar/last-revision/style.scss +0 -10
  193. package/src/components/sidebar/page-attributes/index.js +0 -65
  194. package/src/components/sidebar/plugin-post-excerpt/index.js +0 -61
  195. package/src/components/sidebar/plugin-post-excerpt/test/index.js +0 -36
  196. package/src/components/sidebar/post-excerpt/index.js +0 -59
  197. package/src/components/sidebar/post-taxonomies/index.js +0 -30
  198. package/src/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -48
  199. package/src/components/view-link/index.js +0 -48
@@ -4,22 +4,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.__experimentalGetInsertionPoint = __experimentalGetInsertionPoint;
8
- exports.__experimentalGetPreviewDeviceType = void 0;
7
+ exports.__experimentalGetPreviewDeviceType = exports.__experimentalGetInsertionPoint = void 0;
9
8
  exports.areMetaBoxesInitialized = areMetaBoxesInitialized;
10
9
  exports.getHiddenBlockTypes = exports.getEditorMode = exports.getEditedPostTemplate = exports.getAllMetaBoxes = exports.getActiveMetaBoxLocations = exports.getActiveGeneralSidebarName = void 0;
11
10
  exports.getMetaBoxesPerLocation = getMetaBoxesPerLocation;
12
11
  exports.getPreference = getPreference;
13
12
  exports.getPreferences = void 0;
14
13
  exports.hasMetaBoxes = hasMetaBoxes;
15
- exports.isEditorPanelOpened = exports.isEditorPanelEnabled = exports.isEditingTemplate = void 0;
16
- exports.isEditorPanelRemoved = isEditorPanelRemoved;
17
- exports.isFeatureActive = exports.isEditorSidebarOpened = void 0;
18
- exports.isInserterOpened = isInserterOpened;
19
- exports.isListViewOpened = isListViewOpened;
14
+ exports.isListViewOpened = exports.isInserterOpened = exports.isFeatureActive = exports.isEditorSidebarOpened = exports.isEditorPanelRemoved = exports.isEditorPanelOpened = exports.isEditorPanelEnabled = exports.isEditingTemplate = void 0;
20
15
  exports.isMetaBoxLocationActive = isMetaBoxLocationActive;
21
- exports.isMetaBoxLocationVisible = isMetaBoxLocationVisible;
22
- exports.isPluginSidebarOpened = exports.isPluginItemPinned = exports.isModalActive = void 0;
16
+ exports.isPluginSidebarOpened = exports.isPluginItemPinned = exports.isModalActive = exports.isMetaBoxLocationVisible = void 0;
23
17
  exports.isPublishSidebarOpened = isPublishSidebarOpened;
24
18
  exports.isSavingMetaBoxes = isSavingMetaBoxes;
25
19
  var _rememo = _interopRequireDefault(require("rememo"));
@@ -29,6 +23,7 @@ var _preferences = require("@wordpress/preferences");
29
23
  var _coreData = require("@wordpress/core-data");
30
24
  var _editor = require("@wordpress/editor");
31
25
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
26
+ var _lockUnlock = require("../lock-unlock");
32
27
  /**
33
28
  * External dependencies
34
29
  */
@@ -37,13 +32,12 @@ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
37
32
  * WordPress dependencies
38
33
  */
39
34
 
35
+ /**
36
+ * Internal dependencies
37
+ */
38
+
40
39
  const EMPTY_ARRAY = [];
41
40
  const EMPTY_OBJECT = {};
42
- const EMPTY_INSERTION_POINT = {
43
- rootClientId: undefined,
44
- insertionIndex: undefined,
45
- filterValue: undefined
46
- };
47
41
 
48
42
  /**
49
43
  * Returns the current editing mode.
@@ -181,8 +175,8 @@ const getPreferences = (0, _data.createRegistrySelector)(select => () => {
181
175
  // was migrated to the preferences store. They need to be converted from
182
176
  // the new preferences store format to old format to ensure no breaking
183
177
  // changes for plugins.
184
- const inactivePanels = select(_preferences.store).get('core/edit-post', 'inactivePanels');
185
- const openPanels = select(_preferences.store).get('core/edit-post', 'openPanels');
178
+ const inactivePanels = select(_preferences.store).get('core', 'inactivePanels');
179
+ const openPanels = select(_preferences.store).get('core', 'openPanels');
186
180
  const panels = convertPanelsToOldFormat(inactivePanels, openPanels);
187
181
  return {
188
182
  ...preferences,
@@ -237,33 +231,47 @@ function isPublishSidebarOpened(state) {
237
231
  * Returns true if the given panel was programmatically removed, or false otherwise.
238
232
  * All panels are not removed by default.
239
233
  *
234
+ * @deprecated
235
+ *
240
236
  * @param {Object} state Global application state.
241
237
  * @param {string} panelName A string that identifies the panel.
242
238
  *
243
239
  * @return {boolean} Whether or not the panel is removed.
244
240
  */
245
- function isEditorPanelRemoved(state, panelName) {
246
- return state.removedPanels.includes(panelName);
247
- }
241
+ const isEditorPanelRemoved = (0, _data.createRegistrySelector)(select => (state, panelName) => {
242
+ (0, _deprecated.default)(`select( 'core/edit-post' ).isEditorPanelRemoved`, {
243
+ since: '6.5',
244
+ alternative: `select( 'core/editor' ).isEditorPanelRemoved`
245
+ });
246
+ return select(_editor.store).isEditorPanelRemoved(panelName);
247
+ });
248
248
 
249
249
  /**
250
250
  * Returns true if the given panel is enabled, or false otherwise. Panels are
251
251
  * enabled by default.
252
252
  *
253
+ * @deprecated
254
+ *
253
255
  * @param {Object} state Global application state.
254
256
  * @param {string} panelName A string that identifies the panel.
255
257
  *
256
258
  * @return {boolean} Whether or not the panel is enabled.
257
259
  */
260
+ exports.isEditorPanelRemoved = isEditorPanelRemoved;
258
261
  const isEditorPanelEnabled = (0, _data.createRegistrySelector)(select => (state, panelName) => {
259
- const inactivePanels = select(_preferences.store).get('core/edit-post', 'inactivePanels');
260
- return !isEditorPanelRemoved(state, panelName) && !inactivePanels?.includes(panelName);
262
+ (0, _deprecated.default)(`select( 'core/edit-post' ).isEditorPanelEnabled`, {
263
+ since: '6.5',
264
+ alternative: `select( 'core/editor' ).isEditorPanelEnabled`
265
+ });
266
+ return select(_editor.store).isEditorPanelEnabled(panelName);
261
267
  });
262
268
 
263
269
  /**
264
270
  * Returns true if the given panel is open, or false otherwise. Panels are
265
271
  * closed by default.
266
272
  *
273
+ * @deprecated
274
+ *
267
275
  * @param {Object} state Global application state.
268
276
  * @param {string} panelName A string that identifies the panel.
269
277
  *
@@ -271,8 +279,11 @@ const isEditorPanelEnabled = (0, _data.createRegistrySelector)(select => (state,
271
279
  */
272
280
  exports.isEditorPanelEnabled = isEditorPanelEnabled;
273
281
  const isEditorPanelOpened = (0, _data.createRegistrySelector)(select => (state, panelName) => {
274
- const openPanels = select(_preferences.store).get('core/edit-post', 'openPanels');
275
- return !!openPanels?.includes(panelName);
282
+ (0, _deprecated.default)(`select( 'core/edit-post' ).isEditorPanelOpened`, {
283
+ since: '6.5',
284
+ alternative: `select( 'core/editor' ).isEditorPanelOpened`
285
+ });
286
+ return select(_editor.store).isEditorPanelOpened(panelName);
276
287
  });
277
288
 
278
289
  /**
@@ -342,13 +353,13 @@ const getActiveMetaBoxLocations = (0, _rememo.default)(state => {
342
353
  * @return {boolean} Whether the meta box location is active and visible.
343
354
  */
344
355
  exports.getActiveMetaBoxLocations = getActiveMetaBoxLocations;
345
- function isMetaBoxLocationVisible(state, location) {
356
+ const isMetaBoxLocationVisible = (0, _data.createRegistrySelector)(select => (state, location) => {
346
357
  return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({
347
358
  id
348
359
  }) => {
349
- return isEditorPanelEnabled(state, `meta-box-${id}`);
360
+ return select(_editor.store).isEditorPanelEnabled(state, `meta-box-${id}`);
350
361
  });
351
- }
362
+ });
352
363
 
353
364
  /**
354
365
  * Returns true if there is an active meta box in the given location, or false
@@ -359,6 +370,7 @@ function isMetaBoxLocationVisible(state, location) {
359
370
  *
360
371
  * @return {boolean} Whether the meta box location is active.
361
372
  */
373
+ exports.isMetaBoxLocationVisible = isMetaBoxLocationVisible;
362
374
  function isMetaBoxLocationActive(state, location) {
363
375
  const metaBoxes = getMetaBoxesPerLocation(state, location);
364
376
  return !!metaBoxes && metaBoxes.length !== 0;
@@ -431,28 +443,38 @@ const __experimentalGetPreviewDeviceType = (0, _data.createRegistrySelector)(sel
431
443
  /**
432
444
  * Returns true if the inserter is opened.
433
445
  *
446
+ * @deprecated
447
+ *
434
448
  * @param {Object} state Global application state.
435
449
  *
436
450
  * @return {boolean} Whether the inserter is opened.
437
451
  */
438
452
  exports.__experimentalGetPreviewDeviceType = __experimentalGetPreviewDeviceType;
439
- function isInserterOpened(state) {
440
- return !!state.blockInserterPanel;
441
- }
453
+ const isInserterOpened = (0, _data.createRegistrySelector)(select => () => {
454
+ (0, _deprecated.default)(`select( 'core/edit-post' ).isInserterOpened`, {
455
+ since: '6.5',
456
+ alternative: `select( 'core/editor' ).isInserterOpened`
457
+ });
458
+ return select(_editor.store).isInserterOpened();
459
+ });
442
460
 
443
461
  /**
444
462
  * Get the insertion point for the inserter.
445
463
  *
464
+ * @deprecated
465
+ *
446
466
  * @param {Object} state Global application state.
447
467
  *
448
468
  * @return {Object} The root client ID, index to insert at and starting filter value.
449
469
  */
450
- function __experimentalGetInsertionPoint(state) {
451
- if (typeof state.blockInserterPanel === 'boolean') {
452
- return EMPTY_INSERTION_POINT;
453
- }
454
- return state.blockInserterPanel;
455
- }
470
+ exports.isInserterOpened = isInserterOpened;
471
+ const __experimentalGetInsertionPoint = (0, _data.createRegistrySelector)(select => () => {
472
+ (0, _deprecated.default)(`select( 'core/edit-post' ).__experimentalGetInsertionPoint`, {
473
+ since: '6.5',
474
+ version: '6.7'
475
+ });
476
+ return (0, _lockUnlock.unlock)(select(_editor.store)).getInsertionPoint();
477
+ });
456
478
 
457
479
  /**
458
480
  * Returns true if the list view is opened.
@@ -461,15 +483,21 @@ function __experimentalGetInsertionPoint(state) {
461
483
  *
462
484
  * @return {boolean} Whether the list view is opened.
463
485
  */
464
- function isListViewOpened(state) {
465
- return state.listViewPanel;
466
- }
486
+ exports.__experimentalGetInsertionPoint = __experimentalGetInsertionPoint;
487
+ const isListViewOpened = (0, _data.createRegistrySelector)(select => () => {
488
+ (0, _deprecated.default)(`select( 'core/edit-post' ).isListViewOpened`, {
489
+ since: '6.5',
490
+ alternative: `select( 'core/editor' ).isListViewOpened`
491
+ });
492
+ return select(_editor.store).isListViewOpened();
493
+ });
467
494
 
468
495
  /**
469
496
  * Returns true if the template editing mode is enabled.
470
497
  *
471
498
  * @deprecated
472
499
  */
500
+ exports.isListViewOpened = isListViewOpened;
473
501
  const isEditingTemplate = (0, _data.createRegistrySelector)(select => () => {
474
502
  (0, _deprecated.default)(`select( 'core/edit-post' ).isEditingTemplate`, {
475
503
  since: '6.5',
@@ -1 +1 @@
1
- {"version":3,"names":["_rememo","_interopRequireDefault","require","_data","_interface","_preferences","_coreData","_editor","_deprecated","EMPTY_ARRAY","EMPTY_OBJECT","EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","filterValue","getEditorMode","createRegistrySelector","select","_select$get","preferencesStore","get","exports","isEditorSidebarOpened","activeGeneralSidebar","interfaceStore","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","deprecated","since","alternative","preferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","publishSidebarActive","isEditorPanelRemoved","removedPanels","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","createSelector","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","editorStore","getDeviceType","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","isListViewOpened","listViewPanel","isEditingTemplate","getRenderingMode","areMetaBoxesInitialized","initialized","getEditedPostTemplate","currentTemplate","getEditedPostAttribute","templateWithSameSlug","coreStore","getEntityRecords","per_page","find","template","slug","getEditedEntityRecord","post","getCurrentPost","link","__experimentalGetTemplateForLink"],"sources":["@wordpress/edit-post/src/store/selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\nconst EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n\tfilterValue: undefined,\n};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core/edit-post', 'editorMode' ) ??\n\t\t'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t'core/edit-post'\n\t\t);\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// These preferences now exist in the preferences store.\n\t// Fetch them so that they can be merged into the post\n\t// editor preferences.\n\tconst preferences = [\n\t\t'hiddenBlockTypes',\n\t\t'editorMode',\n\t\t'preferredStyleVariations',\n\t].reduce( ( accumulatedPrefs, preferenceKey ) => {\n\t\tconst value = select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\tpreferenceKey\n\t\t);\n\n\t\treturn {\n\t\t\t...accumulatedPrefs,\n\t\t\t[ preferenceKey ]: value,\n\t\t};\n\t}, {} );\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core/edit-post',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get(\n\t\t'core/edit-post',\n\t\t'openPanels'\n\t);\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...preferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'hiddenBlockTypes'\n\t\t) ?? EMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport function isPublishSidebarOpened( state ) {\n\treturn state.publishSidebarActive;\n}\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport function isEditorPanelRemoved( state, panelName ) {\n\treturn state.removedPanels.includes( panelName );\n}\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tconst inactivePanels = select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'inactivePanels'\n\t\t);\n\t\treturn (\n\t\t\t! isEditorPanelRemoved( state, panelName ) &&\n\t\t\t! inactivePanels?.includes( panelName )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tconst openPanels = select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'openPanels'\n\t\t);\n\t\treturn !! openPanels?.includes( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned(\n\t\t\t'core/edit-post',\n\t\t\tpluginName\n\t\t);\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport function isMetaBoxLocationVisible( state, location ) {\n\treturn (\n\t\tisMetaBoxLocationActive( state, location ) &&\n\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\treturn isEditorPanelEnabled( state, `meta-box-${ id }` );\n\t\t} )\n\t);\n}\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tif ( typeof state.blockInserterPanel === 'boolean' ) {\n\t\treturn EMPTY_INSERTION_POINT;\n\t}\n\n\treturn state.blockInserterPanel;\n}\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getRenderingMode() !== 'post-only';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst currentTemplate =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = select( coreStore )\n\t\t\t\t.getEntityRecords( 'postType', 'wp_template', { per_page: -1 } )\n\t\t\t\t?.find( ( template ) => template.slug === currentTemplate );\n\t\t\tif ( ! templateWithSameSlug ) {\n\t\t\t\treturn templateWithSameSlug;\n\t\t\t}\n\t\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\ttemplateWithSameSlug.id\n\t\t\t);\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tif ( post.link ) {\n\t\t\treturn select( coreStore ).__experimentalGetTemplateForLink(\n\t\t\t\tpost.link\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAQA,MAAMO,WAAW,GAAG,EAAE;AACtB,MAAMC,YAAY,GAAG,CAAC,CAAC;AACvB,MAAMC,qBAAqB,GAAG;EAC7BC,YAAY,EAAEC,SAAS;EACvBC,cAAc,EAAED,SAAS;EACzBE,WAAW,EAAEF;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,aAAa,GAAG,IAAAC,4BAAsB,EAChDC,MAAM,IAAM;EAAA,IAAAC,WAAA;EAAA,QAAAA,WAAA,GACbD,MAAM,CAAEE,kBAAiB,CAAC,CAACC,GAAG,CAAE,gBAAgB,EAAE,YAAa,CAAC,cAAAF,WAAA,cAAAA,WAAA,GAChE,QAAQ;AAAA,CACV,CAAC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ACA;AACA;AACA;AACO,MAAMC,qBAAqB,GAAG,IAAApF,4BAAsB,EACxDC,MAAM,IAAM,MAAM;EACnB,MAAMoF,eAAe,GACpBpF,MAAM,CAAEwE,aAAY,CAAC,CAACa,sBAAsB,CAAE,UAAW,CAAC;EAC3D,IAAKD,eAAe,EAAG;IACtB,MAAME,oBAAoB,GAAGtF,MAAM,CAAEuF,eAAU,CAAC,CAC9CC,gBAAgB,CAAE,UAAU,EAAE,aAAa,EAAE;MAAEC,QAAQ,EAAE,CAAC;IAAE,CAAE,CAAC,EAC9DC,IAAI,CAAIC,QAAQ,IAAMA,QAAQ,CAACC,IAAI,KAAKR,eAAgB,CAAC;IAC5D,IAAK,CAAEE,oBAAoB,EAAG;MAC7B,OAAOA,oBAAoB;IAC5B;IACA,OAAOtF,MAAM,CAAEuF,eAAU,CAAC,CAACM,qBAAqB,CAC/C,UAAU,EACV,aAAa,EACbP,oBAAoB,CAACxB,EACtB,CAAC;EACF;EAEA,MAAMgC,IAAI,GAAG9F,MAAM,CAAEwE,aAAY,CAAC,CAACuB,cAAc,CAAC,CAAC;EACnD,IAAKD,IAAI,CAACE,IAAI,EAAG;IAChB,OAAOhG,MAAM,CAAEuF,eAAU,CAAC,CAACU,gCAAgC,CAC1DH,IAAI,CAACE,IACN,CAAC;EACF;EAEA,OAAO,IAAI;AACZ,CACD,CAAC;AAAC5F,OAAA,CAAA+E,qBAAA,GAAAA,qBAAA"}
1
+ {"version":3,"names":["_rememo","_interopRequireDefault","require","_data","_interface","_preferences","_coreData","_editor","_deprecated","_lockUnlock","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","createRegistrySelector","select","_select$get","preferencesStore","get","exports","isEditorSidebarOpened","activeGeneralSidebar","interfaceStore","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","deprecated","since","alternative","preferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","undefined","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","publishSidebarActive","isEditorPanelRemoved","editorStore","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","createSelector","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","getDeviceType","isInserterOpened","__experimentalGetInsertionPoint","unlock","getInsertionPoint","isListViewOpened","isEditingTemplate","getRenderingMode","areMetaBoxesInitialized","initialized","getEditedPostTemplate","currentTemplate","getEditedPostAttribute","templateWithSameSlug","coreStore","getEntityRecords","per_page","find","template","slug","getEditedEntityRecord","post","getCurrentPost","link","__experimentalGetTemplateForLink"],"sources":["@wordpress/edit-post/src/store/selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core/edit-post', 'editorMode' ) ??\n\t\t'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t'core/edit-post'\n\t\t\t);\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n * - `edit-post/document`\n * - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t'core/edit-post'\n\t\t);\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n * panelName: {\n * enabled: false,\n * opened: true,\n * },\n * anotherPanelName: {\n * opened: true\n * },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// These preferences now exist in the preferences store.\n\t// Fetch them so that they can be merged into the post\n\t// editor preferences.\n\tconst preferences = [\n\t\t'hiddenBlockTypes',\n\t\t'editorMode',\n\t\t'preferredStyleVariations',\n\t].reduce( ( accumulatedPrefs, preferenceKey ) => {\n\t\tconst value = select( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\tpreferenceKey\n\t\t);\n\n\t\treturn {\n\t\t\t...accumulatedPrefs,\n\t\t\t[ preferenceKey ]: value,\n\t\t};\n\t}, {} );\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get( 'core', 'openPanels' );\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...preferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*} defaultValue Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get(\n\t\t\t'core/edit-post',\n\t\t\t'hiddenBlockTypes'\n\t\t) ?? EMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport function isPublishSidebarOpened( state ) {\n\treturn state.publishSidebarActive;\n}\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport const isEditorPanelRemoved = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelRemoved`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelRemoved`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelRemoved( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelEnabled`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelEnabled`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelEnabled( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelOpened`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelOpened( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned(\n\t\t\t'core/edit-post',\n\t\t\tpluginName\n\t\t);\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport const isMetaBoxLocationVisible = createRegistrySelector(\n\t( select ) => ( state, location ) => {\n\t\treturn (\n\t\t\tisMetaBoxLocationActive( state, location ) &&\n\t\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t\tstate,\n\t\t\t\t\t`meta-box-${ id }`\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInsertionPoint();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getRenderingMode() !== 'post-only';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {Object?} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst currentTemplate =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = select( coreStore )\n\t\t\t\t.getEntityRecords( 'postType', 'wp_template', { per_page: -1 } )\n\t\t\t\t?.find( ( template ) => template.slug === currentTemplate );\n\t\t\tif ( ! templateWithSameSlug ) {\n\t\t\t\treturn templateWithSameSlug;\n\t\t\t}\n\t\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\ttemplateWithSameSlug.id\n\t\t\t);\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tif ( post.link ) {\n\t\t\treturn select( coreStore ).__experimentalGetTemplateForLink(\n\t\t\t\tpost.link\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAGA,MAAMQ,WAAW,GAAG,EAAE;AACtB,MAAMC,YAAY,GAAG,CAAC,CAAC;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,GAAG,IAAAC,4BAAsB,EAChDC,MAAM,IAAM;EAAA,IAAAC,WAAA;EAAA,QAAAA,WAAA,GACbD,MAAM,CAAEE,kBAAiB,CAAC,CAACC,GAAG,CAAE,gBAAgB,EAAE,YAAa,CAAC,cAAAF,WAAA,cAAAA,WAAA,GAChE,QAAQ;AAAA,CACV,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANAG,OAAA,CAAAN,aAAA,GAAAA,aAAA;AAOO,MAAMO,qBAAqB,GAAG,IAAAN,4BAAsB,EACxDC,MAAM,IAAM,MAAM;EACnB,MAAMM,oBAAoB,GACzBN,MAAM,CAAEO,gBAAe,CAAC,CAACC,0BAA0B,CAClD,gBACD,CAAC;EACF,OAAO,CAAE,oBAAoB,EAAE,iBAAiB,C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AAoB,CAACvB,EACtB,CAAC;EACF;EAEA,MAAM+B,IAAI,GAAG9F,MAAM,CAAEyC,aAAY,CAAC,CAACsD,cAAc,CAAC,CAAC;EACnD,IAAKD,IAAI,CAACE,IAAI,EAAG;IAChB,OAAOhG,MAAM,CAAEuF,eAAU,CAAC,CAACU,gCAAgC,CAC1DH,IAAI,CAACE,IACN,CAAC;EACF;EAEA,OAAO,IAAI;AACZ,CACD,CAAC;AAAC5F,OAAA,CAAA+E,qBAAA,GAAAA,qBAAA"}
@@ -47,7 +47,8 @@ export class BrowserURL extends Component {
47
47
  postId,
48
48
  postStatus,
49
49
  postType,
50
- isSavingPost
50
+ isSavingPost,
51
+ hasHistory
51
52
  } = this.props;
52
53
  const {
53
54
  historyId
@@ -59,7 +60,7 @@ export class BrowserURL extends Component {
59
60
  this.setTrashURL(postId, postType);
60
61
  return;
61
62
  }
62
- if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId) {
63
+ if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId && !hasHistory) {
63
64
  this.setBrowserURL(postId);
64
65
  }
65
66
  }
@@ -1 +1 @@
1
- {"version":3,"names":["Component","withSelect","addQueryArgs","store","editorStore","getPostEditURL","postId","post","action","getPostTrashedURL","postType","trashed","post_type","ids","BrowserURL","constructor","arguments","state","historyId","componentDidUpdate","prevProps","postStatus","isSavingPost","props","setTrashURL","setBrowserURL","window","location","href","history","replaceState","id","setState","render","select","getCurrentPost","status","type","isTemplate","includes","wp_id"],"sources":["@wordpress/edit-post/src/components/browser-url/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Returns the Post's Edit URL.\n *\n * @param {number} postId Post ID.\n *\n * @return {string} Post edit URL.\n */\nexport function getPostEditURL( postId ) {\n\treturn addQueryArgs( 'post.php', { post: postId, action: 'edit' } );\n}\n\n/**\n * Returns the Post's Trashed URL.\n *\n * @param {number} postId Post ID.\n * @param {string} postType Post Type.\n *\n * @return {string} Post trashed URL.\n */\nexport function getPostTrashedURL( postId, postType ) {\n\treturn addQueryArgs( 'edit.php', {\n\t\ttrashed: 1,\n\t\tpost_type: postType,\n\t\tids: postId,\n\t} );\n}\n\nexport class BrowserURL extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\thistoryId: null,\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { postId, postStatus, postType, isSavingPost } = this.props;\n\t\tconst { historyId } = this.state;\n\n\t\t// Posts are still dirty while saving so wait for saving to finish\n\t\t// to avoid the unsaved changes warning when trashing posts.\n\t\tif ( postStatus === 'trash' && ! isSavingPost ) {\n\t\t\tthis.setTrashURL( postId, postType );\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t( postId !== prevProps.postId || postId !== historyId ) &&\n\t\t\tpostStatus !== 'auto-draft' &&\n\t\t\tpostId\n\t\t) {\n\t\t\tthis.setBrowserURL( postId );\n\t\t}\n\t}\n\n\t/**\n\t * Navigates the browser to the post trashed URL to show a notice about the trashed post.\n\t *\n\t * @param {number} postId Post ID.\n\t * @param {string} postType Post Type.\n\t */\n\tsetTrashURL( postId, postType ) {\n\t\twindow.location.href = getPostTrashedURL( postId, postType );\n\t}\n\n\t/**\n\t * Replaces the browser URL with a post editor link for the given post ID.\n\t *\n\t * Note it is important that, since this function may be called when the\n\t * editor first loads, the result generated `getPostEditURL` matches that\n\t * produced by the server. Otherwise, the URL will change unexpectedly.\n\t *\n\t * @param {number} postId Post ID for which to generate post editor URL.\n\t */\n\tsetBrowserURL( postId ) {\n\t\twindow.history.replaceState(\n\t\t\t{ id: postId },\n\t\t\t'Post ' + postId,\n\t\t\tgetPostEditURL( postId )\n\t\t);\n\n\t\tthis.setState( () => ( {\n\t\t\thistoryId: postId,\n\t\t} ) );\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getCurrentPost, isSavingPost } = select( editorStore );\n\tconst post = getCurrentPost();\n\tlet { id, status, type } = post;\n\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes( type );\n\tif ( isTemplate ) {\n\t\tid = post.wp_id;\n\t}\n\n\treturn {\n\t\tpostId: id,\n\t\tpostStatus: status,\n\t\tpostType: type,\n\t\tisSavingPost: isSavingPost(),\n\t};\n} )( BrowserURL );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAEC,MAAM,EAAG;EACxC,OAAOJ,YAAY,CAAE,UAAU,EAAE;IAAEK,IAAI,EAAED,MAAM;IAAEE,MAAM,EAAE;EAAO,CAAE,CAAC;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAEH,MAAM,EAAEI,QAAQ,EAAG;EACrD,OAAOR,YAAY,CAAE,UAAU,EAAE;IAChCS,OAAO,EAAE,CAAC;IACVC,SAAS,EAAEF,QAAQ;IACnBG,GAAG,EAAEP;EACN,CAAE,CAAC;AACJ;AAEA,OAAO,MAAMQ,UAAU,SAASd,SAAS,CAAC;EACzCe,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,KAAK,GAAG;MACZC,SAAS,EAAE;IACZ,CAAC;EACF;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,MAAM;MAAEd,MAAM;MAAEe,UAAU;MAAEX,QAAQ;MAAEY;IAAa,CAAC,GAAG,IAAI,CAACC,KAAK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AEF,IAAK,CAAC;EACzE,IAAKC,UAAU,EAAG;IACjBP,EAAE,GAAGxB,IAAI,CAACiC,KAAK;EAChB;EAEA,OAAO;IACNlC,MAAM,EAAEyB,EAAE;IACVV,UAAU,EAAEe,MAAM;IAClB1B,QAAQ,EAAE2B,IAAI;IACdf,YAAY,EAAEA,YAAY,CAAC;EAC5B,CAAC;AACF,CAAE,CAAC,CAAER,UAAW,CAAC"}
1
+ {"version":3,"names":["Component","withSelect","addQueryArgs","store","editorStore","getPostEditURL","postId","post","action","getPostTrashedURL","postType","trashed","post_type","ids","BrowserURL","constructor","arguments","state","historyId","componentDidUpdate","prevProps","postStatus","isSavingPost","hasHistory","props","setTrashURL","setBrowserURL","window","location","href","history","replaceState","id","setState","render","select","getCurrentPost","status","type","isTemplate","includes","wp_id"],"sources":["@wordpress/edit-post/src/components/browser-url/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Returns the Post's Edit URL.\n *\n * @param {number} postId Post ID.\n *\n * @return {string} Post edit URL.\n */\nexport function getPostEditURL( postId ) {\n\treturn addQueryArgs( 'post.php', { post: postId, action: 'edit' } );\n}\n\n/**\n * Returns the Post's Trashed URL.\n *\n * @param {number} postId Post ID.\n * @param {string} postType Post Type.\n *\n * @return {string} Post trashed URL.\n */\nexport function getPostTrashedURL( postId, postType ) {\n\treturn addQueryArgs( 'edit.php', {\n\t\ttrashed: 1,\n\t\tpost_type: postType,\n\t\tids: postId,\n\t} );\n}\n\nexport class BrowserURL extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\thistoryId: null,\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { postId, postStatus, postType, isSavingPost, hasHistory } =\n\t\t\tthis.props;\n\t\tconst { historyId } = this.state;\n\n\t\t// Posts are still dirty while saving so wait for saving to finish\n\t\t// to avoid the unsaved changes warning when trashing posts.\n\t\tif ( postStatus === 'trash' && ! isSavingPost ) {\n\t\t\tthis.setTrashURL( postId, postType );\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t( postId !== prevProps.postId || postId !== historyId ) &&\n\t\t\tpostStatus !== 'auto-draft' &&\n\t\t\tpostId &&\n\t\t\t! hasHistory\n\t\t) {\n\t\t\tthis.setBrowserURL( postId );\n\t\t}\n\t}\n\n\t/**\n\t * Navigates the browser to the post trashed URL to show a notice about the trashed post.\n\t *\n\t * @param {number} postId Post ID.\n\t * @param {string} postType Post Type.\n\t */\n\tsetTrashURL( postId, postType ) {\n\t\twindow.location.href = getPostTrashedURL( postId, postType );\n\t}\n\n\t/**\n\t * Replaces the browser URL with a post editor link for the given post ID.\n\t *\n\t * Note it is important that, since this function may be called when the\n\t * editor first loads, the result generated `getPostEditURL` matches that\n\t * produced by the server. Otherwise, the URL will change unexpectedly.\n\t *\n\t * @param {number} postId Post ID for which to generate post editor URL.\n\t */\n\tsetBrowserURL( postId ) {\n\t\twindow.history.replaceState(\n\t\t\t{ id: postId },\n\t\t\t'Post ' + postId,\n\t\t\tgetPostEditURL( postId )\n\t\t);\n\n\t\tthis.setState( () => ( {\n\t\t\thistoryId: postId,\n\t\t} ) );\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getCurrentPost, isSavingPost } = select( editorStore );\n\tconst post = getCurrentPost();\n\tlet { id, status, type } = post;\n\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes( type );\n\tif ( isTemplate ) {\n\t\tid = post.wp_id;\n\t}\n\n\treturn {\n\t\tpostId: id,\n\t\tpostStatus: status,\n\t\tpostType: type,\n\t\tisSavingPost: isSavingPost(),\n\t};\n} )( BrowserURL );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,UAAU,Q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A;AACD;AACA;AACA;AACA;AACA;EACCmB,WAAWA,CAAEnB,MAAM,EAAEI,QAAQ,EAAG;IAC/BiB,MAAM,CAACC,QAAQ,CAACC,IAAI,GAAGpB,iBAAiB,CAAEH,MAAM,EAAEI,QAAS,CAAC;EAC7D;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACCgB,aAAaA,CAAEpB,MAAM,EAAG;IACvBqB,MAAM,CAACG,OAAO,CAACC,YAAY,CAC1B;MAAEC,EAAE,EAAE1B;IAAO,CAAC,EACd,OAAO,GAAGA,MAAM,EAChBD,cAAc,CAAEC,MAAO,CACxB,CAAC;IAED,IAAI,CAAC2B,QAAQ,CAAE,OAAQ;MACtBf,SAAS,EAAEZ;IACZ,CAAC,CAAG,CAAC;EACN;EAEA4B,MAAMA,CAAA,EAAG;IACR,OAAO,IAAI;EACZ;AACD;AAEA,eAAejC,UAAU,CAAIkC,MAAM,IAAM;EACxC,MAAM;IAAEC,cAAc;IAAEd;EAAa,CAAC,GAAGa,MAAM,CAAE/B,WAAY,CAAC;EAC9D,MAAMG,IAAI,GAAG6B,cAAc,CAAC,CAAC;EAC7B,IAAI;IAAEJ,EAAE;IAAEK,MAAM;IAAEC;EAAK,CAAC,GAAG/B,IAAI;EAC/B,MAAMgC,UAAU,GAAG,CAAE,aAAa,EAAE,kBAAkB,CAAE,CAACC,QAAQ,CAAEF,IAAK,CAAC;EACzE,IAAKC,UAAU,EAAG;IACjBP,EAAE,GAAGzB,IAAI,CAACkC,KAAK;EAChB;EAEA,OAAO;IACNnC,MAAM,EAAE0B,EAAE;IACVX,UAAU,EAAEgB,MAAM;IAClB3B,QAAQ,EAAE4B,IAAI;IACdhB,YAAY,EAAEA,YAAY,CAAC;EAC5B,CAAC;AACF,CAAE,CAAC,CAAER,UAAW,CAAC"}
@@ -22,14 +22,14 @@ import { store as preferencesStore } from '@wordpress/preferences';
22
22
  * Internal dependencies
23
23
  */
24
24
  import FullscreenModeClose from './fullscreen-mode-close';
25
- import HeaderToolbar from './header-toolbar';
26
25
  import MoreMenu from './more-menu';
27
26
  import PostPublishButtonOrToggle from './post-publish-button-or-toggle';
28
- import ViewLink from '../view-link';
29
27
  import MainDashboardButton from './main-dashboard-button';
30
28
  import { store as editPostStore } from '../../store';
31
29
  import { unlock } from '../../lock-unlock';
32
30
  const {
31
+ DocumentTools,
32
+ PostViewLink,
33
33
  PreviewDropdown
34
34
  } = unlock(editorPrivateApis);
35
35
  const slideY = {
@@ -63,40 +63,45 @@ const slideX = {
63
63
  }
64
64
  };
65
65
  function Header({
66
- setEntitiesSavedStatesCallback,
67
- setListViewToggleElement
66
+ setEntitiesSavedStatesCallback
68
67
  }) {
69
68
  const isWideViewport = useViewportMatch('large');
70
69
  const isLargeViewport = useViewportMatch('medium');
71
70
  const blockToolbarRef = useRef();
72
71
  const {
73
- blockSelectionStart,
72
+ isTextEditor,
73
+ hasBlockSelection,
74
74
  hasActiveMetaboxes,
75
75
  hasFixedToolbar,
76
76
  isEditingTemplate,
77
77
  isPublishSidebarOpened,
78
- showIconLabels
78
+ showIconLabels,
79
+ hasHistory
79
80
  } = useSelect(select => {
80
81
  const {
81
82
  get: getPreference
82
83
  } = select(preferencesStore);
84
+ const {
85
+ getEditorMode
86
+ } = select(editPostStore);
83
87
  return {
84
- blockSelectionStart: select(blockEditorStore).getBlockSelectionStart(),
88
+ isTextEditor: getEditorMode() === 'text',
89
+ hasBlockSelection: !!select(blockEditorStore).getBlockSelectionStart(),
85
90
  hasActiveMetaboxes: select(editPostStore).hasMetaBoxes(),
91
+ hasHistory: !!select(editorStore).getEditorSettings().goBack,
86
92
  isEditingTemplate: select(editorStore).getRenderingMode() === 'template-only',
87
93
  isPublishSidebarOpened: select(editPostStore).isPublishSidebarOpened(),
88
- hasFixedToolbar: getPreference('core/edit-post', 'fixedToolbar'),
89
- showIconLabels: select(editPostStore).isFeatureActive('showIconLabels')
94
+ hasFixedToolbar: getPreference('core', 'fixedToolbar'),
95
+ showIconLabels: getPreference('core', 'showIconLabels')
90
96
  };
91
97
  }, []);
92
98
  const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = useState(true);
93
- const hasBlockSelected = !!blockSelectionStart;
94
99
  useEffect(() => {
95
100
  // If we have a new block selection, show the block tools
96
- if (blockSelectionStart) {
101
+ if (hasBlockSelection) {
97
102
  setIsBlockToolsCollapsed(false);
98
103
  }
99
- }, [blockSelectionStart]);
104
+ }, [hasBlockSelection]);
100
105
  return createElement("div", {
101
106
  className: "edit-post-header"
102
107
  }, createElement(MainDashboardButton.Slot, null, createElement(motion.div, {
@@ -114,9 +119,8 @@ function Header({
114
119
  delay: 0.8
115
120
  },
116
121
  className: "edit-post-header__toolbar"
117
- }, createElement(HeaderToolbar, {
118
- hasFixedToolbar: hasFixedToolbar,
119
- setListViewToggleElement: setListViewToggleElement
122
+ }, createElement(DocumentTools, {
123
+ disableBlockTools: isTextEditor
120
124
  }), hasFixedToolbar && isLargeViewport && createElement(Fragment, null, createElement("div", {
121
125
  className: classnames('selected-block-tools-wrapper', {
122
126
  'is-collapsed': isEditingTemplate && isBlockToolsCollapsed
@@ -126,7 +130,7 @@ function Header({
126
130
  })), createElement(Popover.Slot, {
127
131
  ref: blockToolbarRef,
128
132
  name: "block-toolbar"
129
- }), isEditingTemplate && hasBlockSelected && createElement(Button, {
133
+ }), isEditingTemplate && hasBlockSelection && createElement(Button, {
130
134
  className: "edit-post-header__block-tools-toggle",
131
135
  icon: isBlockToolsCollapsed ? next : previous,
132
136
  onClick: () => {
@@ -135,9 +139,9 @@ function Header({
135
139
  label: isBlockToolsCollapsed ? __('Show block tools') : __('Hide block tools')
136
140
  })), createElement("div", {
137
141
  className: classnames('edit-post-header__center', {
138
- 'is-collapsed': isEditingTemplate && hasBlockSelected && !isBlockToolsCollapsed && hasFixedToolbar && isLargeViewport
142
+ 'is-collapsed': isEditingTemplate && hasBlockSelection && !isBlockToolsCollapsed && hasFixedToolbar && isLargeViewport
139
143
  })
140
- }, isEditingTemplate && createElement(DocumentBar, null))), createElement(motion.div, {
144
+ }, (isEditingTemplate || hasHistory) && createElement(DocumentBar, null))), createElement(motion.div, {
141
145
  variants: slideY,
142
146
  transition: {
143
147
  type: 'tween',
@@ -151,23 +155,19 @@ function Header({
151
155
  // We track that DOM node to return focus to the PostPublishButtonOrToggle
152
156
  // when the publish sidebar has been closed.
153
157
  createElement(PostSavedState, {
154
- forceIsDirty: hasActiveMetaboxes,
155
- showIconLabels: showIconLabels
158
+ forceIsDirty: hasActiveMetaboxes
156
159
  }), createElement(PreviewDropdown, {
157
- showIconLabels: showIconLabels,
158
160
  forceIsAutosaveable: hasActiveMetaboxes
159
161
  }), createElement(PostPreviewButton, {
160
162
  className: "edit-post-header__post-preview-button",
161
163
  forceIsAutosaveable: hasActiveMetaboxes
162
- }), createElement(ViewLink, null), createElement(PostPublishButtonOrToggle, {
164
+ }), createElement(PostViewLink, null), createElement(PostPublishButtonOrToggle, {
163
165
  forceIsDirty: hasActiveMetaboxes,
164
166
  setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
165
- }), (isWideViewport || !showIconLabels) && createElement(Fragment, null, createElement(PinnedItems.Slot, {
167
+ }), (isWideViewport || !showIconLabels) && createElement(PinnedItems.Slot, {
166
168
  scope: "core/edit-post"
167
169
  }), createElement(MoreMenu, {
168
170
  showIconLabels: showIconLabels
169
- })), showIconLabels && !isWideViewport && createElement(MoreMenu, {
170
- showIconLabels: showIconLabels
171
171
  })));
172
172
  }
173
173
  export default Header;
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","BlockToolbar","store","blockEditorStore","PostSavedState","PostPreviewButton","editorStore","DocumentBar","privateApis","editorPrivateApis","useEffect","useRef","useState","useSelect","__","next","previous","PinnedItems","useViewportMatch","Button","__unstableMotion","motion","Popover","preferencesStore","FullscreenModeClose","HeaderToolbar","MoreMenu","PostPublishButtonOrToggle","ViewLink","MainDashboardButton","editPostStore","unlock","PreviewDropdown","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","setListViewToggleElement","isWideViewport","isLargeViewport","blockToolbarRef","blockSelectionStart","hasActiveMetaboxes","hasFixedToolbar","isEditingTemplate","isPublishSidebarOpened","showIconLabels","select","get","getPreference","getBlockSelectionStart","hasMetaBoxes","getRenderingMode","isFeatureActive","isBlockToolsCollapsed","setIsBlockToolsCollapsed","hasBlockSelected","createElement","className","Slot","div","variants","showTooltip","Fragment","hideDragHandle","ref","name","icon","onClick","collapsed","label","forceIsDirty","forceIsAutosaveable","scope"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tPostSavedState,\n\tPostPreviewButton,\n\tstore as editorStore,\n\tDocumentBar,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\tPopover,\n} from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport HeaderToolbar from './header-toolbar';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport ViewLink from '../view-link';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PreviewDropdown } = unlock( editorPrivateApis );\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\tdistractionFreeInactive: { y: 0 },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( {\n\tsetEntitiesSavedStatesCallback,\n\tsetListViewToggleElement,\n} ) {\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst {\n\t\tblockSelectionStart,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tisEditingTemplate,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\n\t\treturn {\n\t\t\tblockSelectionStart:\n\t\t\t\tselect( blockEditorStore ).getBlockSelectionStart(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'template-only',\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\thasFixedToolbar: getPreference( 'core/edit-post', 'fixedToolbar' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\tconst hasBlockSelected = !! blockSelectionStart;\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( blockSelectionStart ) {\n\t\t\tsetIsBlockToolsCollapsed( false );\n\t\t}\n\t}, [ blockSelectionStart ] );\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose showTooltip />\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<HeaderToolbar\n\t\t\t\t\thasFixedToolbar={ hasFixedToolbar }\n\t\t\t\t\tsetListViewToggleElement={ setListViewToggleElement }\n\t\t\t\t/>\n\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'selected-block-tools-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\t\t\t\tisEditingTemplate &&\n\t\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isEditingTemplate && hasBlockSelected && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-post-header__block-tools-toggle\"\n\t\t\t\t\t\t\t\ticon={ isBlockToolsCollapsed ? next : previous }\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsBlockToolsCollapsed(\n\t\t\t\t\t\t\t\t\t\t( collapsed ) => ! collapsed\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed\n\t\t\t\t\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames( 'edit-post-header__center', {\n\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\tisEditingTemplate &&\n\t\t\t\t\t\t\thasBlockSelected &&\n\t\t\t\t\t\t\t! isBlockToolsCollapsed &&\n\t\t\t\t\t\t\thasFixedToolbar &&\n\t\t\t\t\t\t\tisLargeViewport,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ isEditingTemplate && <DocumentBar /> }\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<PreviewDropdown\n\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t/>\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tclassName=\"edit-post-header__post-preview-button\"\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t/>\n\t\t\t\t<ViewLink />\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ showIconLabels && ! isWideViewport && (\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,YAAY,EACZC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SACCC,cAAc,EACdC,iBAAiB,EACjBH,KAAK,IAAII,WAAW,EACpBC,WAAW,EACXC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,QAAQ,QAAQ,kBAAkB;AACjD,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,MAAM,EACNC,gBAAgB,IAAIC,MAAM,EAC1BC,OAAO,QACD,uBAAuB;AAC9B,SAASpB,KAAK,IAAIqB,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,QAAQ,MAAM,aAAa;AAClC,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CAAEb,sBAAsB;EACzB;EACA;EACA;EACA;EACA;EACAY,aAAA,CAAC7D,cAAc;IACd2E,YAAY,EAAG7B,kBAAoB;IACnCI,cAAc,EAAGA;EAAgB,CACjC,CACD,EACDW,aAAA,CAACjC,eAAe;IACfsB,cAAc,EAAGA,cAAgB;IACjC0B,mBAAmB,EAAG9B;EAAoB,CAC1C,CAAC,EACFe,aAAA,CAAC5D,iBAAiB;IACjB6D,SAAS,EAAC,uCAAuC;IACjDc,mBAAmB,EAAG9B;EAAoB,CAC1C,CAAC,EACFe,aAAA,CAACrC,QAAQ,MAAE,CAAC,EACZqC,aAAA,CAACtC,yBAAyB;IACzBoD,YAAY,EAAG7B,kBAAoB;IACnCN,8BAA8B,EAC7BA;EACA,CACD,CAAC,EACA,CAAEE,cAAc,IAAI,CAAEQ,cAAc,KACrCW,aAAA,CAAAM,QAAA,QACCN,aAAA,CAAChD,WAAW,CAACkD,IAAI;IAACc,KAAK,EAAC;EAAgB,CAAE,CAAC,EAC3ChB,aAAA,CAACvC,QAAQ;IAAC4B,cAAc,EAAGA;EAAgB,CAAE,CAC5C,CACF,EACCA,cAAc,IAAI,CAAER,cAAc,IACnCmB,aAAA,CAACvC,QAAQ;IAAC4B,cAAc,EAAGA;EAAgB,CAAE,CAEnC,CACR,CAAC;AAER;AAEA,eAAeX,MAAM"}
1
+ {"version":3,"names":["classnames","BlockToolbar","store","blockEditorStore","PostSavedState","PostPreviewButton","editorStore","DocumentBar","privateApis","editorPrivateApis","useEffect","useRef","useState","useSelect","__","next","previous","PinnedItems","useViewportMatch","Button","__unstableMotion","motion","Popover","preferencesStore","FullscreenModeClose","MoreMenu","PostPublishButtonOrToggle","MainDashboardButton","editPostStore","unlock","DocumentTools","PostViewLink","PreviewDropdown","slideY","hidden","y","distractionFreeInactive","hover","transition","type","delay","slideX","x","Header","setEntitiesSavedStatesCallback","isWideViewport","isLargeViewport","blockToolbarRef","isTextEditor","hasBlockSelection","hasActiveMetaboxes","hasFixedToolbar","isEditingTemplate","isPublishSidebarOpened","showIconLabels","hasHistory","select","get","getPreference","getEditorMode","getBlockSelectionStart","hasMetaBoxes","getEditorSettings","goBack","getRenderingMode","isBlockToolsCollapsed","setIsBlockToolsCollapsed","createElement","className","Slot","div","variants","showTooltip","disableBlockTools","Fragment","hideDragHandle","ref","name","icon","onClick","collapsed","label","forceIsDirty","forceIsAutosaveable","scope"],"sources":["@wordpress/edit-post/src/components/header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tPostSavedState,\n\tPostPreviewButton,\n\tstore as editorStore,\n\tDocumentBar,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\tPopover,\n} from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { DocumentTools, PostViewLink, PreviewDropdown } =\n\tunlock( editorPrivateApis );\n\nconst slideY = {\n\thidden: { y: '-50px' },\n\tdistractionFreeInactive: { y: 0 },\n\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst {\n\t\tisTextEditor,\n\t\thasBlockSelection,\n\t\thasActiveMetaboxes,\n\t\thasFixedToolbar,\n\t\tisEditingTemplate,\n\t\tisPublishSidebarOpened,\n\t\tshowIconLabels,\n\t\thasHistory,\n\t} = useSelect( ( select ) => {\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editPostStore );\n\n\t\treturn {\n\t\t\tisTextEditor: getEditorMode() === 'text',\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasHistory: !! select( editorStore ).getEditorSettings().goBack,\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'template-only',\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\thasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( hasBlockSelection ) {\n\t\t\tsetIsBlockToolsCollapsed( false );\n\t\t}\n\t}, [ hasBlockSelection ] );\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose showTooltip />\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<DocumentTools disableBlockTools={ isTextEditor } />\n\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'selected-block-tools-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\t\t\t\tisEditingTemplate &&\n\t\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isEditingTemplate && hasBlockSelection && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-post-header__block-tools-toggle\"\n\t\t\t\t\t\t\t\ticon={ isBlockToolsCollapsed ? next : previous }\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsBlockToolsCollapsed(\n\t\t\t\t\t\t\t\t\t\t( collapsed ) => ! collapsed\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed\n\t\t\t\t\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames( 'edit-post-header__center', {\n\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\tisEditingTemplate &&\n\t\t\t\t\t\t\thasBlockSelection &&\n\t\t\t\t\t\t\t! isBlockToolsCollapsed &&\n\t\t\t\t\t\t\thasFixedToolbar &&\n\t\t\t\t\t\t\tisLargeViewport,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ ( isEditingTemplate || hasHistory ) && <DocumentBar /> }\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState forceIsDirty={ hasActiveMetaboxes } />\n\t\t\t\t) }\n\t\t\t\t<PreviewDropdown forceIsAutosaveable={ hasActiveMetaboxes } />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tclassName=\"edit-post-header__post-preview-button\"\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t/>\n\t\t\t\t<PostViewLink />\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t) }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