@wordpress/editor 14.13.1-next.cd6172eb0.0 → 14.15.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 (478) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +1 -0
  4. package/build/bindings/pattern-overrides.js +1 -0
  5. package/build/bindings/pattern-overrides.js.map +1 -1
  6. package/build/bindings/post-meta.js +1 -0
  7. package/build/bindings/post-meta.js.map +1 -1
  8. package/build/components/autocompleters/user.js +1 -0
  9. package/build/components/autocompleters/user.js.map +1 -1
  10. package/build/components/block-removal-warnings/index.js +1 -0
  11. package/build/components/block-removal-warnings/index.js.map +1 -1
  12. package/build/components/block-settings-menu/content-only-settings-menu.js +1 -0
  13. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  14. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -0
  15. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  16. package/build/components/collab-sidebar/add-comment.js +1 -1
  17. package/build/components/collab-sidebar/add-comment.js.map +1 -1
  18. package/build/components/collab-sidebar/comment-button.js +7 -2
  19. package/build/components/collab-sidebar/comment-button.js.map +1 -1
  20. package/build/components/collab-sidebar/comment-form.js +4 -1
  21. package/build/components/collab-sidebar/comment-form.js.map +1 -1
  22. package/build/components/collab-sidebar/comments.js +199 -185
  23. package/build/components/collab-sidebar/comments.js.map +1 -1
  24. package/build/components/collab-sidebar/index.js +11 -4
  25. package/build/components/collab-sidebar/index.js.map +1 -1
  26. package/build/components/collab-sidebar/utils.js +1 -0
  27. package/build/components/collab-sidebar/utils.js.map +1 -1
  28. package/build/components/commands/index.js +28 -0
  29. package/build/components/commands/index.js.map +1 -1
  30. package/build/components/deprecated.js +1 -0
  31. package/build/components/deprecated.js.map +1 -1
  32. package/build/components/document-bar/index.js +5 -2
  33. package/build/components/document-bar/index.js.map +1 -1
  34. package/build/components/document-outline/index.js +1 -0
  35. package/build/components/document-outline/index.js.map +1 -1
  36. package/build/components/document-tools/index.js +3 -6
  37. package/build/components/document-tools/index.js.map +1 -1
  38. package/build/components/editor-help/index.native.js +1 -0
  39. package/build/components/editor-help/index.native.js.map +1 -1
  40. package/build/components/editor-help/intro-to-blocks.native.js +1 -1
  41. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  42. package/build/components/editor-notices/index.js +1 -0
  43. package/build/components/editor-notices/index.js.map +1 -1
  44. package/build/components/editor-snackbars/index.js +1 -0
  45. package/build/components/editor-snackbars/index.js.map +1 -1
  46. package/build/components/entities-saved-states/entity-type-list.js +1 -0
  47. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  48. package/build/components/entities-saved-states/hooks/use-is-dirty.js +1 -0
  49. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  50. package/build/components/entities-saved-states/index.js +3 -1
  51. package/build/components/entities-saved-states/index.js.map +1 -1
  52. package/build/components/error-boundary/index.js +26 -13
  53. package/build/components/error-boundary/index.js.map +1 -1
  54. package/build/components/error-boundary/index.native.js +1 -1
  55. package/build/components/error-boundary/index.native.js.map +1 -1
  56. package/build/components/keyboard-shortcut-help-modal/index.js +1 -0
  57. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  58. package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
  59. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  60. package/build/components/list-view-sidebar/index.js +1 -0
  61. package/build/components/list-view-sidebar/index.js.map +1 -1
  62. package/build/components/local-autosave-monitor/index.js +1 -0
  63. package/build/components/local-autosave-monitor/index.js.map +1 -1
  64. package/build/components/mode-switcher/index.js +1 -0
  65. package/build/components/mode-switcher/index.js.map +1 -1
  66. package/build/components/more-menu/index.js +0 -1
  67. package/build/components/more-menu/index.js.map +1 -1
  68. package/build/components/page-attributes/parent.js +1 -0
  69. package/build/components/page-attributes/parent.js.map +1 -1
  70. package/build/components/post-actions/actions.js +10 -4
  71. package/build/components/post-actions/actions.js.map +1 -1
  72. package/build/components/post-actions/index.js +80 -91
  73. package/build/components/post-actions/index.js.map +1 -1
  74. package/build/components/post-actions/set-as-homepage.js +23 -34
  75. package/build/components/post-actions/set-as-homepage.js.map +1 -1
  76. package/build/components/post-actions/set-as-posts-page.js +154 -0
  77. package/build/components/post-actions/set-as-posts-page.js.map +1 -0
  78. package/build/components/post-author/hook.js +1 -0
  79. package/build/components/post-author/hook.js.map +1 -1
  80. package/build/components/post-card-panel/index.js +64 -24
  81. package/build/components/post-card-panel/index.js.map +1 -1
  82. package/build/components/post-fields/index.js +1 -0
  83. package/build/components/post-fields/index.js.map +1 -1
  84. package/build/components/post-format/index.js +1 -0
  85. package/build/components/post-format/index.js.map +1 -1
  86. package/build/components/post-format/panel.js +1 -0
  87. package/build/components/post-format/panel.js.map +1 -1
  88. package/build/components/post-publish-button/index.js +1 -0
  89. package/build/components/post-publish-button/index.js.map +1 -1
  90. package/build/components/post-publish-panel/maybe-category-panel.js +1 -0
  91. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  92. package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  93. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  94. package/build/components/post-publish-panel/maybe-upload-media.js +2 -1
  95. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  96. package/build/components/post-publish-panel/media-util.js +1 -0
  97. package/build/components/post-publish-panel/media-util.js.map +1 -1
  98. package/build/components/post-publish-panel/prepublish.js +1 -1
  99. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  100. package/build/components/post-saved-state/index.js +1 -0
  101. package/build/components/post-saved-state/index.js.map +1 -1
  102. package/build/components/post-schedule/index.js +1 -0
  103. package/build/components/post-schedule/index.js.map +1 -1
  104. package/build/components/post-taxonomies/flat-term-selector.js +1 -0
  105. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  106. package/build/components/post-taxonomies/hierarchical-term-selector.js +1 -0
  107. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  108. package/build/components/post-taxonomies/index.js +1 -0
  109. package/build/components/post-taxonomies/index.js.map +1 -1
  110. package/build/components/post-taxonomies/most-used-terms.js +1 -0
  111. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  112. package/build/components/post-template/classic-theme.js +1 -0
  113. package/build/components/post-template/classic-theme.js.map +1 -1
  114. package/build/components/post-template/swap-template-button.js +1 -0
  115. package/build/components/post-template/swap-template-button.js.map +1 -1
  116. package/build/components/post-transform-panel/hooks.js +1 -0
  117. package/build/components/post-transform-panel/hooks.js.map +1 -1
  118. package/build/components/post-type-support-check/index.js +1 -0
  119. package/build/components/post-type-support-check/index.js.map +1 -1
  120. package/build/components/preferences-modal/block-visibility.js +1 -0
  121. package/build/components/preferences-modal/block-visibility.js.map +1 -1
  122. package/build/components/preferences-modal/index.js +3 -4
  123. package/build/components/preferences-modal/index.js.map +1 -1
  124. package/build/components/preview-dropdown/index.js +0 -1
  125. package/build/components/preview-dropdown/index.js.map +1 -1
  126. package/build/components/provider/disable-non-page-content-blocks.js +66 -13
  127. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  128. package/build/components/provider/index.js +9 -13
  129. package/build/components/provider/index.js.map +1 -1
  130. package/build/components/provider/index.native.js +1 -0
  131. package/build/components/provider/index.native.js.map +1 -1
  132. package/build/components/provider/use-block-editor-settings.js +4 -1
  133. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  134. package/build/components/sidebar/index.js +1 -0
  135. package/build/components/sidebar/index.js.map +1 -1
  136. package/build/components/start-page-options/index.js +20 -106
  137. package/build/components/start-page-options/index.js.map +1 -1
  138. package/build/components/start-template-options/index.js +1 -0
  139. package/build/components/start-template-options/index.js.map +1 -1
  140. package/build/components/template-part-content-panel/index.js +1 -0
  141. package/build/components/template-part-content-panel/index.js.map +1 -1
  142. package/build/components/template-part-menu-items/index.js +2 -10
  143. package/build/components/template-part-menu-items/index.js.map +1 -1
  144. package/build/components/theme-support-check/index.js +1 -0
  145. package/build/components/theme-support-check/index.js.map +1 -1
  146. package/build/components/visual-editor/use-select-nearest-editable-block.js +1 -0
  147. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  148. package/build/dataviews/store/private-actions.js +16 -2
  149. package/build/dataviews/store/private-actions.js.map +1 -1
  150. package/build/dataviews/store/reducer.js +1 -0
  151. package/build/dataviews/store/reducer.js.map +1 -1
  152. package/build/hooks/custom-sources-backwards-compatibility.js +1 -0
  153. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  154. package/build/hooks/pattern-overrides.js +1 -0
  155. package/build/hooks/pattern-overrides.js.map +1 -1
  156. package/build/store/actions.js +1 -2
  157. package/build/store/actions.js.map +1 -1
  158. package/build/store/constants.js +1 -3
  159. package/build/store/constants.js.map +1 -1
  160. package/build/store/private-actions.js +2 -1
  161. package/build/store/private-actions.js.map +1 -1
  162. package/build/store/private-selectors.js +1 -0
  163. package/build/store/private-selectors.js.map +1 -1
  164. package/build/store/reducer.js +1 -0
  165. package/build/store/reducer.js.map +1 -1
  166. package/build/store/reducer.native.js +1 -0
  167. package/build/store/reducer.native.js.map +1 -1
  168. package/build/store/selectors.js +1 -0
  169. package/build/store/selectors.js.map +1 -1
  170. package/build/store/utils/notice-builder.js +3 -8
  171. package/build/store/utils/notice-builder.js.map +1 -1
  172. package/build/utils/get-item-title.js +32 -0
  173. package/build/utils/get-item-title.js.map +1 -0
  174. package/build/utils/get-template-info.js +1 -0
  175. package/build/utils/get-template-info.js.map +1 -1
  176. package/build/utils/media-sideload/index.js +21 -0
  177. package/build/utils/media-sideload/index.js.map +1 -0
  178. package/build/utils/media-sideload/index.native.js +8 -0
  179. package/build/utils/media-sideload/index.native.js.map +1 -0
  180. package/build/utils/media-upload/index.js +5 -2
  181. package/build/utils/media-upload/index.js.map +1 -1
  182. package/build/utils/pageTypeBadge.js +6 -12
  183. package/build/utils/pageTypeBadge.js.map +1 -1
  184. package/build/utils/terms.js +1 -0
  185. package/build/utils/terms.js.map +1 -1
  186. package/build-module/bindings/pattern-overrides.js +1 -0
  187. package/build-module/bindings/pattern-overrides.js.map +1 -1
  188. package/build-module/bindings/post-meta.js +1 -0
  189. package/build-module/bindings/post-meta.js.map +1 -1
  190. package/build-module/components/autocompleters/user.js +1 -0
  191. package/build-module/components/autocompleters/user.js.map +1 -1
  192. package/build-module/components/block-removal-warnings/index.js +1 -0
  193. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  194. package/build-module/components/block-settings-menu/content-only-settings-menu.js +1 -0
  195. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  196. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -0
  197. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  198. package/build-module/components/collab-sidebar/add-comment.js +1 -1
  199. package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
  200. package/build-module/components/collab-sidebar/comment-button.js +7 -2
  201. package/build-module/components/collab-sidebar/comment-button.js.map +1 -1
  202. package/build-module/components/collab-sidebar/comment-form.js +4 -1
  203. package/build-module/components/collab-sidebar/comment-form.js.map +1 -1
  204. package/build-module/components/collab-sidebar/comments.js +201 -187
  205. package/build-module/components/collab-sidebar/comments.js.map +1 -1
  206. package/build-module/components/collab-sidebar/index.js +11 -4
  207. package/build-module/components/collab-sidebar/index.js.map +1 -1
  208. package/build-module/components/collab-sidebar/utils.js +1 -0
  209. package/build-module/components/collab-sidebar/utils.js.map +1 -1
  210. package/build-module/components/commands/index.js +28 -0
  211. package/build-module/components/commands/index.js.map +1 -1
  212. package/build-module/components/deprecated.js +1 -0
  213. package/build-module/components/deprecated.js.map +1 -1
  214. package/build-module/components/document-bar/index.js +5 -2
  215. package/build-module/components/document-bar/index.js.map +1 -1
  216. package/build-module/components/document-outline/index.js +1 -0
  217. package/build-module/components/document-outline/index.js.map +1 -1
  218. package/build-module/components/document-tools/index.js +4 -7
  219. package/build-module/components/document-tools/index.js.map +1 -1
  220. package/build-module/components/editor-help/index.native.js +1 -0
  221. package/build-module/components/editor-help/index.native.js.map +1 -1
  222. package/build-module/components/editor-help/intro-to-blocks.native.js +1 -1
  223. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  224. package/build-module/components/editor-notices/index.js +1 -0
  225. package/build-module/components/editor-notices/index.js.map +1 -1
  226. package/build-module/components/editor-snackbars/index.js +1 -0
  227. package/build-module/components/editor-snackbars/index.js.map +1 -1
  228. package/build-module/components/entities-saved-states/entity-type-list.js +1 -0
  229. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  230. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +1 -0
  231. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  232. package/build-module/components/entities-saved-states/index.js +3 -1
  233. package/build-module/components/entities-saved-states/index.js.map +1 -1
  234. package/build-module/components/error-boundary/index.js +28 -15
  235. package/build-module/components/error-boundary/index.js.map +1 -1
  236. package/build-module/components/error-boundary/index.native.js +2 -2
  237. package/build-module/components/error-boundary/index.native.js.map +1 -1
  238. package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -0
  239. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  240. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
  241. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  242. package/build-module/components/list-view-sidebar/index.js +1 -0
  243. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  244. package/build-module/components/local-autosave-monitor/index.js +1 -0
  245. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  246. package/build-module/components/mode-switcher/index.js +1 -0
  247. package/build-module/components/mode-switcher/index.js.map +1 -1
  248. package/build-module/components/more-menu/index.js +0 -1
  249. package/build-module/components/more-menu/index.js.map +1 -1
  250. package/build-module/components/page-attributes/parent.js +1 -0
  251. package/build-module/components/page-attributes/parent.js.map +1 -1
  252. package/build-module/components/post-actions/actions.js +10 -4
  253. package/build-module/components/post-actions/actions.js.map +1 -1
  254. package/build-module/components/post-actions/index.js +81 -93
  255. package/build-module/components/post-actions/index.js.map +1 -1
  256. package/build-module/components/post-actions/set-as-homepage.js +22 -33
  257. package/build-module/components/post-actions/set-as-homepage.js.map +1 -1
  258. package/build-module/components/post-actions/set-as-posts-page.js +146 -0
  259. package/build-module/components/post-actions/set-as-posts-page.js.map +1 -0
  260. package/build-module/components/post-author/hook.js +1 -0
  261. package/build-module/components/post-author/hook.js.map +1 -1
  262. package/build-module/components/post-card-panel/index.js +66 -26
  263. package/build-module/components/post-card-panel/index.js.map +1 -1
  264. package/build-module/components/post-fields/index.js +1 -0
  265. package/build-module/components/post-fields/index.js.map +1 -1
  266. package/build-module/components/post-format/index.js +1 -0
  267. package/build-module/components/post-format/index.js.map +1 -1
  268. package/build-module/components/post-format/panel.js +1 -0
  269. package/build-module/components/post-format/panel.js.map +1 -1
  270. package/build-module/components/post-publish-button/index.js +1 -0
  271. package/build-module/components/post-publish-button/index.js.map +1 -1
  272. package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -0
  273. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  274. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  275. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  276. package/build-module/components/post-publish-panel/maybe-upload-media.js +3 -2
  277. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  278. package/build-module/components/post-publish-panel/media-util.js +1 -0
  279. package/build-module/components/post-publish-panel/media-util.js.map +1 -1
  280. package/build-module/components/post-publish-panel/prepublish.js +1 -1
  281. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  282. package/build-module/components/post-saved-state/index.js +1 -0
  283. package/build-module/components/post-saved-state/index.js.map +1 -1
  284. package/build-module/components/post-schedule/index.js +1 -0
  285. package/build-module/components/post-schedule/index.js.map +1 -1
  286. package/build-module/components/post-taxonomies/flat-term-selector.js +1 -0
  287. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  288. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +1 -0
  289. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  290. package/build-module/components/post-taxonomies/index.js +1 -0
  291. package/build-module/components/post-taxonomies/index.js.map +1 -1
  292. package/build-module/components/post-taxonomies/most-used-terms.js +1 -0
  293. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  294. package/build-module/components/post-template/classic-theme.js +1 -0
  295. package/build-module/components/post-template/classic-theme.js.map +1 -1
  296. package/build-module/components/post-template/swap-template-button.js +1 -0
  297. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  298. package/build-module/components/post-transform-panel/hooks.js +1 -0
  299. package/build-module/components/post-transform-panel/hooks.js.map +1 -1
  300. package/build-module/components/post-type-support-check/index.js +1 -0
  301. package/build-module/components/post-type-support-check/index.js.map +1 -1
  302. package/build-module/components/preferences-modal/block-visibility.js +1 -0
  303. package/build-module/components/preferences-modal/block-visibility.js.map +1 -1
  304. package/build-module/components/preferences-modal/index.js +3 -4
  305. package/build-module/components/preferences-modal/index.js.map +1 -1
  306. package/build-module/components/preview-dropdown/index.js +0 -1
  307. package/build-module/components/preview-dropdown/index.js.map +1 -1
  308. package/build-module/components/provider/disable-non-page-content-blocks.js +66 -13
  309. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  310. package/build-module/components/provider/index.js +10 -14
  311. package/build-module/components/provider/index.js.map +1 -1
  312. package/build-module/components/provider/index.native.js +1 -0
  313. package/build-module/components/provider/index.native.js.map +1 -1
  314. package/build-module/components/provider/use-block-editor-settings.js +4 -1
  315. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  316. package/build-module/components/sidebar/index.js +1 -0
  317. package/build-module/components/sidebar/index.js.map +1 -1
  318. package/build-module/components/start-page-options/index.js +21 -106
  319. package/build-module/components/start-page-options/index.js.map +1 -1
  320. package/build-module/components/start-template-options/index.js +1 -0
  321. package/build-module/components/start-template-options/index.js.map +1 -1
  322. package/build-module/components/template-part-content-panel/index.js +1 -0
  323. package/build-module/components/template-part-content-panel/index.js.map +1 -1
  324. package/build-module/components/template-part-menu-items/index.js +2 -10
  325. package/build-module/components/template-part-menu-items/index.js.map +1 -1
  326. package/build-module/components/theme-support-check/index.js +1 -0
  327. package/build-module/components/theme-support-check/index.js.map +1 -1
  328. package/build-module/components/visual-editor/use-select-nearest-editable-block.js +1 -0
  329. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  330. package/build-module/dataviews/store/private-actions.js +16 -2
  331. package/build-module/dataviews/store/private-actions.js.map +1 -1
  332. package/build-module/dataviews/store/reducer.js +1 -0
  333. package/build-module/dataviews/store/reducer.js.map +1 -1
  334. package/build-module/hooks/custom-sources-backwards-compatibility.js +1 -0
  335. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  336. package/build-module/hooks/pattern-overrides.js +1 -0
  337. package/build-module/hooks/pattern-overrides.js.map +1 -1
  338. package/build-module/store/actions.js +1 -2
  339. package/build-module/store/actions.js.map +1 -1
  340. package/build-module/store/constants.js +0 -2
  341. package/build-module/store/constants.js.map +1 -1
  342. package/build-module/store/private-actions.js +2 -1
  343. package/build-module/store/private-actions.js.map +1 -1
  344. package/build-module/store/private-selectors.js +1 -0
  345. package/build-module/store/private-selectors.js.map +1 -1
  346. package/build-module/store/reducer.js +1 -0
  347. package/build-module/store/reducer.js.map +1 -1
  348. package/build-module/store/reducer.native.js +1 -0
  349. package/build-module/store/reducer.native.js.map +1 -1
  350. package/build-module/store/selectors.js +1 -0
  351. package/build-module/store/selectors.js.map +1 -1
  352. package/build-module/store/utils/notice-builder.js +3 -8
  353. package/build-module/store/utils/notice-builder.js.map +1 -1
  354. package/build-module/utils/get-item-title.js +26 -0
  355. package/build-module/utils/get-item-title.js.map +1 -0
  356. package/build-module/utils/get-template-info.js +1 -0
  357. package/build-module/utils/get-template-info.js.map +1 -1
  358. package/build-module/utils/media-sideload/index.js +14 -0
  359. package/build-module/utils/media-sideload/index.js.map +1 -0
  360. package/build-module/utils/media-sideload/index.native.js +2 -0
  361. package/build-module/utils/media-sideload/index.native.js.map +1 -0
  362. package/build-module/utils/media-upload/index.js +5 -2
  363. package/build-module/utils/media-upload/index.js.map +1 -1
  364. package/build-module/utils/pageTypeBadge.js +6 -12
  365. package/build-module/utils/pageTypeBadge.js.map +1 -1
  366. package/build-module/utils/terms.js +1 -0
  367. package/build-module/utils/terms.js.map +1 -1
  368. package/build-style/style-rtl.css +26 -27
  369. package/build-style/style.css +26 -27
  370. package/build-types/components/autocompleters/user.d.ts +7 -1
  371. package/build-types/components/autocompleters/user.d.ts.map +1 -1
  372. package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -1
  373. package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -1
  374. package/build-types/components/collab-sidebar/comments.d.ts +11 -7
  375. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  376. package/build-types/components/collab-sidebar/constants.d.ts.map +1 -1
  377. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  378. package/build-types/components/commands/index.d.ts.map +1 -1
  379. package/build-types/components/document-bar/index.d.ts.map +1 -1
  380. package/build-types/components/document-tools/index.d.ts.map +1 -1
  381. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  382. package/build-types/components/error-boundary/index.d.ts.map +1 -1
  383. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +1 -1
  384. package/build-types/components/media-categories/index.d.ts.map +1 -1
  385. package/build-types/components/more-menu/index.d.ts.map +1 -1
  386. package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -1
  387. package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -1
  388. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  389. package/build-types/components/post-actions/index.d.ts +5 -0
  390. package/build-types/components/post-actions/index.d.ts.map +1 -1
  391. package/build-types/components/post-actions/set-as-homepage.d.ts.map +1 -1
  392. package/build-types/components/post-actions/set-as-posts-page.d.ts +10 -0
  393. package/build-types/components/post-actions/set-as-posts-page.d.ts.map +1 -0
  394. package/build-types/components/post-card-panel/index.d.ts +13 -4
  395. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  396. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +4 -4
  397. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  398. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +4 -4
  399. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  400. package/build-types/components/post-title/constants.d.ts.map +1 -1
  401. package/build-types/components/preferences-modal/index.d.ts.map +1 -1
  402. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  403. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
  404. package/build-types/components/provider/index.d.ts.map +1 -1
  405. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  406. package/build-types/components/start-page-options/index.d.ts +1 -2
  407. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  408. package/build-types/dataviews/api.d.ts.map +1 -1
  409. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  410. package/build-types/dataviews/store/reducer.d.ts +1 -1
  411. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
  412. package/build-types/hooks/pattern-overrides.d.ts.map +1 -1
  413. package/build-types/store/actions.d.ts +7 -9
  414. package/build-types/store/actions.d.ts.map +1 -1
  415. package/build-types/store/constants.d.ts +0 -2
  416. package/build-types/store/constants.d.ts.map +1 -1
  417. package/build-types/store/private-actions.d.ts +1 -1
  418. package/build-types/store/private-actions.d.ts.map +1 -1
  419. package/build-types/store/private-selectors.d.ts +20 -4
  420. package/build-types/store/private-selectors.d.ts.map +1 -1
  421. package/build-types/store/reducer.d.ts +1 -1
  422. package/build-types/store/selectors.d.ts +376 -76
  423. package/build-types/store/selectors.d.ts.map +1 -1
  424. package/build-types/store/utils/notice-builder.d.ts.map +1 -1
  425. package/build-types/utils/get-item-title.d.ts +10 -0
  426. package/build-types/utils/get-item-title.d.ts.map +1 -0
  427. package/build-types/utils/media-sideload/index.d.ts +3 -0
  428. package/build-types/utils/media-sideload/index.d.ts.map +1 -0
  429. package/build-types/utils/media-upload/index.d.ts +3 -1
  430. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  431. package/build-types/utils/pageTypeBadge.d.ts +3 -1
  432. package/build-types/utils/pageTypeBadge.d.ts.map +1 -1
  433. package/package.json +37 -37
  434. package/src/components/collab-sidebar/add-comment.js +1 -1
  435. package/src/components/collab-sidebar/comment-button.js +12 -7
  436. package/src/components/collab-sidebar/comment-form.js +4 -1
  437. package/src/components/collab-sidebar/comments.js +260 -243
  438. package/src/components/collab-sidebar/index.js +10 -2
  439. package/src/components/collab-sidebar/style.scss +10 -1
  440. package/src/components/commands/index.js +29 -0
  441. package/src/components/document-bar/index.js +5 -2
  442. package/src/components/document-tools/index.js +3 -6
  443. package/src/components/document-tools/style.scss +0 -6
  444. package/src/components/editor-help/intro-to-blocks.native.js +1 -1
  445. package/src/components/entities-saved-states/index.js +5 -1
  446. package/src/components/error-boundary/index.js +30 -16
  447. package/src/components/error-boundary/index.native.js +2 -2
  448. package/src/components/error-boundary/style.scss +5 -1
  449. package/src/components/more-menu/index.js +0 -1
  450. package/src/components/post-actions/actions.js +12 -4
  451. package/src/components/post-actions/index.js +90 -94
  452. package/src/components/post-actions/set-as-homepage.js +29 -45
  453. package/src/components/post-actions/set-as-posts-page.js +164 -0
  454. package/src/components/post-card-panel/index.js +71 -33
  455. package/src/components/post-card-panel/style.scss +8 -12
  456. package/src/components/post-publish-panel/maybe-upload-media.js +2 -2
  457. package/src/components/post-publish-panel/prepublish.js +1 -1
  458. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  459. package/src/components/preferences-modal/index.js +8 -13
  460. package/src/components/preview-dropdown/index.js +0 -1
  461. package/src/components/provider/disable-non-page-content-blocks.js +64 -13
  462. package/src/components/provider/index.js +13 -27
  463. package/src/components/provider/use-block-editor-settings.js +3 -0
  464. package/src/components/start-page-options/index.js +28 -119
  465. package/src/components/template-part-menu-items/index.js +2 -11
  466. package/src/dataviews/store/private-actions.ts +23 -8
  467. package/src/store/actions.js +0 -2
  468. package/src/store/constants.ts +0 -2
  469. package/src/store/private-actions.js +1 -1
  470. package/src/store/utils/notice-builder.js +3 -8
  471. package/src/store/utils/test/notice-builder.js +3 -4
  472. package/src/utils/get-item-title.js +25 -0
  473. package/src/utils/media-sideload/index.js +13 -0
  474. package/src/utils/media-sideload/index.native.js +1 -0
  475. package/src/utils/media-upload/index.js +4 -1
  476. package/src/utils/pageTypeBadge.js +7 -10
  477. package/tsconfig.json +1 -4
  478. package/tsconfig.tsbuildinfo +1 -1
