@wordpress/editor 13.32.0 → 13.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (589) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +225 -2
  3. package/build/bindings/index.js.map +1 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/bindings/post-meta.js +12 -30
  6. package/build/bindings/post-meta.js.map +1 -1
  7. package/build/components/autocompleters/index.js.map +1 -1
  8. package/build/components/autocompleters/user.js.map +1 -1
  9. package/build/components/autosave-monitor/index.js +10 -0
  10. package/build/components/autosave-monitor/index.js.map +1 -1
  11. package/build/components/block-manager/category.js.map +1 -1
  12. package/build/components/block-manager/checklist.js.map +1 -1
  13. package/build/components/block-manager/index.js.map +1 -1
  14. package/build/components/block-removal-warnings/index.js.map +1 -1
  15. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  16. package/build/components/character-count/index.js.map +1 -1
  17. package/build/components/commands/index.js +19 -0
  18. package/build/components/commands/index.js.map +1 -1
  19. package/build/components/commands/index.native.js.map +1 -1
  20. package/build/components/deprecated.js.map +1 -1
  21. package/build/components/deprecated.native.js.map +1 -1
  22. package/build/components/document-bar/index.js.map +1 -1
  23. package/build/components/document-outline/check.js.map +1 -1
  24. package/build/components/document-outline/index.js.map +1 -1
  25. package/build/components/document-outline/item.js.map +1 -1
  26. package/build/components/document-tools/index.js +1 -1
  27. package/build/components/document-tools/index.js.map +1 -1
  28. package/build/components/editor-canvas/edit-template-blocks-notification.js +13 -2
  29. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  30. package/build/components/editor-canvas/index.js +2 -2
  31. package/build/components/editor-canvas/index.js.map +1 -1
  32. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  33. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  34. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  35. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  36. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  37. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  38. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  39. package/build/components/editor-help/index.native.js.map +1 -1
  40. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  41. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  43. package/build/components/editor-help/view-sections.native.js.map +1 -1
  44. package/build/components/editor-history/redo.js.map +1 -1
  45. package/build/components/editor-history/undo.js.map +1 -1
  46. package/build/components/editor-notices/index.js.map +1 -1
  47. package/build/components/editor-snackbars/index.js.map +1 -1
  48. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  49. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  50. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  51. package/build/components/entities-saved-states/index.js.map +1 -1
  52. package/build/components/error-boundary/index.js.map +1 -1
  53. package/build/components/error-boundary/index.native.js.map +1 -1
  54. package/build/components/global-keyboard-shortcuts/index.js +24 -0
  55. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  56. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  57. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  58. package/build/components/index.js +33 -1
  59. package/build/components/index.js.map +1 -1
  60. package/build/components/index.native.js.map +1 -1
  61. package/build/components/inserter-sidebar/index.js.map +1 -1
  62. package/build/components/keyboard-shortcut-help-modal/config.js +78 -0
  63. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  64. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
  65. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  66. package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
  67. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  68. package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
  69. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  70. package/build/components/list-view-sidebar/index.js.map +1 -1
  71. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  72. package/build/components/local-autosave-monitor/index.js.map +1 -1
  73. package/build/components/media-categories/index.js.map +1 -1
  74. package/build/components/mode-switcher/index.js.map +1 -1
  75. package/build/components/offline-status/index.native.js.map +1 -1
  76. package/build/components/page-attributes/check.js.map +1 -1
  77. package/build/components/page-attributes/order.js.map +1 -1
  78. package/build/components/page-attributes/panel.js.map +1 -1
  79. package/build/components/page-attributes/parent.js.map +1 -1
  80. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  81. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  82. package/build/components/plugin-more-menu-item/index.js +78 -0
  83. package/build/components/plugin-more-menu-item/index.js.map +1 -0
  84. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  85. package/build/components/plugin-post-status-info/index.js +73 -0
  86. package/build/components/plugin-post-status-info/index.js.map +1 -0
  87. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  88. package/build/components/plugin-sidebar/index.js +108 -0
  89. package/build/components/plugin-sidebar/index.js.map +1 -0
  90. package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
  91. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  92. package/build/components/post-actions/actions.js +218 -17
  93. package/build/components/post-actions/actions.js.map +1 -1
  94. package/build/components/post-actions/index.js +137 -0
  95. package/build/components/post-actions/index.js.map +1 -0
  96. package/build/components/post-author/check.js.map +1 -1
  97. package/build/components/post-author/combobox.js.map +1 -1
  98. package/build/components/post-author/constants.js.map +1 -1
  99. package/build/components/post-author/hook.js.map +1 -1
  100. package/build/components/post-author/index.js.map +1 -1
  101. package/build/components/post-author/panel.js.map +1 -1
  102. package/build/components/post-author/select.js.map +1 -1
  103. package/build/components/post-card-panel/index.js +40 -6
  104. package/build/components/post-card-panel/index.js.map +1 -1
  105. package/build/components/post-comments/index.js.map +1 -1
  106. package/build/components/post-discussion/panel.js.map +1 -1
  107. package/build/components/post-excerpt/check.js +8 -0
  108. package/build/components/post-excerpt/check.js.map +1 -1
  109. package/build/components/post-excerpt/index.js.map +1 -1
  110. package/build/components/post-excerpt/panel.js.map +1 -1
  111. package/build/components/post-excerpt/plugin.js.map +1 -1
  112. package/build/components/post-featured-image/check.js.map +1 -1
  113. package/build/components/post-featured-image/index.js.map +1 -1
  114. package/build/components/post-featured-image/panel.js.map +1 -1
  115. package/build/components/post-format/check.js.map +1 -1
  116. package/build/components/post-format/index.js.map +1 -1
  117. package/build/components/post-last-revision/check.js.map +1 -1
  118. package/build/components/post-last-revision/index.js.map +1 -1
  119. package/build/components/post-last-revision/panel.js.map +1 -1
  120. package/build/components/post-locked-modal/index.js.map +1 -1
  121. package/build/components/post-panel-row/index.js.map +1 -1
  122. package/build/components/post-pending-status/check.js.map +1 -1
  123. package/build/components/post-pending-status/index.js.map +1 -1
  124. package/build/components/post-pingbacks/index.js.map +1 -1
  125. package/build/components/post-preview-button/index.js.map +1 -1
  126. package/build/components/post-publish-button/index.js +31 -31
  127. package/build/components/post-publish-button/index.js.map +1 -1
  128. package/build/components/post-publish-button/label.js +51 -43
  129. package/build/components/post-publish-button/label.js.map +1 -1
  130. package/build/components/post-publish-panel/index.js.map +1 -1
  131. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  132. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  133. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  134. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  135. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  136. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  137. package/build/components/post-saved-state/index.js +10 -6
  138. package/build/components/post-saved-state/index.js.map +1 -1
  139. package/build/components/post-schedule/check.js.map +1 -1
  140. package/build/components/post-schedule/index.js.map +1 -1
  141. package/build/components/post-schedule/label.js.map +1 -1
  142. package/build/components/post-schedule/panel.js +8 -0
  143. package/build/components/post-schedule/panel.js.map +1 -1
  144. package/build/components/post-slug/check.js.map +1 -1
  145. package/build/components/post-slug/index.js +43 -68
  146. package/build/components/post-slug/index.js.map +1 -1
  147. package/build/components/post-status/index.js +239 -0
  148. package/build/components/post-status/index.js.map +1 -0
  149. package/build/components/post-sticky/check.js.map +1 -1
  150. package/build/components/post-sticky/index.js.map +1 -1
  151. package/build/components/post-switch-to-draft-button/index.js +6 -1
  152. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  153. package/build/components/post-sync-status/index.js.map +1 -1
  154. package/build/components/post-taxonomies/check.js.map +1 -1
  155. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  156. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  157. package/build/components/post-taxonomies/index.js.map +1 -1
  158. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  159. package/build/components/post-taxonomies/panel.js.map +1 -1
  160. package/build/components/post-template/block-theme.js +6 -2
  161. package/build/components/post-template/block-theme.js.map +1 -1
  162. package/build/components/post-template/classic-theme.js.map +1 -1
  163. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  164. package/build/components/post-template/create-new-template.js.map +1 -1
  165. package/build/components/post-template/hooks.js.map +1 -1
  166. package/build/components/post-template/panel.js.map +1 -1
  167. package/build/components/post-template/reset-default-template.js.map +1 -1
  168. package/build/components/post-template/swap-template-button.js.map +1 -1
  169. package/build/components/post-text-editor/index.js.map +1 -1
  170. package/build/components/post-title/constants.js.map +1 -1
  171. package/build/components/post-title/index.js.map +1 -1
  172. package/build/components/post-title/index.native.js.map +1 -1
  173. package/build/components/post-title/post-title-raw.js.map +1 -1
  174. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  175. package/build/components/post-title/use-post-title.js.map +1 -1
  176. package/build/components/post-trash/check.js +23 -25
  177. package/build/components/post-trash/check.js.map +1 -1
  178. package/build/components/post-trash/index.js +2 -1
  179. package/build/components/post-trash/index.js.map +1 -1
  180. package/build/components/post-type-support-check/index.js.map +1 -1
  181. package/build/components/post-url/check.js.map +1 -1
  182. package/build/components/post-url/index.js +44 -19
  183. package/build/components/post-url/index.js.map +1 -1
  184. package/build/components/post-url/label.js.map +1 -1
  185. package/build/components/post-url/panel.js +14 -7
  186. package/build/components/post-url/panel.js.map +1 -1
  187. package/build/components/post-view-link/index.js.map +1 -1
  188. package/build/components/post-visibility/check.js.map +1 -1
  189. package/build/components/post-visibility/index.js +2 -1
  190. package/build/components/post-visibility/index.js.map +1 -1
  191. package/build/components/post-visibility/label.js.map +1 -1
  192. package/build/components/post-visibility/utils.js.map +1 -1
  193. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  194. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  195. package/build/components/preferences-modal/index.js +19 -17
  196. package/build/components/preferences-modal/index.js.map +1 -1
  197. package/build/components/preview-dropdown/index.js.map +1 -1
  198. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  199. package/build/components/provider/index.js +4 -2
  200. package/build/components/provider/index.js.map +1 -1
  201. package/build/components/provider/index.native.js +6 -1
  202. package/build/components/provider/index.native.js.map +1 -1
  203. package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
  204. package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
  205. package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  206. package/build/components/provider/use-block-editor-settings.js +64 -43
  207. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  208. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  209. package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  210. package/build/components/provider/with-registry-provider.js +1 -0
  211. package/build/components/provider/with-registry-provider.js.map +1 -1
  212. package/build/components/start-page-options/index.js +139 -0
  213. package/build/components/start-page-options/index.js.map +1 -0
  214. package/build/components/table-of-contents/index.js.map +1 -1
  215. package/build/components/table-of-contents/panel.js.map +1 -1
  216. package/build/components/template-areas/index.js.map +1 -1
  217. package/build/components/template-validation-notice/index.js +23 -29
  218. package/build/components/template-validation-notice/index.js.map +1 -1
  219. package/build/components/theme-support-check/index.js +10 -16
  220. package/build/components/theme-support-check/index.js.map +1 -1
  221. package/build/components/time-to-read/index.js.map +1 -1
  222. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  223. package/build/components/word-count/index.js.map +1 -1
  224. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  225. package/build/hooks/default-autocompleters.js.map +1 -1
  226. package/build/hooks/index.js.map +1 -1
  227. package/build/hooks/index.native.js.map +1 -1
  228. package/build/hooks/pattern-overrides.js +22 -10
  229. package/build/hooks/pattern-overrides.js.map +1 -1
  230. package/build/hooks/use-select-nearest-editable-block.js.map +1 -1
  231. package/build/index.js.map +1 -1
  232. package/build/index.native.js.map +1 -1
  233. package/build/lock-unlock.js.map +1 -1
  234. package/build/private-apis.js +20 -1
  235. package/build/private-apis.js.map +1 -1
  236. package/build/store/actions.js.map +1 -1
  237. package/build/store/actions.native.js.map +1 -1
  238. package/build/store/constants.js +8 -1
  239. package/build/store/constants.js.map +1 -1
  240. package/build/store/defaults.js.map +1 -1
  241. package/build/store/index.js +1 -1
  242. package/build/store/index.js.map +1 -1
  243. package/build/store/local-autosave.js.map +1 -1
  244. package/build/store/private-actions.js +177 -4
  245. package/build/store/private-actions.js.map +1 -1
  246. package/build/store/private-selectors.js +1 -7
  247. package/build/store/private-selectors.js.map +1 -1
  248. package/build/store/reducer.js.map +1 -1
  249. package/build/store/reducer.native.js.map +1 -1
  250. package/build/store/selectors.js +5 -10
  251. package/build/store/selectors.js.map +1 -1
  252. package/build/store/selectors.native.js.map +1 -1
  253. package/build/store/utils/get-filtered-template-parts.js.map +1 -1
  254. package/build/store/utils/is-template-revertable.js +28 -0
  255. package/build/store/utils/is-template-revertable.js.map +1 -0
  256. package/build/store/utils/notice-builder.js.map +1 -1
  257. package/build/utils/get-template-part-icon.js.map +1 -1
  258. package/build/utils/index.js.map +1 -1
  259. package/build/utils/index.native.js.map +1 -1
  260. package/build/utils/media-upload/index.js.map +1 -1
  261. package/build/utils/media-upload/index.native.js.map +1 -1
  262. package/build/utils/terms.js.map +1 -1
  263. package/build/utils/url.js.map +1 -1
  264. package/build-module/bindings/index.js.map +1 -1
  265. package/build-module/bindings/pattern-overrides.js.map +1 -1
  266. package/build-module/bindings/post-meta.js +14 -31
  267. package/build-module/bindings/post-meta.js.map +1 -1
  268. package/build-module/components/autocompleters/index.js.map +1 -1
  269. package/build-module/components/autocompleters/user.js.map +1 -1
  270. package/build-module/components/autosave-monitor/index.js +10 -0
  271. package/build-module/components/autosave-monitor/index.js.map +1 -1
  272. package/build-module/components/block-manager/category.js.map +1 -1
  273. package/build-module/components/block-manager/checklist.js.map +1 -1
  274. package/build-module/components/block-manager/index.js.map +1 -1
  275. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  276. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  277. package/build-module/components/character-count/index.js.map +1 -1
  278. package/build-module/components/commands/index.js +20 -1
  279. package/build-module/components/commands/index.js.map +1 -1
  280. package/build-module/components/commands/index.native.js.map +1 -1
  281. package/build-module/components/deprecated.js.map +1 -1
  282. package/build-module/components/deprecated.native.js.map +1 -1
  283. package/build-module/components/document-bar/index.js.map +1 -1
  284. package/build-module/components/document-outline/check.js.map +1 -1
  285. package/build-module/components/document-outline/index.js.map +1 -1
  286. package/build-module/components/document-outline/item.js.map +1 -1
  287. package/build-module/components/document-tools/index.js +1 -1
  288. package/build-module/components/document-tools/index.js.map +1 -1
  289. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +13 -2
  290. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  291. package/build-module/components/editor-canvas/index.js +2 -2
  292. package/build-module/components/editor-canvas/index.js.map +1 -1
  293. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  294. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  295. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  296. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  297. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  298. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  299. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  300. package/build-module/components/editor-help/index.native.js.map +1 -1
  301. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  302. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  303. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  304. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  305. package/build-module/components/editor-history/redo.js.map +1 -1
  306. package/build-module/components/editor-history/undo.js.map +1 -1
  307. package/build-module/components/editor-notices/index.js.map +1 -1
  308. package/build-module/components/editor-snackbars/index.js.map +1 -1
  309. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  310. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  311. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  312. package/build-module/components/entities-saved-states/index.js.map +1 -1
  313. package/build-module/components/error-boundary/index.js.map +1 -1
  314. package/build-module/components/error-boundary/index.native.js.map +1 -1
  315. package/build-module/components/global-keyboard-shortcuts/index.js +24 -0
  316. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  317. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  318. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  319. package/build-module/components/index.js +4 -0
  320. package/build-module/components/index.js.map +1 -1
  321. package/build-module/components/index.native.js.map +1 -1
  322. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  323. package/build-module/components/keyboard-shortcut-help-modal/config.js +71 -0
  324. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  325. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
  326. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  327. package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
  328. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  329. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
  330. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  331. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  332. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  333. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  334. package/build-module/components/media-categories/index.js.map +1 -1
  335. package/build-module/components/mode-switcher/index.js.map +1 -1
  336. package/build-module/components/offline-status/index.native.js.map +1 -1
  337. package/build-module/components/page-attributes/check.js.map +1 -1
  338. package/build-module/components/page-attributes/order.js.map +1 -1
  339. package/build-module/components/page-attributes/panel.js.map +1 -1
  340. package/build-module/components/page-attributes/parent.js.map +1 -1
  341. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  342. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  343. package/build-module/components/plugin-more-menu-item/index.js +73 -0
  344. package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
  345. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  346. package/build-module/components/plugin-post-status-info/index.js +66 -0
  347. package/build-module/components/plugin-post-status-info/index.js.map +1 -0
  348. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  349. package/build-module/components/plugin-sidebar/index.js +102 -0
  350. package/build-module/components/plugin-sidebar/index.js.map +1 -0
  351. package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
  352. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  353. package/build-module/components/post-actions/actions.js +219 -15
  354. package/build-module/components/post-actions/actions.js.map +1 -1
  355. package/build-module/components/post-actions/index.js +130 -0
  356. package/build-module/components/post-actions/index.js.map +1 -0
  357. package/build-module/components/post-author/check.js.map +1 -1
  358. package/build-module/components/post-author/combobox.js.map +1 -1
  359. package/build-module/components/post-author/constants.js.map +1 -1
  360. package/build-module/components/post-author/hook.js.map +1 -1
  361. package/build-module/components/post-author/index.js.map +1 -1
  362. package/build-module/components/post-author/panel.js.map +1 -1
  363. package/build-module/components/post-author/select.js.map +1 -1
  364. package/build-module/components/post-card-panel/index.js +42 -8
  365. package/build-module/components/post-card-panel/index.js.map +1 -1
  366. package/build-module/components/post-comments/index.js.map +1 -1
  367. package/build-module/components/post-discussion/panel.js.map +1 -1
  368. package/build-module/components/post-excerpt/check.js +9 -0
  369. package/build-module/components/post-excerpt/check.js.map +1 -1
  370. package/build-module/components/post-excerpt/index.js.map +1 -1
  371. package/build-module/components/post-excerpt/panel.js.map +1 -1
  372. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  373. package/build-module/components/post-featured-image/check.js.map +1 -1
  374. package/build-module/components/post-featured-image/index.js.map +1 -1
  375. package/build-module/components/post-featured-image/panel.js.map +1 -1
  376. package/build-module/components/post-format/check.js.map +1 -1
  377. package/build-module/components/post-format/index.js.map +1 -1
  378. package/build-module/components/post-last-revision/check.js.map +1 -1
  379. package/build-module/components/post-last-revision/index.js.map +1 -1
  380. package/build-module/components/post-last-revision/panel.js.map +1 -1
  381. package/build-module/components/post-locked-modal/index.js.map +1 -1
  382. package/build-module/components/post-panel-row/index.js.map +1 -1
  383. package/build-module/components/post-pending-status/check.js.map +1 -1
  384. package/build-module/components/post-pending-status/index.js.map +1 -1
  385. package/build-module/components/post-pingbacks/index.js.map +1 -1
  386. package/build-module/components/post-preview-button/index.js.map +1 -1
  387. package/build-module/components/post-publish-button/index.js +31 -31
  388. package/build-module/components/post-publish-button/index.js.map +1 -1
  389. package/build-module/components/post-publish-button/label.js +51 -42
  390. package/build-module/components/post-publish-button/label.js.map +1 -1
  391. package/build-module/components/post-publish-panel/index.js.map +1 -1
  392. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  393. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  394. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  395. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  396. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  397. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  398. package/build-module/components/post-saved-state/index.js +10 -6
  399. package/build-module/components/post-saved-state/index.js.map +1 -1
  400. package/build-module/components/post-schedule/check.js.map +1 -1
  401. package/build-module/components/post-schedule/index.js.map +1 -1
  402. package/build-module/components/post-schedule/label.js.map +1 -1
  403. package/build-module/components/post-schedule/panel.js +8 -0
  404. package/build-module/components/post-schedule/panel.js.map +1 -1
  405. package/build-module/components/post-slug/check.js.map +1 -1
  406. package/build-module/components/post-slug/index.js +44 -68
  407. package/build-module/components/post-slug/index.js.map +1 -1
  408. package/build-module/components/post-status/index.js +231 -0
  409. package/build-module/components/post-status/index.js.map +1 -0
  410. package/build-module/components/post-sticky/check.js.map +1 -1
  411. package/build-module/components/post-sticky/index.js.map +1 -1
  412. package/build-module/components/post-switch-to-draft-button/index.js +7 -1
  413. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  414. package/build-module/components/post-sync-status/index.js.map +1 -1
  415. package/build-module/components/post-taxonomies/check.js.map +1 -1
  416. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  417. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  418. package/build-module/components/post-taxonomies/index.js.map +1 -1
  419. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  420. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  421. package/build-module/components/post-template/block-theme.js +7 -3
  422. package/build-module/components/post-template/block-theme.js.map +1 -1
  423. package/build-module/components/post-template/classic-theme.js.map +1 -1
  424. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  425. package/build-module/components/post-template/create-new-template.js.map +1 -1
  426. package/build-module/components/post-template/hooks.js.map +1 -1
  427. package/build-module/components/post-template/panel.js.map +1 -1
  428. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  429. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  430. package/build-module/components/post-text-editor/index.js.map +1 -1
  431. package/build-module/components/post-title/constants.js.map +1 -1
  432. package/build-module/components/post-title/index.js.map +1 -1
  433. package/build-module/components/post-title/index.native.js.map +1 -1
  434. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  435. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  436. package/build-module/components/post-title/use-post-title.js.map +1 -1
  437. package/build-module/components/post-trash/check.js +24 -26
  438. package/build-module/components/post-trash/check.js.map +1 -1
  439. package/build-module/components/post-trash/index.js +2 -1
  440. package/build-module/components/post-trash/index.js.map +1 -1
  441. package/build-module/components/post-type-support-check/index.js.map +1 -1
  442. package/build-module/components/post-url/check.js.map +1 -1
  443. package/build-module/components/post-url/index.js +46 -21
  444. package/build-module/components/post-url/index.js.map +1 -1
  445. package/build-module/components/post-url/label.js.map +1 -1
  446. package/build-module/components/post-url/panel.js +14 -7
  447. package/build-module/components/post-url/panel.js.map +1 -1
  448. package/build-module/components/post-view-link/index.js.map +1 -1
  449. package/build-module/components/post-visibility/check.js.map +1 -1
  450. package/build-module/components/post-visibility/index.js +2 -1
  451. package/build-module/components/post-visibility/index.js.map +1 -1
  452. package/build-module/components/post-visibility/label.js.map +1 -1
  453. package/build-module/components/post-visibility/utils.js.map +1 -1
  454. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  455. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  456. package/build-module/components/preferences-modal/index.js +19 -17
  457. package/build-module/components/preferences-modal/index.js.map +1 -1
  458. package/build-module/components/preview-dropdown/index.js.map +1 -1
  459. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  460. package/build-module/components/provider/index.js +5 -3
  461. package/build-module/components/provider/index.js.map +1 -1
  462. package/build-module/components/provider/index.native.js.map +1 -1
  463. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
  464. package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
  465. package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  466. package/build-module/components/provider/use-block-editor-settings.js +66 -45
  467. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  468. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  469. package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  470. package/build-module/components/provider/with-registry-provider.js +1 -0
  471. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  472. package/build-module/components/start-page-options/index.js +132 -0
  473. package/build-module/components/start-page-options/index.js.map +1 -0
  474. package/build-module/components/table-of-contents/index.js.map +1 -1
  475. package/build-module/components/table-of-contents/panel.js.map +1 -1
  476. package/build-module/components/template-areas/index.js.map +1 -1
  477. package/build-module/components/template-validation-notice/index.js +25 -31
  478. package/build-module/components/template-validation-notice/index.js.map +1 -1
  479. package/build-module/components/theme-support-check/index.js +11 -16
  480. package/build-module/components/theme-support-check/index.js.map +1 -1
  481. package/build-module/components/time-to-read/index.js.map +1 -1
  482. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  483. package/build-module/components/word-count/index.js.map +1 -1
  484. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  485. package/build-module/hooks/default-autocompleters.js.map +1 -1
  486. package/build-module/hooks/index.js.map +1 -1
  487. package/build-module/hooks/index.native.js.map +1 -1
  488. package/build-module/hooks/pattern-overrides.js +22 -10
  489. package/build-module/hooks/pattern-overrides.js.map +1 -1
  490. package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -1
  491. package/build-module/index.js.map +1 -1
  492. package/build-module/index.native.js.map +1 -1
  493. package/build-module/lock-unlock.js.map +1 -1
  494. package/build-module/private-apis.js +18 -1
  495. package/build-module/private-apis.js.map +1 -1
  496. package/build-module/store/actions.js.map +1 -1
  497. package/build-module/store/actions.native.js.map +1 -1
  498. package/build-module/store/constants.js +7 -0
  499. package/build-module/store/constants.js.map +1 -1
  500. package/build-module/store/defaults.js.map +1 -1
  501. package/build-module/store/index.js.map +1 -1
  502. package/build-module/store/local-autosave.js.map +1 -1
  503. package/build-module/store/private-actions.js +174 -4
  504. package/build-module/store/private-actions.js.map +1 -1
  505. package/build-module/store/private-selectors.js +1 -6
  506. package/build-module/store/private-selectors.js.map +1 -1
  507. package/build-module/store/reducer.js.map +1 -1
  508. package/build-module/store/reducer.native.js.map +1 -1
  509. package/build-module/store/selectors.js +1 -6
  510. package/build-module/store/selectors.js.map +1 -1
  511. package/build-module/store/selectors.native.js.map +1 -1
  512. package/build-module/store/utils/get-filtered-template-parts.js.map +1 -1
  513. package/build-module/store/utils/is-template-revertable.js +22 -0
  514. package/build-module/store/utils/is-template-revertable.js.map +1 -0
  515. package/build-module/store/utils/notice-builder.js.map +1 -1
  516. package/build-module/utils/get-template-part-icon.js.map +1 -1
  517. package/build-module/utils/index.js.map +1 -1
  518. package/build-module/utils/index.native.js.map +1 -1
  519. package/build-module/utils/media-upload/index.js.map +1 -1
  520. package/build-module/utils/media-upload/index.native.js.map +1 -1
  521. package/build-module/utils/terms.js.map +1 -1
  522. package/build-module/utils/url.js.map +1 -1
  523. package/build-style/style-rtl.css +498 -25
  524. package/build-style/style.css +498 -25
  525. package/package.json +35 -35
  526. package/src/bindings/post-meta.js +11 -27
  527. package/src/components/autosave-monitor/index.js +9 -0
  528. package/src/components/commands/index.js +20 -1
  529. package/src/components/document-tools/index.js +16 -14
  530. package/src/components/editor-canvas/edit-template-blocks-notification.js +16 -2
  531. package/src/components/editor-canvas/index.js +4 -4
  532. package/src/components/error-boundary/style.native.scss +1 -1
  533. package/src/components/global-keyboard-shortcuts/index.js +25 -0
  534. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +20 -0
  535. package/src/components/index.js +4 -0
  536. package/src/components/keyboard-shortcut-help-modal/config.js +53 -0
  537. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
  538. package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
  539. package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
  540. package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
  541. package/src/components/plugin-more-menu-item/index.js +73 -0
  542. package/src/components/plugin-post-status-info/index.js +63 -0
  543. package/src/components/plugin-sidebar/index.js +98 -0
  544. package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
  545. package/src/components/post-actions/actions.js +294 -14
  546. package/src/components/post-actions/index.js +156 -0
  547. package/src/components/post-actions/style.scss +3 -0
  548. package/src/components/post-card-panel/index.js +69 -9
  549. package/src/components/post-excerpt/check.js +8 -0
  550. package/src/components/post-publish-button/index.js +23 -36
  551. package/src/components/post-publish-button/label.js +54 -39
  552. package/src/components/post-publish-button/test/index.js +15 -26
  553. package/src/components/post-publish-button/test/label.js +44 -21
  554. package/src/components/post-saved-state/index.js +13 -6
  555. package/src/components/post-saved-state/test/index.js +4 -0
  556. package/src/components/post-schedule/panel.js +22 -0
  557. package/src/components/post-slug/index.js +50 -68
  558. package/src/components/post-slug/test/index.js +29 -6
  559. package/src/components/post-status/index.js +310 -0
  560. package/src/components/post-status/style.scss +75 -0
  561. package/src/components/post-switch-to-draft-button/index.js +5 -0
  562. package/src/components/post-template/block-theme.js +31 -22
  563. package/src/components/post-trash/check.js +19 -19
  564. package/src/components/post-trash/index.js +1 -0
  565. package/src/components/post-url/index.js +131 -101
  566. package/src/components/post-url/panel.js +20 -7
  567. package/src/components/post-url/style.scss +8 -6
  568. package/src/components/post-visibility/index.js +1 -0
  569. package/src/components/preferences-modal/index.js +26 -22
  570. package/src/components/provider/index.js +17 -8
  571. package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
  572. package/src/components/provider/use-block-editor-settings.js +59 -33
  573. package/src/components/provider/with-registry-provider.js +1 -0
  574. package/src/components/start-page-options/index.js +135 -0
  575. package/src/components/start-page-options/style.scss +26 -0
  576. package/src/components/template-validation-notice/index.js +48 -50
  577. package/src/components/theme-support-check/index.js +9 -16
  578. package/src/components/theme-support-check/test/index.js +44 -43
  579. package/src/hooks/pattern-overrides.js +25 -14
  580. package/src/private-apis.js +15 -0
  581. package/src/store/constants.js +7 -0
  582. package/src/store/private-actions.js +269 -4
  583. package/src/store/private-selectors.js +1 -6
  584. package/src/store/selectors.js +1 -6
  585. package/src/store/utils/is-template-revertable.js +23 -0
  586. package/src/style.scss +6 -2
  587. package/src/components/post-publish-button/style.scss +0 -8
  588. package/src/components/provider/test/disable-non-page-content-blocks.js +0 -111
  589. package/src/components/template-validation-notice/style.scss +0 -9
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { useEntityProp } from '@wordpress/core-data';
5
- import { useSelect } from '@wordpress/data';
4
+ import { store as coreDataStore } from '@wordpress/core-data';
6
5
  import { _x } from '@wordpress/i18n';
