@wordpress/editor 13.33.0 → 13.35.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 (494) hide show
  1. package/CHANGELOG.md +12 -4
  2. package/README.md +132 -20
  3. package/build/bindings/pattern-overrides.js +70 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/components/autosave-monitor/index.js +15 -12
  6. package/build/components/autosave-monitor/index.js.map +1 -1
  7. package/build/components/block-settings-menu/content-only-settings-menu.js +126 -0
  8. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
  9. package/build/components/block-settings-menu/content-only-settings-menu.native.js +11 -0
  10. package/build/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
  11. package/build/components/character-count/index.js +5 -0
  12. package/build/components/character-count/index.js.map +1 -1
  13. package/build/components/collapsible-block-toolbar/index.js +73 -0
  14. package/build/components/collapsible-block-toolbar/index.js.map +1 -0
  15. package/build/components/document-bar/index.js +2 -2
  16. package/build/components/document-bar/index.js.map +1 -1
  17. package/build/components/document-outline/check.js +8 -0
  18. package/build/components/document-outline/check.js.map +1 -1
  19. package/build/components/document-outline/index.js +11 -0
  20. package/build/components/document-outline/index.js.map +1 -1
  21. package/build/components/document-outline/item.js +2 -2
  22. package/build/components/document-outline/item.js.map +1 -1
  23. package/build/components/document-tools/index.js +15 -25
  24. package/build/components/document-tools/index.js.map +1 -1
  25. package/build/components/editor-canvas/edit-template-blocks-notification.js +1 -1
  26. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  27. package/build/components/editor-canvas/index.js +19 -8
  28. package/build/components/editor-canvas/index.js.map +1 -1
  29. package/build/components/editor-history/redo.js +11 -0
  30. package/build/components/editor-history/redo.js.map +1 -1
  31. package/build/components/editor-history/undo.js +11 -0
  32. package/build/components/editor-history/undo.js.map +1 -1
  33. package/build/components/editor-snackbars/index.js +6 -0
  34. package/build/components/editor-snackbars/index.js.map +1 -1
  35. package/build/components/global-keyboard-shortcuts/index.js +7 -0
  36. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  37. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +35 -1
  38. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  39. package/build/components/global-styles-provider/index.js +130 -0
  40. package/build/components/global-styles-provider/index.js.map +1 -0
  41. package/build/components/header/index.js +147 -0
  42. package/build/components/header/index.js.map +1 -0
  43. package/build/components/inserter-sidebar/index.js +56 -34
  44. package/build/components/inserter-sidebar/index.js.map +1 -1
  45. package/build/components/keyboard-shortcut-help-modal/config.js +4 -0
  46. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  47. package/build/components/keyboard-shortcut-help-modal/index.js +2 -2
  48. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  49. package/build/components/list-view-sidebar/index.js +1 -1
  50. package/build/components/list-view-sidebar/index.js.map +1 -1
  51. package/build/components/more-menu/copy-content-menu-item.js +59 -0
  52. package/build/components/more-menu/copy-content-menu-item.js.map +1 -0
  53. package/build/components/more-menu/index.js +119 -0
  54. package/build/components/more-menu/index.js.map +1 -0
  55. package/build/components/more-menu/tools-more-menu-group.js +23 -0
  56. package/build/components/more-menu/tools-more-menu-group.js.map +1 -0
  57. package/build/components/more-menu/view-more-menu-group.js +24 -0
  58. package/build/components/more-menu/view-more-menu-group.js.map +1 -0
  59. package/build/components/page-attributes/check.js +8 -0
  60. package/build/components/page-attributes/check.js.map +1 -1
  61. package/build/components/page-attributes/order.js +7 -0
  62. package/build/components/page-attributes/order.js.map +1 -1
  63. package/build/components/page-attributes/panel.js +14 -8
  64. package/build/components/page-attributes/panel.js.map +1 -1
  65. package/build/components/page-attributes/parent.js +7 -0
  66. package/build/components/page-attributes/parent.js.map +1 -1
  67. package/build/components/plugin-post-publish-panel/index.js +1 -1
  68. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  69. package/build/components/plugin-pre-publish-panel/index.js +1 -1
  70. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  71. package/build/components/plugin-sidebar/index.js +1 -1
  72. package/build/components/plugin-sidebar/index.js.map +1 -1
  73. package/build/components/post-actions/actions.js +219 -66
  74. package/build/components/post-actions/actions.js.map +1 -1
  75. package/build/components/post-actions/index.js +32 -16
  76. package/build/components/post-actions/index.js.map +1 -1
  77. package/build/components/post-author/check.js +9 -0
  78. package/build/components/post-author/check.js.map +1 -1
  79. package/build/components/post-author/index.js +6 -0
  80. package/build/components/post-author/index.js.map +1 -1
  81. package/build/components/post-author/panel.js +5 -0
  82. package/build/components/post-author/panel.js.map +1 -1
  83. package/build/components/post-card-panel/index.js +7 -66
  84. package/build/components/post-card-panel/index.js.map +1 -1
  85. package/build/components/post-comments/index.js +28 -8
  86. package/build/components/post-comments/index.js.map +1 -1
  87. package/build/components/post-content-information/index.js +72 -0
  88. package/build/components/post-content-information/index.js.map +1 -0
  89. package/build/components/post-discussion/panel.js +104 -20
  90. package/build/components/post-discussion/panel.js.map +1 -1
  91. package/build/components/post-excerpt/check.js +0 -19
  92. package/build/components/post-excerpt/check.js.map +1 -1
  93. package/build/components/post-excerpt/index.js +52 -12
  94. package/build/components/post-excerpt/index.js.map +1 -1
  95. package/build/components/post-excerpt/panel.js +118 -7
  96. package/build/components/post-excerpt/panel.js.map +1 -1
  97. package/build/components/post-excerpt/plugin.js +2 -2
  98. package/build/components/post-excerpt/plugin.js.map +1 -1
  99. package/build/components/post-featured-image/index.js +1 -1
  100. package/build/components/post-featured-image/index.js.map +1 -1
  101. package/build/components/post-format/panel.js +27 -0
  102. package/build/components/post-format/panel.js.map +1 -0
  103. package/build/components/post-last-edited-panel/index.js +33 -0
  104. package/build/components/post-last-edited-panel/index.js.map +1 -0
  105. package/build/components/post-panel-row/index.js +2 -2
  106. package/build/components/post-panel-row/index.js.map +1 -1
  107. package/build/components/post-panel-section/index.js +28 -0
  108. package/build/components/post-panel-section/index.js.map +1 -0
  109. package/build/components/post-pingbacks/index.js +5 -2
  110. package/build/components/post-pingbacks/index.js.map +1 -1
  111. package/build/components/post-publish-button/post-publish-button-or-toggle.js +100 -0
  112. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
  113. package/build/components/post-saved-state/index.js +2 -2
  114. package/build/components/post-saved-state/index.js.map +1 -1
  115. package/build/components/post-schedule/panel.js +1 -1
  116. package/build/components/post-schedule/panel.js.map +1 -1
  117. package/build/components/post-slug/panel.js +27 -0
  118. package/build/components/post-slug/panel.js.map +1 -0
  119. package/build/components/post-status/index.js +13 -13
  120. package/build/components/post-status/index.js.map +1 -1
  121. package/build/components/post-sticky/panel.js +21 -0
  122. package/build/components/post-sticky/panel.js.map +1 -0
  123. package/build/components/post-template/block-theme.js +2 -2
  124. package/build/components/post-template/block-theme.js.map +1 -1
  125. package/build/components/post-template/classic-theme.js +0 -1
  126. package/build/components/post-template/classic-theme.js.map +1 -1
  127. package/build/components/post-template/swap-template-button.js +2 -5
  128. package/build/components/post-template/swap-template-button.js.map +1 -1
  129. package/build/components/post-title/index.js +2 -2
  130. package/build/components/post-title/index.js.map +1 -1
  131. package/build/components/post-title/post-title-raw.js +2 -2
  132. package/build/components/post-title/post-title-raw.js.map +1 -1
  133. package/build/components/post-transform-panel/hooks.js +90 -0
  134. package/build/components/post-transform-panel/hooks.js.map +1 -0
  135. package/build/components/post-transform-panel/index.js +101 -0
  136. package/build/components/post-transform-panel/index.js.map +1 -0
  137. package/build/components/post-trash/panel.js +18 -0
  138. package/build/components/post-trash/panel.js.map +1 -0
  139. package/build/components/post-type-support-check/index.js +1 -1
  140. package/build/components/post-type-support-check/index.js.map +1 -1
  141. package/build/components/post-url/index.js +2 -1
  142. package/build/components/post-url/index.js.map +1 -1
  143. package/build/components/post-url/panel.js +1 -1
  144. package/build/components/post-url/panel.js.map +1 -1
  145. package/build/components/preferences-modal/enable-publish-sidebar.js +34 -0
  146. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
  147. package/build/components/preferences-modal/index.js +11 -5
  148. package/build/components/preferences-modal/index.js.map +1 -1
  149. package/build/components/preview-dropdown/index.js +3 -1
  150. package/build/components/preview-dropdown/index.js.map +1 -1
  151. package/build/components/provider/disable-non-page-content-blocks.js +23 -16
  152. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  153. package/build/components/provider/index.js +3 -1
  154. package/build/components/provider/index.js.map +1 -1
  155. package/build/components/provider/use-block-editor-settings.js +21 -3
  156. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  157. package/build/components/save-publish-panels/index.js +89 -0
  158. package/build/components/save-publish-panels/index.js.map +1 -0
  159. package/build/components/sidebar/constants.js +11 -0
  160. package/build/components/sidebar/constants.js.map +1 -0
  161. package/build/components/sidebar/header.js +53 -0
  162. package/build/components/sidebar/header.js.map +1 -0
  163. package/build/components/sidebar/index.js +157 -0
  164. package/build/components/sidebar/index.js.map +1 -0
  165. package/build/components/sidebar/post-summary.js +84 -0
  166. package/build/components/sidebar/post-summary.js.map +1 -0
  167. package/build/components/start-page-options/index.js +10 -8
  168. package/build/components/start-page-options/index.js.map +1 -1
  169. package/build/components/start-template-options/index.js +192 -0
  170. package/build/components/start-template-options/index.js.map +1 -0
  171. package/build/components/template-content-panel/index.js +38 -0
  172. package/build/components/template-content-panel/index.js.map +1 -0
  173. package/build/hooks/pattern-overrides.js +10 -5
  174. package/build/hooks/pattern-overrides.js.map +1 -1
  175. package/build/private-apis.js +19 -8
  176. package/build/private-apis.js.map +1 -1
  177. package/build/private-apis.native.js +72 -0
  178. package/build/private-apis.native.js.map +1 -0
  179. package/build/store/private-selectors.js +6 -1
  180. package/build/store/private-selectors.js.map +1 -1
  181. package/build/store/reducer.js +15 -0
  182. package/build/store/reducer.js.map +1 -1
  183. package/build/store/selectors.js +3 -1
  184. package/build/store/selectors.js.map +1 -1
  185. package/build-module/bindings/pattern-overrides.js +69 -1
  186. package/build-module/bindings/pattern-overrides.js.map +1 -1
  187. package/build-module/components/autosave-monitor/index.js +15 -13
  188. package/build-module/components/autosave-monitor/index.js.map +1 -1
  189. package/build-module/components/block-settings-menu/content-only-settings-menu.js +119 -0
  190. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
  191. package/build-module/components/block-settings-menu/content-only-settings-menu.native.js +5 -0
  192. package/build-module/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
  193. package/build-module/components/character-count/index.js +6 -0
  194. package/build-module/components/character-count/index.js.map +1 -1
  195. package/build-module/components/collapsible-block-toolbar/index.js +65 -0
  196. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -0
  197. package/build-module/components/document-bar/index.js +2 -2
  198. package/build-module/components/document-bar/index.js.map +1 -1
  199. package/build-module/components/document-outline/check.js +9 -0
  200. package/build-module/components/document-outline/check.js.map +1 -1
  201. package/build-module/components/document-outline/index.js +11 -0
  202. package/build-module/components/document-outline/index.js.map +1 -1
  203. package/build-module/components/document-outline/item.js +2 -2
  204. package/build-module/components/document-outline/item.js.map +1 -1
  205. package/build-module/components/document-tools/index.js +17 -27
  206. package/build-module/components/document-tools/index.js.map +1 -1
  207. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +1 -1
  208. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  209. package/build-module/components/editor-canvas/index.js +19 -8
  210. package/build-module/components/editor-canvas/index.js.map +1 -1
  211. package/build-module/components/editor-history/redo.js +11 -0
  212. package/build-module/components/editor-history/redo.js.map +1 -1
  213. package/build-module/components/editor-history/undo.js +11 -0
  214. package/build-module/components/editor-history/undo.js.map +1 -1
  215. package/build-module/components/editor-snackbars/index.js +6 -0
  216. package/build-module/components/editor-snackbars/index.js.map +1 -1
  217. package/build-module/components/global-keyboard-shortcuts/index.js +8 -0
  218. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  219. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +36 -1
  220. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  221. package/build-module/components/global-styles-provider/index.js +120 -0
  222. package/build-module/components/global-styles-provider/index.js.map +1 -0
  223. package/build-module/components/header/index.js +139 -0
  224. package/build-module/components/header/index.js.map +1 -0
  225. package/build-module/components/inserter-sidebar/index.js +59 -37
  226. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  227. package/build-module/components/keyboard-shortcut-help-modal/config.js +4 -0
  228. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  229. package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -2
  230. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  231. package/build-module/components/list-view-sidebar/index.js +1 -1
  232. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  233. package/build-module/components/more-menu/copy-content-menu-item.js +52 -0
  234. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -0
  235. package/build-module/components/more-menu/index.js +111 -0
  236. package/build-module/components/more-menu/index.js.map +1 -0
  237. package/build-module/components/more-menu/tools-more-menu-group.js +16 -0
  238. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -0
  239. package/build-module/components/more-menu/view-more-menu-group.js +17 -0
  240. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -0
  241. package/build-module/components/page-attributes/check.js +9 -0
  242. package/build-module/components/page-attributes/check.js.map +1 -1
  243. package/build-module/components/page-attributes/order.js +7 -0
  244. package/build-module/components/page-attributes/order.js.map +1 -1
  245. package/build-module/components/page-attributes/panel.js +13 -6
  246. package/build-module/components/page-attributes/panel.js.map +1 -1
  247. package/build-module/components/page-attributes/parent.js +7 -0
  248. package/build-module/components/page-attributes/parent.js.map +1 -1
  249. package/build-module/components/plugin-post-publish-panel/index.js +1 -1
  250. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  251. package/build-module/components/plugin-pre-publish-panel/index.js +1 -1
  252. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  253. package/build-module/components/plugin-sidebar/index.js +1 -1
  254. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  255. package/build-module/components/post-actions/actions.js +223 -70
  256. package/build-module/components/post-actions/actions.js.map +1 -1
  257. package/build-module/components/post-actions/index.js +33 -17
  258. package/build-module/components/post-actions/index.js.map +1 -1
  259. package/build-module/components/post-author/check.js +10 -0
  260. package/build-module/components/post-author/check.js.map +1 -1
  261. package/build-module/components/post-author/index.js +6 -0
  262. package/build-module/components/post-author/index.js.map +1 -1
  263. package/build-module/components/post-author/panel.js +6 -0
  264. package/build-module/components/post-author/panel.js.map +1 -1
  265. package/build-module/components/post-card-panel/index.js +9 -67
  266. package/build-module/components/post-card-panel/index.js.map +1 -1
  267. package/build-module/components/post-comments/index.js +30 -10
  268. package/build-module/components/post-comments/index.js.map +1 -1
  269. package/build-module/components/post-content-information/index.js +66 -0
  270. package/build-module/components/post-content-information/index.js.map +1 -0
  271. package/build-module/components/post-discussion/panel.js +105 -21
  272. package/build-module/components/post-discussion/panel.js.map +1 -1
  273. package/build-module/components/post-excerpt/check.js +0 -19
  274. package/build-module/components/post-excerpt/check.js.map +1 -1
  275. package/build-module/components/post-excerpt/index.js +52 -11
  276. package/build-module/components/post-excerpt/index.js.map +1 -1
  277. package/build-module/components/post-excerpt/panel.js +118 -8
  278. package/build-module/components/post-excerpt/panel.js.map +1 -1
  279. package/build-module/components/post-excerpt/plugin.js +2 -2
  280. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  281. package/build-module/components/post-featured-image/index.js +1 -1
  282. package/build-module/components/post-featured-image/index.js.map +1 -1
  283. package/build-module/components/post-format/panel.js +18 -0
  284. package/build-module/components/post-format/panel.js.map +1 -0
  285. package/build-module/components/post-last-edited-panel/index.js +26 -0
  286. package/build-module/components/post-last-edited-panel/index.js.map +1 -0
  287. package/build-module/components/post-panel-row/index.js +2 -2
  288. package/build-module/components/post-panel-row/index.js.map +1 -1
  289. package/build-module/components/post-panel-section/index.js +20 -0
  290. package/build-module/components/post-panel-section/index.js.map +1 -0
  291. package/build-module/components/post-pingbacks/index.js +6 -3
  292. package/build-module/components/post-pingbacks/index.js.map +1 -1
  293. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +91 -0
  294. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
  295. package/build-module/components/post-saved-state/index.js +2 -2
  296. package/build-module/components/post-saved-state/index.js.map +1 -1
  297. package/build-module/components/post-schedule/panel.js +1 -1
  298. package/build-module/components/post-schedule/panel.js.map +1 -1
  299. package/build-module/components/post-slug/panel.js +18 -0
  300. package/build-module/components/post-slug/panel.js.map +1 -0
  301. package/build-module/components/post-status/index.js +13 -13
  302. package/build-module/components/post-status/index.js.map +1 -1
  303. package/build-module/components/post-sticky/panel.js +12 -0
  304. package/build-module/components/post-sticky/panel.js.map +1 -0
  305. package/build-module/components/post-template/block-theme.js +2 -2
  306. package/build-module/components/post-template/block-theme.js.map +1 -1
  307. package/build-module/components/post-template/classic-theme.js +0 -1
  308. package/build-module/components/post-template/classic-theme.js.map +1 -1
  309. package/build-module/components/post-template/swap-template-button.js +3 -6
  310. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  311. package/build-module/components/post-title/index.js +2 -2
  312. package/build-module/components/post-title/index.js.map +1 -1
  313. package/build-module/components/post-title/post-title-raw.js +2 -2
  314. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  315. package/build-module/components/post-transform-panel/hooks.js +83 -0
  316. package/build-module/components/post-transform-panel/hooks.js.map +1 -0
  317. package/build-module/components/post-transform-panel/index.js +94 -0
  318. package/build-module/components/post-transform-panel/index.js.map +1 -0
  319. package/build-module/components/post-trash/panel.js +10 -0
  320. package/build-module/components/post-trash/panel.js.map +1 -0
  321. package/build-module/components/post-type-support-check/index.js +1 -1
  322. package/build-module/components/post-type-support-check/index.js.map +1 -1
  323. package/build-module/components/post-url/index.js +2 -1
  324. package/build-module/components/post-url/index.js.map +1 -1
  325. package/build-module/components/post-url/panel.js +1 -1
  326. package/build-module/components/post-url/panel.js.map +1 -1
  327. package/build-module/components/preferences-modal/enable-publish-sidebar.js +27 -0
  328. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
  329. package/build-module/components/preferences-modal/index.js +11 -5
  330. package/build-module/components/preferences-modal/index.js.map +1 -1
  331. package/build-module/components/preview-dropdown/index.js +3 -1
  332. package/build-module/components/preview-dropdown/index.js.map +1 -1
  333. package/build-module/components/provider/disable-non-page-content-blocks.js +24 -17
  334. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  335. package/build-module/components/provider/index.js +3 -1
  336. package/build-module/components/provider/index.js.map +1 -1
  337. package/build-module/components/provider/use-block-editor-settings.js +21 -3
  338. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  339. package/build-module/components/save-publish-panels/index.js +80 -0
  340. package/build-module/components/save-publish-panels/index.js.map +1 -0
  341. package/build-module/components/sidebar/constants.js +5 -0
  342. package/build-module/components/sidebar/constants.js.map +1 -0
  343. package/build-module/components/sidebar/header.js +46 -0
  344. package/build-module/components/sidebar/header.js.map +1 -0
  345. package/build-module/components/sidebar/index.js +149 -0
  346. package/build-module/components/sidebar/index.js.map +1 -0
  347. package/build-module/components/sidebar/post-summary.js +77 -0
  348. package/build-module/components/sidebar/post-summary.js.map +1 -0
  349. package/build-module/components/start-page-options/index.js +10 -8
  350. package/build-module/components/start-page-options/index.js.map +1 -1
  351. package/build-module/components/start-template-options/index.js +185 -0
  352. package/build-module/components/start-template-options/index.js.map +1 -0
  353. package/build-module/components/template-content-panel/index.js +31 -0
  354. package/build-module/components/template-content-panel/index.js.map +1 -0
  355. package/build-module/hooks/pattern-overrides.js +10 -5
  356. package/build-module/hooks/pattern-overrides.js.map +1 -1
  357. package/build-module/private-apis.js +19 -8
  358. package/build-module/private-apis.js.map +1 -1
  359. package/build-module/private-apis.native.js +62 -0
  360. package/build-module/private-apis.native.js.map +1 -0
  361. package/build-module/store/private-selectors.js +3 -0
  362. package/build-module/store/private-selectors.js.map +1 -1
  363. package/build-module/store/reducer.js +14 -0
  364. package/build-module/store/reducer.js.map +1 -1
  365. package/build-module/store/selectors.js +3 -1
  366. package/build-module/store/selectors.js.map +1 -1
  367. package/build-style/style-rtl.css +535 -48
  368. package/build-style/style.css +535 -48
  369. package/package.json +38 -36
  370. package/src/bindings/pattern-overrides.js +83 -1
  371. package/src/components/autocompleters/style.scss +1 -2
  372. package/src/components/autosave-monitor/index.js +15 -12
  373. package/src/components/block-settings-menu/content-only-settings-menu.js +175 -0
  374. package/src/components/block-settings-menu/content-only-settings-menu.native.js +4 -0
  375. package/src/components/block-settings-menu/style.scss +4 -0
  376. package/src/components/character-count/index.js +5 -0
  377. package/src/components/collapsible-block-toolbar/index.js +77 -0
  378. package/src/components/collapsible-block-toolbar/style.scss +80 -0
  379. package/src/components/document-bar/index.js +2 -2
  380. package/src/components/document-outline/check.js +8 -0
  381. package/src/components/document-outline/index.js +10 -0
  382. package/src/components/document-outline/item.js +2 -2
  383. package/src/components/document-tools/index.js +19 -26
  384. package/src/components/editor-canvas/edit-template-blocks-notification.js +1 -1
  385. package/src/components/editor-canvas/index.js +18 -6
  386. package/src/components/editor-history/redo.js +10 -0
  387. package/src/components/editor-history/undo.js +10 -0
  388. package/src/components/editor-snackbars/index.js +5 -0
  389. package/src/components/entities-saved-states/style.scss +7 -0
  390. package/src/components/global-keyboard-shortcuts/index.js +7 -0
  391. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +42 -1
  392. package/src/components/global-styles-provider/index.js +162 -0
  393. package/src/components/header/index.js +154 -0
  394. package/src/components/header/style.scss +231 -0
  395. package/src/components/inserter-sidebar/index.js +52 -32
  396. package/src/components/inserter-sidebar/style.scss +10 -3
  397. package/src/components/keyboard-shortcut-help-modal/config.js +10 -1
  398. package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
  399. package/src/components/list-view-sidebar/index.js +1 -1
  400. package/src/components/list-view-sidebar/style.scss +3 -2
  401. package/src/components/more-menu/copy-content-menu-item.js +51 -0
  402. package/src/components/more-menu/index.js +158 -0
  403. package/src/components/more-menu/tools-more-menu-group.js +11 -0
  404. package/src/components/more-menu/view-more-menu-group.js +13 -0
  405. package/src/components/page-attributes/check.js +8 -0
  406. package/src/components/page-attributes/order.js +6 -0
  407. package/src/components/page-attributes/panel.js +21 -17
  408. package/src/components/page-attributes/parent.js +6 -0
  409. package/src/components/page-attributes/test/order.js +5 -1
  410. package/src/components/plugin-post-publish-panel/index.js +1 -1
  411. package/src/components/plugin-pre-publish-panel/index.js +1 -1
  412. package/src/components/plugin-sidebar/index.js +1 -1
  413. package/src/components/post-actions/actions.js +373 -152
  414. package/src/components/post-actions/index.js +34 -33
  415. package/src/components/post-author/check.js +9 -0
  416. package/src/components/post-author/index.js +5 -0
  417. package/src/components/post-author/panel.js +5 -0
  418. package/src/components/post-card-panel/index.js +40 -141
  419. package/src/components/post-card-panel/style.scss +2 -6
  420. package/src/components/post-comments/index.js +47 -9
  421. package/src/components/post-content-information/index.js +83 -0
  422. package/src/components/post-content-information/style.scss +6 -0
  423. package/src/components/post-discussion/panel.js +108 -27
  424. package/src/components/post-discussion/style.scss +26 -0
  425. package/src/components/post-excerpt/check.js +0 -18
  426. package/src/components/post-excerpt/index.js +66 -15
  427. package/src/components/post-excerpt/panel.js +196 -19
  428. package/src/components/post-excerpt/plugin.js +2 -2
  429. package/src/components/post-excerpt/style.scss +24 -0
  430. package/src/components/post-featured-image/index.js +1 -1
  431. package/src/components/post-featured-image/style.scss +2 -8
  432. package/src/components/post-format/panel.js +22 -0
  433. package/src/components/post-format/style.scss +6 -0
  434. package/src/components/post-last-edited-panel/index.js +35 -0
  435. package/src/components/post-last-edited-panel/style.scss +6 -0
  436. package/src/components/post-last-revision/test/check.js +5 -1
  437. package/src/components/post-panel-row/index.js +2 -2
  438. package/src/components/post-panel-row/style.scss +3 -3
  439. package/src/components/post-panel-section/index.js +19 -0
  440. package/src/components/post-panel-section/style.scss +3 -0
  441. package/src/components/post-pingbacks/index.js +11 -2
  442. package/src/components/post-publish-button/post-publish-button-or-toggle.js +102 -0
  443. package/src/components/post-publish-button/test/post-publish-button-or-toggle.js +63 -0
  444. package/src/components/post-publish-panel/style.scss +48 -0
  445. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +225 -75
  446. package/src/components/post-saved-state/index.js +2 -2
  447. package/src/components/post-schedule/panel.js +1 -1
  448. package/src/components/post-schedule/style.scss +2 -4
  449. package/src/components/post-slug/panel.js +22 -0
  450. package/src/components/post-slug/style.scss +5 -0
  451. package/src/components/post-slug/test/index.js +5 -1
  452. package/src/components/post-status/index.js +88 -80
  453. package/src/components/post-status/style.scss +0 -1
  454. package/src/components/post-sticky/panel.js +18 -0
  455. package/src/components/post-template/block-theme.js +2 -2
  456. package/src/components/post-template/classic-theme.js +0 -1
  457. package/src/components/post-template/swap-template-button.js +3 -6
  458. package/src/components/post-text-editor/style.scss +1 -1
  459. package/src/components/post-title/index.js +2 -2
  460. package/src/components/post-title/post-title-raw.js +2 -2
  461. package/src/components/post-title/style.scss +1 -1
  462. package/src/components/post-transform-panel/hooks.js +114 -0
  463. package/src/components/post-transform-panel/index.js +99 -0
  464. package/src/components/post-trash/panel.js +13 -0
  465. package/src/components/post-type-support-check/index.js +1 -1
  466. package/src/components/post-type-support-check/test/index.js +2 -2
  467. package/src/components/post-url/index.js +1 -0
  468. package/src/components/post-url/panel.js +1 -1
  469. package/src/components/preferences-modal/enable-publish-sidebar.js +28 -0
  470. package/src/components/preferences-modal/index.js +17 -3
  471. package/src/components/preview-dropdown/index.js +3 -1
  472. package/src/components/provider/disable-non-page-content-blocks.js +23 -21
  473. package/src/components/provider/index.js +4 -0
  474. package/src/components/provider/use-block-editor-settings.js +19 -4
  475. package/src/components/save-publish-panels/index.js +96 -0
  476. package/src/components/save-publish-panels/style.scss +36 -0
  477. package/src/components/sidebar/constants.js +4 -0
  478. package/src/components/sidebar/header.js +49 -0
  479. package/src/components/sidebar/index.js +200 -0
  480. package/src/components/sidebar/post-summary.js +104 -0
  481. package/src/components/sidebar/style.scss +18 -0
  482. package/src/components/start-page-options/index.js +12 -5
  483. package/src/components/start-template-options/index.js +219 -0
  484. package/src/components/start-template-options/style.scss +55 -0
  485. package/src/components/template-areas/style.scss +0 -1
  486. package/src/components/template-content-panel/index.js +36 -0
  487. package/src/hooks/pattern-overrides.js +12 -6
  488. package/src/private-apis.js +22 -8
  489. package/src/private-apis.native.js +61 -0
  490. package/src/store/private-selectors.js +3 -0
  491. package/src/store/reducer.js +12 -0
  492. package/src/store/selectors.js +3 -1
  493. package/src/style.scss +11 -0
  494. package/src/components/post-slug/test/check.js +0 -17
