@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/editor",
3
- "version": "13.33.0",
3
+ "version": "13.35.0",
4
4
  "description": "Enhanced block editor for WordPress posts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,41 +31,43 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.16.0",
34
- "@wordpress/a11y": "^3.56.0",
35
- "@wordpress/api-fetch": "^6.53.0",
36
- "@wordpress/blob": "^3.56.0",
37
- "@wordpress/block-editor": "^12.24.0",
38
- "@wordpress/blocks": "^12.33.0",
39
- "@wordpress/commands": "^0.27.0",
40
- "@wordpress/components": "^27.4.0",
41
- "@wordpress/compose": "^6.33.0",
42
- "@wordpress/core-data": "^6.33.0",
43
- "@wordpress/data": "^9.26.0",
44
- "@wordpress/date": "^4.56.0",
45
- "@wordpress/deprecated": "^3.56.0",
46
- "@wordpress/dom": "^3.56.0",
47
- "@wordpress/element": "^5.33.0",
48
- "@wordpress/hooks": "^3.56.0",
49
- "@wordpress/html-entities": "^3.56.0",
50
- "@wordpress/i18n": "^4.56.0",
51
- "@wordpress/icons": "^9.47.0",
52
- "@wordpress/interface": "^5.33.0",
53
- "@wordpress/keyboard-shortcuts": "^4.33.0",
54
- "@wordpress/keycodes": "^3.56.0",
55
- "@wordpress/media-utils": "^4.47.0",
56
- "@wordpress/notices": "^4.24.0",
57
- "@wordpress/patterns": "^1.17.0",
58
- "@wordpress/plugins": "^6.24.0",
59
- "@wordpress/preferences": "^3.33.0",
60
- "@wordpress/private-apis": "^0.38.0",
61
- "@wordpress/reusable-blocks": "^4.33.0",
62
- "@wordpress/rich-text": "^6.33.0",
63
- "@wordpress/server-side-render": "^4.33.0",
64
- "@wordpress/url": "^3.57.0",
65
- "@wordpress/warning": "^2.56.0",
66
- "@wordpress/wordcount": "^3.56.0",
67
- "classnames": "^2.3.1",
34
+ "@wordpress/a11y": "^3.58.0",
35
+ "@wordpress/api-fetch": "^6.55.0",
36
+ "@wordpress/blob": "^3.58.0",
37
+ "@wordpress/block-editor": "^12.26.0",
38
+ "@wordpress/blocks": "^12.35.0",
39
+ "@wordpress/commands": "^0.29.0",
40
+ "@wordpress/components": "^27.6.0",
41
+ "@wordpress/compose": "^6.35.0",
42
+ "@wordpress/core-data": "^6.35.0",
43
+ "@wordpress/data": "^9.28.0",
44
+ "@wordpress/date": "^4.58.0",
45
+ "@wordpress/deprecated": "^3.58.0",
46
+ "@wordpress/dom": "^3.58.0",
47
+ "@wordpress/element": "^5.35.0",
48
+ "@wordpress/hooks": "^3.58.0",
49
+ "@wordpress/html-entities": "^3.58.0",
50
+ "@wordpress/i18n": "^4.58.0",
51
+ "@wordpress/icons": "^9.49.0",
52
+ "@wordpress/interface": "^5.35.0",
53
+ "@wordpress/keyboard-shortcuts": "^4.35.0",
54
+ "@wordpress/keycodes": "^3.58.0",
55
+ "@wordpress/media-utils": "^4.49.0",
56
+ "@wordpress/notices": "^4.26.0",
57
+ "@wordpress/patterns": "^1.19.0",
58
+ "@wordpress/plugins": "^6.26.0",
59
+ "@wordpress/preferences": "^3.35.0",
60
+ "@wordpress/private-apis": "^0.40.0",
61
+ "@wordpress/reusable-blocks": "^4.35.0",
62
+ "@wordpress/rich-text": "^6.35.0",
63
+ "@wordpress/server-side-render": "^4.35.0",
64
+ "@wordpress/url": "^3.59.0",
65
+ "@wordpress/warning": "^2.58.0",
66
+ "@wordpress/wordcount": "^3.58.0",
67
+ "clsx": "^2.1.1",
68
68
  "date-fns": "^3.6.0",
