@wordpress/editor 14.48.0 → 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 (509) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/build/bindings/pattern-overrides.cjs +1 -1
  3. package/build/bindings/pattern-overrides.cjs.map +2 -2
  4. package/build/components/block-removal-warnings/index.cjs +0 -3
  5. package/build/components/block-removal-warnings/index.cjs.map +2 -2
  6. package/build/components/collab-sidebar/note-byline.cjs +1 -1
  7. package/build/components/collab-sidebar/note-byline.cjs.map +2 -2
  8. package/build/components/collab-sidebar/note-indicator-toolbar.cjs +49 -43
  9. package/build/components/collab-sidebar/note-indicator-toolbar.cjs.map +3 -3
  10. package/build/components/collab-sidebar/note.cjs +49 -17
  11. package/build/components/collab-sidebar/note.cjs.map +3 -3
  12. package/build/components/collab-sidebar/notes.cjs.map +1 -1
  13. package/build/components/collab-sidebar/utils.cjs +1 -1
  14. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  15. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs.map +1 -1
  16. package/build/components/collaborators-overlay/collaborator-styles.cjs.map +1 -1
  17. package/build/components/collaborators-overlay/compute-selection.cjs.map +1 -1
  18. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +1 -1
  19. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +1 -1
  20. package/build/components/collaborators-overlay/use-block-highlighting.cjs +1 -8
  21. package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +3 -3
  22. package/build/components/collaborators-overlay/use-render-cursors.cjs +1 -7
  23. package/build/components/collaborators-overlay/use-render-cursors.cjs.map +3 -3
  24. package/build/components/collaborators-presence/avatar/component.cjs.map +2 -2
  25. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs.map +1 -1
  26. package/build/components/document-bar/index.cjs +7 -5
  27. package/build/components/document-bar/index.cjs.map +2 -2
  28. package/build/components/global-keyboard-shortcuts/index.cjs +3 -2
  29. package/build/components/global-keyboard-shortcuts/index.cjs.map +2 -2
  30. package/build/components/global-styles-sidebar/welcome-guide.cjs +3 -3
  31. package/build/components/global-styles-sidebar/welcome-guide.cjs.map +1 -1
  32. package/build/components/local-autosave-monitor/index.cjs +14 -15
  33. package/build/components/local-autosave-monitor/index.cjs.map +2 -2
  34. package/build/components/more-menu/view-more-menu-group.cjs +1 -2
  35. package/build/components/more-menu/view-more-menu-group.cjs.map +2 -2
  36. package/build/components/page-attributes/parent.cjs +2 -1
  37. package/build/components/page-attributes/parent.cjs.map +2 -2
  38. package/build/components/post-card-panel/index.cjs +1 -1
  39. package/build/components/post-card-panel/index.cjs.map +2 -2
  40. package/build/components/post-excerpt/panel.cjs +1 -1
  41. package/build/components/post-excerpt/panel.cjs.map +2 -2
  42. package/build/components/post-locked-modal/index.cjs +3 -3
  43. package/build/components/post-locked-modal/index.cjs.map +1 -1
  44. package/build/components/post-preview-button/index.cjs +2 -2
  45. package/build/components/post-preview-button/index.cjs.map +2 -2
  46. package/build/components/post-publish-button/index.cjs +115 -157
  47. package/build/components/post-publish-button/index.cjs.map +3 -3
  48. package/build/components/post-publish-button/label.cjs +2 -2
  49. package/build/components/post-publish-button/label.cjs.map +2 -2
  50. package/build/components/post-publish-panel/index.cjs.map +1 -1
  51. package/build/components/post-publish-panel/postpublish.cjs +1 -1
  52. package/build/components/post-publish-panel/postpublish.cjs.map +2 -2
  53. package/build/components/post-revisions-preview/block-diff.cjs +21 -9
  54. package/build/components/post-revisions-preview/block-diff.cjs.map +2 -2
  55. package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
  56. package/build/components/post-revisions-preview/preserve-client-ids.cjs +2 -2
  57. package/build/components/post-revisions-preview/preserve-client-ids.cjs.map +2 -2
  58. package/build/components/post-revisions-preview/revisions-slider.cjs +1 -1
  59. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  60. package/build/components/post-revisions-timeline/index.cjs +173 -0
  61. package/build/components/post-revisions-timeline/index.cjs.map +7 -0
  62. package/build/components/post-saved-state/index.cjs +17 -26
  63. package/build/components/post-saved-state/index.cjs.map +2 -2
  64. package/build/components/post-schedule/label.cjs +5 -5
  65. package/build/components/post-schedule/label.cjs.map +1 -1
  66. package/build/components/post-taxonomies/flat-term-selector.cjs +2 -1
  67. package/build/components/post-taxonomies/flat-term-selector.cjs.map +3 -3
  68. package/build/components/post-taxonomies/hierarchical-term-selector.cjs +1 -1
  69. package/build/components/post-taxonomies/hierarchical-term-selector.cjs.map +2 -2
  70. package/build/components/post-text-editor/index.cjs +51 -0
  71. package/build/components/post-text-editor/index.cjs.map +2 -2
  72. package/build/components/post-text-editor/utils.cjs +150 -0
  73. package/build/components/post-text-editor/utils.cjs.map +7 -0
  74. package/build/components/post-url/index.cjs +1 -1
  75. package/build/components/post-url/index.cjs.map +2 -2
  76. package/build/components/post-view-link/index.cjs +1 -1
  77. package/build/components/post-view-link/index.cjs.map +2 -2
  78. package/build/components/provider/disable-non-page-content-blocks.cjs.map +1 -1
  79. package/build/components/provider/index.cjs +3 -1
  80. package/build/components/provider/index.cjs.map +3 -3
  81. package/build/components/provider/use-network-reconnect.cjs +51 -0
  82. package/build/components/provider/use-network-reconnect.cjs.map +7 -0
  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 +8 -4
  87. package/build/components/revision-fields-diff/index.cjs.map +2 -2
  88. package/build/components/sidebar/dataform-post-summary.cjs +125 -20
  89. package/build/components/sidebar/dataform-post-summary.cjs.map +3 -3
  90. package/build/components/sidebar/index.cjs +2 -15
  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 +1 -1
  95. package/build/components/sidebar/post-summary.cjs.map +2 -2
  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 +7 -1
  103. package/build/components/template-actions-panel/block-theme-content.cjs.map +2 -2
  104. package/build/components/template-actions-panel/index.cjs +0 -9
  105. package/build/components/template-actions-panel/index.cjs.map +3 -3
  106. package/build/components/template-validation-notice/index.cjs +1 -1
  107. package/build/components/template-validation-notice/index.cjs.map +1 -1
  108. package/build/components/upload-progress-snackbar/index.cjs +161 -0
  109. package/build/components/upload-progress-snackbar/index.cjs.map +7 -0
  110. package/build/components/upload-progress-snackbar/tracker.cjs +90 -0
  111. package/build/components/upload-progress-snackbar/tracker.cjs.map +7 -0
  112. package/build/components/visual-editor/edit-template-blocks-notification.cjs +1 -1
  113. package/build/components/visual-editor/edit-template-blocks-notification.cjs.map +1 -1
  114. package/build/{components/revision-author-panel → dataviews/fields/revisions}/index.cjs +18 -26
  115. package/build/dataviews/fields/revisions/index.cjs.map +7 -0
  116. package/build/dataviews/fields/revisions/revisions-view.cjs +74 -0
  117. package/build/dataviews/fields/revisions/revisions-view.cjs.map +7 -0
  118. package/build/dataviews/store/private-actions.cjs +14 -4
  119. package/build/dataviews/store/private-actions.cjs.map +3 -3
  120. package/build/hooks/push-changes-to-global-styles/index.cjs +1 -1
  121. package/build/hooks/push-changes-to-global-styles/index.cjs.map +1 -1
  122. package/build/private-apis.cjs +2 -0
  123. package/build/private-apis.cjs.map +3 -3
  124. package/build/store/actions.cjs +1 -1
  125. package/build/store/actions.cjs.map +2 -2
  126. package/build/store/private-selectors.cjs +6 -1
  127. package/build/store/private-selectors.cjs.map +2 -2
  128. package/build/store/selectors.cjs +1 -2
  129. package/build/store/selectors.cjs.map +2 -2
  130. package/build/utils/media-upload/index.cjs +16 -0
  131. package/build/utils/media-upload/index.cjs.map +3 -3
  132. package/build/utils/set-nested-value.cjs.map +1 -1
  133. package/build-module/bindings/pattern-overrides.mjs +1 -1
  134. package/build-module/bindings/pattern-overrides.mjs.map +2 -2
  135. package/build-module/components/block-removal-warnings/index.mjs +0 -3
  136. package/build-module/components/block-removal-warnings/index.mjs.map +2 -2
  137. package/build-module/components/collab-sidebar/note-byline.mjs +1 -1
  138. package/build-module/components/collab-sidebar/note-byline.mjs.map +2 -2
  139. package/build-module/components/collab-sidebar/note-indicator-toolbar.mjs +53 -44
  140. package/build-module/components/collab-sidebar/note-indicator-toolbar.mjs.map +2 -2
  141. package/build-module/components/collab-sidebar/note.mjs +50 -18
  142. package/build-module/components/collab-sidebar/note.mjs.map +2 -2
  143. package/build-module/components/collab-sidebar/notes.mjs.map +1 -1
  144. package/build-module/components/collab-sidebar/utils.mjs +1 -1
  145. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  146. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs.map +1 -1
  147. package/build-module/components/collaborators-overlay/collaborator-styles.mjs.map +1 -1
  148. package/build-module/components/collaborators-overlay/compute-selection.mjs.map +1 -1
  149. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +1 -1
  150. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +1 -1
  151. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs +1 -8
  152. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
  153. package/build-module/components/collaborators-overlay/use-render-cursors.mjs +1 -7
  154. package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
  155. package/build-module/components/collaborators-presence/avatar/component.mjs.map +2 -2
  156. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs.map +1 -1
  157. package/build-module/components/document-bar/index.mjs +7 -5
  158. package/build-module/components/document-bar/index.mjs.map +2 -2
  159. package/build-module/components/global-keyboard-shortcuts/index.mjs +3 -2
  160. package/build-module/components/global-keyboard-shortcuts/index.mjs.map +2 -2
  161. package/build-module/components/global-styles-sidebar/welcome-guide.mjs +3 -3
  162. package/build-module/components/global-styles-sidebar/welcome-guide.mjs.map +1 -1
  163. package/build-module/components/local-autosave-monitor/index.mjs +15 -16
  164. package/build-module/components/local-autosave-monitor/index.mjs.map +2 -2
  165. package/build-module/components/more-menu/view-more-menu-group.mjs +1 -2
  166. package/build-module/components/more-menu/view-more-menu-group.mjs.map +2 -2
  167. package/build-module/components/page-attributes/parent.mjs +2 -1
  168. package/build-module/components/page-attributes/parent.mjs.map +2 -2
  169. package/build-module/components/post-card-panel/index.mjs +1 -1
  170. package/build-module/components/post-card-panel/index.mjs.map +2 -2
  171. package/build-module/components/post-excerpt/panel.mjs +1 -1
  172. package/build-module/components/post-excerpt/panel.mjs.map +2 -2
  173. package/build-module/components/post-locked-modal/index.mjs +3 -3
  174. package/build-module/components/post-locked-modal/index.mjs.map +1 -1
  175. package/build-module/components/post-preview-button/index.mjs +2 -2
  176. package/build-module/components/post-preview-button/index.mjs.map +2 -2
  177. package/build-module/components/post-publish-button/index.mjs +117 -159
  178. package/build-module/components/post-publish-button/index.mjs.map +2 -2
  179. package/build-module/components/post-publish-button/label.mjs +2 -2
  180. package/build-module/components/post-publish-button/label.mjs.map +2 -2
  181. package/build-module/components/post-publish-panel/index.mjs.map +1 -1
  182. package/build-module/components/post-publish-panel/postpublish.mjs +1 -1
  183. package/build-module/components/post-publish-panel/postpublish.mjs.map +2 -2
  184. package/build-module/components/post-revisions-preview/block-diff.mjs +20 -8
  185. package/build-module/components/post-revisions-preview/block-diff.mjs.map +2 -2
  186. package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
  187. package/build-module/components/post-revisions-preview/preserve-client-ids.mjs +1 -1
  188. package/build-module/components/post-revisions-preview/preserve-client-ids.mjs.map +1 -1
  189. package/build-module/components/post-revisions-preview/revisions-slider.mjs +1 -1
  190. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  191. package/build-module/components/post-revisions-timeline/index.mjs +152 -0
  192. package/build-module/components/post-revisions-timeline/index.mjs.map +7 -0
  193. package/build-module/components/post-saved-state/index.mjs +17 -26
  194. package/build-module/components/post-saved-state/index.mjs.map +2 -2
  195. package/build-module/components/post-schedule/label.mjs +5 -5
  196. package/build-module/components/post-schedule/label.mjs.map +1 -1
  197. package/build-module/components/post-taxonomies/flat-term-selector.mjs +3 -6
  198. package/build-module/components/post-taxonomies/flat-term-selector.mjs.map +2 -2
  199. package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs +1 -1
  200. package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs.map +2 -2
  201. package/build-module/components/post-text-editor/index.mjs +51 -0
  202. package/build-module/components/post-text-editor/index.mjs.map +2 -2
  203. package/build-module/components/post-text-editor/utils.mjs +123 -0
  204. package/build-module/components/post-text-editor/utils.mjs.map +7 -0
  205. package/build-module/components/post-url/index.mjs +1 -1
  206. package/build-module/components/post-url/index.mjs.map +2 -2
  207. package/build-module/components/post-view-link/index.mjs +1 -1
  208. package/build-module/components/post-view-link/index.mjs.map +2 -2
  209. package/build-module/components/provider/disable-non-page-content-blocks.mjs.map +1 -1
  210. package/build-module/components/provider/index.mjs +3 -1
  211. package/build-module/components/provider/index.mjs.map +2 -2
  212. package/build-module/components/provider/use-network-reconnect.mjs +30 -0
  213. package/build-module/components/provider/use-network-reconnect.mjs.map +7 -0
  214. package/build-module/components/resizable-editor/resize-handle.mjs.map +2 -2
  215. package/build-module/components/revision-diff-panel/index.mjs +7 -2
  216. package/build-module/components/revision-diff-panel/index.mjs.map +2 -2
  217. package/build-module/components/revision-fields-diff/index.mjs +8 -4
  218. package/build-module/components/revision-fields-diff/index.mjs.map +2 -2
  219. package/build-module/components/sidebar/dataform-post-summary.mjs +125 -20
  220. package/build-module/components/sidebar/dataform-post-summary.mjs.map +2 -2
  221. package/build-module/components/sidebar/index.mjs +3 -22
  222. package/build-module/components/sidebar/index.mjs.map +2 -2
  223. package/build-module/components/sidebar/post-revision-summary.mjs +11 -17
  224. package/build-module/components/sidebar/post-revision-summary.mjs.map +2 -2
  225. package/build-module/components/sidebar/post-summary.mjs +1 -1
  226. package/build-module/components/sidebar/post-summary.mjs.map +2 -2
  227. package/build-module/components/style-book/examples.mjs +1 -1
  228. package/build-module/components/style-book/examples.mjs.map +1 -1
  229. package/build-module/components/style-book/index.mjs +1 -1
  230. package/build-module/components/style-book/index.mjs.map +2 -2
  231. package/build-module/components/sync-connection-error-modal/index.mjs +3 -3
  232. package/build-module/components/sync-connection-error-modal/index.mjs.map +1 -1
  233. package/build-module/components/template-actions-panel/block-theme-content.mjs +7 -1
  234. package/build-module/components/template-actions-panel/block-theme-content.mjs.map +2 -2
  235. package/build-module/components/template-actions-panel/index.mjs +0 -9
  236. package/build-module/components/template-actions-panel/index.mjs.map +2 -2
  237. package/build-module/components/template-validation-notice/index.mjs +1 -1
  238. package/build-module/components/template-validation-notice/index.mjs.map +1 -1
  239. package/build-module/components/upload-progress-snackbar/index.mjs +135 -0
  240. package/build-module/components/upload-progress-snackbar/index.mjs.map +7 -0
  241. package/build-module/components/upload-progress-snackbar/tracker.mjs +61 -0
  242. package/build-module/components/upload-progress-snackbar/tracker.mjs.map +7 -0
  243. package/build-module/components/visual-editor/edit-template-blocks-notification.mjs +1 -1
  244. package/build-module/components/visual-editor/edit-template-blocks-notification.mjs.map +1 -1
  245. package/build-module/dataviews/fields/revisions/index.mjs +20 -0
  246. package/build-module/dataviews/fields/revisions/index.mjs.map +7 -0
  247. package/build-module/dataviews/fields/revisions/revisions-view.mjs +53 -0
  248. package/build-module/dataviews/fields/revisions/revisions-view.mjs.map +7 -0
  249. package/build-module/dataviews/store/private-actions.mjs +23 -7
  250. package/build-module/dataviews/store/private-actions.mjs.map +2 -2
  251. package/build-module/hooks/push-changes-to-global-styles/index.mjs +1 -1
  252. package/build-module/hooks/push-changes-to-global-styles/index.mjs.map +1 -1
  253. package/build-module/private-apis.mjs +2 -0
  254. package/build-module/private-apis.mjs.map +2 -2
  255. package/build-module/store/actions.mjs +1 -1
  256. package/build-module/store/actions.mjs.map +2 -2
  257. package/build-module/store/private-selectors.mjs +7 -1
  258. package/build-module/store/private-selectors.mjs.map +2 -2
  259. package/build-module/store/selectors.mjs +1 -2
  260. package/build-module/store/selectors.mjs.map +2 -2
  261. package/build-module/utils/media-upload/index.mjs +19 -0
  262. package/build-module/utils/media-upload/index.mjs.map +2 -2
  263. package/build-module/utils/set-nested-value.mjs.map +1 -1
  264. package/build-style/style-rtl.css +707 -270
  265. package/build-style/style.css +707 -270
  266. package/build-types/components/block-removal-warnings/index.d.ts.map +1 -1
  267. package/build-types/components/collab-sidebar/note-byline.d.ts +0 -3
  268. package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -1
  269. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts.map +1 -1
  270. package/build-types/components/collab-sidebar/note.d.ts.map +1 -1
  271. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +0 -3
  272. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts.map +1 -1
  273. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
  274. package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -1
  275. package/build-types/components/document-bar/index.d.ts.map +1 -1
  276. package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -1
  277. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
  278. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  279. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  280. package/build-types/components/post-publish-button/index.d.ts +9 -9
  281. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  282. package/build-types/components/post-revisions-preview/block-diff.d.ts +3 -0
  283. package/build-types/components/post-revisions-preview/block-diff.d.ts.map +1 -1
  284. package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
  285. package/build-types/components/post-revisions-timeline/index.d.ts +2 -0
  286. package/build-types/components/post-revisions-timeline/index.d.ts.map +1 -0
  287. package/build-types/components/post-saved-state/index.d.ts.map +1 -1
  288. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  289. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  290. package/build-types/components/post-text-editor/utils.d.ts +29 -0
  291. package/build-types/components/post-text-editor/utils.d.ts.map +1 -0
  292. package/build-types/components/provider/index.d.ts.map +1 -1
  293. package/build-types/components/provider/use-network-reconnect.d.ts +8 -0
  294. package/build-types/components/provider/use-network-reconnect.d.ts.map +1 -0
  295. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
  296. package/build-types/components/revision-diff-panel/index.d.ts +3 -1
  297. package/build-types/components/revision-diff-panel/index.d.ts.map +1 -1
  298. package/build-types/components/revision-fields-diff/index.d.ts +3 -0
  299. package/build-types/components/revision-fields-diff/index.d.ts.map +1 -1
  300. package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
  301. package/build-types/components/sidebar/index.d.ts.map +1 -1
  302. package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -1
  303. package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -1
  304. package/build-types/components/template-actions-panel/index.d.ts.map +1 -1
  305. package/build-types/components/upload-progress-snackbar/index.d.ts +19 -0
  306. package/build-types/components/upload-progress-snackbar/index.d.ts.map +1 -0
  307. package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts +28 -0
  308. package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts.map +1 -0
  309. package/build-types/components/upload-progress-snackbar/tracker.d.ts +41 -0
  310. package/build-types/components/upload-progress-snackbar/tracker.d.ts.map +1 -0
  311. package/build-types/dataviews/fields/revisions/index.d.ts +8 -0
  312. package/build-types/dataviews/fields/revisions/index.d.ts.map +1 -0
  313. package/build-types/dataviews/fields/revisions/revisions-view.d.ts +2 -0
  314. package/build-types/dataviews/fields/revisions/revisions-view.d.ts.map +1 -0
  315. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  316. package/build-types/private-apis.d.ts.map +1 -1
  317. package/build-types/store/private-selectors.d.ts +1 -1
  318. package/build-types/store/private-selectors.d.ts.map +1 -1
  319. package/build-types/store/selectors.d.ts +1 -1
  320. package/build-types/store/selectors.d.ts.map +1 -1
  321. package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
  322. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  323. package/package.json +59 -50
  324. package/src/bindings/pattern-overrides.js +1 -1
  325. package/src/bindings/test/pattern-overrides.js +65 -0
  326. package/src/components/README.md +1 -1
  327. package/src/components/block-removal-warnings/index.js +0 -7
  328. package/src/components/collab-sidebar/note-byline.js +0 -1
  329. package/src/components/collab-sidebar/note-indicator-toolbar.js +73 -60
  330. package/src/components/collab-sidebar/note.js +64 -29
  331. package/src/components/collab-sidebar/style.scss +20 -0
  332. package/src/components/collaborators-overlay/use-block-highlighting.ts +0 -9
  333. package/src/components/collaborators-overlay/use-render-cursors.ts +0 -8
  334. package/src/components/collaborators-presence/avatar/component.tsx +0 -1
  335. package/src/components/collaborators-presence/avatar/test/index.tsx +8 -4
  336. package/src/components/document-bar/index.js +8 -3
  337. package/src/components/document-bar/style.scss +4 -2
  338. package/src/components/global-keyboard-shortcuts/index.js +2 -1
  339. package/src/components/local-autosave-monitor/index.js +23 -21
  340. package/src/components/more-menu/view-more-menu-group.js +1 -2
  341. package/src/components/page-attributes/parent.js +1 -0
  342. package/src/components/post-card-panel/index.js +1 -1
  343. package/src/components/post-publish-button/index.js +146 -192
  344. package/src/components/post-publish-button/test/index.js +149 -113
  345. package/src/components/post-revisions-preview/block-diff.js +63 -19
  346. package/src/components/post-revisions-preview/diff-markers.js +0 -1
  347. package/src/components/post-revisions-preview/preserve-client-ids.js +1 -1
  348. package/src/components/post-revisions-preview/test/block-diff.js +109 -6
  349. package/src/components/post-revisions-timeline/index.js +186 -0
  350. package/src/components/post-revisions-timeline/style.scss +43 -0
  351. package/src/components/post-saved-state/index.js +23 -26
  352. package/src/components/post-saved-state/test/index.js +18 -0
  353. package/src/components/post-taxonomies/flat-term-selector.js +4 -7
  354. package/src/components/post-text-editor/index.js +65 -0
  355. package/src/components/post-text-editor/test/utils.js +210 -0
  356. package/src/components/post-text-editor/utils.js +204 -0
  357. package/src/components/post-type-support-check/test/index.js +11 -0
  358. package/src/components/post-url/index.js +1 -1
  359. package/src/components/post-view-link/index.js +1 -1
  360. package/src/components/post-view-link/test/index.js +71 -0
  361. package/src/components/provider/index.js +6 -1
  362. package/src/components/provider/test/use-network-reconnect.js +137 -0
  363. package/src/components/provider/use-network-reconnect.js +44 -0
  364. package/src/components/resizable-editor/resize-handle.js +0 -1
  365. package/src/components/revision-diff-panel/index.js +8 -2
  366. package/src/components/revision-fields-diff/index.js +19 -3
  367. package/src/components/sidebar/dataform-post-summary.js +196 -25
  368. package/src/components/sidebar/index.js +4 -23
  369. package/src/components/sidebar/post-revision-summary.js +8 -15
  370. package/src/components/sidebar/post-summary.js +1 -1
  371. package/src/components/style-book/index.js +1 -1
  372. package/src/components/template-actions-panel/block-theme-content.js +10 -2
  373. package/src/components/template-actions-panel/index.js +0 -15
  374. package/src/components/upload-progress-snackbar/README.md +26 -0
  375. package/src/components/upload-progress-snackbar/index.js +216 -0
  376. package/src/components/upload-progress-snackbar/stories/index.story.tsx +85 -0
  377. package/src/components/upload-progress-snackbar/style.scss +30 -0
  378. package/src/components/upload-progress-snackbar/test/index.js +199 -0
  379. package/src/components/upload-progress-snackbar/tracker.js +105 -0
  380. package/src/dataviews/fields/revisions/index.tsx +28 -0
  381. package/src/dataviews/fields/revisions/revisions-view.tsx +59 -0
  382. package/src/dataviews/store/private-actions.ts +27 -6
  383. package/src/private-apis.js +2 -0
  384. package/src/store/private-selectors.js +11 -1
  385. package/src/store/selectors.js +1 -3
  386. package/src/store/test/private-selectors.js +69 -0
  387. package/src/style.scss +2 -1
  388. package/src/utils/media-upload/index.js +27 -0
  389. package/build/components/post-revisions-panel/index.cjs +0 -173
  390. package/build/components/post-revisions-panel/index.cjs.map +0 -7
  391. package/build/components/revision-author-panel/index.cjs.map +0 -7
  392. package/build/components/revision-created-panel/index.cjs +0 -47
  393. package/build/components/revision-created-panel/index.cjs.map +0 -7
  394. package/build-module/components/post-revisions-panel/index.mjs +0 -148
  395. package/build-module/components/post-revisions-panel/index.mjs.map +0 -7
  396. package/build-module/components/revision-author-panel/index.mjs +0 -28
  397. package/build-module/components/revision-author-panel/index.mjs.map +0 -7
  398. package/build-module/components/revision-created-panel/index.mjs +0 -26
  399. package/build-module/components/revision-created-panel/index.mjs.map +0 -7
  400. package/build-types/components/post-revisions-panel/index.d.ts +0 -2
  401. package/build-types/components/post-revisions-panel/index.d.ts.map +0 -1
  402. package/build-types/components/revision-author-panel/index.d.ts +0 -2
  403. package/build-types/components/revision-author-panel/index.d.ts.map +0 -1
  404. package/build-types/components/revision-created-panel/index.d.ts +0 -2
  405. package/build-types/components/revision-created-panel/index.d.ts.map +0 -1
  406. package/src/components/commands/index.native.js +0 -2
  407. package/src/components/deprecated.native.js +0 -47
  408. package/src/components/editor-help/add-blocks.native.js +0 -40
  409. package/src/components/editor-help/customize-blocks.native.js +0 -40
  410. package/src/components/editor-help/help-detail-navigation-screen.native.js +0 -67
  411. package/src/components/editor-help/help-get-support-button.native.js +0 -38
  412. package/src/components/editor-help/help-section-title.native.js +0 -29
  413. package/src/components/editor-help/help-topic-row.native.js +0 -33
  414. package/src/components/editor-help/icon-move-blocks.native.js +0 -10
  415. package/src/components/editor-help/images/add-dark.png +0 -0
  416. package/src/components/editor-help/images/add-dark@2x.png +0 -0
  417. package/src/components/editor-help/images/add-dark@3x.png +0 -0
  418. package/src/components/editor-help/images/add-light.png +0 -0
  419. package/src/components/editor-help/images/add-light@2x.png +0 -0
  420. package/src/components/editor-help/images/add-light@3x.png +0 -0
  421. package/src/components/editor-help/images/block-layout-collage.png +0 -0
  422. package/src/components/editor-help/images/block-layout-collage@2x.png +0 -0
  423. package/src/components/editor-help/images/block-layout-collage@3x.png +0 -0
  424. package/src/components/editor-help/images/build-layouts-dark.png +0 -0
  425. package/src/components/editor-help/images/build-layouts-dark@2x.png +0 -0
  426. package/src/components/editor-help/images/build-layouts-dark@3x.png +0 -0
  427. package/src/components/editor-help/images/build-layouts-light.png +0 -0
  428. package/src/components/editor-help/images/build-layouts-light@2x.png +0 -0
  429. package/src/components/editor-help/images/build-layouts-light@3x.png +0 -0
  430. package/src/components/editor-help/images/drag-and-drop-dark.png +0 -0
  431. package/src/components/editor-help/images/drag-and-drop-dark@2x.png +0 -0
  432. package/src/components/editor-help/images/drag-and-drop-dark@3x.png +0 -0
  433. package/src/components/editor-help/images/drag-and-drop-light.png +0 -0
  434. package/src/components/editor-help/images/drag-and-drop-light@2x.png +0 -0
  435. package/src/components/editor-help/images/drag-and-drop-light@3x.png +0 -0
  436. package/src/components/editor-help/images/edit-media-dark.png +0 -0
  437. package/src/components/editor-help/images/edit-media-dark@2x.png +0 -0
  438. package/src/components/editor-help/images/edit-media-dark@3x.png +0 -0
  439. package/src/components/editor-help/images/edit-media-light.png +0 -0
  440. package/src/components/editor-help/images/edit-media-light@2x.png +0 -0
  441. package/src/components/editor-help/images/edit-media-light@3x.png +0 -0
  442. package/src/components/editor-help/images/embed-media-dark.png +0 -0
  443. package/src/components/editor-help/images/embed-media-dark@2x.png +0 -0
  444. package/src/components/editor-help/images/embed-media-dark@3x.png +0 -0
  445. package/src/components/editor-help/images/embed-media-light.png +0 -0
  446. package/src/components/editor-help/images/embed-media-light@2x.png +0 -0
  447. package/src/components/editor-help/images/embed-media-light@3x.png +0 -0
  448. package/src/components/editor-help/images/move-dark.png +0 -0
  449. package/src/components/editor-help/images/move-dark@2x.png +0 -0
  450. package/src/components/editor-help/images/move-dark@3x.png +0 -0
  451. package/src/components/editor-help/images/move-light.png +0 -0
  452. package/src/components/editor-help/images/move-light@2x.png +0 -0
  453. package/src/components/editor-help/images/move-light@3x.png +0 -0
  454. package/src/components/editor-help/images/options-dark.png +0 -0
  455. package/src/components/editor-help/images/options-dark@2x.png +0 -0
  456. package/src/components/editor-help/images/options-dark@3x.png +0 -0
  457. package/src/components/editor-help/images/options-light.png +0 -0
  458. package/src/components/editor-help/images/options-light@2x.png +0 -0
  459. package/src/components/editor-help/images/options-light@3x.png +0 -0
  460. package/src/components/editor-help/images/rich-text-dark.png +0 -0
  461. package/src/components/editor-help/images/rich-text-dark@2x.png +0 -0
  462. package/src/components/editor-help/images/rich-text-dark@3x.png +0 -0
  463. package/src/components/editor-help/images/rich-text-light.png +0 -0
  464. package/src/components/editor-help/images/rich-text-light@2x.png +0 -0
  465. package/src/components/editor-help/images/rich-text-light@3x.png +0 -0
  466. package/src/components/editor-help/images/settings-dark.png +0 -0
  467. package/src/components/editor-help/images/settings-dark@2x.png +0 -0
  468. package/src/components/editor-help/images/settings-dark@3x.png +0 -0
  469. package/src/components/editor-help/images/settings-light.png +0 -0
  470. package/src/components/editor-help/images/settings-light@2x.png +0 -0
  471. package/src/components/editor-help/images/settings-light@3x.png +0 -0
  472. package/src/components/editor-help/index.native.js +0 -208
  473. package/src/components/editor-help/intro-to-blocks.native.js +0 -91
  474. package/src/components/editor-help/move-blocks.native.js +0 -55
  475. package/src/components/editor-help/remove-blocks.native.js +0 -35
  476. package/src/components/editor-help/style.android.scss +0 -6
  477. package/src/components/editor-help/style.ios.scss +0 -6
  478. package/src/components/editor-help/style.scss +0 -123
  479. package/src/components/editor-help/test/index.native.js +0 -81
  480. package/src/components/editor-help/view-sections.native.js +0 -79
  481. package/src/components/error-boundary/index.native.js +0 -192
  482. package/src/components/error-boundary/style.native.scss +0 -116
  483. package/src/components/index.native.js +0 -15
  484. package/src/components/offline-status/index.native.js +0 -99
  485. package/src/components/offline-status/style.native.scss +0 -28
  486. package/src/components/offline-status/test/index.native.js +0 -108
  487. package/src/components/post-revisions-panel/index.js +0 -161
  488. package/src/components/post-revisions-panel/style.scss +0 -16
  489. package/src/components/post-title/index.native.js +0 -282
  490. package/src/components/post-title/style.native.scss +0 -13
  491. package/src/components/post-title/test/__snapshots__/index.native.js.snap +0 -25
  492. package/src/components/post-title/test/index.native.js +0 -78
  493. package/src/components/provider/index.native.js +0 -497
  494. package/src/components/provider/use-block-editor-settings.native.js +0 -48
  495. package/src/components/revision-author-panel/index.js +0 -36
  496. package/src/components/revision-created-panel/index.js +0 -36
  497. package/src/components/template-part-menu-items/index.native.js +0 -3
  498. package/src/hooks/index.native.js +0 -0
  499. package/src/index.native.js +0 -16
  500. package/src/private-apis.native.js +0 -33
  501. package/src/store/actions.native.js +0 -27
  502. package/src/store/reducer.native.js +0 -94
  503. package/src/store/selectors.native.js +0 -57
  504. package/src/store/test/actions.native.js +0 -16
  505. package/src/store/test/reducer.native.js +0 -36
  506. package/src/store/test/selectors.native.js +0 -28
  507. package/src/utils/index.native.js +0 -6
  508. package/src/utils/media-sideload/index.native.js +0 -1
  509. package/src/utils/media-upload/index.native.js +0 -1