6
+
7
7
  /**
8
8
  * Internal dependencies
9
9
  */
@@ -12,33 +12,17 @@ import { store as editorStore } from '../store';
12
12
  export default {
13
13
  name: 'core/post-meta',
14
14
  label: _x( 'Post Meta', 'block bindings source' ),
15
- useSource( props, sourceAttributes ) {
16
- const { getCurrentPostType } = useSelect( editorStore );
17
- const { context } = props;
18
- const { key: metaKey } = sourceAttributes;
15
+ getPlaceholder( { args } ) {
16
+ return args.key;
17
+ },
18
+ getValue( { registry, context, args } ) {
19
19
  const postType = context.postType
20
20
  ? context.postType
21
- : getCurrentPostType();
22
-
23
- const [ meta, setMeta ] = useEntityProp(
24
- 'postType',
25
- context.postType,
26
- 'meta',
27
- context.postId
28
- );
29
-
30
- if ( postType === 'wp_template' ) {
31
- return { placeholder: metaKey };
32
- }
33
- const metaValue = meta[ metaKey ];
34
- const updateMetaValue = ( newValue ) => {
35
- setMeta( { ...meta, [ metaKey ]: newValue } );
36
- };
21
+ : registry.select( editorStore ).getCurrentPostType();
37
22
 
38
- return {
39
- placeholder: metaKey,
40
- value: metaValue,
41
- updateValue: updateMetaValue,
42
- };
23
+ return registry
24
+ .select( coreDataStore )
25
+ .getEditedEntityRecord( 'postType', postType, context.postId )
26
+ .meta?.[ args.key ];
43
27
  },
44
28
  };
@@ -91,6 +91,15 @@ export class AutosaveMonitor extends Component {
91
91
  }
92
92
  }
