@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
@@ -1,172 +1,130 @@
1
1
  // packages/editor/src/components/post-publish-button/index.js
2
2
  import { Button } from "@wordpress/components";
3
- import { Component } from "@wordpress/element";
4
- import { withSelect, withDispatch } from "@wordpress/data";
5
- import { compose } from "@wordpress/compose";
3
+ import { useDispatch, useSelect } from "@wordpress/data";
6
4
  import PublishButtonLabel from "./label.mjs";
7
5
  import { store as editorStore } from "../../store/index.mjs";
8
- import { Fragment, jsx } from "react/jsx-runtime";
6
+ import { jsx } from "react/jsx-runtime";
9
7
  var noop = () => {
10
8
  };
11
- var PostPublishButton = class extends Component {
12
- constructor(props) {
13
- super(props);
14
- this.createOnClick = this.createOnClick.bind(this);
15
- this.closeEntitiesSavedStates = this.closeEntitiesSavedStates.bind(this);
16
- this.state = {
17
- entitiesSavedStatesCallback: false
18
- };
19
- }
20
- createOnClick(callback) {
21
- return (...args) => {
22
- const { hasNonPostEntityChanges, setEntitiesSavedStatesCallback } = this.props;
23
- if (hasNonPostEntityChanges && setEntitiesSavedStatesCallback) {
24
- this.setState({
25
- entitiesSavedStatesCallback: () => callback(...args)
26
- });
27
- setEntitiesSavedStatesCallback(
28
- () => this.closeEntitiesSavedStates
29
- );
30
- return noop;
31
- }
32
- return callback(...args);
9
+ function PostPublishButton({
10
+ forceIsDirty,
11
+ isOpen,
12
+ isToggle,
13
+ onSubmit = noop,
14
+ onToggle,
15
+ setEntitiesSavedStatesCallback
16
+ }) {
17
+ const {
18
+ hasPublishAction,
19
+ isBeingScheduled,
20
+ isPostSavingLocked,
21
+ isPublishable,
22
+ isPublished,
23
+ isSaveable,
24
+ isSaving,
25
+ isAutoSaving,
26
+ visibility,
27
+ hasNonPostEntityChanges,
28
+ isSavingNonPostEntityChanges,
29
+ postStatus,
30
+ postStatusHasChanged,
31
+ postType,
32
+ postId
33
+ } = useSelect((select) => {
34
+ const store = select(editorStore);
35
+ return {
36
+ isSaving: store.isSavingPost(),
37
+ isAutoSaving: store.isAutosavingPost(),
38
+ isBeingScheduled: store.isEditedPostBeingScheduled(),
39
+ visibility: store.getEditedPostVisibility(),
40
+ isSaveable: store.isEditedPostSaveable(),
41
+ isPostSavingLocked: store.isPostSavingLocked(),
42
+ isPublishable: store.isEditedPostPublishable(),
43
+ isPublished: store.isCurrentPostPublished(),
44
+ hasPublishAction: !!store.getCurrentPost()?._links?.["wp:action-publish"],
45
+ postType: store.getCurrentPostType(),
46
+ postId: store.getCurrentPostId(),
47
+ postStatus: store.getEditedPostAttribute("status"),
48
+ postStatusHasChanged: store.getPostEdits()?.status,
49
+ hasNonPostEntityChanges: store.hasNonPostEntityChanges(),
50
+ isSavingNonPostEntityChanges: store.isSavingNonPostEntityChanges()
33
51
  };
52
+ }, []);
53
+ const { editPost, savePost } = useDispatch(editorStore);
54
+ const savePostStatus = (status) => {
55
+ editPost({ status }, { undoIgnore: true });
56
+ savePost();
57
+ };
58
+ const createOnClick = (callback) => (...args) => {
59
+ if (hasNonPostEntityChanges && setEntitiesSavedStatesCallback) {
60
+ const onClose = (savedEntities) => {
61
+ if (savedEntities && savedEntities.some(
62
+ (elt) => elt.kind === "postType" && elt.name === postType && elt.key === postId
63
+ )) {
64
+ callback(...args);
65
+ }
66
+ };
67
+ setEntitiesSavedStatesCallback(() => onClose);
68
+ return noop;
69
+ }
70
+ return callback(...args);
71
+ };
72
+ const isButtonDisabled = isPostSavingLocked || // Disable while a non-post entity (e.g. a newly created term) is mid-save.
73
+ isSavingNonPostEntityChanges || (isSaving || !isSaveable || !isPublishable && !forceIsDirty) && !hasNonPostEntityChanges;
74
+ const isToggleDisabled = isPostSavingLocked || isSavingNonPostEntityChanges || (isPublished || isSaving || !isSaveable || !isPublishable && !forceIsDirty) && !hasNonPostEntityChanges;
75
+ let publishStatus = "publish";
76
+ if (postStatusHasChanged) {
77
+ publishStatus = postStatus;
78
+ } else if (!hasPublishAction) {
79
+ publishStatus = "pending";
80
+ } else if (visibility === "private") {
81
+ publishStatus = "private";
82
+ } else if (isBeingScheduled) {
83
+ publishStatus = "future";
34
84
  }
35
- closeEntitiesSavedStates(savedEntities) {
36
- const { postType, postId } = this.props;
37
- const { entitiesSavedStatesCallback } = this.state;
38
- this.setState({ entitiesSavedStatesCallback: false }, () => {
39
- if (savedEntities && savedEntities.some(
40
- (elt) => elt.kind === "postType" && elt.name === postType && elt.key === postId
41
- )) {
42
- entitiesSavedStatesCallback();
43
- }
44
- });
45
- }
46
- render() {
47
- const {
48
- forceIsDirty,
49
- hasPublishAction,
50
- isBeingScheduled,
51
- isOpen,
52
- isPostSavingLocked,
53
- isPublishable,
54
- isPublished,
55
- isSaveable,
56
- isSaving,
57
- isAutoSaving,
58
- isToggle,
59
- savePostStatus,
60
- onSubmit = noop,
61
- onToggle,
62
- visibility,
63
- hasNonPostEntityChanges,
64
- isSavingNonPostEntityChanges,
65
- postStatus,
66
- postStatusHasChanged
67
- } = this.props;
68
- const isButtonDisabled = isPostSavingLocked || (isSaving || !isSaveable || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges);
69
- const isToggleDisabled = isPostSavingLocked || (isPublished || isSaving || !isSaveable || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges);
70
- let publishStatus = "publish";
71
- if (postStatusHasChanged) {
72
- publishStatus = postStatus;
73
- } else if (!hasPublishAction) {
74
- publishStatus = "pending";
75
- } else if (visibility === "private") {
76
- publishStatus = "private";
77
- } else if (isBeingScheduled) {
78
- publishStatus = "future";
85
+ const onClickButton = () => {
86
+ if (isButtonDisabled) {
87
+ return;
79
88
  }
80
- const onClickButton = () => {
81
- if (isButtonDisabled) {
82
- return;
83
- }
84
- onSubmit();
85
- savePostStatus(publishStatus);
86
- };
87
- const onClickToggle = () => {
88
- if (isToggleDisabled) {
89
- return;
90
- }
91
- onToggle();
92
- };
93
- const buttonProps = {
94
- "aria-disabled": isButtonDisabled,
95
- className: "editor-post-publish-button",
96
- isBusy: !isAutoSaving && isSaving,
97
- variant: "primary",
98
- onClick: this.createOnClick(onClickButton),
99
- "aria-haspopup": hasNonPostEntityChanges ? "dialog" : void 0
100
- };
101
- const toggleProps = {
102
- "aria-disabled": isToggleDisabled,
103
- "aria-expanded": isOpen,
104
- className: "editor-post-publish-panel__toggle",
105
- isBusy: isSaving && isPublished,
106
- variant: "primary",
89
+ onSubmit();
90
+ savePostStatus(publishStatus);
91
+ };
92
+ const onClickToggle = () => {
93
+ if (isToggleDisabled) {
94
+ return;
95
+ }
96
+ onToggle();
97
+ };
98
+ const buttonProps = {
99
+ "aria-disabled": isButtonDisabled,
100
+ className: "editor-post-publish-button",
101
+ isBusy: !isAutoSaving && isSaving,
102
+ variant: "primary",
103
+ onClick: createOnClick(onClickButton),
104
+ "aria-haspopup": hasNonPostEntityChanges ? "dialog" : void 0
105
+ };
106
+ const toggleProps = {
107
+ "aria-disabled": isToggleDisabled,
108
+ "aria-expanded": isOpen,
109
+ className: "editor-post-publish-panel__toggle",
110
+ isBusy: isSaving && isPublished,
111
+ variant: "primary",
112
+ size: "compact",
113
+ onClick: createOnClick(onClickToggle),
114
+ "aria-haspopup": hasNonPostEntityChanges ? "dialog" : void 0
115
+ };
116
+ const componentProps = isToggle ? toggleProps : buttonProps;
117
+ return /* @__PURE__ */ jsx(
118
+ Button,
119
+ {
120
+ ...componentProps,
121
+ className: `${componentProps.className} editor-post-publish-button__button`,
107
122
  size: "compact",
108
- onClick: this.createOnClick(onClickToggle),
109
- "aria-haspopup": hasNonPostEntityChanges ? "dialog" : void 0
110
- };
111
- const componentProps = isToggle ? toggleProps : buttonProps;
112
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
113
- Button,
114
- {
115
- ...componentProps,
116
- className: `${componentProps.className} editor-post-publish-button__button`,
117
- size: "compact",
118
- children: /* @__PURE__ */ jsx(PublishButtonLabel, {})
119
- }
120
- ) });
121
- }
122
- };
123
- var post_publish_button_default = compose([
124
- withSelect((select) => {
125
- const {
126
- isSavingPost,
127
- isAutosavingPost,
128
- isEditedPostBeingScheduled,
129
- getEditedPostVisibility,
130
- isCurrentPostPublished,
131
- isEditedPostSaveable,
132
- isEditedPostPublishable,
133
- isPostSavingLocked,
134
- getCurrentPost,
135
- getCurrentPostType,
136
- getCurrentPostId,
137
- hasNonPostEntityChanges,
138
- isSavingNonPostEntityChanges,
139
- getEditedPostAttribute,
140
- getPostEdits
141
- } = select(editorStore);
142
- return {
143
- isSaving: isSavingPost(),
144
- isAutoSaving: isAutosavingPost(),
145
- isBeingScheduled: isEditedPostBeingScheduled(),
146
- visibility: getEditedPostVisibility(),
147
- isSaveable: isEditedPostSaveable(),
148
- isPostSavingLocked: isPostSavingLocked(),
149
- isPublishable: isEditedPostPublishable(),
150
- isPublished: isCurrentPostPublished(),
151
- hasPublishAction: getCurrentPost()._links?.["wp:action-publish"] ?? false,
152
- postType: getCurrentPostType(),
153
- postId: getCurrentPostId(),
154
- postStatus: getEditedPostAttribute("status"),
155
- postStatusHasChanged: getPostEdits()?.status,
156
- hasNonPostEntityChanges: hasNonPostEntityChanges(),
157
- isSavingNonPostEntityChanges: isSavingNonPostEntityChanges()
158
- };
159
- }),
160
- withDispatch((dispatch) => {
161
- const { editPost, savePost } = dispatch(editorStore);
162
- return {
163
- savePostStatus: (status) => {
164
- editPost({ status }, { undoIgnore: true });
165
- savePost();
166
- }
167
- };
168
- })
169
- ])(PostPublishButton);
123
+ children: /* @__PURE__ */ jsx(PublishButtonLabel, {})
124
+ }
125
+ );
126
+ }
127
+ var post_publish_button_default = PostPublishButton;
170
128
  export {
171
129
  PostPublishButton,
172
130
  post_publish_button_default as default
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-button/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { Component } from '@wordpress/element';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PublishButtonLabel from './label';\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\nexport class PostPublishButton extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.createOnClick = this.createOnClick.bind( this );\n\t\tthis.closeEntitiesSavedStates =\n\t\t\tthis.closeEntitiesSavedStates.bind( this );\n\n\t\tthis.state = {\n\t\t\tentitiesSavedStatesCallback: false,\n\t\t};\n\t}\n\n\tcreateOnClick( callback ) {\n\t\treturn ( ...args ) => {\n\t\t\tconst { hasNonPostEntityChanges, setEntitiesSavedStatesCallback } =\n\t\t\t\tthis.props;\n\t\t\t// If a post with non-post entities is published, but the user\n\t\t\t// elects to not save changes to the non-post entities, those\n\t\t\t// entities will still be dirty when the Publish button is clicked.\n\t\t\t// We also need to check that the `setEntitiesSavedStatesCallback`\n\t\t\t// prop was passed. See https://github.com/WordPress/gutenberg/pull/37383\n\t\t\tif ( hasNonPostEntityChanges && setEntitiesSavedStatesCallback ) {\n\t\t\t\t// The modal for multiple entity saving will open,\n\t\t\t\t// hold the callback for saving/publishing the post\n\t\t\t\t// so that we can call it if the post entity is checked.\n\t\t\t\tthis.setState( {\n\t\t\t\t\tentitiesSavedStatesCallback: () => callback( ...args ),\n\t\t\t\t} );\n\n\t\t\t\t// Open the save panel by setting its callback.\n\t\t\t\t// To set a function on the useState hook, we must set it\n\t\t\t\t// with another function (() => myFunction). Passing the\n\t\t\t\t// function on its own will cause an error when called.\n\t\t\t\tsetEntitiesSavedStatesCallback(\n\t\t\t\t\t() => this.closeEntitiesSavedStates\n\t\t\t\t);\n\t\t\t\treturn noop;\n\t\t\t}\n\n\t\t\treturn callback( ...args );\n\t\t};\n\t}\n\n\tcloseEntitiesSavedStates( savedEntities ) {\n\t\tconst { postType, postId } = this.props;\n\t\tconst { entitiesSavedStatesCallback } = this.state;\n\t\tthis.setState( { entitiesSavedStatesCallback: false }, () => {\n\t\t\tif (\n\t\t\t\tsavedEntities &&\n\t\t\t\tsavedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === 'postType' &&\n\t\t\t\t\t\telt.name === postType &&\n\t\t\t\t\t\telt.key === postId\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// The post entity was checked, call the held callback from `createOnClick`.\n\t\t\t\tentitiesSavedStatesCallback();\n\t\t\t}\n\t\t} );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\thasPublishAction,\n\t\t\tisBeingScheduled,\n\t\t\tisOpen,\n\t\t\tisPostSavingLocked,\n\t\t\tisPublishable,\n\t\t\tisPublished,\n\t\t\tisSaveable,\n\t\t\tisSaving,\n\t\t\tisAutoSaving,\n\t\t\tisToggle,\n\t\t\tsavePostStatus,\n\t\t\tonSubmit = noop,\n\t\t\tonToggle,\n\t\t\tvisibility,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tpostStatus,\n\t\t\tpostStatusHasChanged,\n\t\t} = this.props;\n\n\t\tconst isButtonDisabled =\n\t\t\tisPostSavingLocked ||\n\t\t\t( ( isSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges ) );\n\n\t\tconst isToggleDisabled =\n\t\t\tisPostSavingLocked ||\n\t\t\t( ( isPublished ||\n\t\t\t\tisSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges ) );\n\n\t\t// If the new status has not changed explicitly, we derive it from\n\t\t// other factors, like having a publish action, etc.. We need to preserve\n\t\t// this because it affects when to show the pre and post publish panels.\n\t\t// If it has changed though explicitly, we need to respect that.\n\t\tlet publishStatus = 'publish';\n\t\tif ( postStatusHasChanged ) {\n\t\t\tpublishStatus = postStatus;\n\t\t} else if ( ! hasPublishAction ) {\n\t\t\tpublishStatus = 'pending';\n\t\t} else if ( visibility === 'private' ) {\n\t\t\tpublishStatus = 'private';\n\t\t} else if ( isBeingScheduled ) {\n\t\t\tpublishStatus = 'future';\n\t\t}\n\n\t\tconst onClickButton = () => {\n\t\t\tif ( isButtonDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonSubmit();\n\t\t\tsavePostStatus( publishStatus );\n\t\t};\n\n\t\t// Callback to open the publish panel.\n\t\tconst onClickToggle = () => {\n\t\t\tif ( isToggleDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonToggle();\n\t\t};\n\n\t\tconst buttonProps = {\n\t\t\t'aria-disabled': isButtonDisabled,\n\t\t\tclassName: 'editor-post-publish-button',\n\t\t\tisBusy: ! isAutoSaving && isSaving,\n\t\t\tvariant: 'primary',\n\t\t\tonClick: this.createOnClick( onClickButton ),\n\t\t\t'aria-haspopup': hasNonPostEntityChanges ? 'dialog' : undefined,\n\t\t};\n\n\t\tconst toggleProps = {\n\t\t\t'aria-disabled': isToggleDisabled,\n\t\t\t'aria-expanded': isOpen,\n\t\t\tclassName: 'editor-post-publish-panel__toggle',\n\t\t\tisBusy: isSaving && isPublished,\n\t\t\tvariant: 'primary',\n\t\t\tsize: 'compact',\n\t\t\tonClick: this.createOnClick( onClickToggle ),\n\t\t\t'aria-haspopup': hasNonPostEntityChanges ? 'dialog' : undefined,\n\t\t};\n\t\tconst componentProps = isToggle ? toggleProps : buttonProps;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button\n\t\t\t\t\t{ ...componentProps }\n\t\t\t\t\tclassName={ `${ componentProps.className } editor-post-publish-button__button` }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<PublishButtonLabel />\n\t\t\t\t</Button>\n\t\t\t</>\n\t\t);\n\t}\n}\n\n/**\n * Renders the publish button.\n */\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisSavingPost,\n\t\t\tisAutosavingPost,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tgetEditedPostVisibility,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostSaveable,\n\t\t\tisEditedPostPublishable,\n\t\t\tisPostSavingLocked,\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetPostEdits,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisAutoSaving: isAutosavingPost(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tvisibility: getEditedPostVisibility(),\n\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\tisPostSavingLocked: isPostSavingLocked(),\n\t\t\tisPublishable: isEditedPostPublishable(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t\tpostStatusHasChanged: getPostEdits()?.status,\n\t\t\thasNonPostEntityChanges: hasNonPostEntityChanges(),\n\t\t\tisSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, savePost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tsavePostStatus: ( status ) => {\n\t\t\t\teditPost( { status }, { undoIgnore: true } );\n\t\t\t\tsavePost();\n\t\t\t},\n\t\t};\n\t} ),\n] )( PostPublishButton );\n"],
5
- "mappings": ";AAGA,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,YAAY,oBAAoB;AACzC,SAAS,eAAe;AAKxB,OAAO,wBAAwB;AAC/B,SAAS,SAAS,mBAAmB;AA6JlC,mBAME,WANF;AA3JH,IAAM,OAAO,MAAM;AAAC;AAEb,IAAM,oBAAN,cAAgC,UAAU;AAAA,EAChD,YAAa,OAAQ;AACpB,UAAO,KAAM;AAEb,SAAK,gBAAgB,KAAK,cAAc,KAAM,IAAK;AACnD,SAAK,2BACJ,KAAK,yBAAyB,KAAM,IAAK;AAE1C,SAAK,QAAQ;AAAA,MACZ,6BAA6B;AAAA,IAC9B;AAAA,EACD;AAAA,EAEA,cAAe,UAAW;AACzB,WAAO,IAAK,SAAU;AACrB,YAAM,EAAE,yBAAyB,+BAA+B,IAC/D,KAAK;AAMN,UAAK,2BAA2B,gCAAiC;AAIhE,aAAK,SAAU;AAAA,UACd,6BAA6B,MAAM,SAAU,GAAG,IAAK;AAAA,QACtD,CAAE;AAMF;AAAA,UACC,MAAM,KAAK;AAAA,QACZ;AACA,eAAO;AAAA,MACR;AAEA,aAAO,SAAU,GAAG,IAAK;AAAA,IAC1B;AAAA,EACD;AAAA,EAEA,yBAA0B,eAAgB;AACzC,UAAM,EAAE,UAAU,OAAO,IAAI,KAAK;AAClC,UAAM,EAA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,UAAM,EAAE,UAAU,SAAS,IAAI,SAAU,WAAY;AACrD,WAAO;AAAA,MACN,gBAAgB,CAAE,WAAY;AAC7B,iBAAU,EAAE,OAAO,GAAG,EAAE,YAAY,KAAK,CAAE;AAC3C,iBAAS;AAAA,MACV;AAAA,IACD;AAAA,EACD,CAAE;AACH,CAAE,EAAG,iBAAkB;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PublishButtonLabel from './label';\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\nexport function PostPublishButton( {\n\tforceIsDirty,\n\tisOpen,\n\tisToggle,\n\tonSubmit = noop,\n\tonToggle,\n\tsetEntitiesSavedStatesCallback,\n} ) {\n\tconst {\n\t\thasPublishAction,\n\t\tisBeingScheduled,\n\t\tisPostSavingLocked,\n\t\tisPublishable,\n\t\tisPublished,\n\t\tisSaveable,\n\t\tisSaving,\n\t\tisAutoSaving,\n\t\tvisibility,\n\t\thasNonPostEntityChanges,\n\t\tisSavingNonPostEntityChanges,\n\t\tpostStatus,\n\t\tpostStatusHasChanged,\n\t\tpostType,\n\t\tpostId,\n\t} = useSelect( ( select ) => {\n\t\tconst store = select( editorStore );\n\t\treturn {\n\t\t\tisSaving: store.isSavingPost(),\n\t\t\tisAutoSaving: store.isAutosavingPost(),\n\t\t\tisBeingScheduled: store.isEditedPostBeingScheduled(),\n\t\t\tvisibility: store.getEditedPostVisibility(),\n\t\t\tisSaveable: store.isEditedPostSaveable(),\n\t\t\tisPostSavingLocked: store.isPostSavingLocked(),\n\t\t\tisPublishable: store.isEditedPostPublishable(),\n\t\t\tisPublished: store.isCurrentPostPublished(),\n\t\t\thasPublishAction:\n\t\t\t\t!! store.getCurrentPost()?._links?.[ 'wp:action-publish' ],\n\t\t\tpostType: store.getCurrentPostType(),\n\t\t\tpostId: store.getCurrentPostId(),\n\t\t\tpostStatus: store.getEditedPostAttribute( 'status' ),\n\t\t\tpostStatusHasChanged: store.getPostEdits()?.status,\n\t\t\thasNonPostEntityChanges: store.hasNonPostEntityChanges(),\n\t\t\tisSavingNonPostEntityChanges: store.isSavingNonPostEntityChanges(),\n\t\t};\n\t}, [] );\n\n\tconst { editPost, savePost } = useDispatch( editorStore );\n\n\tconst savePostStatus = ( status ) => {\n\t\teditPost( { status }, { undoIgnore: true } );\n\t\tsavePost();\n\t};\n\n\tconst createOnClick =\n\t\t( callback ) =>\n\t\t( ...args ) => {\n\t\t\t// If a post with non-post entities is published, but the user\n\t\t\t// elects to not save changes to the non-post entities, those\n\t\t\t// entities will still be dirty when the Publish button is clicked.\n\t\t\t// We also need to check that the `setEntitiesSavedStatesCallback`\n\t\t\t// prop was passed. See https://github.com/WordPress/gutenberg/pull/37383\n\t\t\tif ( hasNonPostEntityChanges && setEntitiesSavedStatesCallback ) {\n\t\t\t\t// The modal for multiple entity saving will open. If the post\n\t\t\t\t// entity is checked when it closes, run the held callback.\n\t\t\t\tconst onClose = ( savedEntities ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tsavedEntities &&\n\t\t\t\t\t\tsavedEntities.some(\n\t\t\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\t\t\telt.kind === 'postType' &&\n\t\t\t\t\t\t\t\telt.name === postType &&\n\t\t\t\t\t\t\t\telt.key === postId\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tcallback( ...args );\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\t// Open the save panel by setting its callback.\n\t\t\t\t// To set a function on the useState hook, we must set it\n\t\t\t\t// with another function (() => myFunction). Passing the\n\t\t\t\t// function on its own will cause an error when called.\n\t\t\t\tsetEntitiesSavedStatesCallback( () => onClose );\n\t\t\t\treturn noop;\n\t\t\t}\n\n\t\t\treturn callback( ...args );\n\t\t};\n\n\tconst isButtonDisabled =\n\t\tisPostSavingLocked ||\n\t\t// Disable while a non-post entity (e.g. a newly created term) is mid-save.\n\t\tisSavingNonPostEntityChanges ||\n\t\t( ( isSaving ||\n\t\t\t! isSaveable ||\n\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t! hasNonPostEntityChanges );\n\n\tconst isToggleDisabled =\n\t\tisPostSavingLocked ||\n\t\tisSavingNonPostEntityChanges ||\n\t\t( ( isPublished ||\n\t\t\tisSaving ||\n\t\t\t! isSaveable ||\n\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t! hasNonPostEntityChanges );\n\n\t// If the new status has not changed explicitly, we derive it from\n\t// other factors, like having a publish action, etc.. We need to preserve\n\t// this because it affects when to show the pre and post publish panels.\n\t// If it has changed though explicitly, we need to respect that.\n\tlet publishStatus = 'publish';\n\tif ( postStatusHasChanged ) {\n\t\tpublishStatus = postStatus;\n\t} else if ( ! hasPublishAction ) {\n\t\tpublishStatus = 'pending';\n\t} else if ( visibility === 'private' ) {\n\t\tpublishStatus = 'private';\n\t} else if ( isBeingScheduled ) {\n\t\tpublishStatus = 'future';\n\t}\n\n\tconst onClickButton = () => {\n\t\tif ( isButtonDisabled ) {\n\t\t\treturn;\n\t\t}\n\t\tonSubmit();\n\t\tsavePostStatus( publishStatus );\n\t};\n\n\t// Callback to open the publish panel.\n\tconst onClickToggle = () => {\n\t\tif ( isToggleDisabled ) {\n\t\t\treturn;\n\t\t}\n\t\tonToggle();\n\t};\n\n\tconst buttonProps = {\n\t\t'aria-disabled': isButtonDisabled,\n\t\tclassName: 'editor-post-publish-button',\n\t\tisBusy: ! isAutoSaving && isSaving,\n\t\tvariant: 'primary',\n\t\tonClick: createOnClick( onClickButton ),\n\t\t'aria-haspopup': hasNonPostEntityChanges ? 'dialog' : undefined,\n\t};\n\n\tconst toggleProps = {\n\t\t'aria-disabled': isToggleDisabled,\n\t\t'aria-expanded': isOpen,\n\t\tclassName: 'editor-post-publish-panel__toggle',\n\t\tisBusy: isSaving && isPublished,\n\t\tvariant: 'primary',\n\t\tsize: 'compact',\n\t\tonClick: createOnClick( onClickToggle ),\n\t\t'aria-haspopup': hasNonPostEntityChanges ? 'dialog' : undefined,\n\t};\n\tconst componentProps = isToggle ? toggleProps : buttonProps;\n\treturn (\n\t\t<Button\n\t\t\t{ ...componentProps }\n\t\t\tclassName={ `${ componentProps.className } editor-post-publish-button__button` }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t<PublishButtonLabel />\n\t\t</Button>\n\t);\n}\n\n/**\n * Renders the publish button.\n */\nexport default PostPublishButton;\n"],
5
+ "mappings": ";AAGA,SAAS,cAAc;AACvB,SAAS,aAAa,iBAAiB;AAKvC,OAAO,wBAAwB;AAC/B,SAAS,SAAS,mBAAmB;AAwKlC;AAtKH,IAAM,OAAO,MAAM;AAAC;AAEb,SAAS,kBAAmB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AACD,GAAI;AACH,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM,QAAQ,OAAQ,WAAY;AAClC,WAAO;AAAA,MACN,UAAU,MAAM,aAAa;AAAA,MAC7B,cAAc,MAAM,iBAAiB;AAAA,MACrC,kBAAkB,MAAM,2BAA2B;AAAA,MACnD,YAAY,MAAM,wBAAwB;AAAA,MAC1C,YAAY,MAAM,qBAAqB;AAAA,MACvC,oBAAoB,MAAM,mBAAmB;AAAA,MAC7C,eAAe,MAAM,wBAAwB;AAAA,MAC7C,aAAa,MAAM,uBAAuB;AAAA,MAC1C,kBACC,CAAC,CAAE,MAAM,eAAe,GAAG,SAAU,mBAAoB;AAAA,MAC1D,UAAU,MAAM,mBAAmB;AAAA,MACnC,QAAQ,MAAM,iBAAiB;AAAA,MAC/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IACD;AACA,aAAS;AAAA,EACV;AAEA,QAAM,cAAc;AAAA,IACnB,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,QAAQ,CAAE,gBAAgB;AAAA,IAC1B,SAAS;AAAA,IACT,SAAS,cAAe,aAAc;AAAA,IACtC,iBAAiB,0BAA0B,WAAW;AAAA,EACvD;AAEA,QAAM,cAAc;AAAA,IACnB,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,QAAQ,YAAY;AAAA,IACpB,SAAS;AAAA,IACT,MAAM;AAAA,IACN,SAAS,cAAe,aAAc;AAAA,IACtC,iBAAiB,0BAA0B,WAAW;AAAA,EACvD;AACA,QAAM,iBAAiB,WAAW,cAAc;AAChD,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,WAAY,GAAI,eAAe,SAAU;AAAA,MACzC,MAAK;AAAA,MAEL,8BAAC,sBAAmB;AAAA;AAAA,EACrB;AAEF;AAKA,IAAO,8BAAQ;",
6
6
  "names": []
7
7
  }
