@wordpress/editor 14.11.0 → 14.12.1-next.082ed6819.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 (842) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +120 -107
  3. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  4. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  5. package/build/components/collab-sidebar/add-comment.js +19 -68
  6. package/build/components/collab-sidebar/add-comment.js.map +1 -1
  7. package/build/components/collab-sidebar/comment-author-info.js +76 -0
  8. package/build/components/collab-sidebar/comment-author-info.js.map +1 -0
  9. package/build/components/collab-sidebar/comment-button-toolbar.js +2 -2
  10. package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
  11. package/build/components/collab-sidebar/comment-button.js +2 -2
  12. package/build/components/collab-sidebar/comment-button.js.map +1 -1
  13. package/build/components/collab-sidebar/comment-form.js +64 -0
  14. package/build/components/collab-sidebar/comment-form.js.map +1 -0
  15. package/build/components/collab-sidebar/comments.js +33 -91
  16. package/build/components/collab-sidebar/comments.js.map +1 -1
  17. package/build/components/collab-sidebar/index.js +75 -73
  18. package/build/components/collab-sidebar/index.js.map +1 -1
  19. package/build/components/commands/index.js +142 -34
  20. package/build/components/commands/index.js.map +1 -1
  21. package/build/components/create-template-part-modal/index.js +2 -2
  22. package/build/components/create-template-part-modal/index.js.map +1 -1
  23. package/build/components/document-bar/index.js +18 -5
  24. package/build/components/document-bar/index.js.map +1 -1
  25. package/build/components/document-outline/check.js +4 -4
  26. package/build/components/document-outline/check.js.map +1 -1
  27. package/build/components/document-outline/index.js +8 -8
  28. package/build/components/document-outline/index.js.map +1 -1
  29. package/build/components/document-tools/index.js +8 -4
  30. package/build/components/document-tools/index.js.map +1 -1
  31. package/build/components/editor-history/redo.js +1 -1
  32. package/build/components/editor-history/redo.js.map +1 -1
  33. package/build/components/editor-history/undo.js +1 -1
  34. package/build/components/editor-history/undo.js.map +1 -1
  35. package/build/components/editor-interface/content-slot-fill.js +1 -10
  36. package/build/components/editor-interface/content-slot-fill.js.map +1 -1
  37. package/build/components/editor-interface/index.js +4 -11
  38. package/build/components/editor-interface/index.js.map +1 -1
  39. package/build/components/editor-notices/index.js +1 -1
  40. package/build/components/editor-notices/index.js.map +1 -1
  41. package/build/components/editor-snackbars/index.js +1 -1
  42. package/build/components/editor-snackbars/index.js.map +1 -1
  43. package/build/components/entities-saved-states/entity-record-item.js +9 -1
  44. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  45. package/build/components/entities-saved-states/index.js +2 -2
  46. package/build/components/entities-saved-states/index.js.map +1 -1
  47. package/build/components/global-styles-provider/index.js +20 -8
  48. package/build/components/global-styles-provider/index.js.map +1 -1
  49. package/build/components/header/index.js +10 -12
  50. package/build/components/header/index.js.map +1 -1
  51. package/build/components/more-menu/index.js +9 -7
  52. package/build/components/more-menu/index.js.map +1 -1
  53. package/build/components/page-attributes/check.js +3 -3
  54. package/build/components/page-attributes/check.js.map +1 -1
  55. package/build/components/page-attributes/order.js +1 -1
  56. package/build/components/page-attributes/order.js.map +1 -1
  57. package/build/components/page-attributes/panel.js +1 -1
  58. package/build/components/page-attributes/panel.js.map +1 -1
  59. package/build/components/page-attributes/parent.js +1 -1
  60. package/build/components/page-attributes/parent.js.map +1 -1
  61. package/build/components/plugin-document-setting-panel/index.js +2 -2
  62. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  63. package/build/components/plugin-more-menu-item/index.js +2 -1
  64. package/build/components/plugin-more-menu-item/index.js.map +1 -1
  65. package/build/components/plugin-post-publish-panel/index.js +2 -2
  66. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  67. package/build/components/plugin-post-status-info/index.js +4 -4
  68. package/build/components/plugin-post-status-info/index.js.map +1 -1
  69. package/build/components/plugin-pre-publish-panel/index.js +2 -2
  70. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  71. package/build/components/plugin-preview-menu-item/index.js +2 -1
  72. package/build/components/plugin-preview-menu-item/index.js.map +1 -1
  73. package/build/components/plugin-sidebar/index.js +1 -0
  74. package/build/components/plugin-sidebar/index.js.map +1 -1
  75. package/build/components/plugin-sidebar-more-menu-item/index.js +2 -1
  76. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  77. package/build/components/post-actions/actions.js +3 -3
  78. package/build/components/post-actions/actions.js.map +1 -1
  79. package/build/components/post-author/check.js +3 -3
  80. package/build/components/post-author/check.js.map +1 -1
  81. package/build/components/post-author/index.js +1 -1
  82. package/build/components/post-author/index.js.map +1 -1
  83. package/build/components/post-author/panel.js +1 -1
  84. package/build/components/post-author/panel.js.map +1 -1
  85. package/build/components/post-card-panel/index.js +9 -4
  86. package/build/components/post-card-panel/index.js.map +1 -1
  87. package/build/components/post-comments/index.js +1 -1
  88. package/build/components/post-comments/index.js.map +1 -1
  89. package/build/components/post-discussion/panel.js +1 -1
  90. package/build/components/post-discussion/panel.js.map +1 -1
  91. package/build/components/post-excerpt/check.js +3 -3
  92. package/build/components/post-excerpt/check.js.map +1 -1
  93. package/build/components/post-excerpt/panel.js +1 -1
  94. package/build/components/post-excerpt/panel.js.map +1 -1
  95. package/build/components/post-excerpt/plugin.js +4 -4
  96. package/build/components/post-excerpt/plugin.js.map +1 -1
  97. package/build/components/post-featured-image/check.js +3 -3
  98. package/build/components/post-featured-image/check.js.map +1 -1
  99. package/build/components/post-featured-image/index.js +39 -9
  100. package/build/components/post-featured-image/index.js.map +1 -1
  101. package/build/components/post-featured-image/panel.js +1 -1
  102. package/build/components/post-featured-image/panel.js.map +1 -1
  103. package/build/components/post-fields/index.js +70 -0
  104. package/build/components/post-fields/index.js.map +1 -0
  105. package/build/components/post-format/check.js +9 -12
  106. package/build/components/post-format/check.js.map +1 -1
  107. package/build/components/post-format/index.js +1 -1
  108. package/build/components/post-format/index.js.map +1 -1
  109. package/build/components/post-format/panel.js +1 -1
  110. package/build/components/post-format/panel.js.map +1 -1
  111. package/build/components/post-last-revision/check.js +3 -3
  112. package/build/components/post-last-revision/check.js.map +1 -1
  113. package/build/components/post-last-revision/index.js +1 -1
  114. package/build/components/post-last-revision/index.js.map +1 -1
  115. package/build/components/post-last-revision/panel.js +1 -1
  116. package/build/components/post-last-revision/panel.js.map +1 -1
  117. package/build/components/post-locked-modal/index.js +1 -1
  118. package/build/components/post-locked-modal/index.js.map +1 -1
  119. package/build/components/post-pending-status/check.js +3 -3
  120. package/build/components/post-pending-status/check.js.map +1 -1
  121. package/build/components/post-pending-status/index.js +1 -1
  122. package/build/components/post-pending-status/index.js.map +1 -1
  123. package/build/components/post-preview-button/index.js +1 -1
  124. package/build/components/post-preview-button/index.js.map +1 -1
  125. package/build/components/post-publish-panel/index.js +5 -2
  126. package/build/components/post-publish-panel/index.js.map +1 -1
  127. package/build/components/post-schedule/check.js +3 -3
  128. package/build/components/post-schedule/check.js.map +1 -1
  129. package/build/components/post-schedule/index.js +1 -1
  130. package/build/components/post-schedule/index.js.map +1 -1
  131. package/build/components/post-schedule/label.js +1 -1
  132. package/build/components/post-schedule/label.js.map +1 -1
  133. package/build/components/post-schedule/panel.js +1 -1
  134. package/build/components/post-schedule/panel.js.map +1 -1
  135. package/build/components/post-slug/check.js +3 -3
  136. package/build/components/post-slug/check.js.map +1 -1
  137. package/build/components/post-slug/index.js +1 -1
  138. package/build/components/post-slug/index.js.map +1 -1
  139. package/build/components/post-sticky/check.js +3 -3
  140. package/build/components/post-sticky/check.js.map +1 -1
  141. package/build/components/post-sticky/index.js +1 -1
  142. package/build/components/post-sticky/index.js.map +1 -1
  143. package/build/components/post-switch-to-draft-button/index.js +1 -1
  144. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  145. package/build/components/post-sync-status/index.js +1 -1
  146. package/build/components/post-sync-status/index.js.map +1 -1
  147. package/build/components/post-taxonomies/check.js +3 -3
  148. package/build/components/post-taxonomies/check.js.map +1 -1
  149. package/build/components/post-taxonomies/flat-term-selector.js +11 -9
  150. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  151. package/build/components/post-taxonomies/panel.js +16 -13
  152. package/build/components/post-taxonomies/panel.js.map +1 -1
  153. package/build/components/post-template/classic-theme.js +2 -2
  154. package/build/components/post-template/classic-theme.js.map +1 -1
  155. package/build/components/post-template/panel.js +1 -1
  156. package/build/components/post-template/panel.js.map +1 -1
  157. package/build/components/post-template/swap-template-button.js +0 -3
  158. package/build/components/post-template/swap-template-button.js.map +1 -1
  159. package/build/components/post-text-editor/index.js +1 -1
  160. package/build/components/post-text-editor/index.js.map +1 -1
  161. package/build/components/post-title/index.js +20 -18
  162. package/build/components/post-title/index.js.map +1 -1
  163. package/build/components/post-title/post-title-raw.js +1 -1
  164. package/build/components/post-title/post-title-raw.js.map +1 -1
  165. package/build/components/post-transform-panel/index.js +0 -3
  166. package/build/components/post-transform-panel/index.js.map +1 -1
  167. package/build/components/post-trash/check.js +3 -3
  168. package/build/components/post-trash/check.js.map +1 -1
  169. package/build/components/post-trash/index.js +1 -1
  170. package/build/components/post-trash/index.js.map +1 -1
  171. package/build/components/post-type-support-check/index.js +6 -6
  172. package/build/components/post-type-support-check/index.js.map +1 -1
  173. package/build/components/post-url/check.js +3 -3
  174. package/build/components/post-url/check.js.map +1 -1
  175. package/build/components/post-url/index.js +1 -1
  176. package/build/components/post-url/index.js.map +1 -1
  177. package/build/components/post-url/label.js +1 -1
  178. package/build/components/post-url/label.js.map +1 -1
  179. package/build/components/post-url/panel.js +1 -1
  180. package/build/components/post-url/panel.js.map +1 -1
  181. package/build/components/post-visibility/check.js +1 -1
  182. package/build/components/post-visibility/check.js.map +1 -1
  183. package/build/components/post-visibility/index.js +1 -1
  184. package/build/components/post-visibility/index.js.map +1 -1
  185. package/build/components/preferences-modal/block-visibility.js +87 -0
  186. package/build/components/preferences-modal/block-visibility.js.map +1 -0
  187. package/build/components/preferences-modal/enable-panel.js +27 -19
  188. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  189. package/build/components/preferences-modal/enable-publish-sidebar.js +13 -10
  190. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  191. package/build/components/preferences-modal/index.js +28 -24
  192. package/build/components/preferences-modal/index.js.map +1 -1
  193. package/build/components/preview-dropdown/index.js +23 -4
  194. package/build/components/preview-dropdown/index.js.map +1 -1
  195. package/build/components/provider/index.js +14 -8
  196. package/build/components/provider/index.js.map +1 -1
  197. package/build/components/provider/use-block-editor-settings.js +10 -9
  198. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  199. package/build/components/sidebar/post-summary.js +2 -2
  200. package/build/components/sidebar/post-summary.js.map +1 -1
  201. package/build/components/start-page-options/index.js +0 -3
  202. package/build/components/start-page-options/index.js.map +1 -1
  203. package/build/components/start-template-options/index.js +0 -3
  204. package/build/components/start-template-options/index.js.map +1 -1
  205. package/build/components/table-of-contents/index.js +1 -1
  206. package/build/components/table-of-contents/index.js.map +1 -1
  207. package/build/components/theme-support-check/index.js +4 -4
  208. package/build/components/theme-support-check/index.js.map +1 -1
  209. package/build/components/time-to-read/index.js +1 -1
  210. package/build/components/time-to-read/index.js.map +1 -1
  211. package/build/components/unsaved-changes-warning/index.js +1 -1
  212. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  213. package/build/components/visual-editor/index.js +5 -2
  214. package/build/components/visual-editor/index.js.map +1 -1
  215. package/build/components/word-count/index.js +1 -1
  216. package/build/components/word-count/index.js.map +1 -1
  217. package/build/components/zoom-out-toggle/index.js +8 -3
  218. package/build/components/zoom-out-toggle/index.js.map +1 -1
  219. package/build/dataviews/api.js +41 -0
  220. package/build/dataviews/api.js.map +1 -1
  221. package/build/dataviews/store/private-actions.js +26 -4
  222. package/build/dataviews/store/private-actions.js.map +1 -1
  223. package/build/dataviews/store/private-selectors.js +5 -0
  224. package/build/dataviews/store/private-selectors.js.map +1 -1
  225. package/build/dataviews/store/reducer.js +23 -0
  226. package/build/dataviews/store/reducer.js.map +1 -1
  227. package/build/private-apis.js +4 -0
  228. package/build/private-apis.js.map +1 -1
  229. package/build/store/actions.js +76 -25
  230. package/build/store/actions.js.map +1 -1
  231. package/build/store/constants.js +0 -2
  232. package/build/store/constants.js.map +1 -1
  233. package/build/store/index.js +0 -4
  234. package/build/store/index.js.map +1 -1
  235. package/build/store/private-selectors.js +5 -1
  236. package/build/store/private-selectors.js.map +1 -1
  237. package/build/store/reducer.native.js +1 -0
  238. package/build/store/reducer.native.js.map +1 -1
  239. package/build/store/selectors.js +36 -44
  240. package/build/store/selectors.js.map +1 -1
  241. package/build/utils/get-template-info.js +60 -0
  242. package/build/utils/get-template-info.js.map +1 -0
  243. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  244. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  245. package/build-module/components/collab-sidebar/add-comment.js +20 -70
  246. package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
  247. package/build-module/components/collab-sidebar/comment-author-info.js +71 -0
  248. package/build-module/components/collab-sidebar/comment-author-info.js.map +1 -0
  249. package/build-module/components/collab-sidebar/comment-button-toolbar.js +2 -2
  250. package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
  251. package/build-module/components/collab-sidebar/comment-button.js +2 -2
  252. package/build-module/components/collab-sidebar/comment-button.js.map +1 -1
  253. package/build-module/components/collab-sidebar/comment-form.js +59 -0
  254. package/build-module/components/collab-sidebar/comment-form.js.map +1 -0
  255. package/build-module/components/collab-sidebar/comments.js +33 -91
  256. package/build-module/components/collab-sidebar/comments.js.map +1 -1
  257. package/build-module/components/collab-sidebar/index.js +76 -74
  258. package/build-module/components/collab-sidebar/index.js.map +1 -1
  259. package/build-module/components/commands/index.js +145 -38
  260. package/build-module/components/commands/index.js.map +1 -1
  261. package/build-module/components/create-template-part-modal/index.js +2 -2
  262. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  263. package/build-module/components/document-bar/index.js +19 -6
  264. package/build-module/components/document-bar/index.js.map +1 -1
  265. package/build-module/components/document-outline/check.js +4 -4
  266. package/build-module/components/document-outline/check.js.map +1 -1
  267. package/build-module/components/document-outline/index.js +8 -8
  268. package/build-module/components/document-outline/index.js.map +1 -1
  269. package/build-module/components/document-tools/index.js +8 -4
  270. package/build-module/components/document-tools/index.js.map +1 -1
  271. package/build-module/components/editor-history/redo.js +1 -1
  272. package/build-module/components/editor-history/redo.js.map +1 -1
  273. package/build-module/components/editor-history/undo.js +1 -1
  274. package/build-module/components/editor-history/undo.js.map +1 -1
  275. package/build-module/components/editor-interface/content-slot-fill.js +2 -11
  276. package/build-module/components/editor-interface/content-slot-fill.js.map +1 -1
  277. package/build-module/components/editor-interface/index.js +5 -12
  278. package/build-module/components/editor-interface/index.js.map +1 -1
  279. package/build-module/components/editor-notices/index.js +1 -1
  280. package/build-module/components/editor-notices/index.js.map +1 -1
  281. package/build-module/components/editor-snackbars/index.js +1 -1
  282. package/build-module/components/editor-snackbars/index.js.map +1 -1
  283. package/build-module/components/entities-saved-states/entity-record-item.js +9 -1
  284. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  285. package/build-module/components/entities-saved-states/index.js +2 -2
  286. package/build-module/components/entities-saved-states/index.js.map +1 -1
  287. package/build-module/components/global-styles-provider/index.js +20 -8
  288. package/build-module/components/global-styles-provider/index.js.map +1 -1
  289. package/build-module/components/header/index.js +10 -12
  290. package/build-module/components/header/index.js.map +1 -1
  291. package/build-module/components/more-menu/index.js +9 -7
  292. package/build-module/components/more-menu/index.js.map +1 -1
  293. package/build-module/components/page-attributes/check.js +3 -3
  294. package/build-module/components/page-attributes/check.js.map +1 -1
  295. package/build-module/components/page-attributes/order.js +1 -1
  296. package/build-module/components/page-attributes/order.js.map +1 -1
  297. package/build-module/components/page-attributes/panel.js +1 -1
  298. package/build-module/components/page-attributes/panel.js.map +1 -1
  299. package/build-module/components/page-attributes/parent.js +1 -1
  300. package/build-module/components/page-attributes/parent.js.map +1 -1
  301. package/build-module/components/plugin-document-setting-panel/index.js +2 -2
  302. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  303. package/build-module/components/plugin-more-menu-item/index.js +2 -1
  304. package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
  305. package/build-module/components/plugin-post-publish-panel/index.js +2 -2
  306. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  307. package/build-module/components/plugin-post-status-info/index.js +4 -4
  308. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  309. package/build-module/components/plugin-pre-publish-panel/index.js +2 -2
  310. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  311. package/build-module/components/plugin-preview-menu-item/index.js +2 -1
  312. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
  313. package/build-module/components/plugin-sidebar/index.js +1 -0
  314. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  315. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -1
  316. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  317. package/build-module/components/post-actions/actions.js +3 -3
  318. package/build-module/components/post-actions/actions.js.map +1 -1
  319. package/build-module/components/post-author/check.js +3 -3
  320. package/build-module/components/post-author/check.js.map +1 -1
  321. package/build-module/components/post-author/index.js +1 -1
  322. package/build-module/components/post-author/index.js.map +1 -1
  323. package/build-module/components/post-author/panel.js +1 -1
  324. package/build-module/components/post-author/panel.js.map +1 -1
  325. package/build-module/components/post-card-panel/index.js +9 -4
  326. package/build-module/components/post-card-panel/index.js.map +1 -1
  327. package/build-module/components/post-comments/index.js +1 -1
  328. package/build-module/components/post-comments/index.js.map +1 -1
  329. package/build-module/components/post-discussion/panel.js +1 -1
  330. package/build-module/components/post-discussion/panel.js.map +1 -1
  331. package/build-module/components/post-excerpt/check.js +3 -3
  332. package/build-module/components/post-excerpt/check.js.map +1 -1
  333. package/build-module/components/post-excerpt/panel.js +1 -1
  334. package/build-module/components/post-excerpt/panel.js.map +1 -1
  335. package/build-module/components/post-excerpt/plugin.js +4 -4
  336. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  337. package/build-module/components/post-featured-image/check.js +3 -3
  338. package/build-module/components/post-featured-image/check.js.map +1 -1
  339. package/build-module/components/post-featured-image/index.js +40 -10
  340. package/build-module/components/post-featured-image/index.js.map +1 -1
  341. package/build-module/components/post-featured-image/panel.js +1 -1
  342. package/build-module/components/post-featured-image/panel.js.map +1 -1
  343. package/build-module/components/post-fields/index.js +62 -0
  344. package/build-module/components/post-fields/index.js.map +1 -0
  345. package/build-module/components/post-format/check.js +10 -11
  346. package/build-module/components/post-format/check.js.map +1 -1
  347. package/build-module/components/post-format/index.js +1 -1
  348. package/build-module/components/post-format/index.js.map +1 -1
  349. package/build-module/components/post-format/panel.js +1 -1
  350. package/build-module/components/post-format/panel.js.map +1 -1
  351. package/build-module/components/post-last-revision/check.js +3 -3
  352. package/build-module/components/post-last-revision/check.js.map +1 -1
  353. package/build-module/components/post-last-revision/index.js +1 -1
  354. package/build-module/components/post-last-revision/index.js.map +1 -1
  355. package/build-module/components/post-last-revision/panel.js +1 -1
  356. package/build-module/components/post-last-revision/panel.js.map +1 -1
  357. package/build-module/components/post-locked-modal/index.js +1 -1
  358. package/build-module/components/post-locked-modal/index.js.map +1 -1
  359. package/build-module/components/post-pending-status/check.js +3 -3
  360. package/build-module/components/post-pending-status/check.js.map +1 -1
  361. package/build-module/components/post-pending-status/index.js +1 -1
  362. package/build-module/components/post-pending-status/index.js.map +1 -1
  363. package/build-module/components/post-preview-button/index.js +1 -1
  364. package/build-module/components/post-preview-button/index.js.map +1 -1
  365. package/build-module/components/post-publish-panel/index.js +5 -2
  366. package/build-module/components/post-publish-panel/index.js.map +1 -1
  367. package/build-module/components/post-schedule/check.js +3 -3
  368. package/build-module/components/post-schedule/check.js.map +1 -1
  369. package/build-module/components/post-schedule/index.js +1 -1
  370. package/build-module/components/post-schedule/index.js.map +1 -1
  371. package/build-module/components/post-schedule/label.js +1 -1
  372. package/build-module/components/post-schedule/label.js.map +1 -1
  373. package/build-module/components/post-schedule/panel.js +1 -1
  374. package/build-module/components/post-schedule/panel.js.map +1 -1
  375. package/build-module/components/post-slug/check.js +3 -3
  376. package/build-module/components/post-slug/check.js.map +1 -1
  377. package/build-module/components/post-slug/index.js +1 -1
  378. package/build-module/components/post-slug/index.js.map +1 -1
  379. package/build-module/components/post-sticky/check.js +3 -3
  380. package/build-module/components/post-sticky/check.js.map +1 -1
  381. package/build-module/components/post-sticky/index.js +1 -1
  382. package/build-module/components/post-sticky/index.js.map +1 -1
  383. package/build-module/components/post-switch-to-draft-button/index.js +1 -1
  384. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  385. package/build-module/components/post-sync-status/index.js +1 -1
  386. package/build-module/components/post-sync-status/index.js.map +1 -1
  387. package/build-module/components/post-taxonomies/check.js +3 -3
  388. package/build-module/components/post-taxonomies/check.js.map +1 -1
  389. package/build-module/components/post-taxonomies/flat-term-selector.js +11 -9
  390. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  391. package/build-module/components/post-taxonomies/panel.js +17 -12
  392. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  393. package/build-module/components/post-template/classic-theme.js +2 -2
  394. package/build-module/components/post-template/classic-theme.js.map +1 -1
  395. package/build-module/components/post-template/panel.js +1 -1
  396. package/build-module/components/post-template/panel.js.map +1 -1
  397. package/build-module/components/post-template/swap-template-button.js +0 -3
  398. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  399. package/build-module/components/post-text-editor/index.js +1 -1
  400. package/build-module/components/post-text-editor/index.js.map +1 -1
  401. package/build-module/components/post-title/index.js +20 -18
  402. package/build-module/components/post-title/index.js.map +1 -1
  403. package/build-module/components/post-title/post-title-raw.js +1 -1
  404. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  405. package/build-module/components/post-transform-panel/index.js +0 -3
  406. package/build-module/components/post-transform-panel/index.js.map +1 -1
  407. package/build-module/components/post-trash/check.js +3 -3
  408. package/build-module/components/post-trash/check.js.map +1 -1
  409. package/build-module/components/post-trash/index.js +1 -1
  410. package/build-module/components/post-trash/index.js.map +1 -1
  411. package/build-module/components/post-type-support-check/index.js +6 -6
  412. package/build-module/components/post-type-support-check/index.js.map +1 -1
  413. package/build-module/components/post-url/check.js +3 -3
  414. package/build-module/components/post-url/check.js.map +1 -1
  415. package/build-module/components/post-url/index.js +1 -1
  416. package/build-module/components/post-url/index.js.map +1 -1
  417. package/build-module/components/post-url/label.js +1 -1
  418. package/build-module/components/post-url/label.js.map +1 -1
  419. package/build-module/components/post-url/panel.js +1 -1
  420. package/build-module/components/post-url/panel.js.map +1 -1
  421. package/build-module/components/post-visibility/check.js +1 -1
  422. package/build-module/components/post-visibility/check.js.map +1 -1
  423. package/build-module/components/post-visibility/index.js +1 -1
  424. package/build-module/components/post-visibility/index.js.map +1 -1
  425. package/build-module/components/preferences-modal/block-visibility.js +80 -0
  426. package/build-module/components/preferences-modal/block-visibility.js.map +1 -0
  427. package/build-module/components/preferences-modal/enable-panel.js +27 -19
  428. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  429. package/build-module/components/preferences-modal/enable-publish-sidebar.js +13 -10
  430. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  431. package/build-module/components/preferences-modal/index.js +28 -24
  432. package/build-module/components/preferences-modal/index.js.map +1 -1
  433. package/build-module/components/preview-dropdown/index.js +24 -5
  434. package/build-module/components/preview-dropdown/index.js.map +1 -1
  435. package/build-module/components/provider/index.js +14 -8
  436. package/build-module/components/provider/index.js.map +1 -1
  437. package/build-module/components/provider/use-block-editor-settings.js +11 -10
  438. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  439. package/build-module/components/sidebar/post-summary.js +2 -2
  440. package/build-module/components/sidebar/post-summary.js.map +1 -1
  441. package/build-module/components/start-page-options/index.js +0 -3
  442. package/build-module/components/start-page-options/index.js.map +1 -1
  443. package/build-module/components/start-template-options/index.js +0 -3
  444. package/build-module/components/start-template-options/index.js.map +1 -1
  445. package/build-module/components/table-of-contents/index.js +1 -1
  446. package/build-module/components/table-of-contents/index.js.map +1 -1
  447. package/build-module/components/theme-support-check/index.js +4 -4
  448. package/build-module/components/theme-support-check/index.js.map +1 -1
  449. package/build-module/components/time-to-read/index.js +1 -1
  450. package/build-module/components/time-to-read/index.js.map +1 -1
  451. package/build-module/components/unsaved-changes-warning/index.js +1 -1
  452. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  453. package/build-module/components/visual-editor/index.js +5 -2
  454. package/build-module/components/visual-editor/index.js.map +1 -1
  455. package/build-module/components/word-count/index.js +1 -1
  456. package/build-module/components/word-count/index.js.map +1 -1
  457. package/build-module/components/zoom-out-toggle/index.js +8 -3
  458. package/build-module/components/zoom-out-toggle/index.js.map +1 -1
  459. package/build-module/dataviews/api.js +39 -0
  460. package/build-module/dataviews/api.js.map +1 -1
  461. package/build-module/dataviews/store/private-actions.js +23 -3
  462. package/build-module/dataviews/store/private-actions.js.map +1 -1
  463. package/build-module/dataviews/store/private-selectors.js +4 -0
  464. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  465. package/build-module/dataviews/store/reducer.js +23 -0
  466. package/build-module/dataviews/store/reducer.js.map +1 -1
  467. package/build-module/private-apis.js +4 -0
  468. package/build-module/private-apis.js.map +1 -1
  469. package/build-module/store/actions.js +72 -23
  470. package/build-module/store/actions.js.map +1 -1
  471. package/build-module/store/constants.js +0 -2
  472. package/build-module/store/constants.js.map +1 -1
  473. package/build-module/store/index.js +0 -4
  474. package/build-module/store/index.js.map +1 -1
  475. package/build-module/store/private-selectors.js +6 -3
  476. package/build-module/store/private-selectors.js.map +1 -1
  477. package/build-module/store/reducer.native.js +2 -1
  478. package/build-module/store/reducer.native.js.map +1 -1
  479. package/build-module/store/selectors.js +35 -41
  480. package/build-module/store/selectors.js.map +1 -1
  481. package/build-module/utils/get-template-info.js +51 -0
  482. package/build-module/utils/get-template-info.js.map +1 -0
  483. package/build-style/style-rtl.css +33 -87
  484. package/build-style/style.css +33 -87
  485. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +2 -2
  486. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
  487. package/build-types/components/collab-sidebar/add-comment.d.ts +2 -2
  488. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
  489. package/build-types/components/collab-sidebar/comment-author-info.d.ts +17 -0
  490. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -0
  491. package/build-types/components/collab-sidebar/comment-form.d.ts +18 -0
  492. package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -0
  493. package/build-types/components/collab-sidebar/comments.d.ts +2 -2
  494. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  495. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  496. package/build-types/components/commands/index.d.ts.map +1 -1
  497. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
  498. package/build-types/components/document-bar/index.d.ts +2 -2
  499. package/build-types/components/document-bar/index.d.ts.map +1 -1
  500. package/build-types/components/document-outline/check.d.ts +5 -5
  501. package/build-types/components/document-outline/check.d.ts.map +1 -1
  502. package/build-types/components/document-outline/index.d.ts +4 -6
  503. package/build-types/components/document-outline/index.d.ts.map +1 -1
  504. package/build-types/components/document-tools/index.d.ts.map +1 -1
  505. package/build-types/components/editor-interface/content-slot-fill.d.ts +12 -1
  506. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -1
  507. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  508. package/build-types/components/editor-notices/index.d.ts +2 -2
  509. package/build-types/components/editor-notices/index.d.ts.map +1 -1
  510. package/build-types/components/editor-snackbars/index.d.ts +2 -2
  511. package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
  512. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
  513. package/build-types/components/entities-saved-states/index.d.ts +4 -4
  514. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  515. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  516. package/build-types/components/header/back-button.d.ts.map +1 -1
  517. package/build-types/components/header/index.d.ts +1 -2
  518. package/build-types/components/header/index.d.ts.map +1 -1
  519. package/build-types/components/more-menu/index.d.ts.map +1 -1
  520. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
  521. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  522. package/build-types/components/page-attributes/check.d.ts +5 -5
  523. package/build-types/components/page-attributes/check.d.ts.map +1 -1
  524. package/build-types/components/page-attributes/order.d.ts +2 -2
  525. package/build-types/components/page-attributes/order.d.ts.map +1 -1
  526. package/build-types/components/page-attributes/panel.d.ts +2 -2
  527. package/build-types/components/page-attributes/panel.d.ts.map +1 -1
  528. package/build-types/components/page-attributes/parent.d.ts +2 -2
  529. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  530. package/build-types/components/plugin-document-setting-panel/index.d.ts +4 -4
  531. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
  532. package/build-types/components/plugin-more-menu-item/index.d.ts +4 -2
  533. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
  534. package/build-types/components/plugin-post-publish-panel/index.d.ts +4 -4
  535. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
  536. package/build-types/components/plugin-post-status-info/index.d.ts +6 -6
  537. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
  538. package/build-types/components/plugin-pre-publish-panel/index.d.ts +4 -4
  539. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
  540. package/build-types/components/plugin-preview-menu-item/index.d.ts +4 -2
  541. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
  542. package/build-types/components/plugin-sidebar/index.d.ts +2 -0
  543. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  544. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +4 -2
  545. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
  546. package/build-types/components/post-author/check.d.ts +5 -5
  547. package/build-types/components/post-author/check.d.ts.map +1 -1
  548. package/build-types/components/post-author/index.d.ts +2 -2
  549. package/build-types/components/post-author/index.d.ts.map +1 -1
  550. package/build-types/components/post-author/panel.d.ts +2 -2
  551. package/build-types/components/post-author/panel.d.ts.map +1 -1
  552. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  553. package/build-types/components/post-discussion/panel.d.ts +2 -2
  554. package/build-types/components/post-discussion/panel.d.ts.map +1 -1
  555. package/build-types/components/post-excerpt/check.d.ts +5 -5
  556. package/build-types/components/post-excerpt/check.d.ts.map +1 -1
  557. package/build-types/components/post-excerpt/panel.d.ts +2 -2
  558. package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
  559. package/build-types/components/post-excerpt/plugin.d.ts +6 -6
  560. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
  561. package/build-types/components/post-featured-image/check.d.ts +5 -5
  562. package/build-types/components/post-featured-image/check.d.ts.map +1 -1
  563. package/build-types/components/post-featured-image/panel.d.ts +2 -2
  564. package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
  565. package/build-types/components/post-fields/index.d.ts +12 -0
  566. package/build-types/components/post-fields/index.d.ts.map +1 -0
  567. package/build-types/components/post-format/check.d.ts +11 -4
  568. package/build-types/components/post-format/check.d.ts.map +1 -1
  569. package/build-types/components/post-format/index.d.ts +2 -2
  570. package/build-types/components/post-format/index.d.ts.map +1 -1
  571. package/build-types/components/post-format/panel.d.ts +2 -2
  572. package/build-types/components/post-format/panel.d.ts.map +1 -1
  573. package/build-types/components/post-last-revision/check.d.ts +5 -5
  574. package/build-types/components/post-last-revision/check.d.ts.map +1 -1
  575. package/build-types/components/post-last-revision/index.d.ts +2 -2
  576. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  577. package/build-types/components/post-last-revision/panel.d.ts +2 -2
  578. package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
  579. package/build-types/components/post-locked-modal/index.d.ts +2 -2
  580. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  581. package/build-types/components/post-pending-status/check.d.ts +5 -5
  582. package/build-types/components/post-pending-status/check.d.ts.map +1 -1
  583. package/build-types/components/post-pending-status/index.d.ts +2 -2
  584. package/build-types/components/post-pending-status/index.d.ts.map +1 -1
  585. package/build-types/components/post-preview-button/index.d.ts +2 -2
  586. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  587. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  588. package/build-types/components/post-schedule/check.d.ts +5 -5
  589. package/build-types/components/post-schedule/check.d.ts.map +1 -1
  590. package/build-types/components/post-schedule/index.d.ts +2 -2
  591. package/build-types/components/post-schedule/index.d.ts.map +1 -1
  592. package/build-types/components/post-schedule/label.d.ts +2 -2
  593. package/build-types/components/post-schedule/label.d.ts.map +1 -1
  594. package/build-types/components/post-schedule/panel.d.ts +2 -2
  595. package/build-types/components/post-schedule/panel.d.ts.map +1 -1
  596. package/build-types/components/post-slug/check.d.ts +5 -5
  597. package/build-types/components/post-slug/check.d.ts.map +1 -1
  598. package/build-types/components/post-slug/index.d.ts +2 -2
  599. package/build-types/components/post-slug/index.d.ts.map +1 -1
  600. package/build-types/components/post-sticky/check.d.ts +5 -5
  601. package/build-types/components/post-sticky/check.d.ts.map +1 -1
  602. package/build-types/components/post-sticky/index.d.ts +2 -2
  603. package/build-types/components/post-sticky/index.d.ts.map +1 -1
  604. package/build-types/components/post-switch-to-draft-button/index.d.ts +2 -2
  605. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
  606. package/build-types/components/post-sync-status/index.d.ts +2 -2
  607. package/build-types/components/post-sync-status/index.d.ts.map +1 -1
  608. package/build-types/components/post-taxonomies/check.d.ts +5 -5
  609. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  610. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +2 -2
  611. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  612. package/build-types/components/post-taxonomies/panel.d.ts +6 -2
  613. package/build-types/components/post-taxonomies/panel.d.ts.map +1 -1
  614. package/build-types/components/post-template/hooks.d.ts +2 -2
  615. package/build-types/components/post-template/panel.d.ts +2 -2
  616. package/build-types/components/post-template/panel.d.ts.map +1 -1
  617. package/build-types/components/post-template/swap-template-button.d.ts.map +1 -1
  618. package/build-types/components/post-text-editor/index.d.ts +2 -2
  619. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  620. package/build-types/components/post-title/index.d.ts +1 -1
  621. package/build-types/components/post-transform-panel/index.d.ts.map +1 -1
  622. package/build-types/components/post-trash/check.d.ts +5 -5
  623. package/build-types/components/post-trash/check.d.ts.map +1 -1
  624. package/build-types/components/post-trash/index.d.ts +2 -2
  625. package/build-types/components/post-trash/index.d.ts.map +1 -1
  626. package/build-types/components/post-type-support-check/index.d.ts +8 -8
  627. package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
  628. package/build-types/components/post-url/check.d.ts +5 -5
  629. package/build-types/components/post-url/check.d.ts.map +1 -1
  630. package/build-types/components/post-url/index.d.ts +2 -2
  631. package/build-types/components/post-url/index.d.ts.map +1 -1
  632. package/build-types/components/post-url/label.d.ts +2 -2
  633. package/build-types/components/post-url/label.d.ts.map +1 -1
  634. package/build-types/components/post-url/panel.d.ts +2 -2
  635. package/build-types/components/post-url/panel.d.ts.map +1 -1
  636. package/build-types/components/post-visibility/check.d.ts +2 -2
  637. package/build-types/components/post-visibility/check.d.ts.map +1 -1
  638. package/build-types/components/post-visibility/index.d.ts +2 -2
  639. package/build-types/components/post-visibility/index.d.ts.map +1 -1
  640. package/build-types/components/preferences-modal/block-visibility.d.ts +2 -0
  641. package/build-types/components/preferences-modal/block-visibility.d.ts.map +1 -0
  642. package/build-types/components/preferences-modal/enable-panel.d.ts +1 -2
  643. package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -1
  644. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
  645. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +1 -2
  646. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -1
  647. package/build-types/components/preferences-modal/index.d.ts.map +1 -1
  648. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  649. package/build-types/components/provider/index.d.ts +2 -2
  650. package/build-types/components/provider/index.d.ts.map +1 -1
  651. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  652. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  653. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  654. package/build-types/components/start-template-options/index.d.ts.map +1 -1
  655. package/build-types/components/theme-support-check/index.d.ts +6 -6
  656. package/build-types/components/theme-support-check/index.d.ts.map +1 -1
  657. package/build-types/components/time-to-read/index.d.ts +2 -2
  658. package/build-types/components/time-to-read/index.d.ts.map +1 -1
  659. package/build-types/components/unsaved-changes-warning/index.d.ts +2 -2
  660. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
  661. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  662. package/build-types/components/word-count/index.d.ts +2 -2
  663. package/build-types/components/word-count/index.d.ts.map +1 -1
  664. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
  665. package/build-types/dataviews/api.d.ts +24 -0
  666. package/build-types/dataviews/api.d.ts.map +1 -1
  667. package/build-types/dataviews/store/private-actions.d.ts +14 -2
  668. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  669. package/build-types/dataviews/store/private-selectors.d.ts +1 -0
  670. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  671. package/build-types/dataviews/store/reducer.d.ts +15 -4
  672. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  673. package/build-types/lock-unlock.d.ts +2 -2
  674. package/build-types/private-apis.d.ts.map +1 -1
  675. package/build-types/store/actions.d.ts +16 -6
  676. package/build-types/store/actions.d.ts.map +1 -1
  677. package/build-types/store/constants.d.ts +0 -2
  678. package/build-types/store/constants.d.ts.map +1 -1
  679. package/build-types/store/index.d.ts +9 -11
  680. package/build-types/store/index.d.ts.map +1 -1
  681. package/build-types/store/private-selectors.d.ts +1 -0
  682. package/build-types/store/private-selectors.d.ts.map +1 -1
  683. package/build-types/store/reducer.d.ts +29 -4
  684. package/build-types/store/reducer.d.ts.map +1 -1
  685. package/build-types/store/selectors.d.ts +7 -14
  686. package/build-types/store/selectors.d.ts.map +1 -1
  687. package/build-types/utils/get-template-info.d.ts +6 -0
  688. package/build-types/utils/get-template-info.d.ts.map +1 -0
  689. package/package.json +36 -35
  690. package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  691. package/src/components/collab-sidebar/add-comment.js +17 -77
  692. package/src/components/collab-sidebar/comment-author-info.js +68 -0
  693. package/src/components/collab-sidebar/comment-button-toolbar.js +3 -3
  694. package/src/components/collab-sidebar/comment-button.js +3 -3
  695. package/src/components/collab-sidebar/comment-form.js +62 -0
  696. package/src/components/collab-sidebar/comments.js +39 -101
  697. package/src/components/collab-sidebar/index.js +79 -88
  698. package/src/components/commands/index.js +390 -270
  699. package/src/components/create-template-part-modal/index.js +4 -2
  700. package/src/components/document-bar/index.js +22 -4
  701. package/src/components/document-bar/style.scss +13 -0
  702. package/src/components/document-outline/check.js +4 -4
  703. package/src/components/document-outline/index.js +9 -9
  704. package/src/components/document-tools/index.js +8 -1
  705. package/src/components/editor-history/redo.js +1 -1
  706. package/src/components/editor-history/undo.js +1 -1
  707. package/src/components/editor-interface/content-slot-fill.js +4 -9
  708. package/src/components/editor-interface/index.js +1 -12
  709. package/src/components/editor-notices/index.js +1 -1
  710. package/src/components/editor-snackbars/index.js +1 -1
  711. package/src/components/entities-saved-states/entity-record-item.js +12 -4
  712. package/src/components/entities-saved-states/index.js +2 -2
  713. package/src/components/global-styles-provider/index.js +20 -8
  714. package/src/components/header/index.js +18 -10
  715. package/src/components/header/style.scss +2 -1
  716. package/src/components/more-menu/index.js +12 -7
  717. package/src/components/page-attributes/check.js +3 -3
  718. package/src/components/page-attributes/order.js +1 -1
  719. package/src/components/page-attributes/panel.js +1 -1
  720. package/src/components/page-attributes/parent.js +1 -1
  721. package/src/components/plugin-document-setting-panel/index.js +2 -2
  722. package/src/components/plugin-more-menu-item/index.js +2 -1
  723. package/src/components/plugin-post-publish-panel/index.js +2 -2
  724. package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +1 -1
  725. package/src/components/plugin-post-status-info/index.js +4 -4
  726. package/src/components/plugin-pre-publish-panel/index.js +2 -2
  727. package/src/components/plugin-preview-menu-item/index.js +2 -1
  728. package/src/components/plugin-sidebar/index.js +1 -0
  729. package/src/components/plugin-sidebar-more-menu-item/index.js +2 -2
  730. package/src/components/post-actions/actions.js +3 -3
  731. package/src/components/post-author/check.js +3 -3
  732. package/src/components/post-author/index.js +1 -1
  733. package/src/components/post-author/panel.js +1 -1
  734. package/src/components/post-card-panel/index.js +18 -5
  735. package/src/components/post-comments/index.js +1 -1
  736. package/src/components/post-discussion/panel.js +1 -1
  737. package/src/components/post-excerpt/check.js +3 -3
  738. package/src/components/post-excerpt/panel.js +1 -1
  739. package/src/components/post-excerpt/plugin.js +4 -4
  740. package/src/components/post-featured-image/check.js +3 -3
  741. package/src/components/post-featured-image/index.js +107 -43
  742. package/src/components/post-featured-image/panel.js +1 -1
  743. package/src/components/post-featured-image/style.scss +23 -13
  744. package/src/components/post-fields/index.ts +76 -0
  745. package/src/components/post-format/check.js +9 -11
  746. package/src/components/post-format/index.js +1 -1
  747. package/src/components/post-format/panel.js +1 -1
  748. package/src/components/post-last-revision/check.js +3 -3
  749. package/src/components/post-last-revision/index.js +1 -1
  750. package/src/components/post-last-revision/panel.js +1 -1
  751. package/src/components/post-locked-modal/index.js +1 -1
  752. package/src/components/post-pending-status/check.js +3 -3
  753. package/src/components/post-pending-status/index.js +1 -1
  754. package/src/components/post-preview-button/index.js +1 -1
  755. package/src/components/post-publish-panel/index.js +7 -3
  756. package/src/components/post-schedule/check.js +3 -3
  757. package/src/components/post-schedule/index.js +1 -1
  758. package/src/components/post-schedule/label.js +1 -1
  759. package/src/components/post-schedule/panel.js +1 -1
  760. package/src/components/post-slug/check.js +3 -3
  761. package/src/components/post-slug/index.js +1 -1
  762. package/src/components/post-sticky/check.js +3 -3
  763. package/src/components/post-sticky/index.js +1 -1
  764. package/src/components/post-switch-to-draft-button/index.js +1 -1
  765. package/src/components/post-sync-status/index.js +1 -1
  766. package/src/components/post-taxonomies/check.js +3 -3
  767. package/src/components/post-taxonomies/flat-term-selector.js +9 -9
  768. package/src/components/post-taxonomies/panel.js +15 -12
  769. package/src/components/post-template/classic-theme.js +2 -2
  770. package/src/components/post-template/panel.js +1 -1
  771. package/src/components/post-template/swap-template-button.js +0 -3
  772. package/src/components/post-text-editor/index.js +1 -1
  773. package/src/components/post-title/index.js +20 -18
  774. package/src/components/post-title/post-title-raw.js +1 -1
  775. package/src/components/post-transform-panel/index.js +0 -3
  776. package/src/components/post-trash/check.js +3 -3
  777. package/src/components/post-trash/index.js +1 -1
  778. package/src/components/post-type-support-check/index.js +6 -6
  779. package/src/components/post-url/check.js +3 -3
  780. package/src/components/post-url/index.js +1 -1
  781. package/src/components/post-url/label.js +1 -1
  782. package/src/components/post-url/panel.js +1 -1
  783. package/src/components/post-visibility/check.js +1 -1
  784. package/src/components/post-visibility/index.js +1 -1
  785. package/src/components/preferences-modal/block-visibility.js +96 -0
  786. package/src/components/preferences-modal/enable-panel.js +27 -17
  787. package/src/components/preferences-modal/enable-publish-sidebar.js +18 -15
  788. package/src/components/preferences-modal/index.js +28 -21
  789. package/src/components/preferences-modal/test/index.js +1 -1
  790. package/src/components/preview-dropdown/index.js +45 -16
  791. package/src/components/provider/index.js +55 -30
  792. package/src/components/provider/use-block-editor-settings.js +10 -9
  793. package/src/components/sidebar/post-summary.js +1 -1
  794. package/src/components/sidebar/style.scss +1 -3
  795. package/src/components/start-page-options/index.js +0 -3
  796. package/src/components/start-template-options/index.js +0 -3
  797. package/src/components/table-of-contents/index.js +1 -1
  798. package/src/components/theme-support-check/index.js +4 -4
  799. package/src/components/time-to-read/index.js +1 -1
  800. package/src/components/unsaved-changes-warning/index.js +1 -1
  801. package/src/components/visual-editor/index.js +7 -1
  802. package/src/components/visual-editor/style.scss +11 -0
  803. package/src/components/word-count/index.js +1 -1
  804. package/src/components/zoom-out-toggle/index.js +26 -13
  805. package/src/dataviews/api.js +41 -0
  806. package/src/dataviews/store/private-actions.ts +57 -3
  807. package/src/dataviews/store/private-selectors.ts +4 -0
  808. package/src/dataviews/store/reducer.ts +38 -1
  809. package/src/private-apis.js +4 -1
  810. package/src/store/actions.js +123 -42
  811. package/src/store/constants.ts +0 -2
  812. package/src/store/index.js +0 -4
  813. package/src/store/private-selectors.js +13 -8
  814. package/src/store/reducer.native.js +2 -0
  815. package/src/store/selectors.js +82 -64
  816. package/src/store/test/selectors.js +0 -255
  817. package/src/style.scss +0 -1
  818. package/src/utils/get-template-info.js +52 -0
  819. package/src/utils/test/get-template-info.js +224 -0
  820. package/tsconfig.tsbuildinfo +1 -1
  821. package/build/components/block-manager/category.js +0 -107
  822. package/build/components/block-manager/category.js.map +0 -1
  823. package/build/components/block-manager/checklist.js +0 -35
  824. package/build/components/block-manager/checklist.js.map +0 -1
  825. package/build/components/block-manager/index.js +0 -115
  826. package/build/components/block-manager/index.js.map +0 -1
  827. package/build-module/components/block-manager/category.js +0 -99
  828. package/build-module/components/block-manager/category.js.map +0 -1
  829. package/build-module/components/block-manager/checklist.js +0 -28
  830. package/build-module/components/block-manager/checklist.js.map +0 -1
  831. package/build-module/components/block-manager/index.js +0 -107
  832. package/build-module/components/block-manager/index.js.map +0 -1
  833. package/build-types/components/block-manager/category.d.ts +0 -6
  834. package/build-types/components/block-manager/category.d.ts.map +0 -1
  835. package/build-types/components/block-manager/checklist.d.ts +0 -7
  836. package/build-types/components/block-manager/checklist.d.ts.map +0 -1
  837. package/build-types/components/block-manager/index.d.ts +0 -2
  838. package/build-types/components/block-manager/index.d.ts.map +0 -1
  839. package/src/components/block-manager/category.js +0 -96
  840. package/src/components/block-manager/checklist.js +0 -30
  841. package/src/components/block-manager/index.js +0 -145
  842. package/src/components/block-manager/style.scss +0 -82
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useState","RawHTML","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalConfirmDialog","ConfirmDialog","Button","DropdownMenu","TextareaControl","Tooltip","dateI18n","format","getSettings","getDateSettings","Icon","check","published","moreVertical","__","_x","useSelect","useEntityProp","store","blockEditorStore","sanitizeCommentString","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Comments","threads","onEditComment","onAddReply","onCommentDelete","onCommentResolve","actionState","setActionState","isConfirmDialogOpen","setIsConfirmDialogOpen","handleConfirmDelete","id","handleConfirmResolve","handleCancelDelete","blockCommentId","select","_select$getBlock$attr","clientID","getSelectedBlockClientId","getBlock","attributes","CommentBoard","thread","parentThread","_parentThread$status","children","CommentHeader","onResolve","_parentThread$id","action","onEdit","onDelete","onReply","undefined","status","alignment","spacing","justify","className","CommentForm","onSubmit","value","onCancel","content","raw","isOpen","onConfirm","confirmButtonText","cancelButtonText","Array","isArray","length","map","inputComment","reply","_thread$content$raw","setInputComment","__nextHasNoMarginBottom","onChange","__next40pxDefaultSize","accessibleWhenDisabled","variant","onClick","disabled","dateSettings","dateTimeFormat","formats","time","actions","title","moreActions","filter","item","src","author_avatar_urls","alt","width","height","author_name","dateTime","date","parent","label","icon","showTooltip","controls","text"],"sources":["@wordpress/editor/src/components/collab-sidebar/comments.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, RawHTML } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tButton,\n\tDropdownMenu,\n\tTextareaControl,\n\tTooltip,\n} from '@wordpress/components';\nimport {\n\tdateI18n,\n\tformat,\n\tgetSettings as getDateSettings,\n} from '@wordpress/date';\nimport { Icon, check, published, moreVertical } from '@wordpress/icons';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeCommentString } from './utils';\n\n/**\n * Renders the Comments component.\n *\n * @param {Object} props - The component props.\n * @param {Array} props.threads - The array of comment threads.\n * @param {Function} props.onEditComment - The function to handle comment editing.\n * @param {Function} props.onAddReply - The function to add a reply to a comment.\n * @param {Function} props.onCommentDelete - The function to delete a comment.\n * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.\n * @return {JSX.Element} The rendered Comments component.\n */\nexport function Comments( {\n\tthreads,\n\tonEditComment,\n\tonAddReply,\n\tonCommentDelete,\n\tonCommentResolve,\n} ) {\n\tconst [ actionState, setActionState ] = useState( false );\n\tconst [ isConfirmDialogOpen, setIsConfirmDialogOpen ] = useState( false );\n\n\tconst handleConfirmDelete = () => {\n\t\tonCommentDelete( actionState.id );\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst handleConfirmResolve = () => {\n\t\tonCommentResolve( actionState.id );\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst handleCancelDelete = () => {\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst blockCommentId = useSelect( ( select ) => {\n\t\tconst clientID = select( blockEditorStore ).getSelectedBlockClientId();\n\t\treturn (\n\t\t\tselect( blockEditorStore ).getBlock( clientID )?.attributes\n\t\t\t\t?.blockCommentId ?? false\n\t\t);\n\t}, [] );\n\n\tconst CommentBoard = ( { thread, parentThread } ) => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<CommentHeader\n\t\t\t\t\tthread={ thread }\n\t\t\t\t\tonResolve={ () => {\n\t\t\t\t\t\tsetActionState( {\n\t\t\t\t\t\t\taction: 'resolve',\n\t\t\t\t\t\t\tid: parentThread?.id ?? thread.id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tsetIsConfirmDialogOpen( true );\n\t\t\t\t\t} }\n\t\t\t\t\tonEdit={ () =>\n\t\t\t\t\t\tsetActionState( { action: 'edit', id: thread.id } )\n\t\t\t\t\t}\n\t\t\t\t\tonDelete={ () => {\n\t\t\t\t\t\tsetActionState( { action: 'delete', id: thread.id } );\n\t\t\t\t\t\tsetIsConfirmDialogOpen( true );\n\t\t\t\t\t} }\n\t\t\t\t\tonReply={\n\t\t\t\t\t\t! parentThread\n\t\t\t\t\t\t\t? () =>\n\t\t\t\t\t\t\t\t\tsetActionState( {\n\t\t\t\t\t\t\t\t\t\taction: 'reply',\n\t\t\t\t\t\t\t\t\t\tid: thread.id,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tstatus={ parentThread?.status ?? thread.status }\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"left\"\n\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-comment\"\n\t\t\t\t>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ 'edit' === actionState?.action &&\n\t\t\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\t\t\tonSubmit={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\tonEditComment( thread.id, value );\n\t\t\t\t\t\t\t\t\t\tsetActionState( false );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonCancel={ () => setActionState( false ) }\n\t\t\t\t\t\t\t\t\tthread={ thread }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ( ! actionState ||\n\t\t\t\t\t\t\t'edit' !== actionState?.action ) && (\n\t\t\t\t\t\t\t<RawHTML>{ thread?.content?.raw }</RawHTML>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</HStack>\n\t\t\t\t{ 'resolve' === actionState?.action &&\n\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t<ConfirmDialog\n\t\t\t\t\t\t\tisOpen={ isConfirmDialogOpen }\n\t\t\t\t\t\t\tonConfirm={ handleConfirmResolve }\n\t\t\t\t\t\t\tonCancel={ handleCancelDelete }\n\t\t\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Are you sure you want to mark this comment as resolved?'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</ConfirmDialog>\n\t\t\t\t\t) }\n\t\t\t\t{ 'delete' === actionState?.action &&\n\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t<ConfirmDialog\n\t\t\t\t\t\t\tisOpen={ isConfirmDialogOpen }\n\t\t\t\t\t\t\tonConfirm={ handleConfirmDelete }\n\t\t\t\t\t\t\tonCancel={ handleCancelDelete }\n\t\t\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Are you sure you want to delete this comment?'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</ConfirmDialog>\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{\n\t\t\t\t// If there are no comments, show a message indicating no comments are available.\n\t\t\t\t( ! Array.isArray( threads ) || threads.length === 0 ) && (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__thread\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// translators: message displayed when there are no comments available\n\t\t\t\t\t\t\t__( 'No comments available' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VStack>\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t{ Array.isArray( threads ) &&\n\t\t\t\tthreads.length > 0 &&\n\t\t\t\tthreads.map( ( thread ) => (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tkey={ thread.id }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'editor-collab-sidebar-panel__thread',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'editor-collab-sidebar-panel__active-thread':\n\t\t\t\t\t\t\t\t\tblockCommentId &&\n\t\t\t\t\t\t\t\t\tblockCommentId === thread.id,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tid={ thread.id }\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CommentBoard thread={ thread } />\n\t\t\t\t\t\t{ 'reply' === actionState?.action &&\n\t\t\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-comment\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\t\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\t\t\t\t\t\t\t\tonAddReply(\n\t\t\t\t\t\t\t\t\t\t\t\t\tinputComment,\n\t\t\t\t\t\t\t\t\t\t\t\t\tthread.id\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\tsetActionState( false );\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tonCancel={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetActionState( false )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ 0 < thread?.reply?.length &&\n\t\t\t\t\t\t\tthread.reply.map( ( reply ) => (\n\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\tkey={ reply.id }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\t\t\t\t\tid={ reply.id }\n\t\t\t\t\t\t\t\t\tspacing=\"2\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CommentBoard\n\t\t\t\t\t\t\t\t\t\tthread={ reply }\n\t\t\t\t\t\t\t\t\t\tparentThread={ thread }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</VStack>\n\t\t\t\t) ) }\n\t\t</>\n\t);\n}\n\n/**\n * EditComment component.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - The function to call when updating the comment.\n * @param {Function} props.onCancel - The function to call when canceling the comment update.\n * @param {Object} props.thread - The comment thread object.\n * @return {JSX.Element} The CommentForm component.\n */\nfunction CommentForm( { onSubmit, onCancel, thread } ) {\n\tconst [ inputComment, setInputComment ] = useState(\n\t\tthread?.content?.raw ?? ''\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TextareaControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ inputComment ?? '' }\n\t\t\t\tonChange={ setInputComment }\n\t\t\t/>\n\t\t\t<VStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ () => onSubmit( inputComment ) }\n\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t0 === sanitizeCommentString( inputComment ).length\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ thread\n\t\t\t\t\t\t\t? _x( 'Update', 'verb' )\n\t\t\t\t\t\t\t: _x( 'Reply', 'Add reply comment' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button __next40pxDefaultSize onClick={ onCancel }>\n\t\t\t\t\t\t{ _x( 'Cancel', 'Cancel comment edit' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\n/**\n * Renders the header of a comment in the collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Object} props.thread - The comment thread object.\n * @param {Function} props.onResolve - The function to resolve the comment.\n * @param {Function} props.onEdit - The function to edit the comment.\n * @param {Function} props.onDelete - The function to delete the comment.\n * @param {Function} props.onReply - The function to reply to the comment.\n * @param {string} props.status - The status of the comment.\n * @return {JSX.Element} The rendered comment header.\n */\nfunction CommentHeader( {\n\tthread,\n\tonResolve,\n\tonEdit,\n\tonDelete,\n\tonReply,\n\tstatus,\n} ) {\n\tconst dateSettings = getDateSettings();\n\tconst [ dateTimeFormat = dateSettings.formats.time ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'time_format'\n\t);\n\n\tconst actions = [\n\t\t{\n\t\t\ttitle: _x( 'Edit', 'Edit comment' ),\n\t\t\tonClick: onEdit,\n\t\t},\n\t\t{\n\t\t\ttitle: _x( 'Delete', 'Delete comment' ),\n\t\t\tonClick: onDelete,\n\t\t},\n\t\t{\n\t\t\ttitle: _x( 'Reply', 'Reply on a comment' ),\n\t\t\tonClick: onReply,\n\t\t},\n\t];\n\n\tconst moreActions = actions.filter( ( item ) => item.onClick );\n\n\treturn (\n\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t<img\n\t\t\t\tsrc={ thread?.author_avatar_urls?.[ 48 ] }\n\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-avatar\"\n\t\t\t\t// translators: alt text for user avatar image\n\t\t\t\talt={ __( 'User avatar' ) }\n\t\t\t\twidth={ 32 }\n\t\t\t\theight={ 32 }\n\t\t\t/>\n\t\t\t<VStack spacing=\"0\">\n\t\t\t\t<span className=\"editor-collab-sidebar-panel__user-name\">\n\t\t\t\t\t{ thread.author_name }\n\t\t\t\t</span>\n\t\t\t\t<time\n\t\t\t\t\tdateTime={ format( 'h:i A', thread.date ) }\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-time\"\n\t\t\t\t>\n\t\t\t\t\t{ dateI18n( dateTimeFormat, thread.date ) }\n\t\t\t\t</time>\n\t\t\t</VStack>\n\t\t\t<span className=\"editor-collab-sidebar-panel__comment-status\">\n\t\t\t\t{ status !== 'approved' && (\n\t\t\t\t\t<HStack alignment=\"right\" justify=\"flex-end\" spacing=\"0\">\n\t\t\t\t\t\t{ 0 === thread.parent && onResolve && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Resolve',\n\t\t\t\t\t\t\t\t\t'Mark comment as resolved'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\ticon={ published }\n\t\t\t\t\t\t\t\tonClick={ onResolve }\n\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t'Select an action',\n\t\t\t\t\t\t\t\t'Select comment action'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-dropdown-menu\"\n\t\t\t\t\t\t\tcontrols={ moreActions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t) }\n\t\t\t\t{ status === 'approved' && (\n\t\t\t\t\t// translators: tooltip for resolved comment\n\t\t\t\t\t<Tooltip text={ __( 'Resolved' ) }>\n\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</HStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,2BAA2B,IAAIC,aAAa,EAC5CC,MAAM,EACNC,YAAY,EACZC,eAAe,EACfC,OAAO,QACD,uBAAuB;AAC9B,SACCC,QAAQ,EACRC,MAAM,EACNC,WAAW,IAAIC,eAAe,QACxB,iBAAiB;AACxB,SAASC,IAAI,EAAEC,KAAK,EAAEC,SAAS,EAAEC,YAAY,QAAQ,kBAAkB;AACvE,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,aAAa,QAAQ,sBA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AAC,KAAKH,MAAM,CAAC2D,MAAM,IAAItD,SAAS,iBACjChC,IAAA,CAACpB,MAAM;UACN2G,KAAK,EAAG9F,EAAE,CACT,SAAS,EACT,0BACD,CAAG;UACHuE,qBAAqB;UACrBwB,IAAI,EAAGlG,SAAW;UAClB6E,OAAO,EAAGnC,SAAW;UACrByD,WAAW;QAAA,CACX,CACD,eACDzF,IAAA,CAACnB,YAAY;UACZ2G,IAAI,EAAGjG,YAAc;UACrBgG,KAAK,EAAG9F,EAAE,CACT,kBAAkB,EAClB,uBACD,CAAG;UACHkD,SAAS,EAAC,oDAAoD;UAC9D+C,QAAQ,EAAGf;QAAa,CACxB,CAAC;MAAA,CACK,CACR,EACCpC,MAAM,KAAK,UAAU;MAAA;MACtB;MACAvC,IAAA,CAACjB,OAAO;QAAC4G,IAAI,EAAGnG,EAAE,CAAE,UAAW,CAAG;QAAAsC,QAAA,eACjC9B,IAAA,CAACZ,IAAI;UAACoG,IAAI,EAAGnG;QAAO,CAAE;MAAC,CACf,CACT;IAAA,CACI,CAAC;EAAA,CACA,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useState","RawHTML","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalConfirmDialog","ConfirmDialog","Button","DropdownMenu","Tooltip","Icon","check","published","moreVertical","__","_x","useSelect","store","blockEditorStore","CommentAuthorInfo","CommentForm","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Comments","threads","onEditComment","onAddReply","onCommentDelete","onCommentResolve","actionState","setActionState","isConfirmDialogOpen","setIsConfirmDialogOpen","handleConfirmDelete","id","handleConfirmResolve","handleCancelDelete","blockCommentId","select","_select$getBlock$attr","clientID","getSelectedBlockClientId","getBlock","attributes","CommentBoard","thread","parentThread","_parentThread$status","children","CommentHeader","onResolve","_parentThread$id","action","onEdit","onDelete","onReply","undefined","status","alignment","spacing","justify","className","onSubmit","value","onCancel","submitButtonText","content","raw","isOpen","onConfirm","confirmButtonText","cancelButtonText","Array","isArray","length","map","reply","inputComment","actions","title","onClick","moreActions","filter","item","avatar","author_avatar_urls","name","author_name","date","parent","label","__next40pxDefaultSize","icon","showTooltip","controls","text"],"sources":["@wordpress/editor/src/components/collab-sidebar/comments.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, RawHTML } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tButton,\n\tDropdownMenu,\n\tTooltip,\n} from '@wordpress/components';\nimport { Icon, check, published, moreVertical } from '@wordpress/icons';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentAuthorInfo from './comment-author-info';\nimport CommentForm from './comment-form';\n\n/**\n * Renders the Comments component.\n *\n * @param {Object} props - The component props.\n * @param {Array} props.threads - The array of comment threads.\n * @param {Function} props.onEditComment - The function to handle comment editing.\n * @param {Function} props.onAddReply - The function to add a reply to a comment.\n * @param {Function} props.onCommentDelete - The function to delete a comment.\n * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.\n * @return {React.ReactNode} The rendered Comments component.\n */\nexport function Comments( {\n\tthreads,\n\tonEditComment,\n\tonAddReply,\n\tonCommentDelete,\n\tonCommentResolve,\n} ) {\n\tconst [ actionState, setActionState ] = useState( false );\n\tconst [ isConfirmDialogOpen, setIsConfirmDialogOpen ] = useState( false );\n\n\tconst handleConfirmDelete = () => {\n\t\tonCommentDelete( actionState.id );\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst handleConfirmResolve = () => {\n\t\tonCommentResolve( actionState.id );\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst handleCancelDelete = () => {\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst blockCommentId = useSelect( ( select ) => {\n\t\tconst clientID = select( blockEditorStore ).getSelectedBlockClientId();\n\t\treturn (\n\t\t\tselect( blockEditorStore ).getBlock( clientID )?.attributes\n\t\t\t\t?.blockCommentId ?? false\n\t\t);\n\t}, [] );\n\n\tconst CommentBoard = ( { thread, parentThread } ) => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<CommentHeader\n\t\t\t\t\tthread={ thread }\n\t\t\t\t\tonResolve={ () => {\n\t\t\t\t\t\tsetActionState( {\n\t\t\t\t\t\t\taction: 'resolve',\n\t\t\t\t\t\t\tid: parentThread?.id ?? thread.id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tsetIsConfirmDialogOpen( true );\n\t\t\t\t\t} }\n\t\t\t\t\tonEdit={ () =>\n\t\t\t\t\t\tsetActionState( { action: 'edit', id: thread.id } )\n\t\t\t\t\t}\n\t\t\t\t\tonDelete={ () => {\n\t\t\t\t\t\tsetActionState( { action: 'delete', id: thread.id } );\n\t\t\t\t\t\tsetIsConfirmDialogOpen( true );\n\t\t\t\t\t} }\n\t\t\t\t\tonReply={\n\t\t\t\t\t\t! parentThread\n\t\t\t\t\t\t\t? () =>\n\t\t\t\t\t\t\t\t\tsetActionState( {\n\t\t\t\t\t\t\t\t\t\taction: 'reply',\n\t\t\t\t\t\t\t\t\t\tid: thread.id,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tstatus={ parentThread?.status ?? thread.status }\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"left\"\n\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-comment\"\n\t\t\t\t>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ 'edit' === actionState?.action &&\n\t\t\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\t\t\tonSubmit={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\tonEditComment( thread.id, value );\n\t\t\t\t\t\t\t\t\t\tsetActionState( false );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonCancel={ () => setActionState( false ) }\n\t\t\t\t\t\t\t\t\tthread={ thread }\n\t\t\t\t\t\t\t\t\tsubmitButtonText={ _x( 'Update', 'verb' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ( ! actionState ||\n\t\t\t\t\t\t\t'edit' !== actionState?.action ) && (\n\t\t\t\t\t\t\t<RawHTML>{ thread?.content?.raw }</RawHTML>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</HStack>\n\t\t\t\t{ 'resolve' === actionState?.action &&\n\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t<ConfirmDialog\n\t\t\t\t\t\t\tisOpen={ isConfirmDialogOpen }\n\t\t\t\t\t\t\tonConfirm={ handleConfirmResolve }\n\t\t\t\t\t\t\tonCancel={ handleCancelDelete }\n\t\t\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Are you sure you want to mark this comment as resolved?'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</ConfirmDialog>\n\t\t\t\t\t) }\n\t\t\t\t{ 'delete' === actionState?.action &&\n\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t<ConfirmDialog\n\t\t\t\t\t\t\tisOpen={ isConfirmDialogOpen }\n\t\t\t\t\t\t\tonConfirm={ handleConfirmDelete }\n\t\t\t\t\t\t\tonCancel={ handleCancelDelete }\n\t\t\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Are you sure you want to delete this comment?'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</ConfirmDialog>\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{\n\t\t\t\t// If there are no comments, show a message indicating no comments are available.\n\t\t\t\t( ! Array.isArray( threads ) || threads.length === 0 ) && (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__thread\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// translators: message displayed when there are no comments available\n\t\t\t\t\t\t\t__( 'No comments available' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VStack>\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t{ Array.isArray( threads ) &&\n\t\t\t\tthreads.length > 0 &&\n\t\t\t\tthreads.map( ( thread ) => (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tkey={ thread.id }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'editor-collab-sidebar-panel__thread',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'editor-collab-sidebar-panel__active-thread':\n\t\t\t\t\t\t\t\t\tblockCommentId &&\n\t\t\t\t\t\t\t\t\tblockCommentId === thread.id,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tid={ thread.id }\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CommentBoard thread={ thread } />\n\t\t\t\t\t\t{ 0 < thread?.reply?.length &&\n\t\t\t\t\t\t\tthread.reply.map( ( reply ) => (\n\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\tkey={ reply.id }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\t\t\t\t\tid={ reply.id }\n\t\t\t\t\t\t\t\t\tspacing=\"2\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CommentBoard\n\t\t\t\t\t\t\t\t\t\tthread={ reply }\n\t\t\t\t\t\t\t\t\t\tparentThread={ thread }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t{ 'reply' === actionState?.action &&\n\t\t\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\t\t\t\t\tspacing=\"2\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<CommentAuthorInfo />\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\t\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\t\t\t\t\t\t\t\tonAddReply(\n\t\t\t\t\t\t\t\t\t\t\t\t\tinputComment,\n\t\t\t\t\t\t\t\t\t\t\t\t\tthread.id\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\tsetActionState( false );\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tonCancel={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetActionState( false )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsubmitButtonText={ _x(\n\t\t\t\t\t\t\t\t\t\t\t\t'Reply',\n\t\t\t\t\t\t\t\t\t\t\t\t'Add reply comment'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t) ) }\n\t\t</>\n\t);\n}\n\n/**\n * Renders the header of a comment in the collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Object} props.thread - The comment thread object.\n * @param {Function} props.onResolve - The function to resolve the comment.\n * @param {Function} props.onEdit - The function to edit the comment.\n * @param {Function} props.onDelete - The function to delete the comment.\n * @param {Function} props.onReply - The function to reply to the comment.\n * @param {string} props.status - The status of the comment.\n * @return {React.ReactNode} The rendered comment header.\n */\nfunction CommentHeader( {\n\tthread,\n\tonResolve,\n\tonEdit,\n\tonDelete,\n\tonReply,\n\tstatus,\n} ) {\n\tconst actions = [\n\t\t{\n\t\t\ttitle: _x( 'Edit', 'Edit comment' ),\n\t\t\tonClick: onEdit,\n\t\t},\n\t\t{\n\t\t\ttitle: _x( 'Delete', 'Delete comment' ),\n\t\t\tonClick: onDelete,\n\t\t},\n\t\t{\n\t\t\ttitle: _x( 'Reply', 'Reply on a comment' ),\n\t\t\tonClick: onReply,\n\t\t},\n\t];\n\n\tconst moreActions = actions.filter( ( item ) => item.onClick );\n\n\treturn (\n\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t<CommentAuthorInfo\n\t\t\t\tavatar={ thread?.author_avatar_urls?.[ 48 ] }\n\t\t\t\tname={ thread?.author_name }\n\t\t\t\tdate={ thread?.date }\n\t\t\t/>\n\t\t\t<span className=\"editor-collab-sidebar-panel__comment-status\">\n\t\t\t\t{ status !== 'approved' && (\n\t\t\t\t\t<HStack alignment=\"right\" justify=\"flex-end\" spacing=\"0\">\n\t\t\t\t\t\t{ 0 === thread?.parent && onResolve && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Resolve',\n\t\t\t\t\t\t\t\t\t'Mark comment as resolved'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\ticon={ published }\n\t\t\t\t\t\t\t\tonClick={ onResolve }\n\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t'Select an action',\n\t\t\t\t\t\t\t\t'Select comment action'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-dropdown-menu\"\n\t\t\t\t\t\t\tcontrols={ moreActions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t) }\n\t\t\t\t{ status === 'approved' && (\n\t\t\t\t\t// translators: tooltip for resolved comment\n\t\t\t\t\t<Tooltip text={ __( 'Resolved' ) }>\n\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</HStack>\n\t);\n}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EAAC,UAAU;QAACD,OAAO,EAAC,GAAG;QAAAX,QAAA,GACrD,CAAC,KAAKH,MAAM,EAAE4C,MAAM,IAAIvC,SAAS,iBAClChC,IAAA,CAACf,MAAM;UACNuF,KAAK,EAAG/E,EAAE,CACT,SAAS,EACT,0BACD,CAAG;UACHgF,qBAAqB;UACrBC,IAAI,EAAGpF,SAAW;UAClBwE,OAAO,EAAG9B,SAAW;UACrB2C,WAAW;QAAA,CACX,CACD,eACD3E,IAAA,CAACd,YAAY;UACZwF,IAAI,EAAGnF,YAAc;UACrBiF,KAAK,EAAG/E,EAAE,CACT,kBAAkB,EAClB,uBACD,CAAG;UACHkD,SAAS,EAAC,oDAAoD;UAC9DiC,QAAQ,EAAGb;QAAa,CACxB,CAAC;MAAA,CACK,CACR,EACCxB,MAAM,KAAK,UAAU;MAAA;MACtB;MACAvC,IAAA,CAACb,OAAO;QAAC0F,IAAI,EAAGrF,EAAE,CAAE,UAAW,CAAG;QAAAsC,QAAA,eACjC9B,IAAA,CAACZ,IAAI;UAACsF,IAAI,EAAGrF;QAAO,CAAE;MAAC,CACf,CACT;IAAA,CACI,CAAC;EAAA,CACA,CAAC;AAEX","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { useSelect, useDispatch, resolveSelect } from '@wordpress/data';
6
- import { useState, useEffect, useMemo } from '@wordpress/element';
6
+ import { useState, useMemo } from '@wordpress/element';
7
7
  import { comment as commentIcon } from '@wordpress/icons';
8
8
  import { addFilter } from '@wordpress/hooks';
9
9
  import { store as noticesStore } from '@wordpress/notices';
@@ -22,7 +22,6 @@ import { store as editorStore } from '../../store';
22
22
  import AddCommentButton from './comment-button';
23
23
  import AddCommentToolbarButton from './comment-button-toolbar';
24
24
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
25
- const threadsEmptyArray = [];
26
25
  const isBlockCommentExperimentEnabled = window?.__experimentalEnableBlockComment;
27
26
  const modifyBlockCommentAttributes = settings => {
28
27
  if (!settings.attributes.blockCommentId) {
@@ -38,11 +37,10 @@ const modifyBlockCommentAttributes = settings => {
38
37
 
39
38
  // Apply the filter to all core blocks
40
39
  addFilter('blocks.registerBlockType', 'block-comment/modify-core-block-attributes', modifyBlockCommentAttributes);
41
-
42
- /**
43
- * Renders the Collab sidebar.
44
- */
45
- export default function CollabSidebar() {
40
+ function CollabSidebarContent({
41
+ showCommentBoard,
42
+ setShowCommentBoard
43
+ }) {
46
44
  const {
47
45
  createNotice
48
46
  } = useDispatch(noticesStore);
@@ -54,49 +52,27 @@ export default function CollabSidebar() {
54
52
  getEntityRecord
55
53
  } = resolveSelect(coreStore);
56
54
  const {
57
- enableComplementaryArea
58
- } = useDispatch(interfaceStore);
59
- const [blockCommentID, setBlockCommentID] = useState(null);
60
- const [showCommentBoard, setShowCommentBoard] = useState(false);
61
- const {
62
- postId
55
+ postId,
56
+ threads
63
57
  } = useSelect(select => {
64
- return {
65
- postId: select(editorStore).getCurrentPostId()
66
- };
67
- }, []);
68
- const postStatus = useSelect(select => {
69
- const post = select(editorStore).getCurrentPost();
70
- return {
71
- postStatus: post?.status
72
- };
73
- }, []);
74
- const threads = useSelect(select => {
75
- if (!postId) {
76
- return threadsEmptyArray;
77
- }
78
58
  const {
79
- getEntityRecords
80
- } = select(coreStore);
81
- const data = getEntityRecords('root', 'comment', {
82
- post: postId,
59
+ getCurrentPostId
60
+ } = select(editorStore);
61
+ const _postId = getCurrentPostId();
62
+ const data = !!_postId ? select(coreStore).getEntityRecords('root', 'comment', {
63
+ post: _postId,
83
64
  type: 'block_comment',
84
65
  status: 'any',
85
66
  per_page: 100
86
- });
87
- return data || threadsEmptyArray;
88
- }, [postId]);
89
- const clientId = useSelect(select => {
90
- const {
91
- getSelectedBlockClientId
92
- } = select(blockEditorStore);
93
- return getSelectedBlockClientId();
67
+ }) : null;
68
+ return {
69
+ postId: _postId,
70
+ threads: data
71
+ };
94
72
  }, []);
95
- const blockDetails = useSelect(select => {
96
- return clientId ? select(blockEditorStore).getBlock(clientId) : null;
97
- }, [clientId]);
98
-
99
- // Get the dispatch functions to save the comment and update the block attributes.
73
+ const {
74
+ getSelectedBlockClientId
75
+ } = useSelect(blockEditorStore);
100
76
  const {
101
77
  updateBlockAttributes
102
78
  } = useDispatch(blockEditorStore);
@@ -106,7 +82,7 @@ export default function CollabSidebar() {
106
82
  // Create a compare to store the references to all objects by id
107
83
  const compare = {};
108
84
  const result = [];
109
- const filteredComments = threads.filter(comment => comment.status !== 'trash');
85
+ const filteredComments = (threads !== null && threads !== void 0 ? threads : []).filter(comment => comment.status !== 'trash');
110
86
 
111
87
  // Initialize each object with an empty `reply` array
112
88
  filteredComments.forEach(item => {
@@ -128,10 +104,6 @@ export default function CollabSidebar() {
128
104
  });
129
105
  return result;
130
106
  }, [threads]);
131
- const openCollabBoard = () => {
132
- setShowCommentBoard(true);
133
- enableComplementaryArea('core', 'edit-post/collab-sidebar');
134
- };
135
107
 
136
108
  // Function to save the comment.
137
109
  const addNewComment = async (comment, parentCommentId) => {
@@ -153,7 +125,7 @@ export default function CollabSidebar() {
153
125
  if (savedRecord) {
154
126
  // If it's a main comment, update the block attributes with the comment id.
155
127
  if (!parentCommentId) {
156
- updateBlockAttributes(clientId, {
128
+ updateBlockAttributes(getSelectedBlockClientId(), {
157
129
  blockCommentId: savedRecord?.id
158
130
  });
159
131
  }
@@ -211,7 +183,7 @@ export default function CollabSidebar() {
211
183
  const childComment = await getEntityRecord('root', 'comment', commentId);
212
184
  await deleteEntityRecord('root', 'comment', commentId);
213
185
  if (childComment && !childComment.parent) {
214
- updateBlockAttributes(clientId, {
186
+ updateBlockAttributes(getSelectedBlockClientId(), {
215
187
  blockCommentId: undefined
216
188
  });
217
189
  }
@@ -222,20 +194,61 @@ export default function CollabSidebar() {
222
194
  isDismissible: true
223
195
  });
224
196
  };
225
- useEffect(() => {
226
- if (blockDetails) {
227
- setBlockCommentID(blockDetails?.attributes.blockCommentId);
228
- }
229
- }, [postId, clientId]);
197
+ return /*#__PURE__*/_jsxs("div", {
198
+ className: "editor-collab-sidebar-panel",
199
+ children: [/*#__PURE__*/_jsx(AddComment, {
200
+ onSubmit: addNewComment,
201
+ showCommentBoard: showCommentBoard,
202
+ setShowCommentBoard: setShowCommentBoard
203
+ }), /*#__PURE__*/_jsx(Comments, {
204
+ threads: resultComments,
205
+ onEditComment: onEditComment,
206
+ onAddReply: addNewComment,
207
+ onCommentDelete: onCommentDelete,
208
+ onCommentResolve: onCommentResolve
209
+ })]
210
+ });
211
+ }
212
+
213
+ /**
214
+ * Renders the Collab sidebar.
215
+ */
216
+ export default function CollabSidebar() {
217
+ const [showCommentBoard, setShowCommentBoard] = useState(false);
218
+ const {
219
+ enableComplementaryArea
220
+ } = useDispatch(interfaceStore);
221
+ const {
222
+ postStatus
223
+ } = useSelect(select => {
224
+ return {
225
+ postStatus: select(editorStore).getEditedPostAttribute('status')
226
+ };
227
+ }, []);
228
+ const {
229
+ blockCommentId
230
+ } = useSelect(select => {
231
+ const {
232
+ getBlockAttributes,
233
+ getSelectedBlockClientId
234
+ } = select(blockEditorStore);
235
+ const _clientId = getSelectedBlockClientId();
236
+ return {
237
+ blockCommentId: _clientId ? getBlockAttributes(_clientId)?.blockCommentId : null
238
+ };
239
+ }, []);
240
+ const openCollabBoard = () => {
241
+ setShowCommentBoard(true);
242
+ enableComplementaryArea('core', 'edit-post/collab-sidebar');
243
+ };
230
244
 
231
245
  // Check if the experimental flag is enabled.
232
- if (!isBlockCommentExperimentEnabled || postStatus.postStatus === 'publish') {
246
+ if (!isBlockCommentExperimentEnabled || postStatus === 'publish') {
233
247
  return null; // or maybe return some message indicating no threads are available.
234
248
  }
249
+ const AddCommentComponent = blockCommentId ? AddCommentToolbarButton : AddCommentButton;
235
250
  return /*#__PURE__*/_jsxs(_Fragment, {
236
- children: [!blockCommentID && /*#__PURE__*/_jsx(AddCommentButton, {
237
- onClick: openCollabBoard
238
- }), blockCommentID > 0 && /*#__PURE__*/_jsx(AddCommentToolbarButton, {
251
+ children: [/*#__PURE__*/_jsx(AddCommentComponent, {
239
252
  onClick: openCollabBoard
240
253
  }), /*#__PURE__*/_jsx(PluginSidebar, {
241
254
  identifier: collabSidebarName
@@ -243,20 +256,9 @@ export default function CollabSidebar() {
243
256
  ,
244
257
  title: __('Comments'),
245
258
  icon: commentIcon,
246
- children: /*#__PURE__*/_jsxs("div", {
247
- className: "editor-collab-sidebar-panel",
248
- children: [/*#__PURE__*/_jsx(AddComment, {
249
- threads: resultComments,
250
- onSubmit: addNewComment,
251
- showCommentBoard: showCommentBoard,
252
- setShowCommentBoard: setShowCommentBoard
253
- }), /*#__PURE__*/_jsx(Comments, {
254
- threads: resultComments,
255
- onEditComment: onEditComment,
256
- onAddReply: addNewComment,
257
- onCommentDelete: onCommentDelete,
258
- onCommentResolve: onCommentResolve
259
- })]
259
+ children: /*#__PURE__*/_jsx(CollabSidebarContent, {
260
+ showCommentBoard: showCommentBoard,
261
+ setShowCommentBoard: setShowCommentBoard
260
262
  })
261
263
  })]
262
264
  });
@@ -1 +1 @@
1
- {"version":3,"names":["__","useSelect","useDispatch","resolveSelect","useState","useEffect","useMemo","comment","commentIcon","addFilter","store","noticesStore","coreStore","blockEditorStore","interfaceStore","PluginSidebar","collabSidebarName","Comments","AddComment","editorStore","AddCommentButton","AddCommentToolbarButton","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","threadsEmptyArray","isBlockCommentExperimentEnabled","window","__experimentalEnableBlockComment","modifyBlockCommentAttributes","settings","attributes","blockCommentId","type","CollabSidebar","createNotice","saveEntityRecord","deleteEntityRecord","getEntityRecord","enableComplementaryArea","blockCommentID","setBlockCommentID","showCommentBoard","setShowCommentBoard","postId","select","getCurrentPostId","postStatus","post","getCurrentPost","status","threads","getEntityRecords","data","per_page","clientId","getSelectedBlockClientId","blockDetails","getBlock","updateBlockAttributes","resultComments","compare","result","filteredComments","filter","forEach","item","id","reply","parent","push","openCollabBoard","addNewComment","parentCommentId","args","content","comment_type","comment_approved","updatedArgs","savedRecord","isDismissible","onError","onCommentResolve","commentId","onEditComment","onCommentDelete","childComment","undefined","children","onClick","identifier","title","icon","className","onSubmit","onAddReply"],"sources":["@wordpress/editor/src/components/collab-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch, resolveSelect } from '@wordpress/data';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport { comment as commentIcon } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PluginSidebar from '../plugin-sidebar';\nimport { collabSidebarName } from './constants';\nimport { Comments } from './comments';\nimport { AddComment } from './add-comment';\nimport { store as editorStore } from '../../store';\nimport AddCommentButton from './comment-button';\nimport AddCommentToolbarButton from './comment-button-toolbar';\n\nconst threadsEmptyArray = [];\n\nconst isBlockCommentExperimentEnabled =\n\twindow?.__experimentalEnableBlockComment;\nconst modifyBlockCommentAttributes = ( settings ) => {\n\tif ( ! settings.attributes.blockCommentId ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tblockCommentId: {\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n};\n\n// Apply the filter to all core blocks\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-comment/modify-core-block-attributes',\n\tmodifyBlockCommentAttributes\n);\n\n/**\n * Renders the Collab sidebar.\n */\nexport default function CollabSidebar() {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord, deleteEntityRecord } = useDispatch( coreStore );\n\tconst { getEntityRecord } = resolveSelect( coreStore );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst [ blockCommentID, setBlockCommentID ] = useState( null );\n\tconst [ showCommentBoard, setShowCommentBoard ] = useState( false );\n\tconst { postId } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostId: select( editorStore ).getCurrentPostId(),\n\t\t};\n\t}, [] );\n\n\tconst postStatus = useSelect( ( select ) => {\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\treturn { postStatus: post?.status };\n\t}, [] );\n\n\tconst threads = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! postId ) {\n\t\t\t\treturn threadsEmptyArray;\n\t\t\t}\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\tconst data = getEntityRecords( 'root', 'comment', {\n\t\t\t\tpost: postId,\n\t\t\t\ttype: 'block_comment',\n\t\t\t\tstatus: 'any',\n\t\t\t\tper_page: 100,\n\t\t\t} );\n\t\t\treturn data || threadsEmptyArray;\n\t\t},\n\t\t[ postId ]\n\t);\n\n\tconst clientId = useSelect( ( select ) => {\n\t\tconst { getSelectedBlockClientId } = select( blockEditorStore );\n\t\treturn getSelectedBlockClientId();\n\t}, [] );\n\n\tconst blockDetails = useSelect(\n\t\t( select ) => {\n\t\t\treturn clientId\n\t\t\t\t? select( blockEditorStore ).getBlock( clientId )\n\t\t\t\t: null;\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Get the dispatch functions to save the comment and update the block attributes.\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\t// Process comments to build the tree structure\n\tconst resultComments = useMemo( () => {\n\t\t// Create a compare to store the references to all objects by id\n\t\tconst compare = {};\n\t\tconst result = [];\n\n\t\tconst filteredComments = threads.filter(\n\t\t\t( comment ) => comment.status !== 'trash'\n\t\t);\n\n\t\t// Initialize each object with an empty `reply` array\n\t\tfilteredComments.forEach( ( item ) => {\n\t\t\tcompare[ item.id ] = { ...item, reply: [] };\n\t\t} );\n\n\t\t// Iterate over the data to build the tree structure\n\t\tfilteredComments.forEach( ( item ) => {\n\t\t\tif ( item.parent === 0 ) {\n\t\t\t\t// If parent is 0, it's a root item, push it to the result array\n\t\t\t\tresult.push( compare[ item.id ] );\n\t\t\t} else if ( compare[ item.parent ] ) {\n\t\t\t\t// Otherwise, find its parent and push it to the parent's `reply` array\n\t\t\t\tcompare[ item.parent ].reply.push( compare[ item.id ] );\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ threads ] );\n\n\tconst openCollabBoard = () => {\n\t\tsetShowCommentBoard( true );\n\t\tenableComplementaryArea( 'core', 'edit-post/collab-sidebar' );\n\t};\n\n\t// Function to save the comment.\n\tconst addNewComment = async ( comment, parentCommentId ) => {\n\t\tconst args = {\n\t\t\tpost: postId,\n\t\t\tcontent: comment,\n\t\t\tcomment_type: 'block_comment',\n\t\t\tcomment_approved: 0,\n\t\t};\n\n\t\t// Create a new object, conditionally including the parent property\n\t\tconst updatedArgs = {\n\t\t\t...args,\n\t\t\t...( parentCommentId ? { parent: parentCommentId } : {} ),\n\t\t};\n\n\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t'root',\n\t\t\t'comment',\n\t\t\tupdatedArgs\n\t\t);\n\n\t\tif ( savedRecord ) {\n\t\t\t// If it's a main comment, update the block attributes with the comment id.\n\t\t\tif ( ! parentCommentId ) {\n\t\t\t\tupdateBlockAttributes( clientId, {\n\t\t\t\t\tblockCommentId: savedRecord?.id,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tcreateNotice(\n\t\t\t\t'snackbar',\n\t\t\t\tparentCommentId\n\t\t\t\t\t? // translators: Reply added successfully\n\t\t\t\t\t __( 'Reply added successfully.' )\n\t\t\t\t\t: // translators: Comment added successfully\n\t\t\t\t\t __( 'Comment added successfully.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onCommentResolve = async ( commentId ) => {\n\t\tconst savedRecord = await saveEntityRecord( 'root', 'comment', {\n\t\t\tid: commentId,\n\t\t\tstatus: 'approved',\n\t\t} );\n\n\t\tif ( savedRecord ) {\n\t\t\t// translators: Comment resolved successfully\n\t\t\tcreateNotice( 'snackbar', __( 'Comment marked as resolved.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onEditComment = async ( commentId, comment ) => {\n\t\tconst savedRecord = await saveEntityRecord( 'root', 'comment', {\n\t\t\tid: commentId,\n\t\t\tcontent: comment,\n\t\t} );\n\n\t\tif ( savedRecord ) {\n\t\t\tcreateNotice(\n\t\t\t\t'snackbar',\n\t\t\t\t// translators: Comment edited successfully\n\t\t\t\t__( 'Comment edited successfully.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onError = () => {\n\t\tcreateNotice(\n\t\t\t'error',\n\t\t\t// translators: Error message when comment submission fails\n\t\t\t__(\n\t\t\t\t'Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier.'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t}\n\t\t);\n\t};\n\n\tconst onCommentDelete = async ( commentId ) => {\n\t\tconst childComment = await getEntityRecord(\n\t\t\t'root',\n\t\t\t'comment',\n\t\t\tcommentId\n\t\t);\n\t\tawait deleteEntityRecord( 'root', 'comment', commentId );\n\n\t\tif ( childComment && ! childComment.parent ) {\n\t\t\tupdateBlockAttributes( clientId, {\n\t\t\t\tblockCommentId: undefined,\n\t\t\t} );\n\t\t}\n\n\t\tcreateNotice(\n\t\t\t'snackbar',\n\t\t\t// translators: Comment deleted successfully\n\t\t\t__( 'Comment deleted successfully.' ),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tisDismissible: true,\n\t\t\t}\n\t\t);\n\t};\n\n\tuseEffect( () => {\n\t\tif ( blockDetails ) {\n\t\t\tsetBlockCommentID( blockDetails?.attributes.blockCommentId );\n\t\t}\n\t}, [ postId, clientId ] );\n\n\t// Check if the experimental flag is enabled.\n\tif (\n\t\t! isBlockCommentExperimentEnabled ||\n\t\tpostStatus.postStatus === 'publish'\n\t) {\n\t\treturn null; // or maybe return some message indicating no threads are available.\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ ! blockCommentID && (\n\t\t\t\t<AddCommentButton onClick={ openCollabBoard } />\n\t\t\t) }\n\n\t\t\t{ blockCommentID > 0 && (\n\t\t\t\t<AddCommentToolbarButton onClick={ openCollabBoard } />\n\t\t\t) }\n\t\t\t<PluginSidebar\n\t\t\t\tidentifier={ collabSidebarName }\n\t\t\t\t// translators: Comments sidebar title\n\t\t\t\ttitle={ __( 'Comments' ) }\n\t\t\t\ticon={ commentIcon }\n\t\t\t>\n\t\t\t\t<div className=\"editor-collab-sidebar-panel\">\n\t\t\t\t\t<AddComment\n\t\t\t\t\t\tthreads={ resultComments }\n\t\t\t\t\t\tonSubmit={ addNewComment }\n\t\t\t\t\t\tshowCommentBoard={ showCommentBoard }\n\t\t\t\t\t\tsetShowCommentBoard={ setShowCommentBoard }\n\t\t\t\t\t/>\n\t\t\t\t\t<Comments\n\t\t\t\t\t\tthreads={ resultComments }\n\t\t\t\t\t\tonEditComment={ onEditComment }\n\t\t\t\t\t\tonAddReply={ addNewComment }\n\t\t\t\t\t\tonCommentDelete={ onCommentDelete }\n\t\t\t\t\t\tonCommentResolve={ onCommentResolve }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</PluginSidebar>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,WAAW,EAAEC,aAAa,QAAQ,iBAAiB;AACvE,SAASC,QAAQ,EAAEC,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACjE,SAASC,OAAO,IAAIC,WA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D,YAAY,EAAG;MACnBhB,iBAAiB,CAAEgB,YAAY,EAAE1B,UAAU,CAACC,cAAe,CAAC;IAC7D;EACD,CAAC,EAAE,CAAEY,MAAM,EAAEW,QAAQ,CAAG,CAAC;;EAEzB;EACA,IACC,CAAE7B,+BAA+B,IACjCqB,UAAU,CAACA,UAAU,KAAK,SAAS,EAClC;IACD,OAAO,IAAI,CAAC,CAAC;EACd;EAEA,oBACCzB,KAAA,CAAAE,SAAA;IAAAgE,QAAA,GACG,CAAEhD,cAAc,iBACjBpB,IAAA,CAACH,gBAAgB;MAACwE,OAAO,EAAGlB;IAAiB,CAAE,CAC/C,EAEC/B,cAAc,GAAG,CAAC,iBACnBpB,IAAA,CAACF,uBAAuB;MAACuE,OAAO,EAAGlB;IAAiB,CAAE,CACtD,eACDnD,IAAA,CAACR,aAAa;MACb8E,UAAU,EAAG7E;MACb;MAAA;MACA8E,KAAK,EAAG9F,EAAE,CAAE,UAAW,CAAG;MAC1B+F,IAAI,EAAGvF,WAAa;MAAAmF,QAAA,eAEpBlE,KAAA;QAAKuE,SAAS,EAAC,6BAA6B;QAAAL,QAAA,gBAC3CpE,IAAA,CAACL,UAAU;UACVoC,OAAO,EAAGS,cAAgB;UAC1BkC,QAAQ,EAAGtB,aAAe;UAC1B9B,gBAAgB,EAAGA,gBAAkB;UACrCC,mBAAmB,EAAGA;QAAqB,CAC3C,CAAC,eACFvB,IAAA,CAACN,QAAQ;UACRqC,OAAO,EAAGS,cAAgB;UAC1BwB,aAAa,EAAGA,aAAe;UAC/BW,UAAU,EAAGvB,aAAe;UAC5Ba,eAAe,EAAGA,eAAiB;UACnCH,gBAAgB,EAAGA;QAAkB,CACrC,CAAC;MAAA,CACE;IAAC,CACQ,CAAC;EAAA,CACf,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__","useSelect","useDispatch","resolveSelect","useState","useMemo","comment","commentIcon","addFilter","store","noticesStore","coreStore","blockEditorStore","interfaceStore","PluginSidebar","collabSidebarName","Comments","AddComment","editorStore","AddCommentButton","AddCommentToolbarButton","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","isBlockCommentExperimentEnabled","window","__experimentalEnableBlockComment","modifyBlockCommentAttributes","settings","attributes","blockCommentId","type","CollabSidebarContent","showCommentBoard","setShowCommentBoard","createNotice","saveEntityRecord","deleteEntityRecord","getEntityRecord","postId","threads","select","getCurrentPostId","_postId","data","getEntityRecords","post","status","per_page","getSelectedBlockClientId","updateBlockAttributes","resultComments","compare","result","filteredComments","filter","forEach","item","id","reply","parent","push","addNewComment","parentCommentId","args","content","comment_type","comment_approved","updatedArgs","savedRecord","isDismissible","onError","onCommentResolve","commentId","onEditComment","onCommentDelete","childComment","undefined","className","children","onSubmit","onAddReply","CollabSidebar","enableComplementaryArea","postStatus","getEditedPostAttribute","getBlockAttributes","_clientId","openCollabBoard","AddCommentComponent","onClick","identifier","title","icon"],"sources":["@wordpress/editor/src/components/collab-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch, resolveSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { comment as commentIcon } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PluginSidebar from '../plugin-sidebar';\nimport { collabSidebarName } from './constants';\nimport { Comments } from './comments';\nimport { AddComment } from './add-comment';\nimport { store as editorStore } from '../../store';\nimport AddCommentButton from './comment-button';\nimport AddCommentToolbarButton from './comment-button-toolbar';\n\nconst isBlockCommentExperimentEnabled =\n\twindow?.__experimentalEnableBlockComment;\nconst modifyBlockCommentAttributes = ( settings ) => {\n\tif ( ! settings.attributes.blockCommentId ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tblockCommentId: {\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n};\n\n// Apply the filter to all core blocks\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-comment/modify-core-block-attributes',\n\tmodifyBlockCommentAttributes\n);\n\nfunction CollabSidebarContent( { showCommentBoard, setShowCommentBoard } ) {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord, deleteEntityRecord } = useDispatch( coreStore );\n\tconst { getEntityRecord } = resolveSelect( coreStore );\n\n\tconst { postId, threads } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId } = select( editorStore );\n\t\tconst _postId = getCurrentPostId();\n\t\tconst data = !! _postId\n\t\t\t? select( coreStore ).getEntityRecords( 'root', 'comment', {\n\t\t\t\t\tpost: _postId,\n\t\t\t\t\ttype: 'block_comment',\n\t\t\t\t\tstatus: 'any',\n\t\t\t\t\tper_page: 100,\n\t\t\t } )\n\t\t\t: null;\n\n\t\treturn {\n\t\t\tpostId: _postId,\n\t\t\tthreads: data,\n\t\t};\n\t}, [] );\n\n\tconst { getSelectedBlockClientId } = useSelect( blockEditorStore );\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\t// Process comments to build the tree structure\n\tconst resultComments = useMemo( () => {\n\t\t// Create a compare to store the references to all objects by id\n\t\tconst compare = {};\n\t\tconst result = [];\n\n\t\tconst filteredComments = ( threads ?? [] ).filter(\n\t\t\t( comment ) => comment.status !== 'trash'\n\t\t);\n\n\t\t// Initialize each object with an empty `reply` array\n\t\tfilteredComments.forEach( ( item ) => {\n\t\t\tcompare[ item.id ] = { ...item, reply: [] };\n\t\t} );\n\n\t\t// Iterate over the data to build the tree structure\n\t\tfilteredComments.forEach( ( item ) => {\n\t\t\tif ( item.parent === 0 ) {\n\t\t\t\t// If parent is 0, it's a root item, push it to the result array\n\t\t\t\tresult.push( compare[ item.id ] );\n\t\t\t} else if ( compare[ item.parent ] ) {\n\t\t\t\t// Otherwise, find its parent and push it to the parent's `reply` array\n\t\t\t\tcompare[ item.parent ].reply.push( compare[ item.id ] );\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ threads ] );\n\n\t// Function to save the comment.\n\tconst addNewComment = async ( comment, parentCommentId ) => {\n\t\tconst args = {\n\t\t\tpost: postId,\n\t\t\tcontent: comment,\n\t\t\tcomment_type: 'block_comment',\n\t\t\tcomment_approved: 0,\n\t\t};\n\n\t\t// Create a new object, conditionally including the parent property\n\t\tconst updatedArgs = {\n\t\t\t...args,\n\t\t\t...( parentCommentId ? { parent: parentCommentId } : {} ),\n\t\t};\n\n\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t'root',\n\t\t\t'comment',\n\t\t\tupdatedArgs\n\t\t);\n\n\t\tif ( savedRecord ) {\n\t\t\t// If it's a main comment, update the block attributes with the comment id.\n\t\t\tif ( ! parentCommentId ) {\n\t\t\t\tupdateBlockAttributes( getSelectedBlockClientId(), {\n\t\t\t\t\tblockCommentId: savedRecord?.id,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tcreateNotice(\n\t\t\t\t'snackbar',\n\t\t\t\tparentCommentId\n\t\t\t\t\t? // translators: Reply added successfully\n\t\t\t\t\t __( 'Reply added successfully.' )\n\t\t\t\t\t: // translators: Comment added successfully\n\t\t\t\t\t __( 'Comment added successfully.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onCommentResolve = async ( commentId ) => {\n\t\tconst savedRecord = await saveEntityRecord( 'root', 'comment', {\n\t\t\tid: commentId,\n\t\t\tstatus: 'approved',\n\t\t} );\n\n\t\tif ( savedRecord ) {\n\t\t\t// translators: Comment resolved successfully\n\t\t\tcreateNotice( 'snackbar', __( 'Comment marked as resolved.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onEditComment = async ( commentId, comment ) => {\n\t\tconst savedRecord = await saveEntityRecord( 'root', 'comment', {\n\t\t\tid: commentId,\n\t\t\tcontent: comment,\n\t\t} );\n\n\t\tif ( savedRecord ) {\n\t\t\tcreateNotice(\n\t\t\t\t'snackbar',\n\t\t\t\t// translators: Comment edited successfully\n\t\t\t\t__( 'Comment edited successfully.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onError = () => {\n\t\tcreateNotice(\n\t\t\t'error',\n\t\t\t// translators: Error message when comment submission fails\n\t\t\t__(\n\t\t\t\t'Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier.'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t}\n\t\t);\n\t};\n\n\tconst onCommentDelete = async ( commentId ) => {\n\t\tconst childComment = await getEntityRecord(\n\t\t\t'root',\n\t\t\t'comment',\n\t\t\tcommentId\n\t\t);\n\t\tawait deleteEntityRecord( 'root', 'comment', commentId );\n\n\t\tif ( childComment && ! childComment.parent ) {\n\t\t\tupdateBlockAttributes( getSelectedBlockClientId(), {\n\t\t\t\tblockCommentId: undefined,\n\t\t\t} );\n\t\t}\n\n\t\tcreateNotice(\n\t\t\t'snackbar',\n\t\t\t// translators: Comment deleted successfully\n\t\t\t__( 'Comment deleted successfully.' ),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tisDismissible: true,\n\t\t\t}\n\t\t);\n\t};\n\n\treturn (\n\t\t<div className=\"editor-collab-sidebar-panel\">\n\t\t\t<AddComment\n\t\t\t\tonSubmit={ addNewComment }\n\t\t\t\tshowCommentBoard={ showCommentBoard }\n\t\t\t\tsetShowCommentBoard={ setShowCommentBoard }\n\t\t\t/>\n\t\t\t<Comments\n\t\t\t\tthreads={ resultComments }\n\t\t\t\tonEditComment={ onEditComment }\n\t\t\t\tonAddReply={ addNewComment }\n\t\t\t\tonCommentDelete={ onCommentDelete }\n\t\t\t\tonCommentResolve={ onCommentResolve }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\n/**\n * Renders the Collab sidebar.\n */\nexport default function CollabSidebar() {\n\tconst [ showCommentBoard, setShowCommentBoard ] = useState( false );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst { postStatus } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostStatus:\n\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t};\n\t}, [] );\n\n\tconst { blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getBlockAttributes, getSelectedBlockClientId } =\n\t\t\tselect( blockEditorStore );\n\t\tconst _clientId = getSelectedBlockClientId();\n\n\t\treturn {\n\t\t\tblockCommentId: _clientId\n\t\t\t\t? getBlockAttributes( _clientId )?.blockCommentId\n\t\t\t\t: null,\n\t\t};\n\t}, [] );\n\n\tconst openCollabBoard = () => {\n\t\tsetShowCommentBoard( true );\n\t\tenableComplementaryArea( 'core', 'edit-post/collab-sidebar' );\n\t};\n\n\t// Check if the experimental flag is enabled.\n\tif ( ! isBlockCommentExperimentEnabled || postStatus === 'publish' ) {\n\t\treturn null; // or maybe return some message indicating no threads are available.\n\t}\n\n\tconst AddCommentComponent = blockCommentId\n\t\t? AddCommentToolbarButton\n\t\t: AddCommentButton;\n\n\treturn (\n\t\t<>\n\t\t\t<AddCommentComponent onClick={ openCollabBoard } />\n\t\t\t<PluginSidebar\n\t\t\t\tidentifier={ collabSidebarName }\n\t\t\t\t// translators: Comments sidebar title\n\t\t\t\ttitle={ __( 'Comments' ) }\n\t\t\t\ticon={ commentIcon }\n\t\t\t>\n\t\t\t\t<CollabSidebarContent\n\t\t\t\t\tshowCommentBoard={ showCommentBoard }\n\t\t\t\t\tsetShowCommentBoard={ setShowCommentBoard }\n\t\t\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