93
93
 
94
+ /**
95
+ * AutosaveMonitor component.
96
+ * Monitors the changes made to the edited post and triggers autosave if necessary.
97
+ *
98
+ * @example
99
+ * ```jsx
100
+ * <AutosaveMonitor interval={30000} />
101
+ * ```
102
+ */
94
103
  export default compose( [
95
104
  withSelect( ( select, ownProps ) => {
96
105
  const { getReferenceByDistinctEdits } = select( coreStore );
@@ -3,12 +3,13 @@
3
3
  */
4
4
  import { useSelect, useDispatch } from '@wordpress/data';
5
5
  import { __ } from '@wordpress/i18n';
6
- import { code, listView, external } from '@wordpress/icons';
6
+ import { code, listView, external, keyboard } from '@wordpress/icons';
7
7
  import { useCommandLoader } from '@wordpress/commands';
8
8
  import { store as preferencesStore } from '@wordpress/preferences';
9
9
  import { store as noticesStore } from '@wordpress/notices';
10
10
  import { store as blockEditorStore } from '@wordpress/block-editor';
11
11
  import { store as coreStore } from '@wordpress/core-data';
12
+ import { store as interfaceStore } from '@wordpress/interface';
12
13
 
13
14
  /**
14
15
  * Internal dependencies
@@ -55,6 +56,7 @@ function useEditorCommandLoader() {
55
56
  switchEditorMode,
56
57
  toggleDistractionFree,
57
58
  } = useDispatch( editorStore );
59
+ const { openModal } = useDispatch( interfaceStore );
58
60
  const { getCurrentPostId } = useSelect( editorStore );
59
61
  const allowSwitchEditorMode = isCodeEditingEnabled && isRichEditingEnabled;
60
62
 
@@ -64,6 +66,15 @@ function useEditorCommandLoader() {
64
66
 
65
67
  const commands = [];
66
68
 
69
+ commands.push( {
70
+ name: 'core/open-shortcut-help',
71
+ label: __( 'Keyboard shortcuts' ),
72
+ icon: keyboard,
73
+ callback: () => {
74
+ openModal( 'editor/keyboard-shortcut-help' );
75
+ },
76
+ } );
77
+
67
78
  commands.push( {
68
79
  name: 'core/toggle-distraction-free',
69
80
  label: isDistractionFree
@@ -75,6 +86,14 @@ function useEditorCommandLoader() {
75
86
  },
76
87
  } );
77
88
 
89
+ commands.push( {
90
+ name: 'core/open-preferences',
91
+ label: __( 'Editor preferences' ),
92
+ callback: () => {
93
+ openModal( 'editor/preferences' );
94
+ },
95
+ } );
96
+
78
97
  commands.push( {
79
98
  name: 'core/toggle-spotlight-mode',
80
99
  label: __( 'Toggle spotlight' ),
@@ -121,20 +121,22 @@ function DocumentTools( {
121
121
  variant="unstyled"
122
122
  >
123
123
  <div className="editor-document-tools__left">
124
- <ToolbarItem
125
- ref={ inserterButton }
126
- as={ Button }
127
- className="editor-document-tools__inserter-toggle"
128
- variant="primary"
129
- isPressed={ isInserterOpened }
130
- onMouseDown={ preventDefault }
131
- onClick={ toggleInserter }
132
- disabled={ disableBlockTools }
133
- icon={ plus }
134
- label={ showIconLabels ? shortLabel : longLabel }
135
- showTooltip={ ! showIconLabels }
136
- aria-expanded={ isInserterOpened }
137
- />
124
+ { ! isDistractionFree && (
125
+ <ToolbarItem
126
+ ref={ inserterButton }
127
+ as={ Button }
128
+ className="editor-document-tools__inserter-toggle"
129
+ variant="primary"
130
+ isPressed={ isInserterOpened }
131
+ onMouseDown={ preventDefault }
132
+ onClick={ toggleInserter }
133
+ disabled={ disableBlockTools }
134
+ icon={ plus }
135
+ label={ showIconLabels ? shortLabel : longLabel }
136
+ showTooltip={ ! showIconLabels }
137
+ aria-expanded={ isInserterOpened }
138
+ />
139
+ ) }
138
140
  { ( isWideViewport || ! showIconLabels ) && (
139
141
  <>
140
142
  { isLargeViewport && ! hasFixedToolbar && (
@@ -2,6 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { useSelect } from '@wordpress/data';
5
+ import { store as coreStore } from '@wordpress/core-data';
5
6
  import { useEffect, useState } from '@wordpress/element';
6
7
  import { __ } from '@wordpress/i18n';
7
8
  import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
@@ -37,10 +38,19 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
37
38
  };
38
39
  }, [] );
39
40
 
41
+ const canEditTemplate = useSelect(
42
+ ( select ) =>
43
+ select( coreStore ).canUser( 'create', 'templates' ) ?? false
44
+ );
45
+
40
46
  const [ isDialogOpen, setIsDialogOpen ] = useState( false );
41
47
 
42
48
  useEffect( () => {
43
49
  const handleDblClick = ( event ) => {
50
+ if ( ! canEditTemplate ) {
51
+ return;
52
+ }
53
+
44
54
  if ( ! event.target.classList.contains( 'is-root-container' ) ) {
45
55
  return;
46
56
  }
@@ -52,7 +62,11 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
52
62
  return () => {
53
63
  canvas?.removeEventListener( 'dblclick', handleDblClick );
54
64
  };
55
- }, [ contentRef ] );
65
+ }, [ contentRef, canEditTemplate ] );
66
+
67
+ if ( ! canEditTemplate ) {
68
+ return null;
69
+ }
56
70
 
57
71
  return (
58
72
  <ConfirmDialog
@@ -68,7 +82,7 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
68
82
  onCancel={ () => setIsDialogOpen( false ) }
69
83
  >
70
84
  { __(
71
- 'You’ve tried to select a block that is part of a template, which may be used on other posts and pages.'
85
+ 'You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?.'
72
86
  ) }
73
87
  </ConfirmDialog>
74
88
  );
@@ -39,8 +39,6 @@ const {
39
39
  useFlashEditableBlocks,
40
40
  } = unlock( blockEditorPrivateApis );
41
41
 
42
- const noop = () => {};
43
-
44
42
  /**
45
43
  * These post types have a special editor where they don't allow you to fill the title
46
44
  * and they don't apply the layout styles.
@@ -95,6 +93,7 @@ function EditorCanvas( {
95
93
  styles,
96
94
  disableIframe = false,
97
95
  iframeProps,
96
+ contentRef,
98
97
  children,
99
98
  } ) {
100
99
  const {
@@ -308,9 +307,10 @@ function EditorCanvas( {
308
307
 
309
308
  const localRef = useRef();
310
309
  const typewriterRef = useTypewriter();
311
- const contentRef = useMergeRefs( [
310
+ contentRef = useMergeRefs( [
312
311
  localRef,
313
- renderingMode === 'post-only' ? typewriterRef : noop,
312
+ contentRef,
313
+ renderingMode === 'post-only' ? typewriterRef : null,
314
314
  useFlashEditableBlocks( {
315
315
  isEnabled: renderingMode === 'template-locked',
316
316
  } ),
@@ -28,7 +28,7 @@
28
28
  justify-content: center;
29
29
  margin-bottom: 8px;
30
30
  background-color: rgba(60, 60, 67, 0.3);
31
- border-radius: $size/2;
31
+ border-radius: 20px;
32
32
  }
33
33
 
34
34
  .error-boundary__icon-container--dark {
@@ -3,6 +3,8 @@
3
3
  */
4
4
  import { useShortcut } from '@wordpress/keyboard-shortcuts';
5
5
  import { useDispatch, useSelect } from '@wordpress/data';
6
+ import { store as interfaceStore } from '@wordpress/interface';
7
+ import { store as blockEditorStore } from '@wordpress/block-editor';
6
8
 
7
9
  /**
8
10
  * Internal dependencies
@@ -15,6 +17,10 @@ export default function EditorKeyboardShortcuts() {
15
17
  select( editorStore ).getEditorSettings();
16
18
  return ! richEditingEnabled || ! codeEditingEnabled;
17
19
  }, [] );
20
+ const { getBlockSelectionStart } = useSelect( blockEditorStore );
21
+ const { getActiveComplementaryArea } = useSelect( interfaceStore );
22
+ const { enableComplementaryArea, disableComplementaryArea } =
23
+ useDispatch( interfaceStore );
18
24
  const {
19
25
  redo,
20
26
  undo,
@@ -86,5 +92,24 @@ export default function EditorKeyboardShortcuts() {
86
92
  }
87
93
  } );
88
94
 
95
+ useShortcut( 'core/editor/toggle-sidebar', ( event ) => {
96
+ // This shortcut has no known clashes, but use preventDefault to prevent any
97
+ // obscure shortcuts from triggering.
98
+ event.preventDefault();
99
+ const isEditorSidebarOpened = [
100
+ 'edit-post/document',
101
+ 'edit-post/block',
102
+ ].includes( getActiveComplementaryArea( 'core' ) );
103
+
104
+ if ( isEditorSidebarOpened ) {
105
+ disableComplementaryArea( 'core' );
106
+ } else {
107
+ const sidebarToOpen = getBlockSelectionStart()
108
+ ? 'edit-post/block'
109
+ : 'edit-post/document';
110
+ enableComplementaryArea( 'core', sidebarToOpen );
111
+ }
112
+ } );
113
+
89
114
  return null;
90
115
  }
@@ -83,6 +83,26 @@ function EditorKeyboardShortcutsRegister() {
83
83
  character: '\\',
84
84
  },
85
85
  } );
86
+
87
+ registerShortcut( {
88
+ name: 'core/editor/toggle-sidebar',
89
+ category: 'global',
90
+ description: __( 'Show or hide the Settings sidebar.' ),
91
+ keyCombination: {
92
+ modifier: 'primaryShift',
93
+ character: ',',
94
+ },
95
+ } );
96
+
97
+ registerShortcut( {
98
+ name: 'core/editor/keyboard-shortcuts',
99
+ category: 'main',
100
+ description: __( 'Display these keyboard shortcuts.' ),
101
+ keyCombination: {
102
+ modifier: 'access',
103
+ character: 'h',
104
+ },
105
+ } );
86
106
  }, [ registerShortcut ] );
87
107
 
88
108
  return <BlockEditorKeyboardShortcuts.Register />;
@@ -28,8 +28,12 @@ export { default as PageAttributesParent } from './page-attributes/parent';
28
28
  export { default as PageTemplate } from './post-template/classic-theme';
29
29
  export { default as PluginDocumentSettingPanel } from './plugin-document-setting-panel';
30
30
  export { default as PluginBlockSettingsMenuItem } from './block-settings-menu/plugin-block-settings-menu-item';
31
+ export { default as PluginMoreMenuItem } from './plugin-more-menu-item';
31
32
  export { default as PluginPostPublishPanel } from './plugin-post-publish-panel';
33
+ export { default as PluginPostStatusInfo } from './plugin-post-status-info';
32
34
  export { default as PluginPrePublishPanel } from './plugin-pre-publish-panel';
35
+ export { default as PluginSidebar } from './plugin-sidebar';
36
+ export { default as PluginSidebarMoreMenuItem } from './plugin-sidebar-more-menu-item';
33
37
  export { default as PostTemplatePanel } from './post-template/panel';
34
38
  export { default as PostAuthor } from './post-author';
35
39
  export { default as PostAuthorCheck } from './post-author/check';
@@ -0,0 +1,53 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
6
+ export const textFormattingShortcuts = [
7
+ {
8
+ keyCombination: { modifier: 'primary', character: 'b' },
9
+ description: __( 'Make the selected text bold.' ),
10
+ },
11
+ {
12
+ keyCombination: { modifier: 'primary', character: 'i' },
13
+ description: __( 'Make the selected text italic.' ),
14
+ },
15
+ {
16
+ keyCombination: { modifier: 'primary', character: 'k' },
17
+ description: __( 'Convert the selected text into a link.' ),
18
+ },
19
+ {
20
+ keyCombination: { modifier: 'primaryShift', character: 'k' },
21
+ description: __( 'Remove a link.' ),
22
+ },
23
+ {
24
+ keyCombination: { character: '[[' },
25
+ description: __( 'Insert a link to a post or page.' ),
26
+ },
27
+ {
28
+ keyCombination: { modifier: 'primary', character: 'u' },
29
+ description: __( 'Underline the selected text.' ),
30
+ },
31
+ {
32
+ keyCombination: { modifier: 'access', character: 'd' },
33
+ description: __( 'Strikethrough the selected text.' ),
34
+ },
35
+ {
36
+ keyCombination: { modifier: 'access', character: 'x' },
37
+ description: __( 'Make the selected text inline code.' ),
38
+ },
39
+ {
40
+ keyCombination: { modifier: 'access', character: '0' },
41
+ description: __( 'Convert the current heading to a paragraph.' ),
42
+ },
43
+ {
44
+ keyCombination: { modifier: 'access', character: '1-6' },
45
+ description: __(
46
+ 'Convert the current paragraph or heading to a heading of level 1 to 6.'
47
+ ),
48
+ },
49
+ {
50
+ keyCombination: { modifier: 'primaryShift', character: 'SPACE' },
51
+ description: __( 'Add non breaking space.' ),
52
+ },
53
+ ];
@@ -0,0 +1,43 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect } from '@wordpress/data';
5
+ import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import Shortcut from './shortcut';
11
+
12
+ function DynamicShortcut( { name } ) {
13
+ const { keyCombination, description, aliases } = useSelect(
14
+ ( select ) => {
15
+ const {
16
+ getShortcutKeyCombination,
17
+ getShortcutDescription,
18
+ getShortcutAliases,
19
+ } = select( keyboardShortcutsStore );
20
+
21
+ return {
22
+ keyCombination: getShortcutKeyCombination( name ),
23
+ aliases: getShortcutAliases( name ),
24
+ description: getShortcutDescription( name ),
25
+ };
26
+ },
27
+ [ name ]
28
+ );
29
+
30
+ if ( ! keyCombination ) {
31
+ return null;
32
+ }
33
+
34
+ return (
35
+ <Shortcut
36
+ keyCombination={ keyCombination }
37
+ description={ description }
38
+ aliases={ aliases }
39
+ />
40
+ );
41
+ }
42
+
43
+ export default DynamicShortcut;
@@ -0,0 +1,160 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import classnames from 'classnames';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { Modal } from '@wordpress/components';
10
+ import { __ } from '@wordpress/i18n';
11
+ import {
12
+ useShortcut,
13
+ store as keyboardShortcutsStore,
14
+ } from '@wordpress/keyboard-shortcuts';
15
+ import { useDispatch, useSelect } from '@wordpress/data';
16
+ import { store as interfaceStore } from '@wordpress/interface';
17
+
18
+ /**
19
+ * Internal dependencies
20
+ */
21
+ import { textFormattingShortcuts } from './config';
22
+ import Shortcut from './shortcut';
23
+ import DynamicShortcut from './dynamic-shortcut';
24
+
25
+ const KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'editor/keyboard-shortcut-help';
26
+
27
+ const ShortcutList = ( { shortcuts } ) => (
28
+ /*
29
+ * Disable reason: The `list` ARIA role is redundant but
30
+ * Safari+VoiceOver won't announce the list otherwise.
31
+ */
32
+ /* eslint-disable jsx-a11y/no-redundant-roles */
33
+ <ul
34
+ className="editor-keyboard-shortcut-help-modal__shortcut-list"
35
+ role="list"
36
+ >
37
+ { shortcuts.map( ( shortcut, index ) => (
38
+ <li
39
+ className="editor-keyboard-shortcut-help-modal__shortcut"
40
+ key={ index }
41
+ >
42
+ { typeof shortcut === 'string' ? (
43
+ <DynamicShortcut name={ shortcut } />
44
+ ) : (
45
+ <Shortcut { ...shortcut } />
46
+ ) }
47
+ </li>
48
+ ) ) }
49
+ </ul>
50
+ /* eslint-enable jsx-a11y/no-redundant-roles */
51
+ );
52
+
53
+ const ShortcutSection = ( { title, shortcuts, className } ) => (
54
+ <section
55
+ className={ classnames(
56
+ 'editor-keyboard-shortcut-help-modal__section',
57
+ className
58
+ ) }
59
+ >
60
+ { !! title && (
61
+ <h2 className="editor-keyboard-shortcut-help-modal__section-title">
62
+ { title }
63
+ </h2>
64
+ ) }
65
+ <ShortcutList shortcuts={ shortcuts } />
66
+ </section>
67
+ );
68
+
69
+ const ShortcutCategorySection = ( {
70
+ title,
71
+ categoryName,
72
+ additionalShortcuts = [],
73
+ } ) => {
74
+ const categoryShortcuts = useSelect(
75
+ ( select ) => {
76
+ return select( keyboardShortcutsStore ).getCategoryShortcuts(
77
+ categoryName
78
+ );
79
+ },
80
+ [ categoryName ]
81
+ );
82
+
83
+ return (
84
+ <ShortcutSection
85
+ title={ title }
86
+ shortcuts={ categoryShortcuts.concat( additionalShortcuts ) }
87
+ />
88
+ );
89
+ };
90
+
91
+ function KeyboardShortcutHelpModal() {
92
+ const isModalActive = useSelect(
93
+ ( select ) =>
94
+ select( interfaceStore ).isModalActive(
95
+ KEYBOARD_SHORTCUT_HELP_MODAL_NAME
96
+ ),
97
+ []
98
+ );
99
+ const { openModal, closeModal } = useDispatch( interfaceStore );
100
+ const toggleModal = () => {
101
+ if ( isModalActive ) {
102
+ closeModal();
103
+ } else {
104
+ openModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );
105
+ }
106
+ };
107
+ useShortcut( 'core/editor/keyboard-shortcuts', toggleModal );
108
+
109
+ if ( ! isModalActive ) {
110
+ return null;
111
+ }
112
+
113
+ return (
114
+ <Modal
115
+ className="editor-keyboard-shortcut-help-modal"
116
+ title={ __( 'Keyboard shortcuts' ) }
117
+ closeButtonLabel={ __( 'Close' ) }
118
+ onRequestClose={ toggleModal }
119
+ >
120
+ <ShortcutSection
121
+ className="editor-keyboard-shortcut-help-modal__main-shortcuts"
122
+ shortcuts={ [ 'core/editor/keyboard-shortcuts' ] }
123
+ />
124
+ <ShortcutCategorySection
125
+ title={ __( 'Global shortcuts' ) }
126
+ categoryName="global"
127
+ />
128
+
129
+ <ShortcutCategorySection
130
+ title={ __( 'Selection shortcuts' ) }
131
+ categoryName="selection"
132
+ />
133
+
134
+ <ShortcutCategorySection
135
+ title={ __( 'Block shortcuts' ) }
136
+ categoryName="block"
137
+ additionalShortcuts={ [
138
+ {
139
+ keyCombination: { character: '/' },
140
+ description: __(
141
+ 'Change the block type after adding a new paragraph.'
142
+ ),
143
+ /* translators: The forward-slash character. e.g. '/'. */
144
+ ariaLabel: __( 'Forward-slash' ),
145
+ },
146
+ ] }
147
+ />
148
+ <ShortcutSection
149
+ title={ __( 'Text formatting' ) }
150
+ shortcuts={ textFormattingShortcuts }
151
+ />
152
+ <ShortcutCategorySection
153
+ title={ __( 'List View shortcuts' ) }
154
+ categoryName="list-view"
155
+ />
156
+ </Modal>
157
+ );
158
+ }
159
+
160
+ export default KeyboardShortcutHelpModal;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { Fragment } from '@wordpress/element';
5
+ import { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';
6
+
7
+ function KeyCombination( { keyCombination, forceAriaLabel } ) {
8
+ const shortcut = keyCombination.modifier
9
+ ? displayShortcutList[ keyCombination.modifier ](
10
+ keyCombination.character
11
+ )
12
+ : keyCombination.character;
13
+ const ariaLabel = keyCombination.modifier
14
+ ? shortcutAriaLabel[ keyCombination.modifier ](
15
+ keyCombination.character
16
+ )
17
+ : keyCombination.character;
18
+
19
+ return (
20
+ <kbd
21
+ className="editor-keyboard-shortcut-help-modal__shortcut-key-combination"
22
+ aria-label={ forceAriaLabel || ariaLabel }
23
+ >
24
+ { ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(
25
+ ( character, index ) => {
26
+ if ( character === '+' ) {
27
+ return <Fragment key={ index }>{ character }</Fragment>;
28
+ }
29
+
30
+ return (
31
+ <kbd
32
+ key={ index }
33
+ className="editor-keyboard-shortcut-help-modal__shortcut-key"
34
+ >
35
+ { character }
36
+ </kbd>
37
+ );
38
+ }
39
+ ) }
40
+ </kbd>
41
+ );
42
+ }
43
+
44
+ function Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {
45
+ return (
46
+ <>
47
+ <div className="editor-keyboard-shortcut-help-modal__shortcut-description">
48
+ { description }
49
+ </div>
50
+ <div className="editor-keyboard-shortcut-help-modal__shortcut-term">
51
+ <KeyCombination
52
+ keyCombination={ keyCombination }
53
+ forceAriaLabel={ ariaLabel }
54
+ />
55
+ { aliases.map( ( alias, index ) => (
56
+ <KeyCombination
57
+ keyCombination={ alias }
58
+ forceAriaLabel={ ariaLabel }
59
+ key={ index }
60
+ />
61
+ ) ) }
62
+ </div>
63
+ </>
64
+ );
65
+ }
66
+
67
+ export default Shortcut;