@wordpress/edit-post 7.31.0 → 7.33.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 (294) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +9 -323
  3. package/build/components/browser-url/index.js.map +1 -1
  4. package/build/components/editor-initialization/index.js +0 -1
  5. package/build/components/editor-initialization/index.js.map +1 -1
  6. package/build/components/editor-initialization/listener-hooks.js +1 -38
  7. package/build/components/editor-initialization/listener-hooks.js.map +1 -1
  8. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  9. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  10. package/build/components/header/index.js +5 -5
  11. package/build/components/header/index.js.map +1 -1
  12. package/build/components/header/index.native.js +1 -1
  13. package/build/components/header/index.native.js.map +1 -1
  14. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  15. package/build/components/header/more-menu/index.js +7 -6
  16. package/build/components/header/more-menu/index.js.map +1 -1
  17. package/build/components/header/post-publish-button-or-toggle.js +11 -13
  18. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  19. package/build/components/header/preferences-menu-item/index.js +12 -4
  20. package/build/components/header/preferences-menu-item/index.js.map +1 -1
  21. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  22. package/build/components/header/writing-menu/index.js.map +1 -1
  23. package/build/components/init-pattern-modal/index.js.map +1 -1
  24. package/build/components/keyboard-shortcuts/index.js +1 -36
  25. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  26. package/build/components/layout/actions-panel.js +4 -7
  27. package/build/components/layout/actions-panel.js.map +1 -1
  28. package/build/components/layout/index.js +16 -21
  29. package/build/components/layout/index.js.map +1 -1
  30. package/build/components/layout/index.native.js.map +1 -1
  31. package/build/components/meta-boxes/index.js.map +1 -1
  32. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  33. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  34. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  35. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  36. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  37. package/build/components/preferences-modal/index.js +1 -21
  38. package/build/components/preferences-modal/index.js.map +1 -1
  39. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  40. package/build/components/sidebar/plugin-post-publish-panel/index.js +16 -64
  41. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  42. package/build/components/sidebar/plugin-pre-publish-panel/index.js +16 -63
  43. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  44. package/build/components/sidebar/post-format/index.js.map +1 -1
  45. package/build/components/sidebar/post-pending-status/index.js.map +1 -1
  46. package/build/components/sidebar/post-slug/index.js.map +1 -1
  47. package/build/components/sidebar/post-status/index.js +9 -9
  48. package/build/components/sidebar/post-status/index.js.map +1 -1
  49. package/build/components/sidebar/post-sticky/index.js.map +1 -1
  50. package/build/components/sidebar/post-trash/index.js.map +1 -1
  51. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  52. package/build/components/sidebar/settings-header/index.js.map +1 -1
  53. package/build/components/sidebar/settings-sidebar/index.js +42 -40
  54. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  55. package/build/components/text-editor/index.js.map +1 -1
  56. package/build/components/visual-editor/block-inspector-button.js +1 -1
  57. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  58. package/build/components/visual-editor/header.native.js.map +1 -1
  59. package/build/components/visual-editor/index.js +4 -1
  60. package/build/components/visual-editor/index.js.map +1 -1
  61. package/build/components/visual-editor/index.native.js.map +1 -1
  62. package/build/components/visual-editor/use-padding-appender.js +62 -0
  63. package/build/components/visual-editor/use-padding-appender.js.map +1 -0
  64. package/build/components/welcome-guide/default.js.map +1 -1
  65. package/build/components/welcome-guide/image.js.map +1 -1
  66. package/build/components/welcome-guide/index.js.map +1 -1
  67. package/build/components/welcome-guide/template.js.map +1 -1
  68. package/build/editor.js +9 -4
  69. package/build/editor.js.map +1 -1
  70. package/build/editor.native.js.map +1 -1
  71. package/build/hooks/commands/use-common-commands.js +7 -24
  72. package/build/hooks/commands/use-common-commands.js.map +1 -1
  73. package/build/hooks/components/index.js.map +1 -1
  74. package/build/hooks/index.js.map +1 -1
  75. package/build/hooks/use-navigate-to-entity-record.js +36 -19
  76. package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
  77. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  78. package/build/index.js +7 -12
  79. package/build/index.js.map +1 -1
  80. package/build/index.native.js +2 -4
  81. package/build/index.native.js.map +1 -1
  82. package/build/lock-unlock.js.map +1 -1
  83. package/build/plugins/copy-content-menu-item/index.js.map +1 -1
  84. package/build/plugins/index.js.map +1 -1
  85. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +7 -4
  86. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  87. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  88. package/build/store/actions.js +46 -31
  89. package/build/store/actions.js.map +1 -1
  90. package/build/store/constants.js.map +1 -1
  91. package/build/store/index.js +1 -1
  92. package/build/store/index.js.map +1 -1
  93. package/build/store/reducer.js +1 -15
  94. package/build/store/reducer.js.map +1 -1
  95. package/build/store/selectors.js +44 -24
  96. package/build/store/selectors.js.map +1 -1
  97. package/build/utils/meta-boxes.js.map +1 -1
  98. package/build-module/components/browser-url/index.js.map +1 -1
  99. package/build-module/components/editor-initialization/index.js +1 -2
  100. package/build-module/components/editor-initialization/index.js.map +1 -1
  101. package/build-module/components/editor-initialization/listener-hooks.js +2 -38
  102. package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
  103. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  104. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  105. package/build-module/components/header/index.js +4 -4
  106. package/build-module/components/header/index.js.map +1 -1
  107. package/build-module/components/header/index.native.js +1 -1
  108. package/build-module/components/header/index.native.js.map +1 -1
  109. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  110. package/build-module/components/header/more-menu/index.js +5 -4
  111. package/build-module/components/header/more-menu/index.js.map +1 -1
  112. package/build-module/components/header/post-publish-button-or-toggle.js +11 -13
  113. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  114. package/build-module/components/header/preferences-menu-item/index.js +11 -3
  115. package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
  116. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  117. package/build-module/components/header/writing-menu/index.js.map +1 -1
  118. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  119. package/build-module/components/keyboard-shortcuts/index.js +1 -36
  120. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  121. package/build-module/components/layout/actions-panel.js +4 -5
  122. package/build-module/components/layout/actions-panel.js.map +1 -1
  123. package/build-module/components/layout/index.js +15 -20
  124. package/build-module/components/layout/index.js.map +1 -1
  125. package/build-module/components/layout/index.native.js.map +1 -1
  126. package/build-module/components/meta-boxes/index.js.map +1 -1
  127. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  128. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  129. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  130. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  131. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  132. package/build-module/components/preferences-modal/index.js +1 -20
  133. package/build-module/components/preferences-modal/index.js.map +1 -1
  134. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  135. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +14 -62
  136. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  137. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +14 -61
  138. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  139. package/build-module/components/sidebar/post-format/index.js.map +1 -1
  140. package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
  141. package/build-module/components/sidebar/post-slug/index.js.map +1 -1
  142. package/build-module/components/sidebar/post-status/index.js +9 -10
  143. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  144. package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
  145. package/build-module/components/sidebar/post-trash/index.js.map +1 -1
  146. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  147. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  148. package/build-module/components/sidebar/settings-sidebar/index.js +43 -41
  149. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  150. package/build-module/components/text-editor/index.js.map +1 -1
  151. package/build-module/components/visual-editor/block-inspector-button.js +1 -1
  152. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  153. package/build-module/components/visual-editor/header.native.js.map +1 -1
  154. package/build-module/components/visual-editor/index.js +4 -1
  155. package/build-module/components/visual-editor/index.js.map +1 -1
  156. package/build-module/components/visual-editor/index.native.js.map +1 -1
  157. package/build-module/components/visual-editor/use-padding-appender.js +55 -0
  158. package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
  159. package/build-module/components/welcome-guide/default.js.map +1 -1
  160. package/build-module/components/welcome-guide/image.js.map +1 -1
  161. package/build-module/components/welcome-guide/index.js.map +1 -1
  162. package/build-module/components/welcome-guide/template.js.map +1 -1
  163. package/build-module/editor.js +9 -4
  164. package/build-module/editor.js.map +1 -1
  165. package/build-module/editor.native.js.map +1 -1
  166. package/build-module/hooks/commands/use-common-commands.js +9 -26
  167. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  168. package/build-module/hooks/components/index.js.map +1 -1
  169. package/build-module/hooks/index.js.map +1 -1
  170. package/build-module/hooks/use-navigate-to-entity-record.js +37 -20
  171. package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
  172. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  173. package/build-module/index.js +8 -8
  174. package/build-module/index.js.map +1 -1
  175. package/build-module/index.native.js +2 -4
  176. package/build-module/index.native.js.map +1 -1
  177. package/build-module/lock-unlock.js.map +1 -1
  178. package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
  179. package/build-module/plugins/index.js.map +1 -1
  180. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +6 -3
  181. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  182. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  183. package/build-module/store/actions.js +38 -22
  184. package/build-module/store/actions.js.map +1 -1
  185. package/build-module/store/constants.js.map +1 -1
  186. package/build-module/store/index.js.map +1 -1
  187. package/build-module/store/reducer.js +1 -13
  188. package/build-module/store/reducer.js.map +1 -1
  189. package/build-module/store/selectors.js +42 -21
  190. package/build-module/store/selectors.js.map +1 -1
  191. package/build-module/utils/meta-boxes.js.map +1 -1
  192. package/build-style/classic-rtl.css +2 -2
  193. package/build-style/classic.css +2 -2
  194. package/build-style/style-rtl.css +12 -454
  195. package/build-style/style.css +12 -454
  196. package/package.json +32 -34
  197. package/src/classic.scss +2 -1
  198. package/src/components/editor-initialization/index.js +1 -5
  199. package/src/components/editor-initialization/listener-hooks.js +1 -40
  200. package/src/components/editor-initialization/test/listener-hooks.js +1 -96
  201. package/src/components/header/index.js +3 -4
  202. package/src/components/header/index.native.js +1 -1
  203. package/src/components/header/more-menu/index.js +3 -4
  204. package/src/components/header/post-publish-button-or-toggle.js +10 -11
  205. package/src/components/header/preferences-menu-item/index.js +9 -3
  206. package/src/components/header/style.scss +5 -3
  207. package/src/components/header/test/index.js +13 -1
  208. package/src/components/keyboard-shortcuts/index.js +3 -44
  209. package/src/components/layout/actions-panel.js +5 -4
  210. package/src/components/layout/index.js +20 -42
  211. package/src/components/meta-boxes/meta-boxes-area/style.scss +1 -1
  212. package/src/components/preferences-modal/index.js +1 -24
  213. package/src/components/sidebar/plugin-post-publish-panel/index.js +12 -67
  214. package/src/components/sidebar/plugin-pre-publish-panel/index.js +12 -66
  215. package/src/components/sidebar/post-status/index.js +6 -9
  216. package/src/components/sidebar/settings-sidebar/index.js +64 -56
  217. package/src/components/visual-editor/block-inspector-button.js +1 -1
  218. package/src/components/visual-editor/index.js +4 -0
  219. package/src/components/visual-editor/use-padding-appender.js +66 -0
  220. package/src/editor.js +14 -4
  221. package/src/hooks/commands/use-common-commands.js +13 -28
  222. package/src/hooks/use-navigate-to-entity-record.js +37 -24
  223. package/src/index.js +11 -6
  224. package/src/index.native.js +1 -4
  225. package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
  226. package/src/store/actions.js +37 -24
  227. package/src/store/reducer.js +0 -13
  228. package/src/store/selectors.js +52 -36
  229. package/src/store/test/actions.js +11 -10
  230. package/src/style.scss +1 -20
  231. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -107
  232. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
  233. package/build/components/header/plugin-more-menu-item/index.js +0 -78
  234. package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
  235. package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
  236. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  237. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  238. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  239. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
  240. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  241. package/build/components/keyboard-shortcut-help-modal/index.js +0 -129
  242. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  243. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
  244. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  245. package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
  246. package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  247. package/build/components/sidebar/plugin-sidebar/index.js +0 -104
  248. package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
  249. package/build/components/sidebar/template-summary/index.js +0 -36
  250. package/build/components/sidebar/template-summary/index.js.map +0 -1
  251. package/build/components/start-page-options/index.js +0 -107
  252. package/build/components/start-page-options/index.js.map +0 -1
  253. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -100
  254. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
  255. package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
  256. package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
  257. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
  258. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  259. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  260. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  261. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  262. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  263. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -119
  264. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  265. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
  266. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  267. package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
  268. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  269. package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
  270. package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
  271. package/build-module/components/sidebar/template-summary/index.js +0 -29
  272. package/build-module/components/sidebar/template-summary/index.js.map +0 -1
  273. package/build-module/components/start-page-options/index.js +0 -100
  274. package/build-module/components/start-page-options/index.js.map +0 -1
  275. package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -108
  276. package/src/components/header/plugin-more-menu-item/index.js +0 -73
  277. package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
  278. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  279. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
  280. package/src/components/keyboard-shortcut-help-modal/index.js +0 -159
  281. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
  282. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  283. package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
  284. package/src/components/sidebar/plugin-post-publish-panel/test/__snapshots__/index.js.snap +0 -39
  285. package/src/components/sidebar/plugin-post-publish-panel/test/index.js +0 -33
  286. package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
  287. package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
  288. package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
  289. package/src/components/sidebar/plugin-pre-publish-panel/test/index.js +0 -33
  290. package/src/components/sidebar/plugin-sidebar/index.js +0 -94
  291. package/src/components/sidebar/template-summary/index.js +0 -37
  292. package/src/components/sidebar/template-summary/style.scss +0 -5
  293. package/src/components/start-page-options/index.js +0 -108
  294. package/src/components/start-page-options/style.scss +0 -26