69
+ "deepmerge": "^4.3.0",
70
+ "is-plain-object": "^5.0.0",
69
71
  "memize": "^2.1.0",
70
72
  "react-autosize-textarea": "^7.1.0",
71
73
  "remove-accents": "^0.5.0"
@@ -77,5 +79,5 @@
77
79
  "publishConfig": {
78
80
  "access": "public"
79
81
  },
80
- "gitHead": "280403b4c1cf6cc2c55a6c4d56f9ef91145e4191"
82
+ "gitHead": "42f38f287506a6b3ed8ccba839b18ad066821044"
81
83
  }
@@ -2,10 +2,92 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { _x } from '@wordpress/i18n';
5
+ import { store as blockEditorStore } from '@wordpress/block-editor';
6
+
7
+ const CONTENT = 'content';
5
8
 
6
9
  export default {
7
10
  name: 'core/pattern-overrides',
8
11
  label: _x( 'Pattern Overrides', 'block bindings source' ),
9
- useSource: null,
12
+ getValue( { registry, clientId, attributeName } ) {
13
+ const { getBlockAttributes, getBlockParentsByBlockName } =
14
+ registry.select( blockEditorStore );
15
+ const currentBlockAttributes = getBlockAttributes( clientId );
16
+ const [ patternClientId ] = getBlockParentsByBlockName(
17
+ clientId,
18
+ 'core/block',
19
+ true
20
+ );
21
+
22
+ const overridableValue =
23
+ getBlockAttributes( patternClientId )?.[ CONTENT ]?.[
24
+ currentBlockAttributes?.metadata?.name
25
+ ]?.[ attributeName ];
26
+
27
+ // If there is no pattern client ID, or it is not overwritten, return the default value.
28
+ if ( ! patternClientId || overridableValue === undefined ) {
29
+ return currentBlockAttributes[ attributeName ];
30
+ }
31
+
32
+ return overridableValue === '' ? undefined : overridableValue;
33
+ },
34
+ setValues( { registry, clientId, attributes } ) {
35
+ const { getBlockAttributes, getBlockParentsByBlockName, getBlocks } =
36
+ registry.select( blockEditorStore );
37
+ const currentBlockAttributes = getBlockAttributes( clientId );
38
+ const blockName = currentBlockAttributes?.metadata?.name;
39
+ if ( ! blockName ) {
40
+ return;
41
+ }
42
+
43
+ const [ patternClientId ] = getBlockParentsByBlockName(
44
+ clientId,
45
+ 'core/block',
46
+ true
47
+ );
48
+
49
+ // If there is no pattern client ID, sync blocks with the same name and same attributes.
50
+ if ( ! patternClientId ) {
51
+ const syncBlocksWithSameName = ( blocks ) => {
52
+ for ( const block of blocks ) {
53
+ if ( block.attributes?.metadata?.name === blockName ) {
54
+ registry
55
+ .dispatch( blockEditorStore )
56
+ .updateBlockAttributes(
57
+ block.clientId,
58
+ attributes
59
+ );
60
+ }
61
+ syncBlocksWithSameName( block.innerBlocks );
62
+ }
63
+ };
64
+
65
+ syncBlocksWithSameName( getBlocks() );
66
+ return;
67
+ }
68
+ const currentBindingValue =
69
+ getBlockAttributes( patternClientId )?.[ CONTENT ];
70
+ registry
71
+ .dispatch( blockEditorStore )
72
+ .updateBlockAttributes( patternClientId, {
73
+ [ CONTENT ]: {
74
+ ...currentBindingValue,
75
+ [ blockName ]: {
76
+ ...currentBindingValue?.[ blockName ],
77
+ ...Object.entries( attributes ).reduce(
78
+ ( acc, [ key, value ] ) => {
79
+ // TODO: We need a way to represent `undefined` in the serialized overrides.
80
+ // Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871
81
+ // We use an empty string to represent undefined for now until
82
+ // we support a richer format for overrides and the block bindings API.
83
+ acc[ key ] = value === undefined ? '' : value;
84
+ return acc;
85
+ },
86
+ {}
87
+ ),
88
+ },
89
+ },
90
+ } );
91
+ },
10
92
  lockAttributesEditing: false,
11
93
  };
