@wordpress/editor 14.33.3-next.36001005c.0 → 14.34.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 (353) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/post-data.js +10 -17
  3. package/build/bindings/post-data.js.map +2 -2
  4. package/build/bindings/post-meta.js +7 -14
  5. package/build/bindings/post-meta.js.map +2 -2
  6. package/build/bindings/term-data.js +6 -16
  7. package/build/bindings/term-data.js.map +2 -2
  8. package/build/components/collab-sidebar/add-comment.js +26 -3
  9. package/build/components/collab-sidebar/add-comment.js.map +3 -3
  10. package/build/components/collab-sidebar/comment-author-info.js +26 -14
  11. package/build/components/collab-sidebar/comment-author-info.js.map +2 -2
  12. package/build/components/collab-sidebar/comment-indicator-toolbar.js +6 -22
  13. package/build/components/collab-sidebar/comment-indicator-toolbar.js.map +3 -3
  14. package/build/components/collab-sidebar/comments.js +105 -28
  15. package/build/components/collab-sidebar/comments.js.map +3 -3
  16. package/build/components/collab-sidebar/hooks.js +3 -4
  17. package/build/components/collab-sidebar/hooks.js.map +2 -2
  18. package/build/components/collab-sidebar/index.js +42 -57
  19. package/build/components/collab-sidebar/index.js.map +3 -3
  20. package/build/components/document-bar/index.js +16 -3
  21. package/build/components/document-bar/index.js.map +2 -2
  22. package/build/components/editor/index.js +25 -4
  23. package/build/components/editor/index.js.map +3 -3
  24. package/build/components/editor-interface/index.js +15 -10
  25. package/build/components/editor-interface/index.js.map +3 -3
  26. package/build/components/entities-saved-states/entity-type-list.js +19 -15
  27. package/build/components/entities-saved-states/entity-type-list.js.map +3 -3
  28. package/build/components/global-styles/block-link.js +70 -0
  29. package/build/components/global-styles/block-link.js.map +7 -0
  30. package/build/components/global-styles/header.js +54 -0
  31. package/build/components/global-styles/header.js.map +7 -0
  32. package/build/components/global-styles/hooks.js +176 -0
  33. package/build/components/global-styles/hooks.js.map +7 -0
  34. package/build/components/global-styles/index.js +138 -0
  35. package/build/components/global-styles/index.js.map +7 -0
  36. package/build/components/global-styles/menu.js +95 -0
  37. package/build/components/global-styles/menu.js.map +7 -0
  38. package/build/components/global-styles-provider/index.js +3 -49
  39. package/build/components/global-styles-provider/index.js.map +3 -3
  40. package/build/components/global-styles-renderer/index.js +55 -0
  41. package/build/components/global-styles-renderer/index.js.map +7 -0
  42. package/build/components/global-styles-sidebar/default-sidebar.js +66 -0
  43. package/build/components/global-styles-sidebar/default-sidebar.js.map +7 -0
  44. package/build/components/global-styles-sidebar/index.js +182 -0
  45. package/build/components/global-styles-sidebar/index.js.map +7 -0
  46. package/build/components/global-styles-sidebar/welcome-guide-image.js +37 -0
  47. package/build/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
  48. package/build/components/global-styles-sidebar/welcome-guide.js +143 -0
  49. package/build/components/global-styles-sidebar/welcome-guide.js.map +7 -0
  50. package/build/components/header/index.js +12 -12
  51. package/build/components/header/index.js.map +3 -3
  52. package/build/components/post-featured-image/index.js +32 -1
  53. package/build/components/post-featured-image/index.js.map +3 -3
  54. package/build/components/post-template/hooks.js +7 -38
  55. package/build/components/post-template/hooks.js.map +2 -2
  56. package/build/components/provider/index.js +1 -1
  57. package/build/components/provider/index.js.map +2 -2
  58. package/build/components/style-book/categories.js +86 -0
  59. package/build/components/style-book/categories.js.map +7 -0
  60. package/build/components/style-book/color-examples.js +64 -0
  61. package/build/components/style-book/color-examples.js.map +7 -0
  62. package/build/components/style-book/constants.js +319 -0
  63. package/build/components/style-book/constants.js.map +7 -0
  64. package/build/components/style-book/duotone-examples.js +68 -0
  65. package/build/components/style-book/duotone-examples.js.map +7 -0
  66. package/build/components/style-book/examples.js +237 -0
  67. package/build/components/style-book/examples.js.map +7 -0
  68. package/build/components/style-book/index.js +627 -0
  69. package/build/components/style-book/index.js.map +7 -0
  70. package/build/components/style-book/types.js +17 -0
  71. package/build/components/style-book/types.js.map +7 -0
  72. package/build/components/styles-canvas/index.js +138 -0
  73. package/build/components/styles-canvas/index.js.map +7 -0
  74. package/build/components/styles-canvas/revisions.js +121 -0
  75. package/build/components/styles-canvas/revisions.js.map +7 -0
  76. package/build/components/styles-canvas/style-book.js +68 -0
  77. package/build/components/styles-canvas/style-book.js.map +7 -0
  78. package/build/components/visual-editor/index.js +4 -3
  79. package/build/components/visual-editor/index.js.map +2 -2
  80. package/build/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
  81. package/build/hooks/index.js +1 -0
  82. package/build/hooks/index.js.map +2 -2
  83. package/build/hooks/media-upload.js +15 -4
  84. package/build/hooks/media-upload.js.map +3 -3
  85. package/build/hooks/push-changes-to-global-styles/index.js +322 -0
  86. package/build/hooks/push-changes-to-global-styles/index.js.map +7 -0
  87. package/build/hooks/use-global-styles-output.js +74 -0
  88. package/build/hooks/use-global-styles-output.js.map +7 -0
  89. package/build/private-apis.js +10 -5
  90. package/build/private-apis.js.map +3 -3
  91. package/build/store/actions.js +1 -1
  92. package/build/store/actions.js.map +2 -2
  93. package/build/store/private-actions.js +23 -0
  94. package/build/store/private-actions.js.map +2 -2
  95. package/build/store/private-selectors.js +10 -0
  96. package/build/store/private-selectors.js.map +2 -2
  97. package/build/store/reducer.js +24 -0
  98. package/build/store/reducer.js.map +2 -2
  99. package/build/{components/editor-interface/content-slot-fill.js → utils/set-nested-value.js} +24 -10
  100. package/build/utils/set-nested-value.js.map +7 -0
  101. package/build-module/bindings/post-data.js +10 -17
  102. package/build-module/bindings/post-data.js.map +2 -2
  103. package/build-module/bindings/post-meta.js +7 -14
  104. package/build-module/bindings/post-meta.js.map +2 -2
  105. package/build-module/bindings/term-data.js +6 -16
  106. package/build-module/bindings/term-data.js.map +2 -2
  107. package/build-module/components/collab-sidebar/add-comment.js +27 -4
  108. package/build-module/components/collab-sidebar/add-comment.js.map +2 -2
  109. package/build-module/components/collab-sidebar/comment-author-info.js +26 -14
  110. package/build-module/components/collab-sidebar/comment-author-info.js.map +2 -2
  111. package/build-module/components/collab-sidebar/comment-indicator-toolbar.js +6 -12
  112. package/build-module/components/collab-sidebar/comment-indicator-toolbar.js.map +2 -2
  113. package/build-module/components/collab-sidebar/comments.js +114 -31
  114. package/build-module/components/collab-sidebar/comments.js.map +2 -2
  115. package/build-module/components/collab-sidebar/hooks.js +3 -4
  116. package/build-module/components/collab-sidebar/hooks.js.map +2 -2
  117. package/build-module/components/collab-sidebar/index.js +42 -57
  118. package/build-module/components/collab-sidebar/index.js.map +2 -2
  119. package/build-module/components/document-bar/index.js +16 -3
  120. package/build-module/components/document-bar/index.js.map +2 -2
  121. package/build-module/components/editor/index.js +25 -4
  122. package/build-module/components/editor/index.js.map +2 -2
  123. package/build-module/components/editor-interface/index.js +15 -10
  124. package/build-module/components/editor-interface/index.js.map +2 -2
  125. package/build-module/components/entities-saved-states/entity-type-list.js +18 -14
  126. package/build-module/components/entities-saved-states/entity-type-list.js.map +2 -2
  127. package/build-module/components/global-styles/block-link.js +46 -0
  128. package/build-module/components/global-styles/block-link.js.map +7 -0
  129. package/build-module/components/global-styles/header.js +41 -0
  130. package/build-module/components/global-styles/header.js.map +7 -0
  131. package/build-module/components/global-styles/hooks.js +154 -0
  132. package/build-module/components/global-styles/hooks.js.map +7 -0
  133. package/build-module/components/global-styles/index.js +112 -0
  134. package/build-module/components/global-styles/index.js.map +7 -0
  135. package/build-module/components/global-styles/menu.js +71 -0
  136. package/build-module/components/global-styles/menu.js.map +7 -0
  137. package/build-module/components/global-styles-provider/index.js +3 -37
  138. package/build-module/components/global-styles-provider/index.js.map +2 -2
  139. package/build-module/components/global-styles-renderer/index.js +31 -0
  140. package/build-module/components/global-styles-renderer/index.js.map +7 -0
  141. package/build-module/components/global-styles-sidebar/default-sidebar.js +49 -0
  142. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +7 -0
  143. package/build-module/components/global-styles-sidebar/index.js +152 -0
  144. package/build-module/components/global-styles-sidebar/index.js.map +7 -0
  145. package/build-module/components/global-styles-sidebar/welcome-guide-image.js +17 -0
  146. package/build-module/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
  147. package/build-module/components/global-styles-sidebar/welcome-guide.js +113 -0
  148. package/build-module/components/global-styles-sidebar/welcome-guide.js.map +7 -0
  149. package/build-module/components/header/index.js +12 -12
  150. package/build-module/components/header/index.js.map +2 -2
  151. package/build-module/components/post-featured-image/index.js +35 -3
  152. package/build-module/components/post-featured-image/index.js.map +2 -2
  153. package/build-module/components/post-template/hooks.js +7 -38
  154. package/build-module/components/post-template/hooks.js.map +2 -2
  155. package/build-module/components/provider/index.js +1 -1
  156. package/build-module/components/provider/index.js.map +2 -2
  157. package/build-module/components/style-book/categories.js +64 -0
  158. package/build-module/components/style-book/categories.js.map +7 -0
  159. package/build-module/components/style-book/color-examples.js +37 -0
  160. package/build-module/components/style-book/color-examples.js.map +7 -0
  161. package/build-module/components/style-book/constants.js +290 -0
  162. package/build-module/components/style-book/constants.js.map +7 -0
  163. package/build-module/components/style-book/duotone-examples.js +48 -0
  164. package/build-module/components/style-book/duotone-examples.js.map +7 -0
  165. package/build-module/components/style-book/examples.js +208 -0
  166. package/build-module/components/style-book/examples.js.map +7 -0
  167. package/build-module/components/style-book/index.js +618 -0
  168. package/build-module/components/style-book/index.js.map +7 -0
  169. package/build-module/components/style-book/types.js +1 -0
  170. package/build-module/components/style-book/types.js.map +7 -0
  171. package/build-module/components/styles-canvas/index.js +104 -0
  172. package/build-module/components/styles-canvas/index.js.map +7 -0
  173. package/build-module/components/styles-canvas/revisions.js +107 -0
  174. package/build-module/components/styles-canvas/revisions.js.map +7 -0
  175. package/build-module/components/styles-canvas/style-book.js +38 -0
  176. package/build-module/components/styles-canvas/style-book.js.map +7 -0
  177. package/build-module/components/visual-editor/index.js +4 -3
  178. package/build-module/components/visual-editor/index.js.map +2 -2
  179. package/build-module/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
  180. package/build-module/hooks/index.js +1 -0
  181. package/build-module/hooks/index.js.map +2 -2
  182. package/build-module/hooks/media-upload.js +19 -5
  183. package/build-module/hooks/media-upload.js.map +2 -2
  184. package/build-module/hooks/push-changes-to-global-styles/index.js +309 -0
  185. package/build-module/hooks/push-changes-to-global-styles/index.js.map +7 -0
  186. package/build-module/hooks/use-global-styles-output.js +49 -0
  187. package/build-module/hooks/use-global-styles-output.js.map +7 -0
  188. package/build-module/private-apis.js +10 -8
  189. package/build-module/private-apis.js.map +2 -2
  190. package/build-module/store/actions.js +1 -1
  191. package/build-module/store/actions.js.map +2 -2
  192. package/build-module/store/private-actions.js +20 -0
  193. package/build-module/store/private-actions.js.map +2 -2
  194. package/build-module/store/private-selectors.js +8 -0
  195. package/build-module/store/private-selectors.js.map +2 -2
  196. package/build-module/store/reducer.js +22 -0
  197. package/build-module/store/reducer.js.map +2 -2
  198. package/build-module/utils/set-nested-value.js +23 -0
  199. package/build-module/utils/set-nested-value.js.map +7 -0
  200. package/build-style/style-rtl.css +3011 -16
  201. package/build-style/style.css +3012 -16
  202. package/build-types/bindings/post-data.d.ts +6 -16
  203. package/build-types/bindings/post-meta.d.ts +6 -13
  204. package/build-types/bindings/term-data.d.ts +6 -16
  205. package/build-types/components/collab-sidebar/add-comment.d.ts +6 -1
  206. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
  207. package/build-types/components/collab-sidebar/comment-author-info.d.ts +5 -16
  208. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -1
  209. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts +1 -2
  210. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +1 -1
  211. package/build-types/components/collab-sidebar/comments.d.ts +12 -26
  212. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  213. package/build-types/components/collab-sidebar/hooks.d.ts +0 -1
  214. package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
  215. package/build-types/components/collab-sidebar/index.d.ts +1 -4
  216. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  217. package/build-types/components/document-bar/index.d.ts +2 -2
  218. package/build-types/components/document-bar/index.d.ts.map +1 -1
  219. package/build-types/components/editor/index.d.ts.map +1 -1
  220. package/build-types/components/editor-interface/index.d.ts +1 -3
  221. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  222. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
  223. package/build-types/components/global-styles/block-link.d.ts +12 -0
  224. package/build-types/components/global-styles/block-link.d.ts.map +1 -0
  225. package/build-types/components/global-styles/header.d.ts +7 -0
  226. package/build-types/components/global-styles/header.d.ts.map +1 -0
  227. package/build-types/components/global-styles/hooks.d.ts +24 -0
  228. package/build-types/components/global-styles/hooks.d.ts.map +1 -0
  229. package/build-types/components/global-styles/index.d.ts +6 -0
  230. package/build-types/components/global-styles/index.d.ts.map +1 -0
  231. package/build-types/components/global-styles/menu.d.ts +13 -0
  232. package/build-types/components/global-styles/menu.d.ts.map +1 -0
  233. package/build-types/components/global-styles-provider/index.d.ts +1 -5
  234. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  235. package/build-types/components/global-styles-renderer/index.d.ts +4 -0
  236. package/build-types/components/global-styles-renderer/index.d.ts.map +1 -0
  237. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts +13 -0
  238. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts.map +1 -0
  239. package/build-types/components/global-styles-sidebar/index.d.ts +2 -0
  240. package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -0
  241. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts +5 -0
  242. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts.map +1 -0
  243. package/build-types/components/global-styles-sidebar/welcome-guide.d.ts +2 -0
  244. package/build-types/components/global-styles-sidebar/welcome-guide.d.ts.map +1 -0
  245. package/build-types/components/header/index.d.ts +1 -3
  246. package/build-types/components/header/index.d.ts.map +1 -1
  247. package/build-types/components/post-template/hooks.d.ts +1 -1
  248. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  249. package/build-types/components/provider/index.d.ts.map +1 -1
  250. package/build-types/components/style-book/categories.d.ts +18 -0
  251. package/build-types/components/style-book/categories.d.ts.map +1 -0
  252. package/build-types/components/style-book/color-examples.d.ts +7 -0
  253. package/build-types/components/style-book/color-examples.d.ts.map +1 -0
  254. package/build-types/components/style-book/constants.d.ts +11 -0
  255. package/build-types/components/style-book/constants.d.ts.map +1 -0
  256. package/build-types/components/style-book/duotone-examples.d.ts +9 -0
  257. package/build-types/components/style-book/duotone-examples.d.ts.map +1 -0
  258. package/build-types/components/style-book/examples.d.ts +12 -0
  259. package/build-types/components/style-book/examples.d.ts.map +1 -0
  260. package/build-types/components/style-book/index.d.ts +31 -0
  261. package/build-types/components/style-book/index.d.ts.map +1 -0
  262. package/build-types/components/style-book/types.d.ts +72 -0
  263. package/build-types/components/style-book/types.d.ts.map +1 -0
  264. package/build-types/components/styles-canvas/index.d.ts +16 -0
  265. package/build-types/components/styles-canvas/index.d.ts.map +1 -0
  266. package/build-types/components/styles-canvas/revisions.d.ts +5 -0
  267. package/build-types/components/styles-canvas/revisions.d.ts.map +1 -0
  268. package/build-types/components/styles-canvas/style-book.d.ts +6 -0
  269. package/build-types/components/styles-canvas/style-book.d.ts.map +1 -0
  270. package/build-types/components/visual-editor/index.d.ts +1 -2
  271. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  272. package/build-types/dataviews/fields/content-preview/content-preview-view.d.ts.map +1 -1
  273. package/build-types/hooks/push-changes-to-global-styles/index.d.ts +2 -0
  274. package/build-types/hooks/push-changes-to-global-styles/index.d.ts.map +1 -0
  275. package/build-types/hooks/use-global-styles-output.d.ts +18 -0
  276. package/build-types/hooks/use-global-styles-output.d.ts.map +1 -0
  277. package/build-types/private-apis.d.ts.map +1 -1
  278. package/build-types/store/actions.d.ts.map +1 -1
  279. package/build-types/store/private-actions.d.ts +20 -0
  280. package/build-types/store/private-actions.d.ts.map +1 -1
  281. package/build-types/store/private-selectors.d.ts +14 -0
  282. package/build-types/store/private-selectors.d.ts.map +1 -1
  283. package/build-types/store/reducer.d.ts +20 -0
  284. package/build-types/store/reducer.d.ts.map +1 -1
  285. package/build-types/utils/set-nested-value.d.ts +20 -0
  286. package/build-types/utils/set-nested-value.d.ts.map +1 -0
  287. package/package.json +40 -40
  288. package/src/bindings/post-data.js +9 -20
  289. package/src/bindings/post-meta.js +6 -17
  290. package/src/bindings/term-data.js +6 -21
  291. package/src/components/collab-sidebar/add-comment.js +31 -3
  292. package/src/components/collab-sidebar/comment-author-info.js +32 -25
  293. package/src/components/collab-sidebar/comment-indicator-toolbar.js +6 -22
  294. package/src/components/collab-sidebar/comments.js +108 -35
  295. package/src/components/collab-sidebar/hooks.js +3 -4
  296. package/src/components/collab-sidebar/index.js +34 -42
  297. package/src/components/collab-sidebar/style.scss +1 -22
  298. package/src/components/document-bar/index.js +18 -3
  299. package/src/components/editor/index.js +27 -1
  300. package/src/components/editor-interface/index.js +40 -39
  301. package/src/components/entities-saved-states/entity-type-list.js +19 -17
  302. package/src/components/global-styles/block-link.js +65 -0
  303. package/src/components/global-styles/header.js +48 -0
  304. package/src/components/global-styles/hooks.js +216 -0
  305. package/src/components/global-styles/index.js +125 -0
  306. package/src/components/global-styles/menu.js +101 -0
  307. package/src/components/global-styles/style.scss +11 -0
  308. package/src/components/global-styles-provider/index.js +3 -45
  309. package/src/components/global-styles-renderer/index.js +39 -0
  310. package/src/components/global-styles-sidebar/default-sidebar.js +46 -0
  311. package/src/components/global-styles-sidebar/index.js +177 -0
  312. package/src/components/global-styles-sidebar/style.scss +119 -0
  313. package/src/components/global-styles-sidebar/welcome-guide-image.js +11 -0
  314. package/src/components/global-styles-sidebar/welcome-guide.js +136 -0
  315. package/src/components/header/index.js +11 -13
  316. package/src/components/post-featured-image/index.js +44 -1
  317. package/src/components/post-template/hooks.js +10 -51
  318. package/src/components/provider/index.js +1 -4
  319. package/src/components/style-book/categories.ts +97 -0
  320. package/src/components/style-book/color-examples.tsx +56 -0
  321. package/src/components/style-book/constants.ts +308 -0
  322. package/src/components/style-book/duotone-examples.tsx +56 -0
  323. package/src/components/style-book/examples.tsx +273 -0
  324. package/src/components/style-book/index.js +794 -0
  325. package/src/components/style-book/style.scss +44 -0
  326. package/src/components/style-book/test/categories.js +166 -0
  327. package/src/components/style-book/types.ts +80 -0
  328. package/src/components/styles-canvas/index.js +126 -0
  329. package/src/components/styles-canvas/revisions.js +144 -0
  330. package/src/components/styles-canvas/style-book.js +57 -0
  331. package/src/components/styles-canvas/style.scss +40 -0
  332. package/src/components/visual-editor/index.js +2 -1
  333. package/src/dataviews/fields/content-preview/content-preview-view.tsx +2 -0
  334. package/src/hooks/index.js +1 -0
  335. package/src/hooks/media-upload.js +25 -5
  336. package/src/hooks/push-changes-to-global-styles/index.js +391 -0
  337. package/src/hooks/push-changes-to-global-styles/style.scss +4 -0
  338. package/src/hooks/use-global-styles-output.js +76 -0
  339. package/src/private-apis.js +10 -8
  340. package/src/store/actions.js +4 -1
  341. package/src/store/private-actions.js +37 -0
  342. package/src/store/private-selectors.js +20 -0
  343. package/src/store/reducer.js +36 -0
  344. package/src/style.scss +7 -0
  345. package/src/utils/set-nested-value.js +39 -0
  346. package/tsconfig.json +3 -0
  347. package/tsconfig.tsbuildinfo +1 -1
  348. package/build/components/editor-interface/content-slot-fill.js.map +0 -7
  349. package/build-module/components/editor-interface/content-slot-fill.js +0 -9
  350. package/build-module/components/editor-interface/content-slot-fill.js.map +0 -7
  351. package/build-types/components/editor-interface/content-slot-fill.d.ts +0 -14
  352. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +0 -1
  353. package/src/components/editor-interface/content-slot-fill.js +0 -10
