@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
@@ -75,10 +75,30 @@
75
75
  color: $gray-700;
76
76
  }
77
77
 
78
+ .editor-collab-sidebar-panel__show-more-button {
79
+ width: fit-content;
80
+ color: var(--wpds-color-foreground-interactive-brand);
81
+ cursor: var(--wpds-cursor-control);
82
+
83
+ &:hover,
84
+ &:focus,
85
+ &:active {
86
+ color: var(--wpds-color-foreground-interactive-brand-active);
87
+ }
88
+ }
89
+
78
90
  .editor-collab-sidebar-panel__note-content {
79
91
  p:last-child {
80
92
  margin-bottom: 0;
81
93
  }
94
+
95
+ &.is-collapsed {
96
+ -webkit-line-clamp: 3;
97
+ line-clamp: 3;
98
+ display: -webkit-box;
99
+ -webkit-box-orient: vertical;
100
+ overflow: hidden;
101
+ }
82
102
  }
83
103
 
84
104
  .editor-collab-sidebar-panel__user-avatar {
@@ -12,7 +12,6 @@ extend( [ a11yPlugin ] );
12
12
  */
13
13
  import { Icon as WCIcon } from '@wordpress/components';
14
14
  import { useMemo } from '@wordpress/element';
15
- // 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.
16
15
  import { Tooltip } from '@wordpress/ui';
17
16
 
18
17
  /**
@@ -7,7 +7,6 @@ import userEvent from '@testing-library/user-event';
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
- // 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.
11
10
  import { Tooltip } from '@wordpress/ui';
12
11
 
13
12
  /**
@@ -141,6 +141,8 @@ export default function DocumentBar( props ) {
141
141
  const { open: openCommandCenter } = useDispatch( commandsStore );
142
142
  const isReducedMotion = useReducedMotion();
143
143
 
144
+ const hasShortcut = ! window.__experimentalAdminBarInEditor;
145
+
144
146
  const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
145
147
  const hasBackButton =
146
148
  !! onNavigateToPreviousEntityRecord || !! unlockedPatternInfo;
@@ -175,6 +177,7 @@ export default function DocumentBar( props ) {
175
177
  <div
176
178
  className={ clsx( 'editor-document-bar', {
177
179
  'has-back-button': hasBackButton,
180
+ 'has-shortcut': hasShortcut,
178
181
  } ) }
179
182
  >
180
183
  <AnimatePresence>
@@ -267,9 +270,11 @@ export default function DocumentBar( props ) {
267
270
  ) }
268
271
  </WCText>
269
272
  </motion.div>
270
- <span className="editor-document-bar__shortcut">
271
- { displayShortcut.primary( 'k' ) }
272
- </span>
273
+ { hasShortcut && (
274
+ <span className="editor-document-bar__shortcut">
275
+ { displayShortcut.primary( 'k' ) }
276
+ </span>
277
+ ) }
273
278
  </Button>
274
279
  ) }
275
280
  </div>
@@ -55,8 +55,10 @@
55
55
  max-width: 70%;
56
56
 
57
57
  // Offset the layout based on the width of the ⌘K label. This ensures the title is centrally aligned.
58
- @include break-medium() {
59
- padding-left: $grid-unit-30;
58
+ .editor-document-bar.has-shortcut & {
59
+ @include break-medium() {
60
+ padding-left: $grid-unit-30;
61
+ }
60
62
  }
61
63
 
62
64
  h1 {
@@ -41,6 +41,7 @@ export default function EditorKeyboardShortcuts() {
41
41
  isPostSavingLocked,
42
42
  isListViewOpened,
43
43
  getEditorMode,
44
+ isSavingNonPostEntityChanges,
44
45
  } = useSelect( editorStore );
45
46
 
46
47
  useShortcut(
@@ -75,7 +76,7 @@ export default function EditorKeyboardShortcuts() {
75
76
  /**
76
77
  * Do not save the post if post saving is locked.
77
78
  */
78
- if ( isPostSavingLocked() ) {
79
+ if ( isPostSavingLocked() || isSavingNonPostEntityChanges() ) {
79
80
  return;
80
81
  }
81
82
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { useCallback, useEffect, useRef } from '@wordpress/element';
5
5
  import { ifCondition, usePrevious } from '@wordpress/compose';
6
- import { useSelect, useDispatch } from '@wordpress/data';
6
+ import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
7
7
  import { __ } from '@wordpress/i18n';
8
8
  import { parse } from '@wordpress/blocks';
9
9
  import { store as noticesStore } from '@wordpress/notices';
@@ -53,19 +53,14 @@ const hasSessionStorageSupport = () => {
53
53
  * restore a local autosave, if one exists.
54
54
  */
55
55
  function useAutosaveNotice() {
56
- const { postId, isEditedPostNew, hasRemoteAutosave } = useSelect(
56
+ const registry = useRegistry();
57
+ const { postId, isEditedPostNew } = useSelect(
57
58
  ( select ) => ( {
58
59
  postId: select( editorStore ).getCurrentPostId(),
59
60
  isEditedPostNew: select( editorStore ).isEditedPostNew(),
60
- hasRemoteAutosave:
61
- !! select( editorStore ).getEditorSettings().autosave,
62
61
  } ),
63
62
  []
64
63
  );
65
- const { getEditedPostAttribute } = useSelect( editorStore );
66
-
67
- const { createWarningNotice, removeNotice } = useDispatch( noticesStore );
68
- const { editPost, resetEditorBlocks } = useDispatch( editorStore );
69
64
 
70
65
  useEffect( () => {
71
66
  let localAutosave = localAutosaveGet( postId, isEditedPostNew );
@@ -83,24 +78,31 @@ function useAutosaveNotice() {
83
78
  const { post_title: title, content, excerpt } = localAutosave;
84
79
  const edits = { title, content, excerpt };
85
80
 
86
- {
87
- // Only display a notice if there is a difference between what has been
88
- // saved and that which is stored in sessionStorage.
89
- const hasDifference = Object.keys( edits ).some( ( key ) => {
90
- return edits[ key ] !== getEditedPostAttribute( key );
91
- } );
92
-
93
- if ( ! hasDifference ) {
94
- // If there is no difference, it can be safely ejected from storage.
95
- localAutosaveClear( postId, isEditedPostNew );
96
- return;
97
- }
81
+ const { getEditedPostAttribute, getEditorSettings } =
82
+ registry.select( editorStore );
83
+
84
+ // Only display a notice if there is a difference between what has been
85
+ // saved and that which is stored in sessionStorage.
86
+ const hasDifference = Object.keys( edits ).some( ( key ) => {
87
+ return edits[ key ] !== getEditedPostAttribute( key );
88
+ } );
89
+
90
+ if ( ! hasDifference ) {
91
+ // If there is no difference, it can be safely ejected from storage.
92
+ localAutosaveClear( postId, isEditedPostNew );
93
+ return;
98
94
  }
99
95
 
96
+ const hasRemoteAutosave = !! getEditorSettings().autosave;
100
97
  if ( hasRemoteAutosave ) {
101
98
  return;
102
99
  }
103
100
 
101
+ const { createWarningNotice, removeNotice } =
102
+ registry.dispatch( noticesStore );
103
+ const { editPost, resetEditorBlocks } =
104
+ registry.dispatch( editorStore );
105
+
104
106
  const id = 'wpEditorAutosaveRestore';
105
107
 
106
108
  createWarningNotice(
@@ -125,7 +127,7 @@ function useAutosaveNotice() {
125
127
  ],
126
128
  }
127
129
  );
128
- }, [ isEditedPostNew, postId ] );
130
+ }, [ registry, postId, isEditedPostNew ] );
129
131
  }
130
132
 
131
133
  /**
@@ -19,6 +19,7 @@ exports[`PluginPostPublishPanel renders fill properly 1`] = `
19
19
  <svg
20
20
  aria-hidden="true"
21
21
  class="components-panel__arrow"
22
+ fill="currentColor"
22
23
  focusable="false"
23
24
  height="24"
24
25
  viewBox="0 0 24 24"
@@ -168,7 +168,7 @@ export default function PostCardPanel( {
168
168
  { sprintf(
169
169
  // translators: %s: Name of the plural post type e.g: "Posts".
170
170
  __( 'Changes will be applied to all selected %s.' ),
171
- labels?.name.toLowerCase()
171
+ labels?.name?.toLowerCase()
172
172
  ) }
173
173
  </WCText>
174
174
  ) }
@@ -48,7 +48,7 @@ export function PostPublishButton( {
48
48
  isPublishable: store.isEditedPostPublishable(),
49
49
  isPublished: store.isCurrentPostPublished(),
50
50
  hasPublishAction:
51
- store.getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
51
+ !! store.getCurrentPost()?._links?.[ 'wp:action-publish' ],
52
52
  postType: store.getCurrentPostType(),
53
53
  postId: store.getCurrentPostId(),
54
54
  postStatus: store.getEditedPostAttribute( 'status' ),
@@ -103,18 +103,21 @@ export function PostPublishButton( {
103
103
 
104
104
  const isButtonDisabled =
105
105
  isPostSavingLocked ||
106
+ // Disable while a non-post entity (e.g. a newly created term) is mid-save.
107
+ isSavingNonPostEntityChanges ||
106
108
  ( ( isSaving ||
107
109
  ! isSaveable ||
108
110
  ( ! isPublishable && ! forceIsDirty ) ) &&
109
- ( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges ) );
111
+ ! hasNonPostEntityChanges );
110
112
 
111
113
  const isToggleDisabled =
112
114
  isPostSavingLocked ||
115
+ isSavingNonPostEntityChanges ||
113
116
  ( ( isPublished ||
114
117
  isSaving ||
115
118
  ! isSaveable ||
116
119
  ( ! isPublishable && ! forceIsDirty ) ) &&
117
- ( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges ) );
120
+ ! hasNonPostEntityChanges );
118
121
 
119
122
  // If the new status has not changed explicitly, we derive it from
120
123
  // other factors, like having a publish action, etc.. We need to preserve
@@ -89,6 +89,19 @@ describe( 'PostPublishButton', () => {
89
89
  );
90
90
  } );
91
91
 
92
+ it( 'should be true if a non-post entity is being saved', () => {
93
+ mockSelector( 'isEditedPostPublishable', true );
94
+ mockSelector( 'isEditedPostSaveable', true );
95
+ mockSelector( 'isSavingNonPostEntityChanges', true );
96
+
97
+ render( <PostPublishButton /> );
98
+
99
+ expect( screen.getByRole( 'button' ) ).toHaveAttribute(
100
+ 'aria-disabled',
101
+ 'true'
102
+ );
103
+ } );
104
+
92
105
  it( 'should be false if post is saveable but not publishable and forceIsDirty is true', () => {
93
106
  mockSelector( 'isEditedPostSaveable', true );
94
107
  mockSelector( 'isEditedPostPublishable', false );
@@ -136,7 +136,6 @@ export default function PostPublishPanelPostpublish( {
136
136
  </p>
137
137
  <div className="post-publish-panel__postpublish-post-address-container">
138
138
  <TextControl
139
- __next40pxDefaultSize
140
139
  className="post-publish-panel__postpublish-post-address"
141
140
  readOnly
142
141
  label={ sprintf(
@@ -66,6 +66,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
66
66
  >
67
67
  <svg
68
68
  aria-hidden="true"
69
+ fill="currentColor"
69
70
  focusable="false"
70
71
  height="24"
71
72
  viewBox="0 0 24 24"
@@ -134,7 +135,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
134
135
  post address
135
136
  </label>
136
137
  <input
137
- class="components-text-control__input is-next-40px-default-size"
138
+ class="components-text-control__input"
138
139
  id="inspector-text-control-0"
139
140
  readonly=""
140
141
  type="text"
@@ -168,6 +169,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
168
169
  </span>
169
170
  <svg
170
171
  aria-hidden="true"
172
+ fill="currentColor"
171
173
  focusable="false"
172
174
  height="24"
173
175
  viewBox="0 0 24 24"
@@ -291,6 +293,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
291
293
  >
292
294
  <svg
293
295
  aria-hidden="true"
296
+ fill="currentColor"
294
297
  focusable="false"
295
298
  height="24"
296
299
  viewBox="0 0 24 24"
@@ -362,7 +365,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
362
365
  post address
363
366
  </label>
364
367
  <input
365
- class="components-text-control__input is-next-40px-default-size"
368
+ class="components-text-control__input"
366
369
  id="inspector-text-control-1"
367
370
  readonly=""
368
371
  type="text"
@@ -521,6 +524,7 @@ exports[`PostPublishPanel should render the pre-publish panel if post status is
521
524
  <svg
522
525
  aria-hidden="true"
523
526
  class="components-site-icon"
527
+ fill="currentColor"
524
528
  focusable="false"
525
529
  height="36px"
526
530
  viewBox="-2 -2 24 24"
@@ -675,6 +679,7 @@ exports[`PostPublishPanel should render the pre-publish panel if the post is not
675
679
  <svg
676
680
  aria-hidden="true"
677
681
  class="components-site-icon"
682
+ fill="currentColor"
678
683
  focusable="false"
679
684
  height="36px"
680
685
  viewBox="-2 -2 24 24"
@@ -15,7 +15,6 @@ import {
15
15
  store as blockEditorStore,
16
16
  } from '@wordpress/block-editor';
17
17
  import { __ } from '@wordpress/i18n';
18
- // 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.
19
18
  import { Tooltip } from '@wordpress/ui';
20
19
 
21
20
  /**
@@ -0,0 +1,186 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { store as coreStore } from '@wordpress/core-data';
6
+ import { DataViewsPicker, filterSortAndPaginate } from '@wordpress/dataviews';
7
+ import { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';
8
+ import { useCallback, useEffect, useMemo, useState } from '@wordpress/element';
9
+ import { __ } from '@wordpress/i18n';
10
+ import { authorField } from '@wordpress/fields';
11
+ import { Text } from '@wordpress/ui';
12
+
13
+ /**
14
+ * Internal dependencies
15
+ */
16
+ import { store as editorStore } from '../../store';
17
+ import { unlock } from '../../lock-unlock';
18
+ import { PostContentInformationUI } from '../post-content-information';
19
+
20
+ const PAGE_SIZE = 10;
21
+ const EMPTY_ARRAY = [];
22
+ const defaultLayouts = { pickerActivity: true };
23
+ const baseView = {
24
+ type: 'pickerActivity',
25
+ titleField: 'date',
26
+ descriptionField: 'details',
27
+ fields: [ 'author' ],
28
+ layout: { density: 'compact' },
29
+ page: 1,
30
+ perPage: PAGE_SIZE,
31
+ };
32
+
33
+ const DAY_IN_MILLISECONDS = 86400000;
34
+
35
+ function getDisplayDate( value ) {
36
+ const dateNowInMs = getDate( null ).getTime();
37
+ const date = getDate( value ?? null );
38
+ return dateNowInMs - date.getTime() > DAY_IN_MILLISECONDS
39
+ ? dateI18n( getSettings().formats.datetimeAbbreviated, date )
40
+ : humanTimeDiff( date );
41
+ }
42
+
43
+ export default function PostRevisionsTimeline() {
44
+ const { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );
45
+ const [ view, setView ] = useState( baseView );
46
+
47
+ const { revisions, revisionKey, currentRevisionId, currentRevision } =
48
+ useSelect( ( select ) => {
49
+ const { getCurrentPostType } = select( editorStore );
50
+ const {
51
+ getCurrentRevisionId: _getCurrentRevisionId,
52
+ getCurrentRevision,
53
+ getRevisionPage,
54
+ getPageRevisions,
55
+ } = unlock( select( editorStore ) );
56
+ const { getEntityConfig } = select( coreStore );
57
+
58
+ const _postType = getCurrentPostType();
59
+ const entityConfig = getEntityConfig( 'postType', _postType );
60
+ const _revisionKey = entityConfig?.revisionKey || 'id';
61
+ const _currentRevisionId = _getCurrentRevisionId();
62
+
63
+ return {
64
+ // Same desc-ordered window the header slider renders (warm cache).
65
+ revisions: getPageRevisions( getRevisionPage() ),
66
+ revisionKey: _revisionKey,
67
+ currentRevisionId: _currentRevisionId,
68
+ currentRevision: _currentRevisionId
69
+ ? getCurrentRevision()
70
+ : undefined,
71
+ };
72
+ }, [] );
73
+
74
+ const postContent = currentRevision?.content?.raw;
75
+
76
+ const isLoading = ! revisions;
77
+
78
+ const fields = useMemo(
79
+ () => [
80
+ {
81
+ id: 'date',
82
+ label: __( 'Date' ),
83
+ // Return the humanized label the row renders so the picker
84
+ // option's accessible name announces e.g. "5 minutes ago"
85
+ // instead of the raw ISO timestamp.
86
+ getValue: ( { item } ) => getDisplayDate( item.date ),
87
+ render: ( { item } ) => (
88
+ <Text
89
+ variant="heading-sm"
90
+ render={ <time dateTime={ item.date } /> }
91
+ >
92
+ { getDisplayDate( item.date ) }
93
+ </Text>
94
+ ),
95
+ enableSorting: false,
96
+ enableHiding: false,
97
+ },
98
+ authorField,
99
+ {
100
+ id: 'details',
101
+ label: __( 'Details' ),
102
+ render: ( { item } ) => {
103
+ if (
104
+ String( item[ revisionKey ] ) !==
105
+ String( currentRevisionId )
106
+ ) {
107
+ return null;
108
+ }
109
+ return (
110
+ <PostContentInformationUI postContent={ postContent } />
111
+ );
112
+ },
113
+ enableSorting: false,
114
+ enableHiding: false,
115
+ },
116
+ ],
117
+ [ revisionKey, currentRevisionId, postContent ]
118
+ );
119
+
120
+ const { data: shownRevisions, paginationInfo } = useMemo(
121
+ () => filterSortAndPaginate( revisions || EMPTY_ARRAY, view, fields ),
122
+ [ revisions, view, fields ]
123
+ );
124
+
125
+ // Keep the selected revision visible: when it changes (e.g. the slider
126
+ // scrubs), jump to the client-side page that contains it. Keyed on the
127
+ // selection/data, not view.page, so manual paging stays free browsing.
128
+ useEffect( () => {
129
+ if ( ! currentRevisionId || ! revisions ) {
130
+ return;
131
+ }
132
+ const index = revisions.findIndex(
133
+ ( r ) => String( r[ revisionKey ] ) === String( currentRevisionId )
134
+ );
135
+ if ( index < 0 ) {
136
+ return;
137
+ }
138
+ const page = Math.floor( index / view.perPage ) + 1;
139
+ setView( ( v ) => ( v.page === page ? v : { ...v, page } ) );
140
+ }, [ currentRevisionId, revisions, revisionKey, view.perPage ] );
141
+
142
+ const selection = useMemo(
143
+ () =>
144
+ currentRevisionId ? [ String( currentRevisionId ) ] : EMPTY_ARRAY,
145
+ [ currentRevisionId ]
146
+ );
147
+
148
+ const onChangeSelection = useCallback(
149
+ ( newSelection ) => {
150
+ // Revisions mode always keeps one revision selected. Clicking the
151
+ // active revision yields an empty selection, which we ignore so the
152
+ // timeline never ends up with nothing selected.
153
+ if ( newSelection.length === 0 ) {
154
+ return;
155
+ }
156
+ const selectedId = newSelection[ newSelection.length - 1 ];
157
+ setCurrentRevisionId( Number( selectedId ) );
158
+ },
159
+ [ setCurrentRevisionId ]
160
+ );
161
+
162
+ const getItemId = useCallback(
163
+ ( item ) => String( item[ revisionKey ] ),
164
+ [ revisionKey ]
165
+ );
166
+
167
+ return (
168
+ <div className="editor-post-revisions-timeline">
169
+ <DataViewsPicker
170
+ view={ view }
171
+ onChangeView={ setView }
172
+ fields={ fields }
173
+ data={ shownRevisions }
174
+ isLoading={ isLoading }
175
+ paginationInfo={ paginationInfo }
176
+ defaultLayouts={ defaultLayouts }
177
+ getItemId={ getItemId }
178
+ selection={ selection }
179
+ onChangeSelection={ onChangeSelection }
180
+ >
181
+ <DataViewsPicker.Layout />
182
+ <DataViewsPicker.Footer />
183
+ </DataViewsPicker>
184
+ </div>
185
+ );
186
+ }
@@ -0,0 +1,43 @@
1
+ // Give the revisions inspector a bounded height so the timeline scrolls
2
+ // internally and the picker's pagination stays pinned to the bottom.
3
+ //
4
+ // The timeline only renders in revisions mode, so its ancestors are scoped
5
+ // with `:has()` — keeping this layout out of the generic editor sidebar.
6
+ .interface-complementary-area:has(.editor-post-revisions-timeline) {
7
+ display: flex;
8
+ flex-direction: column;
9
+ overflow: hidden;
10
+
11
+ // The tabs header keeps its natural height.
12
+ .editor-sidebar__panel-tabs {
13
+ flex-shrink: 0;
14
+ }
15
+ }
16
+
17
+ .editor-sidebar__panel:has(.editor-post-revisions-timeline) {
18
+ display: flex;
19
+ flex-direction: column;
20
+ flex: 1;
21
+ min-height: 0;
22
+
23
+ // The document tab panel hands its bounded height down to the timeline.
24
+ [role="tabpanel"]:has(.editor-post-revisions-timeline) {
25
+ display: flex;
26
+ flex-direction: column;
27
+ flex: 1;
28
+ min-height: 0;
29
+ }
30
+
31
+ // Cap only the post-meta diff content so a large
32
+ // diff (e.g. footnotes) can't dominate the column.
33
+ .editor-revision-meta-diff__content {
34
+ max-height: 80px;
35
+ overflow-y: auto;
36
+ }
37
+
38
+ // timeline grows to fill the leftover space and scrolls internally.
39
+ .editor-post-revisions-timeline {
40
+ flex: 1;
41
+ min-height: 0;
42
+ }
43
+ }
@@ -46,6 +46,7 @@ export default function PostSavedState( { forceIsDirty } ) {
46
46
  isSaveable,
47
47
  isSaving,
48
48
  isSavingLocked,
49
+ isSavingNonPostEntityChanges,
49
50
  isScheduled,
50
51
  hasPublishAction,
51
52
  showIconLabels,
@@ -54,35 +55,25 @@ export default function PostSavedState( { forceIsDirty } ) {
54
55
  postType,
55
56
  } = useSelect(
56
57
  ( select ) => {
57
- const {
58
- isEditedPostNew,
59
- isCurrentPostPublished,
60
- isCurrentPostScheduled,
61
- isEditedPostDirty,
62
- isSavingPost,
63
- isEditedPostSaveable,
64
- isPostSavingLocked,
65
- getCurrentPost,
66
- isAutosavingPost,
67
- getEditedPostAttribute,
68
- getPostEdits,
69
- } = select( editorStore );
58
+ const store = select( editorStore );
70
59
  const { get } = select( preferencesStore );
71
60
  return {
72
- isAutosaving: isAutosavingPost(),
73
- isDirty: forceIsDirty || isEditedPostDirty(),
74
- isNew: isEditedPostNew(),
75
- isPublished: isCurrentPostPublished(),
76
- isSaving: isSavingPost(),
77
- isSaveable: isEditedPostSaveable(),
78
- isSavingLocked: isPostSavingLocked(),
79
- isScheduled: isCurrentPostScheduled(),
61
+ isAutosaving: store.isAutosavingPost(),
62
+ isDirty: forceIsDirty || store.isEditedPostDirty(),
63
+ isNew: store.isEditedPostNew(),
64
+ isPublished: store.isCurrentPostPublished(),
65
+ isSaving: store.isSavingPost(),
66
+ isSaveable: store.isEditedPostSaveable(),
67
+ isSavingLocked: store.isPostSavingLocked(),
68
+ isSavingNonPostEntityChanges:
69
+ store.isSavingNonPostEntityChanges(),
70
+ isScheduled: store.isCurrentPostScheduled(),
80
71
  hasPublishAction:
81
- getCurrentPost()?._links?.[ 'wp:action-publish' ] ?? false,
72
+ !! store.getCurrentPost()?._links?.[ 'wp:action-publish' ],
82
73
  showIconLabels: get( 'core', 'showIconLabels' ),
83
- postStatus: getEditedPostAttribute( 'status' ),
84
- postStatusHasChanged: !! getPostEdits()?.status,
85
- postType: select( editorStore ).getCurrentPostType(),
74
+ postStatus: store.getEditedPostAttribute( 'status' ),
75
+ postStatusHasChanged: !! store.getPostEdits()?.status,
76
+ postType: store.getCurrentPostType(),
86
77
  };
87
78
  },
88
79
  [ forceIsDirty ]
@@ -143,7 +134,13 @@ export default function PostSavedState( { forceIsDirty } ) {
143
134
 
144
135
  const isSaved = forceSavedMessage || ( ! isNew && ! isDirty );
145
136
  const isSavedState = isSaving || isSaved;
146
- const isDisabled = isSaving || isSaved || ! isSaveable || isSavingLocked;
137
+ const isDisabled =
138
+ isSaving ||
139
+ isSaved ||
140
+ ! isSaveable ||
141
+ isSavingLocked ||
142
+ // Disable while a non-post entity (e.g. a newly created term) is mid-save.
143
+ isSavingNonPostEntityChanges;
147
144
  let text;
148
145
 
149
146
  if ( isSaving ) {
@@ -9,6 +9,7 @@ exports[`PostSavedState returns a disabled button if the post is not saveable 1`
9
9
  >
10
10
  <svg
11
11
  aria-hidden="true"
12
+ fill="currentColor"
12
13
  focusable="false"
13
14
  height="24"
14
15
  viewBox="0 0 24 24"