@wordpress/editor 14.48.1 → 14.48.2-next.v.202606191442.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 (401) hide show
  1. package/build/bindings/pattern-overrides.cjs +1 -1
  2. package/build/bindings/pattern-overrides.cjs.map +2 -2
  3. package/build/components/collab-sidebar/note-byline.cjs +1 -1
  4. package/build/components/collab-sidebar/note-byline.cjs.map +2 -2
  5. package/build/components/collab-sidebar/note.cjs +49 -17
  6. package/build/components/collab-sidebar/note.cjs.map +3 -3
  7. package/build/components/collab-sidebar/notes.cjs.map +1 -1
  8. package/build/components/collab-sidebar/utils.cjs +1 -1
  9. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  10. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs.map +1 -1
  11. package/build/components/collaborators-overlay/collaborator-styles.cjs.map +1 -1
  12. package/build/components/collaborators-overlay/compute-selection.cjs.map +1 -1
  13. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +1 -1
  14. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +1 -1
  15. package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +1 -1
  16. package/build/components/collaborators-presence/avatar/component.cjs.map +2 -2
  17. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs.map +1 -1
  18. package/build/components/document-bar/index.cjs +7 -5
  19. package/build/components/document-bar/index.cjs.map +2 -2
  20. package/build/components/global-keyboard-shortcuts/index.cjs +3 -2
  21. package/build/components/global-keyboard-shortcuts/index.cjs.map +2 -2
  22. package/build/components/global-styles-sidebar/welcome-guide.cjs +3 -3
  23. package/build/components/global-styles-sidebar/welcome-guide.cjs.map +1 -1
  24. package/build/components/local-autosave-monitor/index.cjs +14 -15
  25. package/build/components/local-autosave-monitor/index.cjs.map +2 -2
  26. package/build/components/page-attributes/parent.cjs +1 -1
  27. package/build/components/page-attributes/parent.cjs.map +2 -2
  28. package/build/components/post-card-panel/index.cjs +1 -1
  29. package/build/components/post-card-panel/index.cjs.map +2 -2
  30. package/build/components/post-excerpt/panel.cjs +1 -1
  31. package/build/components/post-excerpt/panel.cjs.map +2 -2
  32. package/build/components/post-locked-modal/index.cjs +3 -3
  33. package/build/components/post-locked-modal/index.cjs.map +1 -1
  34. package/build/components/post-preview-button/index.cjs +2 -2
  35. package/build/components/post-preview-button/index.cjs.map +2 -2
  36. package/build/components/post-publish-button/index.cjs +4 -3
  37. package/build/components/post-publish-button/index.cjs.map +2 -2
  38. package/build/components/post-publish-button/label.cjs +2 -2
  39. package/build/components/post-publish-button/label.cjs.map +2 -2
  40. package/build/components/post-publish-panel/index.cjs.map +1 -1
  41. package/build/components/post-publish-panel/postpublish.cjs +1 -1
  42. package/build/components/post-publish-panel/postpublish.cjs.map +2 -2
  43. package/build/components/post-revisions-preview/block-diff.cjs.map +1 -1
  44. package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
  45. package/build/components/post-revisions-preview/revisions-slider.cjs +1 -1
  46. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  47. package/build/components/post-revisions-timeline/index.cjs +173 -0
  48. package/build/components/post-revisions-timeline/index.cjs.map +7 -0
  49. package/build/components/post-saved-state/index.cjs +17 -26
  50. package/build/components/post-saved-state/index.cjs.map +2 -2
  51. package/build/components/post-schedule/label.cjs +5 -5
  52. package/build/components/post-schedule/label.cjs.map +1 -1
  53. package/build/components/post-taxonomies/flat-term-selector.cjs +2 -1
  54. package/build/components/post-taxonomies/flat-term-selector.cjs.map +3 -3
  55. package/build/components/post-taxonomies/hierarchical-term-selector.cjs +1 -1
  56. package/build/components/post-taxonomies/hierarchical-term-selector.cjs.map +2 -2
  57. package/build/components/post-text-editor/index.cjs +51 -0
  58. package/build/components/post-text-editor/index.cjs.map +2 -2
  59. package/build/components/post-text-editor/utils.cjs +150 -0
  60. package/build/components/post-text-editor/utils.cjs.map +7 -0
  61. package/build/components/post-url/index.cjs +1 -1
  62. package/build/components/post-url/index.cjs.map +2 -2
  63. package/build/components/post-view-link/index.cjs +1 -1
  64. package/build/components/post-view-link/index.cjs.map +2 -2
  65. package/build/components/provider/disable-non-page-content-blocks.cjs.map +1 -1
  66. package/build/components/provider/index.cjs +1 -1
  67. package/build/components/provider/index.cjs.map +2 -2
  68. package/build/components/resizable-editor/resize-handle.cjs.map +2 -2
  69. package/build/components/revision-diff-panel/index.cjs +7 -2
  70. package/build/components/revision-diff-panel/index.cjs.map +2 -2
  71. package/build/components/revision-fields-diff/index.cjs +6 -2
  72. package/build/components/revision-fields-diff/index.cjs.map +2 -2
  73. package/build/components/sidebar/dataform-post-summary.cjs +125 -20
  74. package/build/components/sidebar/dataform-post-summary.cjs.map +3 -3
  75. package/build/components/sidebar/index.cjs +1 -11
  76. package/build/components/sidebar/index.cjs.map +3 -3
  77. package/build/components/sidebar/post-revision-summary.cjs +11 -17
  78. package/build/components/sidebar/post-revision-summary.cjs.map +3 -3
  79. package/build/components/sidebar/post-summary.cjs +1 -1
  80. package/build/components/sidebar/post-summary.cjs.map +2 -2
  81. package/build/components/style-book/examples.cjs +1 -1
  82. package/build/components/style-book/examples.cjs.map +1 -1
  83. package/build/components/style-book/index.cjs +1 -1
  84. package/build/components/style-book/index.cjs.map +2 -2
  85. package/build/components/sync-connection-error-modal/index.cjs +3 -3
  86. package/build/components/sync-connection-error-modal/index.cjs.map +1 -1
  87. package/build/components/template-actions-panel/block-theme-content.cjs.map +2 -2
  88. package/build/components/template-actions-panel/index.cjs +0 -9
  89. package/build/components/template-actions-panel/index.cjs.map +3 -3
  90. package/build/components/template-validation-notice/index.cjs +1 -1
  91. package/build/components/template-validation-notice/index.cjs.map +1 -1
  92. package/build/components/upload-progress-snackbar/index.cjs +3 -3
  93. package/build/components/upload-progress-snackbar/index.cjs.map +2 -2
  94. package/build/components/upload-progress-snackbar/tracker.cjs.map +1 -1
  95. package/build/components/visual-editor/edit-template-blocks-notification.cjs +1 -1
  96. package/build/components/visual-editor/edit-template-blocks-notification.cjs.map +1 -1
  97. package/build/{components/revision-author-panel → dataviews/fields/revisions}/index.cjs +18 -26
  98. package/build/dataviews/fields/revisions/index.cjs.map +7 -0
  99. package/build/dataviews/fields/revisions/revisions-view.cjs +74 -0
  100. package/build/dataviews/fields/revisions/revisions-view.cjs.map +7 -0
  101. package/build/dataviews/store/private-actions.cjs +14 -4
  102. package/build/dataviews/store/private-actions.cjs.map +3 -3
  103. package/build/hooks/push-changes-to-global-styles/index.cjs +1 -1
  104. package/build/hooks/push-changes-to-global-styles/index.cjs.map +1 -1
  105. package/build/store/actions.cjs +1 -1
  106. package/build/store/actions.cjs.map +2 -2
  107. package/build/store/private-selectors.cjs +6 -1
  108. package/build/store/private-selectors.cjs.map +2 -2
  109. package/build/utils/media-upload/index.cjs.map +1 -1
  110. package/build/utils/set-nested-value.cjs.map +1 -1
  111. package/build-module/bindings/pattern-overrides.mjs +1 -1
  112. package/build-module/bindings/pattern-overrides.mjs.map +2 -2
  113. package/build-module/components/collab-sidebar/note-byline.mjs +1 -1
  114. package/build-module/components/collab-sidebar/note-byline.mjs.map +2 -2
  115. package/build-module/components/collab-sidebar/note.mjs +50 -18
  116. package/build-module/components/collab-sidebar/note.mjs.map +2 -2
  117. package/build-module/components/collab-sidebar/notes.mjs.map +1 -1
  118. package/build-module/components/collab-sidebar/utils.mjs +1 -1
  119. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  120. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs.map +1 -1
  121. package/build-module/components/collaborators-overlay/collaborator-styles.mjs.map +1 -1
  122. package/build-module/components/collaborators-overlay/compute-selection.mjs.map +1 -1
  123. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +1 -1
  124. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +1 -1
  125. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +1 -1
  126. package/build-module/components/collaborators-presence/avatar/component.mjs.map +2 -2
  127. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs.map +1 -1
  128. package/build-module/components/document-bar/index.mjs +7 -5
  129. package/build-module/components/document-bar/index.mjs.map +2 -2
  130. package/build-module/components/global-keyboard-shortcuts/index.mjs +3 -2
  131. package/build-module/components/global-keyboard-shortcuts/index.mjs.map +2 -2
  132. package/build-module/components/global-styles-sidebar/welcome-guide.mjs +3 -3
  133. package/build-module/components/global-styles-sidebar/welcome-guide.mjs.map +1 -1
  134. package/build-module/components/local-autosave-monitor/index.mjs +15 -16
  135. package/build-module/components/local-autosave-monitor/index.mjs.map +2 -2
  136. package/build-module/components/page-attributes/parent.mjs +1 -1
  137. package/build-module/components/page-attributes/parent.mjs.map +2 -2
  138. package/build-module/components/post-card-panel/index.mjs +1 -1
  139. package/build-module/components/post-card-panel/index.mjs.map +2 -2
  140. package/build-module/components/post-excerpt/panel.mjs +1 -1
  141. package/build-module/components/post-excerpt/panel.mjs.map +2 -2
  142. package/build-module/components/post-locked-modal/index.mjs +3 -3
  143. package/build-module/components/post-locked-modal/index.mjs.map +1 -1
  144. package/build-module/components/post-preview-button/index.mjs +2 -2
  145. package/build-module/components/post-preview-button/index.mjs.map +2 -2
  146. package/build-module/components/post-publish-button/index.mjs +4 -3
  147. package/build-module/components/post-publish-button/index.mjs.map +2 -2
  148. package/build-module/components/post-publish-button/label.mjs +2 -2
  149. package/build-module/components/post-publish-button/label.mjs.map +2 -2
  150. package/build-module/components/post-publish-panel/index.mjs.map +1 -1
  151. package/build-module/components/post-publish-panel/postpublish.mjs +1 -1
  152. package/build-module/components/post-publish-panel/postpublish.mjs.map +2 -2
  153. package/build-module/components/post-revisions-preview/block-diff.mjs.map +1 -1
  154. package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
  155. package/build-module/components/post-revisions-preview/revisions-slider.mjs +1 -1
  156. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  157. package/build-module/components/post-revisions-timeline/index.mjs +152 -0
  158. package/build-module/components/post-revisions-timeline/index.mjs.map +7 -0
  159. package/build-module/components/post-saved-state/index.mjs +17 -26
  160. package/build-module/components/post-saved-state/index.mjs.map +2 -2
  161. package/build-module/components/post-schedule/label.mjs +5 -5
  162. package/build-module/components/post-schedule/label.mjs.map +1 -1
  163. package/build-module/components/post-taxonomies/flat-term-selector.mjs +3 -6
  164. package/build-module/components/post-taxonomies/flat-term-selector.mjs.map +2 -2
  165. package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs +1 -1
  166. package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs.map +2 -2
  167. package/build-module/components/post-text-editor/index.mjs +51 -0
  168. package/build-module/components/post-text-editor/index.mjs.map +2 -2
  169. package/build-module/components/post-text-editor/utils.mjs +123 -0
  170. package/build-module/components/post-text-editor/utils.mjs.map +7 -0
  171. package/build-module/components/post-url/index.mjs +1 -1
  172. package/build-module/components/post-url/index.mjs.map +2 -2
  173. package/build-module/components/post-view-link/index.mjs +1 -1
  174. package/build-module/components/post-view-link/index.mjs.map +2 -2
  175. package/build-module/components/provider/disable-non-page-content-blocks.mjs.map +1 -1
  176. package/build-module/components/provider/index.mjs +1 -1
  177. package/build-module/components/provider/index.mjs.map +2 -2
  178. package/build-module/components/resizable-editor/resize-handle.mjs.map +2 -2
  179. package/build-module/components/revision-diff-panel/index.mjs +7 -2
  180. package/build-module/components/revision-diff-panel/index.mjs.map +2 -2
  181. package/build-module/components/revision-fields-diff/index.mjs +6 -2
  182. package/build-module/components/revision-fields-diff/index.mjs.map +2 -2
  183. package/build-module/components/sidebar/dataform-post-summary.mjs +125 -20
  184. package/build-module/components/sidebar/dataform-post-summary.mjs.map +2 -2
  185. package/build-module/components/sidebar/index.mjs +1 -11
  186. package/build-module/components/sidebar/index.mjs.map +2 -2
  187. package/build-module/components/sidebar/post-revision-summary.mjs +11 -17
  188. package/build-module/components/sidebar/post-revision-summary.mjs.map +2 -2
  189. package/build-module/components/sidebar/post-summary.mjs +1 -1
  190. package/build-module/components/sidebar/post-summary.mjs.map +2 -2
  191. package/build-module/components/style-book/examples.mjs +1 -1
  192. package/build-module/components/style-book/examples.mjs.map +1 -1
  193. package/build-module/components/style-book/index.mjs +1 -1
  194. package/build-module/components/style-book/index.mjs.map +2 -2
  195. package/build-module/components/sync-connection-error-modal/index.mjs +3 -3
  196. package/build-module/components/sync-connection-error-modal/index.mjs.map +1 -1
  197. package/build-module/components/template-actions-panel/block-theme-content.mjs.map +2 -2
  198. package/build-module/components/template-actions-panel/index.mjs +0 -9
  199. package/build-module/components/template-actions-panel/index.mjs.map +2 -2
  200. package/build-module/components/template-validation-notice/index.mjs +1 -1
  201. package/build-module/components/template-validation-notice/index.mjs.map +1 -1
  202. package/build-module/components/upload-progress-snackbar/index.mjs +3 -3
  203. package/build-module/components/upload-progress-snackbar/index.mjs.map +2 -2
  204. package/build-module/components/upload-progress-snackbar/tracker.mjs.map +1 -1
  205. package/build-module/components/visual-editor/edit-template-blocks-notification.mjs +1 -1
  206. package/build-module/components/visual-editor/edit-template-blocks-notification.mjs.map +1 -1
  207. package/build-module/dataviews/fields/revisions/index.mjs +20 -0
  208. package/build-module/dataviews/fields/revisions/index.mjs.map +7 -0
  209. package/build-module/dataviews/fields/revisions/revisions-view.mjs +53 -0
  210. package/build-module/dataviews/fields/revisions/revisions-view.mjs.map +7 -0
  211. package/build-module/dataviews/store/private-actions.mjs +23 -7
  212. package/build-module/dataviews/store/private-actions.mjs.map +2 -2
  213. package/build-module/hooks/push-changes-to-global-styles/index.mjs +1 -1
  214. package/build-module/hooks/push-changes-to-global-styles/index.mjs.map +1 -1
  215. package/build-module/store/actions.mjs +1 -1
  216. package/build-module/store/actions.mjs.map +2 -2
  217. package/build-module/store/private-selectors.mjs +7 -1
  218. package/build-module/store/private-selectors.mjs.map +2 -2
  219. package/build-module/utils/media-upload/index.mjs.map +1 -1
  220. package/build-module/utils/set-nested-value.mjs.map +1 -1
  221. package/build-style/style-rtl.css +270 -206
  222. package/build-style/style.css +270 -206
  223. package/build-types/components/collab-sidebar/note-byline.d.ts +0 -3
  224. package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -1
  225. package/build-types/components/collab-sidebar/note.d.ts.map +1 -1
  226. package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -1
  227. package/build-types/components/document-bar/index.d.ts +2 -2
  228. package/build-types/components/document-bar/index.d.ts.map +1 -1
  229. package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -1
  230. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
  231. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  232. package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
  233. package/build-types/components/post-revisions-timeline/index.d.ts +2 -0
  234. package/build-types/components/post-revisions-timeline/index.d.ts.map +1 -0
  235. package/build-types/components/post-saved-state/index.d.ts.map +1 -1
  236. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  237. package/build-types/components/post-text-editor/index.d.ts +1 -1
  238. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  239. package/build-types/components/provider/index.d.ts.map +1 -1
  240. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
  241. package/build-types/components/revision-diff-panel/index.d.ts +3 -1
  242. package/build-types/components/revision-diff-panel/index.d.ts.map +1 -1
  243. package/build-types/components/revision-fields-diff/index.d.ts.map +1 -1
  244. package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
  245. package/build-types/components/sidebar/index.d.ts.map +1 -1
  246. package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -1
  247. package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -1
  248. package/build-types/components/template-actions-panel/index.d.ts.map +1 -1
  249. package/build-types/dataviews/fields/revisions/index.d.ts +8 -0
  250. package/build-types/dataviews/fields/revisions/index.d.ts.map +1 -0
  251. package/build-types/dataviews/fields/revisions/revisions-view.d.ts +2 -0
  252. package/build-types/dataviews/fields/revisions/revisions-view.d.ts.map +1 -0
  253. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  254. package/build-types/store/private-selectors.d.ts +1 -1
  255. package/build-types/store/private-selectors.d.ts.map +1 -1
  256. package/build-types/store/selectors.d.ts +1 -1
  257. package/build-types/store/selectors.d.ts.map +1 -1
  258. package/package.json +53 -47
  259. package/src/bindings/pattern-overrides.js +1 -1
  260. package/src/bindings/test/pattern-overrides.js +65 -0
  261. package/src/components/collab-sidebar/note-byline.js +0 -1
  262. package/src/components/collab-sidebar/note.js +64 -29
  263. package/src/components/collab-sidebar/style.scss +20 -0
  264. package/src/components/collaborators-presence/avatar/component.tsx +0 -1
  265. package/src/components/collaborators-presence/avatar/test/index.tsx +0 -1
  266. package/src/components/document-bar/index.js +8 -3
  267. package/src/components/document-bar/style.scss +4 -2
  268. package/src/components/global-keyboard-shortcuts/index.js +2 -1
  269. package/src/components/local-autosave-monitor/index.js +23 -21
  270. package/src/components/post-card-panel/index.js +1 -1
  271. package/src/components/post-publish-button/index.js +6 -3
  272. package/src/components/post-publish-button/test/index.js +13 -0
  273. package/src/components/post-revisions-preview/diff-markers.js +0 -1
  274. package/src/components/post-revisions-timeline/index.js +186 -0
  275. package/src/components/post-revisions-timeline/style.scss +43 -0
  276. package/src/components/post-saved-state/index.js +23 -26
  277. package/src/components/post-saved-state/test/index.js +18 -0
  278. package/src/components/post-taxonomies/flat-term-selector.js +4 -7
  279. package/src/components/post-text-editor/index.js +65 -0
  280. package/src/components/post-text-editor/test/utils.js +210 -0
  281. package/src/components/post-text-editor/utils.js +204 -0
  282. package/src/components/post-type-support-check/test/index.js +11 -0
  283. package/src/components/post-url/index.js +1 -1
  284. package/src/components/post-view-link/index.js +1 -1
  285. package/src/components/post-view-link/test/index.js +71 -0
  286. package/src/components/provider/index.js +2 -1
  287. package/src/components/resizable-editor/resize-handle.js +0 -1
  288. package/src/components/revision-diff-panel/index.js +8 -2
  289. package/src/components/revision-fields-diff/index.js +12 -1
  290. package/src/components/sidebar/dataform-post-summary.js +196 -25
  291. package/src/components/sidebar/index.js +2 -12
  292. package/src/components/sidebar/post-revision-summary.js +8 -15
  293. package/src/components/sidebar/post-summary.js +1 -1
  294. package/src/components/style-book/index.js +1 -1
  295. package/src/components/template-actions-panel/block-theme-content.js +0 -1
  296. package/src/components/template-actions-panel/index.js +0 -15
  297. package/src/dataviews/fields/revisions/index.tsx +28 -0
  298. package/src/dataviews/fields/revisions/revisions-view.tsx +59 -0
  299. package/src/dataviews/store/private-actions.ts +27 -6
  300. package/src/store/private-selectors.js +11 -1
  301. package/src/store/test/private-selectors.js +69 -0
  302. package/src/style.scss +1 -1
  303. package/build/components/post-revisions-panel/index.cjs +0 -173
  304. package/build/components/post-revisions-panel/index.cjs.map +0 -7
  305. package/build/components/revision-author-panel/index.cjs.map +0 -7
  306. package/build/components/revision-created-panel/index.cjs +0 -47
  307. package/build/components/revision-created-panel/index.cjs.map +0 -7
  308. package/build-module/components/post-revisions-panel/index.mjs +0 -148
  309. package/build-module/components/post-revisions-panel/index.mjs.map +0 -7
  310. package/build-module/components/revision-author-panel/index.mjs +0 -28
  311. package/build-module/components/revision-author-panel/index.mjs.map +0 -7
  312. package/build-module/components/revision-created-panel/index.mjs +0 -26
  313. package/build-module/components/revision-created-panel/index.mjs.map +0 -7
  314. package/build-types/components/collab-sidebar/add-comment.d.ts +0 -6
  315. package/build-types/components/collab-sidebar/add-comment.d.ts.map +0 -1
  316. package/build-types/components/collab-sidebar/comment-author-info.d.ts +0 -8
  317. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +0 -1
  318. package/build-types/components/collab-sidebar/comment-form.d.ts +0 -9
  319. package/build-types/components/collab-sidebar/comment-form.d.ts.map +0 -1
  320. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts +0 -6
  321. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +0 -1
  322. package/build-types/components/collab-sidebar/comment-menu-item.d.ts +0 -6
  323. package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +0 -1
  324. package/build-types/components/collab-sidebar/comments.d.ts +0 -10
  325. package/build-types/components/collab-sidebar/comments.d.ts.map +0 -1
  326. package/build-types/components/global-styles-provider/index.d.ts +0 -16
  327. package/build-types/components/global-styles-provider/index.d.ts.map +0 -1
  328. package/build-types/components/media/index.d.ts +0 -3
  329. package/build-types/components/media/index.d.ts.map +0 -1
  330. package/build-types/components/media/metadata-panel.d.ts +0 -12
  331. package/build-types/components/media/metadata-panel.d.ts.map +0 -1
  332. package/build-types/components/media/preview.d.ts +0 -9
  333. package/build-types/components/media/preview.d.ts.map +0 -1
  334. package/build-types/components/post-revisions-panel/index.d.ts +0 -2
  335. package/build-types/components/post-revisions-panel/index.d.ts.map +0 -1
  336. package/build-types/components/revision-author-panel/index.d.ts +0 -2
  337. package/build-types/components/revision-author-panel/index.d.ts.map +0 -1
  338. package/build-types/components/revision-created-panel/index.d.ts +0 -2
  339. package/build-types/components/revision-created-panel/index.d.ts.map +0 -1
  340. package/src/components/editor-help/images/add-dark.png +0 -0
  341. package/src/components/editor-help/images/add-dark@2x.png +0 -0
  342. package/src/components/editor-help/images/add-dark@3x.png +0 -0
  343. package/src/components/editor-help/images/add-light.png +0 -0
  344. package/src/components/editor-help/images/add-light@2x.png +0 -0
  345. package/src/components/editor-help/images/add-light@3x.png +0 -0
  346. package/src/components/editor-help/images/block-layout-collage.png +0 -0
  347. package/src/components/editor-help/images/block-layout-collage@2x.png +0 -0
  348. package/src/components/editor-help/images/block-layout-collage@3x.png +0 -0
  349. package/src/components/editor-help/images/build-layouts-dark.png +0 -0
  350. package/src/components/editor-help/images/build-layouts-dark@2x.png +0 -0
  351. package/src/components/editor-help/images/build-layouts-dark@3x.png +0 -0
  352. package/src/components/editor-help/images/build-layouts-light.png +0 -0
  353. package/src/components/editor-help/images/build-layouts-light@2x.png +0 -0
  354. package/src/components/editor-help/images/build-layouts-light@3x.png +0 -0
  355. package/src/components/editor-help/images/drag-and-drop-dark.png +0 -0
  356. package/src/components/editor-help/images/drag-and-drop-dark@2x.png +0 -0
  357. package/src/components/editor-help/images/drag-and-drop-dark@3x.png +0 -0
  358. package/src/components/editor-help/images/drag-and-drop-light.png +0 -0
  359. package/src/components/editor-help/images/drag-and-drop-light@2x.png +0 -0
  360. package/src/components/editor-help/images/drag-and-drop-light@3x.png +0 -0
  361. package/src/components/editor-help/images/edit-media-dark.png +0 -0
  362. package/src/components/editor-help/images/edit-media-dark@2x.png +0 -0
  363. package/src/components/editor-help/images/edit-media-dark@3x.png +0 -0
  364. package/src/components/editor-help/images/edit-media-light.png +0 -0
  365. package/src/components/editor-help/images/edit-media-light@2x.png +0 -0
  366. package/src/components/editor-help/images/edit-media-light@3x.png +0 -0
  367. package/src/components/editor-help/images/embed-media-dark.png +0 -0
  368. package/src/components/editor-help/images/embed-media-dark@2x.png +0 -0
  369. package/src/components/editor-help/images/embed-media-dark@3x.png +0 -0
  370. package/src/components/editor-help/images/embed-media-light.png +0 -0
  371. package/src/components/editor-help/images/embed-media-light@2x.png +0 -0
  372. package/src/components/editor-help/images/embed-media-light@3x.png +0 -0
  373. package/src/components/editor-help/images/move-dark.png +0 -0
  374. package/src/components/editor-help/images/move-dark@2x.png +0 -0
  375. package/src/components/editor-help/images/move-dark@3x.png +0 -0
  376. package/src/components/editor-help/images/move-light.png +0 -0
  377. package/src/components/editor-help/images/move-light@2x.png +0 -0
  378. package/src/components/editor-help/images/move-light@3x.png +0 -0
  379. package/src/components/editor-help/images/options-dark.png +0 -0
  380. package/src/components/editor-help/images/options-dark@2x.png +0 -0
  381. package/src/components/editor-help/images/options-dark@3x.png +0 -0
  382. package/src/components/editor-help/images/options-light.png +0 -0
  383. package/src/components/editor-help/images/options-light@2x.png +0 -0
  384. package/src/components/editor-help/images/options-light@3x.png +0 -0
  385. package/src/components/editor-help/images/rich-text-dark.png +0 -0
  386. package/src/components/editor-help/images/rich-text-dark@2x.png +0 -0
  387. package/src/components/editor-help/images/rich-text-dark@3x.png +0 -0
  388. package/src/components/editor-help/images/rich-text-light.png +0 -0
  389. package/src/components/editor-help/images/rich-text-light@2x.png +0 -0
  390. package/src/components/editor-help/images/rich-text-light@3x.png +0 -0
  391. package/src/components/editor-help/images/settings-dark.png +0 -0
  392. package/src/components/editor-help/images/settings-dark@2x.png +0 -0
  393. package/src/components/editor-help/images/settings-dark@3x.png +0 -0
  394. package/src/components/editor-help/images/settings-light.png +0 -0
  395. package/src/components/editor-help/images/settings-light@2x.png +0 -0
  396. package/src/components/editor-help/images/settings-light@3x.png +0 -0
  397. package/src/components/editor-help/style.scss +0 -123
  398. package/src/components/post-revisions-panel/index.js +0 -161
  399. package/src/components/post-revisions-panel/style.scss +0 -16
  400. package/src/components/revision-author-panel/index.js +0 -36
  401. package/src/components/revision-created-panel/index.js +0 -36