@@ -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,
@@ -29,6 +29,7 @@ import GlobalStylesUIWrapper from './components/global-styles';
29
29
  import { StyleBookPreview } from './components/style-book';
30
30
  import { useGlobalStyles, useStyle } from './components/global-styles/hooks';
31
31
  import { GlobalStylesActionMenu } from './components/global-styles/menu';
32
+ import UploadProgressSnackbar from './components/upload-progress-snackbar';
32
33
 
33
34
  const { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;
34
35
 
@@ -48,6 +49,7 @@ lock( privateApis, {
48
49
  ToolsMoreMenuGroup,
49
50
  ViewMoreMenuGroup,
50
51
  ResizableEditor,
52
+ UploadProgressSnackbar,
51
53
  registerCoreBlockBindingsSources,
52
54
  getTemplateInfo,
53
55
  // Global Styles
@@ -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
  );
@@ -11,7 +11,6 @@ import { isInTheFuture, getDate } from '@wordpress/date';
11
11
  import { addQueryArgs, cleanForSlug } from '@wordpress/url';
12
12
  import { createSelector, createRegistrySelector } from '@wordpress/data';
13
13
  import deprecated from '@wordpress/deprecated';
14
- import { Platform } from '@wordpress/element';
15
14
  import { store as blockEditorStore } from '@wordpress/block-editor';
16
15
  import { store as coreStore } from '@wordpress/core-data';
17
16
  import { store as preferencesStore } from '@wordpress/preferences';
@@ -524,8 +523,7 @@ export function isEditedPostSaveable( state ) {
524
523
  return (
525
524
  !! getEditedPostAttribute( state, 'title' ) ||
526
525
  !! getEditedPostAttribute( state, 'excerpt' ) ||
527
- ! isEditedPostEmpty( state ) ||
528
- Platform.OS === 'native'
526
+ ! isEditedPostEmpty( state )
529
527
  );
530
528
  }
531
529
 
@@ -10,7 +10,9 @@ import { store as preferencesStore } from '@wordpress/preferences';
10
10
  import {
11
11
  getDefaultRenderingMode,
12
12
  getPostBlocksByName,
13
+ isCollaborationEnabledForCurrentPost,
13
14
  } from '../private-selectors';
15
+ import { lock } from '../../lock-unlock';
14
16
 
15
17
  describe( 'getPostBlocksByName', () => {
16
18
  const state = {
@@ -86,6 +88,73 @@ describe( 'getPostBlocksByName', () => {
86
88
  } );
87
89
  } );
88
90
 
91
+ describe( 'isCollaborationEnabledForCurrentPost', () => {
92
+ let originalCollaborationEnabled;
93
+
94
+ beforeEach( () => {
95
+ originalCollaborationEnabled = window._wpCollaborationEnabled;
96
+ window._wpCollaborationEnabled = true;
97
+ } );
98
+
99
+ afterEach( () => {
100
+ window._wpCollaborationEnabled = originalCollaborationEnabled;
101
+ } );
102
+
103
+ function setupRegistry( {
104
+ collaborationSupported = true,
105
+ syncConfig = {},
106
+ } = {} ) {
107
+ isCollaborationEnabledForCurrentPost.registry = {
108
+ select: ( store ) => {
109
+ if ( store === coreStore ) {
110
+ const selectors = {
111
+ getEntityConfig: () => ( { syncConfig } ),
112
+ };
113
+ lock( selectors, {
114
+ isCollaborationSupported: () => collaborationSupported,
115
+ } );
116
+ return selectors;
117
+ }
118
+ },
119
+ };
120
+ }
121
+
122
+ it( 'returns true when the current post type sync config should sync', () => {
123
+ const shouldSync = jest.fn( () => true );
124
+ setupRegistry( {
125
+ syncConfig: { shouldSync, supportsPersistence: true },
126
+ } );
127
+
128
+ const state = { postType: 'book', postId: 123 };
129
+
130
+ expect( isCollaborationEnabledForCurrentPost( state ) ).toBe( true );
131
+ expect( shouldSync ).toHaveBeenCalledWith( 'postType/book', 123 );
132
+ } );
133
+
134
+ it( 'returns false when the current post type sync config does not support persistence', () => {
135
+ const shouldSync = jest.fn( () => true );
136
+ setupRegistry( { syncConfig: { shouldSync } } );
137
+
138
+ const state = { postType: 'book', postId: 123 };
139
+
140
+ expect( isCollaborationEnabledForCurrentPost( state ) ).toBe( false );
141
+ expect( shouldSync ).not.toHaveBeenCalled();
142
+ } );
143
+
144
+ it( 'returns false when the current post type sync config should not sync', () => {
145
+ setupRegistry( {
146
+ syncConfig: {
147
+ shouldSync: () => false,
148
+ supportsPersistence: true,
149
+ },
150
+ } );
151
+
152
+ const state = { postType: 'book', postId: 123 };
153
+
154
+ expect( isCollaborationEnabledForCurrentPost( state ) ).toBe( false );
155
+ } );
156
+ } );
157
+
89
158
  describe( 'getDefaultRenderingMode', () => {
90
159
  function setupRegistry( {
91
160
  supportsEditor = true,
package/src/style.scss CHANGED
@@ -40,8 +40,8 @@
40
40
  @use "./components/post-panel-row/style.scss" as *;
41
41
  @use "./components/post-panel-section/style.scss" as *;
42
42
  @use "./components/post-publish-panel/style.scss" as *;
43
- @use "./components/post-revisions-panel/style.scss" as *;
44
43
  @use "./components/post-revisions-preview/style.scss" as *;
44
+ @use "./components/post-revisions-timeline/style.scss" as *;
45
45
  @use "./components/revision-diff-panel/style.scss" as *;
46
46
  @use "./components/post-saved-state/style.scss" as *;
47
47
  @use "./components/post-schedule/style.scss" as *;
@@ -68,6 +68,7 @@
68
68
  @use "./components/styles-canvas/style.scss" as *;
69
69
  @use "./components/table-of-contents/style.scss" as *;
70
70
  @use "./components/text-editor/style.scss" as *;
71
+ @use "./components/upload-progress-snackbar/style.scss" as *;
71
72
  @use "./components/visual-editor/style.scss" as *;
72
73
  @use "./dataviews/fields/content-preview/style.scss" as *;
73
74
  @use "./hooks/push-changes-to-global-styles/style.scss" as *;
@@ -15,6 +15,10 @@ import { isClientSideMediaSupported } from '@wordpress/upload-media';
15
15
  * Internal dependencies
16
16
  */
17
17
  import { store as editorStore } from '../../store';
18
+ import {
19
+ addFiles as trackStart,
20
+ advance as trackAdvance,
21
+ } from '../../components/upload-progress-snackbar/tracker';
18
22
 
19
23
  const noop = () => {};
20
24
 
@@ -78,6 +82,18 @@ export default function mediaUpload( {
78
82
 
79
83
  const postData = currentPostId ? { post: currentPostId } : {};
80
84
 
85
+ // Track this batch for the upload progress snackbar. Only applies to the
86
+ // non-CSM path — when CSM is enabled, the block-editor provider intercepts
87
+ // mediaUpload and dispatches to the upload-media store, so this wrapper is
88
+ // not called.
89
+ if ( ! isClientSideMediaActive ) {
90
+ const trackingFiles = Array.from( filesList ).map(
91
+ ( f ) => f?.name || ''
92
+ );
93
+ trackStart( trackingFiles );
94
+ }
95
+ let lastCompletedCount = 0;
96
+
81
97
  uploadMedia( {
82
98
  allowedTypes,
83
99
  filesList,
@@ -106,6 +122,15 @@ export default function mediaUpload( {
106
122
  ) {
107
123
  clearSaveLock();
108
124
  }
125
+
126
+ // Advance the snackbar tracker for newly-completed files.
127
+ if ( ! isClientSideMediaActive ) {
128
+ const completedCount = entityFiles.length;
129
+ if ( completedCount > lastCompletedCount ) {
130
+ trackAdvance( completedCount - lastCompletedCount );
131
+ lastCompletedCount = completedCount;
132
+ }
133
+ }
109
134
  },
110
135
  onSuccess,
111
136
  additionalData: {
@@ -116,6 +141,8 @@ export default function mediaUpload( {
116
141
  onError: ( { message } ) => {
117
142
  if ( ! isClientSideMediaActive ) {
118
143
  clearSaveLock();
144
+ // Failed files still count as "done" for the snackbar.
145
+ trackAdvance( 1 );
119
146
  }
120
147
  onError( message );
121
148
  },
@@ -1,173 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // packages/editor/src/components/post-revisions-panel/index.js
31
- var post_revisions_panel_exports = {};
32
- __export(post_revisions_panel_exports, {
33
- default: () => PostRevisionsPanel
34
- });
35
- module.exports = __toCommonJS(post_revisions_panel_exports);
36
- var import_components = require("@wordpress/components");
37
- var import_core_data = require("@wordpress/core-data");
38
- var import_dataviews = require("@wordpress/dataviews");
39
- var import_date = require("@wordpress/date");
40
- var import_data = require("@wordpress/data");
41
- var import_i18n = require("@wordpress/i18n");
42
- var import_fields = require("@wordpress/fields");
43
- var import_check = __toESM(require("../post-last-revision/check.cjs"));
44
- var import_store = require("../../store/index.cjs");
45
- var import_lock_unlock = require("../../lock-unlock.cjs");
46
- var import_jsx_runtime = require("react/jsx-runtime");
47
- var { Badge: WCBadge } = (0, import_lock_unlock.unlock)(import_components.privateApis);
48
- var DAY_IN_MILLISECONDS = 864e5;
49
- var EMPTY_ARRAY = [];
50
- var defaultLayouts = { activity: true };
51
- var noop = () => {
52
- };
53
- var paginationInfo = {};
54
- var view = {
55
- type: "activity",
56
- titleField: "date",
57
- fields: ["author"],
58
- layout: { density: "compact" }
59
- };
60
- var fields = [
61
- {
62
- id: "date",
63
- label: (0, import_i18n.__)("Date"),
64
- render: ({ item, field }) => {
65
- const dateNowInMs = (0, import_date.getDate)(null).getTime();
66
- const _value = field.getValue({ item });
67
- const date = (0, import_date.getDate)(_value ?? null);
68
- const displayDate = dateNowInMs - date.getTime() > DAY_IN_MILLISECONDS ? (0, import_date.dateI18n)(
69
- (0, import_date.getSettings)().formats.datetimeAbbreviated,
70
- date
71
- ) : (0, import_date.humanTimeDiff)(date);
72
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
- "time",
74
- {
75
- className: "editor-post-revisions-panel__revision-date",
76
- dateTime: _value,
77
- children: displayDate
78
- }
79
- );
80
- },
81
- enableSorting: false,
82
- enableHiding: false
83
- },
84
- import_fields.authorField
85
- ];
86
- function PostRevisionsPanelContent() {
87
- const { setCurrentRevisionId } = (0, import_lock_unlock.unlock)((0, import_data.useDispatch)(import_store.store));
88
- const {
89
- revisionsCount,
90
- revisions,
91
- revisionKey,
92
- isLoading,
93
- lastRevisionId
94
- } = (0, import_data.useSelect)((select) => {
95
- const { getCurrentPostId, getCurrentPostType } = select(import_store.store);
96
- const { getCurrentPostRevisionsCount, getCurrentPostLastRevisionId } = select(import_store.store);
97
- const { getRevisions, getEntityConfig, isResolving } = select(import_core_data.store);
98
- const _postType = getCurrentPostType();
99
- const entityConfig = getEntityConfig("postType", _postType);
100
- const _revisionKey = entityConfig?.revisionKey || "id";
101
- const revisionsQuery = {
102
- per_page: 3,
103
- orderby: "date",
104
- order: "desc",
105
- _fields: `${_revisionKey},date,author`
106
- };
107
- const query = [
108
- "postType",
109
- _postType,
110
- getCurrentPostId(),
111
- revisionsQuery
112
- ];
113
- const _revisions = getRevisions(...query);
114
- return {
115
- revisionsCount: getCurrentPostRevisionsCount(),
116
- lastRevisionId: getCurrentPostLastRevisionId(),
117
- revisions: _revisions,
118
- revisionKey: _revisionKey,
119
- isLoading: isResolving("getRevisions", query)
120
- };
121
- }, []);
122
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
123
- import_components.PanelBody,
124
- {
125
- title: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", align: "center", as: "span", children: [
126
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: (0, import_i18n.__)("Revisions") }),
127
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WCBadge, { className: "editor-post-revisions-panel__revisions-count", children: revisionsCount })
128
- ] }),
129
- initialOpen: false,
130
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { className: "editor-post-revisions-panel", children: [
131
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
132
- import_dataviews.DataViews,
133
- {
134
- view,
135
- onChangeView: noop,
136
- fields,
137
- data: revisions || EMPTY_ARRAY,
138
- isLoading,
139
- paginationInfo,
140
- defaultLayouts,
141
- getItemId: (item) => item[revisionKey],
142
- isItemClickable: () => true,
143
- onClickItem: (item) => {
144
- setCurrentRevisionId(item[revisionKey]);
145
- },
146
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dataviews.DataViews.Layout, {})
147
- }
148
- ),
149
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
150
- import_components.Button,
151
- {
152
- className: "editor-post-revisions-panel__view-all",
153
- __next40pxDefaultSize: true,
154
- variant: "secondary",
155
- onClick: () => setCurrentRevisionId(lastRevisionId),
156
- children: (0, import_i18n.__)("View all revisions")
157
- }
158
- )
159
- ] })
160
- }
161
- );
162
- }
163
- function PostRevisionsPanel() {
164
- const disableVisualRevisions = (0, import_data.useSelect)(
165
- (select) => !!select(import_store.store).getEditorSettings().disableVisualRevisions,
166
- []
167
- );
168
- if (disableVisualRevisions) {
169
- return null;
170
- }
171
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_check.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PostRevisionsPanelContent, {}) });
172
- }
173
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/post-revisions-panel/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { DataViews } from '@wordpress/dataviews';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { authorField } from '@wordpress/fields';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from '../post-last-revision/check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { Badge: WCBadge } = unlock( componentsPrivateApis );\nconst DAY_IN_MILLISECONDS = 86400000;\nconst EMPTY_ARRAY = [];\nconst defaultLayouts = { activity: true };\nconst noop = () => {};\nconst paginationInfo = {};\nconst view = {\n\ttype: 'activity',\n\ttitleField: 'date',\n\tfields: [ 'author' ],\n\tlayout: { density: 'compact' },\n};\nconst fields = [\n\t{\n\t\tid: 'date',\n\t\tlabel: __( 'Date' ),\n\t\trender: ( { item, field } ) => {\n\t\t\tconst dateNowInMs = getDate( null ).getTime();\n\t\t\tconst _value = field.getValue( { item } );\n\t\t\tconst date = getDate( _value ?? null );\n\t\t\tconst displayDate =\n\t\t\t\tdateNowInMs - date.getTime() > DAY_IN_MILLISECONDS\n\t\t\t\t\t? dateI18n(\n\t\t\t\t\t\t\tgetSettings().formats.datetimeAbbreviated,\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t )\n\t\t\t\t\t: humanTimeDiff( date );\n\t\t\treturn (\n\t\t\t\t<time\n\t\t\t\t\tclassName=\"editor-post-revisions-panel__revision-date\"\n\t\t\t\t\tdateTime={ _value }\n\t\t\t\t>\n\t\t\t\t\t{ displayDate }\n\t\t\t\t</time>\n\t\t\t);\n\t\t},\n\t\tenableSorting: false,\n\t\tenableHiding: false,\n\t},\n\tauthorField,\n];\n\nfunction PostRevisionsPanelContent() {\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\tconst {\n\t\trevisionsCount,\n\t\trevisions,\n\t\trevisionKey,\n\t\tisLoading,\n\t\tlastRevisionId,\n\t} = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPostType } = select( editorStore );\n\t\tconst { getCurrentPostRevisionsCount, getCurrentPostLastRevisionId } =\n\t\t\tselect( editorStore );\n\t\tconst { getRevisions, getEntityConfig, isResolving } =\n\t\t\tselect( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst entityConfig = getEntityConfig( 'postType', _postType );\n\t\tconst _revisionKey = entityConfig?.revisionKey || 'id';\n\t\tconst revisionsQuery = {\n\t\t\tper_page: 3,\n\t\t\torderby: 'date',\n\t\t\torder: 'desc',\n\t\t\t_fields: `${ _revisionKey },date,author`,\n\t\t};\n\t\tconst query = [\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\tgetCurrentPostId(),\n\t\t\trevisionsQuery,\n\t\t];\n\t\tconst _revisions = getRevisions( ...query );\n\t\treturn {\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisions: _revisions,\n\t\t\trevisionKey: _revisionKey,\n\t\t\tisLoading: isResolving( 'getRevisions', query ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={\n\t\t\t\t<HStack justify=\"space-between\" align=\"center\" as=\"span\">\n\t\t\t\t\t<span>{ __( 'Revisions' ) }</span>\n\t\t\t\t\t<WCBadge className=\"editor-post-revisions-panel__revisions-count\">\n\t\t\t\t\t\t{ revisionsCount }\n\t\t\t\t\t</WCBadge>\n\t\t\t\t</HStack>\n\t\t\t}\n\t\t\tinitialOpen={ false }\n\t\t>\n\t\t\t<VStack className=\"editor-post-revisions-panel\">\n\t\t\t\t<DataViews\n\t\t\t\t\tview={ view }\n\t\t\t\t\tonChangeView={ noop }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tdata={ revisions || EMPTY_ARRAY }\n\t\t\t\t\tisLoading={ isLoading }\n\t\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t\t\tgetItemId={ ( item ) => item[ revisionKey ] }\n\t\t\t\t\tisItemClickable={ () => true }\n\t\t\t\t\tonClickItem={ ( item ) => {\n\t\t\t\t\t\tsetCurrentRevisionId( item[ revisionKey ] );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<DataViews.Layout />\n\t\t\t\t</DataViews>\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-post-revisions-panel__view-all\"\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'View all revisions' ) }\n\t\t\t\t</Button>\n\t\t\t</VStack>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function PostRevisionsPanel() {\n\tconst disableVisualRevisions = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( editorStore ).getEditorSettings().disableVisualRevisions,\n\t\t[]\n\t);\n\tif ( disableVisualRevisions ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostRevisionsPanelContent />\n\t\t</PostLastRevisionCheck>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAMO;AACP,uBAAmC;AACnC,uBAA0B;AAC1B,kBAA8D;AAC9D,kBAAuC;AACvC,kBAAmB;AACnB,oBAA4B;AAK5B,mBAAkC;AAClC,mBAAqC;AACrC,yBAAuB;AA8BnB;AA5BJ,IAAM,EAAE,OAAO,QAAQ,QAAI,2BAAQ,kBAAAA,WAAsB;AACzD,IAAM,sBAAsB;AAC5B,IAAM,cAAc,CAAC;AACrB,IAAM,iBAAiB,EAAE,UAAU,KAAK;AACxC,IAAM,OAAO,MAAM;AAAC;AACpB,IAAM,iBAAiB,CAAC;AACxB,IAAM,OAAO;AAAA,EACZ,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,QAAQ,CAAE,QAAS;AAAA,EACnB,QAAQ,EAAE,SAAS,UAAU;AAC9B;AACA,IAAM,SAAS;AAAA,EACd;AAAA,IACC,IAAI;AAAA,IACJ,WAAO,gBAAI,MAAO;AAAA,IAClB,QAAQ,CAAE,EAAE,MAAM,MAAM,MAAO;AAC9B,YAAM,kBAAc,qBAAS,IAAK,EAAE,QAAQ;AAC5C,YAAM,SAAS,MAAM,SAAU,EAAE,KAAK,CAAE;AACxC,YAAM,WAAO,qBAAS,UAAU,IAAK;AACrC,YAAM,cACL,cAAc,KAAK,QAAQ,IAAI,0BAC5B;AAAA,YACA,yBAAY,EAAE,QAAQ;AAAA,QACtB;AAAA,MACA,QACA,2BAAe,IAAK;AACxB,aACC;AAAA,QAAC;AAAA;AAAA,UACA,WAAU;AAAA,UACV,UAAW;AAAA,UAET;AAAA;AAAA,MACH;AAAA,IAEF;AAAA,IACA,eAAe;AAAA,IACf,cAAc;AAAA,EACf;AAAA,EACA;AACD;AAEA,SAAS,4BAA4B;AACpC,QAAM,EAAE,qBAAqB,QAAI,+BAAQ,yBAAa,aAAAC,KAAY,CAAE;AACpE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,uBAAW,CAAE,WAAY;AAC5B,UAAM,EAAE,kBAAkB,mBAAmB,IAAI,OAAQ,aAAAA,KAAY;AACrE,UAAM,EAAE,8BAA8B,6BAA6B,IAClE,OAAQ,aAAAA,KAAY;AACrB,UAAM,EAAE,cAAc,iBAAiB,YAAY,IAClD,OAAQ,iBAAAC,KAAU;AACnB,UAAM,YAAY,mBAAmB;AACrC,UAAM,eAAe,gBAAiB,YAAY,SAAU;AAC5D,UAAM,eAAe,cAAc,eAAe;AAClD,UAAM,iBAAiB;AAAA,MACtB,UAAU;AAAA,MACV,SAAS;AAAA,MACT,OAAO;AAAA,MACP,SAAS,GAAI,YAAa;AAAA,IAC3B;AACA,UAAM,QAAQ;AAAA,MACb;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjB;AAAA,IACD;AACA,UAAM,aAAa,aAAc,GAAG,KAAM;AAC1C,WAAO;AAAA,MACN,gBAAgB,6BAA6B;AAAA,MAC7C,gBAAgB,6BAA6B;AAAA,MAC7C,WAAW;AAAA,MACX,aAAa;AAAA,MACb,WAAW,YAAa,gBAAgB,KAAM;AAAA,IAC/C;AAAA,EACD,GAAG,CAAC,CAAE;AACN,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OACC,6CAAC,kBAAAC,sBAAA,EAAO,SAAQ,iBAAgB,OAAM,UAAS,IAAG,QACjD;AAAA,oDAAC,UAAO,8BAAI,WAAY,GAAG;AAAA,QAC3B,4CAAC,WAAQ,WAAU,gDAChB,0BACH;AAAA,SACD;AAAA,MAED,aAAc;AAAA,MAEd,uDAAC,kBAAAC,sBAAA,EAAO,WAAU,+BACjB;AAAA;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA,cAAe;AAAA,YACf;AAAA,YACA,MAAO,aAAa;AAAA,YACpB;AAAA,YACA;AAAA,YACA;AAAA,YACA,WAAY,CAAE,SAAU,KAAM,WAAY;AAAA,YAC1C,iBAAkB,MAAM;AAAA,YACxB,aAAc,CAAE,SAAU;AACzB,mCAAsB,KAAM,WAAY,CAAE;AAAA,YAC3C;AAAA,YAEA,sDAAC,2BAAU,QAAV,EAAiB;AAAA;AAAA,QACnB;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,uBAAqB;AAAA,YACrB,SAAQ;AAAA,YACR,SAAU,MAAM,qBAAsB,cAAe;AAAA,YAEnD,8BAAI,oBAAqB;AAAA;AAAA,QAC5B;AAAA,SACD;AAAA;AAAA,EACD;AAEF;AAEe,SAAR,qBAAsC;AAC5C,QAAM,6BAAyB;AAAA,IAC9B,CAAE,WACD,CAAC,CAAE,OAAQ,aAAAH,KAAY,EAAE,kBAAkB,EAAE;AAAA,IAC9C,CAAC;AAAA,EACF;AACA,MAAK,wBAAyB;AAC7B,WAAO;AAAA,EACR;AACA,SACC,4CAAC,aAAAI,SAAA,EACA,sDAAC,6BAA0B,GAC5B;AAEF;",
6
- "names": ["componentsPrivateApis", "editorStore", "coreStore", "HStack", "VStack", "PostLastRevisionCheck"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/revision-author-panel/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function RevisionAuthorPanel() {\n\tconst authorName = useSelect( ( select ) => {\n\t\tconst { getCurrentRevision } = unlock( select( editorStore ) );\n\t\tconst revision = getCurrentRevision();\n\t\tif ( ! revision?.author ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst author = select( coreStore ).getUser( revision.author );\n\t\treturn author?.name;\n\t}, [] );\n\n\tif ( ! authorName ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostPanelRow label={ __( 'Author' ) }>\n\t\t\t{ decodeEntities( authorName ) }\n\t\t</PostPanelRow>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,uBAAmC;AACnC,2BAA+B;AAC/B,kBAAmB;AAKnB,4BAAyB;AACzB,mBAAqC;AACrC,yBAAuB;AAkBrB;AAhBa,SAAR,sBAAuC;AAC7C,QAAM,iBAAa,uBAAW,CAAE,WAAY;AAC3C,UAAM,EAAE,mBAAmB,QAAI,2BAAQ,OAAQ,aAAAA,KAAY,CAAE;AAC7D,UAAM,WAAW,mBAAmB;AACpC,QAAK,CAAE,UAAU,QAAS;AACzB,aAAO;AAAA,IACR;AACA,UAAM,SAAS,OAAQ,iBAAAC,KAAU,EAAE,QAAS,SAAS,MAAO;AAC5D,WAAO,QAAQ;AAAA,EAChB,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,YAAa;AACnB,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,sBAAAC,SAAA,EAAa,WAAQ,gBAAI,QAAS,GAChC,mDAAgB,UAAW,GAC9B;AAEF;",
6
- "names": ["editorStore", "coreStore", "PostPanelRow"]
7
- }
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/editor/src/components/revision-created-panel/index.js
21
- var revision_created_panel_exports = {};
22
- __export(revision_created_panel_exports, {
23
- default: () => RevisionCreatedPanel
24
- });
25
- module.exports = __toCommonJS(revision_created_panel_exports);
26
- var import_components = require("@wordpress/components");
27
- var import_data = require("@wordpress/data");
28
- var import_i18n = require("@wordpress/i18n");
29
- var import_date = require("@wordpress/date");
30
- var import_store = require("../../store/index.cjs");
31
- var import_lock_unlock = require("../../lock-unlock.cjs");
32
- var import_jsx_runtime = require("react/jsx-runtime");
33
- function RevisionCreatedPanel() {
34
- const date = (0, import_data.useSelect)((select) => {
35
- const { getCurrentRevision } = (0, import_lock_unlock.unlock)(select(import_store.store));
36
- return getCurrentRevision()?.date;
37
- }, []);
38
- if (!date) {
39
- return null;
40
- }
41
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-post-last-edited-panel", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalText, { children: (0, import_i18n.sprintf)(
42
- // translators: %s: Human-readable time difference, e.g. "2 days ago".
43
- (0, import_i18n.__)("Created %s."),
44
- (0, import_date.humanTimeDiff)(date)
45
- ) }) });
46
- }
47
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/revision-created-panel/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalText as WCText } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function RevisionCreatedPanel() {\n\tconst date = useSelect( ( select ) => {\n\t\tconst { getCurrentRevision } = unlock( select( editorStore ) );\n\t\treturn getCurrentRevision()?.date;\n\t}, [] );\n\n\tif ( ! date ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"editor-post-last-edited-panel\">\n\t\t\t<WCText>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: Human-readable time difference, e.g. \"2 days ago\".\n\t\t\t\t\t__( 'Created %s.' ),\n\t\t\t\t\thumanTimeDiff( date )\n\t\t\t\t) }\n\t\t\t</WCText>\n\t\t</div>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA6C;AAC7C,kBAA0B;AAC1B,kBAA4B;AAC5B,kBAA8B;AAK9B,mBAAqC;AACrC,yBAAuB;AAcpB;AAZY,SAAR,uBAAwC;AAC9C,QAAM,WAAO,uBAAW,CAAE,WAAY;AACrC,UAAM,EAAE,mBAAmB,QAAI,2BAAQ,OAAQ,aAAAA,KAAY,CAAE;AAC7D,WAAO,mBAAmB,GAAG;AAAA,EAC9B,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,MAAO;AACb,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,SAAI,WAAU,iCACd,sDAAC,kBAAAC,oBAAA,EACE;AAAA;AAAA,QAED,gBAAI,aAAc;AAAA,QAClB,2BAAe,IAAK;AAAA,EACrB,GACD,GACD;AAEF;",
6
- "names": ["editorStore", "WCText"]
7
- }