@wordpress/editor 14.13.1-next.cd6172eb0.0 → 14.14.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 (360) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/pattern-overrides.js +1 -0
  3. package/build/bindings/pattern-overrides.js.map +1 -1
  4. package/build/bindings/post-meta.js +1 -0
  5. package/build/bindings/post-meta.js.map +1 -1
  6. package/build/components/autocompleters/user.js +1 -0
  7. package/build/components/autocompleters/user.js.map +1 -1
  8. package/build/components/block-removal-warnings/index.js +1 -0
  9. package/build/components/block-removal-warnings/index.js.map +1 -1
  10. package/build/components/block-settings-menu/content-only-settings-menu.js +1 -0
  11. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  12. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -0
  13. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  14. package/build/components/collab-sidebar/add-comment.js +1 -1
  15. package/build/components/collab-sidebar/add-comment.js.map +1 -1
  16. package/build/components/collab-sidebar/comment-button.js +7 -2
  17. package/build/components/collab-sidebar/comment-button.js.map +1 -1
  18. package/build/components/collab-sidebar/comment-form.js +4 -1
  19. package/build/components/collab-sidebar/comment-form.js.map +1 -1
  20. package/build/components/collab-sidebar/comments.js +199 -185
  21. package/build/components/collab-sidebar/comments.js.map +1 -1
  22. package/build/components/collab-sidebar/index.js +11 -4
  23. package/build/components/collab-sidebar/index.js.map +1 -1
  24. package/build/components/collab-sidebar/utils.js +1 -0
  25. package/build/components/collab-sidebar/utils.js.map +1 -1
  26. package/build/components/deprecated.js +1 -0
  27. package/build/components/deprecated.js.map +1 -1
  28. package/build/components/document-bar/index.js +3 -1
  29. package/build/components/document-bar/index.js.map +1 -1
  30. package/build/components/document-outline/index.js +1 -0
  31. package/build/components/document-outline/index.js.map +1 -1
  32. package/build/components/editor-help/index.native.js +1 -0
  33. package/build/components/editor-help/index.native.js.map +1 -1
  34. package/build/components/editor-notices/index.js +1 -0
  35. package/build/components/editor-notices/index.js.map +1 -1
  36. package/build/components/editor-snackbars/index.js +1 -0
  37. package/build/components/editor-snackbars/index.js.map +1 -1
  38. package/build/components/entities-saved-states/entity-type-list.js +1 -0
  39. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  40. package/build/components/entities-saved-states/hooks/use-is-dirty.js +1 -0
  41. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  42. package/build/components/entities-saved-states/index.js +1 -0
  43. package/build/components/entities-saved-states/index.js.map +1 -1
  44. package/build/components/error-boundary/index.js +26 -13
  45. package/build/components/error-boundary/index.js.map +1 -1
  46. package/build/components/keyboard-shortcut-help-modal/index.js +1 -0
  47. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  48. package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
  49. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  50. package/build/components/list-view-sidebar/index.js +1 -0
  51. package/build/components/list-view-sidebar/index.js.map +1 -1
  52. package/build/components/local-autosave-monitor/index.js +1 -0
  53. package/build/components/local-autosave-monitor/index.js.map +1 -1
  54. package/build/components/mode-switcher/index.js +1 -0
  55. package/build/components/mode-switcher/index.js.map +1 -1
  56. package/build/components/page-attributes/parent.js +1 -0
  57. package/build/components/page-attributes/parent.js.map +1 -1
  58. package/build/components/post-actions/actions.js +1 -0
  59. package/build/components/post-actions/actions.js.map +1 -1
  60. package/build/components/post-actions/index.js +77 -91
  61. package/build/components/post-actions/index.js.map +1 -1
  62. package/build/components/post-author/hook.js +1 -0
  63. package/build/components/post-author/hook.js.map +1 -1
  64. package/build/components/post-card-panel/index.js +56 -23
  65. package/build/components/post-card-panel/index.js.map +1 -1
  66. package/build/components/post-fields/index.js +1 -0
  67. package/build/components/post-fields/index.js.map +1 -1
  68. package/build/components/post-format/index.js +1 -0
  69. package/build/components/post-format/index.js.map +1 -1
  70. package/build/components/post-format/panel.js +1 -0
  71. package/build/components/post-format/panel.js.map +1 -1
  72. package/build/components/post-publish-button/index.js +1 -0
  73. package/build/components/post-publish-button/index.js.map +1 -1
  74. package/build/components/post-publish-panel/maybe-category-panel.js +1 -0
  75. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  76. package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  77. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  78. package/build/components/post-publish-panel/maybe-upload-media.js +1 -0
  79. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  80. package/build/components/post-publish-panel/media-util.js +1 -0
  81. package/build/components/post-publish-panel/media-util.js.map +1 -1
  82. package/build/components/post-publish-panel/prepublish.js +1 -1
  83. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  84. package/build/components/post-saved-state/index.js +1 -0
  85. package/build/components/post-saved-state/index.js.map +1 -1
  86. package/build/components/post-schedule/index.js +1 -0
  87. package/build/components/post-schedule/index.js.map +1 -1
  88. package/build/components/post-taxonomies/flat-term-selector.js +1 -0
  89. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  90. package/build/components/post-taxonomies/hierarchical-term-selector.js +1 -0
  91. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  92. package/build/components/post-taxonomies/index.js +1 -0
  93. package/build/components/post-taxonomies/index.js.map +1 -1
  94. package/build/components/post-taxonomies/most-used-terms.js +1 -0
  95. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  96. package/build/components/post-template/classic-theme.js +1 -0
  97. package/build/components/post-template/classic-theme.js.map +1 -1
  98. package/build/components/post-template/swap-template-button.js +1 -0
  99. package/build/components/post-template/swap-template-button.js.map +1 -1
  100. package/build/components/post-transform-panel/hooks.js +1 -0
  101. package/build/components/post-transform-panel/hooks.js.map +1 -1
  102. package/build/components/post-type-support-check/index.js +1 -0
  103. package/build/components/post-type-support-check/index.js.map +1 -1
  104. package/build/components/preferences-modal/block-visibility.js +1 -0
  105. package/build/components/preferences-modal/block-visibility.js.map +1 -1
  106. package/build/components/preferences-modal/index.js +1 -0
  107. package/build/components/preferences-modal/index.js.map +1 -1
  108. package/build/components/provider/disable-non-page-content-blocks.js +1 -0
  109. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  110. package/build/components/provider/index.native.js +1 -0
  111. package/build/components/provider/index.native.js.map +1 -1
  112. package/build/components/provider/use-block-editor-settings.js +1 -0
  113. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  114. package/build/components/sidebar/index.js +1 -0
  115. package/build/components/sidebar/index.js.map +1 -1
  116. package/build/components/start-page-options/index.js +1 -0
  117. package/build/components/start-page-options/index.js.map +1 -1
  118. package/build/components/start-template-options/index.js +1 -0
  119. package/build/components/start-template-options/index.js.map +1 -1
  120. package/build/components/template-part-content-panel/index.js +1 -0
  121. package/build/components/template-part-content-panel/index.js.map +1 -1
  122. package/build/components/theme-support-check/index.js +1 -0
  123. package/build/components/theme-support-check/index.js.map +1 -1
  124. package/build/components/visual-editor/use-select-nearest-editable-block.js +1 -0
  125. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  126. package/build/dataviews/store/private-actions.js +16 -2
  127. package/build/dataviews/store/private-actions.js.map +1 -1
  128. package/build/dataviews/store/reducer.js +1 -0
  129. package/build/dataviews/store/reducer.js.map +1 -1
  130. package/build/hooks/custom-sources-backwards-compatibility.js +1 -0
  131. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  132. package/build/hooks/pattern-overrides.js +1 -0
  133. package/build/hooks/pattern-overrides.js.map +1 -1
  134. package/build/store/actions.js +1 -0
  135. package/build/store/actions.js.map +1 -1
  136. package/build/store/private-actions.js +1 -0
  137. package/build/store/private-actions.js.map +1 -1
  138. package/build/store/private-selectors.js +1 -0
  139. package/build/store/private-selectors.js.map +1 -1
  140. package/build/store/reducer.js +1 -0
  141. package/build/store/reducer.js.map +1 -1
  142. package/build/store/reducer.native.js +1 -0
  143. package/build/store/reducer.native.js.map +1 -1
  144. package/build/store/selectors.js +1 -0
  145. package/build/store/selectors.js.map +1 -1
  146. package/build/utils/get-template-info.js +1 -0
  147. package/build/utils/get-template-info.js.map +1 -1
  148. package/build/utils/pageTypeBadge.js +6 -12
  149. package/build/utils/pageTypeBadge.js.map +1 -1
  150. package/build/utils/terms.js +1 -0
  151. package/build/utils/terms.js.map +1 -1
  152. package/build-module/bindings/pattern-overrides.js +1 -0
  153. package/build-module/bindings/pattern-overrides.js.map +1 -1
  154. package/build-module/bindings/post-meta.js +1 -0
  155. package/build-module/bindings/post-meta.js.map +1 -1
  156. package/build-module/components/autocompleters/user.js +1 -0
  157. package/build-module/components/autocompleters/user.js.map +1 -1
  158. package/build-module/components/block-removal-warnings/index.js +1 -0
  159. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  160. package/build-module/components/block-settings-menu/content-only-settings-menu.js +1 -0
  161. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  162. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -0
  163. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  164. package/build-module/components/collab-sidebar/add-comment.js +1 -1
  165. package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
  166. package/build-module/components/collab-sidebar/comment-button.js +7 -2
  167. package/build-module/components/collab-sidebar/comment-button.js.map +1 -1
  168. package/build-module/components/collab-sidebar/comment-form.js +4 -1
  169. package/build-module/components/collab-sidebar/comment-form.js.map +1 -1
  170. package/build-module/components/collab-sidebar/comments.js +201 -187
  171. package/build-module/components/collab-sidebar/comments.js.map +1 -1
  172. package/build-module/components/collab-sidebar/index.js +11 -4
  173. package/build-module/components/collab-sidebar/index.js.map +1 -1
  174. package/build-module/components/collab-sidebar/utils.js +1 -0
  175. package/build-module/components/collab-sidebar/utils.js.map +1 -1
  176. package/build-module/components/deprecated.js +1 -0
  177. package/build-module/components/deprecated.js.map +1 -1
  178. package/build-module/components/document-bar/index.js +3 -1
  179. package/build-module/components/document-bar/index.js.map +1 -1
  180. package/build-module/components/document-outline/index.js +1 -0
  181. package/build-module/components/document-outline/index.js.map +1 -1
  182. package/build-module/components/editor-help/index.native.js +1 -0
  183. package/build-module/components/editor-help/index.native.js.map +1 -1
  184. package/build-module/components/editor-notices/index.js +1 -0
  185. package/build-module/components/editor-notices/index.js.map +1 -1
  186. package/build-module/components/editor-snackbars/index.js +1 -0
  187. package/build-module/components/editor-snackbars/index.js.map +1 -1
  188. package/build-module/components/entities-saved-states/entity-type-list.js +1 -0
  189. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  190. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +1 -0
  191. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  192. package/build-module/components/entities-saved-states/index.js +1 -0
  193. package/build-module/components/entities-saved-states/index.js.map +1 -1
  194. package/build-module/components/error-boundary/index.js +28 -15
  195. package/build-module/components/error-boundary/index.js.map +1 -1
  196. package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -0
  197. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  198. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -0
  199. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  200. package/build-module/components/list-view-sidebar/index.js +1 -0
  201. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  202. package/build-module/components/local-autosave-monitor/index.js +1 -0
  203. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  204. package/build-module/components/mode-switcher/index.js +1 -0
  205. package/build-module/components/mode-switcher/index.js.map +1 -1
  206. package/build-module/components/page-attributes/parent.js +1 -0
  207. package/build-module/components/page-attributes/parent.js.map +1 -1
  208. package/build-module/components/post-actions/actions.js +1 -0
  209. package/build-module/components/post-actions/actions.js.map +1 -1
  210. package/build-module/components/post-actions/index.js +77 -92
  211. package/build-module/components/post-actions/index.js.map +1 -1
  212. package/build-module/components/post-author/hook.js +1 -0
  213. package/build-module/components/post-author/hook.js.map +1 -1
  214. package/build-module/components/post-card-panel/index.js +59 -24
  215. package/build-module/components/post-card-panel/index.js.map +1 -1
  216. package/build-module/components/post-fields/index.js +1 -0
  217. package/build-module/components/post-fields/index.js.map +1 -1
  218. package/build-module/components/post-format/index.js +1 -0
  219. package/build-module/components/post-format/index.js.map +1 -1
  220. package/build-module/components/post-format/panel.js +1 -0
  221. package/build-module/components/post-format/panel.js.map +1 -1
  222. package/build-module/components/post-publish-button/index.js +1 -0
  223. package/build-module/components/post-publish-button/index.js.map +1 -1
  224. package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -0
  225. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  226. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  227. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  228. package/build-module/components/post-publish-panel/maybe-upload-media.js +1 -0
  229. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  230. package/build-module/components/post-publish-panel/media-util.js +1 -0
  231. package/build-module/components/post-publish-panel/media-util.js.map +1 -1
  232. package/build-module/components/post-publish-panel/prepublish.js +1 -1
  233. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  234. package/build-module/components/post-saved-state/index.js +1 -0
  235. package/build-module/components/post-saved-state/index.js.map +1 -1
  236. package/build-module/components/post-schedule/index.js +1 -0
  237. package/build-module/components/post-schedule/index.js.map +1 -1
  238. package/build-module/components/post-taxonomies/flat-term-selector.js +1 -0
  239. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  240. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +1 -0
  241. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  242. package/build-module/components/post-taxonomies/index.js +1 -0
  243. package/build-module/components/post-taxonomies/index.js.map +1 -1
  244. package/build-module/components/post-taxonomies/most-used-terms.js +1 -0
  245. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  246. package/build-module/components/post-template/classic-theme.js +1 -0
  247. package/build-module/components/post-template/classic-theme.js.map +1 -1
  248. package/build-module/components/post-template/swap-template-button.js +1 -0
  249. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  250. package/build-module/components/post-transform-panel/hooks.js +1 -0
  251. package/build-module/components/post-transform-panel/hooks.js.map +1 -1
  252. package/build-module/components/post-type-support-check/index.js +1 -0
  253. package/build-module/components/post-type-support-check/index.js.map +1 -1
  254. package/build-module/components/preferences-modal/block-visibility.js +1 -0
  255. package/build-module/components/preferences-modal/block-visibility.js.map +1 -1
  256. package/build-module/components/preferences-modal/index.js +1 -0
  257. package/build-module/components/preferences-modal/index.js.map +1 -1
  258. package/build-module/components/provider/disable-non-page-content-blocks.js +1 -0
  259. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  260. package/build-module/components/provider/index.native.js +1 -0
  261. package/build-module/components/provider/index.native.js.map +1 -1
  262. package/build-module/components/provider/use-block-editor-settings.js +1 -0
  263. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  264. package/build-module/components/sidebar/index.js +1 -0
  265. package/build-module/components/sidebar/index.js.map +1 -1
  266. package/build-module/components/start-page-options/index.js +1 -0
  267. package/build-module/components/start-page-options/index.js.map +1 -1
  268. package/build-module/components/start-template-options/index.js +1 -0
  269. package/build-module/components/start-template-options/index.js.map +1 -1
  270. package/build-module/components/template-part-content-panel/index.js +1 -0
  271. package/build-module/components/template-part-content-panel/index.js.map +1 -1
  272. package/build-module/components/theme-support-check/index.js +1 -0
  273. package/build-module/components/theme-support-check/index.js.map +1 -1
  274. package/build-module/components/visual-editor/use-select-nearest-editable-block.js +1 -0
  275. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  276. package/build-module/dataviews/store/private-actions.js +16 -2
  277. package/build-module/dataviews/store/private-actions.js.map +1 -1
  278. package/build-module/dataviews/store/reducer.js +1 -0
  279. package/build-module/dataviews/store/reducer.js.map +1 -1
  280. package/build-module/hooks/custom-sources-backwards-compatibility.js +1 -0
  281. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  282. package/build-module/hooks/pattern-overrides.js +1 -0
  283. package/build-module/hooks/pattern-overrides.js.map +1 -1
  284. package/build-module/store/actions.js +1 -0
  285. package/build-module/store/actions.js.map +1 -1
  286. package/build-module/store/private-actions.js +1 -0
  287. package/build-module/store/private-actions.js.map +1 -1
  288. package/build-module/store/private-selectors.js +1 -0
  289. package/build-module/store/private-selectors.js.map +1 -1
  290. package/build-module/store/reducer.js +1 -0
  291. package/build-module/store/reducer.js.map +1 -1
  292. package/build-module/store/reducer.native.js +1 -0
  293. package/build-module/store/reducer.native.js.map +1 -1
  294. package/build-module/store/selectors.js +1 -0
  295. package/build-module/store/selectors.js.map +1 -1
  296. package/build-module/utils/get-template-info.js +1 -0
  297. package/build-module/utils/get-template-info.js.map +1 -1
  298. package/build-module/utils/pageTypeBadge.js +6 -12
  299. package/build-module/utils/pageTypeBadge.js.map +1 -1
  300. package/build-module/utils/terms.js +1 -0
  301. package/build-module/utils/terms.js.map +1 -1
  302. package/build-style/style-rtl.css +22 -3
  303. package/build-style/style.css +22 -3
  304. package/build-types/components/autocompleters/user.d.ts +7 -1
  305. package/build-types/components/autocompleters/user.d.ts.map +1 -1
  306. package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -1
  307. package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -1
  308. package/build-types/components/collab-sidebar/comments.d.ts +11 -7
  309. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  310. package/build-types/components/collab-sidebar/constants.d.ts.map +1 -1
  311. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  312. package/build-types/components/document-bar/index.d.ts.map +1 -1
  313. package/build-types/components/error-boundary/index.d.ts.map +1 -1
  314. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +1 -1
  315. package/build-types/components/media-categories/index.d.ts.map +1 -1
  316. package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -1
  317. package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -1
  318. package/build-types/components/post-actions/index.d.ts +5 -0
  319. package/build-types/components/post-actions/index.d.ts.map +1 -1
  320. package/build-types/components/post-card-panel/index.d.ts +13 -4
  321. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  322. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +4 -4
  323. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  324. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +4 -4
  325. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  326. package/build-types/components/post-title/constants.d.ts.map +1 -1
  327. package/build-types/dataviews/api.d.ts.map +1 -1
  328. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  329. package/build-types/dataviews/store/reducer.d.ts +1 -1
  330. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
  331. package/build-types/hooks/pattern-overrides.d.ts.map +1 -1
  332. package/build-types/store/actions.d.ts +7 -9
  333. package/build-types/store/actions.d.ts.map +1 -1
  334. package/build-types/store/private-actions.d.ts +1 -1
  335. package/build-types/store/private-actions.d.ts.map +1 -1
  336. package/build-types/store/private-selectors.d.ts +20 -4
  337. package/build-types/store/private-selectors.d.ts.map +1 -1
  338. package/build-types/store/reducer.d.ts +1 -1
  339. package/build-types/store/selectors.d.ts +376 -76
  340. package/build-types/store/selectors.d.ts.map +1 -1
  341. package/build-types/utils/pageTypeBadge.d.ts +3 -1
  342. package/build-types/utils/pageTypeBadge.d.ts.map +1 -1
  343. package/package.json +36 -36
  344. package/src/components/collab-sidebar/add-comment.js +1 -1
  345. package/src/components/collab-sidebar/comment-button.js +12 -7
  346. package/src/components/collab-sidebar/comment-form.js +4 -1
  347. package/src/components/collab-sidebar/comments.js +260 -243
  348. package/src/components/collab-sidebar/index.js +10 -2
  349. package/src/components/collab-sidebar/style.scss +10 -1
  350. package/src/components/document-bar/index.js +3 -1
  351. package/src/components/error-boundary/index.js +30 -16
  352. package/src/components/error-boundary/style.scss +5 -1
  353. package/src/components/post-actions/index.js +89 -95
  354. package/src/components/post-card-panel/index.js +65 -29
  355. package/src/components/post-card-panel/style.scss +5 -0
  356. package/src/components/post-publish-panel/prepublish.js +1 -1
  357. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  358. package/src/dataviews/store/private-actions.ts +23 -8
  359. package/src/utils/pageTypeBadge.js +7 -10
  360. package/tsconfig.tsbuildinfo +1 -1