@@ -1,8 +1,7 @@
1
1
  .editor-autocompleters__user {
2
2
  .editor-autocompleters__no-avatar::before {
3
- /* stylelint-disable */
3
+ /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword -- dashicons don't need a generic family keyword. */
4
4
  font: normal 20px/1 dashicons;
5
- /* stylelint-enable */
6
5
  content: "\f110";
7
6
  margin-right: 5px;
8
7
  vertical-align: middle;
@@ -11,17 +11,6 @@ import { store as coreStore } from '@wordpress/core-data';
11
11
  */
12
12
  import { store as editorStore } from '../../store';
13
13
 
14
- /**
15
- * AutosaveMonitor invokes `props.autosave()` within at most `interval` seconds after an unsaved change is detected.
16
- *
17
- * The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.
18
- * The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as
19
- * the specific way of detecting changes.
20
- *
21
- * There are two caveats:
22
- * * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.
23
- * * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.
24
- */
25
14
  export class AutosaveMonitor extends Component {
26
15
  constructor( props ) {
27
16
  super( props );
@@ -92,9 +81,23 @@ export class AutosaveMonitor extends Component {
92
81
  }
93
82
 
94
83
  /**
95
- * AutosaveMonitor component.
96
84
  * Monitors the changes made to the edited post and triggers autosave if necessary.
97
85
  *
86
+ * The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.
87
+ * The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as
88
+ * the specific way of detecting changes.
89
+ *
90
+ * There are two caveats:
91
+ * * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.
92
+ * * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.
93
+ *
94
+ * @param {Object} props - The properties passed to the component.
95
+ * @param {Function} props.autosave - The function to call when changes need to be saved.
96
+ * @param {number} props.interval - The maximum time in seconds between an unsaved change and an autosave.
97
+ * @param {boolean} props.isAutosaveable - If false, the check for changes is retried every second.
98
+ * @param {boolean} props.disableIntervalChecks - If true, disables the timer and any change will immediately trigger `props.autosave()`.
99
+ * @param {boolean} props.isDirty - Indicates if there are unsaved changes.
100
+ *
98
101
  * @example
99
102
  * ```jsx
100
103
  * <AutosaveMonitor interval={30000} />
@@ -0,0 +1,175 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ BlockSettingsMenuControls,
6
+ __unstableBlockSettingsMenuFirstItem as BlockSettingsMenuFirstItem,
7
+ store as blockEditorStore,
8
+ useBlockDisplayInformation,
9
+ } from '@wordpress/block-editor';
10
+ import { store as coreStore } from '@wordpress/core-data';
11
+ import { __experimentalText as Text, MenuItem } from '@wordpress/components';
12
+ import { useSelect, useDispatch } from '@wordpress/data';
13
+ import { __ } from '@wordpress/i18n';
14
+
15
+ /**
16
+ * Internal dependencies
17
+ */
18
+ import { store as editorStore } from '../../store';
19
+ import { unlock } from '../../lock-unlock';
20
+
21
+ function ContentOnlySettingsMenuItems( { clientId, onClose } ) {
22
+ const { entity, onNavigateToEntityRecord } = useSelect(
23
+ ( select ) => {
24
+ const {
25
+ getBlockEditingMode,
26
+ getBlockParentsByBlockName,
27
+ getSettings,
28
+ getBlockAttributes,
29
+ } = select( blockEditorStore );
30
+ const contentOnly =
31
+ getBlockEditingMode( clientId ) === 'contentOnly';
32
+ if ( ! contentOnly ) {
33
+ return {};
34
+ }
35
+ const patternParent = getBlockParentsByBlockName(
36
+ clientId,
37
+ 'core/block',
38
+ true
39
+ )[ 0 ];
40
+
41
+ let record;
42
+ if ( patternParent ) {
43
+ record = select( coreStore ).getEntityRecord(
44
+ 'postType',
45
+ 'wp_block',
46
+ getBlockAttributes( patternParent ).ref
47
+ );
48
+ } else {
49
+ const { getCurrentPostType, getCurrentTemplateId } =
50
+ select( editorStore );
51
+ const currentPostType = getCurrentPostType();
52
+ const templateId = getCurrentTemplateId();
53
+ if ( currentPostType === 'page' && templateId ) {
54
+ record = select( coreStore ).getEntityRecord(
55
+ 'postType',
56
+ 'wp_template',
57
+ templateId
58
+ );
59
+ }
60
+ }
61
+ return {
62
+ entity: record,
63
+ onNavigateToEntityRecord:
64
+ getSettings().onNavigateToEntityRecord,
65
+ };
66
+ },
67
+ [ clientId ]
68
+ );
69
+
70
+ if ( ! entity ) {
71
+ return (
72
+ <TemplateLockContentOnlyMenuItems
73
+ clientId={ clientId }
74
+ onClose={ onClose }
75
+ />
76
+ );
77
+ }
78
+
79
+ const isPattern = entity.type === 'wp_block';
80
+
81
+ return (
82
+ <>
83
+ <BlockSettingsMenuFirstItem>
84
+ <MenuItem
85
+ onClick={ () => {
86
+ onNavigateToEntityRecord( {
87
+ postId: entity.id,
88
+ postType: entity.type,
89
+ } );
90
+ } }
91
+ >
92
+ { isPattern ? __( 'Edit pattern' ) : __( 'Edit template' ) }
93
+ </MenuItem>
94
+ </BlockSettingsMenuFirstItem>
95
+ <Text
96
+ variant="muted"
97
+ as="p"
98
+ className="editor-content-only-settings-menu__description"
99
+ >
100
+ { isPattern
101
+ ? __(
102
+ 'Edit the pattern to move, delete, or make further changes to this block.'
103
+ )
104
+ : __(
105
+ 'Edit the template to move, delete, or make further changes to this block.'
106
+ ) }
107
+ </Text>
108
+ </>
109
+ );
110
+ }
111
+
112
+ function TemplateLockContentOnlyMenuItems( { clientId, onClose } ) {
113
+ const { contentLockingParent } = useSelect(
114
+ ( select ) => {
115
+ const { getContentLockingParent } = unlock(
116
+ select( blockEditorStore )
117
+ );
118
+ return {
119
+ contentLockingParent: getContentLockingParent( clientId ),
120
+ };
121
+ },
122
+ [ clientId ]
123
+ );
124
+ const blockDisplayInformation =
125
+ useBlockDisplayInformation( contentLockingParent );
126
+ // Disable reason: We're using a hook here so it has to be on top-level.
127
+ // eslint-disable-next-line @wordpress/no-unused-vars-before-return
128
+ const { modifyContentLockBlock, selectBlock } = unlock(
129
+ useDispatch( blockEditorStore )
130
+ );
131
+
132
+ if ( ! blockDisplayInformation?.title ) {
133
+ return null;
134
+ }
135
+
136
+ return (
137
+ <>
138
+ <BlockSettingsMenuFirstItem>
139
+ <MenuItem
140
+ onClick={ () => {
141
+ selectBlock( contentLockingParent );
142
+ modifyContentLockBlock( contentLockingParent );
143
+ onClose();
144
+ } }
145
+ >
146
+ { __( 'Unlock' ) }
147
+ </MenuItem>
148
+ </BlockSettingsMenuFirstItem>
149
+ <Text
150
+ variant="muted"
151
+ as="p"
152
+ className="editor-content-only-settings-menu__description"
153
+ >
154
+ { __(
155
+ 'Temporarily unlock the parent block to edit, delete or make further changes to this block.'
156
+ ) }
157
+ </Text>
158
+ </>
159
+ );
160
+ }
161
+
162
+ export default function ContentOnlySettingsMenu() {
163
+ return (
164
+ <BlockSettingsMenuControls>
165
+ { ( { selectedClientIds, onClose } ) =>
166
+ selectedClientIds.length === 1 && (
167
+ <ContentOnlySettingsMenuItems
168
+ clientId={ selectedClientIds[ 0 ] }
169
+ onClose={ onClose }
170
+ />
171
+ )
172
+ }
173
+ </BlockSettingsMenuControls>
174
+ );
175
+ }
@@ -0,0 +1,4 @@
1
+ // Render nothing in native for now.
2
+ export default function ContentOnlySettingsMenu() {
3
+ return null;
4
+ }
@@ -0,0 +1,4 @@
1
+ .editor-content-only-settings-menu__description {
2
+ padding: $grid-unit;
3
+ min-width: 235px;
4
+ }
@@ -9,6 +9,11 @@ import { count as characterCount } from '@wordpress/wordcount';
9
9
  */
10
10
  import { store as editorStore } from '../../store';
11
11
 
12
+ /**
13
+ * Renders the character count of the post content.
14
+ *
15
+ * @return {number} The character count.
16
+ */
12
17
  export default function CharacterCount() {
13
18
  const content = useSelect(
14
19
  ( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),
@@ -0,0 +1,77 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import {
10
+ BlockToolbar,
11
+ store as blockEditorStore,
12
+ privateApis as blockEditorPrivateApis,
13
+ } from '@wordpress/block-editor';
14
+ import { useEffect } from '@wordpress/element';
15
+ import { Button, Popover } from '@wordpress/components';
16
+ import { __ } from '@wordpress/i18n';
17
+ import { next, previous } from '@wordpress/icons';
18
+ import { useSelect } from '@wordpress/data';
19
+
20
+ /**
21
+ * Internal dependencies
22
+ */
23
+ import { unlock } from '../../lock-unlock';
24
+
25
+ const { useHasBlockToolbar } = unlock( blockEditorPrivateApis );
26
+
27
+ function CollapsableBlockToolbar( { isCollapsed, onToggle } ) {
28
+ const { blockSelectionStart } = useSelect( ( select ) => {
29
+ return {
30
+ blockSelectionStart:
31
+ select( blockEditorStore ).getBlockSelectionStart(),
32
+ };
33
+ }, [] );
34
+ const hasBlockToolbar = useHasBlockToolbar();
35
+
36
+ const hasBlockSelection = !! blockSelectionStart;
37
+
38
+ useEffect( () => {
39
+ // If we have a new block selection, show the block tools
40
+ if ( blockSelectionStart ) {
41
+ onToggle( false );
42
+ }
43
+ }, [ blockSelectionStart, onToggle ] );
44
+
45
+ if ( ! hasBlockToolbar ) {
46
+ return null;
47
+ }
48
+
49
+ return (
50
+ <>
51
+ <div
52
+ className={ clsx( 'editor-collapsible-block-toolbar', {
53
+ 'is-collapsed': isCollapsed || ! hasBlockSelection,
54
+ } ) }
55
+ >
56
+ <BlockToolbar hideDragHandle />
57
+ </div>
58
+ <Popover.Slot name="block-toolbar" />
59
+
60
+ <Button
61
+ className="editor-collapsible-block-toolbar__toggle"
62
+ icon={ isCollapsed ? next : previous }
63
+ onClick={ () => {
64
+ onToggle( ! isCollapsed );
65
+ } }
66
+ label={
67
+ isCollapsed
68
+ ? __( 'Show block tools' )
69
+ : __( 'Hide block tools' )
70
+ }
71
+ size="compact"
72
+ />
73
+ </>
74
+ );
75
+ }
76
+
77
+ export default CollapsableBlockToolbar;
@@ -0,0 +1,80 @@
1
+ .editor-collapsible-block-toolbar {
2
+ overflow: hidden;
3
+ display: flex;
4
+ align-items: center;
5
+ height: $header-height;
6
+
7
+ .block-editor-block-contextual-toolbar {
8
+ border-bottom: 0;
9
+ height: 100%;
10
+ }
11
+
12
+ // These rules ensure that icons are always positioned in a way that lines up with the rest of the icons in the toolbar.
13
+ .block-editor-block-toolbar {
14
+ height: 100%;
15
+ // Push down so that buttons are centered vertically.
16
+ // It should be 14px (60px header height - 32px compact button height = 28 / 2),
17
+ // but there is a -1px top-margin down the stack that affects this.
18
+ padding-top: math.div($header-height - $button-size-compact, 2) + 1;
19
+
20
+ // Match the height of other buttons in the header toolbar.
21
+ .components-button:not(.block-editor-block-mover-button) {
22
+ height: $button-size-compact;
23
+ }
24
+ }
25
+
26
+ &::after {
27
+ content: "";
28
+ width: $border-width;
29
+ height: $grid-unit-30;
30
+ background-color: $gray-300;
31
+ margin-right: $grid-unit - $border-width;
32
+ }
33
+
34
+ // Modified group borders.
35
+ .components-toolbar-group,
36
+ .components-toolbar {
37
+ border-right: none;
38
+ position: relative;
39
+
40
+ &::after {
41
+ content: "";
42
+ width: $border-width;
43
+ height: $grid-unit-30;
44
+ background-color: $gray-300;
45
+ top: $grid-unit-05;
46
+ position: absolute;
47
+ right: -$border-width;
48
+ }
49
+
50
+ & .components-toolbar-group.components-toolbar-group {
51
+ &::after {
52
+ display: none;
53
+ }
54
+ }
55
+ }
56
+
57
+ .block-editor-block-mover {
58
+ // Match the height of other buttons in the header toolbar.
59
+ &.is-horizontal .block-editor-block-mover-button {
60
+ height: $button-size-compact;
61
+ overflow: visible;
62
+ }
63
+
64
+ // Move up a little to prevent the toolbar shift when focus is on the vertical movers.
65
+ @include break-small() {
66
+ &:not(.is-horizontal) .block-editor-block-mover__move-button-container {
67
+ position: relative;
68
+ top: -10px;
69
+ }
70
+ }
71
+ }
72
+
73
+ &.is-collapsed {
74
+ display: none;
75
+ }
76
+ }
77
+
78
+ .editor-collapsible-block-toolbar__toggle {
79
+ margin-left: 2px; // Allow focus ring to be fully visible
80
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import classnames from 'classnames';
4
+ import clsx from 'clsx';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -111,7 +111,7 @@ export default function DocumentBar() {
111
111
 
112
112
  return (
113
113
  <div
114
- className={ classnames( 'editor-document-bar', {
114
+ className={ clsx( 'editor-document-bar', {
115
115
  'has-back-button': hasBackButton,
116
116
  'is-global': isGlobalEntity,
117
117
  } ) }
@@ -4,6 +4,14 @@
4
4
  import { useSelect } from '@wordpress/data';
5
5
  import { store as blockEditorStore } from '@wordpress/block-editor';
6
6
 
7
+ /**
8
+ * Component check if there are any headings (core/heading blocks) present in the document.
9
+ *
10
+ * @param {Object} props Props.
11
+ * @param {Element} props.children Children to be rendered.
12
+ *
13
+ * @return {Component|null} The component to be rendered or null if there are headings.
14
+ */
7
15
  export default function DocumentOutlineCheck( { children } ) {
8
16
  const hasHeadings = useSelect( ( select ) => {
9
17
  const { getGlobalBlockCount } = select( blockEditorStore );
@@ -98,6 +98,16 @@ const isEmptyHeading = ( heading ) =>
98
98
  ! heading.attributes.content ||
99
99
  heading.attributes.content.trim().length === 0;
100
100
 
101
+ /**
102
+ * Renders a document outline component.
103
+ *
104
+ * @param {Object} props Props.
105
+ * @param {Function} props.onSelect Function to be called when an outline item is selected.
106
+ * @param {boolean} props.isTitleSupported Indicates whether the title is supported.
107
+ * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.
108
+ *
109
+ * @return {Component} The component to be rendered.
110
+ */
101
111
  export default function DocumentOutline( {
102
112
  onSelect,
103
113
  isTitleSupported,
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import classnames from 'classnames';
4
+ import clsx from 'clsx';
5
5
 
6
6
  const TableOfContentsItem = ( {
7
7
  children,
@@ -11,7 +11,7 @@ const TableOfContentsItem = ( {
11
11
  onSelect,
12
12
  } ) => (
13
13
  <li
14
- className={ classnames(
14
+ className={ clsx(
15
15
  'document-outline__item',
16
16
  `is-${ level.toLowerCase() }`,
17
17
  {