@@ -1,3 +1,7 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
1
5
  /**
2
6
  * WordPress dependencies
3
7
  */
@@ -18,7 +22,7 @@ import {
18
22
  import { unlock } from '../../lock-unlock';
19
23
  import CommentAuthorInfo from './comment-author-info';
20
24
  import CommentForm from './comment-form';
21
- import { focusCommentThread } from './utils';
25
+ import { focusCommentThread, noop } from './utils';
22
26
 
23
27
  const { useBlockElement } = unlock( blockEditorPrivateApis );
24
28
 
@@ -27,6 +31,10 @@ export function AddComment( {
27
31
  showCommentBoard,
28
32
  setShowCommentBoard,
29
33
  commentSidebarRef,
34
+ reflowComments = noop,
35
+ isFloating = false,
36
+ y,
37
+ refs,
30
38
  } ) {
31
39
  const { clientId, blockCommentId } = useSelect( ( select ) => {
32
40
  const { getSelectedBlock } = select( blockEditorStore );
@@ -44,10 +52,29 @@ export function AddComment( {
44
52
 
45
53
  return (
46
54
  <VStack
47
- className="editor-collab-sidebar-panel__thread is-selected"
55
+ className={ clsx(
56
+ 'editor-collab-sidebar-panel__thread is-selected',
57
+ {
58
+ 'is-floating': isFloating,
59
+ }
60
+ ) }
48
61
  spacing="3"
49
62
  tabIndex={ 0 }
63
+ aria-label={ __( 'New note' ) }
50
64
  role="listitem"
65
+ ref={ isFloating ? refs.setFloating : undefined }
66
+ style={
67
+ isFloating
68
+ ? // Delay showing the floating note box until a Y position is known to prevent blink.
69
+ { top: y, opacity: ! y ? 0 : undefined }
70
+ : undefined
71
+ }
72
+ onBlur={ ( event ) => {
73
+ if ( event.currentTarget.contains( event.relatedTarget ) ) {
74
+ return;
75
+ }
76
+ setShowCommentBoard( false );
77
+ } }
51
78
  >
52
79
  <HStack alignment="left" spacing="3">
53
80
  <CommentAuthorInfo />
@@ -62,8 +89,9 @@ export function AddComment( {
62
89
  setShowCommentBoard( false );
63
90
  blockElement?.focus();
64
91
  } }
92
+ reflowComments={ reflowComments }
65
93
  submitButtonText={ __( 'Add note' ) }
66
- labelText={ __( 'New Note' ) }
94
+ labelText={ __( 'New note' ) }
67
95
  />
68
96
  </VStack>
69
97
  );
@@ -18,38 +18,45 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
18
18
  */
19
19
  import { getAvatarBorderColor } from './utils';
20
20
 
21
- /**
22
- * Render author information for a comment.
23
- *
24
- * @param {Object} props - Component properties.
25
- * @param {string} props.avatar - URL of the author's avatar.
26
- * @param {string} props.name - Name of the author.
27
- * @param {string} props.date - Date of the comment.
28
- * @param {string} props.userId - User ID of the author.
29
- *
30
- * @return {React.ReactNode} The JSX element representing the author's information.
31
- */
32
21
  function CommentAuthorInfo( { avatar, name, date, userId } ) {
22
+ const hasAvatar = !! avatar;
33
23
  const dateSettings = getDateSettings();
34
24
  const {
35
25
  currentUserAvatar,
36
26
  currentUserName,
37
27
  currentUserId,
38
28
  dateFormat = dateSettings.formats.date,
39
- } = useSelect( ( select ) => {
40
- const { getCurrentUser, getEntityRecord } = select( coreStore );
41
- const { getSettings } = select( blockEditorStore );
42
- const userData = getCurrentUser();
43
- const { __experimentalDiscussionSettings } = getSettings();
44
- const defaultAvatar = __experimentalDiscussionSettings?.avatarURL;
45
- const siteSettings = getEntityRecord( 'root', 'site' );
46
- return {
47
- currentUserAvatar: userData?.avatar_urls?.[ 48 ] ?? defaultAvatar,
48
- currentUserName: userData?.name,
49
- currentUserId: userData?.id,
50
- dateFormat: siteSettings?.date_format,
51
- };
52
- }, [] );
29
+ } = useSelect(
30
+ ( select ) => {
31
+ const { canUser, getCurrentUser, getEntityRecord } =
32
+ select( coreStore );
33
+ const siteSettings = canUser( 'read', {
34
+ kind: 'root',
35
+ name: 'site',
36
+ } )
37
+ ? getEntityRecord( 'root', 'site' )
38
+ : undefined;
39
+
40
+ if ( hasAvatar ) {
41
+ return {
42
+ dateFormat: siteSettings?.date_format,
43
+ };
44
+ }
45
+
46
+ const { getSettings } = select( blockEditorStore );
47
+ const { __experimentalDiscussionSettings } = getSettings();
48
+ const defaultAvatar = __experimentalDiscussionSettings?.avatarURL;
49
+ const userData = getCurrentUser();
50
+ return {
51
+ currentUserAvatar:
52
+ userData?.avatar_urls?.[ 48 ] ?? defaultAvatar,
53
+ currentUserName: userData?.name,
54
+ currentUserId: userData?.id,
55
+ dateFormat: siteSettings?.date_format,
56
+ };
57
+ },
58
+ [ hasAvatar ]
59
+ );
53
60
 
54
61
  const commentDate = getDate( date );
55
62
  const commentDateTime = dateI18n( 'c', commentDate );
@@ -6,11 +6,6 @@ import { __, _n, sprintf } from '@wordpress/i18n';
6
6
  import { useMemo } from '@wordpress/element';
7
7
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
8
8
 
9
- /**
10
- * External dependencies
11
- */
12
- import clsx from 'clsx';
13
-
14
9
  /**
15
10
  * Internal dependencies
16
11
  */
@@ -19,7 +14,7 @@ import { getAvatarBorderColor } from './utils';
19
14
 
20
15
  const { CommentIconToolbarSlotFill } = unlock( blockEditorPrivateApis );
21
16
 
22
- const CommentAvatarIndicator = ( { onClick, thread, hasMoreComments } ) => {
17
+ const CommentAvatarIndicator = ( { onClick, thread } ) => {
23
18
  const threadParticipants = useMemo( () => {
24
19
  if ( ! thread ) {
25
20
  return [];
@@ -34,15 +29,13 @@ const CommentAvatarIndicator = ( { onClick, thread, hasMoreComments } ) => {
34
29
  allComments.forEach( ( comment ) => {
35
30
  // Track thread participants (original commenter + repliers).
36
31
  if ( comment.author_name && comment.author_avatar_urls ) {
37
- const authorKey = `${ comment.author }-${ comment.author_name }`;
38
- if ( ! participantsMap.has( authorKey ) ) {
39
- participantsMap.set( authorKey, {
32
+ if ( ! participantsMap.has( comment.author ) ) {
33
+ participantsMap.set( comment.author, {
40
34
  name: comment.author_name,
41
35
  avatar:
42
36
  comment.author_avatar_urls?.[ '48' ] ||
43
37
  comment.author_avatar_urls?.[ '96' ],
44
38
  id: comment.author,
45
- isOriginalCommenter: comment.id === thread.id,
46
39
  date: comment.date,
47
40
  } );
48
41
  }
@@ -52,14 +45,6 @@ const CommentAvatarIndicator = ( { onClick, thread, hasMoreComments } ) => {
52
45
  return Array.from( participantsMap.values() );
53
46
  }, [ thread ] );
54
47
 
55
- const hasUnresolved = thread?.status !== 'approved';
56
-
57
- // Check if this specific thread has more participants due to pagination.
58
- // If we have pagination AND this thread + its replies equals or exceeds the API limit,
59
- // then this thread likely has more participants that weren't loaded.
60
- const threadHasMoreParticipants =
61
- hasMoreComments && thread?.reply && 1 + thread.reply.length >= 100;
62
-
63
48
  if ( ! threadParticipants.length ) {
64
49
  return null;
65
50
  }
@@ -68,6 +53,7 @@ const CommentAvatarIndicator = ( { onClick, thread, hasMoreComments } ) => {
68
53
  const maxAvatars = 3;
69
54
  const visibleParticipants = threadParticipants.slice( 0, maxAvatars );
70
55
  const overflowCount = Math.max( 0, threadParticipants.length - maxAvatars );
56
+ const threadHasMoreParticipants = threadParticipants.length > 100;
71
57
 
72
58
  // If we hit the comment limit, show "100+" instead of exact overflow count.
73
59
  const overflowText =
@@ -95,9 +81,7 @@ const CommentAvatarIndicator = ( { onClick, thread, hasMoreComments } ) => {
95
81
  return (
96
82
  <CommentIconToolbarSlotFill.Fill>
97
83
  <ToolbarButton
98
- className={ clsx( 'comment-avatar-indicator', {
99
- 'has-unresolved': hasUnresolved,
100
- } ) }
84
+ className="comment-avatar-indicator"
101
85
  label={ __( 'View notes' ) }
102
86
  onClick={ onClick }
103
87
  showTooltip
@@ -105,7 +89,7 @@ const CommentAvatarIndicator = ( { onClick, thread, hasMoreComments } ) => {
105
89
  <div className="comment-avatar-stack">
106
90
  { visibleParticipants.map( ( participant, index ) => (
107
91
  <img
108
- key={ participant.name + index }
92
+ key={ participant.id }
109
93
  src={ participant.avatar }
110
94
  alt={ participant.name }
111
95
  className="comment-avatar"
@@ -6,7 +6,13 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { useState, RawHTML, useEffect, useCallback } from '@wordpress/element';
9
+ import {
10
+ useState,
11
+ RawHTML,
12
+ useEffect,
13
+ useCallback,
14
+ useMemo,
15
+ } from '@wordpress/element';
10
16
  import {
11
17
  __experimentalText as Text,
12
18
  __experimentalHStack as HStack,
@@ -33,32 +39,19 @@ import {
33
39
  import { unlock } from '../../lock-unlock';
34
40
  import CommentAuthorInfo from './comment-author-info';
35
41
  import CommentForm from './comment-form';
36
- import { getCommentExcerpt, focusCommentThread } from './utils';
42
+ import { focusCommentThread, getCommentExcerpt } from './utils';
37
43
  import { useFloatingThread } from './hooks';
44
+ import { AddComment } from './add-comment';
38
45
 
39
46
  const { useBlockElement } = unlock( blockEditorPrivateApis );
40
47
  const { Menu } = unlock( componentsPrivateApis );
41
48
 
42
- /**
43
- * Renders the Comments component.
44
- *
45
- * @param {Object} props - The component props.
46
- * @param {Array} props.threads - The array of comment threads.
47
- * @param {Function} props.onEditComment - The function to handle comment editing.
48
- * @param {Function} props.onAddReply - The function to add a reply to a comment.
49
- * @param {Function} props.onCommentDelete - The function to delete a comment.
50
- * @param {Function} props.setShowCommentBoard - The function to set the comment board visibility.
51
- * @param {Ref} props.commentSidebarRef - The ref to the comment sidebar.
52
- * @param {Function} props.reflowComments - The function to call indicating a comment is updated.
53
- * @param {boolean} props.isFloating - Whether the comment thread is floating.
54
- * @param {number} props.commentLastUpdated - Timestamp of the last comment update.
55
- * @return {React.ReactNode} The rendered Comments component.
56
- */
57
49
  export function Comments( {
58
- threads,
50
+ threads: noteThreads,
59
51
  onEditComment,
60
52
  onAddReply,
61
53
  onCommentDelete,
54
+ showCommentBoard,
62
55
  setShowCommentBoard,
63
56
  commentSidebarRef,
64
57
  reflowComments,
@@ -70,20 +63,62 @@ export function Comments( {
70
63
  const [ boardOffsets, setBoardOffsets ] = useState( {} );
71
64
  const [ blockRefs, setBlockRefs ] = useState( {} );
72
65
 
73
- const { blockCommentId, selectedBlockClientId } = useSelect( ( select ) => {
74
- const { getBlockAttributes, getSelectedBlockClientId } =
75
- select( blockEditorStore );
76
- const clientId = getSelectedBlockClientId();
77
- return {
78
- blockCommentId: clientId
79
- ? getBlockAttributes( clientId )?.metadata?.noteId
80
- : null,
81
- selectedBlockClientId: clientId,
82
- };
83
- }, [] );
66
+ const { blockCommentId, selectedBlockClientId, orderedBlockIds } =
67
+ useSelect( ( select ) => {
68
+ const { getBlockAttributes, getSelectedBlockClientId } =
69
+ select( blockEditorStore );
70
+ const clientId = getSelectedBlockClientId();
71
+ return {
72
+ blockCommentId: clientId
73
+ ? getBlockAttributes( clientId )?.metadata?.noteId
74
+ : null,
75
+ selectedBlockClientId: clientId,
76
+ orderedBlockIds: select( blockEditorStore ).getBlockOrder(),
77
+ };
78
+ }, [] );
84
79
 
85
80
  const relatedBlockElement = useBlockElement( selectedBlockClientId );
86
81
 
82
+ const threads = useMemo( () => {
83
+ const t = [ ...noteThreads ];
84
+ const orderedThreads = [];
85
+ // In floating mode, when the note board is shown, and as long
86
+ // as the selected block doesn't have an existing note attached -
87
+ // add a "new note" entry to the threads. This special thread type
88
+ // gets sorted and floated like regular threads, but shows an AddComment
89
+ // component instead of a regular comment thread.
90
+ if ( isFloating && showCommentBoard && undefined === blockCommentId ) {
91
+ // Insert the new note entry at the correct location for its blockId.
92
+ const newNoteThread = {
93
+ id: 'new-note-thread',
94
+ blockClientId: selectedBlockClientId,
95
+ content: { rendered: '' },
96
+ };
97
+ // Insert the new comment block at the right order within the threads.
98
+ orderedBlockIds.forEach( ( blockId ) => {
99
+ if ( blockId === selectedBlockClientId ) {
100
+ orderedThreads.push( newNoteThread );
101
+ } else {
102
+ const threadForBlock = t.find(
103
+ ( thread ) => thread.blockClientId === blockId
104
+ );
105
+ if ( threadForBlock ) {
106
+ orderedThreads.push( threadForBlock );
107
+ }
108
+ }
109
+ } );
110
+ return orderedThreads;
111
+ }
112
+ return t;
113
+ }, [
114
+ noteThreads,
115
+ isFloating,
116
+ showCommentBoard,
117
+ blockCommentId,
118
+ selectedBlockClientId,
119
+ orderedBlockIds,
120
+ ] );
121
+
87
122
  const handleDelete = async ( comment ) => {
88
123
  const currentIndex = threads.findIndex( ( t ) => t.id === comment.id );
89
124
  const nextThread = threads[ currentIndex + 1 ];
@@ -247,17 +282,33 @@ export function Comments( {
247
282
  const hasThreads = Array.isArray( threads ) && threads.length > 0;
248
283
  if ( ! hasThreads && ! isFloating ) {
249
284
  return (
250
- <VStack alignment="left" justify="flex-start" spacing="2">
285
+ <>
286
+ <AddComment
287
+ onSubmit={ onAddReply }
288
+ showCommentBoard={ showCommentBoard }
289
+ setShowCommentBoard={ setShowCommentBoard }
290
+ commentSidebarRef={ commentSidebarRef }
291
+ />
251
292
  <Text as="p">{ __( 'No notes available.' ) }</Text>
252
293
  <Text as="p" variant="muted">
253
294
  { __( 'Only logged in users can see Notes.' ) }
254
295
  </Text>
255
- </VStack>
296
+ </>
256
297
  );
257
298
  }
258
299
 
259
300
  return (
260
- <VStack spacing="3">
301
+ <>
302
+ { ! isFloating &&
303
+ showCommentBoard &&
304
+ undefined === blockCommentId && (
305
+ <AddComment
306
+ onSubmit={ onAddReply }
307
+ showCommentBoard={ showCommentBoard }
308
+ setShowCommentBoard={ setShowCommentBoard }
309
+ commentSidebarRef={ commentSidebarRef }
310
+ />
311
+ ) }
261
312
  { threads.map( ( thread ) => (
262
313
  <Thread
263
314
  key={ thread.id }
@@ -276,9 +327,10 @@ export function Comments( {
276
327
  setBlockRef={ setBlockRef }
277
328
  selectedThread={ selectedThread }
278
329
  commentLastUpdated={ commentLastUpdated }
330
+ showCommentBoard={ showCommentBoard }
279
331
  />
280
332
  ) ) }
281
- </VStack>
333
+ </>
282
334
  );
283
335
  }
284
336
 
@@ -298,6 +350,7 @@ function Thread( {
298
350
  setSelectedThread,
299
351
  selectedThread,
300
352
  commentLastUpdated,
353
+ showCommentBoard,
301
354
  } ) {
302
355
  const { toggleBlockHighlight, selectBlock, toggleBlockSpotlight } = unlock(
303
356
  useDispatch( blockEditorStore )
@@ -347,7 +400,7 @@ function Thread( {
347
400
  const restReplies = allReplies.length > 0 ? allReplies.slice( 0, -1 ) : [];
348
401
 
349
402
  const commentExcerpt = getCommentExcerpt(
350
- stripHTML( thread.content.rendered ),
403
+ stripHTML( thread.content?.rendered ),
351
404
  10
352
405
  );
353
406
  const ariaLabel = !! thread.blockClientId
@@ -362,6 +415,21 @@ function Thread( {
362
415
  commentExcerpt
363
416
  );
364
417
 
418
+ if ( 'new-note-thread' === thread.id && showCommentBoard && isFloating ) {
419
+ return (
420
+ <AddComment
421
+ onSubmit={ onAddReply }
422
+ showCommentBoard={ showCommentBoard }
423
+ setShowCommentBoard={ setShowCommentBoard }
424
+ commentSidebarRef={ commentSidebarRef }
425
+ reflowComments={ reflowComments }
426
+ isFloating={ isFloating }
427
+ y={ y }
428
+ refs={ refs }
429
+ />
430
+ );
431
+ }
432
+
365
433
  return (
366
434
  // Disable reason: role="listitem" does in fact support aria-expanded.
367
435
  // eslint-disable-next-line jsx-a11y/role-supports-aria-props
@@ -378,6 +446,9 @@ function Thread( {
378
446
  onFocus={ onMouseEnter }
379
447
  onBlur={ onMouseLeave }
380
448
  onKeyDown={ ( event ) => {
449
+ if ( event.defaultPrevented ) {
450
+ return;
451
+ }
381
452
  // Expand or Collapse thread.
382
453
  if (
383
454
  event.key === 'Enter' &&
@@ -745,7 +816,9 @@ const CommentBoard = ( {
745
816
  onCancel={ handleCancel }
746
817
  confirmButtonText={ __( 'Delete' ) }
747
818
  >
748
- { __( 'Are you sure you want to delete this note?' ) }
819
+ { __(
820
+ "Are you sure you want to delete this note? This will also delete all of this note's replies."
821
+ ) }
749
822
  </ConfirmDialog>
750
823
  ) }
751
824
  </VStack>
@@ -50,10 +50,10 @@ export function useBlockComments( postId ) {
50
50
  post: postId,
51
51
  type: 'note',
52
52
  status: 'all',
53
- per_page: 100,
53
+ per_page: -1,
54
54
  };
55
55
 
56
- const { records: threads, totalPages } = useEntityRecords(
56
+ const { records: threads } = useEntityRecords(
57
57
  'root',
58
58
  'comment',
59
59
  queryArgs,
@@ -160,7 +160,6 @@ export function useBlockComments( postId ) {
160
160
  return {
161
161
  resultComments,
162
162
  unresolvedSortedThreads,
163
- totalPages,
164
163
  reflowComments,
165
164
  commentLastUpdated,
166
165
  };
@@ -399,7 +398,7 @@ export function useFloatingThread( {
399
398
  if ( blockRef.current ) {
400
399
  refs.setReference( blockRef.current );
401
400
  }
402
- }, [ blockRef, refs ] );
401
+ }, [ blockRef, refs, commentLastUpdated ] );
403
402
 
404
403
  // Track thread heights.
405
404
  useEffect( () => {
@@ -20,7 +20,6 @@ import {
20
20
  SIDEBARS,
21
21
  } from './constants';
22
22
  import { Comments } from './comments';
23
- import { AddComment } from './add-comment';
24
23
  import { store as editorStore } from '../../store';
25
24
  import AddCommentMenuItem from './comment-menu-item';
26
25
  import CommentAvatarIndicator from './comment-indicator-toolbar';
@@ -31,9 +30,9 @@ import {
31
30
  useEnableFloatingSidebar,
32
31
  } from './hooks';
33
32
  import { focusCommentThread } from './utils';
34
- import PluginMoreMenuItem from '../plugin-more-menu-item';
33
+ import PostTypeSupportCheck from '../post-type-support-check';
35
34
 
36
- function CollabSidebarContent( {
35
+ function NotesSidebarContent( {
37
36
  showCommentBoard,
38
37
  setShowCommentBoard,
39
38
  styles,
@@ -61,12 +60,6 @@ function CollabSidebarContent( {
61
60
  }
62
61
  } }
63
62
  >
64
- <AddComment
65
- onSubmit={ onCreate }
66
- showCommentBoard={ showCommentBoard }
67
- setShowCommentBoard={ setShowCommentBoard }
68
- commentSidebarRef={ commentSidebarRef }
69
- />
70
63
  <Comments
71
64
  threads={ comments }
72
65
  onEditComment={ onEdit }
@@ -83,22 +76,14 @@ function CollabSidebarContent( {
83
76
  );
84
77
  }
85
78
 
86
- /**
87
- * Renders the Collab sidebar.
88
- */
89
- export default function CollabSidebar() {
79
+ function NotesSidebar( { postId, mode } ) {
90
80
  const [ showCommentBoard, setShowCommentBoard ] = useState( false );
91
81
  const { getActiveComplementaryArea } = useSelect( interfaceStore );
92
82
  const { enableComplementaryArea } = useDispatch( interfaceStore );
93
83
  const isLargeViewport = useViewportMatch( 'medium' );
94
84
  const commentSidebarRef = useRef( null );
95
85
 
96
- const { postId } = useSelect( ( select ) => {
97
- const { getCurrentPostId } = select( editorStore );
98
- return {
99
- postId: getCurrentPostId(),
100
- };
101
- }, [] );
86
+ const showFloatingSidebar = isLargeViewport && mode === 'post-only';
102
87
 
103
88
  const blockCommentId = useSelect( ( select ) => {
104
89
  const { getBlockAttributes, getSelectedBlockClientId } =
@@ -112,17 +97,14 @@ export default function CollabSidebar() {
112
97
  const {
113
98
  resultComments,
114
99
  unresolvedSortedThreads,
115
- totalPages,
116
100
  reflowComments,
117
101
  commentLastUpdated,
118
102
  } = useBlockComments( postId );
119
103
  useEnableFloatingSidebar(
120
- isLargeViewport &&
104
+ showFloatingSidebar &&
121
105
  ( unresolvedSortedThreads.length > 0 || showCommentBoard )
122
106
  );
123
107
 
124
- const hasMoreComments = totalPages && totalPages > 1;
125
-
126
108
  // Get the global styles to set the background color of the sidebar.
127
109
  const { merged: GlobalStyles } = useGlobalStylesContext();
128
110
  const backgroundColor = GlobalStyles?.styles?.color?.background;
@@ -132,20 +114,18 @@ export default function CollabSidebar() {
132
114
  ? resultComments.find( ( thread ) => thread.id === blockCommentId )
133
115
  : null;
134
116
 
135
- // If postId is not a valid number, do not render the comment sidebar.
136
- if ( ! ( !! postId && typeof postId === 'number' ) ) {
137
- return null;
138
- }
139
-
140
117
  async function openTheSidebar() {
141
118
  const prevArea = await getActiveComplementaryArea( 'core' );
142
119
  const activeNotesArea = SIDEBARS.find( ( name ) => name === prevArea );
143
120
 
144
- // If the notes sidebar is not already active, enable the floating sidebar.
145
- if ( ! activeNotesArea ) {
121
+ if ( currentThread?.status === 'approved' ) {
122
+ enableComplementaryArea( 'core', collabHistorySidebarName );
123
+ } else if ( ! activeNotesArea ) {
146
124
  enableComplementaryArea(
147
125
  'core',
148
- isLargeViewport ? collabSidebarName : collabHistorySidebarName
126
+ showFloatingSidebar
127
+ ? collabSidebarName
128
+ : collabHistorySidebarName
149
129
  );
150
130
  }
151
131
 
@@ -169,18 +149,18 @@ export default function CollabSidebar() {
169
149
  { blockCommentId && (
170
150
  <CommentAvatarIndicator
171
151
  thread={ currentThread }
172
- hasMoreComments={ hasMoreComments }
173
152
  onClick={ openTheSidebar }
174
153
  />
175
154
  ) }
176
155
  <AddCommentMenuItem onClick={ openTheSidebar } />
177
156
  <PluginSidebar
178
157
  identifier={ collabHistorySidebarName }
158
+ name={ collabHistorySidebarName }
179
159
  title={ __( 'Notes' ) }
180
160
  icon={ commentIcon }
181
161
  closeLabel={ __( 'Close Notes' ) }
182
162
  >
183
- <CollabSidebarContent
163
+ <NotesSidebarContent
184
164
  comments={ resultComments }
185
165
  showCommentBoard={ showCommentBoard }
186
166
  setShowCommentBoard={ setShowCommentBoard }
@@ -198,7 +178,7 @@ export default function CollabSidebar() {
198
178
  headerClassName="editor-collab-sidebar__header"
199
179
  backgroundColor={ backgroundColor }
200
180
  >
201
- <CollabSidebarContent
181
+ <NotesSidebarContent
202
182
  comments={ unresolvedSortedThreads }
203
183
  showCommentBoard={ showCommentBoard }
204
184
  setShowCommentBoard={ setShowCommentBoard }
@@ -212,14 +192,26 @@ export default function CollabSidebar() {
212
192
  />
213
193
  </PluginSidebar>
214
194
  ) }
215
- <PluginMoreMenuItem
216
- icon={ commentIcon }
217
- onClick={ () =>
218
- enableComplementaryArea( 'core', collabHistorySidebarName )
219
- }
220
- >
221
- { __( 'Notes' ) }
222
- </PluginMoreMenuItem>
223
195
  </>
224
196
  );
225
197
  }
198
+
199
+ export default function NotesSidebarContainer() {
200
+ const { postId, mode } = useSelect( ( select ) => {
201
+ const { getCurrentPostId, getRenderingMode } = select( editorStore );
202
+ return {
203
+ postId: getCurrentPostId(),
204
+ mode: getRenderingMode(),
205
+ };
206
+ }, [] );
207
+
208
+ if ( ! postId || typeof postId !== 'number' ) {
209
+ return null;
210
+ }
211
+
212
+ return (
213
+ <PostTypeSupportCheck supportKeys="editor.notes">
214
+ <NotesSidebar postId={ postId } mode={ mode } />
215
+ </PostTypeSupportCheck>
216
+ );
217
+ }
@@ -16,7 +16,7 @@
16
16
  }
17
17
 
18
18
  .editor-collab-sidebar-panel {
19
- padding: $grid-unit-20;
19
+ padding: $grid-unit-20 $grid-unit-20 $grid-unit-30;
20
20
  height: 100%;
21
21
  overflow: hidden;
22
22
  }
@@ -161,27 +161,6 @@
161
161
  min-width: auto;
162
162
  background: transparent;
163
163
  border: none;
164
-
165
- &:hover::before {
166
- background: rgba(0, 0, 0, 0.04);
167
- }
168
-
169
- &.has-unresolved {
170
- .comment-avatar-stack {
171
- &::after {
172
- content: "";
173
- position: absolute;
174
- top: -2px;
175
- right: -2px;
176
- width: $grid-unit-10;
177
- height: $grid-unit-10;
178
- background: #d63638;
179
- border-radius: $radius-round;
180
- border: $border-width solid $white;
181
- z-index: 10;
182
- }
183
- }
184
- }
185
164
  }
186
165
 
187
166
  .comment-avatar-stack {