@wordpress/editor 14.9.0 → 14.11.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 (518) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/build/bindings/api.js +0 -29
  4. package/build/bindings/api.js.map +1 -1
  5. package/build/bindings/post-meta.js +2 -1
  6. package/build/bindings/post-meta.js.map +1 -1
  7. package/build/components/autocompleters/user.js.map +1 -1
  8. package/build/components/block-manager/index.js +2 -2
  9. package/build/components/block-manager/index.js.map +1 -1
  10. package/build/components/collab-sidebar/add-comment.js +120 -0
  11. package/build/components/collab-sidebar/add-comment.js.map +1 -0
  12. package/build/components/collab-sidebar/comment-button-toolbar.js +37 -0
  13. package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
  14. package/build/components/collab-sidebar/comment-button.js +37 -0
  15. package/build/components/collab-sidebar/comment-button.js.map +1 -0
  16. package/build/components/collab-sidebar/comments.js +321 -0
  17. package/build/components/collab-sidebar/comments.js.map +1 -0
  18. package/build/components/collab-sidebar/constants.js +8 -0
  19. package/build/components/collab-sidebar/constants.js.map +1 -0
  20. package/build/components/collab-sidebar/index.js +272 -0
  21. package/build/components/collab-sidebar/index.js.map +1 -0
  22. package/build/components/collab-sidebar/utils.js +16 -0
  23. package/build/components/collab-sidebar/utils.js.map +1 -0
  24. package/build/components/commands/index.js +6 -6
  25. package/build/components/commands/index.js.map +1 -1
  26. package/build/components/create-template-part-modal/index.js.map +1 -1
  27. package/build/components/create-template-part-modal/utils.js.map +1 -1
  28. package/build/components/document-bar/index.js +8 -7
  29. package/build/components/document-bar/index.js.map +1 -1
  30. package/build/components/document-outline/index.js.map +1 -1
  31. package/build/components/document-outline/item.js.map +1 -1
  32. package/build/components/document-tools/index.js +2 -6
  33. package/build/components/document-tools/index.js.map +1 -1
  34. package/build/components/editor-interface/index.js +4 -14
  35. package/build/components/editor-interface/index.js.map +1 -1
  36. package/build/components/entities-saved-states/index.js +2 -2
  37. package/build/components/entities-saved-states/index.js.map +1 -1
  38. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  39. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  40. package/build/components/global-styles-provider/index.js +13 -3
  41. package/build/components/global-styles-provider/index.js.map +1 -1
  42. package/build/components/header/index.js +5 -2
  43. package/build/components/header/index.js.map +1 -1
  44. package/build/components/inserter-sidebar/index.js +2 -2
  45. package/build/components/inserter-sidebar/index.js.map +1 -1
  46. package/build/components/media-categories/index.js.map +1 -1
  47. package/build/components/page-attributes/parent.js +5 -5
  48. package/build/components/page-attributes/parent.js.map +1 -1
  49. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  50. package/build/components/plugin-more-menu-item/index.js +13 -11
  51. package/build/components/plugin-more-menu-item/index.js.map +1 -1
  52. package/build/components/plugin-preview-menu-item/index.js +15 -13
  53. package/build/components/plugin-preview-menu-item/index.js.map +1 -1
  54. package/build/components/plugin-sidebar/index.js +0 -15
  55. package/build/components/plugin-sidebar/index.js.map +1 -1
  56. package/build/components/post-actions/index.js +5 -5
  57. package/build/components/post-actions/index.js.map +1 -1
  58. package/build/components/post-author/panel.js +4 -4
  59. package/build/components/post-author/panel.js.map +1 -1
  60. package/build/components/post-card-panel/index.js +7 -36
  61. package/build/components/post-card-panel/index.js.map +1 -1
  62. package/build/components/post-content-information/index.js +2 -3
  63. package/build/components/post-content-information/index.js.map +1 -1
  64. package/build/components/post-featured-image/index.js +26 -7
  65. package/build/components/post-featured-image/index.js.map +1 -1
  66. package/build/components/post-format/index.js +1 -1
  67. package/build/components/post-format/index.js.map +1 -1
  68. package/build/components/post-last-revision/index.js +1 -1
  69. package/build/components/post-last-revision/index.js.map +1 -1
  70. package/build/components/post-locked-modal/index.js +2 -2
  71. package/build/components/post-locked-modal/index.js.map +1 -1
  72. package/build/components/post-preview-button/index.js +1 -1
  73. package/build/components/post-preview-button/index.js.map +1 -1
  74. package/build/components/post-publish-button/index.js.map +1 -1
  75. package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -1
  76. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  77. package/build/components/post-publish-panel/maybe-upload-media.js +1 -0
  78. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  79. package/build/components/post-publish-panel/media-util.js +1 -0
  80. package/build/components/post-publish-panel/media-util.js.map +1 -1
  81. package/build/components/post-publish-panel/postpublish.js +1 -1
  82. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  83. package/build/components/post-schedule/label.js +1 -1
  84. package/build/components/post-schedule/label.js.map +1 -1
  85. package/build/components/post-taxonomies/flat-term-selector.js +13 -5
  86. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  87. package/build/components/post-taxonomies/hierarchical-term-selector.js +3 -2
  88. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  89. package/build/components/post-taxonomies/index.js +1 -1
  90. package/build/components/post-taxonomies/index.js.map +1 -1
  91. package/build/components/post-taxonomies/panel.js.map +1 -1
  92. package/build/components/post-template/classic-theme.js +2 -4
  93. package/build/components/post-template/classic-theme.js.map +1 -1
  94. package/build/components/post-text-editor/index.js.map +1 -1
  95. package/build/components/post-title/index.js +15 -19
  96. package/build/components/post-title/index.js.map +1 -1
  97. package/build/components/post-title/index.native.js +2 -2
  98. package/build/components/post-title/index.native.js.map +1 -1
  99. package/build/components/post-url/index.js +76 -63
  100. package/build/components/post-url/index.js.map +1 -1
  101. package/build/components/post-url/panel.js +49 -29
  102. package/build/components/post-url/panel.js.map +1 -1
  103. package/build/components/post-visibility/index.js.map +1 -1
  104. package/build/components/preferences-modal/index.js.map +1 -1
  105. package/build/components/preview-dropdown/index.js +0 -4
  106. package/build/components/preview-dropdown/index.js.map +1 -1
  107. package/build/components/provider/index.js +10 -12
  108. package/build/components/provider/index.js.map +1 -1
  109. package/build/components/provider/use-block-editor-settings.js +1 -1
  110. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  111. package/build/components/resizable-editor/resize-handle.js.map +1 -1
  112. package/build/components/sidebar/header.js +2 -1
  113. package/build/components/sidebar/header.js.map +1 -1
  114. package/build/components/sidebar/index.js +3 -3
  115. package/build/components/sidebar/index.js.map +1 -1
  116. package/build/components/time-to-read/index.js +2 -2
  117. package/build/components/time-to-read/index.js.map +1 -1
  118. package/build/components/visual-editor/edit-template-blocks-notification.js +4 -1
  119. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  120. package/build/components/visual-editor/index.js +24 -25
  121. package/build/components/visual-editor/index.js.map +1 -1
  122. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  123. package/build/components/visual-editor/use-zoom-out-mode-exit.js +52 -0
  124. package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
  125. package/build/components/zoom-out-toggle/index.js +37 -5
  126. package/build/components/zoom-out-toggle/index.js.map +1 -1
  127. package/build/dataviews/actions/duplicate-template-part.js +3 -3
  128. package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
  129. package/build/private-apis.js +0 -1
  130. package/build/private-apis.js.map +1 -1
  131. package/build/store/actions.js +30 -4
  132. package/build/store/actions.js.map +1 -1
  133. package/build/store/constants.js +1 -0
  134. package/build/store/constants.js.map +1 -1
  135. package/build/store/local-autosave.js.map +1 -1
  136. package/build/store/private-actions.js +8 -7
  137. package/build/store/private-actions.js.map +1 -1
  138. package/build/store/selectors.js +24 -2
  139. package/build/store/selectors.js.map +1 -1
  140. package/build/utils/media-upload/index.js.map +1 -1
  141. package/build/utils/pageTypeBadge.js +51 -0
  142. package/build/utils/pageTypeBadge.js.map +1 -0
  143. package/build/utils/terms.js +2 -2
  144. package/build/utils/terms.js.map +1 -1
  145. package/build-module/bindings/api.js +1 -29
  146. package/build-module/bindings/api.js.map +1 -1
  147. package/build-module/bindings/post-meta.js +2 -1
  148. package/build-module/bindings/post-meta.js.map +1 -1
  149. package/build-module/components/autocompleters/user.js +1 -3
  150. package/build-module/components/autocompleters/user.js.map +1 -1
  151. package/build-module/components/block-manager/category.js +1 -2
  152. package/build-module/components/block-manager/category.js.map +1 -1
  153. package/build-module/components/block-manager/checklist.js +1 -2
  154. package/build-module/components/block-manager/checklist.js.map +1 -1
  155. package/build-module/components/block-manager/index.js +3 -4
  156. package/build-module/components/block-manager/index.js.map +1 -1
  157. package/build-module/components/block-settings-menu/content-only-settings-menu.js +1 -3
  158. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  159. package/build-module/components/blog-title/index.js +1 -3
  160. package/build-module/components/blog-title/index.js.map +1 -1
  161. package/build-module/components/collab-sidebar/add-comment.js +114 -0
  162. package/build-module/components/collab-sidebar/add-comment.js.map +1 -0
  163. package/build-module/components/collab-sidebar/comment-button-toolbar.js +30 -0
  164. package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
  165. package/build-module/components/collab-sidebar/comment-button.js +30 -0
  166. package/build-module/components/collab-sidebar/comment-button.js.map +1 -0
  167. package/build-module/components/collab-sidebar/comments.js +314 -0
  168. package/build-module/components/collab-sidebar/comments.js.map +1 -0
  169. package/build-module/components/collab-sidebar/constants.js +2 -0
  170. package/build-module/components/collab-sidebar/constants.js.map +1 -0
  171. package/build-module/components/collab-sidebar/index.js +264 -0
  172. package/build-module/components/collab-sidebar/index.js.map +1 -0
  173. package/build-module/components/collab-sidebar/utils.js +10 -0
  174. package/build-module/components/collab-sidebar/utils.js.map +1 -0
  175. package/build-module/components/collapsible-block-toolbar/index.js +1 -3
  176. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  177. package/build-module/components/commands/index.js +6 -6
  178. package/build-module/components/commands/index.js.map +1 -1
  179. package/build-module/components/create-template-part-modal/index.js +1 -2
  180. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  181. package/build-module/components/create-template-part-modal/utils.js.map +1 -1
  182. package/build-module/components/document-bar/index.js +10 -10
  183. package/build-module/components/document-bar/index.js.map +1 -1
  184. package/build-module/components/document-outline/index.js +1 -2
  185. package/build-module/components/document-outline/index.js.map +1 -1
  186. package/build-module/components/document-outline/item.js +1 -2
  187. package/build-module/components/document-outline/item.js.map +1 -1
  188. package/build-module/components/document-tools/index.js +4 -10
  189. package/build-module/components/document-tools/index.js.map +1 -1
  190. package/build-module/components/editor/index.js +1 -3
  191. package/build-module/components/editor/index.js.map +1 -1
  192. package/build-module/components/editor-help/add-blocks.native.js +1 -3
  193. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  194. package/build-module/components/editor-help/customize-blocks.native.js +1 -3
  195. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  196. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +1 -2
  197. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  198. package/build-module/components/editor-help/index.native.js +1 -3
  199. package/build-module/components/editor-help/index.native.js.map +1 -1
  200. package/build-module/components/editor-help/intro-to-blocks.native.js +1 -3
  201. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  202. package/build-module/components/editor-help/move-blocks.native.js +1 -3
  203. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  204. package/build-module/components/editor-help/remove-blocks.native.js +1 -3
  205. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  206. package/build-module/components/editor-help/view-sections.native.js +1 -2
  207. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  208. package/build-module/components/editor-interface/index.js +5 -17
  209. package/build-module/components/editor-interface/index.js.map +1 -1
  210. package/build-module/components/editor-notices/index.js +1 -3
  211. package/build-module/components/editor-notices/index.js.map +1 -1
  212. package/build-module/components/entities-saved-states/entity-record-item.js +1 -3
  213. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  214. package/build-module/components/entities-saved-states/entity-type-list.js +1 -2
  215. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  216. package/build-module/components/entities-saved-states/index.js +3 -4
  217. package/build-module/components/entities-saved-states/index.js.map +1 -1
  218. package/build-module/components/error-boundary/index.native.js +1 -2
  219. package/build-module/components/error-boundary/index.native.js.map +1 -1
  220. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  221. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  222. package/build-module/components/global-styles-provider/index.js +13 -3
  223. package/build-module/components/global-styles-provider/index.js.map +1 -1
  224. package/build-module/components/header/index.js +6 -4
  225. package/build-module/components/header/index.js.map +1 -1
  226. package/build-module/components/inserter-sidebar/index.js +2 -2
  227. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  228. package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
  229. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  230. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -3
  231. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  232. package/build-module/components/list-view-sidebar/list-view-outline.js +1 -3
  233. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  234. package/build-module/components/media-categories/index.js.map +1 -1
  235. package/build-module/components/more-menu/index.js +1 -3
  236. package/build-module/components/more-menu/index.js.map +1 -1
  237. package/build-module/components/offline-status/index.native.js +1 -2
  238. package/build-module/components/offline-status/index.native.js.map +1 -1
  239. package/build-module/components/page-attributes/parent.js +6 -7
  240. package/build-module/components/page-attributes/parent.js.map +1 -1
  241. package/build-module/components/plugin-document-setting-panel/index.js +1 -3
  242. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  243. package/build-module/components/plugin-more-menu-item/index.js +12 -10
  244. package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
  245. package/build-module/components/plugin-preview-menu-item/index.js +14 -12
  246. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
  247. package/build-module/components/plugin-sidebar/index.js +0 -15
  248. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  249. package/build-module/components/post-actions/index.js +6 -8
  250. package/build-module/components/post-actions/index.js.map +1 -1
  251. package/build-module/components/post-author/panel.js +5 -6
  252. package/build-module/components/post-author/panel.js.map +1 -1
  253. package/build-module/components/post-card-panel/index.js +9 -38
  254. package/build-module/components/post-card-panel/index.js.map +1 -1
  255. package/build-module/components/post-content-information/index.js +2 -3
  256. package/build-module/components/post-content-information/index.js.map +1 -1
  257. package/build-module/components/post-discussion/panel.js +1 -2
  258. package/build-module/components/post-discussion/panel.js.map +1 -1
  259. package/build-module/components/post-excerpt/panel.js +1 -3
  260. package/build-module/components/post-excerpt/panel.js.map +1 -1
  261. package/build-module/components/post-featured-image/index.js +27 -9
  262. package/build-module/components/post-featured-image/index.js.map +1 -1
  263. package/build-module/components/post-format/index.js +2 -3
  264. package/build-module/components/post-format/index.js.map +1 -1
  265. package/build-module/components/post-format/panel.js +1 -2
  266. package/build-module/components/post-format/panel.js.map +1 -1
  267. package/build-module/components/post-last-revision/index.js +1 -1
  268. package/build-module/components/post-last-revision/index.js.map +1 -1
  269. package/build-module/components/post-locked-modal/index.js +3 -5
  270. package/build-module/components/post-locked-modal/index.js.map +1 -1
  271. package/build-module/components/post-panel-row/index.js +1 -2
  272. package/build-module/components/post-panel-row/index.js.map +1 -1
  273. package/build-module/components/post-preview-button/index.js +2 -4
  274. package/build-module/components/post-preview-button/index.js.map +1 -1
  275. package/build-module/components/post-publish-button/index.js +1 -2
  276. package/build-module/components/post-publish-button/index.js.map +1 -1
  277. package/build-module/components/post-publish-panel/index.js +1 -3
  278. package/build-module/components/post-publish-panel/index.js.map +1 -1
  279. package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -2
  280. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  281. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -3
  282. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  283. package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -2
  284. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  285. package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -2
  286. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  287. package/build-module/components/post-publish-panel/media-util.js +1 -0
  288. package/build-module/components/post-publish-panel/media-util.js.map +1 -1
  289. package/build-module/components/post-publish-panel/postpublish.js +2 -4
  290. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  291. package/build-module/components/post-publish-panel/prepublish.js +1 -3
  292. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  293. package/build-module/components/post-saved-state/index.js +1 -2
  294. package/build-module/components/post-saved-state/index.js.map +1 -1
  295. package/build-module/components/post-schedule/label.js +1 -1
  296. package/build-module/components/post-schedule/label.js.map +1 -1
  297. package/build-module/components/post-status/index.js +1 -3
  298. package/build-module/components/post-status/index.js.map +1 -1
  299. package/build-module/components/post-switch-to-draft-button/index.js +1 -3
  300. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  301. package/build-module/components/post-taxonomies/flat-term-selector.js +16 -10
  302. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  303. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -4
  304. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  305. package/build-module/components/post-taxonomies/index.js +1 -1
  306. package/build-module/components/post-taxonomies/index.js.map +1 -1
  307. package/build-module/components/post-taxonomies/most-used-terms.js +1 -2
  308. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  309. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  310. package/build-module/components/post-template/block-theme.js +1 -3
  311. package/build-module/components/post-template/block-theme.js.map +1 -1
  312. package/build-module/components/post-template/classic-theme.js +3 -6
  313. package/build-module/components/post-template/classic-theme.js.map +1 -1
  314. package/build-module/components/post-template/create-new-template-modal.js +1 -2
  315. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  316. package/build-module/components/post-template/create-new-template.js +1 -3
  317. package/build-module/components/post-template/create-new-template.js.map +1 -1
  318. package/build-module/components/post-template/swap-template-button.js +1 -3
  319. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  320. package/build-module/components/post-text-editor/index.js +1 -3
  321. package/build-module/components/post-text-editor/index.js.map +1 -1
  322. package/build-module/components/post-title/index.js +15 -19
  323. package/build-module/components/post-title/index.js.map +1 -1
  324. package/build-module/components/post-title/index.native.js +2 -2
  325. package/build-module/components/post-title/index.native.js.map +1 -1
  326. package/build-module/components/post-trash/index.js +1 -2
  327. package/build-module/components/post-trash/index.js.map +1 -1
  328. package/build-module/components/post-url/index.js +78 -66
  329. package/build-module/components/post-url/index.js.map +1 -1
  330. package/build-module/components/post-url/panel.js +51 -31
  331. package/build-module/components/post-url/panel.js.map +1 -1
  332. package/build-module/components/post-visibility/index.js +1 -2
  333. package/build-module/components/post-visibility/index.js.map +1 -1
  334. package/build-module/components/posts-per-page/index.js +1 -3
  335. package/build-module/components/posts-per-page/index.js.map +1 -1
  336. package/build-module/components/preferences-modal/index.js +1 -3
  337. package/build-module/components/preferences-modal/index.js.map +1 -1
  338. package/build-module/components/preview-dropdown/index.js +1 -7
  339. package/build-module/components/preview-dropdown/index.js.map +1 -1
  340. package/build-module/components/provider/index.js +11 -15
  341. package/build-module/components/provider/index.js.map +1 -1
  342. package/build-module/components/provider/index.native.js +1 -3
  343. package/build-module/components/provider/index.native.js.map +1 -1
  344. package/build-module/components/provider/use-block-editor-settings.js +1 -1
  345. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  346. package/build-module/components/resizable-editor/resize-handle.js +1 -3
  347. package/build-module/components/resizable-editor/resize-handle.js.map +1 -1
  348. package/build-module/components/save-publish-panels/index.js +1 -3
  349. package/build-module/components/save-publish-panels/index.js.map +1 -1
  350. package/build-module/components/sidebar/header.js +3 -3
  351. package/build-module/components/sidebar/header.js.map +1 -1
  352. package/build-module/components/sidebar/index.js +5 -6
  353. package/build-module/components/sidebar/index.js.map +1 -1
  354. package/build-module/components/sidebar/post-summary.js +1 -3
  355. package/build-module/components/sidebar/post-summary.js.map +1 -1
  356. package/build-module/components/site-discussion/index.js +1 -3
  357. package/build-module/components/site-discussion/index.js.map +1 -1
  358. package/build-module/components/start-template-options/index.js +1 -2
  359. package/build-module/components/start-template-options/index.js.map +1 -1
  360. package/build-module/components/table-of-contents/panel.js +1 -3
  361. package/build-module/components/table-of-contents/panel.js.map +1 -1
  362. package/build-module/components/template-part-menu-items/convert-to-template-part.js +1 -3
  363. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
  364. package/build-module/components/template-validation-notice/index.js +1 -3
  365. package/build-module/components/template-validation-notice/index.js.map +1 -1
  366. package/build-module/components/text-editor/index.js +1 -2
  367. package/build-module/components/text-editor/index.js.map +1 -1
  368. package/build-module/components/time-to-read/index.js +2 -2
  369. package/build-module/components/time-to-read/index.js.map +1 -1
  370. package/build-module/components/visual-editor/edit-template-blocks-notification.js +4 -1
  371. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  372. package/build-module/components/visual-editor/index.js +26 -29
  373. package/build-module/components/visual-editor/index.js.map +1 -1
  374. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  375. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +46 -0
  376. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
  377. package/build-module/components/zoom-out-toggle/index.js +37 -5
  378. package/build-module/components/zoom-out-toggle/index.js.map +1 -1
  379. package/build-module/dataviews/actions/duplicate-template-part.js +4 -4
  380. package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
  381. package/build-module/hooks/pattern-overrides.js +1 -3
  382. package/build-module/hooks/pattern-overrides.js.map +1 -1
  383. package/build-module/private-apis.js +1 -2
  384. package/build-module/private-apis.js.map +1 -1
  385. package/build-module/store/actions.js +30 -4
  386. package/build-module/store/actions.js.map +1 -1
  387. package/build-module/store/constants.js +1 -0
  388. package/build-module/store/constants.js.map +1 -1
  389. package/build-module/store/local-autosave.js.map +1 -1
  390. package/build-module/store/private-actions.js +9 -8
  391. package/build-module/store/private-actions.js.map +1 -1
  392. package/build-module/store/selectors.js +24 -2
  393. package/build-module/store/selectors.js.map +1 -1
  394. package/build-module/utils/media-upload/index.js.map +1 -1
  395. package/build-module/utils/pageTypeBadge.js +45 -0
  396. package/build-module/utils/pageTypeBadge.js.map +1 -0
  397. package/build-module/utils/terms.js +2 -2
  398. package/build-module/utils/terms.js.map +1 -1
  399. package/build-style/style-rtl.css +116 -59
  400. package/build-style/style.css +116 -59
  401. package/build-types/bindings/api.d.ts +0 -13
  402. package/build-types/bindings/api.d.ts.map +1 -1
  403. package/build-types/bindings/post-meta.d.ts.map +1 -1
  404. package/build-types/components/collab-sidebar/add-comment.d.ts +15 -0
  405. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -0
  406. package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts +5 -0
  407. package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts.map +1 -0
  408. package/build-types/components/collab-sidebar/comment-button.d.ts +5 -0
  409. package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -0
  410. package/build-types/components/collab-sidebar/comments.d.ts +19 -0
  411. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -0
  412. package/build-types/components/collab-sidebar/constants.d.ts +2 -0
  413. package/build-types/components/collab-sidebar/constants.d.ts.map +1 -0
  414. package/build-types/components/collab-sidebar/index.d.ts +5 -0
  415. package/build-types/components/collab-sidebar/index.d.ts.map +1 -0
  416. package/build-types/components/collab-sidebar/utils.d.ts +8 -0
  417. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -0
  418. package/build-types/components/commands/index.d.ts.map +1 -1
  419. package/build-types/components/document-bar/index.d.ts.map +1 -1
  420. package/build-types/components/document-tools/index.d.ts.map +1 -1
  421. package/build-types/components/editor-interface/index.d.ts +1 -2
  422. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  423. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  424. package/build-types/components/header/index.d.ts.map +1 -1
  425. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  426. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  427. package/build-types/components/plugin-more-menu-item/index.d.ts +62 -2
  428. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
  429. package/build-types/components/plugin-preview-menu-item/index.d.ts +41 -2
  430. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
  431. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  432. package/build-types/components/post-author/panel.d.ts.map +1 -1
  433. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  434. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  435. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  436. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  437. package/build-types/components/post-url/index.d.ts.map +1 -1
  438. package/build-types/components/post-url/panel.d.ts.map +1 -1
  439. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  440. package/build-types/components/provider/index.d.ts.map +1 -1
  441. package/build-types/components/sidebar/index.d.ts.map +1 -1
  442. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
  443. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  444. package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts +5 -0
  445. package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts.map +1 -0
  446. package/build-types/components/zoom-out-toggle/index.d.ts +3 -1
  447. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
  448. package/build-types/private-apis.d.ts.map +1 -1
  449. package/build-types/store/actions.d.ts +1 -4
  450. package/build-types/store/actions.d.ts.map +1 -1
  451. package/build-types/store/selectors.d.ts +21 -0
  452. package/build-types/store/selectors.d.ts.map +1 -1
  453. package/build-types/utils/pageTypeBadge.d.ts +5 -0
  454. package/build-types/utils/pageTypeBadge.d.ts.map +1 -0
  455. package/build-types/utils/terms.d.ts.map +1 -1
  456. package/package.json +39 -38
  457. package/src/bindings/api.js +1 -32
  458. package/src/bindings/post-meta.js +1 -0
  459. package/src/components/collab-sidebar/add-comment.js +124 -0
  460. package/src/components/collab-sidebar/comment-button-toolbar.js +29 -0
  461. package/src/components/collab-sidebar/comment-button.js +31 -0
  462. package/src/components/collab-sidebar/comments.js +404 -0
  463. package/src/components/collab-sidebar/constants.js +1 -0
  464. package/src/components/collab-sidebar/index.js +307 -0
  465. package/src/components/collab-sidebar/style.scss +111 -0
  466. package/src/components/collab-sidebar/utils.js +9 -0
  467. package/src/components/commands/index.js +9 -7
  468. package/src/components/document-bar/index.js +15 -7
  469. package/src/components/document-bar/style.scss +0 -4
  470. package/src/components/document-tools/index.js +2 -8
  471. package/src/components/editor-interface/index.js +4 -18
  472. package/src/components/entities-saved-states/index.js +2 -2
  473. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  474. package/src/components/global-styles-provider/index.js +20 -6
  475. package/src/components/header/index.js +3 -1
  476. package/src/components/header/style.scss +1 -0
  477. package/src/components/inserter-sidebar/index.js +3 -6
  478. package/src/components/page-attributes/parent.js +6 -4
  479. package/src/components/plugin-more-menu-item/index.js +12 -11
  480. package/src/components/plugin-preview-menu-item/index.js +14 -13
  481. package/src/components/plugin-sidebar/index.js +0 -13
  482. package/src/components/post-actions/index.js +8 -11
  483. package/src/components/post-author/panel.js +4 -2
  484. package/src/components/post-card-panel/index.js +9 -43
  485. package/src/components/post-card-panel/style.scss +1 -9
  486. package/src/components/post-content-information/index.js +1 -1
  487. package/src/components/post-featured-image/index.js +31 -16
  488. package/src/components/post-featured-image/style.scss +5 -2
  489. package/src/components/post-last-revision/index.js +1 -1
  490. package/src/components/post-saved-state/test/__snapshots__/index.js.snap +1 -1
  491. package/src/components/post-schedule/label.js +1 -1
  492. package/src/components/post-sticky/test/index.js +6 -6
  493. package/src/components/post-taxonomies/flat-term-selector.js +15 -4
  494. package/src/components/post-taxonomies/hierarchical-term-selector.js +3 -2
  495. package/src/components/post-template/classic-theme.js +1 -2
  496. package/src/components/post-url/index.js +67 -55
  497. package/src/components/post-url/panel.js +61 -35
  498. package/src/components/post-url/style.scss +21 -3
  499. package/src/components/preview-dropdown/index.js +0 -2
  500. package/src/components/provider/index.js +32 -24
  501. package/src/components/provider/use-block-editor-settings.js +1 -1
  502. package/src/components/sidebar/header.js +3 -2
  503. package/src/components/sidebar/index.js +5 -3
  504. package/src/components/time-to-read/index.js +3 -3
  505. package/src/components/visual-editor/edit-template-blocks-notification.js +5 -1
  506. package/src/components/visual-editor/index.js +32 -39
  507. package/src/components/visual-editor/use-zoom-out-mode-exit.js +49 -0
  508. package/src/components/zoom-out-toggle/index.js +39 -5
  509. package/src/dataviews/actions/duplicate-template-part.tsx +3 -3
  510. package/src/private-apis.js +1 -5
  511. package/src/store/actions.js +33 -4
  512. package/src/store/private-actions.js +3 -3
  513. package/src/store/selectors.js +24 -2
  514. package/src/style.scss +1 -0
  515. package/src/utils/pageTypeBadge.js +41 -0
  516. package/src/utils/terms.js +4 -2
  517. package/src/utils/test/terms.js +3 -3
  518. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,307 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { useSelect, useDispatch, resolveSelect } from '@wordpress/data';
