@wordpress/editor 14.13.1-next.cd6172eb0.0 → 14.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (478) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +1 -0
  4. package/build/bindings/pattern-overrides.js +1 -0
  5. package/build/bindings/pattern-overrides.js.map +1 -1
  6. package/build/bindings/post-meta.js +1 -0
  7. package/build/bindings/post-meta.js.map +1 -1
  8. package/build/components/autocompleters/user.js +1 -0
  9. package/build/components/autocompleters/user.js.map +1 -1
  10. package/build/components/block-removal-warnings/index.js +1 -0
  11. package/build/components/block-removal-warnings/index.js.map +1 -1
  12. package/build/components/block-settings-menu/content-only-settings-menu.js +1 -0
  13. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  14. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -0
  15. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  16. package/build/components/collab-sidebar/add-comment.js +1 -1
  17. package/build/components/collab-sidebar/add-comment.js.map +1 -1
  18. package/build/components/collab-sidebar/comment-button.js +7 -2
  19. package/build/components/collab-sidebar/comment-button.js.map +1 -1
  20. package/build/components/collab-sidebar/comment-form.js +4 -1
  21. package/build/components/collab-sidebar/comment-form.js.map +1 -1
  22. package/build/components/collab-sidebar/comments.js +199 -185
  23. package/build/components/collab-sidebar/comments.js.map +1 -1
  24. package/build/components/collab-sidebar/index.js +11 -4
  25. package/build/components/collab-sidebar/index.js.map +1 -1
  26. package/build/components/collab-sidebar/utils.js +1 -0
  27. package/build/components/collab-sidebar/utils.js.map +1 -1
  28. package/build/components/commands/index.js +28 -0
  29. package/build/components/commands/index.js.map +1 -1
  30. package/build/components/deprecated.js +1 -0
  31. package/build/components/deprecated.js.map +1 -1
  32. package/build/components/document-bar/index.js +5 -2
  33. package/build/components/document-bar/index.js.map +1 -1
  34. package/build/components/document-outline/index.js +1 -0
  35. package/build/components/document-outline/index.js.map +1 -1
  36. package/build/components/document-tools/index.js +3 -6
  37. package/build/components/document-tools/index.js.map +1 -1
  38. package/build/components/editor-help/index.native.js +1 -0
  39. package/build/components/editor-help/index.native.js.map +1 -1
  40. package/build/components/editor-help/intro-to-blocks.native.js +1 -1
  41. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  42. package/build/components/editor-notices/index.js +1 -0
  43. package/build/components/editor-notices/index.js.map +1 -1
  44. package/build/components/editor-snackbars/index.js +1 -0
  45. package/build/components/editor-snackbars/index.js.map +1 -1
  46. package/build/components/entities-saved-states/entity-type-list.js +1 -0
  47. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  48. package/build/components/entities-saved-states/hooks/use-is-dirty.js +1 -0
  49. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  50. package/build/components/entities-saved-states/index.js +3 -1
  51. package/build/components/entities-saved-states/index.js.map +1 -1
  52. package/build/components/error-boundary/index.js +26 -13
  53. package/build/components/error-boundary/index.js.map +1 -1
  54. package/build/components/error-boundary/index.native.js +1 -1
  55. package/build/components/error-boundary/index.native.js.map +1 -1
  56. package/build/components/keyboard-shortcut-help-modal/index.js +1 -0
  57. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  58. package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
  59. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  60. package/build/components/list-view-sidebar/index.js +1 -0
  61. package/build/components/list-view-sidebar/index.js.map +1 -1
  62. package/build/components/local-autosave-monitor/index.js +1 -0
  63. package/build/components/local-autosave-monitor/index.js.map +1 -1
  64. package/build/components/mode-switcher/index.js +1 -0
  65. package/build/components/mode-switcher/index.js.map +1 -1
  66. package/build/components/more-menu/index.js +0 -1
  67. package/build/components/more-menu/index.js.map +1 -1
  68. package/build/components/page-attributes/parent.js +1 -0
  69. package/build/components/page-attributes/parent.js.map +1 -1
  70. package/build/components/post-actions/actions.js +10 -4
  71. package/build/components/post-actions/actions.js.map +1 -1
  72. package/build/components/post-actions/index.js +80 -91
  73. package/build/components/post-actions/index.js.map +1 -1
  74. package/build/components/post-actions/set-as-homepage.js +23 -34
  75. package/build/components/post-actions/set-as-homepage.js.map +1 -1
  76. package/build/components/post-actions/set-as-posts-page.js +154 -0
  77. package/build/components/post-actions/set-as-posts-page.js.map +1 -0
  78. package/build/components/post-author/hook.js +1 -0
  79. package/build/components/post-author/hook.js.map +1 -1
  80. package/build/components/post-card-panel/index.js +64 -24
  81. package/build/components/post-card-panel/index.js.map +1 -1
  82. package/build/components/post-fields/index.js +1 -0
  83. package/build/components/post-fields/index.js.map +1 -1
  84. package/build/components/post-format/index.js +1 -0
  85. package/build/components/post-format/index.js.map +1 -1
  86. package/build/components/post-format/panel.js +1 -0
  87. package/build/components/post-format/panel.js.map +1 -1
  88. package/build/components/post-publish-button/index.js +1 -0
  89. package/build/components/post-publish-button/index.js.map +1 -1
  90. package/build/components/post-publish-panel/maybe-category-panel.js +1 -0
  91. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  92. package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  93. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  94. package/build/components/post-publish-panel/maybe-upload-media.js +2 -1
  95. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  96. package/build/components/post-publish-panel/media-util.js +1 -0
  97. package/build/components/post-publish-panel/media-util.js.map +1 -1
  98. package/build/components/post-publish-panel/prepublish.js +1 -1
  99. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  100. package/build/components/post-saved-state/index.js +1 -0
  101. package/build/components/post-saved-state/index.js.map +1 -1
  102. package/build/components/post-schedule/index.js +1 -0
  103. package/build/components/post-schedule/index.js.map +1 -1
  104. package/build/components/post-taxonomies/flat-term-selector.js +1 -0
  105. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  106. package/build/components/post-taxonomies/hierarchical-term-selector.js +1 -0
  107. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  108. package/build/components/post-taxonomies/index.js +1 -0
  109. package/build/components/post-taxonomies/index.js.map +1 -1
  110. package/build/components/post-taxonomies/most-used-terms.js +1 -0
  111. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  112. package/build/components/post-template/classic-theme.js +1 -0
  113. package/build/components/post-template/classic-theme.js.map +1 -1
  114. package/build/components/post-template/swap-template-button.js +1 -0
  115. package/build/components/post-template/swap-template-button.js.map +1 -1
  116. package/build/components/post-transform-panel/hooks.js +1 -0
  117. package/build/components/post-transform-panel/hooks.js.map +1 -1
  118. package/build/components/post-type-support-check/index.js +1 -0
  119. package/build/components/post-type-support-check/index.js.map +1 -1
  120. package/build/components/preferences-modal/block-visibility.js +1 -0
  121. package/build/components/preferences-modal/block-visibility.js.map +1 -1
  122. package/build/components/preferences-modal/index.js +3 -4
  123. package/build/components/preferences-modal/index.js.map +1 -1
  124. package/build/components/preview-dropdown/index.js +0 -1
  125. package/build/components/preview-dropdown/index.js.map +1 -1
  126. package/build/components/provider/disable-non-page-content-blocks.js +66 -13
  127. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  128. package/build/components/provider/index.js +9 -13
  129. package/build/components/provider/index.js.map +1 -1
  130. package/build/components/provider/index.native.js +1 -0
  131. package/build/components/provider/index.native.js.map +1 -1
  132. package/build/components/provider/use-block-editor-settings.js +4 -1
  133. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  134. package/build/components/sidebar/index.js +1 -0
  135. package/build/components/sidebar/index.js.map +1 -1
  136. package/build/components/start-page-options/index.js +20 -106
  137. package/build/components/start-page-options/index.js.map +1 -1
  138. package/build/components/start-template-options/index.js +1 -0
  139. package/build/components/start-template-options/index.js.map +1 -1
  140. package/build/components/template-part-content-panel/index.js +1 -0
  141. package/build/components/template-part-content-panel/index.js.map +1 -1
  142. package/build/components/template-part-menu-items/index.js +2 -10
  143. package/build/components/template-part-menu-items/index.js.map +1 -1
  144. package/build/components/theme-support-check/index.js +1 -0
  145. package/build/components/theme-support-check/index.js.map +1 -1
  146. package/build/components/visual-editor/use-select-nearest-editable-block.js +1 -0
  147. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  148. package/build/dataviews/store/private-actions.js +16 -2
  149. package/build/dataviews/store/private-actions.js.map +1 -1
  150. package/build/dataviews/store/reducer.js +1 -0
  151. package/build/dataviews/store/reducer.js.map +1 -1
  152. package/build/hooks/custom-sources-backwards-compatibility.js +1 -0
  153. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  154. package/build/hooks/pattern-overrides.js +1 -0
  155. package/build/hooks/pattern-overrides.js.map +1 -1
  156. package/build/store/actions.js +1 -2
  157. package/build/store/actions.js.map +1 -1
  158. package/build/store/constants.js +1 -3
  159. package/build/store/constants.js.map +1 -1
  160. package/build/store/private-actions.js +2 -1
  161. package/build/store/private-actions.js.map +1 -1
  162. package/build/store/private-selectors.js +1 -0
  163. package/build/store/private-selectors.js.map +1 -1
  164. package/build/store/reducer.js +1 -0
  165. package/build/store/reducer.js.map +1 -1
  166. package/build/store/reducer.native.js +1 -0
  167. package/build/store/reducer.native.js.map +1 -1
  168. package/build/store/selectors.js +1 -0
  169. package/build/store/selectors.js.map +1 -1
  170. package/build/store/utils/notice-builder.js +3 -8
  171. package/build/store/utils/notice-builder.js.map +1 -1
  172. package/build/utils/get-item-title.js +32 -0
  173. package/build/utils/get-item-title.js.map +1 -0
  174. package/build/utils/get-template-info.js +1 -0
  175. package/build/utils/get-template-info.js.map +1 -1
  176. package/build/utils/media-sideload/index.js +21 -0
  177. package/build/utils/media-sideload/index.js.map +1 -0
  178. package/build/utils/media-sideload/index.native.js +8 -0
  179. package/build/utils/media-sideload/index.native.js.map +1 -0
  180. package/build/utils/media-upload/index.js +5 -2
  181. package/build/utils/media-upload/index.js.map +1 -1
  182. package/build/utils/pageTypeBadge.js +6 -12
  183. package/build/utils/pageTypeBadge.js.map +1 -1
  184. package/build/utils/terms.js +1 -0
  185. package/build/utils/terms.js.map +1 -1
  186. package/build-module/bindings/pattern-overrides.js +1 -0
  187. package/build-module/bindings/pattern-overrides.js.map +1 -1
  188. package/build-module/bindings/post-meta.js +1 -0
  189. package/build-module/bindings/post-meta.js.map +1 -1
  190. package/build-module/components/autocompleters/user.js +1 -0
  191. package/build-module/components/autocompleters/user.js.map +1 -1
  192. package/build-module/components/block-removal-warnings/index.js +1 -0
  193. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  194. package/build-module/components/block-settings-menu/content-only-settings-menu.js +1 -0
  195. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  196. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -0
  197. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  198. package/build-module/components/collab-sidebar/add-comment.js +1 -1
  199. package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
  200. package/build-module/components/collab-sidebar/comment-button.js +7 -2
  201. package/build-module/components/collab-sidebar/comment-button.js.map +1 -1
  202. package/build-module/components/collab-sidebar/comment-form.js +4 -1
  203. package/build-module/components/collab-sidebar/comment-form.js.map +1 -1
  204. package/build-module/components/collab-sidebar/comments.js +201 -187
  205. package/build-module/components/collab-sidebar/comments.js.map +1 -1
  206. package/build-module/components/collab-sidebar/index.js +11 -4
  207. package/build-module/components/collab-sidebar/index.js.map +1 -1
  208. package/build-module/components/collab-sidebar/utils.js +1 -0
  209. package/build-module/components/collab-sidebar/utils.js.map +1 -1
  210. package/build-module/components/commands/index.js +28 -0
  211. package/build-module/components/commands/index.js.map +1 -1
  212. package/build-module/components/deprecated.js +1 -0
  213. package/build-module/components/deprecated.js.map +1 -1
  214. package/build-module/components/document-bar/index.js +5 -2
  215. package/build-module/components/document-bar/index.js.map +1 -1
  216. package/build-module/components/document-outline/index.js +1 -0
  217. package/build-module/components/document-outline/index.js.map +1 -1
  218. package/build-module/components/document-tools/index.js +4 -7
  219. package/build-module/components/document-tools/index.js.map +1 -1
  220. package/build-module/components/editor-help/index.native.js +1 -0
  221. package/build-module/components/editor-help/index.native.js.map +1 -1
  222. package/build-module/components/editor-help/intro-to-blocks.native.js +1 -1
  223. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  224. package/build-module/components/editor-notices/index.js +1 -0
  225. package/build-module/components/editor-notices/index.js.map +1 -1
  226. package/build-module/components/editor-snackbars/index.js +1 -0
  227. package/build-module/components/editor-snackbars/index.js.map +1 -1
  228. package/build-module/components/entities-saved-states/entity-type-list.js +1 -0
  229. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  230. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +1 -0
  231. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  232. package/build-module/components/entities-saved-states/index.js +3 -1
  233. package/build-module/components/entities-saved-states/index.js.map +1 -1
  234. package/build-module/components/error-boundary/index.js +28 -15
  235. package/build-module/components/error-boundary/index.js.map +1 -1
  236. package/build-module/components/error-boundary/index.native.js +2 -2
  237. package/build-module/components/error-boundary/index.native.js.map +1 -1
  238. package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -0
  239. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  240. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
  241. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  242. package/build-module/components/list-view-sidebar/index.js +1 -0
  243. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  244. package/build-module/components/local-autosave-monitor/index.js +1 -0
  245. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  246. package/build-module/components/mode-switcher/index.js +1 -0
  247. package/build-module/components/mode-switcher/index.js.map +1 -1
  248. package/build-module/components/more-menu/index.js +0 -1
  249. package/build-module/components/more-menu/index.js.map +1 -1
  250. package/build-module/components/page-attributes/parent.js +1 -0
  251. package/build-module/components/page-attributes/parent.js.map +1 -1
  252. package/build-module/components/post-actions/actions.js +10 -4
  253. package/build-module/components/post-actions/actions.js.map +1 -1
  254. package/build-module/components/post-actions/index.js +81 -93
  255. package/build-module/components/post-actions/index.js.map +1 -1
  256. package/build-module/components/post-actions/set-as-homepage.js +22 -33
  257. package/build-module/components/post-actions/set-as-homepage.js.map +1 -1
  258. package/build-module/components/post-actions/set-as-posts-page.js +146 -0
  259. package/build-module/components/post-actions/set-as-posts-page.js.map +1 -0
  260. package/build-module/components/post-author/hook.js +1 -0
  261. package/build-module/components/post-author/hook.js.map +1 -1
  262. package/build-module/components/post-card-panel/index.js +66 -26
  263. package/build-module/components/post-card-panel/index.js.map +1 -1
  264. package/build-module/components/post-fields/index.js +1 -0
  265. package/build-module/components/post-fields/index.js.map +1 -1
  266. package/build-module/components/post-format/index.js +1 -0
  267. package/build-module/components/post-format/index.js.map +1 -1
  268. package/build-module/components/post-format/panel.js +1 -0
  269. package/build-module/components/post-format/panel.js.map +1 -1
  270. package/build-module/components/post-publish-button/index.js +1 -0
  271. package/build-module/components/post-publish-button/index.js.map +1 -1
  272. package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -0
  273. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  274. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  275. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  276. package/build-module/components/post-publish-panel/maybe-upload-media.js +3 -2
  277. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  278. package/build-module/components/post-publish-panel/media-util.js +1 -0
  279. package/build-module/components/post-publish-panel/media-util.js.map +1 -1
  280. package/build-module/components/post-publish-panel/prepublish.js +1 -1
  281. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  282. package/build-module/components/post-saved-state/index.js +1 -0
  283. package/build-module/components/post-saved-state/index.js.map +1 -1
  284. package/build-module/components/post-schedule/index.js +1 -0
  285. package/build-module/components/post-schedule/index.js.map +1 -1
  286. package/build-module/components/post-taxonomies/flat-term-selector.js +1 -0
  287. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  288. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +1 -0
  289. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  290. package/build-module/components/post-taxonomies/index.js +1 -0
  291. package/build-module/components/post-taxonomies/index.js.map +1 -1
  292. package/build-module/components/post-taxonomies/most-used-terms.js +1 -0
  293. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  294. package/build-module/components/post-template/classic-theme.js +1 -0
  295. package/build-module/components/post-template/classic-theme.js.map +1 -1
  296. package/build-module/components/post-template/swap-template-button.js +1 -0
  297. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  298. package/build-module/components/post-transform-panel/hooks.js +1 -0
  299. package/build-module/components/post-transform-panel/hooks.js.map +1 -1
  300. package/build-module/components/post-type-support-check/index.js +1 -0
  301. package/build-module/components/post-type-support-check/index.js.map +1 -1
  302. package/build-module/components/preferences-modal/block-visibility.js +1 -0
  303. package/build-module/components/preferences-modal/block-visibility.js.map +1 -1
  304. package/build-module/components/preferences-modal/index.js +3 -4
  305. package/build-module/components/preferences-modal/index.js.map +1 -1
  306. package/build-module/components/preview-dropdown/index.js +0 -1
  307. package/build-module/components/preview-dropdown/index.js.map +1 -1
  308. package/build-module/components/provider/disable-non-page-content-blocks.js +66 -13
  309. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  310. package/build-module/components/provider/index.js +10 -14
  311. package/build-module/components/provider/index.js.map +1 -1
  312. package/build-module/components/provider/index.native.js +1 -0
  313. package/build-module/components/provider/index.native.js.map +1 -1
  314. package/build-module/components/provider/use-block-editor-settings.js +4 -1
  315. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  316. package/build-module/components/sidebar/index.js +1 -0
  317. package/build-module/components/sidebar/index.js.map +1 -1
  318. package/build-module/components/start-page-options/index.js +21 -106
  319. package/build-module/components/start-page-options/index.js.map +1 -1
  320. package/build-module/components/start-template-options/index.js +1 -0
  321. package/build-module/components/start-template-options/index.js.map +1 -1
  322. package/build-module/components/template-part-content-panel/index.js +1 -0
  323. package/build-module/components/template-part-content-panel/index.js.map +1 -1
  324. package/build-module/components/template-part-menu-items/index.js +2 -10
  325. package/build-module/components/template-part-menu-items/index.js.map +1 -1
  326. package/build-module/components/theme-support-check/index.js +1 -0
  327. package/build-module/components/theme-support-check/index.js.map +1 -1
  328. package/build-module/components/visual-editor/use-select-nearest-editable-block.js +1 -0
  329. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  330. package/build-module/dataviews/store/private-actions.js +16 -2
  331. package/build-module/dataviews/store/private-actions.js.map +1 -1
  332. package/build-module/dataviews/store/reducer.js +1 -0
  333. package/build-module/dataviews/store/reducer.js.map +1 -1
  334. package/build-module/hooks/custom-sources-backwards-compatibility.js +1 -0
  335. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  336. package/build-module/hooks/pattern-overrides.js +1 -0
  337. package/build-module/hooks/pattern-overrides.js.map +1 -1
  338. package/build-module/store/actions.js +1 -2
  339. package/build-module/store/actions.js.map +1 -1
  340. package/build-module/store/constants.js +0 -2
  341. package/build-module/store/constants.js.map +1 -1
  342. package/build-module/store/private-actions.js +2 -1
  343. package/build-module/store/private-actions.js.map +1 -1
  344. package/build-module/store/private-selectors.js +1 -0
  345. package/build-module/store/private-selectors.js.map +1 -1
  346. package/build-module/store/reducer.js +1 -0
  347. package/build-module/store/reducer.js.map +1 -1
  348. package/build-module/store/reducer.native.js +1 -0
  349. package/build-module/store/reducer.native.js.map +1 -1
  350. package/build-module/store/selectors.js +1 -0
  351. package/build-module/store/selectors.js.map +1 -1
  352. package/build-module/store/utils/notice-builder.js +3 -8
  353. package/build-module/store/utils/notice-builder.js.map +1 -1
  354. package/build-module/utils/get-item-title.js +26 -0
  355. package/build-module/utils/get-item-title.js.map +1 -0
  356. package/build-module/utils/get-template-info.js +1 -0
  357. package/build-module/utils/get-template-info.js.map +1 -1
  358. package/build-module/utils/media-sideload/index.js +14 -0
  359. package/build-module/utils/media-sideload/index.js.map +1 -0
  360. package/build-module/utils/media-sideload/index.native.js +2 -0
  361. package/build-module/utils/media-sideload/index.native.js.map +1 -0
  362. package/build-module/utils/media-upload/index.js +5 -2
  363. package/build-module/utils/media-upload/index.js.map +1 -1
  364. package/build-module/utils/pageTypeBadge.js +6 -12
  365. package/build-module/utils/pageTypeBadge.js.map +1 -1
  366. package/build-module/utils/terms.js +1 -0
  367. package/build-module/utils/terms.js.map +1 -1
  368. package/build-style/style-rtl.css +26 -27
  369. package/build-style/style.css +26 -27
  370. package/build-types/components/autocompleters/user.d.ts +7 -1
  371. package/build-types/components/autocompleters/user.d.ts.map +1 -1
  372. package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -1
  373. package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -1
  374. package/build-types/components/collab-sidebar/comments.d.ts +11 -7
  375. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  376. package/build-types/components/collab-sidebar/constants.d.ts.map +1 -1
  377. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  378. package/build-types/components/commands/index.d.ts.map +1 -1
  379. package/build-types/components/document-bar/index.d.ts.map +1 -1
  380. package/build-types/components/document-tools/index.d.ts.map +1 -1
  381. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  382. package/build-types/components/error-boundary/index.d.ts.map +1 -1
  383. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +1 -1
  384. package/build-types/components/media-categories/index.d.ts.map +1 -1
  385. package/build-types/components/more-menu/index.d.ts.map +1 -1
  386. package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -1
  387. package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -1
  388. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  389. package/build-types/components/post-actions/index.d.ts +5 -0
  390. package/build-types/components/post-actions/index.d.ts.map +1 -1
  391. package/build-types/components/post-actions/set-as-homepage.d.ts.map +1 -1
  392. package/build-types/components/post-actions/set-as-posts-page.d.ts +10 -0
  393. package/build-types/components/post-actions/set-as-posts-page.d.ts.map +1 -0
  394. package/build-types/components/post-card-panel/index.d.ts +13 -4
  395. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  396. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +4 -4
  397. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  398. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +4 -4
  399. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  400. package/build-types/components/post-title/constants.d.ts.map +1 -1
  401. package/build-types/components/preferences-modal/index.d.ts.map +1 -1
  402. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  403. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
  404. package/build-types/components/provider/index.d.ts.map +1 -1
  405. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  406. package/build-types/components/start-page-options/index.d.ts +1 -2
  407. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  408. package/build-types/dataviews/api.d.ts.map +1 -1
  409. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  410. package/build-types/dataviews/store/reducer.d.ts +1 -1
  411. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
  412. package/build-types/hooks/pattern-overrides.d.ts.map +1 -1
  413. package/build-types/store/actions.d.ts +7 -9
  414. package/build-types/store/actions.d.ts.map +1 -1
  415. package/build-types/store/constants.d.ts +0 -2
  416. package/build-types/store/constants.d.ts.map +1 -1
  417. package/build-types/store/private-actions.d.ts +1 -1
  418. package/build-types/store/private-actions.d.ts.map +1 -1
  419. package/build-types/store/private-selectors.d.ts +20 -4
  420. package/build-types/store/private-selectors.d.ts.map +1 -1
  421. package/build-types/store/reducer.d.ts +1 -1
  422. package/build-types/store/selectors.d.ts +376 -76
  423. package/build-types/store/selectors.d.ts.map +1 -1
  424. package/build-types/store/utils/notice-builder.d.ts.map +1 -1
  425. package/build-types/utils/get-item-title.d.ts +10 -0
  426. package/build-types/utils/get-item-title.d.ts.map +1 -0
  427. package/build-types/utils/media-sideload/index.d.ts +3 -0
  428. package/build-types/utils/media-sideload/index.d.ts.map +1 -0
  429. package/build-types/utils/media-upload/index.d.ts +3 -1
  430. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  431. package/build-types/utils/pageTypeBadge.d.ts +3 -1
  432. package/build-types/utils/pageTypeBadge.d.ts.map +1 -1
  433. package/package.json +37 -37
  434. package/src/components/collab-sidebar/add-comment.js +1 -1
  435. package/src/components/collab-sidebar/comment-button.js +12 -7
  436. package/src/components/collab-sidebar/comment-form.js +4 -1
  437. package/src/components/collab-sidebar/comments.js +260 -243
  438. package/src/components/collab-sidebar/index.js +10 -2
  439. package/src/components/collab-sidebar/style.scss +10 -1
  440. package/src/components/commands/index.js +29 -0
  441. package/src/components/document-bar/index.js +5 -2
  442. package/src/components/document-tools/index.js +3 -6
  443. package/src/components/document-tools/style.scss +0 -6
  444. package/src/components/editor-help/intro-to-blocks.native.js +1 -1
  445. package/src/components/entities-saved-states/index.js +5 -1
  446. package/src/components/error-boundary/index.js +30 -16
  447. package/src/components/error-boundary/index.native.js +2 -2
  448. package/src/components/error-boundary/style.scss +5 -1
  449. package/src/components/more-menu/index.js +0 -1
  450. package/src/components/post-actions/actions.js +12 -4
  451. package/src/components/post-actions/index.js +90 -94
  452. package/src/components/post-actions/set-as-homepage.js +29 -45
  453. package/src/components/post-actions/set-as-posts-page.js +164 -0
  454. package/src/components/post-card-panel/index.js +71 -33
  455. package/src/components/post-card-panel/style.scss +8 -12
  456. package/src/components/post-publish-panel/maybe-upload-media.js +2 -2
  457. package/src/components/post-publish-panel/prepublish.js +1 -1
  458. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  459. package/src/components/preferences-modal/index.js +8 -13
  460. package/src/components/preview-dropdown/index.js +0 -1
  461. package/src/components/provider/disable-non-page-content-blocks.js +64 -13
  462. package/src/components/provider/index.js +13 -27
  463. package/src/components/provider/use-block-editor-settings.js +3 -0
  464. package/src/components/start-page-options/index.js +28 -119
  465. package/src/components/template-part-menu-items/index.js +2 -11
  466. package/src/dataviews/store/private-actions.ts +23 -8
  467. package/src/store/actions.js +0 -2
  468. package/src/store/constants.ts +0 -2
  469. package/src/store/private-actions.js +1 -1
  470. package/src/store/utils/notice-builder.js +3 -8
  471. package/src/store/utils/test/notice-builder.js +3 -4
  472. package/src/utils/get-item-title.js +25 -0
  473. package/src/utils/media-sideload/index.js +13 -0
  474. package/src/utils/media-sideload/index.native.js +1 -0
  475. package/src/utils/media-upload/index.js +4 -1
  476. package/src/utils/pageTypeBadge.js +7 -10
  477. package/tsconfig.json +1 -4
  478. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["BlockSettingsMenuControls","MenuItem","compose","jsx","_jsx","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","children","onClose","undefined"],"sources":["@wordpress/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/editor';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {React.ReactNode} The rendered component.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,yBAAyB,QAAQ,yBAAyB;AACnE,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,OAAO,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7C,MAAMC,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,OAAO,KACtDD,QAAQ,CAACE,MAAM,CAAIC,EAAE,IAAM,CAAEF,OAAO,CAACG,QAAQ,CAAED,EAAG,CAAE,CAAC,CAACE,MAAM,KAAK,CAAC;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAEC,cAAc,EAAEC,aAAa,KACvD,CAAEC,KAAK,CAACC,OAAO,CAAEF,aAAc,CAAC,IAChCT,2BAA2B,CAAEQ,cAAc,EAAEC,aAAc,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,2BAA2B,GAAGA,CAAE;EACrCH,aAAa;EACbI,IAAI;EACJC,KAAK;EACLC,OAAO;EACPC,KAAK;EACLC;AACD,CAAC,kBACAlB,IAAA,CAACJ,yBAAyB;EAAAuB,QAAA,EACvBA,CAAE;IAAEV,cAAc;IAAEW;EAAQ,CAAC,KAAM;IACpC,IAAK,CAAEZ,gBAAgB,CAAEC,cAAc,EAAEC,aAAc,CAAC,EAAG;MAC1D,OAAO,IAAI;IACZ;IACA,oBACCV,IAAA,CAACH,QAAQ;MACRmB,OAAO,EAAGlB,OAAO,CAAEkB,OAAO,EAAEI,OAAQ,CAAG;MACvCN,IAAI,EAAGA,IAAM;MACbC,KAAK,EAAGE,KAAK,GAAGF,KAAK,GAAGM,SAAW;MACnCH,IAAI,EAAGA,IAAM;MAAAC,QAAA,EAEX,CAAEF,KAAK,IAAIF;IAAK,CACT,CAAC;EAEb;AAAC,CACyB,CAC3B;AAED,eAAeF,2BAA2B","ignoreList":[]}