@@ -0,0 +1,96 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { Button, createSlotFill } from '@wordpress/components';
6
+ import { __ } from '@wordpress/i18n';
7
+ import { useCallback } from '@wordpress/element';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import EntitiesSavedStates from '../entities-saved-states';
13
+ import PostPublishPanel from '../post-publish-panel';
14
+ import PluginPrePublishPanel from '../plugin-pre-publish-panel';
15
+ import PluginPostPublishPanel from '../plugin-post-publish-panel';
16
+ import { store as editorStore } from '../../store';
17
+
18
+ const { Fill, Slot } = createSlotFill( 'ActionsPanel' );
19
+
20
+ export const ActionsPanelFill = Fill;
21
+
22
+ export default function SavePublishPanels( {
23
+ setEntitiesSavedStatesCallback,
24
+ closeEntitiesSavedStates,
25
+ isEntitiesSavedStatesOpen,
26
+ forceIsDirtyPublishPanel,
27
+ } ) {
28
+ const { closePublishSidebar, togglePublishSidebar } =
29
+ useDispatch( editorStore );
30
+ const { publishSidebarOpened, hasNonPostEntityChanges } = useSelect(
31
+ ( select ) => ( {
32
+ publishSidebarOpened:
33
+ select( editorStore ).isPublishSidebarOpened(),
34
+ hasNonPostEntityChanges:
35
+ select( editorStore ).hasNonPostEntityChanges(),
36
+ } ),
37
+ []
38
+ );
39
+
40
+ const openEntitiesSavedStates = useCallback(
41
+ () => setEntitiesSavedStatesCallback( true ),
42
+ []
43
+ );
44
+
45
+ // It is ok for these components to be unmounted when not in visual use.
46
+ // We don't want more than one present at a time, decide which to render.
47
+ let unmountableContent;
48
+ if ( publishSidebarOpened ) {
49
+ unmountableContent = (
50
+ <PostPublishPanel
51
+ onClose={ closePublishSidebar }
52
+ forceIsDirty={ forceIsDirtyPublishPanel }
53
+ PrePublishExtension={ PluginPrePublishPanel.Slot }
54
+ PostPublishExtension={ PluginPostPublishPanel.Slot }
55
+ />
56
+ );
57
+ } else if ( hasNonPostEntityChanges ) {
58
+ unmountableContent = (
59
+ <div className="editor-layout__toggle-entities-saved-states-panel">
60
+ <Button
61
+ variant="secondary"
62
+ className="editor-layout__toggle-entities-saved-states-panel-button"
63
+ onClick={ openEntitiesSavedStates }
64
+ aria-expanded={ false }
65
+ >
66
+ { __( 'Open save panel' ) }
67
+ </Button>
68
+ </div>
69
+ );
70
+ } else {
71
+ unmountableContent = (
72
+ <div className="editor-layout__toggle-publish-panel">
73
+ <Button
74
+ variant="secondary"
75
+ className="editor-layout__toggle-publish-panel-button"
76
+ onClick={ togglePublishSidebar }
77
+ aria-expanded={ false }
78
+ >
79
+ { __( 'Open publish panel' ) }
80
+ </Button>
81
+ </div>
82
+ );
83
+ }
84
+
85
+ // Since EntitiesSavedStates controls its own panel, we can keep it
86
+ // always mounted to retain its own component state (such as checkboxes).
87
+ return (
88
+ <>
89
+ { isEntitiesSavedStatesOpen && (
90
+ <EntitiesSavedStates close={ closeEntitiesSavedStates } />
91
+ ) }
92
+ <Slot bubblesVirtually />
93
+ { ! isEntitiesSavedStatesOpen && unmountableContent }
94
+ </>
95
+ );
96
+ }
@@ -0,0 +1,36 @@
1
+
2
+ .editor-layout__toggle-publish-panel,
3
+ .editor-layout__toggle-sidebar-panel,
4
+ .editor-layout__toggle-entities-saved-states-panel {
5
+ z-index: z-index(".editor-layout__toggle-sidebar-panel");
6
+ position: fixed !important; // Need to override the default relative positionning
7
+ top: -9999em;
8
+ bottom: auto;
9
+ left: auto;
10
+ right: 0;
11
+ box-sizing: border-box;
12
+ width: $sidebar-width;
13
+ background-color: $white;
14
+ border: 1px dotted $gray-300;
15
+ height: auto !important; // Need to override the default sidebar positionnings
16
+ padding: $grid-unit-30;
17
+ display: flex;
18
+ justify-content: center;
19
+ }
20
+
21
+ .editor-layout__toggle-entities-saved-states-panel,
22
+ .editor-layout__toggle-publish-panel {
23
+ .interface-interface-skeleton__actions:focus &,
24
+ .interface-interface-skeleton__actions:focus-within & {
25
+ top: auto;
26
+ bottom: 0;
27
+ }
28
+ }
29
+
30
+ .edit-post-layout__toggle-sidebar-panel {
31
+ .interface-interface-skeleton__sidebar:focus &,
32
+ .interface-interface-skeleton__sidebar:focus-within & {
33
+ top: auto;
34
+ bottom: 0;
35
+ }
36
+ }
@@ -0,0 +1,4 @@
1
+ export const sidebars = {
2
+ document: 'edit-post/document',
3
+ block: 'edit-post/block',
4
+ };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { privateApis as componentsPrivateApis } from '@wordpress/components';
5
+ import { __, _x } from '@wordpress/i18n';
6
+ import { useSelect } from '@wordpress/data';
7
+ import { forwardRef } from '@wordpress/element';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import { store as editorStore } from '../../store';
13
+ import { unlock } from '../../lock-unlock';
14
+ import { sidebars } from './constants';
15
+
16
+ const { Tabs } = unlock( componentsPrivateApis );
17
+
18
+ const SidebarHeader = ( _, ref ) => {
19
+ const { documentLabel } = useSelect( ( select ) => {
20
+ const { getPostTypeLabel } = select( editorStore );
21
+
22
+ return {
23
+ // translators: Default label for the Document sidebar tab, not selected.
24
+ documentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),
25
+ };
26
+ }, [] );
27
+
28
+ return (
29
+ <Tabs.TabList ref={ ref }>
30
+ <Tabs.Tab
31
+ tabId={ sidebars.document }
32
+ // Used for focus management in the SettingsSidebar component.
33
+ data-tab-id={ sidebars.document }
34
+ >
35
+ { documentLabel }
36
+ </Tabs.Tab>
37
+ <Tabs.Tab
38
+ tabId={ sidebars.block }
39
+ // Used for focus management in the SettingsSidebar component.
40
+ data-tab-id={ sidebars.block }
41
+ >
42
+ { /* translators: Text label for the Block Settings Sidebar tab. */ }
43
+ { __( 'Block' ) }
44
+ </Tabs.Tab>
45
+ </Tabs.TabList>
46
+ );
47
+ };
48
+
49
+ export default forwardRef( SidebarHeader );
@@ -0,0 +1,200 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ BlockInspector,
6
+ store as blockEditorStore,
7
+ } from '@wordpress/block-editor';
8
+ import { useSelect, useDispatch } from '@wordpress/data';
9
+ import {
10
+ Platform,
11
+ useCallback,
12
+ useContext,
13
+ useEffect,
14
+ useRef,
15
+ } from '@wordpress/element';
16
+ import { isRTL, __ } from '@wordpress/i18n';
17
+ import { drawerLeft, drawerRight } from '@wordpress/icons';
18
+ import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
19
+ import { privateApis as componentsPrivateApis } from '@wordpress/components';
20
+ import { store as interfaceStore } from '@wordpress/interface';
21
+
22
+ /**
23
+ * Internal dependencies
24
+ */
25
+ import PageAttributesPanel from '../page-attributes/panel';
26
+ import PatternOverridesPanel from '../pattern-overrides-panel';
27
+ import PluginDocumentSettingPanel from '../plugin-document-setting-panel';
28
+ import PluginSidebar from '../plugin-sidebar';
29
+ import PostLastRevisionPanel from '../post-last-revision/panel';
30
+ import PostSummary from './post-summary';
31
+ import PostTaxonomiesPanel from '../post-taxonomies/panel';
32
+ import PostTransformPanel from '../post-transform-panel';
33
+ import SidebarHeader from './header';
34
+ import TemplateContentPanel from '../template-content-panel';
35
+ import useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';
36
+ import { sidebars } from './constants';
37
+ import { unlock } from '../../lock-unlock';
38
+ import { store as editorStore } from '../../store';
39
+ import {
40
+ NAVIGATION_POST_TYPE,
41
+ TEMPLATE_PART_POST_TYPE,
42
+ TEMPLATE_POST_TYPE,
43
+ } from '../../store/constants';
44
+
45
+ const { Tabs } = unlock( componentsPrivateApis );
46
+
47
+ const SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {
48
+ web: true,
49
+ native: false,
50
+ } );
51
+
52
+ const SidebarContent = ( {
53
+ tabName,
54
+ keyboardShortcut,
55
+ renderingMode,
56
+ onActionPerformed,
57
+ extraPanels,
58
+ } ) => {
59
+ const tabListRef = useRef( null );
60
+ // Because `PluginSidebar` renders a `ComplementaryArea`, we
61
+ // need to forward the `Tabs` context so it can be passed through the
62
+ // underlying slot/fill.
63
+ const tabsContextValue = useContext( Tabs.Context );
64
+
65
+ // This effect addresses a race condition caused by tabbing from the last
66
+ // block in the editor into the settings sidebar. Without this effect, the
67
+ // selected tab and browser focus can become separated in an unexpected way
68
+ // (e.g the "block" tab is focused, but the "post" tab is selected).
69
+ useEffect( () => {
70
+ const tabsElements = Array.from(
71
+ tabListRef.current?.querySelectorAll( '[role="tab"]' ) || []
72
+ );
73
+ const selectedTabElement = tabsElements.find(
74
+ // We are purposefully using a custom `data-tab-id` attribute here
75
+ // because we don't want rely on any assumptions about `Tabs`
76
+ // component internals.
77
+ ( element ) => element.getAttribute( 'data-tab-id' ) === tabName
78
+ );
79
+ const activeElement = selectedTabElement?.ownerDocument.activeElement;
80
+ const tabsHasFocus = tabsElements.some( ( element ) => {
81
+ return activeElement && activeElement.id === element.id;
82
+ } );
83
+ if (
84
+ tabsHasFocus &&
85
+ selectedTabElement &&
86
+ selectedTabElement.id !== activeElement?.id
87
+ ) {
88
+ selectedTabElement?.focus();
89
+ }
90
+ }, [ tabName ] );
91
+
92
+ return (
93
+ <PluginSidebar
94
+ identifier={ tabName }
95
+ header={
96
+ <Tabs.Context.Provider value={ tabsContextValue }>
97
+ <SidebarHeader ref={ tabListRef } />
98
+ </Tabs.Context.Provider>
99
+ }
100
+ closeLabel={ __( 'Close Settings' ) }
101
+ // This classname is added so we can apply a corrective negative
102
+ // margin to the panel.
103
+ // see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
104
+ className="editor-sidebar__panel"
105
+ headerClassName="editor-sidebar__panel-tabs"
106
+ /* translators: button label text should, if possible, be under 16 characters. */
107
+ title={ __( 'Settings' ) }
108
+ toggleShortcut={ keyboardShortcut }
109
+ icon={ isRTL() ? drawerLeft : drawerRight }
110
+ isActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }
111
+ >
112
+ <Tabs.Context.Provider value={ tabsContextValue }>
113
+ <Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>
114
+ <PostSummary onActionPerformed={ onActionPerformed } />
115
+ <PluginDocumentSettingPanel.Slot />
116
+ { renderingMode !== 'post-only' && (
117
+ <TemplateContentPanel />
118
+ ) }
119
+ <PostTransformPanel />
120
+ <PostLastRevisionPanel />
121
+ <PostTaxonomiesPanel />
122
+ <PageAttributesPanel />
123
+ <PatternOverridesPanel />
124
+ { extraPanels }
125
+ </Tabs.TabPanel>
126
+ <Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>
127
+ <BlockInspector />
128
+ </Tabs.TabPanel>
129
+ </Tabs.Context.Provider>
130
+ </PluginSidebar>
131
+ );
132
+ };
133
+
134
+ const Sidebar = ( { extraPanels, onActionPerformed } ) => {
135
+ useAutoSwitchEditorSidebars();
136
+ const { tabName, keyboardShortcut, showSummary, renderingMode } = useSelect(
137
+ ( select ) => {
138
+ const shortcut = select(
139
+ keyboardShortcutsStore
140
+ ).getShortcutRepresentation( 'core/editor/toggle-sidebar' );
141
+
142
+ const sidebar =
143
+ select( interfaceStore ).getActiveComplementaryArea( 'core' );
144
+ const _isEditorSidebarOpened = [
145
+ sidebars.block,
146
+ sidebars.document,
147
+ ].includes( sidebar );
148
+ let _tabName = sidebar;
149
+ if ( ! _isEditorSidebarOpened ) {
150
+ _tabName = !! select(
151
+ blockEditorStore
152
+ ).getBlockSelectionStart()
153
+ ? sidebars.block
154
+ : sidebars.document;
155
+ }
156
+
157
+ return {
158
+ tabName: _tabName,
159
+ keyboardShortcut: shortcut,
160
+ showSummary: ! [
161
+ TEMPLATE_POST_TYPE,
162
+ TEMPLATE_PART_POST_TYPE,
163
+ NAVIGATION_POST_TYPE,
164
+ ].includes( select( editorStore ).getCurrentPostType() ),
165
+ renderingMode: select( editorStore ).getRenderingMode(),
166
+ };
167
+ },
168
+ []
169
+ );
170
+
171
+ const { enableComplementaryArea } = useDispatch( interfaceStore );
172
+
173
+ const onTabSelect = useCallback(
174
+ ( newSelectedTabId ) => {
175
+ if ( !! newSelectedTabId ) {
176
+ enableComplementaryArea( 'core', newSelectedTabId );
177
+ }
178
+ },
179
+ [ enableComplementaryArea ]
180
+ );
181
+
182
+ return (
183
+ <Tabs
184
+ selectedTabId={ tabName }
185
+ onSelect={ onTabSelect }
186
+ selectOnMove={ false }
187
+ >
188
+ <SidebarContent
189
+ tabName={ tabName }
190
+ keyboardShortcut={ keyboardShortcut }
191
+ showSummary={ showSummary }
192
+ renderingMode={ renderingMode }
193
+ onActionPerformed={ onActionPerformed }
194
+ extraPanels={ extraPanels }
195
+ />
196
+ </Tabs>
197
+ );
198
+ };
199
+
200
+ export default Sidebar;
@@ -0,0 +1,104 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __experimentalVStack as VStack } from '@wordpress/components';
5
+ import { useSelect } from '@wordpress/data';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import PluginPostStatusInfo from '../plugin-post-status-info';
11
+ import PostActions from '../post-actions';
12
+ import PostAuthorPanel from '../post-author/panel';
13
+ import PostCardPanel from '../post-card-panel';
14
+ import PostContentInformation from '../post-content-information';
15
+ import PostDiscussionPanel from '../post-discussion/panel';
16
+ import { PrivatePostExcerptPanel as PostExcerptPanel } from '../post-excerpt/panel';
17
+ import PostFeaturedImagePanel from '../post-featured-image/panel';
18
+ import PostFormatPanel from '../post-format/panel';
19
+ import PostLastEditedPanel from '../post-last-edited-panel';
20
+ import PostPanelSection from '../post-panel-section';
21
+ import PostSchedulePanel from '../post-schedule/panel';
22
+ import PostStatusPanel from '../post-status';
23
+ import PostStickyPanel from '../post-sticky';
24
+ import PostSyncStatus from '../post-sync-status';
25
+ import PostTemplatePanel from '../post-template/panel';
26
+ import PostTrashPanel from '../post-trash/panel';
27
+ import PostURLPanel from '../post-url/panel';
28
+ import { store as editorStore } from '../../store';
29
+ import {
30
+ NAVIGATION_POST_TYPE,
31
+ PATTERN_POST_TYPE,
32
+ TEMPLATE_PART_POST_TYPE,
33
+ TEMPLATE_POST_TYPE,
34
+ } from '../../store/constants';
35
+ import TemplateAreas from '../template-areas';
36
+
37
+ /**
38
+ * Module Constants
39
+ */
40
+ const PANEL_NAME = 'post-status';
41
+
42
+ export default function PostSummary( { onActionPerformed } ) {
43
+ const { isRemovedPostStatusPanel, postType } = useSelect( ( select ) => {
44
+ // We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
45
+ // not use isEditorPanelEnabled since this panel should not be disabled through the UI.
46
+ const { isEditorPanelRemoved, getCurrentPostType } =
47
+ select( editorStore );
48
+ return {
49
+ isRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),
50
+ postType: getCurrentPostType(),
51
+ };
52
+ }, [] );
53
+ const isPattern = postType === PATTERN_POST_TYPE;
54
+ const isTemplate = postType === TEMPLATE_POST_TYPE;
55
+ const isTemplatePart = postType === TEMPLATE_PART_POST_TYPE;
56
+ const isNavigation = postType === NAVIGATION_POST_TYPE;
57
+
58
+ return (
59
+ <PostPanelSection className="editor-post-summary">
60
+ <PluginPostStatusInfo.Slot>
61
+ { ( fills ) => (
62
+ <>
63
+ <VStack spacing={ 4 }>
64
+ <PostCardPanel
65
+ actions={
66
+ <PostActions
67
+ onActionPerformed={ onActionPerformed }
68
+ />
69
+ }
70
+ />
71
+ <PostFeaturedImagePanel withPanelBody={ false } />
72
+ <PostExcerptPanel />
73
+ <VStack spacing={ 1 }>
74
+ <PostContentInformation />
75
+ <PostLastEditedPanel />
76
+ </VStack>
77
+ { ! isRemovedPostStatusPanel && (
78
+ <VStack spacing={ 2 }>
79
+ <VStack spacing={ 1 }>
80
+ <PostStatusPanel />
81
+ <PostSchedulePanel />
82
+ <PostTemplatePanel />
83
+ <PostURLPanel />
84
+ <PostDiscussionPanel />
85
+ <PostSyncStatus />
86
+ </VStack>
87
+ <PostStickyPanel />
88
+ <PostFormatPanel />
89
+ <PostAuthorPanel />
90
+ { isTemplate && <TemplateAreas /> }
91
+ { fills }
92
+ { ! isPattern &&
93
+ ! isTemplate &&
94
+ ! isTemplatePart &&
95
+ ! isNavigation && <PostTrashPanel /> }
96
+ </VStack>
97
+ ) }
98
+ </VStack>
99
+ </>
100
+ ) }
101
+ </PluginPostStatusInfo.Slot>
102
+ </PostPanelSection>
103
+ );
104
+ }
@@ -0,0 +1,18 @@
1
+ .components-panel__header.editor-sidebar__panel-tabs {
2
+ padding-left: 0;
3
+ padding-right: $grid-unit-20;
4
+
5
+ .components-button.has-icon {
6
+ padding: 0;
7
+ min-width: $icon-size;
8
+ height: $icon-size;
9
+
10
+ @include break-medium() {
11
+ display: flex;
12
+ }
13
+ }
14
+ }
15
+
16
+ .editor-post-summary .components-v-stack:empty {
17
+ display: none;
18
+ }
@@ -11,11 +11,13 @@ import {
11
11
  import { useSelect, useDispatch } from '@wordpress/data';
12
12
  import { useAsyncList } from '@wordpress/compose';
13
13
  import { store as coreStore } from '@wordpress/core-data';
14
+ import { __unstableSerializeAndClean } from '@wordpress/blocks';
14
15
 
15
16
  /**
16
17
  * Internal dependencies
17
18
  */
18
19
  import { store as editorStore } from '../../store';
20
+ import { TEMPLATE_POST_TYPE } from '../../store/constants';
19
21
 
20
22
  function useStartPatterns() {
21
23
  // A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
@@ -71,7 +73,11 @@ function PatternSelection( { blockPatterns, onChoosePattern } ) {
71
73
  blockPatterns={ blockPatterns }
72
74
  shownPatterns={ shownBlockPatterns }
73
75
  onClickPattern={ ( _pattern, blocks ) => {
74
- editEntityRecord( 'postType', postType, postId, { blocks } );
76
+ editEntityRecord( 'postType', postType, postId, {
77
+ blocks,
78
+ content: ( { blocks: blocksForSerialization = [] } ) =>
79
+ __unstableSerializeAndClean( blocksForSerialization ),
80
+ } );
75
81
  onChoosePattern();
76
82
  } }
77
83
  />
@@ -110,14 +116,15 @@ export default function StartPageOptions() {
110
116
  isEditedPostEmpty,
111
117
  getCurrentPostType,
112
118
  getCurrentPostId,
113
- getEditorSettings,
114
119
  } = select( editorStore );
115
- const { __unstableIsPreviewMode: isPreviewMode } = getEditorSettings();
120
+ const _postType = getCurrentPostType();
116
121
 
117
122
  return {
118
123
  shouldEnableModal:
119
- ! isPreviewMode && ! isEditedPostDirty() && isEditedPostEmpty(),
120
- postType: getCurrentPostType(),
124
+ ! isEditedPostDirty() &&
125
+ isEditedPostEmpty() &&
126
+ TEMPLATE_POST_TYPE !== _postType,
127
+ postType: _postType,
121
128
  postId: getCurrentPostId(),
122
129
  };
123
130
  }, [] );