6
+ import { useState, useEffect, useMemo } from '@wordpress/element';
7
+ import { comment as commentIcon } from '@wordpress/icons';
8
+ import { addFilter } from '@wordpress/hooks';
9
+ import { store as noticesStore } from '@wordpress/notices';
10
+ import { store as coreStore } from '@wordpress/core-data';
11
+ import { store as blockEditorStore } from '@wordpress/block-editor';
12
+ import { store as interfaceStore } from '@wordpress/interface';
13
+
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+ import PluginSidebar from '../plugin-sidebar';
18
+ import { collabSidebarName } from './constants';
19
+ import { Comments } from './comments';
20
+ import { AddComment } from './add-comment';
21
+ import { store as editorStore } from '../../store';
22
+ import AddCommentButton from './comment-button';
23
+ import AddCommentToolbarButton from './comment-button-toolbar';
24
+
25
+ const threadsEmptyArray = [];
26
+
27
+ const isBlockCommentExperimentEnabled =
28
+ window?.__experimentalEnableBlockComment;
29
+ const modifyBlockCommentAttributes = ( settings ) => {
30
+ if ( ! settings.attributes.blockCommentId ) {
31
+ settings.attributes = {
32
+ ...settings.attributes,
33
+ blockCommentId: {
34
+ type: 'number',
35
+ },
36
+ };
37
+ }
38
+
39
+ return settings;
40
+ };
41
+
42
+ // Apply the filter to all core blocks
43
+ addFilter(
44
+ 'blocks.registerBlockType',
45
+ 'block-comment/modify-core-block-attributes',
46
+ modifyBlockCommentAttributes
47
+ );
48
+
49
+ /**
50
+ * Renders the Collab sidebar.
51
+ */
52
+ export default function CollabSidebar() {
53
+ const { createNotice } = useDispatch( noticesStore );
54
+ const { saveEntityRecord, deleteEntityRecord } = useDispatch( coreStore );
55
+ const { getEntityRecord } = resolveSelect( coreStore );
56
+ const { enableComplementaryArea } = useDispatch( interfaceStore );
57
+ const [ blockCommentID, setBlockCommentID ] = useState( null );
58
+ const [ showCommentBoard, setShowCommentBoard ] = useState( false );
59
+ const { postId } = useSelect( ( select ) => {
60
+ return {
61
+ postId: select( editorStore ).getCurrentPostId(),
62
+ };
63
+ }, [] );
64
+
65
+ const postStatus = useSelect( ( select ) => {
66
+ const post = select( editorStore ).getCurrentPost();
67
+ return { postStatus: post?.status };
68
+ }, [] );
69
+
70
+ const threads = useSelect(
71
+ ( select ) => {
72
+ if ( ! postId ) {
73
+ return threadsEmptyArray;
74
+ }
75
+ const { getEntityRecords } = select( coreStore );
76
+ const data = getEntityRecords( 'root', 'comment', {
77
+ post: postId,
78
+ type: 'block_comment',
79
+ status: 'any',
80
+ per_page: 100,
81
+ } );
82
+ return data || threadsEmptyArray;
83
+ },
84
+ [ postId ]
85
+ );
86
+
87
+ const clientId = useSelect( ( select ) => {
88
+ const { getSelectedBlockClientId } = select( blockEditorStore );
89
+ return getSelectedBlockClientId();
90
+ }, [] );
91
+
92
+ const blockDetails = useSelect(
93
+ ( select ) => {
94
+ return clientId
95
+ ? select( blockEditorStore ).getBlock( clientId )
96
+ : null;
97
+ },
98
+ [ clientId ]
99
+ );
100
+
101
+ // Get the dispatch functions to save the comment and update the block attributes.
102
+ const { updateBlockAttributes } = useDispatch( blockEditorStore );
103
+
104
+ // Process comments to build the tree structure
105
+ const resultComments = useMemo( () => {
106
+ // Create a compare to store the references to all objects by id
107
+ const compare = {};
108
+ const result = [];
109
+
110
+ const filteredComments = threads.filter(
111
+ ( comment ) => comment.status !== 'trash'
112
+ );
113
+
114
+ // Initialize each object with an empty `reply` array
115
+ filteredComments.forEach( ( item ) => {
116
+ compare[ item.id ] = { ...item, reply: [] };
117
+ } );
118
+
119
+ // Iterate over the data to build the tree structure
120
+ filteredComments.forEach( ( item ) => {
121
+ if ( item.parent === 0 ) {
122
+ // If parent is 0, it's a root item, push it to the result array
123
+ result.push( compare[ item.id ] );
124
+ } else if ( compare[ item.parent ] ) {
125
+ // Otherwise, find its parent and push it to the parent's `reply` array
126
+ compare[ item.parent ].reply.push( compare[ item.id ] );
127
+ }
128
+ } );
129
+
130
+ return result;
131
+ }, [ threads ] );
132
+
133
+ const openCollabBoard = () => {
134
+ setShowCommentBoard( true );
135
+ enableComplementaryArea( 'core', 'edit-post/collab-sidebar' );
136
+ };
137
+
138
+ // Function to save the comment.
139
+ const addNewComment = async ( comment, parentCommentId ) => {
140
+ const args = {
141
+ post: postId,
142
+ content: comment,
143
+ comment_type: 'block_comment',
144
+ comment_approved: 0,
145
+ };
146
+
147
+ // Create a new object, conditionally including the parent property
148
+ const updatedArgs = {
149
+ ...args,
150
+ ...( parentCommentId ? { parent: parentCommentId } : {} ),
151
+ };
152
+
153
+ const savedRecord = await saveEntityRecord(
154
+ 'root',
155
+ 'comment',
156
+ updatedArgs
157
+ );
158
+
159
+ if ( savedRecord ) {
160
+ // If it's a main comment, update the block attributes with the comment id.
161
+ if ( ! parentCommentId ) {
162
+ updateBlockAttributes( clientId, {
163
+ blockCommentId: savedRecord?.id,
164
+ } );
165
+ }
166
+
167
+ createNotice(
168
+ 'snackbar',
169
+ parentCommentId
170
+ ? // translators: Reply added successfully
171
+ __( 'Reply added successfully.' )
172
+ : // translators: Comment added successfully
173
+ __( 'Comment added successfully.' ),
174
+ {
175
+ type: 'snackbar',
176
+ isDismissible: true,
177
+ }
178
+ );
179
+ } else {
180
+ onError();
181
+ }
182
+ };
183
+
184
+ const onCommentResolve = async ( commentId ) => {
185
+ const savedRecord = await saveEntityRecord( 'root', 'comment', {
186
+ id: commentId,
187
+ status: 'approved',
188
+ } );
189
+
190
+ if ( savedRecord ) {
191
+ // translators: Comment resolved successfully
192
+ createNotice( 'snackbar', __( 'Comment marked as resolved.' ), {
193
+ type: 'snackbar',
194
+ isDismissible: true,
195
+ } );
196
+ } else {
197
+ onError();
198
+ }
199
+ };
200
+
201
+ const onEditComment = async ( commentId, comment ) => {
202
+ const savedRecord = await saveEntityRecord( 'root', 'comment', {
203
+ id: commentId,
204
+ content: comment,
205
+ } );
206
+
207
+ if ( savedRecord ) {
208
+ createNotice(
209
+ 'snackbar',
210
+ // translators: Comment edited successfully
211
+ __( 'Comment edited successfully.' ),
212
+ {
213
+ type: 'snackbar',
214
+ isDismissible: true,
215
+ }
216
+ );
217
+ } else {
218
+ onError();
219
+ }
220
+ };
221
+
222
+ const onError = () => {
223
+ createNotice(
224
+ 'error',
225
+ // translators: Error message when comment submission fails
226
+ __(
227
+ 'Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier.'
228
+ ),
229
+ {
230
+ isDismissible: true,
231
+ }
232
+ );
233
+ };
234
+
235
+ const onCommentDelete = async ( commentId ) => {
236
+ const childComment = await getEntityRecord(
237
+ 'root',
238
+ 'comment',
239
+ commentId
240
+ );
241
+ await deleteEntityRecord( 'root', 'comment', commentId );
242
+
243
+ if ( childComment && ! childComment.parent ) {
244
+ updateBlockAttributes( clientId, {
245
+ blockCommentId: undefined,
246
+ } );
247
+ }
248
+
249
+ createNotice(
250
+ 'snackbar',
251
+ // translators: Comment deleted successfully
252
+ __( 'Comment deleted successfully.' ),
253
+ {
254
+ type: 'snackbar',
255
+ isDismissible: true,
256
+ }
257
+ );
258
+ };
259
+
260
+ useEffect( () => {
261
+ if ( blockDetails ) {
262
+ setBlockCommentID( blockDetails?.attributes.blockCommentId );
263
+ }
264
+ }, [ postId, clientId ] );
265
+
266
+ // Check if the experimental flag is enabled.
267
+ if (
268
+ ! isBlockCommentExperimentEnabled ||
269
+ postStatus.postStatus === 'publish'
270
+ ) {
271
+ return null; // or maybe return some message indicating no threads are available.
272
+ }
273
+
274
+ return (
275
+ <>
276
+ { ! blockCommentID && (
277
+ <AddCommentButton onClick={ openCollabBoard } />
278
+ ) }
279
+
280
+ { blockCommentID > 0 && (
281
+ <AddCommentToolbarButton onClick={ openCollabBoard } />
282
+ ) }
283
+ <PluginSidebar
284
+ identifier={ collabSidebarName }
285
+ // translators: Comments sidebar title
286
+ title={ __( 'Comments' ) }
287
+ icon={ commentIcon }
288
+ >
289
+ <div className="editor-collab-sidebar-panel">
290
+ <AddComment
291
+ threads={ resultComments }
292
+ onSubmit={ addNewComment }
293
+ showCommentBoard={ showCommentBoard }
294
+ setShowCommentBoard={ setShowCommentBoard }
295
+ />
296
+ <Comments
297
+ threads={ resultComments }
298
+ onEditComment={ onEditComment }
299
+ onAddReply={ addNewComment }
300
+ onCommentDelete={ onCommentDelete }
301
+ onCommentResolve={ onCommentResolve }
302
+ />
303
+ </div>
304
+ </PluginSidebar>
305
+ </>
306
+ );
307
+ }
@@ -0,0 +1,111 @@
1
+ .editor-collab-sidebar-panel {
2
+ padding: $grid-unit-20;
3
+
4
+ &__thread {
5
+ position: relative;
6
+ padding: $grid-unit-20;
7
+ border-radius: $radius-large;
8
+ border: 1px solid $gray-300;
9
+ background-color: $gray-100;
10
+ margin-bottom: $grid-unit-20;
11
+ }
12
+
13
+ &__active-thread {
14
+ border: 1.5px solid #3858e9;
15
+ background-color: $white;
16
+ box-shadow: 0 5.5px 7.8px -0.3px rgba(0, 0, 0, 0.102);
17
+ }
18
+
19
+ &__comment-field {
20
+ flex: 1;
21
+ }
22
+
23
+ &__child-thread {
24
+ margin-top: 15px;
25
+ }
26
+
27
+ &__user-name {
28
+ font-size: 12px;
29
+ font-weight: 400;
30
+ line-height: 16px;
31
+ text-align: left;
32
+ color: $gray-700;
33
+ text-transform: capitalize;
34
+ }
35
+
36
+ &__user-time {
37
+ font-size: 12px;
38
+ font-weight: 400;
39
+ line-height: 16px;
40
+ text-align: left;
41
+ color: $gray-700;
42
+ }
43
+
44
+ &__user-comment {
45
+ font-size: 13px;
46
+ font-weight: 400;
47
+ line-height: 20px;
48
+ text-align: left;
49
+ color: $gray-900;
50
+
51
+ p {
52
+ margin-bottom: 0;
53
+ }
54
+ }
55
+
56
+ &__user-avatar {
57
+ border-radius: $radius-round;
58
+ flex-shrink: 0;
59
+ }
60
+
61
+ &__thread-overlay {
62
+ background-color: rgba(0, 0, 0, 0.7);
63
+ width: 100%;
64
+ height: 100%;
65
+ text-align: center;
66
+ position: absolute;
67
+ top: 0;
68
+ left: 0;
69
+ z-index: 1;
70
+ padding: 15px;
71
+ border-radius: $radius-large;
72
+ color: $white;
73
+
74
+ p {
75
+ margin-bottom: 15px;
76
+ }
77
+
78
+ button {
79
+ padding: 4px 10px;
80
+ color: $white;
81
+ }
82
+ }
83
+
84
+ &__comment-status {
85
+ margin-left: auto;
86
+
87
+ button {
88
+ &.has-icon:not(.has-text) {
89
+ min-width: 24px;
90
+ padding: 0;
91
+ width: 24px;
92
+ height: 24px;
93
+ flex-shrink: 0;
94
+ }
95
+ }
96
+ }
97
+
98
+ &__comment-dropdown-menu {
99
+ flex-shrink: 0;
100
+
101
+ button {
102
+ &.has-icon {
103
+ min-width: 24px;
104
+ padding: 0;
105
+ width: 24px;
106
+ height: 24px;
107
+ }
108
+ }
109
+ }
110
+
111
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Sanitizes a comment string by removing non-printable ASCII characters.
3
+ *
4
+ * @param {string} str - The comment string to sanitize.
5
+ * @return {string} - The sanitized comment string.
6
+ */
7
+ export function sanitizeCommentString( str ) {
8
+ return str.trim();
9
+ }
@@ -57,7 +57,7 @@ function useEditorCommandLoader() {
57
57
  isDistractionFree: get( 'core', 'distractionFree' ),
58
58
  isFocusMode: get( 'core', 'focusMode' ),
59
59
  isTopToolbar: get( 'core', 'fixedToolbar' ),
60
- isPreviewMode: getSettings().__unstableIsPreviewMode,
60
+ isPreviewMode: getSettings().isPreviewMode,
61
61
  isViewable: getPostType( getCurrentPostType() )?.viewable ?? false,
62
62
  isCodeEditingEnabled: getEditorSettings().codeEditingEnabled,
63
63
  isRichEditingEnabled: getEditorSettings().richEditingEnabled,
@@ -98,8 +98,8 @@ function useEditorCommandLoader() {
98
98
  commands.push( {
99
99
  name: 'core/toggle-distraction-free',
100
100
  label: isDistractionFree
101
- ? __( 'Exit Distraction Free' )
102
- : __( 'Enter Distraction Free' ),
101
+ ? __( 'Exit Distraction free' )
102
+ : __( 'Enter Distraction free' ),
103
103
  callback: ( { close } ) => {
104
104
  toggleDistractionFree();
105
105
  close();
@@ -117,7 +117,9 @@ function useEditorCommandLoader() {
117
117
 
118
118
  commands.push( {
119
119
  name: 'core/toggle-spotlight-mode',
120
- label: __( 'Toggle spotlight' ),
120
+ label: isFocusMode
121
+ ? __( 'Exit Spotlight mode' )
122
+ : __( 'Enter Spotlight mode' ),
121
123
  callback: ( { close } ) => {
122
124
  toggle( 'core', 'focusMode' );
123
125
  close();
@@ -160,7 +162,7 @@ function useEditorCommandLoader() {
160
162
 
161
163
  commands.push( {
162
164
  name: 'core/toggle-top-toolbar',
163
- label: __( 'Toggle top toolbar' ),
165
+ label: __( 'Top toolbar' ),
164
166
  callback: ( { close } ) => {
165
167
  toggle( 'core', 'fixedToolbar' );
166
168
  if ( isDistractionFree ) {
@@ -224,7 +226,7 @@ function useEditorCommandLoader() {
224
226
 
225
227
  commands.push( {
226
228
  name: 'core/open-settings-sidebar',
227
- label: __( 'Toggle settings sidebar' ),
229
+ label: __( 'Show or hide the Settings panel.' ),
228
230
  icon: isRTL() ? drawerLeft : drawerRight,
229
231
  callback: ( { close } ) => {
230
232
  const activeSidebar = getActiveComplementaryArea( 'core' );
@@ -239,7 +241,7 @@ function useEditorCommandLoader() {
239
241
 
240
242
  commands.push( {
241
243
  name: 'core/open-block-inspector',
242
- label: __( 'Toggle block inspector' ),
244
+ label: __( 'Show or hide the Block settings panel' ),
243
245
  icon: blockDefault,
244
246
  callback: ( { close } ) => {
245
247
  const activeSidebar = getActiveComplementaryArea( 'core' );
@@ -26,8 +26,9 @@ import { decodeEntities } from '@wordpress/html-entities';
26
26
  /**
27
27
  * Internal dependencies
28
28
  */
29
- import { TEMPLATE_POST_TYPES, GLOBAL_POST_TYPES } from '../../store/constants';
29
+ import { TEMPLATE_POST_TYPES } from '../../store/constants';
30
30
  import { store as editorStore } from '../../store';
31
+ import usePageTypeBadge from '../../utils/pageTypeBadge';
31
32
 
32
33
  /** @typedef {import("@wordpress/components").IconType} IconType */
33
34
 
@@ -56,7 +57,6 @@ export default function DocumentBar( props ) {
56
57
  postTypeLabel,
57
58
  documentTitle,
58
59
  isNotFound,
59
- isUnsyncedPattern,
60
60
  templateTitle,
61
61
  onNavigateToPreviousEntityRecord,
62
62
  } = useSelect( ( select ) => {
@@ -93,7 +93,6 @@ export default function DocumentBar( props ) {
93
93
  _postType,
94
94
  _postId
95
95
  ),
96
- isUnsyncedPattern: _document?.wp_pattern_sync_status === 'unsynced',
97
96
  templateTitle: _templateInfo.title,
98
97
  onNavigateToPreviousEntityRecord:
99
98
  getEditorSettings().onNavigateToPreviousEntityRecord,
@@ -104,12 +103,13 @@ export default function DocumentBar( props ) {
104
103
  const isReducedMotion = useReducedMotion();
105
104
 
106
105
  const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
107
- const isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );
108
106
  const hasBackButton = !! onNavigateToPreviousEntityRecord;
109
107
  const entityTitle = isTemplate ? templateTitle : documentTitle;
110
108
  const title = props.title || entityTitle;
111
109
  const icon = props.icon;
112
110
 
111
+ const pageTypeBadge = usePageTypeBadge();
112
+
113
113
  const mountedRef = useRef( false );
114
114
  useEffect( () => {
115
115
  mountedRef.current = true;
@@ -119,7 +119,6 @@ export default function DocumentBar( props ) {
119
119
  <div
120
120
  className={ clsx( 'editor-document-bar', {
121
121
  'has-back-button': hasBackButton,
122
- 'is-global': isGlobalEntity && ! isUnsyncedPattern,
123
122
  } ) }
124
123
  >
125
124
  <AnimatePresence>
@@ -184,11 +183,20 @@ export default function DocumentBar( props ) {
184
183
  ? decodeEntities( title )
185
184
  : __( 'No title' ) }
186
185
  </span>
187
- { postTypeLabel && ! props.title && (
186
+ { pageTypeBadge && (
188
187
  <span className="editor-document-bar__post-type-label">
189
- { ' + decodeEntities( postTypeLabel ) }
188
+ { ${ pageTypeBadge }` }
190
189
  </span>
191
190
  ) }
191
+ { postTypeLabel &&
192
+ ! props.title &&
193
+ ! pageTypeBadge && (
194
+ <span className="editor-document-bar__post-type-label">
195
+ { `· ${ decodeEntities(
196
+ postTypeLabel
197
+ ) }` }
198
+ </span>
199
+ ) }
192
200
  </Text>
193
201
  </motion.div>
194
202
  <span className="editor-document-bar__shortcut">
@@ -67,10 +67,6 @@
67
67
  flex: 1;
68
68
  overflow: hidden;
69
69
  text-overflow: ellipsis;
70
-
71
- .editor-document-bar.is-global & {
72
- color: var(--wp-block-synced-color);
73
- }
74
70
  }
75
71
 
76
72
  .editor-document-bar__post-type-label {
@@ -9,11 +9,7 @@ import clsx from 'clsx';
9
9
  import { useViewportMatch } from '@wordpress/compose';
10
10
  import { useSelect, useDispatch } from '@wordpress/data';
11
11
  import { __, _x } from '@wordpress/i18n';
12
- import {
13
- NavigableToolbar,
14
- ToolSelector,
15
- store as blockEditorStore,
16
- } from '@wordpress/block-editor';
12
+ import { NavigableToolbar, ToolSelector } from '@wordpress/block-editor';
17
13
  import { Button, ToolbarItem } from '@wordpress/components';
18
14
  import { listView, plus } from '@wordpress/icons';
19
15
  import { useCallback } from '@wordpress/element';
@@ -48,7 +44,6 @@ function DocumentTools( { className, disableBlockTools = false } ) {
48
44
  getListViewToggleRef,
49
45
  } = unlock( select( editorStore ) );
50
46
  const { getShortcutRepresentation } = select( keyboardShortcutsStore );
51
- const { __unstableGetEditorMode } = select( blockEditorStore );
52
47
 
53
48
  return {
54
49
  isInserterOpened: select( editorStore ).isInserterOpened(),
@@ -61,7 +56,6 @@ function DocumentTools( { className, disableBlockTools = false } ) {
61
56
  showIconLabels: get( 'core', 'showIconLabels' ),
62
57
  isDistractionFree: get( 'core', 'distractionFree' ),
63
58
  isVisualMode: getEditorMode() === 'visual',
64
- isZoomedOutView: __unstableGetEditorMode() === 'zoom-out',
65
59
  };
66
60
  }, [] );
67
61
 
@@ -96,7 +90,7 @@ function DocumentTools( { className, disableBlockTools = false } ) {
96
90
 
97
91
  /* translators: button label text should, if possible, be under 16 characters. */
98
92
  const longLabel = _x(
99
- 'Toggle block inserter',
93
+ 'Block Inserter',
100
94
  'Generic label for block inserter button'
101
95
  );
102
96
  const shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );
@@ -15,7 +15,6 @@ import {
15
15
  BlockBreadcrumb,
16
16
  BlockToolbar,
17
17
  } from '@wordpress/block-editor';
18
- import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
19
18
  import { useViewportMatch } from '@wordpress/compose';
20
19
  import { useState, useCallback } from '@wordpress/element';
21
20
 
@@ -49,7 +48,6 @@ const interfaceLabels = {
49
48
 
50
49
  export default function EditorInterface( {
51
50
  className,
52
- enableRegionNavigation,
53
51
  styles,
54
52
  children,
55
53
  forceIsDirty,
@@ -69,8 +67,6 @@ export default function EditorInterface( {
69
67
  isListViewOpened,
70
68
  isDistractionFree,
71
69
  isPreviewMode,
72
- previousShortcut,
73
- nextShortcut,
74
70
  showBlockBreadcrumbs,
75
71
  documentLabel,
76
72
  isZoomOut,
@@ -87,16 +83,11 @@ export default function EditorInterface( {
87
83
  isInserterOpened: select( editorStore ).isInserterOpened(),
88
84
  isListViewOpened: select( editorStore ).isListViewOpened(),
89
85
  isDistractionFree: get( 'core', 'distractionFree' ),
90
- isPreviewMode: editorSettings.__unstableIsPreviewMode,
91
- previousShortcut: select(
92
- keyboardShortcutsStore
93
- ).getAllShortcutKeyCombinations( 'core/editor/previous-region' ),
94
- nextShortcut: select(
95
- keyboardShortcutsStore
96
- ).getAllShortcutKeyCombinations( 'core/editor/next-region' ),
86
+ isPreviewMode: editorSettings.isPreviewMode,
97
87
  showBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),
98
- // translators: Default label for the Document in the Block Breadcrumb.
99
- documentLabel: postTypeLabel || _x( 'Document', 'noun' ),
88
+ documentLabel:
89
+ // translators: Default label for the Document in the Block Breadcrumb.
90
+ postTypeLabel || _x( 'Document', 'noun, breadcrumb' ),
100
91
  isZoomOut: _isZoomOut(),
101
92
  };
102
93
  }, [] );
@@ -121,7 +112,6 @@ export default function EditorInterface( {
121
112
 
122
113
  return (
123
114
  <InterfaceSkeleton
124
- enableRegionNavigation={ enableRegionNavigation }
125
115
  isDistractionFree={ isDistractionFree }
126
116
  className={ clsx( 'editor-editor-interface', className, {
127
117
  'is-entity-save-view-open': !! entitiesSavedStatesCallback,
@@ -231,10 +221,6 @@ export default function EditorInterface( {
231
221
  )
232
222
  : undefined
233
223
  }
234
- shortcuts={ {
235
- previous: previousShortcut,
236
- next: nextShortcut,
237
- } }
238
224
  />
239
225
  );
240
226
  }
@@ -177,9 +177,9 @@ export function EntitiesSavedStatesExtensible( {
177
177
  _n(
178
178
  'There is <strong>%d site change</strong> waiting to be saved.',
179
179
  'There are <strong>%d site changes</strong> waiting to be saved.',
180
- sortedPartitionedSavables.length
180
+ dirtyEntityRecords.length
181
181
  ),
182
- sortedPartitionedSavables.length
182
+ dirtyEntityRecords.length
183
183
  ),
184
184
  { strong: <strong /> }
185
185
  )