@@ -2,17 +2,6 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { combineReducers } from '@wordpress/data';
5
- export function publishSidebarActive(state = false, action) {
6
- switch (action.type) {
7
- case 'OPEN_PUBLISH_SIDEBAR':
8
- return true;
9
- case 'CLOSE_PUBLISH_SIDEBAR':
10
- return false;
11
- case 'TOGGLE_PUBLISH_SIDEBAR':
12
- return !state;
13
- }
14
- return state;
15
- }
16
5
 
17
6
  /**
18
7
  * Reducer keeping track of the meta boxes isSaving state.
@@ -93,7 +82,6 @@ const metaBoxes = combineReducers({
93
82
  initialized: metaBoxesInitialized
94
83
  });
95
84
  export default combineReducers({
96
- metaBoxes,
97
- publishSidebarActive
85
+ metaBoxes
98
86
  });
99
87
  //# sourceMappingURL=reducer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["combineReducers","publishSidebarActive","state","action","type","isSavingMetaBoxes","mergeMetaboxes","metaboxes","newMetaboxes","mergedMetaboxes","metabox","existing","findIndex","box","id","push","metaBoxLocations","newState","location","Object","entries","metaBoxesPerLocation","metaBoxesInitialized","metaBoxes","isSaving","locations","initialized"],"sources":["@wordpress/edit-post/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function publishSidebarActive( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_PUBLISH_SIDEBAR':\n\t\t\treturn true;\n\t\tcase 'CLOSE_PUBLISH_SIDEBAR':\n\t\t\treturn false;\n\t\tcase 'TOGGLE_PUBLISH_SIDEBAR':\n\t\t\treturn ! state;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the meta boxes isSaving state.\n * A \"true\" value means the meta boxes saving request is in-flight.\n *\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function isSavingMetaBoxes( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_META_BOX_UPDATES':\n\t\t\treturn true;\n\t\tcase 'META_BOX_UPDATES_SUCCESS':\n\t\tcase 'META_BOX_UPDATES_FAILURE':\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}\n\nfunction mergeMetaboxes( metaboxes = [], newMetaboxes ) {\n\tconst mergedMetaboxes = [ ...metaboxes ];\n\tfor ( const metabox of newMetaboxes ) {\n\t\tconst existing = mergedMetaboxes.findIndex(\n\t\t\t( box ) => box.id === metabox.id\n\t\t);\n\t\tif ( existing !== -1 ) {\n\t\t\tmergedMetaboxes[ existing ] = metabox;\n\t\t} else {\n\t\t\tmergedMetaboxes.push( metabox );\n\t\t}\n\t}\n\treturn mergedMetaboxes;\n}\n\n/**\n * Reducer keeping track of the meta boxes per location.\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function metaBoxLocations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_META_BOXES_PER_LOCATIONS': {\n\t\t\tconst newState = { ...state };\n\t\t\tfor ( const [ location, metaboxes ] of Object.entries(\n\t\t\t\taction.metaBoxesPerLocation\n\t\t\t) ) {\n\t\t\t\tnewState[ location ] = mergeMetaboxes(\n\t\t\t\t\tnewState[ location ],\n\t\t\t\t\tmetaboxes\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn newState;\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer tracking whether meta boxes are initialized.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nfunction metaBoxesInitialized( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'META_BOXES_INITIALIZED':\n\t\t\treturn true;\n\t}\n\treturn state;\n}\n\nconst metaBoxes = combineReducers( {\n\tisSaving: isSavingMetaBoxes,\n\tlocations: metaBoxLocations,\n\tinitialized: metaBoxesInitialized,\n} );\n\nexport default combineReducers( {\n\tmetaBoxes,\n\tpublishSidebarActive,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;AAEjD,OAAO,SAASC,oBAAoBA,CAAEC,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EAC7D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,sBAAsB;MAC1B,OAAO,IAAI;IACZ,KAAK,uBAAuB;MAC3B,OAAO,KAAK;IACb,KAAK,wBAAwB;MAC5B,OAAO,CAAEF,KAAK;EAChB;EACA,OAAOA,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,iBAAiBA,CAAEH,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EAC1D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,0BAA0B;MAC9B,OAAO,IAAI;IACZ,KAAK,0BAA0B;IAC/B,KAAK,0BAA0B;MAC9B,OAAO,KAAK;IACb;MACC,OAAOF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;EAClCwB,QAAQ,EAAEnB,iBAAiB;EAC3BoB,SAAS,EAAET,gBAAgB;EAC3BU,WAAW,EAAEJ;AACd,CAAE,CAAC;AAEH,eAAetB,eAAe,CAAE;EAC/BuB,SAAS;EACTtB;AACD,CAAE,CAAC"}
1
+ {"version":3,"names":["combineReducers","isSavingMetaBoxes","state","action","type","mergeMetaboxes","metaboxes","newMetaboxes","mergedMetaboxes","metabox","existing","findIndex","box","id","push","metaBoxLocations","newState","location","Object","entries","metaBoxesPerLocation","metaBoxesInitialized","metaBoxes","isSaving","locations","initialized"],"sources":["@wordpress/edit-post/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer keeping track of the meta boxes isSaving state.\n * A \"true\" value means the meta boxes saving request is in-flight.\n *\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function isSavingMetaBoxes( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_META_BOX_UPDATES':\n\t\t\treturn true;\n\t\tcase 'META_BOX_UPDATES_SUCCESS':\n\t\tcase 'META_BOX_UPDATES_FAILURE':\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}\n\nfunction mergeMetaboxes( metaboxes = [], newMetaboxes ) {\n\tconst mergedMetaboxes = [ ...metaboxes ];\n\tfor ( const metabox of newMetaboxes ) {\n\t\tconst existing = mergedMetaboxes.findIndex(\n\t\t\t( box ) => box.id === metabox.id\n\t\t);\n\t\tif ( existing !== -1 ) {\n\t\t\tmergedMetaboxes[ existing ] = metabox;\n\t\t} else {\n\t\t\tmergedMetaboxes.push( metabox );\n\t\t}\n\t}\n\treturn mergedMetaboxes;\n}\n\n/**\n * Reducer keeping track of the meta boxes per location.\n *\n * @param {boolean} state Previous state.\n * @param {Object} action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function metaBoxLocations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_META_BOXES_PER_LOCATIONS': {\n\t\t\tconst newState = { ...state };\n\t\t\tfor ( const [ location, metaboxes ] of Object.entries(\n\t\t\t\taction.metaBoxesPerLocation\n\t\t\t) ) {\n\t\t\t\tnewState[ location ] = mergeMetaboxes(\n\t\t\t\t\tnewState[ location ],\n\t\t\t\t\tmetaboxes\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn newState;\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer tracking whether meta boxes are initialized.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nfunction metaBoxesInitialized( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'META_BOXES_INITIALIZED':\n\t\t\treturn true;\n\t}\n\treturn state;\n}\n\nconst metaBoxes = combineReducers( {\n\tisSaving: isSavingMetaBoxes,\n\tlocations: metaBoxLocations,\n\tinitialized: metaBoxesInitialized,\n} );\n\nexport default combineReducers( {\n\tmetaBoxes,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAEC,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EAC1D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,0BAA0B;MAC9B,OAAO,IAAI;IACZ,KAAK,0BAA0B;IAC/B,KAAK,0BAA0B;MAC9B,OAAO,KAAK;IACb;MACC,OAAOF,KAAK;EACd;AACD;AAEA,SAASG,cAAcA,CAAEC,SAAS,GAAG,EAAE,EAAEC,YAAY,EAAG;EACvD,MAAMC,eAAe,GAAG,CAAE,GAAGF,SAAS,CAAE;EACxC,KAAM,MAAMG,OAAO,IAAIF,YAAY,EAAG;IACrC,MAAMG,QAAQ,GAAGF,eAAe,CAACG,SAAS,CACvCC,GAAG,IAAMA,GAAG,CAACC,EAAE,KAAKJ,OAAO,CAACI,EAC/B,CAAC;IACD,IAAKH,QAAQ,KAAK,CAAC,CAAC,EAAG;MACtBF,eAAe,CAAEE,QAAQ,CAAE,GAAGD,OAAO;IACtC,CAAC,MAAM;MACND,eAAe,CAACM,IAAI,CAAEL,OAAQ,CAAC;IAChC;EACD;EACA,OAAOD,eAAe;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,gBAAgBA,CAAEb,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,8BAA8B;MAAE;QACpC,MAAMY,QAAQ,GAAG;UAAE,GAAGd;QAAM,CAAC;QAC7B,KAAM,MAAM,CAAEe,QAAQ,EAAEX,SAAS,CAAE,IAAIY,MAAM,CAACC,OAAO,CACpDhB,MAAM,CAACiB,oBACR,CAAC,EAAG;UACHJ,QAAQ,CAAEC,QAAQ,CAAE,GAAGZ,cAAc,CACpCW,QAAQ,CAAEC,QAAQ,CAAE,EACpBX,SACD,CAAC;QACF;QACA,OAAOU,QAAQ;MAChB;EACD;EAEA,OAAOd,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASmB,oBAAoBA,CAAEnB,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,wBAAwB;MAC5B,OAAO,IAAI;EACb;EACA,OAAOF,KAAK;AACb;AAEA,MAAMoB,SAAS,GAAGtB,eAAe,CAAE;EAClCuB,QAAQ,EAAEtB,iBAAiB;EAC3BuB,SAAS,EAAET,gBAAgB;EAC3BU,WAAW,EAAEJ;AACd,CAAE,CAAC;AAEH,eAAerB,eAAe,CAAE;EAC/BsB;AACD,CAAE,CAAC","ignoreList":[]}
@@ -1,22 +1,19 @@
1
- /**
2
- * External dependencies
3
- */
4
- import createSelector from 'rememo';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
9
- import { createRegistrySelector } from '@wordpress/data';
10
- import { store as interfaceStore } from '@wordpress/interface';
4
+ import { createSelector, createRegistrySelector } from '@wordpress/data';
11
5
  import { store as preferencesStore } from '@wordpress/preferences';