@@ -16,7 +16,7 @@ import {
16
16
  Tooltip,
17
17
  } from '@wordpress/components';
18
18
  import { Icon, check, published, moreVertical } from '@wordpress/icons';
19
- import { __, _x } from '@wordpress/i18n';
19
+ import { __, _x, sprintf } from '@wordpress/i18n';
20
20
  import { useSelect } from '@wordpress/data';
21
21
  import { store as blockEditorStore } from '@wordpress/block-editor';
22
22
 
@@ -29,12 +29,14 @@ import CommentForm from './comment-form';
29
29
  /**
30
30
  * Renders the Comments component.
31
31
  *
32
- * @param {Object} props - The component props.
33
- * @param {Array} props.threads - The array of comment threads.
34
- * @param {Function} props.onEditComment - The function to handle comment editing.
35
- * @param {Function} props.onAddReply - The function to add a reply to a comment.
36
- * @param {Function} props.onCommentDelete - The function to delete a comment.
37
- * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.
32
+ * @param {Object} props - The component props.
33
+ * @param {Array} props.threads - The array of comment threads.
34
+ * @param {Function} props.onEditComment - The function to handle comment editing.
35
+ * @param {Function} props.onAddReply - The function to add a reply to a comment.
36
+ * @param {Function} props.onCommentDelete - The function to delete a comment.
37
+ * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.
38
+ * @param {boolean} props.showCommentBoard - Whether to show the comment board.
39
+ * @param {Function} props.setShowCommentBoard - The function to set the comment board visibility.
38
40
  * @return {React.ReactNode} The rendered Comments component.
39
41
  */