@@ -41,9 +41,9 @@ function PublishButtonLabel() {
41
41
  };
42
42
  }, []);
43
43
  if (isPublishing) {
44
- return __("Publishing\u2026");
44
+ return __("Publishing");
45
45
  } else if ((isPublished || isBeingScheduled) && isSaving && !isAutosaving) {
46
- return __("Saving\u2026");
46
+ return __("Saving");
47
47
  }
48
48
  if (!hasPublishAction) {
49
49
  return isSmallerThanMediumViewport ? __("Publish") : __("Submit for Review");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-button/label.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the label for the publish button.\n *\n * @return {string} The label for the publish button.\n */\nexport default function PublishButtonLabel() {\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tconst {\n\t\tisPublished,\n\t\tisBeingScheduled,\n\t\tisSaving,\n\t\tisPublishing,\n\t\thasPublishAction,\n\t\tisAutosaving,\n\t\thasNonPostEntityChanges,\n\t\tpostStatusHasChanged,\n\t\tpostStatus,\n\t\tisPostSavingLocked,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisSavingPost,\n\t\t\tisPublishingPost,\n\t\t\tgetCurrentPost,\n\t\t\tisAutosavingPost,\n\t\t\tgetPostEdits,\n\t\t\tgetEditedPostAttribute,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisPublishing: isPublishingPost(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t\tisPostSavingLocked: select( editorStore ).isPostSavingLocked(),\n\t\t\tpostStatusHasChanged: !! getPostEdits()?.status,\n\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t};\n\t}, [] );\n\tif ( isPublishing ) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Publishing\u2026' );\n\t} else if (\n\t\t( isPublished || isBeingScheduled ) &&\n\t\tisSaving &&\n\t\t! isAutosaving\n\t) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Saving\u2026' );\n\t}\n\tif ( ! hasPublishAction ) {\n\t\t// TODO: this is because \"Submit for review\" string is too long in some languages.\n\t\t// @see https://github.com/WordPress/gutenberg/issues/10475\n\t\treturn isSmallerThanMediumViewport\n\t\t\t? __( 'Publish' )\n\t\t\t: __( 'Submit for Review' );\n\t}\n\tif (\n\t\t( hasNonPostEntityChanges && ! isPostSavingLocked ) ||\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( ! postStatusHasChanged && postStatus === 'future' )\n\t) {\n\t\treturn __( 'Save' );\n\t}\n\tif ( isBeingScheduled ) {\n\t\treturn __( 'Schedule' );\n\t}\n\treturn __( 'Publish' );\n}\n"],
5
- "mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AAKjC,SAAS,SAAS,mBAAmB;AAOtB,SAAR,qBAAsC;AAC5C,QAAM,8BAA8B,iBAAkB,UAAU,GAAI;AACpE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,WAAY;AACxB,WAAO;AAAA,MACN,aAAa,uBAAuB;AAAA,MACpC,kBAAkB,2BAA2B;AAAA,MAC7C,UAAU,aAAa;AAAA,MACvB,cAAc,iBAAiB;AAAA,MAC/B,kBACC,eAAe,EAAE,SAAU,mBAAoB,KAAK;AAAA,MACrD,cAAc,iBAAiB;AAAA,MAC/B,yBACC,OAAQ,WAAY,EAAE,wBAAwB;AAAA,MAC/C,oBAAoB,OAAQ,WAAY,EAAE,mBAAmB;AAAA,MAC7D,sBAAsB,CAAC,CAAE,aAAa,GAAG;AAAA,MACzC,YAAY,uBAAwB,QAAS;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,CAAE;AACN,MAAK,cAAe;AAEnB,WAAO,GAAI,kBAAc;AAAA,EAC1B,YACG,eAAe,qBACjB,YACA,CAAE,cACD;AAED,WAAO,GAAI,cAAU;AAAA,EACtB;AACA,MAAK,CAAE,kBAAmB;AAGzB,WAAO,8BACJ,GAAI,SAAU,IACd,GAAI,mBAAoB;AAAA,EAC5B;AACA,MACG,2BAA2B,CAAE,sBAC/B,eACE,wBACD,CAAE,CAAE,UAAU,SAAU,EAAE,SAAU,UAAW,KAC9C,CAAE,wBAAwB,eAAe,UAC1C;AACD,WAAO,GAAI,MAAO;AAAA,EACnB;AACA,MAAK,kBAAmB;AACvB,WAAO,GAAI,UAAW;AAAA,EACvB;AACA,SAAO,GAAI,SAAU;AACtB;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the label for the publish button.\n *\n * @return {string} The label for the publish button.\n */\nexport default function PublishButtonLabel() {\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tconst {\n\t\tisPublished,\n\t\tisBeingScheduled,\n\t\tisSaving,\n\t\tisPublishing,\n\t\thasPublishAction,\n\t\tisAutosaving,\n\t\thasNonPostEntityChanges,\n\t\tpostStatusHasChanged,\n\t\tpostStatus,\n\t\tisPostSavingLocked,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisSavingPost,\n\t\t\tisPublishingPost,\n\t\t\tgetCurrentPost,\n\t\t\tisAutosavingPost,\n\t\t\tgetPostEdits,\n\t\t\tgetEditedPostAttribute,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisPublishing: isPublishingPost(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t\tisPostSavingLocked: select( editorStore ).isPostSavingLocked(),\n\t\t\tpostStatusHasChanged: !! getPostEdits()?.status,\n\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t};\n\t}, [] );\n\tif ( isPublishing ) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Publishing' );\n\t} else if (\n\t\t( isPublished || isBeingScheduled ) &&\n\t\tisSaving &&\n\t\t! isAutosaving\n\t) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Saving' );\n\t}\n\tif ( ! hasPublishAction ) {\n\t\t// TODO: this is because \"Submit for review\" string is too long in some languages.\n\t\t// @see https://github.com/WordPress/gutenberg/issues/10475\n\t\treturn isSmallerThanMediumViewport\n\t\t\t? __( 'Publish' )\n\t\t\t: __( 'Submit for Review' );\n\t}\n\tif (\n\t\t( hasNonPostEntityChanges && ! isPostSavingLocked ) ||\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( ! postStatusHasChanged && postStatus === 'future' )\n\t) {\n\t\treturn __( 'Save' );\n\t}\n\tif ( isBeingScheduled ) {\n\t\treturn __( 'Schedule' );\n\t}\n\treturn __( 'Publish' );\n}\n"],
5
+ "mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AAKjC,SAAS,SAAS,mBAAmB;AAOtB,SAAR,qBAAsC;AAC5C,QAAM,8BAA8B,iBAAkB,UAAU,GAAI;AACpE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,WAAY;AACxB,WAAO;AAAA,MACN,aAAa,uBAAuB;AAAA,MACpC,kBAAkB,2BAA2B;AAAA,MAC7C,UAAU,aAAa;AAAA,MACvB,cAAc,iBAAiB;AAAA,MAC/B,kBACC,eAAe,EAAE,SAAU,mBAAoB,KAAK;AAAA,MACrD,cAAc,iBAAiB;AAAA,MAC/B,yBACC,OAAQ,WAAY,EAAE,wBAAwB;AAAA,MAC/C,oBAAoB,OAAQ,WAAY,EAAE,mBAAmB;AAAA,MAC7D,sBAAsB,CAAC,CAAE,aAAa,GAAG;AAAA,MACzC,YAAY,uBAAwB,QAAS;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,CAAE;AACN,MAAK,cAAe;AAEnB,WAAO,GAAI,aAAc;AAAA,EAC1B,YACG,eAAe,qBACjB,YACA,CAAE,cACD;AAED,WAAO,GAAI,SAAU;AAAA,EACtB;AACA,MAAK,CAAE,kBAAmB;AAGzB,WAAO,8BACJ,GAAI,SAAU,IACd,GAAI,mBAAoB;AAAA,EAC5B;AACA,MACG,2BAA2B,CAAE,sBAC/B,eACE,wBACD,CAAE,CAAE,UAAU,SAAU,EAAE,SAAU,UAAW,KAC9C,CAAE,wBAAwB,eAAe,UAC1C;AACD,WAAO,GAAI,MAAO;AAAA,EACnB;AACA,MAAK,kBAAmB;AACvB,WAAO,GAAI,UAAW;AAAA,EACvB;AACA,SAAO,GAAI,SAAU;AACtB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-panel/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { Button, Spinner, CheckboxControl } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseConstrainedTabbing,\n\tuseEvent,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { closeSmall } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from '../post-publish-button';\nimport PostPublishPanelPrepublish from './prepublish';\nimport PostPublishPanelPostpublish from './postpublish';\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders a panel for publishing a post.\n *\n * @param {Object} props Component props.\n * @param {boolean} [props.forceIsDirty] Whether to force the dirty state.\n * @param {()=>void} props.onClose Called when the panel requests to close.\n * @param {React.ComponentType} [props.PostPublishExtension] Component rendered after publishing.\n * @param {React.ComponentType} [props.PrePublishExtension] Component rendered before publishing.\n *\n * @return {React.JSX.Element} The post publish panel.\n */\nexport default function PostPublishPanel( {\n\tforceIsDirty,\n\tonClose,\n\tPostPublishExtension,\n\tPrePublishExtension,\n\t...propsForPanel\n} ) {\n\tconst {\n\t\thasPublishAction,\n\t\tisPostTypeViewable,\n\t\tisBeingScheduled,\n\t\tisDirty,\n\t\tisPublished,\n\t\tisPublishSidebarEnabled,\n\t\tisSaving,\n\t\tisSavingNonPostEntityChanges,\n\t\tisScheduled,\n\t\tcurrentPostId,\n\t} = useSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst {\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditedPostAttribute,\n\t\t\tisCurrentPostPublished,\n\t\t\tisCurrentPostScheduled,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisEditedPostDirty,\n\t\t\tisAutosavingPost,\n\t\t\tisSavingPost,\n\t\t\tisSavingNonPostEntityChanges: _isSavingNonPostEntityChanges,\n\t\t\tisPublishSidebarEnabled: _isPublishSidebarEnabled,\n\t\t} = select( editorStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPostTypeViewable: postType?.viewable,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled: _isPublishSidebarEnabled(),\n\t\t\tisSaving: isSavingPost() && ! isAutosavingPost(),\n\t\t\tisSavingNonPostEntityChanges: _isSavingNonPostEntityChanges(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\tcurrentPostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\n\tconst { disablePublishSidebar, enablePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\n\tconst cancelButtonRef = useRef( null );\n\tconst wrapperRef = useMergeRefs( [\n\t\tuseFocusReturn(),\n\t\tuseConstrainedTabbing(),\n\t] );\n\n\tuseEffect( () => {\n\t\tcancelButtonRef.current?.focus();\n\t}, [] );\n\n\t// Auto-collapse the publish sidebar when a post is published and the user\n\t// makes an edit, or when the edited post changes. The panel only mounts\n\t// for unpublished posts, so `isPublished && isDirty` cannot be true on\n\t// mount \u2014 it implies a publish-then-edit transition.\n\tconst prevPostIdRef = useRef( currentPostId );\n\tconst stableOnClose = useEvent( onClose );\n\tuseEffect( () => {\n\t\tconst postChanged = currentPostId !== prevPostIdRef.current;\n\t\tprevPostIdRef.current = currentPostId;\n\n\t\tif ( postChanged || ( isPublished && ! isSaving && isDirty ) ) {\n\t\t\tstableOnClose();\n\t\t}\n\t}, [ isPublished, isSaving, isDirty, currentPostId, stableOnClose ] );\n\n\tfunction onTogglePublishSidebar() {\n\t\tif ( isPublishSidebarEnabled ) {\n\t\t\tdisablePublishSidebar();\n\t\t} else {\n\t\t\tenablePublishSidebar();\n\t\t}\n\t}\n\n\tfunction onSubmit() {\n\t\tif ( ! hasPublishAction || ! isPostTypeViewable ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\tconst isPublishedOrScheduled =\n\t\tisPublished || ( isScheduled && isBeingScheduled );\n\tconst isPrePublish = ! isPublishedOrScheduled && ! isSaving;\n\tconst isPostPublish = isPublishedOrScheduled && ! isSaving;\n\n\treturn (\n\t\t<div\n\t\t\tref={ wrapperRef }\n\t\t\ttabIndex={ -1 }\n\t\t\tclassName=\"editor-post-publish-panel\"\n\t\t\t{ ...propsForPanel }\n\t\t>\n\t\t\t<div className=\"editor-post-publish-panel__header\">\n\t\t\t\t{ isPostPublish ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-cancel-button\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tref={ cancelButtonRef }\n\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\tdisabled={ isSavingNonPostEntityChanges }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-publish-button\">\n\t\t\t\t\t\t\t<PostPublishButton\n\t\t\t\t\t\t\t\tonSubmit={ onSubmit }\n\t\t\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<div className=\"editor-post-publish-panel__content\">\n\t\t\t\t{ isPrePublish && (\n\t\t\t\t\t<PostPublishPanelPrepublish>\n\t\t\t\t\t\t{ PrePublishExtension && <PrePublishExtension /> }\n\t\t\t\t\t</PostPublishPanelPrepublish>\n\t\t\t\t) }\n\t\t\t\t{ isPostPublish && (\n\t\t\t\t\t<PostPublishPanelPostpublish focusOnMount>\n\t\t\t\t\t\t{ PostPublishExtension && <PostPublishExtension /> }\n\t\t\t\t\t</PostPublishPanelPostpublish>\n\t\t\t\t) }\n\t\t\t\t{ isSaving && <Spinner /> }\n\t\t\t</div>\n\t\t\t<div className=\"editor-post-publish-panel__footer\">\n\t\t\t\t<CheckboxControl\n\t\t\t\t\tlabel={ __( 'Always show pre-publish checks.' ) }\n\t\t\t\t\tchecked={ isPublishSidebarEnabled }\n\t\t\t\t\tonChange={ onTogglePublishSidebar }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { Button, Spinner, CheckboxControl } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseConstrainedTabbing,\n\tuseEvent,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { closeSmall } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from '../post-publish-button';\nimport PostPublishPanelPrepublish from './prepublish';\nimport PostPublishPanelPostpublish from './postpublish';\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders a panel for publishing a post.\n *\n * @param {Object} props Component props.\n * @param {boolean} [props.forceIsDirty] Whether to force the dirty state.\n * @param {()=>void} props.onClose Called when the panel requests to close.\n * @param {React.ComponentType} [props.PostPublishExtension] Component rendered after publishing.\n * @param {React.ComponentType} [props.PrePublishExtension] Component rendered before publishing.\n *\n * @return {React.JSX.Element} The post publish panel.\n */\nexport default function PostPublishPanel( {\n\tforceIsDirty,\n\tonClose,\n\tPostPublishExtension,\n\tPrePublishExtension,\n\t...propsForPanel\n} ) {\n\tconst {\n\t\thasPublishAction,\n\t\tisPostTypeViewable,\n\t\tisBeingScheduled,\n\t\tisDirty,\n\t\tisPublished,\n\t\tisPublishSidebarEnabled,\n\t\tisSaving,\n\t\tisSavingNonPostEntityChanges,\n\t\tisScheduled,\n\t\tcurrentPostId,\n\t} = useSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst {\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditedPostAttribute,\n\t\t\tisCurrentPostPublished,\n\t\t\tisCurrentPostScheduled,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisEditedPostDirty,\n\t\t\tisAutosavingPost,\n\t\t\tisSavingPost,\n\t\t\tisSavingNonPostEntityChanges: _isSavingNonPostEntityChanges,\n\t\t\tisPublishSidebarEnabled: _isPublishSidebarEnabled,\n\t\t} = select( editorStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPostTypeViewable: postType?.viewable,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled: _isPublishSidebarEnabled(),\n\t\t\tisSaving: isSavingPost() && ! isAutosavingPost(),\n\t\t\tisSavingNonPostEntityChanges: _isSavingNonPostEntityChanges(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\tcurrentPostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\n\tconst { disablePublishSidebar, enablePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\n\tconst cancelButtonRef = useRef( null );\n\tconst wrapperRef = useMergeRefs( [\n\t\tuseFocusReturn(),\n\t\tuseConstrainedTabbing(),\n\t] );\n\n\tuseEffect( () => {\n\t\tcancelButtonRef.current?.focus();\n\t}, [] );\n\n\t// Auto-collapse the publish sidebar when a post is published and the user\n\t// makes an edit, or when the edited post changes. The panel only mounts\n\t// for unpublished posts, so `isPublished && isDirty` cannot be true on\n\t// mount it implies a publish-then-edit transition.\n\tconst prevPostIdRef = useRef( currentPostId );\n\tconst stableOnClose = useEvent( onClose );\n\tuseEffect( () => {\n\t\tconst postChanged = currentPostId !== prevPostIdRef.current;\n\t\tprevPostIdRef.current = currentPostId;\n\n\t\tif ( postChanged || ( isPublished && ! isSaving && isDirty ) ) {\n\t\t\tstableOnClose();\n\t\t}\n\t}, [ isPublished, isSaving, isDirty, currentPostId, stableOnClose ] );\n\n\tfunction onTogglePublishSidebar() {\n\t\tif ( isPublishSidebarEnabled ) {\n\t\t\tdisablePublishSidebar();\n\t\t} else {\n\t\t\tenablePublishSidebar();\n\t\t}\n\t}\n\n\tfunction onSubmit() {\n\t\tif ( ! hasPublishAction || ! isPostTypeViewable ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\tconst isPublishedOrScheduled =\n\t\tisPublished || ( isScheduled && isBeingScheduled );\n\tconst isPrePublish = ! isPublishedOrScheduled && ! isSaving;\n\tconst isPostPublish = isPublishedOrScheduled && ! isSaving;\n\n\treturn (\n\t\t<div\n\t\t\tref={ wrapperRef }\n\t\t\ttabIndex={ -1 }\n\t\t\tclassName=\"editor-post-publish-panel\"\n\t\t\t{ ...propsForPanel }\n\t\t>\n\t\t\t<div className=\"editor-post-publish-panel__header\">\n\t\t\t\t{ isPostPublish ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-cancel-button\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tref={ cancelButtonRef }\n\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\tdisabled={ isSavingNonPostEntityChanges }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-publish-button\">\n\t\t\t\t\t\t\t<PostPublishButton\n\t\t\t\t\t\t\t\tonSubmit={ onSubmit }\n\t\t\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<div className=\"editor-post-publish-panel__content\">\n\t\t\t\t{ isPrePublish && (\n\t\t\t\t\t<PostPublishPanelPrepublish>\n\t\t\t\t\t\t{ PrePublishExtension && <PrePublishExtension /> }\n\t\t\t\t\t</PostPublishPanelPrepublish>\n\t\t\t\t) }\n\t\t\t\t{ isPostPublish && (\n\t\t\t\t\t<PostPublishPanelPostpublish focusOnMount>\n\t\t\t\t\t\t{ PostPublishExtension && <PostPublishExtension /> }\n\t\t\t\t\t</PostPublishPanelPostpublish>\n\t\t\t\t) }\n\t\t\t\t{ isSaving && <Spinner /> }\n\t\t\t</div>\n\t\t\t<div className=\"editor-post-publish-panel__footer\">\n\t\t\t\t<CheckboxControl\n\t\t\t\t\tlabel={ __( 'Always show pre-publish checks.' ) }\n\t\t\t\t\tchecked={ isPublishSidebarEnabled }\n\t\t\t\t\tonChange={ onTogglePublishSidebar }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],
5
5
  "mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,WAAW,cAAc;AAClC,SAAS,QA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ACD;AAAA,UACA,oBAAC,SAAI,WAAU,oDACd;AAAA,YAAC;AAAA;AAAA,cACA;AAAA,cACA;AAAA;AAAA,UACD,GACD;AAAA,WACD,GAEF;AAAA,QACA,qBAAC,SAAI,WAAU,sCACZ;AAAA,0BACD,oBAAC,8BACE,iCAAuB,oBAAC,uBAAoB,GAC/C;AAAA,UAEC,iBACD,oBAAC,+BAA4B,cAAY,MACtC,kCAAwB,oBAAC,wBAAqB,GACjD;AAAA,UAEC,YAAY,oBAAC,WAAQ;AAAA,WACxB;AAAA,QACA,oBAAC,SAAI,WAAU,qCACd;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ,GAAI,iCAAkC;AAAA,YAC9C,SAAU;AAAA,YACV,UAAW;AAAA;AAAA,QACZ,GACD;AAAA;AAAA;AAAA,EACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -95,7 +95,7 @@ function PostPublishPanelPostpublish({