12
6
  import { store as coreStore } from '@wordpress/core-data';
13
- import { store as editorStore } from '@wordpress/editor';
7
+ import { store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
14
8
  import deprecated from '@wordpress/deprecated';
15
9
 
16
10
  /**
17
11
  * Internal dependencies
18
12
  */
19
13
  import { unlock } from '../lock-unlock';
14
+ const {
15
+ interfaceStore
16
+ } = unlock(editorPrivateApis);
20
17
  const EMPTY_ARRAY = [];
21
18
  const EMPTY_OBJECT = {};
22
19
 
@@ -40,7 +37,7 @@ export const getEditorMode = createRegistrySelector(select => () => {
40
37
  * @return {boolean} Whether the editor sidebar is opened.
41
38
  */
42
39
  export const isEditorSidebarOpened = createRegistrySelector(select => () => {
43
- const activeGeneralSidebar = select(interfaceStore).getActiveComplementaryArea('core/edit-post');
40
+ const activeGeneralSidebar = select(interfaceStore).getActiveComplementaryArea('core');
44
41
  return ['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar);
45
42
  });
46
43
 
@@ -52,7 +49,7 @@ export const isEditorSidebarOpened = createRegistrySelector(select => () => {
52
49
  * @return {boolean} Whether the plugin sidebar is opened.
53
50
  */
54
51
  export const isPluginSidebarOpened = createRegistrySelector(select => () => {
55
- const activeGeneralSidebar = select(interfaceStore).getActiveComplementaryArea('core/edit-post');
52
+ const activeGeneralSidebar = select(interfaceStore).getActiveComplementaryArea('core');
56
53
  return !!activeGeneralSidebar && !['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar);
57
54
  });
58
55
 
@@ -71,7 +68,7 @@ export const isPluginSidebarOpened = createRegistrySelector(select => () => {
71
68
  * @return {?string} Active general sidebar name.
72
69
  */
73
70
  export const getActiveGeneralSidebarName = createRegistrySelector(select => () => {
74
- return select(interfaceStore).getActiveComplementaryArea('core/edit-post');
71
+ return select(interfaceStore).getActiveComplementaryArea('core');
75
72
  });
76
73
 
77
74
  /**
@@ -190,13 +187,19 @@ export const getHiddenBlockTypes = createRegistrySelector(select => () => {
190
187
  /**
191
188
  * Returns true if the publish sidebar is opened.
192
189
  *
190
+ * @deprecated
191
+ *
193
192
  * @param {Object} state Global application state
194
193
  *
195
194
  * @return {boolean} Whether the publish sidebar is open.
196
195
  */
197
- export function isPublishSidebarOpened(state) {
198
- return state.publishSidebarActive;
199
- }
196
+ export const isPublishSidebarOpened = createRegistrySelector(select => () => {
197
+ deprecated(`select( 'core/edit-post' ).isPublishSidebarOpened`, {
198
+ since: '6.6',
199
+ alternative: `select( 'core/editor' ).isPublishSidebarOpened`
200
+ });
201
+ return select(editorStore).isPublishSidebarOpened();
202
+ });
200
203
 
201
204
  /**
202
205
  * Returns true if the given panel was programmatically removed, or false otherwise.
@@ -295,7 +298,7 @@ export const isFeatureActive = createRegistrySelector(select => (state, feature)
295
298
  * @return {boolean} Whether the plugin item is pinned.
296
299
  */
297
300
  export const isPluginItemPinned = createRegistrySelector(select => (state, pluginName) => {
298
- return select(interfaceStore).isItemPinned('core/edit-post', pluginName);
301
+ return select(interfaceStore).isItemPinned('core', pluginName);
299
302
  });
300
303
 
301
304
  /**
@@ -481,26 +484,44 @@ export function areMetaBoxesInitialized(state) {
481
484
  * @return {Object?} Post Template.
482
485
  */
483
486
  export const getEditedPostTemplate = createRegistrySelector(select => () => {
487
+ const {
488
+ id: postId,
489
+ type: postType,
490
+ slug
491
+ } = select(editorStore).getCurrentPost();
492
+ const {
493
+ getSite,
494
+ getEditedEntityRecord,
495
+ getEntityRecords
496
+ } = select(coreStore);
497
+ const siteSettings = getSite();
498
+ // First check if the current page is set as the posts page.
499
+ const isPostsPage = +postId === siteSettings?.page_for_posts;
500
+ if (isPostsPage) {
501
+ const defaultTemplateId = select(coreStore).getDefaultTemplateId({
502
+ slug: 'home'
503
+ });
504
+ return getEditedEntityRecord('postType', 'wp_template', defaultTemplateId);
505
+ }
484
506
  const currentTemplate = select(editorStore).getEditedPostAttribute('template');
485
507
  if (currentTemplate) {
486
- const templateWithSameSlug = select(coreStore).getEntityRecords('postType', 'wp_template', {
508
+ const templateWithSameSlug = getEntityRecords('postType', 'wp_template', {
487
509
  per_page: -1
488
510
  })?.find(template => template.slug === currentTemplate);
489
511
  if (!templateWithSameSlug) {
490
512
  return templateWithSameSlug;
491
513
  }
492
- return select(coreStore).getEditedEntityRecord('postType', 'wp_template', templateWithSameSlug.id);
514
+ return getEditedEntityRecord('postType', 'wp_template', templateWithSameSlug.id);
493
515
  }
494
- const post = select(editorStore).getCurrentPost();
495
516
  let slugToCheck;
496
517
  // In `draft` status we might not have a slug available, so we use the `single`
497
518
  // post type templates slug(ex page, single-post, single-product etc..).
498
519
  // Pages do not need the `single` prefix in the slug to be prioritized
499
520
  // through template hierarchy.
500
- if (post.slug) {
501
- slugToCheck = post.type === 'page' ? `${post.type}-${post.slug}` : `single-${post.type}-${post.slug}`;
521
+ if (slug) {
522
+ slugToCheck = postType === 'page' ? `${postType}-${slug}` : `single-${postType}-${slug}`;
502
523
  } else {
503
- slugToCheck = post.type === 'page' ? 'page' : `single-${post.type}`;
524
+ slugToCheck = postType === 'page' ? 'page' : `single-${postType}`;
504
525
  }
505
526
  const defaultTemplateId = select(coreStore).getDefaultTemplateId({
506
527
  slug: slugToCheck
@@ -1 +1 @@
1
- {"version":3,"names":["createSelector","createRegistrySelector","store","interfaceStore","preferencesStore","coreStore","editorStore","deprecated","unlock","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","select","_select$get","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","since","alternative","corePreferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","preferences","undefined","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","publishSidebarActive","isEditorPanelRemoved","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","getDeviceType","isInserterOpened","__experimentalGetInsertionPoint","getInsertionPoint","isListViewOpened","isEditingTemplate","getCurrentPostType","areMetaBoxesInitialized","initialized","getEditedPostTemplate","currentTemplate","getEditedPostAttribute","templateWithSameSlug","getEntityRecords","per_page","find","template","slug","getEditedEntityRecord","post","getCurrentPost","slugToCheck","type","defaultTemplateId","getDefaultTemplateId"],"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', 'editorMode' ) ?? '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\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\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...corePreferences,\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( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_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 ).getCurrentPostType() === 'wp_template';\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\tlet slugToCheck;\n\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t// through template hierarchy.\n\t\tif ( post.slug ) {\n\t\t\tslugToCheck =\n\t\t\t\tpost.type === 'page'\n\t\t\t\t\t? `${ post.type }-${ post.slug }`\n\t\t\t\t\t: `single-${ post.type }-${ post.slug }`;\n\t\t} else {\n\t\t\tslugToCheck =\n\t\t\t\tpost.type === 'page' ? 'page' : `single-${ post.type }`;\n\t\t}\n\t\tconst defaultTemplateId = select( coreStore ).getDefaultTemplateId( {\n\t\t\tslug: slugToCheck,\n\t\t} );\n\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\tdefaultTemplateId\n\t\t);\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAc,MAAM,QAAQ;;AAEnC;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,cAAc,QAAQ,sBAAsB;AAC9D,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;AAClE,SAASF,KAAK,IAAIG,SAAS,QAAQ,sBAAsB;AACzD,SAASH,KAAK,IAAII,WAAW,QAAQ,mBAAmB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAMC,YAAY,GAAG,CAAC,CAAC;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGV,sBAAsB,CAChDW,MAAM,IAAM;EAAA,IAAAC,WAAA;EAAA,QAAAA,WAAA,GACbD,MAAM,CAAER,gBAAiB,CAAC,CAACU,GAAG,CAAE,MAAM,EAAE,YAAa,CAAC,cAAAD,WAAA,cAAAA,WAAA,GAAI,QAAQ;AAAA,CACpE,CAAC;;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Aa,EACbK,iBACD,CAAC;AACF,CACD,CAAC"}
1
+ {"version":3,"names":["createSelector","createRegistrySelector","store","preferencesStore","coreStore","editorStore","privateApis","editorPrivateApis","deprecated","unlock","interfaceStore","EMPTY_ARRAY","EMPTY_OBJECT","getEditorMode","select","_select$get","get","isEditorSidebarOpened","activeGeneralSidebar","getActiveComplementaryArea","includes","isPluginSidebarOpened","getActiveGeneralSidebarName","convertPanelsToOldFormat","inactivePanels","openPanels","_ref","panelsWithEnabledState","reduce","accumulatedPanels","panelName","enabled","panels","currentPanelState","opened","getPreferences","since","alternative","corePreferences","accumulatedPrefs","preferenceKey","value","getPreference","state","defaultValue","preferences","undefined","getHiddenBlockTypes","_select$get2","isPublishSidebarOpened","isEditorPanelRemoved","isEditorPanelEnabled","isEditorPanelOpened","isModalActive","modalName","isFeatureActive","feature","isPluginItemPinned","pluginName","isItemPinned","getActiveMetaBoxLocations","Object","keys","metaBoxes","locations","filter","location","isMetaBoxLocationActive","isMetaBoxLocationVisible","getMetaBoxesPerLocation","some","id","length","getAllMetaBoxes","values","flat","hasMetaBoxes","isSavingMetaBoxes","isSaving","__experimentalGetPreviewDeviceType","version","getDeviceType","isInserterOpened","__experimentalGetInsertionPoint","getInsertionPoint","isListViewOpened","isEditingTemplate","getCurrentPostType","areMetaBoxesInitialized","initialized","getEditedPostTemplate","postId","type","postType","slug","getCurrentPost","getSite","getEditedEntityRecord","getEntityRecords","siteSettings","isPostsPage","page_for_posts","defaultTemplateId","getDefaultTemplateId","currentTemplate","getEditedPostAttribute","templateWithSameSlug","per_page","find","template","slugToCheck"],"sources":["@wordpress/edit-post/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\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', 'editorMode' ) ?? '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( 'core' );\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( 'core' );\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( 'core' );\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\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\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...corePreferences,\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( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport const isPublishSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated( `select( 'core/edit-post' ).isPublishSidebarOpened`, {\n\t\t\tsince: '6.6',\n\t\t\talternative: `select( 'core/editor' ).isPublishSidebarOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isPublishSidebarOpened();\n\t}\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( 'core', pluginName );\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 ).getCurrentPostType() === 'wp_template';\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 {\n\t\t\tid: postId,\n\t\t\ttype: postType,\n\t\t\tslug,\n\t\t} = select( editorStore ).getCurrentPost();\n\t\tconst { getSite, getEditedEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = getSite();\n\t\t// First check if the current page is set as the posts page.\n\t\tconst isPostsPage = +postId === siteSettings?.page_for_posts;\n\t\tif ( isPostsPage ) {\n\t\t\tconst defaultTemplateId = select( coreStore ).getDefaultTemplateId(\n\t\t\t\t{ slug: 'home' }\n\t\t\t);\n\t\t\treturn getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\tdefaultTemplateId\n\t\t\t);\n\t\t}\n\t\tconst currentTemplate =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\t\tif ( currentTemplate ) {\n\t\t\tconst templateWithSameSlug = getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\t{ per_page: -1 }\n\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 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\t\tlet slugToCheck;\n\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t// through template hierarchy.\n\t\tif ( slug ) {\n\t\t\tslugToCheck =\n\t\t\t\tpostType === 'page'\n\t\t\t\t\t? `${ postType }-${ slug }`\n\t\t\t\t\t: `single-${ postType }-${ slug }`;\n\t\t} else {\n\t\t\tslugToCheck = postType === 'page' ? 'page' : `single-${ postType }`;\n\t\t}\n\t\tconst defaultTemplateId = select( coreStore ).getDefaultTemplateId( {\n\t\t\tslug: slugToCheck,\n\t\t} );\n\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\tdefaultTemplateId\n\t\t);\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,sBAAsB,QAAQ,iBAAiB;AACxE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SACCF,KAAK,IAAIG,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,MAAM;EAAEC;AAAe,CAAC,GAAGD,MAAM,CAAEF,iBAAkB,CAAC;AACtD,MAAMI,WAAW,GAAG,EAAE;AACtB,MAAMC,YAAY,GAAG,CAAC,CAAC;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGZ,sBAAsB,CAChDa,MAAM,IAAM;EAAA,IAAAC,WAAA;EAAA,QAAAA,WAAA,GACbD,MAAM,CAAEX,gBAAiB,CAAC,CAACa,GAAG,CAAE,MAAM,EAAE,YAAa,CAAC,cAAAD,WAAA,cAAAA,WAAA,GAAI,QAAQ;AAAA,CACpE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,qBAAqB,GAAGhB,sBAAsB,CACxDa,MAAM,IAAM,MAAM;EACnB,MAAMI,oBAAoB,GACzBJ,MAAM,CAAEJ,cAAe,CAAC,CAACS,0BAA0B,CAAE,MAAO,CAAC;EAC9D,OAAO,CAAE,oBAAoB,EAAE,iBAAiB,CAAE,CAACC,QAAQ,CAC1DF,oBACD,CAAC;AACF,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA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GAAGxF,MAAM,CAAEV,SAAU,CAAC,CAACmG,oBAAoB,CAAE;IACnET,IAAI,EAAEgB;EACP,CAAE,CAAC;EACH,OAAOhG,MAAM,CAAEV,SAAU,CAAC,CAAC6F,qBAAqB,CAC/C,UAAU,EACV,aAAa,EACbK,iBACD,CAAC;AACF,CACD,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["getMetaBoxContainer","location","area","document","querySelector"],"sources":["@wordpress/edit-post/src/utils/meta-boxes.js"],"sourcesContent":["/**\n * Function returning the current Meta Boxes DOM Node in the editor\n * whether the meta box area is opened or not.\n * If the MetaBox Area is visible returns it, and returns the original container instead.\n *\n * @param {string} location Meta Box location.\n *\n * @return {string} HTML content.\n */\nexport const getMetaBoxContainer = ( location ) => {\n\tconst area = document.querySelector(\n\t\t`.edit-post-meta-boxes-area.is-${ location } .metabox-location-${ location }`\n\t);\n\tif ( area ) {\n\t\treturn area;\n\t}\n\n\treturn document.querySelector( '#metaboxes .metabox-location-' + location );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,mBAAmB,GAAKC,QAAQ,IAAM;EAClD,MAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CACjC,iCAAiCH,QAAU,sBAAsBA,QAAU,EAC7E,CAAC;EACD,IAAKC,IAAI,EAAG;IACX,OAAOA,IAAI;EACZ;EAEA,OAAOC,QAAQ,CAACC,aAAa,CAAE,+BAA+B,GAAGH,QAAS,CAAC;AAC5E,CAAC"}
1
+ {"version":3,"names":["getMetaBoxContainer","location","area","document","querySelector"],"sources":["@wordpress/edit-post/src/utils/meta-boxes.js"],"sourcesContent":["/**\n * Function returning the current Meta Boxes DOM Node in the editor\n * whether the meta box area is opened or not.\n * If the MetaBox Area is visible returns it, and returns the original container instead.\n *\n * @param {string} location Meta Box location.\n *\n * @return {string} HTML content.\n */\nexport const getMetaBoxContainer = ( location ) => {\n\tconst area = document.querySelector(\n\t\t`.edit-post-meta-boxes-area.is-${ location } .metabox-location-${ location }`\n\t);\n\tif ( area ) {\n\t\treturn area;\n\t}\n\n\treturn document.querySelector( '#metaboxes .metabox-location-' + location );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,mBAAmB,GAAKC,QAAQ,IAAM;EAClD,MAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CACjC,iCAAiCH,QAAU,sBAAsBA,QAAU,EAC7E,CAAC;EACD,IAAKC,IAAI,EAAG;IACX,OAAOA,IAAI;EACZ;EAEA,OAAOC,QAAQ,CAACC,aAAa,CAAE,+BAA+B,GAAGH,QAAS,CAAC;AAC5E,CAAC","ignoreList":[]}
@@ -96,7 +96,7 @@
96
96
  --wp-admin-border-width-focus: 2px;
97
97
  --wp-block-synced-color: #7a00df;
98
98
  --wp-block-synced-color--rgb: 122, 0, 223;
99
- --wp-bound-block-color: #9747ff;
99
+ --wp-bound-block-color: var(--wp-block-synced-color);
100
100
  }
101
101
  @media (min-resolution: 192dpi) {
102
102
  :root {
@@ -104,7 +104,7 @@
104
104
  }
105
105
  }
106
106
 
107
- .editor-styles-wrapper .wp-block {
107
+ .editor-styles-wrapper :where(:not(.is-layout-flex, .is-layout-grid)) > .wp-block {
108
108
  margin-right: auto;
109
109
  margin-left: auto;
110
110
  }
@@ -96,7 +96,7 @@
96
96
  --wp-admin-border-width-focus: 2px;
97
97
  --wp-block-synced-color: #7a00df;
98
98
  --wp-block-synced-color--rgb: 122, 0, 223;
99
- --wp-bound-block-color: #9747ff;
99
+ --wp-bound-block-color: var(--wp-block-synced-color);
100
100
  }
101
101
  @media (min-resolution: 192dpi) {
102
102
  :root {
@@ -104,7 +104,7 @@
104
104
  }
105
105
  }
106
106
 
107
- .editor-styles-wrapper .wp-block {
107
+ .editor-styles-wrapper :where(:not(.is-layout-flex, .is-layout-grid)) > .wp-block {
108
108
  margin-left: auto;
109
109
  margin-right: auto;
110
110
  }