@wordpress/editor 14.48.1 → 14.49.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 (460) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +5 -13
  3. package/build/bindings/pattern-overrides.cjs +1 -1
  4. package/build/bindings/pattern-overrides.cjs.map +2 -2
  5. package/build/components/autosave-monitor/index.cjs +40 -83
  6. package/build/components/autosave-monitor/index.cjs.map +3 -3
  7. package/build/components/collab-sidebar/note-byline.cjs +1 -1
  8. package/build/components/collab-sidebar/note-byline.cjs.map +2 -2
  9. package/build/components/collab-sidebar/note.cjs +49 -17
  10. package/build/components/collab-sidebar/note.cjs.map +3 -3
  11. package/build/components/collab-sidebar/notes.cjs.map +1 -1
  12. package/build/components/collab-sidebar/utils.cjs +1 -1
  13. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  14. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs.map +1 -1
  15. package/build/components/collaborators-overlay/collaborator-styles.cjs.map +1 -1
  16. package/build/components/collaborators-overlay/compute-selection.cjs.map +1 -1
  17. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +1 -1
  18. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +1 -1
  19. package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +1 -1
  20. package/build/components/collaborators-presence/avatar/component.cjs.map +2 -2
  21. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs.map +1 -1
  22. package/build/components/document-bar/index.cjs +7 -5
  23. package/build/components/document-bar/index.cjs.map +2 -2
  24. package/build/components/global-keyboard-shortcuts/index.cjs +3 -2
  25. package/build/components/global-keyboard-shortcuts/index.cjs.map +2 -2
  26. package/build/components/global-styles-sidebar/welcome-guide.cjs +3 -3
  27. package/build/components/global-styles-sidebar/welcome-guide.cjs.map +1 -1
  28. package/build/components/local-autosave-monitor/index.cjs +14 -15
  29. package/build/components/local-autosave-monitor/index.cjs.map +2 -2
  30. package/build/components/page-attributes/parent.cjs +1 -1
  31. package/build/components/page-attributes/parent.cjs.map +2 -2
  32. package/build/components/post-card-panel/index.cjs +1 -1
  33. package/build/components/post-card-panel/index.cjs.map +2 -2
  34. package/build/components/post-excerpt/panel.cjs +1 -1
  35. package/build/components/post-excerpt/panel.cjs.map +2 -2
  36. package/build/components/post-locked-modal/index.cjs +3 -3
  37. package/build/components/post-locked-modal/index.cjs.map +1 -1
  38. package/build/components/post-preview-button/index.cjs +2 -2
  39. package/build/components/post-preview-button/index.cjs.map +2 -2
  40. package/build/components/post-publish-button/index.cjs +4 -3
  41. package/build/components/post-publish-button/index.cjs.map +2 -2
  42. package/build/components/post-publish-button/label.cjs +2 -2
  43. package/build/components/post-publish-button/label.cjs.map +2 -2
  44. package/build/components/post-publish-panel/index.cjs.map +1 -1
  45. package/build/components/post-publish-panel/postpublish.cjs +1 -2
  46. package/build/components/post-publish-panel/postpublish.cjs.map +2 -2
  47. package/build/components/post-revisions-preview/block-diff.cjs.map +1 -1
  48. package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
  49. package/build/components/post-revisions-preview/revisions-slider.cjs +1 -1
  50. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  51. package/build/components/post-revisions-timeline/index.cjs +173 -0
  52. package/build/components/post-revisions-timeline/index.cjs.map +7 -0
  53. package/build/components/post-saved-state/index.cjs +17 -26
  54. package/build/components/post-saved-state/index.cjs.map +2 -2
  55. package/build/components/post-schedule/label.cjs +5 -5
  56. package/build/components/post-schedule/label.cjs.map +1 -1
  57. package/build/components/post-status/index.cjs +0 -1
  58. package/build/components/post-status/index.cjs.map +2 -2
  59. package/build/components/post-taxonomies/flat-term-selector.cjs +2 -1
  60. package/build/components/post-taxonomies/flat-term-selector.cjs.map +3 -3
  61. package/build/components/post-taxonomies/hierarchical-term-selector.cjs +1 -2
  62. package/build/components/post-taxonomies/hierarchical-term-selector.cjs.map +2 -2
  63. package/build/components/post-template/create-new-template-modal.cjs +0 -1
  64. package/build/components/post-template/create-new-template-modal.cjs.map +2 -2
  65. package/build/components/post-text-editor/index.cjs +51 -0
  66. package/build/components/post-text-editor/index.cjs.map +2 -2
  67. package/build/components/post-text-editor/utils.cjs +150 -0
  68. package/build/components/post-text-editor/utils.cjs.map +7 -0
  69. package/build/components/post-url/index.cjs +1 -1
  70. package/build/components/post-url/index.cjs.map +2 -2
  71. package/build/components/post-view-link/index.cjs +1 -1
  72. package/build/components/post-view-link/index.cjs.map +2 -2
  73. package/build/components/post-visibility/index.cjs +0 -1
  74. package/build/components/post-visibility/index.cjs.map +2 -2
  75. package/build/components/provider/disable-non-page-content-blocks.cjs +23 -3
  76. package/build/components/provider/disable-non-page-content-blocks.cjs.map +2 -2
  77. package/build/components/provider/index.cjs +1 -1
  78. package/build/components/provider/index.cjs.map +2 -2
  79. package/build/components/provider/navigation-block-editing-mode.cjs +9 -2
  80. package/build/components/provider/navigation-block-editing-mode.cjs.map +2 -2
  81. package/build/components/provider/use-block-editor-settings.cjs +2 -1
  82. package/build/components/provider/use-block-editor-settings.cjs.map +2 -2
  83. package/build/components/resizable-editor/resize-handle.cjs.map +2 -2
  84. package/build/components/revision-diff-panel/index.cjs +7 -2
  85. package/build/components/revision-diff-panel/index.cjs.map +2 -2
  86. package/build/components/revision-fields-diff/index.cjs +6 -2
  87. package/build/components/revision-fields-diff/index.cjs.map +2 -2
  88. package/build/components/sidebar/dataform-post-summary.cjs +189 -29
  89. package/build/components/sidebar/dataform-post-summary.cjs.map +3 -3
  90. package/build/components/sidebar/index.cjs +1 -11
  91. package/build/components/sidebar/index.cjs.map +3 -3
  92. package/build/components/sidebar/post-revision-summary.cjs +11 -17
  93. package/build/components/sidebar/post-revision-summary.cjs.map +3 -3
  94. package/build/components/sidebar/post-summary.cjs +8 -6
  95. package/build/components/sidebar/post-summary.cjs.map +3 -3
  96. package/build/components/style-book/examples.cjs +1 -1
  97. package/build/components/style-book/examples.cjs.map +1 -1
  98. package/build/components/style-book/index.cjs +1 -1
  99. package/build/components/style-book/index.cjs.map +2 -2
  100. package/build/components/sync-connection-error-modal/index.cjs +3 -3
  101. package/build/components/sync-connection-error-modal/index.cjs.map +1 -1
  102. package/build/components/template-actions-panel/block-theme-content.cjs.map +2 -2
  103. package/build/components/template-actions-panel/index.cjs +0 -9
  104. package/build/components/template-actions-panel/index.cjs.map +3 -3
  105. package/build/components/template-validation-notice/index.cjs +1 -1
  106. package/build/components/template-validation-notice/index.cjs.map +1 -1
  107. package/build/components/upload-progress-snackbar/index.cjs +3 -3
  108. package/build/components/upload-progress-snackbar/index.cjs.map +2 -2
  109. package/build/components/upload-progress-snackbar/tracker.cjs.map +1 -1
  110. package/build/components/visual-editor/edit-template-blocks-notification.cjs +1 -1
  111. package/build/components/visual-editor/edit-template-blocks-notification.cjs.map +1 -1
  112. package/build/{components/revision-author-panel → dataviews/fields/revisions}/index.cjs +18 -26
  113. package/build/dataviews/fields/revisions/index.cjs.map +7 -0
  114. package/build/dataviews/fields/revisions/revisions-view.cjs +74 -0
  115. package/build/dataviews/fields/revisions/revisions-view.cjs.map +7 -0
  116. package/build/dataviews/store/private-actions.cjs +17 -5
  117. package/build/dataviews/store/private-actions.cjs.map +3 -3
  118. package/build/hooks/push-changes-to-global-styles/index.cjs +1 -1
  119. package/build/hooks/push-changes-to-global-styles/index.cjs.map +1 -1
  120. package/build/store/actions.cjs +1 -1
  121. package/build/store/actions.cjs.map +2 -2
  122. package/build/store/private-actions.cjs +2 -2
  123. package/build/store/private-actions.cjs.map +2 -2
  124. package/build/store/private-selectors.cjs +6 -1
  125. package/build/store/private-selectors.cjs.map +2 -2
  126. package/build/utils/media-upload/index.cjs.map +1 -1
  127. package/build/utils/set-nested-value.cjs.map +1 -1
  128. package/build-module/bindings/pattern-overrides.mjs +1 -1
  129. package/build-module/bindings/pattern-overrides.mjs.map +2 -2
  130. package/build-module/components/autosave-monitor/index.mjs +42 -81
  131. package/build-module/components/autosave-monitor/index.mjs.map +2 -2
  132. package/build-module/components/collab-sidebar/note-byline.mjs +1 -1
  133. package/build-module/components/collab-sidebar/note-byline.mjs.map +2 -2
  134. package/build-module/components/collab-sidebar/note.mjs +50 -18
  135. package/build-module/components/collab-sidebar/note.mjs.map +2 -2
  136. package/build-module/components/collab-sidebar/notes.mjs.map +1 -1
  137. package/build-module/components/collab-sidebar/utils.mjs +1 -1
  138. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  139. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs.map +1 -1
  140. package/build-module/components/collaborators-overlay/collaborator-styles.mjs.map +1 -1
  141. package/build-module/components/collaborators-overlay/compute-selection.mjs.map +1 -1
  142. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +1 -1
  143. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +1 -1
  144. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +1 -1
  145. package/build-module/components/collaborators-presence/avatar/component.mjs.map +2 -2
  146. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs.map +1 -1
  147. package/build-module/components/document-bar/index.mjs +7 -5
  148. package/build-module/components/document-bar/index.mjs.map +2 -2
  149. package/build-module/components/global-keyboard-shortcuts/index.mjs +3 -2
  150. package/build-module/components/global-keyboard-shortcuts/index.mjs.map +2 -2
  151. package/build-module/components/global-styles-sidebar/welcome-guide.mjs +3 -3
  152. package/build-module/components/global-styles-sidebar/welcome-guide.mjs.map +1 -1
  153. package/build-module/components/local-autosave-monitor/index.mjs +15 -16
  154. package/build-module/components/local-autosave-monitor/index.mjs.map +2 -2
  155. package/build-module/components/page-attributes/parent.mjs +1 -1
  156. package/build-module/components/page-attributes/parent.mjs.map +2 -2
  157. package/build-module/components/post-card-panel/index.mjs +1 -1
  158. package/build-module/components/post-card-panel/index.mjs.map +2 -2
  159. package/build-module/components/post-excerpt/panel.mjs +1 -1
  160. package/build-module/components/post-excerpt/panel.mjs.map +2 -2
  161. package/build-module/components/post-locked-modal/index.mjs +3 -3
  162. package/build-module/components/post-locked-modal/index.mjs.map +1 -1
  163. package/build-module/components/post-preview-button/index.mjs +2 -2
  164. package/build-module/components/post-preview-button/index.mjs.map +2 -2
  165. package/build-module/components/post-publish-button/index.mjs +4 -3
  166. package/build-module/components/post-publish-button/index.mjs.map +2 -2
  167. package/build-module/components/post-publish-button/label.mjs +2 -2
  168. package/build-module/components/post-publish-button/label.mjs.map +2 -2
  169. package/build-module/components/post-publish-panel/index.mjs.map +1 -1
  170. package/build-module/components/post-publish-panel/postpublish.mjs +1 -2
  171. package/build-module/components/post-publish-panel/postpublish.mjs.map +2 -2
  172. package/build-module/components/post-revisions-preview/block-diff.mjs.map +1 -1
  173. package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
  174. package/build-module/components/post-revisions-preview/revisions-slider.mjs +1 -1
  175. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  176. package/build-module/components/post-revisions-timeline/index.mjs +152 -0
  177. package/build-module/components/post-revisions-timeline/index.mjs.map +7 -0
  178. package/build-module/components/post-saved-state/index.mjs +17 -26
  179. package/build-module/components/post-saved-state/index.mjs.map +2 -2
  180. package/build-module/components/post-schedule/label.mjs +5 -5
  181. package/build-module/components/post-schedule/label.mjs.map +1 -1
  182. package/build-module/components/post-status/index.mjs +0 -1
  183. package/build-module/components/post-status/index.mjs.map +2 -2
  184. package/build-module/components/post-taxonomies/flat-term-selector.mjs +3 -6
  185. package/build-module/components/post-taxonomies/flat-term-selector.mjs.map +2 -2
  186. package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs +1 -2
  187. package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs.map +2 -2
  188. package/build-module/components/post-template/create-new-template-modal.mjs +0 -1
  189. package/build-module/components/post-template/create-new-template-modal.mjs.map +2 -2
  190. package/build-module/components/post-text-editor/index.mjs +51 -0
  191. package/build-module/components/post-text-editor/index.mjs.map +2 -2
  192. package/build-module/components/post-text-editor/utils.mjs +123 -0
  193. package/build-module/components/post-text-editor/utils.mjs.map +7 -0
  194. package/build-module/components/post-url/index.mjs +1 -1
  195. package/build-module/components/post-url/index.mjs.map +2 -2
  196. package/build-module/components/post-view-link/index.mjs +1 -1
  197. package/build-module/components/post-view-link/index.mjs.map +2 -2
  198. package/build-module/components/post-visibility/index.mjs +0 -1
  199. package/build-module/components/post-visibility/index.mjs.map +2 -2
  200. package/build-module/components/provider/disable-non-page-content-blocks.mjs +23 -3
  201. package/build-module/components/provider/disable-non-page-content-blocks.mjs.map +2 -2
  202. package/build-module/components/provider/index.mjs +1 -1
  203. package/build-module/components/provider/index.mjs.map +2 -2
  204. package/build-module/components/provider/navigation-block-editing-mode.mjs +10 -3
  205. package/build-module/components/provider/navigation-block-editing-mode.mjs.map +2 -2
  206. package/build-module/components/provider/use-block-editor-settings.mjs +2 -1
  207. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  208. package/build-module/components/resizable-editor/resize-handle.mjs.map +2 -2
  209. package/build-module/components/revision-diff-panel/index.mjs +7 -2
  210. package/build-module/components/revision-diff-panel/index.mjs.map +2 -2
  211. package/build-module/components/revision-fields-diff/index.mjs +6 -2
  212. package/build-module/components/revision-fields-diff/index.mjs.map +2 -2
  213. package/build-module/components/sidebar/dataform-post-summary.mjs +190 -30
  214. package/build-module/components/sidebar/dataform-post-summary.mjs.map +2 -2
  215. package/build-module/components/sidebar/index.mjs +1 -11
  216. package/build-module/components/sidebar/index.mjs.map +2 -2
  217. package/build-module/components/sidebar/post-revision-summary.mjs +11 -17
  218. package/build-module/components/sidebar/post-revision-summary.mjs.map +2 -2
  219. package/build-module/components/sidebar/post-summary.mjs +8 -6
  220. package/build-module/components/sidebar/post-summary.mjs.map +2 -2
  221. package/build-module/components/style-book/examples.mjs +1 -1
  222. package/build-module/components/style-book/examples.mjs.map +1 -1
  223. package/build-module/components/style-book/index.mjs +1 -1
  224. package/build-module/components/style-book/index.mjs.map +2 -2
  225. package/build-module/components/sync-connection-error-modal/index.mjs +3 -3
  226. package/build-module/components/sync-connection-error-modal/index.mjs.map +1 -1
  227. package/build-module/components/template-actions-panel/block-theme-content.mjs.map +2 -2
  228. package/build-module/components/template-actions-panel/index.mjs +0 -9
  229. package/build-module/components/template-actions-panel/index.mjs.map +2 -2
  230. package/build-module/components/template-validation-notice/index.mjs +1 -1
  231. package/build-module/components/template-validation-notice/index.mjs.map +1 -1
  232. package/build-module/components/upload-progress-snackbar/index.mjs +3 -3
  233. package/build-module/components/upload-progress-snackbar/index.mjs.map +2 -2
  234. package/build-module/components/upload-progress-snackbar/tracker.mjs.map +1 -1
  235. package/build-module/components/visual-editor/edit-template-blocks-notification.mjs +1 -1
  236. package/build-module/components/visual-editor/edit-template-blocks-notification.mjs.map +1 -1
  237. package/build-module/dataviews/fields/revisions/index.mjs +20 -0
  238. package/build-module/dataviews/fields/revisions/index.mjs.map +7 -0
  239. package/build-module/dataviews/fields/revisions/revisions-view.mjs +53 -0
  240. package/build-module/dataviews/fields/revisions/revisions-view.mjs.map +7 -0
  241. package/build-module/dataviews/store/private-actions.mjs +28 -8
  242. package/build-module/dataviews/store/private-actions.mjs.map +2 -2
  243. package/build-module/hooks/push-changes-to-global-styles/index.mjs +1 -1
  244. package/build-module/hooks/push-changes-to-global-styles/index.mjs.map +1 -1
  245. package/build-module/store/actions.mjs +1 -1
  246. package/build-module/store/actions.mjs.map +2 -2
  247. package/build-module/store/private-actions.mjs +2 -2
  248. package/build-module/store/private-actions.mjs.map +2 -2
  249. package/build-module/store/private-selectors.mjs +7 -1
  250. package/build-module/store/private-selectors.mjs.map +2 -2
  251. package/build-module/utils/media-upload/index.mjs.map +1 -1
  252. package/build-module/utils/set-nested-value.mjs.map +1 -1
  253. package/build-style/style-rtl.css +298 -238
  254. package/build-style/style.css +298 -238
  255. package/build-types/components/autosave-monitor/index.d.ts +11 -29
  256. package/build-types/components/autosave-monitor/index.d.ts.map +1 -1
  257. package/build-types/components/collab-sidebar/note-byline.d.ts +0 -3
  258. package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -1
  259. package/build-types/components/collab-sidebar/note.d.ts.map +1 -1
  260. package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -1
  261. package/build-types/components/document-bar/index.d.ts +2 -2
  262. package/build-types/components/document-bar/index.d.ts.map +1 -1
  263. package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -1
  264. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
  265. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  266. package/build-types/components/post-publish-panel/postpublish.d.ts.map +1 -1
  267. package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
  268. package/build-types/components/post-revisions-timeline/index.d.ts +2 -0
  269. package/build-types/components/post-revisions-timeline/index.d.ts.map +1 -0
  270. package/build-types/components/post-saved-state/index.d.ts.map +1 -1
  271. package/build-types/components/post-status/index.d.ts.map +1 -1
  272. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  273. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  274. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
  275. package/build-types/components/post-text-editor/index.d.ts +1 -1
  276. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  277. package/build-types/components/post-visibility/index.d.ts.map +1 -1
  278. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
  279. package/build-types/components/provider/index.d.ts.map +1 -1
  280. package/build-types/components/provider/navigation-block-editing-mode.d.ts.map +1 -1
  281. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  282. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
  283. package/build-types/components/revision-diff-panel/index.d.ts +3 -1
  284. package/build-types/components/revision-diff-panel/index.d.ts.map +1 -1
  285. package/build-types/components/revision-fields-diff/index.d.ts.map +1 -1
  286. package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
  287. package/build-types/components/sidebar/index.d.ts.map +1 -1
  288. package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -1
  289. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  290. package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -1
  291. package/build-types/components/template-actions-panel/index.d.ts.map +1 -1
  292. package/build-types/dataviews/fields/revisions/index.d.ts +8 -0
  293. package/build-types/dataviews/fields/revisions/index.d.ts.map +1 -0
  294. package/build-types/dataviews/fields/revisions/revisions-view.d.ts +2 -0
  295. package/build-types/dataviews/fields/revisions/revisions-view.d.ts.map +1 -0
  296. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  297. package/build-types/store/private-selectors.d.ts +1 -1
  298. package/build-types/store/private-selectors.d.ts.map +1 -1
  299. package/build-types/store/selectors.d.ts +1 -1
  300. package/build-types/store/selectors.d.ts.map +1 -1
  301. package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
  302. package/package.json +53 -47
  303. package/src/bindings/pattern-overrides.js +1 -1
  304. package/src/bindings/test/pattern-overrides.js +65 -0
  305. package/src/components/autosave-monitor/index.js +69 -104
  306. package/src/components/autosave-monitor/test/index.js +137 -122
  307. package/src/components/collab-sidebar/note-byline.js +0 -1
  308. package/src/components/collab-sidebar/note.js +64 -29
  309. package/src/components/collab-sidebar/style.scss +20 -0
  310. package/src/components/collaborators-presence/avatar/component.tsx +0 -1
  311. package/src/components/collaborators-presence/avatar/test/index.tsx +0 -1
  312. package/src/components/document-bar/index.js +8 -3
  313. package/src/components/document-bar/style.scss +4 -2
  314. package/src/components/global-keyboard-shortcuts/index.js +2 -1
  315. package/src/components/local-autosave-monitor/index.js +23 -21
  316. package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +1 -0
  317. package/src/components/post-card-panel/index.js +1 -1
  318. package/src/components/post-publish-button/index.js +6 -3
  319. package/src/components/post-publish-button/test/index.js +13 -0
  320. package/src/components/post-publish-panel/postpublish.js +0 -1
  321. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +7 -2
  322. package/src/components/post-revisions-preview/diff-markers.js +0 -1
  323. package/src/components/post-revisions-timeline/index.js +186 -0
  324. package/src/components/post-revisions-timeline/style.scss +43 -0
  325. package/src/components/post-saved-state/index.js +23 -26
  326. package/src/components/post-saved-state/test/__snapshots__/index.js.snap +1 -0
  327. package/src/components/post-saved-state/test/index.js +18 -0
  328. package/src/components/post-status/index.js +0 -1
  329. package/src/components/post-taxonomies/flat-term-selector.js +4 -7
  330. package/src/components/post-taxonomies/hierarchical-term-selector.js +0 -1
  331. package/src/components/post-template/create-new-template-modal.js +0 -1
  332. package/src/components/post-text-editor/index.js +65 -0
  333. package/src/components/post-text-editor/test/utils.js +210 -0
  334. package/src/components/post-text-editor/utils.js +204 -0
  335. package/src/components/post-type-support-check/test/index.js +11 -0
  336. package/src/components/post-url/index.js +1 -1
  337. package/src/components/post-view-link/index.js +1 -1
  338. package/src/components/post-view-link/test/index.js +71 -0
  339. package/src/components/post-visibility/index.js +0 -1
  340. package/src/components/provider/disable-non-page-content-blocks.js +23 -6
  341. package/src/components/provider/index.js +2 -1
  342. package/src/components/provider/navigation-block-editing-mode.js +10 -4
  343. package/src/components/provider/use-block-editor-settings.js +3 -1
  344. package/src/components/resizable-editor/resize-handle.js +0 -1
  345. package/src/components/revision-diff-panel/index.js +8 -2
  346. package/src/components/revision-fields-diff/index.js +12 -1
  347. package/src/components/sidebar/dataform-post-summary.js +291 -36
  348. package/src/components/sidebar/index.js +2 -12
  349. package/src/components/sidebar/post-revision-summary.js +8 -15
  350. package/src/components/sidebar/post-summary.js +12 -10
  351. package/src/components/style-book/index.js +1 -1
  352. package/src/components/template-actions-panel/block-theme-content.js +0 -1
  353. package/src/components/template-actions-panel/index.js +0 -15
  354. package/src/dataviews/fields/revisions/index.tsx +28 -0
  355. package/src/dataviews/fields/revisions/revisions-view.tsx +59 -0
  356. package/src/dataviews/store/private-actions.ts +35 -7
  357. package/src/store/private-actions.js +2 -2
  358. package/src/store/private-selectors.js +11 -1
  359. package/src/store/test/actions.js +2 -2
  360. package/src/store/test/private-selectors.js +69 -0
  361. package/src/style.scss +1 -1
  362. package/build/components/post-revisions-panel/index.cjs +0 -173
  363. package/build/components/post-revisions-panel/index.cjs.map +0 -7
  364. package/build/components/revision-author-panel/index.cjs.map +0 -7
  365. package/build/components/revision-created-panel/index.cjs +0 -47
  366. package/build/components/revision-created-panel/index.cjs.map +0 -7
  367. package/build-module/components/post-revisions-panel/index.mjs +0 -148
  368. package/build-module/components/post-revisions-panel/index.mjs.map +0 -7
  369. package/build-module/components/revision-author-panel/index.mjs +0 -28
  370. package/build-module/components/revision-author-panel/index.mjs.map +0 -7
  371. package/build-module/components/revision-created-panel/index.mjs +0 -26
  372. package/build-module/components/revision-created-panel/index.mjs.map +0 -7
  373. package/build-types/components/collab-sidebar/add-comment.d.ts +0 -6
  374. package/build-types/components/collab-sidebar/add-comment.d.ts.map +0 -1
  375. package/build-types/components/collab-sidebar/comment-author-info.d.ts +0 -8
  376. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +0 -1
  377. package/build-types/components/collab-sidebar/comment-form.d.ts +0 -9
  378. package/build-types/components/collab-sidebar/comment-form.d.ts.map +0 -1
  379. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts +0 -6
  380. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +0 -1
  381. package/build-types/components/collab-sidebar/comment-menu-item.d.ts +0 -6
  382. package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +0 -1
  383. package/build-types/components/collab-sidebar/comments.d.ts +0 -10
  384. package/build-types/components/collab-sidebar/comments.d.ts.map +0 -1
  385. package/build-types/components/global-styles-provider/index.d.ts +0 -16
  386. package/build-types/components/global-styles-provider/index.d.ts.map +0 -1
  387. package/build-types/components/media/index.d.ts +0 -3
  388. package/build-types/components/media/index.d.ts.map +0 -1
  389. package/build-types/components/media/metadata-panel.d.ts +0 -12
  390. package/build-types/components/media/metadata-panel.d.ts.map +0 -1
  391. package/build-types/components/media/preview.d.ts +0 -9
  392. package/build-types/components/media/preview.d.ts.map +0 -1
  393. package/build-types/components/post-revisions-panel/index.d.ts +0 -2
  394. package/build-types/components/post-revisions-panel/index.d.ts.map +0 -1
  395. package/build-types/components/revision-author-panel/index.d.ts +0 -2
  396. package/build-types/components/revision-author-panel/index.d.ts.map +0 -1
  397. package/build-types/components/revision-created-panel/index.d.ts +0 -2
  398. package/build-types/components/revision-created-panel/index.d.ts.map +0 -1
  399. package/src/components/editor-help/images/add-dark.png +0 -0
  400. package/src/components/editor-help/images/add-dark@2x.png +0 -0
  401. package/src/components/editor-help/images/add-dark@3x.png +0 -0
  402. package/src/components/editor-help/images/add-light.png +0 -0
  403. package/src/components/editor-help/images/add-light@2x.png +0 -0
  404. package/src/components/editor-help/images/add-light@3x.png +0 -0
  405. package/src/components/editor-help/images/block-layout-collage.png +0 -0
  406. package/src/components/editor-help/images/block-layout-collage@2x.png +0 -0
  407. package/src/components/editor-help/images/block-layout-collage@3x.png +0 -0
  408. package/src/components/editor-help/images/build-layouts-dark.png +0 -0
  409. package/src/components/editor-help/images/build-layouts-dark@2x.png +0 -0
  410. package/src/components/editor-help/images/build-layouts-dark@3x.png +0 -0
  411. package/src/components/editor-help/images/build-layouts-light.png +0 -0
  412. package/src/components/editor-help/images/build-layouts-light@2x.png +0 -0
  413. package/src/components/editor-help/images/build-layouts-light@3x.png +0 -0
  414. package/src/components/editor-help/images/drag-and-drop-dark.png +0 -0
  415. package/src/components/editor-help/images/drag-and-drop-dark@2x.png +0 -0
  416. package/src/components/editor-help/images/drag-and-drop-dark@3x.png +0 -0
  417. package/src/components/editor-help/images/drag-and-drop-light.png +0 -0
  418. package/src/components/editor-help/images/drag-and-drop-light@2x.png +0 -0
  419. package/src/components/editor-help/images/drag-and-drop-light@3x.png +0 -0
  420. package/src/components/editor-help/images/edit-media-dark.png +0 -0
  421. package/src/components/editor-help/images/edit-media-dark@2x.png +0 -0
  422. package/src/components/editor-help/images/edit-media-dark@3x.png +0 -0
  423. package/src/components/editor-help/images/edit-media-light.png +0 -0
  424. package/src/components/editor-help/images/edit-media-light@2x.png +0 -0
  425. package/src/components/editor-help/images/edit-media-light@3x.png +0 -0
  426. package/src/components/editor-help/images/embed-media-dark.png +0 -0
  427. package/src/components/editor-help/images/embed-media-dark@2x.png +0 -0
  428. package/src/components/editor-help/images/embed-media-dark@3x.png +0 -0
  429. package/src/components/editor-help/images/embed-media-light.png +0 -0
  430. package/src/components/editor-help/images/embed-media-light@2x.png +0 -0
  431. package/src/components/editor-help/images/embed-media-light@3x.png +0 -0
  432. package/src/components/editor-help/images/move-dark.png +0 -0
  433. package/src/components/editor-help/images/move-dark@2x.png +0 -0
  434. package/src/components/editor-help/images/move-dark@3x.png +0 -0
  435. package/src/components/editor-help/images/move-light.png +0 -0
  436. package/src/components/editor-help/images/move-light@2x.png +0 -0
  437. package/src/components/editor-help/images/move-light@3x.png +0 -0
  438. package/src/components/editor-help/images/options-dark.png +0 -0
  439. package/src/components/editor-help/images/options-dark@2x.png +0 -0
  440. package/src/components/editor-help/images/options-dark@3x.png +0 -0
  441. package/src/components/editor-help/images/options-light.png +0 -0
  442. package/src/components/editor-help/images/options-light@2x.png +0 -0
  443. package/src/components/editor-help/images/options-light@3x.png +0 -0
  444. package/src/components/editor-help/images/rich-text-dark.png +0 -0
  445. package/src/components/editor-help/images/rich-text-dark@2x.png +0 -0
  446. package/src/components/editor-help/images/rich-text-dark@3x.png +0 -0
  447. package/src/components/editor-help/images/rich-text-light.png +0 -0
  448. package/src/components/editor-help/images/rich-text-light@2x.png +0 -0
  449. package/src/components/editor-help/images/rich-text-light@3x.png +0 -0
  450. package/src/components/editor-help/images/settings-dark.png +0 -0
  451. package/src/components/editor-help/images/settings-dark@2x.png +0 -0
  452. package/src/components/editor-help/images/settings-dark@3x.png +0 -0
  453. package/src/components/editor-help/images/settings-light.png +0 -0
  454. package/src/components/editor-help/images/settings-light@2x.png +0 -0
  455. package/src/components/editor-help/images/settings-light@3x.png +0 -0
  456. package/src/components/editor-help/style.scss +0 -123
  457. package/src/components/post-revisions-panel/index.js +0 -161
  458. package/src/components/post-revisions-panel/style.scss +0 -16
  459. package/src/components/revision-author-panel/index.js +0 -36
  460. package/src/components/revision-created-panel/index.js +0 -36