40
42
  export function Comments( {
@@ -43,129 +45,28 @@ export function Comments( {
43
45
  onAddReply,
44
46
  onCommentDelete,
45
47
  onCommentResolve,
48
+ showCommentBoard,
49
+ setShowCommentBoard,
46
50
  } ) {
47
- const [ actionState, setActionState ] = useState( false );
48
- const [ isConfirmDialogOpen, setIsConfirmDialogOpen ] = useState( false );
49
-
50
- const handleConfirmDelete = () => {
51
- onCommentDelete( actionState.id );
52
- setActionState( false );
53
- setIsConfirmDialogOpen( false );
54
- };
55
-
56
- const handleConfirmResolve = () => {
57
- onCommentResolve( actionState.id );
58
- setActionState( false );
59
- setIsConfirmDialogOpen( false );
60
- };
51
+ const { blockCommentId } = useSelect( ( select ) => {
52
+ const { getBlockAttributes, getSelectedBlockClientId } =
53
+ select( blockEditorStore );
54
+ const _clientId = getSelectedBlockClientId();
61
55
 
62
- const handleCancelDelete = () => {
63
- setActionState( false );
64
- setIsConfirmDialogOpen( false );
65
- };
66
-
67
- const blockCommentId = useSelect( ( select ) => {
68
- const clientID = select( blockEditorStore ).getSelectedBlockClientId();
69
- return (
70
- select( blockEditorStore ).getBlock( clientID )?.attributes
71
- ?.blockCommentId ?? false
72
- );
56
+ return {
57
+ blockCommentId: _clientId
58
+ ? getBlockAttributes( _clientId )?.blockCommentId
59
+ : null,
60
+ };
73
61
  }, [] );
74
62
 
75
- const CommentBoard = ( { thread, parentThread } ) => {
76
- return (
77
- <>
78
- <CommentHeader
79
- thread={ thread }
80
- onResolve={ () => {
81
- setActionState( {
82
- action: 'resolve',
83
- id: parentThread?.id ?? thread.id,
84
- } );
85
- setIsConfirmDialogOpen( true );
86
- } }
87
- onEdit={ () =>
88
- setActionState( { action: 'edit', id: thread.id } )
89
- }
90
- onDelete={ () => {
91
- setActionState( { action: 'delete', id: thread.id } );
92
- setIsConfirmDialogOpen( true );
93
- } }
94
- onReply={
95
- ! parentThread
96
- ? () =>
97
- setActionState( {
98
- action: 'reply',
99
- id: thread.id,
100
- } )
101
- : undefined
102
- }
103
- status={ parentThread?.status ?? thread.status }
104
- />
105
- <HStack
106
- alignment="left"
107
- spacing="3"
108
- justify="flex-start"
109
- className="editor-collab-sidebar-panel__user-comment"
110
- >
111
- <VStack
112
- spacing="3"
113
- className="editor-collab-sidebar-panel__comment-field"
114
- >
115
- { 'edit' === actionState?.action &&
116
- thread.id === actionState?.id && (
117
- <CommentForm
118
- onSubmit={ ( value ) => {
119
- onEditComment( thread.id, value );
120
- setActionState( false );
121
- } }
122
- onCancel={ () => setActionState( false ) }
123
- thread={ thread }
124
- submitButtonText={ _x( 'Update', 'verb' ) }
125
- />
126
- ) }
127
- { ( ! actionState ||
128
- 'edit' !== actionState?.action ) && (
129
- <RawHTML>{ thread?.content?.raw }</RawHTML>
130
- ) }
131
- </VStack>
132
- </HStack>
133
- { 'resolve' === actionState?.action &&
134
- thread.id === actionState?.id && (
135
- <ConfirmDialog
136
- isOpen={ isConfirmDialogOpen }
137
- onConfirm={ handleConfirmResolve }
138
- onCancel={ handleCancelDelete }
139
- confirmButtonText="Yes"
140
- cancelButtonText="No"
141
- >
142
- {
143
- // translators: message displayed when confirming an action
144
- __(
145
- 'Are you sure you want to mark this comment as resolved?'
146
- )
147
- }
148
- </ConfirmDialog>
149
- ) }
150
- { 'delete' === actionState?.action &&
151
- thread.id === actionState?.id && (
152
- <ConfirmDialog
153
- isOpen={ isConfirmDialogOpen }
154
- onConfirm={ handleConfirmDelete }
155
- onCancel={ handleCancelDelete }
156
- confirmButtonText="Yes"
157
- cancelButtonText="No"
158
- >
159
- {
160
- // translators: message displayed when confirming an action
161
- __(
162
- 'Are you sure you want to delete this comment?'
163
- )
164
- }
165
- </ConfirmDialog>
166
- ) }
167
- </>
168
- );
63
+ const [ focusThread, setFocusThread ] = useState(
64
+ showCommentBoard && blockCommentId ? blockCommentId : null
65
+ );
66
+
67
+ const clearThreadFocus = () => {
68
+ setFocusThread( null );
69
+ setShowCommentBoard( false );
169
70
  };
170
71
 
171
72
  return (
@@ -186,7 +87,6 @@ export function Comments( {
186
87
  </VStack>
187
88
  )
188
89
  }
189
-
190
90
  { Array.isArray( threads ) &&
191
91
  threads.length > 0 &&
192
92
  threads.map( ( thread ) => (
@@ -198,145 +98,262 @@ export function Comments( {
198
98
  'editor-collab-sidebar-panel__active-thread':
199
99
  blockCommentId &&
200
100
  blockCommentId === thread.id,
101
+ 'editor-collab-sidebar-panel__focus-thread':
102
+ focusThread && focusThread === thread.id,
201
103
  }
202
104
  ) }
203
105
  id={ thread.id }
204
106
  spacing="3"
107
+ onClick={ () => setFocusThread( thread.id ) }
205
108
  >
206
- <CommentBoard thread={ thread } />
207
- { 0 < thread?.reply?.length &&
208
- thread.reply.map( ( reply ) => (
209
- <VStack
210
- key={ reply.id }
211
- className="editor-collab-sidebar-panel__child-thread"
212
- id={ reply.id }
213
- spacing="2"
214
- >
109
+ <Thread
110
+ thread={ thread }
111
+ onAddReply={ onAddReply }
112
+ onCommentDelete={ onCommentDelete }
113
+ onCommentResolve={ onCommentResolve }
114
+ onEditComment={ onEditComment }
115
+ isFocused={ focusThread === thread.id }
116
+ clearThreadFocus={ clearThreadFocus }
117
+ />
118
+ </VStack>
119
+ ) ) }
120
+ </>
121
+ );
122
+ }
123
+
124
+ function Thread( {
125
+ thread,
126
+ onEditComment,
127
+ onAddReply,
128
+ onCommentDelete,
129
+ onCommentResolve,
130
+ isFocused,
131
+ clearThreadFocus,
132
+ } ) {
133
+ return (
134
+ <>
135
+ <CommentBoard
136
+ thread={ thread }
137
+ onResolve={ onCommentResolve }
138
+ onEdit={ onEditComment }
139
+ onDelete={ onCommentDelete }
140
+ status={ thread.status }
141
+ />
142
+ { 0 < thread?.reply?.length && (
143
+ <>
144
+ { ! isFocused && (
145
+ <VStack className="editor-collab-sidebar-panel__show-more-reply">
146
+ { sprintf(
147
+ // translators: 1: number of replies.
148
+ _x(
149
+ '%s more replies..',
150
+ 'Show replies button'
151
+ ),
152
+ thread?.reply?.length
153
+ ) }
154
+ </VStack>
155
+ ) }
156
+
157
+ { isFocused &&
158
+ thread.reply.map( ( reply ) => (
159
+ <VStack
160
+ key={ reply.id }
161
+ className="editor-collab-sidebar-panel__child-thread"
162
+ id={ reply.id }
163
+ spacing="2"
164
+ >
165
+ { 'approved' !== thread.status && (
215
166
  <CommentBoard
216
167
  thread={ reply }
217
- parentThread={ thread }
168
+ onEdit={ onEditComment }
169
+ onDelete={ onCommentDelete }
218
170
  />
219
- </VStack>
220
- ) ) }
221
- { 'reply' === actionState?.action &&
222
- thread.id === actionState?.id && (
223
- <VStack
224
- className="editor-collab-sidebar-panel__child-thread"
225
- spacing="2"
226
- >
227
- <HStack
228
- alignment="left"
229
- spacing="3"
230
- justify="flex-start"
231
- >
232
- <CommentAuthorInfo />
233
- </HStack>
234
- <VStack
235
- spacing="3"
236
- className="editor-collab-sidebar-panel__comment-field"
237
- >
238
- <CommentForm
239
- onSubmit={ ( inputComment ) => {
240
- onAddReply(
241
- inputComment,
242
- thread.id
243
- );
244
- setActionState( false );
245
- } }
246
- onCancel={ () =>
247
- setActionState( false )
248
- }
249
- submitButtonText={ _x(
250
- 'Reply',
251
- 'Add reply comment'
252
- ) }
253
- />
254
- </VStack>
255
- </VStack>
171
+ ) }
172
+ { 'approved' === thread.status && (
173
+ <CommentBoard thread={ reply } />
174
+ ) }
175
+ </VStack>
176
+ ) ) }
177
+ </>
178
+ ) }
179
+ { 'approved' !== thread.status && isFocused && (
180
+ <VStack
181
+ className="editor-collab-sidebar-panel__child-thread"
182
+ spacing="2"
183
+ >
184
+ <HStack alignment="left" spacing="3" justify="flex-start">
185
+ <CommentAuthorInfo />
186
+ </HStack>
187
+ <VStack
188
+ spacing="3"
189
+ className="editor-collab-sidebar-panel__comment-field"
190
+ >
191
+ <CommentForm
192
+ onSubmit={ ( inputComment ) => {
193
+ onAddReply( inputComment, thread.id );
194
+ } }
195
+ onCancel={ ( event ) => {
196
+ event.stopPropagation(); // Prevent the parent onClick from being triggered
197
+ clearThreadFocus();
198
+ } }
199
+ submitButtonText={ _x(
200
+ 'Reply',
201
+ 'Add reply comment'
256
202
  ) }
203
+ />
257
204
  </VStack>
258
- ) ) }
205
+ </VStack>
206
+ ) }
259
207
  </>
260
208
  );
261
209
  }
262
210
 
263
- /**
264
- * Renders the header of a comment in the collaboration sidebar.
265
- *
266
- * @param {Object} props - The component props.
267
- * @param {Object} props.thread - The comment thread object.
268
- * @param {Function} props.onResolve - The function to resolve the comment.
269
- * @param {Function} props.onEdit - The function to edit the comment.
270
- * @param {Function} props.onDelete - The function to delete the comment.
271
- * @param {Function} props.onReply - The function to reply to the comment.
272
- * @param {string} props.status - The status of the comment.
273
- * @return {React.ReactNode} The rendered comment header.
274
- */
275
- function CommentHeader( {
276
- thread,
277
- onResolve,
278
- onEdit,
279
- onDelete,
280
- onReply,
281
- status,
282
- } ) {
211
+ const CommentBoard = ( { thread, onResolve, onEdit, onDelete, status } ) => {
212
+ const [ actionState, setActionState ] = useState( false );
213
+ const [ showConfirmDialog, setShowConfirmDialog ] = useState( false );
214
+
215
+ const handleConfirmDelete = () => {
216
+ onDelete( thread.id );
217
+ setActionState( false );
218
+ setShowConfirmDialog( false );
219
+ };
220
+
221
+ const handleConfirmResolve = () => {
222
+ onResolve( thread.id );
223
+ setActionState( false );
224
+ setShowConfirmDialog( false );
225
+ };
226
+
227
+ const handleCancel = () => {
228
+ setActionState( false );
229
+ setShowConfirmDialog( false );
230
+ };
231
+
283
232
  const actions = [
284
- {
233
+ onEdit && {
285
234
  title: _x( 'Edit', 'Edit comment' ),
286
- onClick: onEdit,
235
+ onClick: () => {
236
+ setActionState( 'edit' );
237
+ },
287
238
  },
288
- {
239
+ onDelete && {
289
240
  title: _x( 'Delete', 'Delete comment' ),
290
- onClick: onDelete,
291
- },
292
- {
293
- title: _x( 'Reply', 'Reply on a comment' ),
294
- onClick: onReply,
241
+ onClick: () => {
242
+ setActionState( 'delete' );
243
+ setShowConfirmDialog( true );
244
+ },
295
245
  },
296
246
  ];
297
247
 
298
- const moreActions = actions.filter( ( item ) => item.onClick );
248
+ const moreActions = actions.filter( ( item ) => item?.onClick );
299
249
 
300
250
  return (
301
- <HStack alignment="left" spacing="3" justify="flex-start">
302
- <CommentAuthorInfo
303
- avatar={ thread?.author_avatar_urls?.[ 48 ] }
304
- name={ thread?.author_name }
305
- date={ thread?.date }
306
- />
307
- <span className="editor-collab-sidebar-panel__comment-status">
308
- { status !== 'approved' && (
309
- <HStack alignment="right" justify="flex-end" spacing="0">
310
- { 0 === thread?.parent && onResolve && (
311
- <Button
312
- label={ _x(
313
- 'Resolve',
314
- 'Mark comment as resolved'
315
- ) }
316
- __next40pxDefaultSize
317
- icon={ published }
318
- onClick={ onResolve }
319
- showTooltip
320
- />
321
- ) }
322
- <DropdownMenu
323
- icon={ moreVertical }
324
- label={ _x(
325
- 'Select an action',
326
- 'Select comment action'
251
+ <>
252
+ <HStack alignment="left" spacing="3" justify="flex-start">
253
+ <CommentAuthorInfo
254
+ avatar={ thread?.author_avatar_urls?.[ 48 ] }
255
+ name={ thread?.author_name }
256
+ date={ thread?.date }
257
+ />
258
+ <span className="editor-collab-sidebar-panel__comment-status">
259
+ { status !== 'approved' && (
260
+ <HStack
261
+ alignment="right"
262
+ justify="flex-end"
263
+ spacing="0"
264
+ >
265
+ { 0 === thread?.parent && onResolve && (
266
+ <Button
267
+ label={ _x(
268
+ 'Resolve',
269
+ 'Mark comment as resolved'
270
+ ) }
271
+ __next40pxDefaultSize
272
+ icon={ published }
273
+ onClick={ () => {
274
+ setActionState( 'resolve' );
275
+ setShowConfirmDialog( true );
276
+ } }
277
+ showTooltip
278
+ />
279
+ ) }
280
+ { 0 < moreActions.length && (
281
+ <DropdownMenu
282
+ icon={ moreVertical }
283
+ label={ _x(
284
+ 'Select an action',
285
+ 'Select comment action'
286
+ ) }
287
+ className="editor-collab-sidebar-panel__comment-dropdown-menu"
288
+ controls={ moreActions }
289
+ />
327
290
  ) }
328
- className="editor-collab-sidebar-panel__comment-dropdown-menu"
329
- controls={ moreActions }
291
+ </HStack>
292
+ ) }
293
+ { status === 'approved' && (
294
+ // translators: tooltip for resolved comment
295
+ <Tooltip text={ __( 'Resolved' ) }>
296
+ <Icon icon={ check } />
297
+ </Tooltip>
298
+ ) }
299
+ </span>
300
+ </HStack>
301
+ <HStack
302
+ alignment="left"
303
+ spacing="3"
304
+ justify="flex-start"
305
+ className="editor-collab-sidebar-panel__user-comment"
306
+ >
307
+ <VStack
308
+ spacing="3"
309
+ className="editor-collab-sidebar-panel__comment-field"
310
+ >
311
+ { 'edit' === actionState && (
312
+ <CommentForm
313
+ onSubmit={ ( value ) => {
314
+ onEdit( thread.id, value );
315
+ setActionState( false );
316
+ } }
317
+ onCancel={ () => handleCancel() }
318
+ thread={ thread }
319
+ submitButtonText={ _x( 'Update', 'verb' ) }
330
320
  />
331
- </HStack>
332
- ) }
333
- { status === 'approved' && (
334
- // translators: tooltip for resolved comment
335
- <Tooltip text={ __( 'Resolved' ) }>
336
- <Icon icon={ check } />
337
- </Tooltip>
338
- ) }
339
- </span>
340
- </HStack>
321
+ ) }
322
+ { 'edit' !== actionState && (
323
+ <RawHTML>{ thread?.content?.raw }</RawHTML>
324
+ ) }
325
+ </VStack>
326
+ </HStack>
327
+ { 'resolve' === actionState && (
328
+ <ConfirmDialog
329
+ isOpen={ showConfirmDialog }
330
+ onConfirm={ handleConfirmResolve }
331
+ onCancel={ handleCancel }
332
+ confirmButtonText="Yes"
333
+ cancelButtonText="No"
334
+ >
335
+ {
336
+ // translators: message displayed when confirming an action
337
+ __(
338
+ 'Are you sure you want to mark this comment as resolved?'
339
+ )
340
+ }
341
+ </ConfirmDialog>
342
+ ) }
343
+ { 'delete' === actionState && (
344
+ <ConfirmDialog
345
+ isOpen={ showConfirmDialog }
346
+ onConfirm={ handleConfirmDelete }
347
+ onCancel={ handleCancel }
348
+ confirmButtonText="Yes"
349
+ cancelButtonText="No"
350
+ >
351
+ {
352
+ // translators: message displayed when confirming an action
353
+ __( 'Are you sure you want to delete this comment?' )
354
+ }
355
+ </ConfirmDialog>
356
+ ) }
357
+ </>
341
358
  );
342
- }
359
+ };
@@ -203,11 +203,14 @@ function CollabSidebarContent( {
203
203
  setShowCommentBoard={ setShowCommentBoard }
204
204
  />
205
205
  <Comments
206
+ key={ getSelectedBlockClientId() }
206
207
  threads={ comments }
207
208
  onEditComment={ onEditComment }
208
209
  onAddReply={ addNewComment }
209
210
  onCommentDelete={ onCommentDelete }
210
211
  onCommentResolve={ onCommentResolve }
212
+ showCommentBoard={ showCommentBoard }
213
+ setShowCommentBoard={ setShowCommentBoard }
211
214
  />
212
215
  </div>
213
216
  );
@@ -293,17 +296,22 @@ export default function CollabSidebar() {
293
296
  return { resultComments: [], sortedThreads: [] };
294
297
  }
295
298
 
299
+ const updatedResult = result.map( ( item ) => ( {
300
+ ...item,
301
+ reply: [ ...item.reply ].reverse(),
302
+ } ) );
303
+
296
304
  const blockCommentIds = getCommentIdsFromBlocks( blocks );
297
305
 
298
306
  const threadIdMap = new Map(
299
- result.map( ( thread ) => [ thread.id, thread ] )
307
+ updatedResult.map( ( thread ) => [ thread.id, thread ] )
300
308
  );
301
309
 
302
310
  const sortedComments = blockCommentIds
303
311
  .map( ( id ) => threadIdMap.get( id ) )
304
312
  .filter( ( thread ) => thread !== undefined );
305
313
 
306
- return { resultComments: result, sortedThreads: sortedComments };
314
+ return { resultComments: updatedResult, sortedThreads: sortedComments };
307
315
  }, [ threads, blocks ] );
308
316
 
309
317
  // Get the global styles to set the background color of the sidebar.
@@ -18,13 +18,17 @@
18
18
  position: relative;
19
19
  padding: $grid-unit-20;
20
20
  border-radius: $radius-large;
21
- border: 1px solid $gray-300;
21
+ border: 1.5px solid $gray-300;
22
22
  background-color: $gray-100;
23
23
  margin-bottom: $grid-unit-20;
24
24
  }
25
25
 
26
26
  &__active-thread {
27
27
  border: 1.5px solid #3858e9;
28
+ }
29
+
30
+ &__focus-thread {
31
+ border: 1.5px solid #3858e9;
28
32
  background-color: $white;
29
33
  box-shadow: 0 5.5px 7.8px -0.3px rgba(0, 0, 0, 0.102);
30
34
  }
@@ -121,4 +125,9 @@
121
125
  }
122
126
  }
123
127
 
128
+ &__show-more-reply {
129
+ font-weight: 500;
130
+ font-style: italic;
131
+ padding: 0;
132
+ }
124
133
  }
@@ -25,6 +25,7 @@ import { store as noticesStore } from '@wordpress/notices';
25
25
  import { store as blockEditorStore } from '@wordpress/block-editor';
26
26
  import { store as coreStore, useEntityRecord } from '@wordpress/core-data';
27
27
  import { store as interfaceStore } from '@wordpress/interface';
28
+ import { getPath } from '@wordpress/url';
28
29
  import { decodeEntities } from '@wordpress/html-entities';
29
30
 
30
31
  /**
@@ -90,6 +91,19 @@ const getEditorCommandLoader = () =>
90
91
  const { openModal, enableComplementaryArea, disableComplementaryArea } =
91
92
  useDispatch( interfaceStore );
92
93
  const { getCurrentPostId } = useSelect( editorStore );
94
+ const { isBlockBasedTheme, canCreateTemplate } = useSelect(
95
+ ( select ) => {
96
+ return {
97
+ isBlockBasedTheme:
98
+ select( coreStore ).getCurrentTheme()?.is_block_theme,
99
+ canCreateTemplate: select( coreStore ).canUser( 'create', {
100
+ kind: 'postType',
101
+ name: 'wp_template',
102
+ } ),
103
+ };
104
+ },
105
+ []
106
+ );
93
107
  const allowSwitchEditorMode =
94
108
  isCodeEditingEnabled && isRichEditingEnabled;
95
109
 
@@ -271,6 +285,21 @@ const getEditorCommandLoader = () =>
271
285
  },
272
286
  } );
273
287
  }
288
+ if ( canCreateTemplate && isBlockBasedTheme ) {
289
+ const isSiteEditor = getPath( window.location.href )?.includes(
290
+ 'site-editor.php'
291
+ );
292
+ if ( ! isSiteEditor ) {
293
+ commands.push( {
294
+ name: 'core/go-to-site-editor',
295
+ label: __( 'Open Site Editor' ),
296
+ callback: ( { close } ) => {
297
+ close();
298
+ document.location = 'site-editor.php';
299
+ },
300
+ } );
301
+ }
302
+ }
274
303
 
275
304
  return {
276
305
  commands,