@@ -38,6 +38,16 @@ function stringifyValue( value ) {
38
38
  return String( value );
39
39
  }
40
40
 
41
+ /**
42
+ * Determines whether a meta value should be treated as empty.
43
+ *
44
+ * @param {string} str The stringified value.
45
+ * @return {boolean} Whether the value is effectively empty.
46
+ */
47
+ function isEmptyMeta( str ) {
48
+ return ! str || str === '[]' || str === '{}';
49
+ }
50
+
41
51
  /**
42
52
  * Panel that shows meta field diffs between the current revision and
43
53
  * the previous revision in the document sidebar during revision mode.
@@ -72,7 +82,7 @@ export default function RevisionFieldsDiffPanel() {
72
82
  const revStr = stringifyValue( revisionMeta[ key ] );
73
83
  const prevStr = stringifyValue( previousMeta[ key ] );
74
84
 
75
- if ( ! revStr && ! prevStr ) {
85
+ if ( isEmptyMeta( revStr ) && isEmptyMeta( prevStr ) ) {
76
86
  continue;
77
87
  }
78
88
 
@@ -91,6 +101,7 @@ export default function RevisionFieldsDiffPanel() {
91
101
  title={ __( 'Meta' ) }
92
102
  entries={ entries }
93
103
  initialOpen={ false }
104
+ className="editor-revision-meta-diff__content"
94
105
  />
95
106
  );
96
107
  }
@@ -18,9 +18,76 @@ 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: [] };
23
24
 
25
+ // Some post types expose summary fields that edit entities other than the one
26
+ // being edited. Keyed by the post type that needs them, the related records are
27
+ // merged into the form data under a `${ kind }_${ name }` namespace key so that
28
+ // a single DataForm can read and write all of them, and edits to those keys are
29
+ // routed back to their entity.
30
+ //
31
+ // The fields themselves are namespace-agnostic: they read and write a plain
32
+ // record. The `fields` list ties each one to the entity it edits, and this
33
+ // component overrides their `getValue`/`setValue`/`render` to operate on the
34
+ // namespaced record, plus their `isVisible` to only show where that record is
35
+ // present (e.g. the `home`/`index` template summary).
36
+ //
37
+ // Currently only `wp_template` uses this: `posts_per_page` and
38
+ // `default_comment_status` target `root/site`, and `posts_page_title` targets
39
+ // the posts page (the `page` assigned as `page_for_posts`).
40
+ const ENTITIES = {
41
+ wp_template: {
42
+ root_site: {
43
+ kind: 'root',
44
+ name: 'site',
45
+ fields: [ 'posts_per_page', 'default_comment_status' ],
46
+ isVisible: ( item ) =>
47
+ [ 'home', 'index' ].includes( item.slug ?? '' ),
48
+ },
49
+ posttype_page: {
50
+ kind: 'postType',
51
+ name: 'page',
52
+ getId: ( select ) =>
53
+ select( coreDataStore ).getEditedEntityRecord( 'root', 'site' )
54
+ ?.page_for_posts,
55
+ fields: [ 'posts_page_title' ],
56
+ isVisible: ( item ) =>
57
+ [ 'home', 'index' ].includes( item.slug ?? '' ),
58
+ },
59
+ },
60
+ };
61
+
62
+ // Rebinds a namespace-agnostic field to the namespaced record it edits. Every
63
+ // field callback that receives the form `item` is redirected to the
64
+ // `item[ namespace ]` sub-record so the field operates on its own entity:
65
+ // `getValue`/`setValue`/`render` here, and the rest indirectly because they all
66
+ // funnel through the (remapped) `getValue` (default `render`, `getValueFormatted`
67
+ // and `isValid` range/`custom` validation). Edits are wrapped back under the
68
+ // namespace key. The caller-supplied `isVisible` encodes entity-specific
69
+ // conditions (e.g. only for `home`/`index` templates); the generic guard
70
+ // `!! item[ namespace ]` ensures the field is hidden when the sub-record
71
+ // hasn't been fetched.
72
+ function bindFieldToNamespace( field, namespace, isVisible = () => true ) {
73
+ const subItem = ( item ) => item?.[ namespace ] ?? {};
74
+ return {
75
+ ...field,
76
+ getValue: ( { item } ) =>
77
+ field.getValue
78
+ ? field.getValue( { item: subItem( item ) } )
79
+ : subItem( item )[ field.id ],
80
+ setValue: ( { item, value } ) => ( {
81
+ [ namespace ]: field.setValue( { item: subItem( item ), value } ),
82
+ } ),
83
+ render: field.render
84
+ ? ( props ) =>
85
+ field.render( { ...props, item: subItem( props.item ) } )
86
+ : undefined,
87
+ isVisible: ( item ) => isVisible( item ) && !! item[ namespace ],
88
+ };
89
+ }
90
+
24
91
  export default function DataFormPostSummary( { onActionPerformed } ) {
25
92
  const { postType, postId } = useSelect( ( select ) => {
26
93
  const { getCurrentPostType, getCurrentPostId } = select( editorStore );
@@ -50,33 +117,102 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
50
117
 
51
118
  const templatePanelMode = usePostTemplatePanelMode();
52
119
 
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
- }, [] );
120
+ // Assemble every piece of supplementary data merged into the form `data`
121
+ // alongside the post record: read-only editor data that the post's own
122
+ // fields consume (e.g. the `template` field's `available_templates` in
123
+ // classic themes), and the records of other entities targeted by namespaced
124
+ // fields (keyed by `${ kind }_${ name }`) together with the id used to
125
+ // persist edits back to each one.
126
+ const { entityData, entityIds, availableTemplates } = useSelect(
127
+ ( select ) => {
128
+ const { getEditedEntityRecord, canUser, getCurrentTheme } =
129
+ select( coreDataStore );
130
+
131
+ const _availableTemplates = getCurrentTheme()?.is_block_theme
132
+ ? null
133
+ : select( editorStore ).getEditorSettings()
134
+ .availableTemplates ?? {};
135
+
136
+ const extra = {};
137
+ const ids = {};
138
+
139
+ // Other entities the current post type needs merged into its form.
140
+ for ( const [ key, entity ] of Object.entries(
141
+ ENTITIES[ postType ] ?? {}
142
+ ) ) {
143
+ if (
144
+ ! canUser( 'read', {
145
+ kind: entity.kind,
146
+ name: entity.name,
147
+ } )
148
+ ) {
149
+ continue;
150
+ }
151
+ const id = entity.getId ? entity.getId( select ) : undefined;
152
+ // Entities resolved through another record need a valid id.
153
+ if ( entity.getId && ! id ) {
154
+ continue;
155
+ }
156
+ extra[ key ] = getEditedEntityRecord(
157
+ entity.kind,
158
+ entity.name,
159
+ id
160
+ );
161
+ ids[ key ] = id;
162
+ }
163
+
164
+ return {
165
+ entityData: extra,
166
+ entityIds: ids,
167
+ availableTemplates: _availableTemplates,
168
+ };
169
+ },
170
+ [ postType ]
171
+ );
61
172
 
62
- // Augment record only when needed(not a block theme with available templates).
63
- const augmentedRecord = useMemo( () => {
64
- if ( ! record || ! availableTemplates ) {
173
+ // Merge the supplementary data onto the record only when there is any.
174
+ const data = useMemo( () => {
175
+ if ( ! record ) {
65
176
  return record;
66
177
  }
67
- return {
68
- ...record,
69
- available_templates: availableTemplates,
70
- };
71
- }, [ record, availableTemplates ] );
178
+ const extra = { ...entityData };
179
+ if ( availableTemplates && Object.keys( availableTemplates ).length ) {
180
+ extra.available_templates = availableTemplates;
181
+ }
182
+ if ( ! Object.keys( extra ).length ) {
183
+ return record;
184
+ }
185
+ return { ...record, ...extra };
186
+ }, [ record, entityData, availableTemplates ] );
72
187
 
73
188
  const { editEntityRecord } = useDispatch( coreDataStore );
74
189
 
190
+ // Map of namespaced field id to the namespace key its entity is merged under.
191
+ const fieldNamespaces = useMemo( () => {
192
+ const map = {};
193
+ for ( const [ namespace, entity ] of Object.entries(
194
+ ENTITIES[ postType ] ?? {}
195
+ ) ) {
196
+ for ( const id of entity.fields ?? [] ) {
197
+ map[ id ] = namespace;
198
+ }
199
+ }
200
+ return map;
201
+ }, [ postType ] );
202
+
75
203
  const _fields = usePostFields( { postType } );
76
204
  const fields = useMemo(
77
205
  () =>
78
206
  _fields
79
207
  ?.map( ( field ) => {
208
+ const namespace = fieldNamespaces[ field.id ];
209
+ if ( namespace ) {
210
+ return bindFieldToNamespace(
211
+ field,
212
+ namespace,
213
+ ENTITIES[ postType ]?.[ namespace ]?.isVisible
214
+ );
215
+ }
80
216
  if ( field.id === 'status' ) {
81
217
  return {
82
218
  ...field,
@@ -107,24 +243,59 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
107
243
  }
108
244
  return field;
109
245
  } )
110
- .filter( Boolean ),
111
- [ _fields, templatePanelMode, availableTemplates ]
246
+ .filter( Boolean )
247
+ // Editor-only field, injected here rather than registered
248
+ // so it never leaks into the site editor list / quick-edit fields.
249
+ .concat( revisionsField ),
250
+ [
251
+ _fields,
252
+ templatePanelMode,
253
+ availableTemplates,
254
+ fieldNamespaces,
255
+ postType,
256
+ ]
112
257
  );
113
258
 
114
259
  const onChange = ( edits ) => {
260
+ // Route edits that target another entity (merged in under a namespace)
261
+ // back to that entity; collect the rest for the post being edited.
262
+ const entities = ENTITIES[ postType ] ?? {};
263
+ const baseEdits = {};
264
+ for ( const [ key, value ] of Object.entries( edits ) ) {
265
+ const entity = entities[ key ];
266
+ if ( entity ) {
267
+ editEntityRecord(
268
+ entity.kind,
269
+ entity.name,
270
+ entityIds[ key ],
271
+ value
272
+ );
273
+ } else {
274
+ baseEdits[ key ] = value;
275
+ }
276
+ }
277
+
278
+ if ( ! Object.keys( baseEdits ).length ) {
279
+ return;
280
+ }
281
+
115
282
  if (
116
- edits.status &&
117
- edits.status !== 'future' &&
283
+ baseEdits.status &&
284
+ baseEdits.status !== 'future' &&
118
285
  record?.status === 'future' &&
119
286
  new Date( record.date ) > new Date()
120
287
  ) {
121
- edits.date = null;
288
+ baseEdits.date = null;
122
289
  }
123
- if ( edits.status && edits.status === 'private' && record?.password ) {
124
- edits.password = '';
290
+ if (
291
+ baseEdits.status &&
292
+ baseEdits.status === 'private' &&
293
+ record?.password
294
+ ) {
295
+ baseEdits.password = '';
125
296
  }
126
297
 
127
- editEntityRecord( 'postType', postType, postId, edits );
298
+ editEntityRecord( 'postType', postType, postId, baseEdits );
128
299
  };
129
300
  return (
130
301
  <PostPanelSection className="editor-post-summary">
@@ -135,7 +306,7 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
135
306
  onActionPerformed={ onActionPerformed }
136
307
  />
137
308
  <DataForm
138
- data={ augmentedRecord }
309
+ data={ data }
139
310
  fields={ fields }
140
311
  form={ form }
141
312
  onChange={ onChange }
@@ -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
  }
@@ -43,7 +43,7 @@ export default function PostSummary( { onActionPerformed } ) {
43
43
  );
44
44
  if (
45
45
  window?.__experimentalDataFormInspector &&
46
- [ 'page', 'post' ].includes( postType )
46
+ [ 'page', 'post', 'wp_template' ].includes( postType )
47
47
  ) {
48
48
  return <DataFormPostSummary onActionPerformed={ onActionPerformed } />;
49
49
  }
@@ -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
+ }
@@ -37,9 +37,15 @@ import {
37
37
  patternTitleField,
38
38
  notesField,
39
39
  scheduledDateField,
40
+ lastEditedDateField,
40
41
  formatField,
41
42
  postContentInfoField,
42
43
  stickyField,
44
+ descriptionField,
45
+ readOnlyDescriptionField,
46
+ postsPerPageField,
47
+ siteDiscussionField,
48
+ postsPageTitleField,
43
49
  } from '@wordpress/fields';
44
50
  import {
45
51
  altTextField,
@@ -47,7 +53,7 @@ import {
47
53
  authorField as mediaAuthorField,
48
54
  captionField,
49
55
  dateAddedField,
50
- descriptionField,
56
+ descriptionField as mediaDescriptionField,
51
57
  filenameField,
52
58
  filesizeField,
53
59
  mediaDimensionsField,
@@ -164,7 +170,7 @@ const ORDERED_MEDIA_FIELDS = [
164
170
  titleField,
165
171
  altTextField,
166
172
  captionField,
167
- descriptionField,
173
+ mediaDescriptionField,
168
174
  ];
169
175
 
170
176
  export const registerPostTypeSchema =
@@ -262,12 +268,15 @@ export const registerPostTypeSchema =
262
268
  currentTheme?.theme_supports?.[ 'post-thumbnails' ] &&
263
269
  featuredImageField,
264
270
  postTypeConfig.supports?.author && authorField,
265
- statusField,
271
+ ! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
272
+ statusField,
266
273
  ! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
267
274
  dateField,
268
275
  ! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
269
276
  scheduledDateField,
270
- slugField,
277
+ lastEditedDateField,
278
+ ! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
279
+ slugField,
271
280
  ! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
272
281
  postTypeConfig.supports?.excerpt &&
273
282
  excerptField,
@@ -277,15 +286,27 @@ export const registerPostTypeSchema =
277
286
  ( postTypeConfig.supports?.comments ||
278
287
  postTypeConfig.supports?.trackbacks ) &&
279
288
  discussionField,
280
- templateField,
289
+ ! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
290
+ templateField,
281
291
  postTypeConfig.supports?.[ 'post-formats' ] &&
282
292
  ! disablePostFormats &&
283
293
  formatField,
284
294
  ! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
285
295
  postTypeConfig.supports?.editor &&
286
296
  postContentInfoField,
287
- passwordField,
297
+ ! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
298
+ passwordField,
288
299
  postTypeConfig.slug === 'post' && stickyField,
300
+ postTypeConfig.slug === 'wp_template' && descriptionField,
301
+ postTypeConfig.slug === 'wp_template' &&
302
+ readOnlyDescriptionField,
303
+ // The `home`/`index` template summary exposes a few fields that
304
+ // target other entities (`root/site` and the posts page).
305
+ // `DataFormPostSummary` overrides them to read/write the right
306
+ // entity and to control their visibility.
307
+ postTypeConfig.slug === 'wp_template' && postsPageTitleField,
308
+ postTypeConfig.slug === 'wp_template' && postsPerPageField,
309
+ postTypeConfig.slug === 'wp_template' && siteDiscussionField,
289
310
  postTypeConfig.supports?.editor &&
290
311
  postTypeConfig.viewable &&
291
312
  postPreviewField,
@@ -25,6 +25,7 @@ import {
25
25
  getRenderingMode,
26
26
  getCurrentPost,
27
27
  getCurrentPostType,
28
+ getCurrentPostId,
28
29
  getEditorSettings,
29
30
  getCurrentPostRevisionsCount,
30
31
  } from './selectors';
@@ -598,13 +599,22 @@ export const isCollaborationEnabledForCurrentPost = createRegistrySelector(
598
599
  }
599
600
 
600
601
  const currentPostType = getCurrentPostType( state );
602
+ const currentPostId = getCurrentPostId( state );
601
603
  const entityConfig = select( coreStore ).getEntityConfig(
602
604
  'postType',
603
605
  currentPostType
604
606
  );
607
+ const syncConfig = entityConfig?.syncConfig;
605
608
 
606
609
  return Boolean(
607
- entityConfig?.syncConfig && window._wpCollaborationEnabled
610
+ syncConfig &&
611
+ syncConfig.supportsPersistence &&
612
+ window._wpCollaborationEnabled &&
613
+ false !==
614
+ syncConfig.shouldSync?.(
615
+ `postType/${ currentPostType }`,
616
+ currentPostId
617
+ )
608
618
  );
609
619
  }
610
620
  );