@@ -2,10 +2,10 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { useDispatch, useSelect } from '@wordpress/data';
5
+ import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
6
6
  import { store as coreDataStore } from '@wordpress/core-data';
7
7
  import { DataForm } from '@wordpress/dataviews';
8
- import { __experimentalVStack as VStack } from '@wordpress/components';
8
+ import { Stack } from '@wordpress/ui';
9
9
  import { useMemo } from '@wordpress/element';
10
10
  import { useViewConfig } from '@wordpress/views';
11
11
 
@@ -18,22 +18,190 @@ import { store as editorStore } from '../../store';
18
18
  import PostTrash from '../post-trash';
19
19
  import usePostFields from '../post-fields';
20
20
  import { usePostTemplatePanelMode } from '../post-template/hooks';
21
+ import revisionsField from '../../dataviews/fields/revisions';
21
22
 
22
23
  const EMPTY_FORM = { layout: { type: 'panel' }, fields: [] };
24
+ const VIEW_CONFIG_FIELDS = [ 'form' ];
23
25
 
24
- export default function DataFormPostSummary( { onActionPerformed } ) {
25
- const { postType, postId } = useSelect( ( select ) => {
26
- const { getCurrentPostType, getCurrentPostId } = select( editorStore );
26
+ /**
27
+ * Bridges the legacy editor-panel visibility controls onto the DataForm summary,
28
+ * returning the form with the hidden fields removed. The new inspector has no
29
+ * concept of the Preferences → Panels switches or of `removeEditorPanel`, so we
30
+ * reproduce their effect on the form.
31
+ *
32
+ * @param {Object} form The DataForm summary form configuration.
33
+ * @return {Object} The form with the hidden fields removed.
34
+ */
35
+ function useInspectorPanelVisibility( form ) {
36
+ const {
37
+ isPostStatusRemoved,
38
+ featuredImageEnabled,
39
+ excerptEnabled,
40
+ discussionEnabled,
41
+ pageAttributesEnabled,
42
+ } = useSelect( ( select ) => {
43
+ const { isEditorPanelRemoved, isEditorPanelEnabled } =
44
+ select( editorStore );
27
45
  return {
28
- postType: getCurrentPostType(),
29
- postId: getCurrentPostId(),
46
+ isPostStatusRemoved: isEditorPanelRemoved( 'post-status' ),
47
+ featuredImageEnabled: isEditorPanelEnabled( 'featured-image' ),
48
+ excerptEnabled: isEditorPanelEnabled( 'post-excerpt' ),
49
+ discussionEnabled: isEditorPanelEnabled( 'discussion-panel' ),
50
+ pageAttributesEnabled: isEditorPanelEnabled( 'page-attributes' ),
30
51
  };
31
52
  }, [] );
53
+
54
+ const visibleForm = useMemo( () => {
55
+ if ( ! form.fields?.length ) {
56
+ return form;
57
+ }
58
+ // `featured_media`/`excerpt` are their own top-level panels and
59
+ // `post-content-info` is always shown, so they survive. Everything else
60
+ // belongs to the `post-status` summary panel: `discussion`/`parent` honor
61
+ // their own switch, but every one of them is hidden while the `post-status`
62
+ // panel is removed.
63
+ const visibilityById = {
64
+ featured_media: featuredImageEnabled,
65
+ excerpt: excerptEnabled,
66
+ 'post-content-info': true,
67
+ discussion: discussionEnabled && ! isPostStatusRemoved,
68
+ parent: pageAttributesEnabled && ! isPostStatusRemoved,
69
+ };
70
+ const isFieldVisible = ( id ) =>
71
+ id in visibilityById ? visibilityById[ id ] : ! isPostStatusRemoved;
72
+ // Recurse into `children` so a panel-tied field is dropped wherever it
73
+ // sits in the form: the PHP view-config filter can nest such a field
74
+ // inside another field's group.
75
+ const filterFields = ( fields ) =>
76
+ fields.reduce( ( acc, field ) => {
77
+ const id = typeof field === 'string' ? field : field.id;
78
+ if ( ! isFieldVisible( id ) ) {
79
+ return acc;
80
+ }
81
+ if (
82
+ typeof field !== 'string' &&
83
+ Array.isArray( field.children )
84
+ ) {
85
+ const children = filterFields( field.children );
86
+ // A group whose children were all removed would render as
87
+ // an empty panel, so drop it too.
88
+ if ( ! children.length ) {
89
+ return acc;
90
+ }
91
+ acc.push( { ...field, children } );
92
+ return acc;
93
+ }
94
+ acc.push( field );
95
+ return acc;
96
+ }, [] );
97
+ return { ...form, fields: filterFields( form.fields ) };
98
+ }, [
99
+ form,
100
+ isPostStatusRemoved,
101
+ featuredImageEnabled,
102
+ excerptEnabled,
103
+ discussionEnabled,
104
+ pageAttributesEnabled,
105
+ ] );
106
+
107
+ return visibleForm;
108
+ }
109
+
110
+ // Some post types expose summary fields that edit entities other than the one
111
+ // being edited. Keyed by the post type that needs them, the related records are
112
+ // merged into the form data under a `${ kind }_${ name }` namespace key so that
113
+ // a single DataForm can read and write all of them, and edits to those keys are
114
+ // routed back to their entity.
115
+ //
116
+ // The fields themselves are namespace-agnostic: they read and write a plain
117
+ // record. The `fields` list ties each one to the entity it edits, and this
118
+ // component overrides their `getValue`/`setValue`/`render` to operate on the
119
+ // namespaced record, plus their `isVisible` to only show where that record is
120
+ // present (e.g. the `home`/`index` template summary).
121
+ //
122
+ // Currently only `wp_template` uses this: `posts_per_page` and
123
+ // `default_comment_status` target `root/site`, and `posts_page_title` targets
124
+ // the posts page (the `page` assigned as `page_for_posts`).
125
+ const ENTITIES = {
126
+ wp_template: {
127
+ root_site: {
128
+ kind: 'root',
129
+ name: 'site',
130
+ fields: [ 'posts_per_page', 'default_comment_status' ],
131
+ isVisible: ( item ) =>
132
+ [ 'home', 'index' ].includes( item.slug ?? '' ),
133
+ },
134
+ posttype_page: {
135
+ kind: 'postType',
136
+ name: 'page',
137
+ getId: ( select ) =>
138
+ select( coreDataStore ).getEditedEntityRecord( 'root', 'site' )
139
+ ?.page_for_posts,
140
+ fields: [ 'posts_page_title' ],
141
+ isVisible: ( item ) =>
142
+ [ 'home', 'index' ].includes( item.slug ?? '' ),
143
+ },
144
+ },
145
+ };
146
+
147
+ // Rebinds a namespace-agnostic field to the namespaced record it edits. Every
148
+ // field callback that receives the form `item` is redirected to the
149
+ // `item[ namespace ]` sub-record so the field operates on its own entity:
150
+ // `getValue`/`setValue`/`render` here, and the rest indirectly because they all
151
+ // funnel through the (remapped) `getValue` (default `render`, `getValueFormatted`
152
+ // and `isValid` range/`custom` validation). Edits are wrapped back under the
153
+ // namespace key. The caller-supplied `isVisible` encodes entity-specific
154
+ // conditions (e.g. only for `home`/`index` templates); the generic guard
155
+ // `!! item[ namespace ]` ensures the field is hidden when the sub-record
156
+ // hasn't been fetched.
157
+ function bindFieldToNamespace( field, namespace, isVisible = () => true ) {
158
+ const subItem = ( item ) => item?.[ namespace ] ?? {};
159
+ return {
160
+ ...field,
161
+ getValue: ( { item } ) =>
162
+ field.getValue
163
+ ? field.getValue( { item: subItem( item ) } )
164
+ : subItem( item )[ field.id ],
165
+ setValue: ( { item, value } ) => ( {
166
+ [ namespace ]: field.setValue( { item: subItem( item ), value } ),
167
+ } ),
168
+ render: field.render
169
+ ? ( props ) =>
170
+ field.render( { ...props, item: subItem( props.item ) } )
171
+ : undefined,
172
+ isVisible: ( item ) => isVisible( item ) && !! item[ namespace ],
173
+ };
174
+ }
175
+
176
+ export default function DataFormPostSummary( { onActionPerformed } ) {
177
+ const { postType, postId, isPostStatusRemoved, availableTemplates } =
178
+ useSelect( ( select ) => {
179
+ const {
180
+ getCurrentPostType,
181
+ getCurrentPostId,
182
+ isEditorPanelRemoved,
183
+ getEditorSettings,
184
+ } = select( editorStore );
185
+ const _availableTemplates = select(
186
+ coreDataStore
187
+ ).getCurrentTheme()?.is_block_theme
188
+ ? null
189
+ : getEditorSettings().availableTemplates ?? null;
190
+ return {
191
+ postType: getCurrentPostType(),
192
+ postId: getCurrentPostId(),
193
+ isPostStatusRemoved: isEditorPanelRemoved( 'post-status' ),
194
+ availableTemplates: _availableTemplates,
195
+ };
196
+ }, [] );
32
197
  const { form: formConfig } = useViewConfig( {
33
198
  kind: 'postType',
34
199
  name: postType,
200
+ fields: VIEW_CONFIG_FIELDS,
35
201
  } );
36
- const form = formConfig ?? EMPTY_FORM;
202
+ // Bridge the legacy editor-panel visibility (Preferences → Panels and
203
+ // programmatic panel removal) onto the form by dropping hidden fields.
204
+ const form = useInspectorPanelVisibility( formConfig ?? EMPTY_FORM );
37
205
  const record = useSelect(
38
206
  ( select ) => {
39
207
  if ( ! postType || ! postId ) {
@@ -50,33 +218,82 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
50
218
 
51
219
  const templatePanelMode = usePostTemplatePanelMode();
52
220
 
53
- const availableTemplates = useSelect( ( select ) => {
54
- if ( select( coreDataStore ).getCurrentTheme()?.is_block_theme ) {
55
- return null;
56
- }
57
- return (
58
- select( editorStore ).getEditorSettings().availableTemplates ?? {}
59
- );
60
- }, [] );
221
+ const entityRecords = useSelect(
222
+ ( select ) => {
223
+ const { getEditedEntityRecord, canUser } = select( coreDataStore );
61
224
 
62
- // Augment record only when needed(not a block theme with available templates).
63
- const augmentedRecord = useMemo( () => {
64
- if ( ! record || ! availableTemplates ) {
225
+ const records = {};
226
+
227
+ // Other entities the current post type needs merged into its form.
228
+ for ( const [ namespace, entity ] of Object.entries(
229
+ ENTITIES[ postType ] ?? {}
230
+ ) ) {
231
+ if (
232
+ ! canUser( 'read', {
233
+ kind: entity.kind,
234
+ name: entity.name,
235
+ } )
236
+ ) {
237
+ continue;
238
+ }
239
+ const id = entity.getId ? entity.getId( select ) : undefined;
240
+ // Entities resolved through another record need a valid id.
241
+ if ( entity.getId && ! id ) {
242
+ continue;
243
+ }
244
+ records[ namespace ] = getEditedEntityRecord(
245
+ entity.kind,
246
+ entity.name,
247
+ id
248
+ );
249
+ }
250
+
251
+ return records;
252
+ },
253
+ [ postType ]
254
+ );
255
+
256
+ // Merge the supplementary data onto the record.
257
+ const data = useMemo( () => {
258
+ if ( ! record ) {
65
259
  return record;
66
260
  }
67
- return {
68
- ...record,
69
- available_templates: availableTemplates,
70
- };
71
- }, [ record, availableTemplates ] );
261
+ const extra = { ...entityRecords };
262
+ if ( availableTemplates && Object.keys( availableTemplates ).length ) {
263
+ extra.available_templates = availableTemplates;
264
+ }
265
+ return { ...record, ...extra };
266
+ }, [ record, entityRecords, availableTemplates ] );
72
267
 
73
268
  const { editEntityRecord } = useDispatch( coreDataStore );
269
+ const registry = useRegistry();
270
+
271
+ // Map of namespaced field id to the namespace key its entity is merged under.
272
+ const fieldNamespaces = useMemo( () => {
273
+ const map = {};
274
+ for ( const [ namespace, entity ] of Object.entries(
275
+ ENTITIES[ postType ] ?? {}
276
+ ) ) {
277
+ for ( const id of entity.fields ?? [] ) {
278
+ map[ id ] = namespace;
279
+ }
280
+ }
281
+ return map;
282
+ }, [ postType ] );
74
283
 
75
284
  const _fields = usePostFields( { postType } );
76
285
  const fields = useMemo(
77
286
  () =>
78
287
  _fields
79
288
  ?.map( ( field ) => {
289
+ const namespace = fieldNamespaces[ field.id ];
290
+ if ( namespace ) {
291
+ return bindFieldToNamespace(
292
+ field,
293
+ namespace,
294
+ ENTITIES[ postType ]?.[ namespace ]?.isVisible
295
+ );
296
+ }
80
297
  if ( field.id === 'status' ) {
81
298
  return {
82
299
  ...field,
@@ -107,41 +324,79 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
107
324
  }
108
325
  return field;
109
326
  } )
110
- .filter( Boolean ),
111
- [ _fields, templatePanelMode, availableTemplates ]
327
+ .filter( Boolean )
328
+ // Editor-only field, injected here rather than registered
329
+ // so it never leaks into the site editor list / quick-edit fields.
330
+ .concat( revisionsField ),
331
+ [
332
+ _fields,
333
+ templatePanelMode,
334
+ availableTemplates,
335
+ fieldNamespaces,
336
+ postType,
337
+ ]
112
338
  );
113
339
 
114
340
  const onChange = ( edits ) => {
341
+ // Route edits that target another entity (merged in under a namespace)
342
+ // back to that entity; collect the rest for the post being edited.
343
+ const entities = ENTITIES[ postType ] ?? {};
344
+ const baseEdits = {};
345
+ for ( const [ key, value ] of Object.entries( edits ) ) {
346
+ const entity = entities[ key ];
347
+ if ( entity ) {
348
+ // Resolve the id the same way it was resolved to read the
349
+ // record, so the save targets the right entity regardless of
350
+ // its key field (`undefined` for the `root/site` singleton).
351
+ const id = entity.getId
352
+ ? entity.getId( registry.select )
353
+ : undefined;
354
+ editEntityRecord( entity.kind, entity.name, id, value );
355
+ } else {
356
+ baseEdits[ key ] = value;
357
+ }
358
+ }
359
+
360
+ if ( ! Object.keys( baseEdits ).length ) {
361
+ return;
362
+ }
363
+
115
364
  if (
116
- edits.status &&
117
- edits.status !== 'future' &&
365
+ baseEdits.status &&
366
+ baseEdits.status !== 'future' &&
118
367
  record?.status === 'future' &&
119
368
  new Date( record.date ) > new Date()
120
369
  ) {
121
- edits.date = null;
370
+ baseEdits.date = null;
122
371
  }
123
- if ( edits.status && edits.status === 'private' && record?.password ) {
124
- edits.password = '';
372
+ if (
373
+ baseEdits.status &&
374
+ baseEdits.status === 'private' &&
375
+ record?.password
376
+ ) {
377
+ baseEdits.password = '';
125
378
  }
126
379
 
127
- editEntityRecord( 'postType', postType, postId, edits );
380
+ editEntityRecord( 'postType', postType, postId, baseEdits );
128
381
  };
129
382
  return (
130
383
  <PostPanelSection className="editor-post-summary">
131
- <VStack spacing={ 4 }>
384
+ <Stack direction="column" gap="lg">
132
385
  <PostCardPanel
133
386
  postType={ postType }
134
387
  postId={ postId }
135
388
  onActionPerformed={ onActionPerformed }
136
389
  />
137
390
  <DataForm
138
- data={ augmentedRecord }
391
+ data={ data }
139
392
  fields={ fields }
140
393
  form={ form }
141
394
  onChange={ onChange }
142
395
  />
143
- <PostTrash onActionPerformed={ onActionPerformed } />
144
- </VStack>
396
+ { ! isPostStatusRemoved && (
397
+ <PostTrash onActionPerformed={ onActionPerformed } />
398
+ ) }
399
+ </Stack>
145
400
  </PostPanelSection>
146
401
  );
147
402
  }
@@ -27,7 +27,6 @@ import SidebarHeader from './header';
27
27
  import TemplateActionsPanel from '../template-actions-panel';
28
28
  import TemplateContentPanel from '../template-content-panel';
29
29
  import TemplatePartContentPanel from '../template-part-content-panel';
30
- import PostRevisionsPanel from '../post-revisions-panel';
31
30
  import RevisionBlockDiffPanel from '../revision-block-diff';
32
31
  import useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';
33
32
  import { sidebars } from './constants';
@@ -96,17 +95,8 @@ const SidebarContent = ( {
96
95
  <PluginDocumentSettingPanel.Slot />
97
96
  <TemplateContentPanel />
98
97
  { window?.__experimentalDataFormInspector &&
99
- [
100
- 'post',
101
- 'page',
102
- 'wp_template',
103
- 'wp_template_part',
104
- 'wp_block',
105
- ].includes( postType ) && (
106
- <>
107
- <TemplateActionsPanel />
108
- <PostRevisionsPanel />
109
- </>
98
+ [ 'page', 'post' ].includes( postType ) && (
99
+ <TemplateActionsPanel />
110
100
  ) }
111
101
  <TemplatePartContentPanel />
112
102
  <PostTransformPanel />
@@ -14,22 +14,19 @@ import { addQueryArgs } from '@wordpress/url';
14
14
  */
15
15
  import { store as editorStore } from '../../store';
16
16
  import { unlock } from '../../lock-unlock';
17
- import RevisionAuthorPanel from '../revision-author-panel';
18
- import RevisionCreatedPanel from '../revision-created-panel';
19
- import { PostContentInformationUI } from '../post-content-information';
20
- import RevisionFieldsDiffPanel from '../revision-fields-diff';
17
+ import PostRevisionsTimeline from '../post-revisions-timeline';
21
18
  import PostPanelSection from '../post-panel-section';
22
19
  import PostCardPanel from '../post-card-panel';
20
+ import RevisionFieldsDiffPanel from '../revision-fields-diff';
23
21
 
24
22
  export default function PostRevisionSummary() {
25
- const { revisionId, postId, postContent } = useSelect( ( select ) => {
26
- const { getCurrentRevisionId, getCurrentRevision, getCurrentPostId } =
27
- unlock( select( editorStore ) );
28
- const _revisionId = getCurrentRevisionId();
23
+ const { revisionId, postId } = useSelect( ( select ) => {
24
+ const { getCurrentRevisionId, getCurrentPostId } = unlock(
25
+ select( editorStore )
26
+ );
29
27
  return {
30
- revisionId: _revisionId,
28
+ revisionId: getCurrentRevisionId(),
31
29
  postId: getCurrentPostId(),
32
- postContent: _revisionId && getCurrentRevision()?.content?.raw,
33
30
  };
34
31
  }, [] );
35
32
  if ( ! revisionId ) {
@@ -40,10 +37,6 @@ export default function PostRevisionSummary() {
40
37
  <PostPanelSection className="editor-post-summary">
41
38
  <VStack spacing={ 4 }>
42
39
  <PostCardPanel postId={ postId } hideActions />
43
- <VStack spacing={ 1 }>
44
- <PostContentInformationUI postContent={ postContent } />
45
- <RevisionCreatedPanel />
46
- </VStack>
47
40
  <ExternalLink
48
41
  href={ addQueryArgs( 'revision.php', {
49
42
  revision: revisionId,
@@ -51,10 +44,10 @@ export default function PostRevisionSummary() {
51
44
  >
52
45
  { __( 'Open classic revisions screen' ) }
53
46
  </ExternalLink>
54
- <RevisionAuthorPanel />
55
47
  </VStack>
56
48
  </PostPanelSection>
57
49
  <RevisionFieldsDiffPanel />
50
+ <PostRevisionsTimeline />
58
51
  </>
59
52
  );
60
53
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __experimentalVStack as VStack } from '@wordpress/components';
4
+ import { Stack } from '@wordpress/ui';
5
5
  import { useSelect } from '@wordpress/data';
6
6
 
7
7
  /**
@@ -43,7 +43,9 @@ export default function PostSummary( { onActionPerformed } ) {
43
43
  );
44
44
  if (
45
45
  window?.__experimentalDataFormInspector &&
46
- [ 'page', 'post' ].includes( postType )
46
+ [ 'page', 'post', 'wp_template', 'wp_template_part' ].includes(
47
+ postType
48
+ )
47
49
  ) {
48
50
  return <DataFormPostSummary onActionPerformed={ onActionPerformed } />;
49
51
  }
@@ -73,7 +75,7 @@ function ClassicPostSummary( { onActionPerformed } ) {
73
75
  <PluginPostStatusInfo.Slot>
74
76
  { ( fills ) => (
75
77
  <>
76
- <VStack spacing={ 4 }>
78
+ <Stack direction="column" gap="lg">
77
79
  <PostCardPanel
78
80
  postType={ postType }
79
81
  postId={ postId }
@@ -81,13 +83,13 @@ function ClassicPostSummary( { onActionPerformed } ) {
81
83
  />
82
84
  <PostFeaturedImagePanel withPanelBody={ false } />
83
85
  <PostExcerptPanel />
84
- <VStack spacing={ 1 }>
86
+ <Stack direction="column" gap="xs">
85
87
  <PostContentInformation />
86
88
  <PostLastEditedPanel />
87
- </VStack>
89
+ </Stack>
88
90
  { ! isRemovedPostStatusPanel && (
89
- <VStack spacing={ 4 }>
90
- <VStack spacing={ 1 }>
91
+ <Stack direction="column" gap="lg">
92
+ <Stack direction="column" gap="xs">
91
93
  <PostStatusPanel />
92
94
  <PostSchedulePanel />
93
95
  <PostURLPanel />
@@ -102,13 +104,13 @@ function ClassicPostSummary( { onActionPerformed } ) {
102
104
  <SiteDiscussion />
103
105
  <PostFormatPanel />
104
106
  { fills }
105
- </VStack>
107
+ </Stack>
106
108
  <PostTrash
107
109
  onActionPerformed={ onActionPerformed }
108
110
  />
109
- </VStack>
111
+ </Stack>
110
112
  ) }
111
- </VStack>
113
+ </Stack>
112
114
  </>
113
115
  ) }
114
116
  </PluginPostStatusInfo.Slot>
@@ -500,7 +500,7 @@ export const StyleBookPreview = ( {
500
500
  return { examples: examplesForSinglePageUse };
501
501
  }
502
502
 
503
- if ( blockVariation ) {
503
+ if ( blockVariation && filteredExamples?.examples?.length ) {
504
504
  return {
505
505
  examples: applyBlockVariationsToExamples(
506
506
  filteredExamples.examples,
@@ -20,7 +20,6 @@ import { decodeEntities } from '@wordpress/html-entities';
20
20
  import { ENTER, SPACE } from '@wordpress/keycodes';
21
21
  import { store as noticesStore } from '@wordpress/notices';
22
22
  import { store as preferencesStore } from '@wordpress/preferences';
23
- // eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
24
23
  import { Tooltip } from '@wordpress/ui';
25
24
 
26
25
  /**
@@ -1,27 +1,12 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useSelect } from '@wordpress/data';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
9
- import { store as editorStore } from '../../store';
10
4
  import { usePostTemplatePanelMode } from '../post-template/hooks';
11
5
  import BlockThemeContent from './block-theme-content';
12
6
  import ClassicThemeContent from './classic-theme-content';
13
7
 
14
8
  export default function TemplateActionsPanel() {
15
- const postType = useSelect(
16
- ( select ) => select( editorStore ).getCurrentPostType(),
17
- []
18
- );
19
9
  const mode = usePostTemplatePanelMode();
20
- // This check is because the experiment is gated for these post
21
- // types for now. Later we should use `postType.viewable`.
22
- if ( ! [ 'page', 'post' ].includes( postType ) ) {
23
- return null;
24
- }
25
10
  if ( mode === 'classic' ) {
26
11
  return <ClassicThemeContent />;
27
12
  }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import type { Field } from '@wordpress/dataviews';
5
+ import type { BasePost } from '@wordpress/fields';
6
+ import { __ } from '@wordpress/i18n';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import RevisionsView from './revisions-view';
12
+
13
+ const revisionsField: Field< BasePost > = {
14
+ id: 'revisions',
15
+ label: __( 'Revisions' ),
16
+ readOnly: true,
17
+ enableSorting: false,
18
+ render: RevisionsView,
19
+ isVisible: ( item ) => {
20
+ const revisionsCount =
21
+ item._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;
22
+ const lastRevisionId =
23
+ item._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;
24
+ return !! lastRevisionId && revisionsCount >= 2;
25
+ },
26
+ };
27
+
28
+ export default revisionsField;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { Button } from '@wordpress/components';
5
+ import { useDispatch, useSelect } from '@wordpress/data';
6
+ import { _n, sprintf } from '@wordpress/i18n';
7
+ import { addQueryArgs } from '@wordpress/url';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ // @ts-ignore
13
+ import { store as editorStore } from '../../../store';
14
+ import { unlock } from '../../../lock-unlock';
15
+
16
+ export default function RevisionsView() {
17
+ const { lastRevisionId, revisionsCount, disableVisualRevisions } =
18
+ useSelect( ( select ) => {
19
+ const {
20
+ getCurrentPostLastRevisionId,
21
+ getCurrentPostRevisionsCount,
22
+ getEditorSettings,
23
+ // @ts-ignore
24
+ } = select( editorStore );
25
+ return {
26
+ lastRevisionId: getCurrentPostLastRevisionId(),
27
+ revisionsCount: getCurrentPostRevisionsCount(),
28
+ disableVisualRevisions:
29
+ // @ts-ignore
30
+ !! getEditorSettings().disableVisualRevisions,
31
+ };
32
+ }, [] );
33
+ const { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );
34
+
35
+ const buttonProps = disableVisualRevisions
36
+ ? {
37
+ href: addQueryArgs( 'revision.php', {
38
+ revision: lastRevisionId,
39
+ } ),
40
+ }
41
+ : { onClick: () => setCurrentRevisionId( lastRevisionId ) };
42
+
43
+ return (
44
+ <Button
45
+ { ...buttonProps }
46
+ variant="link"
47
+ text={ String( revisionsCount ) }
48
+ aria-label={ sprintf(
49
+ /* translators: %d: number of revisions. */
50
+ _n(
51
+ 'Open revisions screen: %d revision',
52
+ 'Open revisions screen: %d revisions',
53
+ revisionsCount
54
+ ),
55
+ revisionsCount
56
+ ) }
57
+ />
58
+ );
59
+ }