@@ -3,9 +3,12 @@
3
3
  */
4
4
  import { Component } from '@wordpress/element';
5
5
  import { __ } from '@wordpress/i18n';
6
- import { Button } from '@wordpress/components';
6
+ import {
7
+ Button,
8
+ __experimentalHStack as HStack,
9
+ __experimentalText as Text,
10
+ } from '@wordpress/components';
7
11
  import { select } from '@wordpress/data';
8
- import { Warning } from '@wordpress/block-editor';
9
12
  import { useCopyToClipboard } from '@wordpress/compose';
10
13
  import { doAction } from '@wordpress/hooks';
11
14
 
@@ -26,10 +29,10 @@ function getContent() {
26
29
  } catch ( error ) {}
27
30
  }
28
31
 
29
- function CopyButton( { text, children } ) {
32
+ function CopyButton( { text, children, variant = 'secondary' } ) {
30
33
  const ref = useCopyToClipboard( text );
31
34
  return (
32
- <Button __next40pxDefaultSize variant="secondary" ref={ ref }>
35
+ <Button __next40pxDefaultSize variant={ variant } ref={ ref }>
33
36
  { children }
34
37
  </Button>
35
38
  );
@@ -54,23 +57,34 @@ class ErrorBoundary extends Component {
54
57
 
55
58
  render() {
56
59
  const { error } = this.state;
60
+ const { canCopyContent = false } = this.props;
57
61
  if ( ! error ) {
58
62
  return this.props.children;
59
63
  }
60
64
 
61
- const actions = [
62
- <CopyButton key="copy-post" text={ getContent }>
63
- { __( 'Copy Post Text' ) }
64
- </CopyButton>,
65
- <CopyButton key="copy-error" text={ error.stack }>
66
- { __( 'Copy Error' ) }
67
- </CopyButton>,
68
- ];
69
-
70
65
  return (
71
- <Warning className="editor-error-boundary" actions={ actions }>
72
- { __( 'The editor has encountered an unexpected error.' ) }
73
- </Warning>
66
+ <HStack
67
+ className="editor-error-boundary"
68
+ alignment="baseline"
69
+ spacing={ 4 }
70
+ justify="space-between"
71
+ expanded={ false }
72
+ wrap
73
+ >
74
+ <Text as="p">
75
+ { __( 'The editor has encountered an unexpected error.' ) }
76
+ </Text>
77
+ <HStack expanded={ false }>
78
+ { canCopyContent && (
79
+ <CopyButton text={ getContent }>
80
+ { __( 'Copy contents' ) }
81
+ </CopyButton>
82
+ ) }
83
+ <CopyButton variant="primary" text={ error?.stack }>
84
+ { __( 'Copy error' ) }
85
+ </CopyButton>
86
+ </HStack>
87
+ </HStack>
74
88
  );
75
89
  }
76
90
  }
@@ -1,7 +1,11 @@
1
1
  .editor-error-boundary {
2
+ font-family: $default-font;
2
3
  margin: auto;
3
4
  max-width: 780px;
4
- padding: 20px;
5
+ padding: 1em;
5
6
  margin-top: 60px;
6
7
  box-shadow: $elevation-large;
8
+ border: $border-width solid $gray-900;
9
+ border-radius: $radius-small;
10
+ background-color: $white;
7
11
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { useSelect } from '@wordpress/data';
4
+ import { useRegistry, useSelect } from '@wordpress/data';
5
5
  import { useState, useMemo } from '@wordpress/element';
6
6
  import { __ } from '@wordpress/i18n';
7
7
  import {
@@ -20,66 +20,87 @@ import { usePostActions } from './actions';
20
20
 
21
21
  const { Menu, kebabCase } = unlock( componentsPrivateApis );
22
22
 
23
- export default function PostActions( { postType, postId, onActionPerformed } ) {
24
- const [ isActionsMenuOpen, setIsActionsMenuOpen ] = useState( false );
25
- const { item, permissions } = useSelect(
23
+ function useEditedEntityRecordsWithPermissions( postType, postIds ) {
24
+ const { items, permissions } = useSelect(
26
25
  ( select ) => {
27
26
  const { getEditedEntityRecord, getEntityRecordPermissions } =
28
27
  unlock( select( coreStore ) );
29
28
  return {
30
- item: getEditedEntityRecord( 'postType', postType, postId ),
31
- permissions: getEntityRecordPermissions(
32
- 'postType',
33
- postType,
34
- postId
29
+ items: postIds.map( ( postId ) =>
30
+ getEditedEntityRecord( 'postType', postType, postId )
31
+ ),
32
+ permissions: postIds.map( ( postId ) =>
33
+ getEntityRecordPermissions( 'postType', postType, postId )
35
34
  ),
36
35
  };
37
36
  },
38
- [ postId, postType ]
37
+ [ postIds, postType ]
39
38
  );
40
- const itemWithPermissions = useMemo( () => {
41
- return {
39
+
40
+ return useMemo( () => {
41
+ return items.map( ( item, index ) => ( {
42
42
  ...item,
43
- permissions,
44
- };
45
- }, [ item, permissions ] );
43
+ permissions: permissions[ index ],
44
+ } ) );
45
+ }, [ items, permissions ] );
46
+ }
47
+
48
+ export default function PostActions( { postType, postId, onActionPerformed } ) {
49
+ const [ activeModalAction, setActiveModalAction ] = useState( null );
50
+ const _postIds = useMemo( () => {
51
+ if ( Array.isArray( postId ) ) {
52
+ return postId;
53
+ }
54
+ return postId ? [ postId ] : [];
55
+ }, [ postId ] );
56
+
57
+ const itemsWithPermissions = useEditedEntityRecordsWithPermissions(
58
+ postType,
59
+ _postIds
60
+ );
46
61
  const allActions = usePostActions( { postType, onActionPerformed } );
47
62
 
48
63
  const actions = useMemo( () => {
49
64
  return allActions.filter( ( action ) => {
50
65
  return (
51
- ! action.isEligible || action.isEligible( itemWithPermissions )
66
+ ( ! action.isEligible ||
67
+ itemsWithPermissions.some( ( itemWithPermissions ) =>
68
+ action.isEligible( itemWithPermissions )
69
+ ) ) &&
70
+ ( itemsWithPermissions.length < 2 || action.supportsBulk )
52
71
  );
53
72
  } );
54
- }, [ allActions, itemWithPermissions ] );
73
+ }, [ allActions, itemsWithPermissions ] );
55
74
 
56
75
  return (
57
- <Menu
58
- open={ isActionsMenuOpen }
59
- trigger={
60
- <Button
61
- size="small"
62
- icon={ moreVertical }
63
- label={ __( 'Actions' ) }
64
- disabled={ ! actions.length }
65
- accessibleWhenDisabled
66
- className="editor-all-actions-button"
67
- onClick={ () =>
68
- setIsActionsMenuOpen( ! isActionsMenuOpen )
69
- }
76
+ <>
77
+ <Menu
78
+ trigger={
79
+ <Button
80
+ size="small"
81
+ icon={ moreVertical }
82
+ label={ __( 'Actions' ) }
83
+ disabled={ ! actions.length }
84
+ accessibleWhenDisabled
85
+ className="editor-all-actions-button"
86
+ />
87
+ }
88
+ placement="bottom-end"
89
+ >
90
+ <ActionsDropdownMenuGroup
91
+ actions={ actions }
92
+ items={ itemsWithPermissions }
93
+ setActiveModalAction={ setActiveModalAction }
70
94
  />
71
- }
72
- onOpenChange={ setIsActionsMenuOpen }
73
- placement="bottom-end"
74
- >
75
- <ActionsDropdownMenuGroup
76
- actions={ actions }
77
- item={ itemWithPermissions }
78
- onClose={ () => {
79
- setIsActionsMenuOpen( false );
80
- } }
81
- />
82
- </Menu>
95
+ </Menu>
96
+ { !! activeModalAction && (
97
+ <ActionModal
98
+ action={ activeModalAction }
99
+ items={ itemsWithPermissions }
100
+ closeModal={ () => setActiveModalAction( null ) }
101
+ />
102
+ ) }
103
+ </>
83
104
  );
84
105
  }
85
106
 
@@ -88,79 +109,52 @@ export default function PostActions( { postType, postId, onActionPerformed } ) {
88
109
  // and the dataviews package should not be using the editor packages directly,
89
110
  // so duplicating the code here seems like the least bad option.
90
111
 
91
- // Copied as is from packages/dataviews/src/item-actions.js
92
112
  function DropdownMenuItemTrigger( { action, onClick, items } ) {
93
113
  const label =
94
114
  typeof action.label === 'string' ? action.label : action.label( items );
95
115
  return (
96
- <Menu.Item onClick={ onClick } hideOnClick={ ! action.RenderModal }>
116
+ <Menu.Item onClick={ onClick }>
97
117
  <Menu.ItemLabel>{ label }</Menu.ItemLabel>
98
118
  </Menu.Item>
99
119
  );
100
120
  }
101
121
 
102
- // Copied as is from packages/dataviews/src/item-actions.js
103
- // With an added onClose prop.
104
- function ActionWithModal( { action, item, ActionTrigger, onClose } ) {
105
- const [ isModalOpen, setIsModalOpen ] = useState( false );
106
- const actionTriggerProps = {
107
- action,
108
- onClick: () => setIsModalOpen( true ),
109
- items: [ item ],
110
- };
111
- const { RenderModal, hideModalHeader } = action;
122
+ export function ActionModal( { action, items, closeModal } ) {
123
+ const label =
124
+ typeof action.label === 'string' ? action.label : action.label( items );
112
125
  return (
113
- <>
114
- <ActionTrigger { ...actionTriggerProps } />
115
- { isModalOpen && (
116
- <Modal
117
- title={ action.modalHeader || action.label }
118
- __experimentalHideHeader={ !! hideModalHeader }
119
- onRequestClose={ () => {
120
- setIsModalOpen( false );
121
- } }
122
- overlayClassName={ `editor-action-modal editor-action-modal__${ kebabCase(
123
- action.id
124
- ) }` }
125
- focusOnMount="firstContentElement"
126
- size="medium"
127
- >
128
- <RenderModal
129
- items={ [ item ] }
130
- closeModal={ () => {
131
- setIsModalOpen( false );
132
- onClose();
133
- } }
134
- />
135
- </Modal>
136
- ) }
137
- </>
126
+ <Modal
127
+ title={ action.modalHeader || label }
128
+ __experimentalHideHeader={ !! action.hideModalHeader }
129
+ onRequestClose={ closeModal ?? ( () => {} ) }
130
+ focusOnMount="firstContentElement"
131
+ size="medium"
132
+ overlayClassName={ `editor-action-modal editor-action-modal__${ kebabCase(
133
+ action.id
134
+ ) }` }
135
+ >
136
+ <action.RenderModal items={ items } closeModal={ closeModal } />
137
+ </Modal>
138
138
  );
139
139
  }
140
140
 
141
- // Copied as is from packages/dataviews/src/item-actions.js
142
- // With an added onClose prop.
143
- function ActionsDropdownMenuGroup( { actions, item, onClose } ) {
141
+ function ActionsDropdownMenuGroup( { actions, items, setActiveModalAction } ) {
142
+ const registry = useRegistry();
144
143
  return (
145
144
  <Menu.Group>
146
145
  { actions.map( ( action ) => {
147
- if ( action.RenderModal ) {
148
- return (
149
- <ActionWithModal
150
- key={ action.id }
151
- action={ action }
152
- item={ item }
153
- ActionTrigger={ DropdownMenuItemTrigger }
154
- onClose={ onClose }
155
- />
156
- );
157
- }
158
146
  return (
159
147
  <DropdownMenuItemTrigger
160
148
  key={ action.id }
161
149
  action={ action }
162
- onClick={ () => action.callback( [ item ] ) }
163
- items={ [ item ] }
150
+ onClick={ () => {
151
+ if ( 'RenderModal' in action ) {
152
+ setActiveModalAction( action );
153
+ return;
154
+ }
155
+ action.callback( items, { registry } );
156
+ } }
157
+ items={ items }
164
158
  />
165
159
  );
166
160
  } ) }
@@ -4,11 +4,13 @@
4
4
  import {
5
5
  Icon,
6
6
  __experimentalHStack as HStack,
7
+ __experimentalVStack as VStack,
7
8
  __experimentalText as Text,
8
9
  } from '@wordpress/components';
9
10
  import { store as coreStore } from '@wordpress/core-data';
10
11
  import { useSelect } from '@wordpress/data';
11
- import { __ } from '@wordpress/i18n';
12
+ import { useMemo } from '@wordpress/element';
13
+ import { __, sprintf } from '@wordpress/i18n';
12
14
  import { decodeEntities } from '@wordpress/html-entities';
13
15
 
14
16
  /**
@@ -24,50 +26,77 @@ import PostActions from '../post-actions';
24
26
  import usePageTypeBadge from '../../utils/pageTypeBadge';
25
27
  import { getTemplateInfo } from '../../utils/get-template-info';
26
28
 
29
+ /**
30
+ * Renders a title of the post type and the available quick actions available within a 3-dot dropdown.
31
+ *
32
+ * @param {Object} props - Component props.
33
+ * @param {string} [props.postType] - The post type string.
34
+ * @param {string|string[]} [props.postId] - The post id or list of post ids.
35
+ * @param {Function} [props.onActionPerformed] - A callback function for when a quick action is performed.
36
+ * @return {React.ReactNode} The rendered component.
37
+ */
27
38
  export default function PostCardPanel( {
28
39
  postType,
29
40
  postId,
30
41
  onActionPerformed,
31
42
  } ) {
32
- const { title, icon } = useSelect(
43
+ const postIds = useMemo(
44
+ () => ( Array.isArray( postId ) ? postId : [ postId ] ),
45
+ [ postId ]
46
+ );
47
+ const { postTitle, icon, labels } = useSelect(
33
48
  ( select ) => {
34
- const { getEditedEntityRecord } = select( coreStore );
49
+ const { getEditedEntityRecord, getEntityRecord, getPostType } =
50
+ select( coreStore );
51
+ const { getPostIcon } = unlock( select( editorStore ) );
52
+ let _title = '';
35
53
  const _record = getEditedEntityRecord(
36
54
  'postType',
37
55
  postType,
38
- postId
56
+ postIds[ 0 ]
39
57
  );
58
+ if ( postIds.length === 1 ) {
59
+ const { default_template_types: templateTypes = [] } =
60
+ getEntityRecord( 'root', '__unstableBase' ) ?? {};
40
61
 
41
- const { default_template_types: templateTypes = [] } =
42
- select( coreStore ).getEntityRecord(
43
- 'root',
44
- '__unstableBase'
45
- ) ?? {};
46
-
47
- const _templateInfo = [
48
- TEMPLATE_POST_TYPE,
49
- TEMPLATE_PART_POST_TYPE,
50
- ].includes( postType )
51
- ? getTemplateInfo( {
52
- template: _record,
53
- templateTypes,
54
- } )
55
- : {};
62
+ const _templateInfo = [
63
+ TEMPLATE_POST_TYPE,
64
+ TEMPLATE_PART_POST_TYPE,
65
+ ].includes( postType )
66
+ ? getTemplateInfo( {
67
+ template: _record,
68
+ templateTypes,
69
+ } )
70
+ : {};
71
+ _title = _templateInfo?.title || _record?.title;
72
+ }
56
73
 
57
74
  return {
58
- title: _templateInfo?.title || _record?.title,
59
- icon: unlock( select( editorStore ) ).getPostIcon( postType, {
75
+ postTitle: _title,
76
+ icon: getPostIcon( postType, {
60
77
  area: _record?.area,
61
78
  } ),
79
+ labels: getPostType( postType )?.labels,
62
80
  };
63
81
  },
64
- [ postId, postType ]
82
+ [ postIds, postType ]
65
83
  );
66
84
 
67
- const pageTypeBadge = usePageTypeBadge();
85
+ const pageTypeBadge = usePageTypeBadge( postId );
86
+ let title = __( 'No title' );
87
+ if ( labels?.name && postIds.length > 1 ) {
88
+ title = sprintf(
89
+ // translators: %i number of selected items %s: Name of the plural post type e.g: "Posts".
90
+ __( '%i %s' ),
91
+ postId.length,
92
+ labels?.name
93
+ );
94
+ } else if ( postTitle ) {
95
+ title = decodeEntities( postTitle );
96
+ }
68
97
 
69
98
  return (
70
- <div className="editor-post-card-panel">
99
+ <VStack spacing={ 1 } className="editor-post-card-panel">
71
100
  <HStack
72
101
  spacing={ 2 }
73
102
  className="editor-post-card-panel__header"
@@ -78,12 +107,10 @@ export default function PostCardPanel( {
78
107
  numberOfLines={ 2 }
79
108
  truncate
80
109
  className="editor-post-card-panel__title"
81
- weight={ 500 }
82
110
  as="h2"
83
- lineHeight="20px"
84
111
  >
85
- { title ? decodeEntities( title ) : __( 'No title' ) }
86
- { pageTypeBadge && (
112
+ { title }
113
+ { pageTypeBadge && postIds.length === 1 && (
87
114
  <span className="editor-post-card-panel__title-badge">
88
115
  { pageTypeBadge }
89
116
  </span>
@@ -95,6 +122,15 @@ export default function PostCardPanel( {
95
122
  onActionPerformed={ onActionPerformed }
96
123
  />
97
124
  </HStack>
98
- </div>
125
+ { postIds.length > 1 && (
126
+ <Text className="editor-post-card-panel__description">
127
+ { sprintf(
128
+ // translators: %s: Name of the plural post type e.g: "Posts".
129
+ __( 'Changes will be applied to all selected %s.' ),
130
+ labels?.name.toLowerCase()
131
+ ) }
132
+ </Text>
133
+ ) }
134
+ </VStack>
99
135
  );
100
136
  }
@@ -7,6 +7,7 @@
7
7
  width: 100%;
8
8
 
9
9
  &.editor-post-card-panel__title {
10
+ @include heading-medium();
10
11
  margin: 0;
11
12
  padding: 2px 0;
12
13
  display: flex;
@@ -32,6 +33,10 @@
32
33
  &.has-description &__header {
33
34
  margin-bottom: $grid-unit-10;
34
35
  }
36
+
37
+ .editor-post-card-panel__description {
38
+ color: $gray-700;
39
+ }
35
40
  }
36
41
 
37
42
  .editor-post-card-panel__title-badge {
@@ -75,7 +75,7 @@ function PostPublishPanelPrepublish( { children } ) {
75
75
  if ( ! hasPublishAction ) {
76
76
  prePublishTitle = __( 'Are you ready to submit for review?' );
77
77
  prePublishBodyText = __(
78
- 'When you’re ready, submit your work for review, and an Editor will be able to approve it for you.'
78
+ 'Your work will be reviewed and then approved.'
79
79
  );
80
80
  } else if ( isBeingScheduled ) {
81
81
  prePublishTitle = __( 'Are you ready to schedule?' );
@@ -466,7 +466,7 @@ exports[`PostPublishPanel should render the pre-publish panel if post status is
466
466
  </strong>
467
467
  </div>
468
468
  <p>
469
- When you’re ready, submit your work for review, and an Editor will be able to approve it for you.
469
+ Your work will be reviewed and then approved.
470
470
  </p>
471
471
  <div
472
472
  class="components-site-card"
@@ -619,7 +619,7 @@ exports[`PostPublishPanel should render the pre-publish panel if the post is not
619
619
  </strong>
620
620
  </div>
621
621
  <p>
622
- When you’re ready, submit your work for review, and an Editor will be able to approve it for you.
622
+ Your work will be reviewed and then approved.
623
623
  </p>
624
624
  <div
625
625
  class="components-site-card"
@@ -4,12 +4,6 @@
4
4
  import { store as coreStore } from '@wordpress/core-data';
5
5
  import type { Action, Field } from '@wordpress/dataviews';
6
6
  import { doAction } from '@wordpress/hooks';
7
-
8
- /**
9
- * Internal dependencies
10
- */
11
- import { store as editorStore } from '../../store';
12
- import { unlock } from '../../lock-unlock';
13
7
  import type { PostType } from '@wordpress/fields';
14
8
  import {
15
9
  viewPost,
@@ -35,8 +29,17 @@ import {
35
29
  authorField,
36
30
  titleField,
37
31
  templateField,
32
+ templateTitleField,
33
+ pageTitleField,
34
+ patternTitleField,
38
35
  } from '@wordpress/fields';
39
36
 
37
+ /**
38
+ * Internal dependencies
39
+ */
40
+ import { store as editorStore } from '../../store';
41
+ import { unlock } from '../../lock-unlock';
42
+
40
43
  export function registerEntityAction< Item >(
41
44
  kind: string,
42
45
  name: string,
@@ -164,16 +167,28 @@ export const registerPostTypeSchema =
164
167
  postTypeConfig.supports?.thumbnail &&
165
168
  currentTheme?.theme_supports?.[ 'post-thumbnails' ] &&
166
169
  featuredImageField,
167
- titleField,
168
170
  postTypeConfig.supports?.author && authorField,
169
171
  statusField,
170
172
  dateField,
171
173
  slugField,
172
174
  postTypeConfig.supports?.[ 'page-attributes' ] && parentField,
173
175
  postTypeConfig.supports?.comments && commentStatusField,
174
- passwordField,
175
176
  templateField,
177
+ passwordField,
176
178
  ].filter( Boolean );
179
+ if ( postTypeConfig.supports?.title ) {
180
+ let _titleField;
181
+ if ( postType === 'page' ) {
182
+ _titleField = pageTitleField;
183
+ } else if ( postType === 'wp_template' ) {
184
+ _titleField = templateTitleField;
185
+ } else if ( postType === 'wp_block' ) {
186
+ _titleField = patternTitleField;
187
+ } else {
188
+ _titleField = titleField;
189
+ }
190
+ fields.push( _titleField );
191
+ }
177
192
 
178
193
  registry.batch( () => {
179
194
  actions.forEach( ( action ) => {
@@ -5,19 +5,14 @@ import { __ } from '@wordpress/i18n';
5
5
  import { useSelect } from '@wordpress/data';
6
6
  import { store as coreStore } from '@wordpress/core-data';
7
7
 
8
- /**
9
- * Internal dependencies
10
- */
11
- import { store as editorStore } from '../store';
12
-
13
8
  /**
14
9
  * Custom hook to get the page type badge for the current post on edit site view.
10
+ *
11
+ * @param {number|string} postId postId of the current post being edited.
15
12
  */
16
- export default function usePageTypeBadge() {
13
+ export default function usePageTypeBadge( postId ) {
17
14
  const { isFrontPage, isPostsPage } = useSelect( ( select ) => {
18
- const { getCurrentPostId } = select( editorStore );
19
15
  const { canUser, getEditedEntityRecord } = select( coreStore );
20
- const postId = getCurrentPostId();
21
16
  const siteSettings = canUser( 'read', {
22
17
  kind: 'root',
23
18
  name: 'site',
@@ -25,9 +20,11 @@ export default function usePageTypeBadge() {
25
20
  ? getEditedEntityRecord( 'root', 'site' )
26
21
  : undefined;
27
22
 
23
+ const _postId = parseInt( postId, 10 );
24
+
28
25
  return {
29
- isFrontPage: siteSettings?.page_on_front === postId,
30
- isPostsPage: siteSettings?.page_for_posts === postId,
26
+ isFrontPage: siteSettings?.page_on_front === _postId,
27
+ isPostsPage: siteSettings?.page_for_posts === _postId,
31
28
  };
32
29
  } );
33
30