95
95
  postPublishNonLinkHeader
96
96
  ] }),
97
97
  /* @__PURE__ */ jsxs(PanelBody, { children: [
98
- /* @__PURE__ */ jsx("p", { className: "post-publish-panel__postpublish-subheader", children: /* @__PURE__ */ jsx("strong", { children: __("What\u2019s next?") }) }),
98
+ /* @__PURE__ */ jsx("p", { className: "post-publish-panel__postpublish-subheader", children: /* @__PURE__ */ jsx("strong", { children: __("What’s next?") }) }),
99
99
  /* @__PURE__ */ jsxs("div", { className: "post-publish-panel__postpublish-post-address-container", children: [
100
100
  /* @__PURE__ */ jsx(
101
101
  TextControl,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-panel/postpublish.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\tTextControl,\n\tExternalLink,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useEffect, useState, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { addQueryArgs, safeDecodeURIComponent } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { external } from '@wordpress/icons';\nimport { VisuallyHidden } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleLabel from '../post-schedule/label';\nimport { store as editorStore } from '../../store';\n\nconst POSTNAME = '%postname%';\nconst PAGENAME = '%pagename%';\n\n/**\n * Returns URL for a future post.\n *\n * @param {Object} post Post object.\n *\n * @return {string} PostPublish URL.\n */\n\nconst getFuturePostUrl = ( post ) => {\n\tconst { slug } = post;\n\n\tif ( post.permalink_template.includes( POSTNAME ) ) {\n\t\treturn post.permalink_template.replace( POSTNAME, slug );\n\t}\n\n\tif ( post.permalink_template.includes( PAGENAME ) ) {\n\t\treturn post.permalink_template.replace( PAGENAME, slug );\n\t}\n\n\treturn post.permalink_template;\n};\n\nfunction CopyButton( { text } ) {\n\tconst [ showCopyConfirmation, setShowCopyConfirmation ] = useState( false );\n\tconst timeoutIdRef = useRef();\n\tconst ref = useCopyToClipboard( text, () => {\n\t\tsetShowCopyConfirmation( true );\n\t\tif ( timeoutIdRef.current ) {\n\t\t\tclearTimeout( timeoutIdRef.current );\n\t\t}\n\t\ttimeoutIdRef.current = setTimeout( () => {\n\t\t\tsetShowCopyConfirmation( false );\n\t\t}, 4000 );\n\t} );\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( timeoutIdRef.current ) {\n\t\t\t\tclearTimeout( timeoutIdRef.current );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Button __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ showCopyConfirmation ? __( 'Copied!' ) : __( 'Copy' ) }\n\t\t</Button>\n\t);\n}\n\nexport default function PostPublishPanelPostpublish( {\n\tfocusOnMount,\n\tchildren,\n} ) {\n\tconst { post, postType, isScheduled } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetCurrentPost,\n\t\t\tisCurrentPostScheduled,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\tpost: getCurrentPost(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t};\n\t}, [] );\n\n\tconst postLabel = postType?.labels?.singular_name;\n\tconst viewPostLabel = postType?.labels?.view_item;\n\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\tconst link =\n\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\tpost_type: post.type,\n\t} );\n\n\tconst postLinkRef = useCallback(\n\t\t( node ) => {\n\t\t\tif ( focusOnMount && node ) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t},\n\t\t[ focusOnMount ]\n\t);\n\n\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t<>\n\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t<PostScheduleLabel />.\n\t\t</>\n\t) : (\n\t\t__( 'is now live.' )\n\t);\n\n\treturn (\n\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t<ExternalLink ref={ postLinkRef } href={ link }>\n\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t</ExternalLink>{ ' ' }\n\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t</PanelBody>\n\t\t\t<PanelBody>\n\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t<strong>{ __( 'What\u2019s next?' ) }</strong>\n\t\t\t\t</p>\n\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\treadOnly\n\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\tonFocus={ ( event ) => event.target.select() }\n\t\t\t\t\t/>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t<CopyButton text={ link } />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\thref={ link }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t<VisuallyHidden render={ <span /> }>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</PanelBody>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n"],
5
- "mappings": ";AAGA;AAAA,EACC;AA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AAU,0DACd;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,uBAAqB;AAAA,YACrB,WAAU;AAAA,YACV,UAAQ;AAAA,YACR,OAAQ;AAAA;AAAA,cAEP,GAAI,YAAa;AAAA,cACjB;AAAA,YACD;AAAA,YACA,OAAQ,uBAAwB,IAAK;AAAA,YACrC,SAAU,CAAE,UAAW,MAAM,OAAO,OAAO;AAAA;AAAA,QAC5C;AAAA,QAEA,oBAAC,SAAI,WAAU,kEACd,8BAAC,cAAW,MAAO,MAAO,GAC3B;AAAA,SACD;AAAA,MAEA,qBAAC,SAAI,WAAU,2CACZ;AAAA,SAAE,eACH;AAAA,UAAC;AAAA;AAAA,YACA,SAAQ;AAAA,YACR,MAAO;AAAA,YACP,uBAAqB;AAAA,YACrB,MAAO;AAAA,YACP,cAAa;AAAA,YACb,QAAO;AAAA,YAEL;AAAA;AAAA,cACF,oBAAC;AAAA,gBAAe,QAAS,oBAAC,UAAK;AAAA;AAAA,gBAG7B,aAAI,sBAAuB;AAAA,eAE7B;AAAA;AAAA;AAAA,QACD;AAAA,QAED;AAAA,UAAC;AAAA;AAAA,YACA,SAAU,cAAc,YAAY;AAAA,YACpC,uBAAqB;AAAA,YACrB,MAAO;AAAA,YAEL;AAAA;AAAA,QACH;AAAA,SACD;AAAA,OACD;AAAA,IACE;AAAA,KACH;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\tTextControl,\n\tExternalLink,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useEffect, useState, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { addQueryArgs, safeDecodeURIComponent } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { external } from '@wordpress/icons';\nimport { VisuallyHidden } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleLabel from '../post-schedule/label';\nimport { store as editorStore } from '../../store';\n\nconst POSTNAME = '%postname%';\nconst PAGENAME = '%pagename%';\n\n/**\n * Returns URL for a future post.\n *\n * @param {Object} post Post object.\n *\n * @return {string} PostPublish URL.\n */\n\nconst getFuturePostUrl = ( post ) => {\n\tconst { slug } = post;\n\n\tif ( post.permalink_template.includes( POSTNAME ) ) {\n\t\treturn post.permalink_template.replace( POSTNAME, slug );\n\t}\n\n\tif ( post.permalink_template.includes( PAGENAME ) ) {\n\t\treturn post.permalink_template.replace( PAGENAME, slug );\n\t}\n\n\treturn post.permalink_template;\n};\n\nfunction CopyButton( { text } ) {\n\tconst [ showCopyConfirmation, setShowCopyConfirmation ] = useState( false );\n\tconst timeoutIdRef = useRef();\n\tconst ref = useCopyToClipboard( text, () => {\n\t\tsetShowCopyConfirmation( true );\n\t\tif ( timeoutIdRef.current ) {\n\t\t\tclearTimeout( timeoutIdRef.current );\n\t\t}\n\t\ttimeoutIdRef.current = setTimeout( () => {\n\t\t\tsetShowCopyConfirmation( false );\n\t\t}, 4000 );\n\t} );\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( timeoutIdRef.current ) {\n\t\t\t\tclearTimeout( timeoutIdRef.current );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Button __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ showCopyConfirmation ? __( 'Copied!' ) : __( 'Copy' ) }\n\t\t</Button>\n\t);\n}\n\nexport default function PostPublishPanelPostpublish( {\n\tfocusOnMount,\n\tchildren,\n} ) {\n\tconst { post, postType, isScheduled } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetCurrentPost,\n\t\t\tisCurrentPostScheduled,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\tpost: getCurrentPost(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t};\n\t}, [] );\n\n\tconst postLabel = postType?.labels?.singular_name;\n\tconst viewPostLabel = postType?.labels?.view_item;\n\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\tconst link =\n\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\tpost_type: post.type,\n\t} );\n\n\tconst postLinkRef = useCallback(\n\t\t( node ) => {\n\t\t\tif ( focusOnMount && node ) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t},\n\t\t[ focusOnMount ]\n\t);\n\n\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t<>\n\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t<PostScheduleLabel />.\n\t\t</>\n\t) : (\n\t\t__( 'is now live.' )\n\t);\n\n\treturn (\n\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t<ExternalLink ref={ postLinkRef } href={ link }>\n\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t</ExternalLink>{ ' ' }\n\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t</PanelBody>\n\t\t\t<PanelBody>\n\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t<strong>{ __( 'What’s next?' ) }</strong>\n\t\t\t\t</p>\n\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\treadOnly\n\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\tonFocus={ ( event ) => event.target.select() }\n\t\t\t\t\t/>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t<CopyButton text={ link } />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\thref={ link }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t<VisuallyHidden render={ <span /> }>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</PanelBody>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n"],
5
+ "mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,IAAI,eAAe;AAC5B,SAAS,aAAa,WAAW,UAAU,cAAc;AACzD,SAAS,iBAAiB;AAC1B,SAAS,cAAc,8BAA8B;AACrD,SAAS,sBAAsB;AAC/B,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,uBAAwB,IAAK;AAAA,YACrC,SAAU,CAAE,UAAW,MAAM,OAAO,OAAO;AAAA;AAAA,QAC5C;AAAA,QAEA,oBAAC,SAAI,WAAU,kEACd,8BAAC,cAAW,MAAO,MAAO,GAC3B;AAAA,SACD;AAAA,MAEA,qBAAC,SAAI,WAAU,2CACZ;AAAA,SAAE,eACH;AAAA,UAAC;AAAA;AAAA,YACA,SAAQ;AAAA,YACR,MAAO;AAAA,YACP,uBAAqB;AAAA,YACrB,MAAO;AAAA,YACP,cAAa;AAAA,YACb,QAAO;AAAA,YAEL;AAAA;AAAA,cACF,oBAAC;AAAA,gBAAe,QAAS,oBAAC,UAAK;AAAA;AAAA,gBAG7B,aAAI,sBAAuB;AAAA,eAE7B;AAAA;AAAA;AAAA,QACD;AAAA,QAED;AAAA,UAAC;AAAA;AAAA,YACA,SAAU,cAAc,YAAY;AAAA,YACpC,uBAAqB;AAAA,YACrB,MAAO;AAAA,YAEL;AAAA;AAAA,QACH;AAAA,SACD;AAAA,OACD;AAAA,IACE;AAAA,KACH;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,5 @@
1
1
  // packages/editor/src/components/post-revisions-preview/block-diff.js
2
- import { diffArrays } from "diff/lib/diff/array";
3
- import { diffWords } from "diff/lib/diff/word";
2
+ import { diffArrays, diffWordsWithSpace } from "diff";
4
3
  import { parse as grammarParse } from "@wordpress/block-serialization-default-parser";
5
4
  import {
6
5
  privateApis as blocksPrivateApis,
@@ -16,6 +15,9 @@ import {
16
15
  import { __, _n, sprintf } from "@wordpress/i18n";
17
16
  import { unlock } from "../../lock-unlock.mjs";
18
17
  var { parseRawBlock } = unlock(blocksPrivateApis);
18
+ function isWhitespaceRawBlock(rawBlock) {
19
+ return rawBlock.blockName === null && (!rawBlock.innerHTML || !rawBlock.innerHTML.trim());
20
+ }
19
21
  function stringifyValue(value) {
20
22
  if (value === null || value === void 0) {
21
23
  return "";
@@ -135,14 +137,19 @@ function pairSimilarBlocks(blocks) {
135
137
  };
136
138
  const lo = Math.min(rem.index, bestMatch.index);
137
139
  const hi = Math.max(rem.index, bestMatch.index);
138
- let hasAddedBetween = false;
140
+ let crossesCurrentContent = false;
139
141
  for (let i = lo + 1; i < hi; i++) {
140
- if (blocks[i].__revisionDiffStatus?.status === "added" && !pairedAdded.has(i)) {
141
- hasAddedBetween = true;
142
+ const status = blocks[i].__revisionDiffStatus?.status;
143
+ if (status === void 0) {
144
+ crossesCurrentContent = true;
145
+ break;
146
+ }
147
+ if (status === "added" && !pairedAdded.has(i)) {
148
+ crossesCurrentContent = true;
142
149
  break;
143
150
  }
144
151
  }
145
- if (hasAddedBetween) {
152
+ if (crossesCurrentContent) {
146
153
  modifications.set(bestMatch.index, modifiedBlock);
147
154
  pairedRemoved.add(rem.index);
148
155
  } else {
@@ -162,6 +169,8 @@ function pairSimilarBlocks(blocks) {
162
169
  }).filter(Boolean);
163
170
  }
164
171
  function diffRawBlocks(currentRaw, previousRaw) {
172
+ currentRaw = currentRaw.filter((b) => !isWhitespaceRawBlock(b));
173
+ previousRaw = previousRaw.filter((b) => !isWhitespaceRawBlock(b));
165
174
  const createBlockSignature = (rawBlock) => JSON.stringify({
166
175
  name: rawBlock.blockName,
167
176
  attrs: rawBlock.attrs,
@@ -301,7 +310,7 @@ function describeFormatChange(currentFormats, previousFormats, currIdx, prevIdx)
301
310
  function applyRichTextDiff(currentRichText, previousRichText) {
302
311
  const currentText = currentRichText.toPlainText();
303
312
  const previousText = previousRichText.toPlainText();
304
- const textDiff = diffWords(previousText, currentText);
313
+ const textDiff = diffWordsWithSpace(previousText, currentText);
305
314
  let result = create({ text: "" });
306
315
  let currentIdx = 0;
307
316
  let previousIdx = 0;
@@ -421,7 +430,10 @@ function applyDiffToBlock(currentBlock, previousBlock, diffStatus) {
421
430
  previousBlock.attributes[attrName]
422
431
  );
423
432
  if (currStr !== prevStr) {
424
- changedAttributes[attrName] = diffWords(prevStr, currStr);
433
+ changedAttributes[attrName] = diffWordsWithSpace(
434
+ prevStr,
435
+ currStr
436
+ );
425
437
  }
426
438
  }
427
439
  }