1
+ {"version":3,"names":["BlockSettingsMenuControls","MenuItem","compose","jsx","_jsx","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","children","onClose","undefined"],"sources":["@wordpress/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/editor';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {React.ReactNode} The rendered component.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,yBAAyB,QAAQ,yBAAyB;AACnE,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,OAAO,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7C,MAAMC,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,OAAO,KACtDD,QAAQ,CAACE,MAAM,CAAIC,EAAE,IAAM,CAAEF,OAAO,CAACG,QAAQ,CAAED,EAAG,CAAE,CAAC,CAACE,MAAM,KAAK,CAAC;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAEC,cAAc,EAAEC,aAAa,KACvD,CAAEC,KAAK,CAACC,OAAO,CAAEF,aAAc,CAAC,IAChCT,2BAA2B,CAAEQ,cAAc,EAAEC,aAAc,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,2BAA2B,GAAGA,CAAE;EACrCH,aAAa;EACbI,IAAI;EACJC,KAAK;EACLC,OAAO;EACPC,KAAK;EACLC;AACD,CAAC,kBACAlB,IAAA,CAACJ,yBAAyB;EAAAuB,QAAA,EACvBA,CAAE;IAAEV,cAAc;IAAEW;EAAQ,CAAC,KAAM;IACpC,IAAK,CAAEZ,gBAAgB,CAAEC,cAAc,EAAEC,aAAc,CAAC,EAAG;MAC1D,OAAO,IAAI;IACZ;IACA,oBACCV,IAAA,CAACH,QAAQ;MACRmB,OAAO,EAAGlB,OAAO,CAAEkB,OAAO,EAAEI,OAAQ,CAAG;MACvCN,IAAI,EAAGA,IAAM;MACbC,KAAK,EAAGE,KAAK,GAAGF,KAAK,GAAGM,SAAW;MACnCH,IAAI,EAAGA,IAAM;MAAAC,QAAA,EAEX,CAAEF,KAAK,IAAIF;IAAK,CACT,CAAC;EAEb;AAAC,CACyB,CAC3B;AAED,eAAeF,2BAA2B","ignoreList":[]}
@@ -45,7 +45,7 @@ export function AddComment({
45
45
  }
46
46
  return /*#__PURE__*/_jsxs(VStack, {
47
47
  spacing: "3",
48
- className: "editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread",
48
+ className: "editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread",
49
49
  children: [/*#__PURE__*/_jsx(HStack, {
50
50
  alignment: "left",
51
51
  spacing: "3",
@@ -1 +1 @@
1
- {"version":3,"names":["_x","useSelect","__experimentalHStack","HStack","__experimentalVStack","VStack","store","blockEditorStore","CommentAuthorInfo","CommentForm","jsx","_jsx","jsxs","_jsxs","AddComment","onSubmit","showCommentBoard","setShowCommentBoard","clientId","blockCommentId","select","getSelectedBlock","selectedBlock","attributes","undefined","spacing","className","children","alignment","inputComment","onCancel","submitButtonText"],"sources":["@wordpress/editor/src/components/collab-sidebar/add-comment.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\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 UI for adding a comment in the Gutenberg editor's collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - A callback function to be called when the user submits a comment.\n * @param {boolean} props.showCommentBoard - The function to edit the comment.\n * @param {Function} props.setShowCommentBoard - The function to delete the comment.\n * @return {React.ReactNode} The rendered comment input UI.\n */\nexport function AddComment( {\n\tonSubmit,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n} ) {\n\tconst { clientId, blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock } = select( blockEditorStore );\n\t\tconst selectedBlock = getSelectedBlock();\n\t\treturn {\n\t\t\tclientId: selectedBlock?.clientId,\n\t\t\tblockCommentId: selectedBlock?.attributes?.blockCommentId,\n\t\t};\n\t} );\n\n\tif ( ! showCommentBoard || ! clientId || undefined !== blockCommentId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing=\"3\"\n\t\t\tclassName=\"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread\"\n\t\t>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\">\n\t\t\t\t<CommentAuthorInfo />\n\t\t\t</HStack>\n\t\t\t<CommentForm\n\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t} }\n\t\t\t\tonCancel={ () => {\n\t\t\t\t\tsetShowCommentBoard( false );\n\t\t\t\t} }\n\t\t\t\tsubmitButtonText={ _x( 'Comment', 'Add comment button' ) }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,WAAW,MAAM,gBAAgB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASA,OAAO,SAASC,UAAUA,CAAE;EAC3BC,QAAQ;EACRC,gBAAgB;EAChBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,QAAQ;IAAEC;EAAe,CAAC,GAAGlB,SAAS,CAAImB,MAAM,IAAM;IAC7D,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM,CAAEb,gBAAiB,CAAC;IACvD,MAAMe,aAAa,GAAGD,gBAAgB,CAAC,CAAC;IACxC,OAAO;MACNH,QAAQ,EAAEI,aAAa,EAAEJ,QAAQ;MACjCC,cAAc,EAAEG,aAAa,EAAEC,UAAU,EAAEJ;IAC5C,CAAC;EACF,CAAE,CAAC;EAEH,IAAK,CAAEH,gBAAgB,IAAI,CAAEE,QAAQ,IAAIM,SAAS,KAAKL,cAAc,EAAG;IACvE,OAAO,IAAI;EACZ;EAEA,oBACCN,KAAA,CAACR,MAAM;IACNoB,OAAO,EAAC,GAAG;IACXC,SAAS,EAAC,gFAAgF;IAAAC,QAAA,gBAE1FhB,IAAA,CAACR,MAAM;MAACyB,SAAS,EAAC,MAAM;MAACH,OAAO,EAAC,GAAG;MAAAE,QAAA,eACnChB,IAAA,CAACH,iBAAiB,IAAE;IAAC,CACd,CAAC,eACTG,IAAA,CAACF,WAAW;MACXM,QAAQ,EAAKc,YAAY,IAAM;QAC9Bd,QAAQ,CAAEc,YAAa,CAAC;MACzB,CAAG;MACHC,QAAQ,EAAGA,CAAA,KAAM;QAChBb,mBAAmB,CAAE,KAAM,CAAC;MAC7B,CAAG;MACHc,gBAAgB,EAAG/B,EAAE,CAAE,SAAS,EAAE,oBAAqB;IAAG,CAC1D,CAAC;EAAA,CACK,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_x","useSelect","__experimentalHStack","HStack","__experimentalVStack","VStack","store","blockEditorStore","CommentAuthorInfo","CommentForm","jsx","_jsx","jsxs","_jsxs","AddComment","onSubmit","showCommentBoard","setShowCommentBoard","clientId","blockCommentId","select","getSelectedBlock","selectedBlock","attributes","undefined","spacing","className","children","alignment","inputComment","onCancel","submitButtonText"],"sources":["@wordpress/editor/src/components/collab-sidebar/add-comment.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\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 UI for adding a comment in the Gutenberg editor's collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - A callback function to be called when the user submits a comment.\n * @param {boolean} props.showCommentBoard - The function to edit the comment.\n * @param {Function} props.setShowCommentBoard - The function to delete the comment.\n * @return {React.ReactNode} The rendered comment input UI.\n */\nexport function AddComment( {\n\tonSubmit,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n} ) {\n\tconst { clientId, blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock } = select( blockEditorStore );\n\t\tconst selectedBlock = getSelectedBlock();\n\t\treturn {\n\t\t\tclientId: selectedBlock?.clientId,\n\t\t\tblockCommentId: selectedBlock?.attributes?.blockCommentId,\n\t\t};\n\t} );\n\n\tif ( ! showCommentBoard || ! clientId || undefined !== blockCommentId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing=\"3\"\n\t\t\tclassName=\"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread\"\n\t\t>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\">\n\t\t\t\t<CommentAuthorInfo />\n\t\t\t</HStack>\n\t\t\t<CommentForm\n\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t} }\n\t\t\t\tonCancel={ () => {\n\t\t\t\t\tsetShowCommentBoard( false );\n\t\t\t\t} }\n\t\t\t\tsubmitButtonText={ _x( 'Comment', 'Add comment button' ) }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,WAAW,MAAM,gBAAgB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASA,OAAO,SAASC,UAAUA,CAAE;EAC3BC,QAAQ;EACRC,gBAAgB;EAChBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,QAAQ;IAAEC;EAAe,CAAC,GAAGlB,SAAS,CAAImB,MAAM,IAAM;IAC7D,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM,CAAEb,gBAAiB,CAAC;IACvD,MAAMe,aAAa,GAAGD,gBAAgB,CAAC,CAAC;IACxC,OAAO;MACNH,QAAQ,EAAEI,aAAa,EAAEJ,QAAQ;MACjCC,cAAc,EAAEG,aAAa,EAAEC,UAAU,EAAEJ;IAC5C,CAAC;EACF,CAAE,CAAC;EAEH,IAAK,CAAEH,gBAAgB,IAAI,CAAEE,QAAQ,IAAIM,SAAS,KAAKL,cAAc,EAAG;IACvE,OAAO,IAAI;EACZ;EAEA,oBACCN,KAAA,CAACR,MAAM;IACNoB,OAAO,EAAC,GAAG;IACXC,SAAS,EAAC,0HAA0H;IAAAC,QAAA,gBAEpIhB,IAAA,CAACR,MAAM;MAACyB,SAAS,EAAC,MAAM;MAACH,OAAO,EAAC,GAAG;MAAAE,QAAA,eACnChB,IAAA,CAACH,iBAAiB,IAAE;IAAC,CACd,CAAC,eACTG,IAAA,CAACF,WAAW;MACXM,QAAQ,EAAKc,YAAY,IAAM;QAC9Bd,QAAQ,CAAEc,YAAa,CAAC;MACzB,CAAG;MACHC,QAAQ,EAAGA,CAAA,KAAM;QAChBb,mBAAmB,CAAE,KAAM,CAAC;MAC7B,CAAG;MACHc,gBAAgB,EAAG/B,EAAE,CAAE,SAAS,EAAE,oBAAqB;IAAG,CAC1D,CAAC;EAAA,CACK,CAAC;AAEX","ignoreList":[]}
@@ -18,9 +18,14 @@ const AddCommentButton = ({
18
18
  onClick
19
19
  }) => {
20
20
  return /*#__PURE__*/_jsx(CommentIconSlotFill.Fill, {
21
- children: /*#__PURE__*/_jsx(MenuItem, {
21
+ children: ({
22
+ onClose
23
+ }) => /*#__PURE__*/_jsx(MenuItem, {
22
24
  icon: commentIcon,
23
- onClick: onClick,
25
+ onClick: () => {
26
+ onClick();
27
+ onClose();
28
+ },
24
29
  "aria-haspopup": "dialog",
25
30
  children: _x('Comment', 'Add comment button')
26
31
  })
@@ -1 +1 @@
1
- {"version":3,"names":["MenuItem","_x","comment","commentIcon","privateApis","blockEditorPrivateApis","unlock","jsx","_jsx","CommentIconSlotFill","AddCommentButton","onClick","Fill","children","icon"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { comment as commentIcon } from '@wordpress/icons';\n\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { CommentIconSlotFill } = unlock( blockEditorPrivateApis );\n\nconst AddCommentButton = ( { onClick } ) => {\n\treturn (\n\t\t<CommentIconSlotFill.Fill>\n\t\t\t<MenuItem\n\t\t\t\ticon={ commentIcon }\n\t\t\t\tonClick={ onClick }\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t>\n\t\t\t\t{ _x( 'Comment', 'Add comment button' ) }\n\t\t\t</MenuItem>\n\t\t</CommentIconSlotFill.Fill>\n\t);\n};\n\nexport default AddCommentButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,IAAIC,WAAW,QAAQ,kBAAkB;AAEzD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAoB,CAAC,GAAGH,MAAM,CAAED,sBAAuB,CAAC;AAEhE,MAAMK,gBAAgB,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAC3C,oBACCH,IAAA,CAACC,mBAAmB,CAACG,IAAI;IAAAC,QAAA,eACxBL,IAAA,CAACR,QAAQ;MACRc,IAAI,EAAGX,WAAa;MACpBQ,OAAO,EAAGA,OAAS;MACnB,iBAAc,QAAQ;MAAAE,QAAA,EAEpBZ,EAAE,CAAE,SAAS,EAAE,oBAAqB;IAAC,CAC9B;EAAC,CACc,CAAC;AAE7B,CAAC;AAED,eAAeS,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["MenuItem","_x","comment","commentIcon","privateApis","blockEditorPrivateApis","unlock","jsx","_jsx","CommentIconSlotFill","AddCommentButton","onClick","Fill","children","onClose","icon"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { comment as commentIcon } from '@wordpress/icons';\n\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { CommentIconSlotFill } = unlock( blockEditorPrivateApis );\n\nconst AddCommentButton = ( { onClick } ) => {\n\treturn (\n\t\t<CommentIconSlotFill.Fill>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<MenuItem\n\t\t\t\t\ticon={ commentIcon }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonClick();\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t>\n\t\t\t\t\t{ _x( 'Comment', 'Add comment button' ) }\n\t\t\t\t</MenuItem>\n\t\t\t) }\n\t\t</CommentIconSlotFill.Fill>\n\t);\n};\n\nexport default AddCommentButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,IAAIC,WAAW,QAAQ,kBAAkB;AAEzD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAoB,CAAC,GAAGH,MAAM,CAAED,sBAAuB,CAAC;AAEhE,MAAMK,gBAAgB,GAAGA,CAAE;EAAEC;AAAQ,CAAC,KAAM;EAC3C,oBACCH,IAAA,CAACC,mBAAmB,CAACG,IAAI;IAAAC,QAAA,EACtBA,CAAE;MAAEC;IAAQ,CAAC,kBACdN,IAAA,CAACR,QAAQ;MACRe,IAAI,EAAGZ,WAAa;MACpBQ,OAAO,EAAGA,CAAA,KAAM;QACfA,OAAO,CAAC,CAAC;QACTG,OAAO,CAAC,CAAC;MACV,CAAG;MACH,iBAAc,QAAQ;MAAAD,QAAA,EAEpBZ,EAAE,CAAE,SAAS,EAAE,oBAAqB;IAAC,CAC9B;EACV,CACwB,CAAC;AAE7B,CAAC;AAED,eAAeS,gBAAgB","ignoreList":[]}
@@ -43,7 +43,10 @@ function CommentForm({
43
43
  __next40pxDefaultSize: true,
44
44
  accessibleWhenDisabled: true,
45
45
  variant: "primary",
46
- onClick: () => onSubmit(inputComment),
46
+ onClick: () => {
47
+ onSubmit(inputComment);
48
+ setInputComment('');
49
+ },
47
50
  disabled: 0 === sanitizeCommentString(inputComment).length,
48
51
  text: submitButtonText
49
52
  }), /*#__PURE__*/_jsx(Button, {
@@ -1 +1 @@
1
- {"version":3,"names":["useState","__experimentalHStack","HStack","Button","TextareaControl","_x","sanitizeCommentString","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CommentForm","onSubmit","onCancel","thread","submitButtonText","_thread$content$raw","inputComment","setInputComment","content","raw","children","__next40pxDefaultSize","__nextHasNoMarginBottom","value","onChange","alignment","spacing","justify","accessibleWhenDisabled","variant","onClick","disabled","length","text"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-form.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\tButton,\n\tTextareaControl,\n} from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeCommentString } from './utils';\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 * @param {string} props.submitButtonText - The text to display on the submit button.\n * @return {React.ReactNode} The CommentForm component.\n */\nfunction CommentForm( { onSubmit, onCancel, thread, submitButtonText } ) {\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__next40pxDefaultSize\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<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ () => onSubmit( inputComment ) }\n\t\t\t\t\tdisabled={\n\t\t\t\t\t\t0 === sanitizeCommentString( inputComment ).length\n\t\t\t\t\t}\n\t\t\t\t\ttext={ submitButtonText }\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t\ttext={ _x( 'Cancel', 'Cancel comment button' ) }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</>\n\t);\n}\n\nexport default CommentForm;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,eAAe,QACT,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,qBAAqB,QAAQ,SAAS;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAUA,SAASC,WAAWA,CAAE;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAiB,CAAC,EAAG;EAAA,IAAAC,mBAAA;EACxE,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAGpB,QAAQ,EAAAkB,mBAAA,GACjDF,MAAM,EAAEK,OAAO,EAAEC,GAAG,cAAAJ,mBAAA,cAAAA,mBAAA,GAAI,EACzB,CAAC;EAED,oBACCR,KAAA,CAAAE,SAAA;IAAAW,QAAA,gBACCf,IAAA,CAACJ,eAAe;MACfoB,qBAAqB;MACrBC,uBAAuB;MACvBC,KAAK,EAAGP,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,EAAI;MAC5BQ,QAAQ,EAAGP;IAAiB,CAC5B,CAAC,eACFV,KAAA,CAACR,MAAM;MAAC0B,SAAS,EAAC,MAAM;MAACC,OAAO,EAAC,GAAG;MAACC,OAAO,EAAC,YAAY;MAAAP,QAAA,gBACxDf,IAAA,CAACL,MAAM;QACNqB,qBAAqB;QACrBO,sBAAsB;QACtBC,OAAO,EAAC,SAAS;QACjBC,OAAO,EAAGA,CAAA,KAAMnB,QAAQ,CAAEK,YAAa,CAAG;QAC1Ce,QAAQ,EACP,CAAC,KAAK5B,qBAAqB,CAAEa,YAAa,CAAC,CAACgB,MAC5C;QACDC,IAAI,EAAGnB;MAAkB,CACzB,CAAC,eACFT,IAAA,CAACL,MAAM;QACNqB,qBAAqB;QACrBQ,OAAO,EAAC,UAAU;QAClBC,OAAO,EAAGlB,QAAU;QACpBqB,IAAI,EAAG/B,EAAE,CAAE,QAAQ,EAAE,uBAAwB;MAAG,CAChD,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAEA,eAAeQ,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["useState","__experimentalHStack","HStack","Button","TextareaControl","_x","sanitizeCommentString","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CommentForm","onSubmit","onCancel","thread","submitButtonText","_thread$content$raw","inputComment","setInputComment","content","raw","children","__next40pxDefaultSize","__nextHasNoMarginBottom","value","onChange","alignment","spacing","justify","accessibleWhenDisabled","variant","onClick","disabled","length","text"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-form.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\tButton,\n\tTextareaControl,\n} from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeCommentString } from './utils';\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 * @param {string} props.submitButtonText - The text to display on the submit button.\n * @return {React.ReactNode} The CommentForm component.\n */\nfunction CommentForm( { onSubmit, onCancel, thread, submitButtonText } ) {\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__next40pxDefaultSize\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<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t\t\tsetInputComment( '' );\n\t\t\t\t\t} }\n\t\t\t\t\tdisabled={\n\t\t\t\t\t\t0 === sanitizeCommentString( inputComment ).length\n\t\t\t\t\t}\n\t\t\t\t\ttext={ submitButtonText }\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t\ttext={ _x( 'Cancel', 'Cancel comment button' ) }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</>\n\t);\n}\n\nexport default CommentForm;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,eAAe,QACT,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,qBAAqB,QAAQ,SAAS;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAUA,SAASC,WAAWA,CAAE;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAiB,CAAC,EAAG;EAAA,IAAAC,mBAAA;EACxE,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAGpB,QAAQ,EAAAkB,mBAAA,GACjDF,MAAM,EAAEK,OAAO,EAAEC,GAAG,cAAAJ,mBAAA,cAAAA,mBAAA,GAAI,EACzB,CAAC;EAED,oBACCR,KAAA,CAAAE,SAAA;IAAAW,QAAA,gBACCf,IAAA,CAACJ,eAAe;MACfoB,qBAAqB;MACrBC,uBAAuB;MACvBC,KAAK,EAAGP,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,EAAI;MAC5BQ,QAAQ,EAAGP;IAAiB,CAC5B,CAAC,eACFV,KAAA,CAACR,MAAM;MAAC0B,SAAS,EAAC,MAAM;MAACC,OAAO,EAAC,GAAG;MAACC,OAAO,EAAC,YAAY;MAAAP,QAAA,gBACxDf,IAAA,CAACL,MAAM;QACNqB,qBAAqB;QACrBO,sBAAsB;QACtBC,OAAO,EAAC,SAAS;QACjBC,OAAO,EAAGA,CAAA,KAAM;UACfnB,QAAQ,CAAEK,YAAa,CAAC;UACxBC,eAAe,CAAE,EAAG,CAAC;QACtB,CAAG;QACHc,QAAQ,EACP,CAAC,KAAK5B,qBAAqB,CAAEa,YAAa,CAAC,CAACgB,MAC5C;QACDC,IAAI,EAAGnB;MAAkB,CACzB,CAAC,eACFT,IAAA,CAACL,MAAM;QACNqB,qBAAqB;QACrBQ,OAAO,EAAC,UAAU;QAClBC,OAAO,EAAGlB,QAAU;QACpBqB,IAAI,EAAG/B,EAAE,CAAE,QAAQ,EAAE,uBAAwB;MAAG,CAChD,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAEA,eAAeQ,WAAW","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * External dependencies
3
4
  */
@@ -9,7 +10,7 @@ import clsx from 'clsx';
9
10
  import { useState, RawHTML } from '@wordpress/element';
10
11
  import { __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalConfirmDialog as ConfirmDialog, Button, DropdownMenu, Tooltip } from '@wordpress/components';
11
12
  import { Icon, check, published, moreVertical } from '@wordpress/icons';
12
- import { __, _x } from '@wordpress/i18n';
13
+ import { __, _x, sprintf } from '@wordpress/i18n';
13
14
  import { useSelect } from '@wordpress/data';
14
15
  import { store as blockEditorStore } from '@wordpress/block-editor';
15
16
 
@@ -22,115 +23,42 @@ import CommentForm from './comment-form';
22
23
  /**
23
24
  * Renders the Comments component.
24
25
  *
25
- * @param {Object} props - The component props.
26
- * @param {Array} props.threads - The array of comment threads.
27
- * @param {Function} props.onEditComment - The function to handle comment editing.
28
- * @param {Function} props.onAddReply - The function to add a reply to a comment.
29
- * @param {Function} props.onCommentDelete - The function to delete a comment.
30
- * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.
26
+ * @param {Object} props - The component props.
27
+ * @param {Array} props.threads - The array of comment threads.
28
+ * @param {Function} props.onEditComment - The function to handle comment editing.
29
+ * @param {Function} props.onAddReply - The function to add a reply to a comment.
30
+ * @param {Function} props.onCommentDelete - The function to delete a comment.
31
+ * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.
32
+ * @param {boolean} props.showCommentBoard - Whether to show the comment board.
33
+ * @param {Function} props.setShowCommentBoard - The function to set the comment board visibility.
31
34
  * @return {React.ReactNode} The rendered Comments component.
32
35
  */
33
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
36
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
34
37
  export function Comments({
35
38
  threads,
36
39
  onEditComment,
37
40
  onAddReply,
38
41
  onCommentDelete,
39
- onCommentResolve
42
+ onCommentResolve,
43
+ showCommentBoard,
44
+ setShowCommentBoard
40
45
  }) {
41
- const [actionState, setActionState] = useState(false);
42
- const [isConfirmDialogOpen, setIsConfirmDialogOpen] = useState(false);
43
- const handleConfirmDelete = () => {
44
- onCommentDelete(actionState.id);
45
- setActionState(false);
46
- setIsConfirmDialogOpen(false);
47
- };
48
- const handleConfirmResolve = () => {
49
- onCommentResolve(actionState.id);
50
- setActionState(false);
51
- setIsConfirmDialogOpen(false);
52
- };
53
- const handleCancelDelete = () => {
54
- setActionState(false);
55
- setIsConfirmDialogOpen(false);
56
- };
57
- const blockCommentId = useSelect(select => {
58
- var _select$getBlock$attr;
59
- const clientID = select(blockEditorStore).getSelectedBlockClientId();
60
- return (_select$getBlock$attr = select(blockEditorStore).getBlock(clientID)?.attributes?.blockCommentId) !== null && _select$getBlock$attr !== void 0 ? _select$getBlock$attr : false;
46
+ const {
47
+ blockCommentId
48
+ } = useSelect(select => {
49
+ const {
50
+ getBlockAttributes,
51
+ getSelectedBlockClientId
52
+ } = select(blockEditorStore);
53
+ const _clientId = getSelectedBlockClientId();
54
+ return {
55
+ blockCommentId: _clientId ? getBlockAttributes(_clientId)?.blockCommentId : null
56
+ };
61
57
  }, []);
62
- const CommentBoard = ({
63
- thread,
64
- parentThread
65
- }) => {
66
- var _parentThread$status;
67
- return /*#__PURE__*/_jsxs(_Fragment, {
68
- children: [/*#__PURE__*/_jsx(CommentHeader, {
69
- thread: thread,
70
- onResolve: () => {
71
- var _parentThread$id;
72
- setActionState({
73
- action: 'resolve',
74
- id: (_parentThread$id = parentThread?.id) !== null && _parentThread$id !== void 0 ? _parentThread$id : thread.id
75
- });
76
- setIsConfirmDialogOpen(true);
77
- },
78
- onEdit: () => setActionState({
79
- action: 'edit',
80
- id: thread.id
81
- }),
82
- onDelete: () => {
83
- setActionState({
84
- action: 'delete',
85
- id: thread.id
86
- });
87
- setIsConfirmDialogOpen(true);
88
- },
89
- onReply: !parentThread ? () => setActionState({
90
- action: 'reply',
91
- id: thread.id
92
- }) : undefined,
93
- status: (_parentThread$status = parentThread?.status) !== null && _parentThread$status !== void 0 ? _parentThread$status : thread.status
94
- }), /*#__PURE__*/_jsx(HStack, {
95
- alignment: "left",
96
- spacing: "3",
97
- justify: "flex-start",
98
- className: "editor-collab-sidebar-panel__user-comment",
99
- children: /*#__PURE__*/_jsxs(VStack, {
100
- spacing: "3",
101
- className: "editor-collab-sidebar-panel__comment-field",
102
- children: ['edit' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsx(CommentForm, {
103
- onSubmit: value => {
104
- onEditComment(thread.id, value);
105
- setActionState(false);
106
- },
107
- onCancel: () => setActionState(false),
108
- thread: thread,
109
- submitButtonText: _x('Update', 'verb')
110
- }), (!actionState || 'edit' !== actionState?.action) && /*#__PURE__*/_jsx(RawHTML, {
111
- children: thread?.content?.raw
112
- })]
113
- })
114
- }), 'resolve' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsx(ConfirmDialog, {
115
- isOpen: isConfirmDialogOpen,
116
- onConfirm: handleConfirmResolve,
117
- onCancel: handleCancelDelete,
118
- confirmButtonText: "Yes",
119
- cancelButtonText: "No",
120
- children:
121
- // translators: message displayed when confirming an action
122
- __('Are you sure you want to mark this comment as resolved?')
123
- }), 'delete' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsx(ConfirmDialog, {
124
- isOpen: isConfirmDialogOpen,
125
- onConfirm: handleConfirmDelete,
126
- onCancel: handleCancelDelete,
127
- confirmButtonText: "Yes",
128
- cancelButtonText: "No",
129
- children:
130
- // translators: message displayed when confirming an action
131
- __('Are you sure you want to delete this comment?')
132
- })]
133
- });
58
+ const [focusThread, setFocusThread] = useState(showCommentBoard && blockCommentId ? blockCommentId : null);
59
+ const clearThreadFocus = () => {
60
+ setFocusThread(null);
61
+ setShowCommentBoard(false);
134
62
  };
135
63
  return /*#__PURE__*/_jsxs(_Fragment, {
136
64
  children: [
@@ -143,114 +71,200 @@ export function Comments({
143
71
  children:
144
72
  // translators: message displayed when there are no comments available
145
73
  __('No comments available')
146
- }), Array.isArray(threads) && threads.length > 0 && threads.map(thread => /*#__PURE__*/_jsxs(VStack, {
74
+ }), Array.isArray(threads) && threads.length > 0 && threads.map(thread => /*#__PURE__*/_jsx(VStack, {
147
75
  className: clsx('editor-collab-sidebar-panel__thread', {
148
- 'editor-collab-sidebar-panel__active-thread': blockCommentId && blockCommentId === thread.id
76
+ 'editor-collab-sidebar-panel__active-thread': blockCommentId && blockCommentId === thread.id,
77
+ 'editor-collab-sidebar-panel__focus-thread': focusThread && focusThread === thread.id
149
78
  }),
150
79
  id: thread.id,
151
80
  spacing: "3",
152
- children: [/*#__PURE__*/_jsx(CommentBoard, {
153
- thread: thread
154
- }), 0 < thread?.reply?.length && thread.reply.map(reply => /*#__PURE__*/_jsx(VStack, {
81
+ onClick: () => setFocusThread(thread.id),
82
+ children: /*#__PURE__*/_jsx(Thread, {
83
+ thread: thread,
84
+ onAddReply: onAddReply,
85
+ onCommentDelete: onCommentDelete,
86
+ onCommentResolve: onCommentResolve,
87
+ onEditComment: onEditComment,
88
+ isFocused: focusThread === thread.id,
89
+ clearThreadFocus: clearThreadFocus
90
+ })
91
+ }, thread.id))]
92
+ });
93
+ }
94
+ function Thread({
95
+ thread,
96
+ onEditComment,
97
+ onAddReply,
98
+ onCommentDelete,
99
+ onCommentResolve,
100
+ isFocused,
101
+ clearThreadFocus
102
+ }) {
103
+ return /*#__PURE__*/_jsxs(_Fragment, {
104
+ children: [/*#__PURE__*/_jsx(CommentBoard, {
105
+ thread: thread,
106
+ onResolve: onCommentResolve,
107
+ onEdit: onEditComment,
108
+ onDelete: onCommentDelete,
109
+ status: thread.status
110
+ }), 0 < thread?.reply?.length && /*#__PURE__*/_jsxs(_Fragment, {
111
+ children: [!isFocused && /*#__PURE__*/_jsx(VStack, {
112
+ className: "editor-collab-sidebar-panel__show-more-reply",
113
+ children: sprintf(
114
+ // translators: 1: number of replies.
115
+ _x('%s more replies..', 'Show replies button'), thread?.reply?.length)
116
+ }), isFocused && thread.reply.map(reply => /*#__PURE__*/_jsxs(VStack, {
155
117
  className: "editor-collab-sidebar-panel__child-thread",
156
118
  id: reply.id,
157
119
  spacing: "2",
158
- children: /*#__PURE__*/_jsx(CommentBoard, {
120
+ children: ['approved' !== thread.status && /*#__PURE__*/_jsx(CommentBoard, {
159
121
  thread: reply,
160
- parentThread: thread
161
- })
162
- }, reply.id)), 'reply' === actionState?.action && thread.id === actionState?.id && /*#__PURE__*/_jsxs(VStack, {
163
- className: "editor-collab-sidebar-panel__child-thread",
164
- spacing: "2",
165
- children: [/*#__PURE__*/_jsx(HStack, {
166
- alignment: "left",
167
- spacing: "3",
168
- justify: "flex-start",
169
- children: /*#__PURE__*/_jsx(CommentAuthorInfo, {})
170
- }), /*#__PURE__*/_jsx(VStack, {
171
- spacing: "3",
172
- className: "editor-collab-sidebar-panel__comment-field",
173
- children: /*#__PURE__*/_jsx(CommentForm, {
174
- onSubmit: inputComment => {
175
- onAddReply(inputComment, thread.id);
176
- setActionState(false);
177
- },
178
- onCancel: () => setActionState(false),
179
- submitButtonText: _x('Reply', 'Add reply comment')
180
- })
122
+ onEdit: onEditComment,
123
+ onDelete: onCommentDelete
124
+ }), 'approved' === thread.status && /*#__PURE__*/_jsx(CommentBoard, {
125
+ thread: reply
181
126
  })]
127
+ }, reply.id))]
128
+ }), 'approved' !== thread.status && isFocused && /*#__PURE__*/_jsxs(VStack, {
129
+ className: "editor-collab-sidebar-panel__child-thread",
130
+ spacing: "2",
131
+ children: [/*#__PURE__*/_jsx(HStack, {
132
+ alignment: "left",
133
+ spacing: "3",
134
+ justify: "flex-start",
135
+ children: /*#__PURE__*/_jsx(CommentAuthorInfo, {})
136
+ }), /*#__PURE__*/_jsx(VStack, {
137
+ spacing: "3",
138
+ className: "editor-collab-sidebar-panel__comment-field",
139
+ children: /*#__PURE__*/_jsx(CommentForm, {
140
+ onSubmit: inputComment => {
141
+ onAddReply(inputComment, thread.id);
142
+ },
143
+ onCancel: event => {
144
+ event.stopPropagation(); // Prevent the parent onClick from being triggered
145
+ clearThreadFocus();
146
+ },
147
+ submitButtonText: _x('Reply', 'Add reply comment')
148
+ })
182
149
  })]
183
- }, thread.id))]
150
+ })]
184
151
  });
185
152
  }
186
-
187
- /**
188
- * Renders the header of a comment in the collaboration sidebar.
189
- *
190
- * @param {Object} props - The component props.
191
- * @param {Object} props.thread - The comment thread object.
192
- * @param {Function} props.onResolve - The function to resolve the comment.
193
- * @param {Function} props.onEdit - The function to edit the comment.
194
- * @param {Function} props.onDelete - The function to delete the comment.
195
- * @param {Function} props.onReply - The function to reply to the comment.
196
- * @param {string} props.status - The status of the comment.
197
- * @return {React.ReactNode} The rendered comment header.
198
- */
199
- function CommentHeader({
153
+ const CommentBoard = ({
200
154
  thread,
201
155
  onResolve,
202
156
  onEdit,
203
157
  onDelete,
204
- onReply,
205
158
  status
206
- }) {
207
- const actions = [{
159
+ }) => {
160
+ const [actionState, setActionState] = useState(false);
161
+ const [showConfirmDialog, setShowConfirmDialog] = useState(false);
162
+ const handleConfirmDelete = () => {
163
+ onDelete(thread.id);
164
+ setActionState(false);
165
+ setShowConfirmDialog(false);
166
+ };
167
+ const handleConfirmResolve = () => {
168
+ onResolve(thread.id);
169
+ setActionState(false);
170
+ setShowConfirmDialog(false);
171
+ };
172
+ const handleCancel = () => {
173
+ setActionState(false);
174
+ setShowConfirmDialog(false);
175
+ };
176
+ const actions = [onEdit && {
208
177
  title: _x('Edit', 'Edit comment'),
209
- onClick: onEdit
210
- }, {
178
+ onClick: () => {
179
+ setActionState('edit');
180
+ }
181
+ }, onDelete && {
211
182
  title: _x('Delete', 'Delete comment'),
212
- onClick: onDelete
213
- }, {
214
- title: _x('Reply', 'Reply on a comment'),
215
- onClick: onReply
183
+ onClick: () => {
184
+ setActionState('delete');
185
+ setShowConfirmDialog(true);
186
+ }
216
187
  }];
217
- const moreActions = actions.filter(item => item.onClick);
218
- return /*#__PURE__*/_jsxs(HStack, {
219
- alignment: "left",
220
- spacing: "3",
221
- justify: "flex-start",
222
- children: [/*#__PURE__*/_jsx(CommentAuthorInfo, {
223
- avatar: thread?.author_avatar_urls?.[48],
224
- name: thread?.author_name,
225
- date: thread?.date
226
- }), /*#__PURE__*/_jsxs("span", {
227
- className: "editor-collab-sidebar-panel__comment-status",
228
- children: [status !== 'approved' && /*#__PURE__*/_jsxs(HStack, {
229
- alignment: "right",
230
- justify: "flex-end",
231
- spacing: "0",
232
- children: [0 === thread?.parent && onResolve && /*#__PURE__*/_jsx(Button, {
233
- label: _x('Resolve', 'Mark comment as resolved'),
234
- __next40pxDefaultSize: true,
235
- icon: published,
236
- onClick: onResolve,
237
- showTooltip: true
238
- }), /*#__PURE__*/_jsx(DropdownMenu, {
239
- icon: moreVertical,
240
- label: _x('Select an action', 'Select comment action'),
241
- className: "editor-collab-sidebar-panel__comment-dropdown-menu",
242
- controls: moreActions
188
+ const moreActions = actions.filter(item => item?.onClick);
189
+ return /*#__PURE__*/_jsxs(_Fragment, {
190
+ children: [/*#__PURE__*/_jsxs(HStack, {
191
+ alignment: "left",
192
+ spacing: "3",
193
+ justify: "flex-start",
194
+ children: [/*#__PURE__*/_jsx(CommentAuthorInfo, {
195
+ avatar: thread?.author_avatar_urls?.[48],
196
+ name: thread?.author_name,
197
+ date: thread?.date
198
+ }), /*#__PURE__*/_jsxs("span", {
199
+ className: "editor-collab-sidebar-panel__comment-status",
200
+ children: [status !== 'approved' && /*#__PURE__*/_jsxs(HStack, {
201
+ alignment: "right",
202
+ justify: "flex-end",
203
+ spacing: "0",
204
+ children: [0 === thread?.parent && onResolve && /*#__PURE__*/_jsx(Button, {
205
+ label: _x('Resolve', 'Mark comment as resolved'),
206
+ __next40pxDefaultSize: true,
207
+ icon: published,
208
+ onClick: () => {
209
+ setActionState('resolve');
210
+ setShowConfirmDialog(true);
211
+ },
212
+ showTooltip: true
213
+ }), 0 < moreActions.length && /*#__PURE__*/_jsx(DropdownMenu, {
214
+ icon: moreVertical,
215
+ label: _x('Select an action', 'Select comment action'),
216
+ className: "editor-collab-sidebar-panel__comment-dropdown-menu",
217
+ controls: moreActions
218
+ })]
219
+ }), status === 'approved' &&
220
+ /*#__PURE__*/
221
+ // translators: tooltip for resolved comment
222
+ _jsx(Tooltip, {
223
+ text: __('Resolved'),
224
+ children: /*#__PURE__*/_jsx(Icon, {
225
+ icon: check
226
+ })
243
227
  })]
244
- }), status === 'approved' &&
245
- /*#__PURE__*/
246
- // translators: tooltip for resolved comment
247
- _jsx(Tooltip, {
248
- text: __('Resolved'),
249
- children: /*#__PURE__*/_jsx(Icon, {
250
- icon: check
251
- })
252
228
  })]
229
+ }), /*#__PURE__*/_jsx(HStack, {
230
+ alignment: "left",
231
+ spacing: "3",
232
+ justify: "flex-start",
233
+ className: "editor-collab-sidebar-panel__user-comment",
234
+ children: /*#__PURE__*/_jsxs(VStack, {
235
+ spacing: "3",
236
+ className: "editor-collab-sidebar-panel__comment-field",
237
+ children: ['edit' === actionState && /*#__PURE__*/_jsx(CommentForm, {
238
+ onSubmit: value => {
239
+ onEdit(thread.id, value);
240
+ setActionState(false);
241
+ },
242
+ onCancel: () => handleCancel(),
243
+ thread: thread,
244
+ submitButtonText: _x('Update', 'verb')
245
+ }), 'edit' !== actionState && /*#__PURE__*/_jsx(RawHTML, {
246
+ children: thread?.content?.raw
247
+ })]
248
+ })
249
+ }), 'resolve' === actionState && /*#__PURE__*/_jsx(ConfirmDialog, {
250
+ isOpen: showConfirmDialog,
251
+ onConfirm: handleConfirmResolve,
252
+ onCancel: handleCancel,
253
+ confirmButtonText: "Yes",
254
+ cancelButtonText: "No",
255
+ children:
256
+ // translators: message displayed when confirming an action
257
+ __('Are you sure you want to mark this comment as resolved?')
258
+ }), 'delete' === actionState && /*#__PURE__*/_jsx(ConfirmDialog, {
259
+ isOpen: showConfirmDialog,
260
+ onConfirm: handleConfirmDelete,
261
+ onCancel: handleCancel,
262
+ confirmButtonText: "Yes",
263
+ cancelButtonText: "No",
264
+ children:
265
+ // translators: message displayed when confirming an action
266
+ __('Are you sure you want to delete this comment?')
253
267
  })]
254
268
  });
255
- }
269
+ };
256
270
  //# sourceMappingURL=comments.js.map