@wordpress/editor 14.5.0 → 14.7.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 (415) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +37 -0
  3. package/build/bindings/post-meta.js +12 -10
  4. package/build/bindings/post-meta.js.map +1 -1
  5. package/build/components/block-manager/index.js +4 -1
  6. package/build/components/block-manager/index.js.map +1 -1
  7. package/build/components/block-settings-menu/content-only-settings-menu.js +5 -8
  8. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  9. package/build/components/create-template-part-modal/index.js +1 -0
  10. package/build/components/create-template-part-modal/index.js.map +1 -1
  11. package/build/components/document-bar/index.js +4 -4
  12. package/build/components/document-bar/index.js.map +1 -1
  13. package/build/components/editor-history/redo.js +4 -1
  14. package/build/components/editor-history/redo.js.map +1 -1
  15. package/build/components/editor-history/undo.js +4 -1
  16. package/build/components/editor-history/undo.js.map +1 -1
  17. package/build/components/editor-interface/index.js +2 -3
  18. package/build/components/editor-interface/index.js.map +1 -1
  19. package/build/components/error-boundary/index.js +4 -1
  20. package/build/components/error-boundary/index.js.map +1 -1
  21. package/build/components/global-styles-provider/index.js +17 -4
  22. package/build/components/global-styles-provider/index.js.map +1 -1
  23. package/build/components/index.js +8 -0
  24. package/build/components/index.js.map +1 -1
  25. package/build/components/inserter-sidebar/index.js +8 -7
  26. package/build/components/inserter-sidebar/index.js.map +1 -1
  27. package/build/components/local-autosave-monitor/index.js +5 -5
  28. package/build/components/local-autosave-monitor/index.js.map +1 -1
  29. package/build/components/page-attributes/parent.js +10 -6
  30. package/build/components/page-attributes/parent.js.map +1 -1
  31. package/build/components/plugin-preview-menu-item/index.js +57 -0
  32. package/build/components/plugin-preview-menu-item/index.js.map +1 -0
  33. package/build/components/post-actions/actions.js +4 -499
  34. package/build/components/post-actions/actions.js.map +1 -1
  35. package/build/components/post-actions/index.js +13 -25
  36. package/build/components/post-actions/index.js.map +1 -1
  37. package/build/components/post-card-panel/index.js +20 -20
  38. package/build/components/post-card-panel/index.js.map +1 -1
  39. package/build/components/post-excerpt/panel.js +4 -1
  40. package/build/components/post-excerpt/panel.js.map +1 -1
  41. package/build/components/post-featured-image/index.js +14 -3
  42. package/build/components/post-featured-image/index.js.map +1 -1
  43. package/build/components/post-format/index.js +4 -1
  44. package/build/components/post-format/index.js.map +1 -1
  45. package/build/components/post-last-revision/index.js +4 -1
  46. package/build/components/post-last-revision/index.js.map +1 -1
  47. package/build/components/post-locked-modal/index.js +12 -3
  48. package/build/components/post-locked-modal/index.js.map +1 -1
  49. package/build/components/post-publish-panel/index.js +4 -1
  50. package/build/components/post-publish-panel/index.js.map +1 -1
  51. package/build/components/post-publish-panel/maybe-post-format-panel.js +4 -1
  52. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  53. package/build/components/post-publish-panel/maybe-upload-media.js +14 -8
  54. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  55. package/build/components/post-publish-panel/postpublish.js +4 -0
  56. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  57. package/build/components/post-slug/index.js +1 -0
  58. package/build/components/post-slug/index.js.map +1 -1
  59. package/build/components/post-status/index.js +4 -2
  60. package/build/components/post-status/index.js.map +1 -1
  61. package/build/components/post-taxonomies/hierarchical-term-selector.js +6 -2
  62. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  63. package/build/components/post-taxonomies/most-used-terms.js +4 -1
  64. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  65. package/build/components/post-template/block-theme.js +13 -4
  66. package/build/components/post-template/block-theme.js.map +1 -1
  67. package/build/components/post-template/classic-theme.js +4 -1
  68. package/build/components/post-template/classic-theme.js.map +1 -1
  69. package/build/components/post-title/index.js +32 -46
  70. package/build/components/post-title/index.js.map +1 -1
  71. package/build/components/post-url/index.js +10 -6
  72. package/build/components/post-url/index.js.map +1 -1
  73. package/build/components/preview-dropdown/index.js +26 -14
  74. package/build/components/preview-dropdown/index.js.map +1 -1
  75. package/build/components/provider/use-block-editor-settings.js +5 -6
  76. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  77. package/build/components/save-publish-panels/index.js +8 -2
  78. package/build/components/save-publish-panels/index.js.map +1 -1
  79. package/build/components/sidebar/post-summary.js +10 -7
  80. package/build/components/sidebar/post-summary.js.map +1 -1
  81. package/build/components/start-template-options/index.js +4 -1
  82. package/build/components/start-template-options/index.js.map +1 -1
  83. package/build/components/table-of-contents/index.js +4 -1
  84. package/build/components/table-of-contents/index.js.map +1 -1
  85. package/build/components/template-content-panel/index.js +1 -1
  86. package/build/components/template-content-panel/index.js.map +1 -1
  87. package/build/components/text-editor/index.js +4 -1
  88. package/build/components/text-editor/index.js.map +1 -1
  89. package/build/components/visual-editor/index.js +1 -6
  90. package/build/components/visual-editor/index.js.map +1 -1
  91. package/build/dataviews/actions/duplicate-pattern.js +48 -0
  92. package/build/dataviews/actions/duplicate-pattern.js.map +1 -0
  93. package/build/dataviews/actions/duplicate-post.js +146 -0
  94. package/build/dataviews/actions/duplicate-post.js.map +1 -0
  95. package/build/dataviews/actions/duplicate-post.native.js +9 -0
  96. package/build/dataviews/actions/duplicate-post.native.js.map +1 -0
  97. package/build/dataviews/actions/duplicate-template-part.js +67 -0
  98. package/build/dataviews/actions/duplicate-template-part.js.map +1 -0
  99. package/build/dataviews/actions/export-pattern.js +2 -0
  100. package/build/dataviews/actions/export-pattern.js.map +1 -1
  101. package/build/dataviews/actions/permanently-delete-post.js +2 -0
  102. package/build/dataviews/actions/permanently-delete-post.js.map +1 -1
  103. package/build/dataviews/actions/rename-post.js +125 -0
  104. package/build/dataviews/actions/rename-post.js.map +1 -0
  105. package/build/dataviews/actions/reorder-page.js +116 -0
  106. package/build/dataviews/actions/reorder-page.js.map +1 -0
  107. package/build/dataviews/actions/reorder-page.native.js +9 -0
  108. package/build/dataviews/actions/reorder-page.native.js.map +1 -0
  109. package/build/dataviews/actions/reset-post.js +9 -3
  110. package/build/dataviews/actions/reset-post.js.map +1 -1
  111. package/build/dataviews/actions/trash-post.js +8 -2
  112. package/build/dataviews/actions/trash-post.js.map +1 -1
  113. package/build/dataviews/actions/utils.js +9 -1
  114. package/build/dataviews/actions/utils.js.map +1 -1
  115. package/build/dataviews/actions/view-post-revisions.js +49 -0
  116. package/build/dataviews/actions/view-post-revisions.js.map +1 -0
  117. package/build/dataviews/actions/view-post.js +36 -0
  118. package/build/dataviews/actions/view-post.js.map +1 -0
  119. package/build/dataviews/fields/index.js +32 -0
  120. package/build/dataviews/fields/index.js.map +1 -0
  121. package/build/dataviews/store/private-actions.js +16 -2
  122. package/build/dataviews/store/private-actions.js.map +1 -1
  123. package/build/dataviews/types.js.map +1 -1
  124. package/build/private-apis.js +2 -2
  125. package/build/private-apis.js.map +1 -1
  126. package/build/store/private-actions.js +2 -2
  127. package/build/store/private-actions.js.map +1 -1
  128. package/build/store/utils/is-template-revertable.js +1 -1
  129. package/build/store/utils/is-template-revertable.js.map +1 -1
  130. package/build-module/bindings/post-meta.js +12 -10
  131. package/build-module/bindings/post-meta.js.map +1 -1
  132. package/build-module/components/block-manager/index.js +4 -1
  133. package/build-module/components/block-manager/index.js.map +1 -1
  134. package/build-module/components/block-settings-menu/content-only-settings-menu.js +6 -9
  135. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  136. package/build-module/components/create-template-part-modal/index.js +1 -0
  137. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  138. package/build-module/components/document-bar/index.js +4 -4
  139. package/build-module/components/document-bar/index.js.map +1 -1
  140. package/build-module/components/editor-history/redo.js +4 -1
  141. package/build-module/components/editor-history/redo.js.map +1 -1
  142. package/build-module/components/editor-history/undo.js +4 -1
  143. package/build-module/components/editor-history/undo.js.map +1 -1
  144. package/build-module/components/editor-interface/index.js +2 -3
  145. package/build-module/components/editor-interface/index.js.map +1 -1
  146. package/build-module/components/error-boundary/index.js +4 -1
  147. package/build-module/components/error-boundary/index.js.map +1 -1
  148. package/build-module/components/global-styles-provider/index.js +17 -4
  149. package/build-module/components/global-styles-provider/index.js.map +1 -1
  150. package/build-module/components/index.js +1 -0
  151. package/build-module/components/index.js.map +1 -1
  152. package/build-module/components/inserter-sidebar/index.js +8 -7
  153. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  154. package/build-module/components/local-autosave-monitor/index.js +5 -5
  155. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  156. package/build-module/components/page-attributes/parent.js +10 -6
  157. package/build-module/components/page-attributes/parent.js.map +1 -1
  158. package/build-module/components/plugin-preview-menu-item/index.js +52 -0
  159. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -0
  160. package/build-module/components/post-actions/actions.js +5 -501
  161. package/build-module/components/post-actions/actions.js.map +1 -1
  162. package/build-module/components/post-actions/index.js +13 -25
  163. package/build-module/components/post-actions/index.js.map +1 -1
  164. package/build-module/components/post-card-panel/index.js +20 -20
  165. package/build-module/components/post-card-panel/index.js.map +1 -1
  166. package/build-module/components/post-excerpt/panel.js +4 -1
  167. package/build-module/components/post-excerpt/panel.js.map +1 -1
  168. package/build-module/components/post-featured-image/index.js +14 -3
  169. package/build-module/components/post-featured-image/index.js.map +1 -1
  170. package/build-module/components/post-format/index.js +4 -1
  171. package/build-module/components/post-format/index.js.map +1 -1
  172. package/build-module/components/post-last-revision/index.js +4 -1
  173. package/build-module/components/post-last-revision/index.js.map +1 -1
  174. package/build-module/components/post-locked-modal/index.js +12 -3
  175. package/build-module/components/post-locked-modal/index.js.map +1 -1
  176. package/build-module/components/post-publish-panel/index.js +4 -1
  177. package/build-module/components/post-publish-panel/index.js.map +1 -1
  178. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +4 -1
  179. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  180. package/build-module/components/post-publish-panel/maybe-upload-media.js +14 -8
  181. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  182. package/build-module/components/post-publish-panel/postpublish.js +4 -0
  183. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  184. package/build-module/components/post-slug/index.js +1 -0
  185. package/build-module/components/post-slug/index.js.map +1 -1
  186. package/build-module/components/post-status/index.js +4 -2
  187. package/build-module/components/post-status/index.js.map +1 -1
  188. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +7 -3
  189. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  190. package/build-module/components/post-taxonomies/most-used-terms.js +4 -1
  191. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  192. package/build-module/components/post-template/block-theme.js +13 -4
  193. package/build-module/components/post-template/block-theme.js.map +1 -1
  194. package/build-module/components/post-template/classic-theme.js +4 -1
  195. package/build-module/components/post-template/classic-theme.js.map +1 -1
  196. package/build-module/components/post-title/index.js +33 -47
  197. package/build-module/components/post-title/index.js.map +1 -1
  198. package/build-module/components/post-url/index.js +11 -7
  199. package/build-module/components/post-url/index.js.map +1 -1
  200. package/build-module/components/preview-dropdown/index.js +26 -14
  201. package/build-module/components/preview-dropdown/index.js.map +1 -1
  202. package/build-module/components/provider/use-block-editor-settings.js +6 -7
  203. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  204. package/build-module/components/save-publish-panels/index.js +8 -2
  205. package/build-module/components/save-publish-panels/index.js.map +1 -1
  206. package/build-module/components/sidebar/post-summary.js +10 -7
  207. package/build-module/components/sidebar/post-summary.js.map +1 -1
  208. package/build-module/components/start-template-options/index.js +4 -1
  209. package/build-module/components/start-template-options/index.js.map +1 -1
  210. package/build-module/components/table-of-contents/index.js +4 -1
  211. package/build-module/components/table-of-contents/index.js.map +1 -1
  212. package/build-module/components/template-content-panel/index.js +1 -1
  213. package/build-module/components/template-content-panel/index.js.map +1 -1
  214. package/build-module/components/text-editor/index.js +4 -1
  215. package/build-module/components/text-editor/index.js.map +1 -1
  216. package/build-module/components/visual-editor/index.js +1 -6
  217. package/build-module/components/visual-editor/index.js.map +1 -1
  218. package/build-module/dataviews/actions/duplicate-pattern.js +39 -0
  219. package/build-module/dataviews/actions/duplicate-pattern.js.map +1 -0
  220. package/build-module/dataviews/actions/duplicate-post.js +139 -0
  221. package/build-module/dataviews/actions/duplicate-post.js.map +1 -0
  222. package/build-module/dataviews/actions/duplicate-post.native.js +3 -0
  223. package/build-module/dataviews/actions/duplicate-post.native.js.map +1 -0
  224. package/build-module/dataviews/actions/duplicate-template-part.js +58 -0
  225. package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -0
  226. package/build-module/dataviews/actions/export-pattern.js +2 -0
  227. package/build-module/dataviews/actions/export-pattern.js.map +1 -1
  228. package/build-module/dataviews/actions/permanently-delete-post.js +3 -0
  229. package/build-module/dataviews/actions/permanently-delete-post.js.map +1 -1
  230. package/build-module/dataviews/actions/rename-post.js +118 -0
  231. package/build-module/dataviews/actions/rename-post.js.map +1 -0
  232. package/build-module/dataviews/actions/reorder-page.js +111 -0
  233. package/build-module/dataviews/actions/reorder-page.js.map +1 -0
  234. package/build-module/dataviews/actions/reorder-page.native.js +3 -0
  235. package/build-module/dataviews/actions/reorder-page.native.js.map +1 -0
  236. package/build-module/dataviews/actions/reset-post.js +9 -3
  237. package/build-module/dataviews/actions/reset-post.js.map +1 -1
  238. package/build-module/dataviews/actions/trash-post.js +8 -2
  239. package/build-module/dataviews/actions/trash-post.js.map +1 -1
  240. package/build-module/dataviews/actions/utils.js +7 -1
  241. package/build-module/dataviews/actions/utils.js.map +1 -1
  242. package/build-module/dataviews/actions/view-post-revisions.js +43 -0
  243. package/build-module/dataviews/actions/view-post-revisions.js.map +1 -0
  244. package/build-module/dataviews/actions/view-post.js +30 -0
  245. package/build-module/dataviews/actions/view-post.js.map +1 -0
  246. package/build-module/dataviews/fields/index.js +26 -0
  247. package/build-module/dataviews/fields/index.js.map +1 -0
  248. package/build-module/dataviews/store/private-actions.js +16 -2
  249. package/build-module/dataviews/store/private-actions.js.map +1 -1
  250. package/build-module/dataviews/types.js.map +1 -1
  251. package/build-module/private-apis.js +2 -2
  252. package/build-module/private-apis.js.map +1 -1
  253. package/build-module/store/private-actions.js +2 -2
  254. package/build-module/store/private-actions.js.map +1 -1
  255. package/build-module/store/utils/is-template-revertable.js +1 -1
  256. package/build-module/store/utils/is-template-revertable.js.map +1 -1
  257. package/build-style/style-rtl.css +14 -38
  258. package/build-style/style.css +14 -38
  259. package/build-types/bindings/post-meta.d.ts +0 -3
  260. package/build-types/bindings/post-meta.d.ts.map +1 -1
  261. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -1
  262. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
  263. package/build-types/components/editor-history/redo.d.ts.map +1 -1
  264. package/build-types/components/editor-history/undo.d.ts.map +1 -1
  265. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  266. package/build-types/components/error-boundary/index.d.ts.map +1 -1
  267. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  268. package/build-types/components/index.d.ts +1 -0
  269. package/build-types/components/index.d.ts.map +1 -1
  270. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  271. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  272. package/build-types/components/plugin-preview-menu-item/index.d.ts +3 -0
  273. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -0
  274. package/build-types/components/post-actions/actions.d.ts +1 -26
  275. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  276. package/build-types/components/post-actions/index.d.ts +3 -2
  277. package/build-types/components/post-actions/index.d.ts.map +1 -1
  278. package/build-types/components/post-card-panel/index.d.ts +4 -2
  279. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  280. package/build-types/components/post-format/index.d.ts.map +1 -1
  281. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  282. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  283. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  284. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
  285. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
  286. package/build-types/components/post-slug/index.d.ts.map +1 -1
  287. package/build-types/components/post-status/index.d.ts.map +1 -1
  288. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +1 -17
  289. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  290. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -1
  291. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  292. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  293. package/build-types/components/post-url/index.d.ts.map +1 -1
  294. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  295. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  296. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  297. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  298. package/build-types/components/start-template-options/index.d.ts.map +1 -1
  299. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  300. package/build-types/components/text-editor/index.d.ts.map +1 -1
  301. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  302. package/build-types/dataviews/actions/duplicate-pattern.d.ts +5 -0
  303. package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +1 -0
  304. package/build-types/dataviews/actions/duplicate-post.d.ts +5 -0
  305. package/build-types/dataviews/actions/duplicate-post.d.ts.map +1 -0
  306. package/build-types/dataviews/actions/duplicate-post.native.d.ts +3 -0
  307. package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +1 -0
  308. package/build-types/dataviews/actions/duplicate-template-part.d.ts +5 -0
  309. package/build-types/dataviews/actions/duplicate-template-part.d.ts.map +1 -0
  310. package/build-types/dataviews/actions/export-pattern.d.ts.map +1 -1
  311. package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +1 -1
  312. package/build-types/dataviews/actions/rename-post.d.ts +5 -0
  313. package/build-types/dataviews/actions/rename-post.d.ts.map +1 -0
  314. package/build-types/dataviews/actions/reorder-page.d.ts +8 -0
  315. package/build-types/dataviews/actions/reorder-page.d.ts.map +1 -0
  316. package/build-types/dataviews/actions/reorder-page.native.d.ts +3 -0
  317. package/build-types/dataviews/actions/reorder-page.native.d.ts.map +1 -0
  318. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -1
  319. package/build-types/dataviews/actions/trash-post.d.ts.map +1 -1
  320. package/build-types/dataviews/actions/utils.d.ts +5 -3
  321. package/build-types/dataviews/actions/utils.d.ts.map +1 -1
  322. package/build-types/dataviews/actions/view-post-revisions.d.ts +8 -0
  323. package/build-types/dataviews/actions/view-post-revisions.d.ts.map +1 -0
  324. package/build-types/dataviews/actions/view-post.d.ts +8 -0
  325. package/build-types/dataviews/actions/view-post.d.ts.map +1 -0
  326. package/build-types/dataviews/fields/index.d.ts +8 -0
  327. package/build-types/dataviews/fields/index.d.ts.map +1 -0
  328. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  329. package/build-types/dataviews/types.d.ts +57 -8
  330. package/build-types/dataviews/types.d.ts.map +1 -1
  331. package/build-types/store/private-actions.d.ts.map +1 -1
  332. package/build-types/store/utils/is-template-revertable.d.ts.map +1 -1
  333. package/package.json +36 -36
  334. package/src/bindings/post-meta.js +14 -8
  335. package/src/components/block-manager/index.js +2 -0
  336. package/src/components/block-manager/style.scss +2 -2
  337. package/src/components/block-settings-menu/content-only-settings-menu.js +5 -9
  338. package/src/components/create-template-part-modal/index.js +1 -0
  339. package/src/components/create-template-part-modal/style.scss +1 -1
  340. package/src/components/document-bar/index.js +4 -4
  341. package/src/components/document-outline/style.scss +1 -1
  342. package/src/components/editor-history/redo.js +2 -0
  343. package/src/components/editor-history/undo.js +2 -0
  344. package/src/components/editor-interface/index.js +2 -4
  345. package/src/components/error-boundary/index.js +6 -1
  346. package/src/components/error-boundary/style.native.scss +1 -1
  347. package/src/components/error-boundary/style.scss +1 -1
  348. package/src/components/global-styles-provider/index.js +16 -3
  349. package/src/components/header/style.scss +6 -3
  350. package/src/components/index.js +1 -0
  351. package/src/components/inserter-sidebar/index.js +12 -5
  352. package/src/components/local-autosave-monitor/index.js +6 -6
  353. package/src/components/page-attributes/parent.js +18 -13
  354. package/src/components/plugin-preview-menu-item/index.js +52 -0
  355. package/src/components/post-actions/actions.js +5 -616
  356. package/src/components/post-actions/index.js +24 -34
  357. package/src/components/post-card-panel/index.js +28 -27
  358. package/src/components/post-card-panel/style.scss +1 -1
  359. package/src/components/post-discussion/style.scss +0 -9
  360. package/src/components/post-excerpt/panel.js +2 -0
  361. package/src/components/post-featured-image/index.js +8 -0
  362. package/src/components/post-featured-image/style.scss +1 -2
  363. package/src/components/post-format/index.js +2 -0
  364. package/src/components/post-format/style.scss +0 -6
  365. package/src/components/post-last-revision/index.js +2 -0
  366. package/src/components/post-locked-modal/index.js +14 -2
  367. package/src/components/post-locked-modal/style.scss +1 -1
  368. package/src/components/post-publish-panel/index.js +2 -0
  369. package/src/components/post-publish-panel/maybe-post-format-panel.js +2 -0
  370. package/src/components/post-publish-panel/maybe-upload-media.js +37 -29
  371. package/src/components/post-publish-panel/postpublish.js +8 -2
  372. package/src/components/post-publish-panel/style.scss +3 -1
  373. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +8 -8
  374. package/src/components/post-slug/index.js +1 -0
  375. package/src/components/post-status/index.js +3 -2
  376. package/src/components/post-status/style.scss +0 -19
  377. package/src/components/post-taxonomies/hierarchical-term-selector.js +5 -1
  378. package/src/components/post-taxonomies/most-used-terms.js +2 -0
  379. package/src/components/post-template/block-theme.js +15 -9
  380. package/src/components/post-template/classic-theme.js +2 -0
  381. package/src/components/post-title/index.js +30 -41
  382. package/src/components/post-url/index.js +17 -9
  383. package/src/components/preview-dropdown/index.js +28 -20
  384. package/src/components/provider/use-block-editor-settings.js +5 -5
  385. package/src/components/resizable-editor/style.scss +2 -2
  386. package/src/components/save-publish-panels/index.js +4 -0
  387. package/src/components/save-publish-panels/style.scss +3 -3
  388. package/src/components/sidebar/post-summary.js +20 -16
  389. package/src/components/site-discussion/style.scss +0 -14
  390. package/src/components/start-template-options/index.js +6 -1
  391. package/src/components/table-of-contents/index.js +2 -0
  392. package/src/components/template-content-panel/index.js +4 -1
  393. package/src/components/text-editor/index.js +2 -0
  394. package/src/components/visual-editor/index.js +2 -9
  395. package/src/dataviews/actions/duplicate-pattern.tsx +40 -0
  396. package/src/dataviews/actions/duplicate-post.native.tsx +3 -0
  397. package/src/dataviews/actions/duplicate-post.tsx +174 -0
  398. package/src/dataviews/actions/duplicate-template-part.tsx +70 -0
  399. package/src/dataviews/actions/export-pattern.tsx +2 -0
  400. package/src/dataviews/actions/permanently-delete-post.tsx +2 -0
  401. package/src/dataviews/actions/rename-post.tsx +146 -0
  402. package/src/dataviews/actions/reorder-page.native.tsx +3 -0
  403. package/src/dataviews/actions/reorder-page.tsx +125 -0
  404. package/src/dataviews/actions/reset-post.tsx +6 -1
  405. package/src/dataviews/actions/trash-post.tsx +4 -0
  406. package/src/dataviews/actions/utils.ts +14 -4
  407. package/src/dataviews/actions/view-post-revisions.tsx +47 -0
  408. package/src/dataviews/actions/view-post.tsx +30 -0
  409. package/src/dataviews/fields/index.ts +26 -0
  410. package/src/dataviews/store/private-actions.ts +42 -1
  411. package/src/dataviews/types.ts +47 -6
  412. package/src/private-apis.js +2 -2
  413. package/src/store/private-actions.js +4 -2
  414. package/src/store/utils/is-template-revertable.js +2 -1
  415. package/tsconfig.tsbuildinfo +1 -1
@@ -166,7 +166,10 @@ export default function PostLockedModal() {
166
166
  focusOnMount: true,
167
167
  shouldCloseOnClickOutside: false,
168
168
  shouldCloseOnEsc: false,
169
- isDismissible: false,
169
+ isDismissible: false
170
+ // Do not remove this class, as this class is used by third party plugins.
171
+ ,
172
+ className: "editor-post-locked-modal",
170
173
  size: "medium",
171
174
  children: /*#__PURE__*/_jsxs(HStack, {
172
175
  alignment: "top",
@@ -203,11 +206,17 @@ export default function PostLockedModal() {
203
206
  }), /*#__PURE__*/_jsxs(HStack, {
204
207
  className: "editor-post-locked-modal__buttons",
205
208
  justify: "flex-end",
206
- children: [!isTakeover && /*#__PURE__*/_jsx(Button, {
209
+ children: [!isTakeover && /*#__PURE__*/_jsx(Button
210
+ // TODO: Switch to `true` (40px size) if possible
211
+ , {
212
+ __next40pxDefaultSize: false,
207
213
  variant: "tertiary",
208
214
  href: unlockUrl,
209
215
  children: __('Take over')
210
- }), /*#__PURE__*/_jsx(Button, {
216
+ }), /*#__PURE__*/_jsx(Button
217
+ // TODO: Switch to `true` (40px size) if possible
218
+ , {
219
+ __next40pxDefaultSize: false,
211
220
  variant: "primary",
212
221
  href: allPostsUrl,
213
222
  children: allPostsLabel
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","Modal","Button","ExternalLink","__experimentalHStack","HStack","useSelect","useDispatch","addQueryArgs","useEffect","createInterpolateElement","addAction","removeAction","useInstanceId","store","coreStore","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PostLockedModal","instanceId","hookName","autosave","updatePostLock","isLocked","isTakeover","user","postId","postLockUtils","activePostLock","postType","previewLink","select","isPostLocked","isPostLockTakeover","getPostLockUser","getCurrentPostId","getActivePostLock","getEditedPostAttribute","getEditedPostPreviewLink","getEditorSettings","getPostType","sendPostLock","data","lock","post_id","receivePostLock","received","lock_error","name","avatar","avatar_src_2x","new_lock","releasePostLock","window","FormData","append","unlockNonce","navigator","sendBeacon","ajaxUrl","xhr","XMLHttpRequest","open","send","addEventListener","removeEventListener","userDisplayName","userAvatar","unlockUrl","lockKey","post","action","_wpnonce","nonce","allPostsUrl","post_type","slug","allPostsLabel","title","focusOnMount","shouldCloseOnClickOutside","shouldCloseOnEsc","isDismissible","size","children","alignment","spacing","src","alt","className","width","height","strong","PreviewLink","href","justify","variant"],"sources":["@wordpress/editor/src/components/post-locked-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * A modal component that is displayed when a post is locked for editing by another user.\n * The modal provides information about the lock status and options to take over or exit the editor.\n *\n * @return {JSX.Element|null} The rendered PostLockedModal component.\n */\nexport default function PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button variant=\"tertiary\" href={ unlockUrl }>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button variant=\"primary\" href={ allPostsUrl }>\n\t\t\t\t\t\t\t{ allPostsLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</div>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;A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eACA,CAAC,GACDxE,EAAE,CACF,mIACA,CAAC,EACJ;YACCkG,MAAM,eAAE/E,IAAA,aAAS,CAAC;YAClBgF,WAAW,eACVhF,IAAA,CAACf,YAAY;cAACgG,IAAI,EAAGhE,WAAa;cAAAsD,QAAA,EAC/B1F,EAAE,CAAE,SAAU;YAAC,CACJ;UAEhB,CACD;QAAC,CACC,CACH,EACC,CAAE8B,UAAU,iBACbP,KAAA,CAAAF,SAAA;UAAAqE,QAAA,gBACCvE,IAAA;YAAAuE,QAAA,EACG/E,wBAAwB,CACzB6D,eAAe,GACZvE,OAAO,EACP;YACAD,EAAE,CACD,qIACD,CAAC,EACDwE,eACA,CAAC,GACDxE,EAAE,CACF,8HACA,CAAC,EACJ;cACCkG,MAAM,eAAE/E,IAAA,aAAS,CAAC;cAClBgF,WAAW,eACVhF,IAAA,CAACf,YAAY;gBAACgG,IAAI,EAAGhE,WAAa;gBAAAsD,QAAA,EAC/B1F,EAAE,CAAE,SAAU;cAAC,CACJ;YAEhB,CACD;UAAC,CACC,CAAC,eACJmB,IAAA;YAAAuE,QAAA,EACG1F,EAAE,CACH,0GACD;UAAC,CACC,CAAC;QAAA,CACH,CACF,eAEDuB,KAAA,CAACjB,MAAM;UACNyF,SAAS,EAAC,mCAAmC;UAC7CM,OAAO,EAAC,UAAU;UAAAX,QAAA,GAEhB,CAAE5D,UAAU,iBACbX,IAAA,CAAChB,MAAM;YAACmG,OAAO,EAAC,UAAU;YAACF,IAAI,EAAG1B,SAAW;YAAAgB,QAAA,EAC1C1F,EAAE,CAAE,WAAY;UAAC,CACZ,CACR,eACDmB,IAAA,CAAChB,MAAM;YAACmG,OAAO,EAAC,SAAS;YAACF,IAAI,EAAGpB,WAAa;YAAAU,QAAA,EAC3CP;UAAa,CACR,CAAC;QAAA,CACF,CAAC;MAAA,CACL,CAAC;IAAA,CACC;EAAC,CACH,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","Modal","Button","ExternalLink","__experimentalHStack","HStack","useSelect","useDispatch","addQueryArgs","useEffect","createInterpolateElement","addAction","removeAction","useInstanceId","store","coreStore","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PostLockedModal","instanceId","hookName","autosave","updatePostLock","isLocked","isTakeover","user","postId","postLockUtils","activePostLock","postType","previewLink","select","isPostLocked","isPostLockTakeover","getPostLockUser","getCurrentPostId","getActivePostLock","getEditedPostAttribute","getEditedPostPreviewLink","getEditorSettings","getPostType","sendPostLock","data","lock","post_id","receivePostLock","received","lock_error","name","avatar","avatar_src_2x","new_lock","releasePostLock","window","FormData","append","unlockNonce","navigator","sendBeacon","ajaxUrl","xhr","XMLHttpRequest","open","send","addEventListener","removeEventListener","userDisplayName","userAvatar","unlockUrl","lockKey","post","action","_wpnonce","nonce","allPostsUrl","post_type","slug","allPostsLabel","title","focusOnMount","shouldCloseOnClickOutside","shouldCloseOnEsc","isDismissible","className","size","children","alignment","spacing","src","alt","width","height","strong","PreviewLink","href","justify","__next40pxDefaultSize","variant"],"sources":["@wordpress/editor/src/components/post-locked-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * A modal component that is displayed when a post is locked for editing by another user.\n * The modal provides information about the lock status and options to take over or exit the editor.\n *\n * @return {JSX.Element|null} The rendered PostLockedModal component.\n */\nexport default function PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\t// Do not remove this class, as this class is used by third party plugins.\n\t\t\tclassName=\"editor-post-locked-modal\"\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\thref={ unlockUrl }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\thref={ allPostsUrl }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ allPostsLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</div>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAA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List":[]}
@@ -70,7 +70,10 @@ export class PostPublishPanel extends Component {
70
70
  ...propsForPanel,
71
71
  children: [/*#__PURE__*/_jsx("div", {
72
72
  className: "editor-post-publish-panel__header",
73
- children: isPostPublish ? /*#__PURE__*/_jsx(Button, {
73
+ children: isPostPublish ? /*#__PURE__*/_jsx(Button
74
+ // TODO: Switch to `true` (40px size) if possible
75
+ , {
76
+ __next40pxDefaultSize: false,
74
77
  onClick: onClose,
75
78
  icon: closeSmall,
76
79
  label: __('Close panel')
@@ -1 +1 @@
1
- {"version":3,"names":["__","Component","Button","Spinner","CheckboxControl","withFocusReturn","withConstrainedTabbing","withSelect","withDispatch","compose","closeSmall","store","coreStore","PostPublishButton","PostPublishPanelPrepublish","PostPublishPanelPostpublish","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PostPublishPanel","constructor","arguments","onSubmit","bind","componentDidUpdate","prevProps","isPublished","props","isSaving","isDirty","onClose","hasPublishAction","isPostTypeViewable","render","forceIsDirty","isBeingScheduled","isPublishSidebarEnabled","isScheduled","isSavingNonPostEntityChanges","onTogglePublishSidebar","PostPublishExtension","PrePublishExtension","additionalProps","propsForPanel","isPublishedOrScheduled","isPrePublish","isPostPublish","className","children","onClick","icon","label","focusOnMount","accessibleWhenDisabled","disabled","variant","size","__nextHasNoMarginBottom","checked","onChange","select","_getCurrentPost$_link","getPostType","getCurrentPost","getEditedPostAttribute","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostBeingScheduled","isEditedPostDirty","isAutosavingPost","isSavingPost","postType","_links","viewable","dispatch","disablePublishSidebar","enablePublishSidebar"],"sources":["@wordpress/editor/src/components/post-publish-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport {\n\tButton,\n\tSpinner,\n\tCheckboxControl,\n\twithFocusReturn,\n\twithConstrainedTabbing,\n} from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } 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\nexport class PostPublishPanel extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.onSubmit = this.onSubmit.bind( this );\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Automatically collapse the publish sidebar when a post\n\t\t// is published and the user makes an edit.\n\t\tif (\n\t\t\tprevProps.isPublished &&\n\t\t\t! this.props.isSaving &&\n\t\t\tthis.props.isDirty\n\t\t) {\n\t\t\tthis.props.onClose();\n\t\t}\n\t}\n\n\tonSubmit() {\n\t\tconst { onClose, hasPublishAction, isPostTypeViewable } = this.props;\n\t\tif ( ! hasPublishAction || ! isPostTypeViewable ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\tisBeingScheduled,\n\t\t\tisPublished,\n\t\t\tisPublishSidebarEnabled,\n\t\t\tisScheduled,\n\t\t\tisSaving,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tonClose,\n\t\t\tonTogglePublishSidebar,\n\t\t\tPostPublishExtension,\n\t\t\tPrePublishExtension,\n\t\t\t...additionalProps\n\t\t} = this.props;\n\t\tconst {\n\t\t\thasPublishAction,\n\t\t\tisDirty,\n\t\t\tisPostTypeViewable,\n\t\t\t...propsForPanel\n\t\t} = additionalProps;\n\t\tconst isPublishedOrScheduled =\n\t\t\tisPublished || ( isScheduled && isBeingScheduled );\n\t\tconst isPrePublish = ! isPublishedOrScheduled && ! isSaving;\n\t\tconst isPostPublish = isPublishedOrScheduled && ! isSaving;\n\t\treturn (\n\t\t\t<div className=\"editor-post-publish-panel\" { ...propsForPanel }>\n\t\t\t\t<div className=\"editor-post-publish-panel__header\">\n\t\t\t\t\t{ isPostPublish ? (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-publish-button\">\n\t\t\t\t\t\t\t\t<PostPublishButton\n\t\t\t\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\t\t\t\tonSubmit={ this.onSubmit }\n\t\t\t\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-cancel-button\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ isSavingNonPostEntityChanges }\n\t\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__content\">\n\t\t\t\t\t{ isPrePublish && (\n\t\t\t\t\t\t<PostPublishPanelPrepublish>\n\t\t\t\t\t\t\t{ PrePublishExtension && <PrePublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPrepublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isPostPublish && (\n\t\t\t\t\t\t<PostPublishPanelPostpublish focusOnMount>\n\t\t\t\t\t\t\t{ PostPublishExtension && <PostPublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPostpublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isSaving && <Spinner /> }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__footer\">\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Always show pre-publish checks.' ) }\n\t\t\t\t\t\tchecked={ isPublishSidebarEnabled }\n\t\t\t\t\t\tonChange={ onTogglePublishSidebar }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\n/**\n * Renders a panel for publishing a post.\n */\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst {\n\t\t\tgetCurrentPost,\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,\n\t\t} = select( editorStore );\n\t\tconst { isPublishSidebarEnabled } = 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};\n\t} ),\n\twithDispatch( ( dispatch, { isPublishSidebarEnabled } ) => {\n\t\tconst { disablePublishSidebar, enablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonTogglePublishSidebar: () => {\n\t\t\t\tif ( isPublishSidebarEnabled ) {\n\t\t\t\t\tdisablePublishSidebar();\n\t\t\t\t} else {\n\t\t\t\t\tenablePublishSidebar();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t} ),\n\twithFocusReturn,\n\twithConstrainedTabbing,\n] )( PostPublishPanel );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SACCC,MAAM,EACNC,OAAO,EACPC,eAAe,EACfC,eAAe,EACfC,sBAAsB,QAChB,uBAAuB;AAC9B,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,0BAA0B,MAAM,cAAc;AACrD,OAAOC,2BAA2B,MAAM,eAAe;AACvD,SAASJ,KAAK,IAAIK,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEnD,OAAO,MAAMC,gBAAgB,SAAStB,SAAS,CAAC;EAC/CuB,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IACrB,IAAI,CAACC,QAAQ,GAAG,IAAI,CAACA,QAAQ,CAACC,IAAI,CAAE,IAAK,CAAC;EAC3C;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B;IACA;IACA,IACCA,SAAS,CAACC,WAAW,IACrB,CAAE,IAAI,CAACC,KAAK,CAACC,QAAQ,IACrB,IAAI,CAACD,KAAK,CAACE,OAAO,EACjB;MACD,IAAI,CAACF,KAAK,CAACG,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[]}
1
+ {"version":3,"names":["__","Component","Button","Spinner","CheckboxControl","withFocusReturn","withConstrainedTabbing","withSelect","withDispatch","compose","closeSmall","store","coreStore","PostPublishButton","PostPublishPanelPrepublish","PostPublishPanelPostpublish","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PostPublishPanel","constructor","arguments","onSubmit","bind","componentDidUpdate","prevProps","isPublished","props","isSaving","isDirty","onClose","hasPublishAction","isPostTypeViewable","render","forceIsDirty","isBeingScheduled","isPublishSidebarEnabled","isScheduled","isSavingNonPostEntityChanges","onTogglePublishSidebar","PostPublishExtension","PrePublishExtension","additionalProps","propsForPanel","isPublishedOrScheduled","isPrePublish","isPostPublish","className","children","__next40pxDefaultSize","onClick","icon","label","focusOnMount","accessibleWhenDisabled","disabled","variant","size","__nextHasNoMarginBottom","checked","onChange","select","_getCurrentPost$_link","getPostType","getCurrentPost","getEditedPostAttribute","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostBeingScheduled","isEditedPostDirty","isAutosavingPost","isSavingPost","postType","_links","viewable","dispatch","disablePublishSidebar","enablePublishSidebar"],"sources":["@wordpress/editor/src/components/post-publish-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport {\n\tButton,\n\tSpinner,\n\tCheckboxControl,\n\twithFocusReturn,\n\twithConstrainedTabbing,\n} from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } 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\nexport class PostPublishPanel extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.onSubmit = this.onSubmit.bind( this );\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Automatically collapse the publish sidebar when a post\n\t\t// is published and the user makes an edit.\n\t\tif (\n\t\t\tprevProps.isPublished &&\n\t\t\t! this.props.isSaving &&\n\t\t\tthis.props.isDirty\n\t\t) {\n\t\t\tthis.props.onClose();\n\t\t}\n\t}\n\n\tonSubmit() {\n\t\tconst { onClose, hasPublishAction, isPostTypeViewable } = this.props;\n\t\tif ( ! hasPublishAction || ! isPostTypeViewable ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\tisBeingScheduled,\n\t\t\tisPublished,\n\t\t\tisPublishSidebarEnabled,\n\t\t\tisScheduled,\n\t\t\tisSaving,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tonClose,\n\t\t\tonTogglePublishSidebar,\n\t\t\tPostPublishExtension,\n\t\t\tPrePublishExtension,\n\t\t\t...additionalProps\n\t\t} = this.props;\n\t\tconst {\n\t\t\thasPublishAction,\n\t\t\tisDirty,\n\t\t\tisPostTypeViewable,\n\t\t\t...propsForPanel\n\t\t} = additionalProps;\n\t\tconst isPublishedOrScheduled =\n\t\t\tisPublished || ( isScheduled && isBeingScheduled );\n\t\tconst isPrePublish = ! isPublishedOrScheduled && ! isSaving;\n\t\tconst isPostPublish = isPublishedOrScheduled && ! isSaving;\n\t\treturn (\n\t\t\t<div className=\"editor-post-publish-panel\" { ...propsForPanel }>\n\t\t\t\t<div className=\"editor-post-publish-panel__header\">\n\t\t\t\t\t{ isPostPublish ? (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-publish-button\">\n\t\t\t\t\t\t\t\t<PostPublishButton\n\t\t\t\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\t\t\t\tonSubmit={ this.onSubmit }\n\t\t\t\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-cancel-button\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ isSavingNonPostEntityChanges }\n\t\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__content\">\n\t\t\t\t\t{ isPrePublish && (\n\t\t\t\t\t\t<PostPublishPanelPrepublish>\n\t\t\t\t\t\t\t{ PrePublishExtension && <PrePublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPrepublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isPostPublish && (\n\t\t\t\t\t\t<PostPublishPanelPostpublish focusOnMount>\n\t\t\t\t\t\t\t{ PostPublishExtension && <PostPublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPostpublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isSaving && <Spinner /> }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__footer\">\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Always show pre-publish checks.' ) }\n\t\t\t\t\t\tchecked={ isPublishSidebarEnabled }\n\t\t\t\t\t\tonChange={ onTogglePublishSidebar }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\n/**\n * Renders a panel for publishing a post.\n */\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst {\n\t\t\tgetCurrentPost,\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,\n\t\t} = select( editorStore );\n\t\tconst { isPublishSidebarEnabled } = 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};\n\t} ),\n\twithDispatch( ( dispatch, { isPublishSidebarEnabled } ) => {\n\t\tconst { disablePublishSidebar, enablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonTogglePublishSidebar: () => {\n\t\t\t\tif ( isPublishSidebarEnabled ) {\n\t\t\t\t\tdisablePublishSidebar();\n\t\t\t\t} else {\n\t\t\t\t\tenablePublishSidebar();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t} ),\n\twithFocusReturn,\n\twithConstrainedTabbing,\n] )( PostPublishP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D,MAAM4D,QAAQ,GAAGT,WAAW,CAAEE,sBAAsB,CAAE,MAAO,CAAE,CAAC;EAEhE,OAAO;IACNlC,gBAAgB,GAAA+B,qBAAA,GACfE,cAAc,CAAC,CAAC,CAACS,MAAM,GAAI,mBAAmB,CAAE,cAAAX,qBAAA,cAAAA,qBAAA,GAAI,KAAK;IAC1D9B,kBAAkB,EAAEwC,QAAQ,EAAEE,QAAQ;IACtCvC,gBAAgB,EAAEiC,0BAA0B,CAAC,CAAC;IAC9CvC,OAAO,EAAEwC,iBAAiB,CAAC,CAAC;IAC5B3C,WAAW,EAAEwC,sBAAsB,CAAC,CAAC;IACrC9B,uBAAuB,EAAEA,uBAAuB,CAAC,CAAC;IAClDR,QAAQ,EAAE2C,YAAY,CAAC,CAAC,IAAI,CAAED,gBAAgB,CAAC,CAAC;IAChDhC,4BAA4B,EAAEA,4BAA4B,CAAC,CAAC;IAC5DD,WAAW,EAAE8B,sBAAsB,CAAC;EACrC,CAAC;AACF,CAAE,CAAC,EACH/D,YAAY,CAAE,CAAEuE,QAAQ,EAAE;EAAEvC;AAAwB,CAAC,KAAM;EAC1D,MAAM;IAAEwC,qBAAqB;IAAEC;EAAqB,CAAC,GACpDF,QAAQ,CAAE/D,WAAY,CAAC;EACxB,OAAO;IACN2B,sBAAsB,EAAEA,CAAA,KAAM;MAC7B,IAAKH,uBAAuB,EAAG;QAC9BwC,qBAAqB,CAAC,CAAC;MACxB,CAAC,MAAM;QACNC,oBAAoB,CAAC,CAAC;MACvB;IACD;EACD,CAAC;AACF,CAAE,CAAC,EACH5E,eAAe,EACfC,sBAAsB,CACrB,CAAC,CAAEiB,gBAAiB,CAAC","ignoreList":[]}
@@ -21,7 +21,10 @@ const PostFormatSuggestion = ({
21
21
  suggestedPostFormat,
22
22
  suggestionText,
23
23
  onUpdatePostFormat
24
- }) => /*#__PURE__*/_jsx(Button, {
24
+ }) => /*#__PURE__*/_jsx(Button
25
+ // TODO: Switch to `true` (40px size) if possible
26
+ , {
27
+ __next40pxDefaultSize: false,
25
28
  variant: "link",
26
29
  onClick: () => onUpdatePostFormat(suggestedPostFormat),
27
30
  children: suggestionText
@@ -1 +1 @@
1
- {"version":3,"names":["Button","PanelBody","useDispatch","useSelect","__","sprintf","store","coreStore","POST_FORMATS","editorStore","jsx","_jsx","jsxs","_jsxs","getSuggestion","supportedFormats","suggestedPostFormat","formats","filter","format","includes","id","find","PostFormatSuggestion","suggestionText","onUpdatePostFormat","variant","onClick","children","PostFormatPanel","currentPostFormat","suggestion","select","_select$getThemeSuppo","getEditedPostAttribute","getSuggestedPostFormat","getThemeSupports","editPost","panelBodyTitle","className","initialOpen","title","caption"],"sources":["@wordpress/editor/src/components/post-publish-panel/maybe-post-format-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, PanelBody } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { POST_FORMATS } from '../post-format';\nimport { store as editorStore } from '../../store';\n\nconst getSuggestion = ( supportedFormats, suggestedPostFormat ) => {\n\tconst formats = POST_FORMATS.filter( ( format ) =>\n\t\tsupportedFormats?.includes( format.id )\n\t);\n\treturn formats.find( ( format ) => format.id === suggestedPostFormat );\n};\n\nconst PostFormatSuggestion = ( {\n\tsuggestedPostFormat,\n\tsuggestionText,\n\tonUpdatePostFormat,\n} ) => (\n\t<Button\n\t\tvariant=\"link\"\n\t\tonClick={ () => onUpdatePostFormat( suggestedPostFormat ) }\n\t>\n\t\t{ suggestionText }\n\t</Button>\n);\n\nexport default function PostFormatPanel() {\n\tconst { currentPostFormat, suggestion } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getSuggestedPostFormat } =\n\t\t\tselect( editorStore );\n\t\tconst supportedFormats =\n\t\t\tselect( coreStore ).getThemeSupports().formats ?? [];\n\t\treturn {\n\t\t\tcurrentPostFormat: getEditedPostAttribute( 'format' ),\n\t\t\tsuggestion: getSuggestion(\n\t\t\t\tsupportedFormats,\n\t\t\t\tgetSuggestedPostFormat()\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst onUpdatePostFormat = ( format ) => editPost( { format } );\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'Use a post format' ) }\n\t\t</span>,\n\t];\n\n\tif ( ! suggestion || suggestion.id === currentPostFormat ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody initialOpen={ false } title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<PostFormatSuggestion\n\t\t\t\t\tonUpdatePostFormat={ onUpdatePostFormat }\n\t\t\t\t\tsuggestedPostFormat={ suggestion.id }\n\t\t\t\t\tsuggestionText={ sprintf(\n\t\t\t\t\t\t/* translators: %s: post format */\n\t\t\t\t\t\t__( 'Apply the \"%1$s\" format.' ),\n\t\t\t\t\t\tsuggestion.caption\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</p>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,SAAS,QAAQ,uBAAuB;AACzD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,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E/D,MAAMmB,cAAc,GAAG,CACtBlC,EAAE,CAAE,aAAc,CAAC,eACnBO,IAAA;IAAM4B,SAAS,EAAC,iCAAiC;IAAAX,QAAA,EAC9CxB,EAAE,CAAE,mBAAoB;EAAC,GAD0B,OAEhD,CAAC,CACP;EAED,IAAK,CAAE2B,UAAU,IAAIA,UAAU,CAACV,EAAE,KAAKS,iBAAiB,EAAG;IAC1D,OAAO,IAAI;EACZ;EAEA,oBACCjB,KAAA,CAACZ,SAAS;IAACuC,WAAW,EAAG,KAAO;IAACC,KAAK,EAAGH,cAAgB;IAAAV,QAAA,gBACxDjB,IAAA;MAAAiB,QAAA,EACGxB,EAAE,CACH,+IACD;IAAC,CACC,CAAC,eACJO,IAAA;MAAAiB,QAAA,eACCjB,IAAA,CAACY,oBAAoB;QACpBE,kBAAkB,EAAGA,kBAAoB;QACzCT,mBAAmB,EAAGe,UAAU,CAACV,EAAI;QACrCG,cAAc,EAAGnB,OAAO,EACvB;QACAD,EAAE,CAAE,0BAA2B,CAAC,EAChC2B,UAAU,CAACW,OACZ;MAAG,CACH;IAAC,CACA,CAAC;EAAA,CACM,CAAC;AAEd","ignoreList":[]}
1
+ {"version":3,"names":["Button","PanelBody","useDispatch","useSelect","__","sprintf","store","coreStore","POST_FORMATS","editorStore","jsx","_jsx","jsxs","_jsxs","getSuggestion","supportedFormats","suggestedPostFormat","formats","filter","format","includes","id","find","PostFormatSuggestion","suggestionText","onUpdatePostFormat","__next40pxDefaultSize","variant","onClick","children","PostFormatPanel","currentPostFormat","suggestion","select","_select$getThemeSuppo","getEditedPostAttribute","getSuggestedPostFormat","getThemeSupports","editPost","panelBodyTitle","className","initialOpen","title","caption"],"sources":["@wordpress/editor/src/components/post-publish-panel/maybe-post-format-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, PanelBody } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { POST_FORMATS } from '../post-format';\nimport { store as editorStore } from '../../store';\n\nconst getSuggestion = ( supportedFormats, suggestedPostFormat ) => {\n\tconst formats = POST_FORMATS.filter( ( format ) =>\n\t\tsupportedFormats?.includes( format.id )\n\t);\n\treturn formats.find( ( format ) => format.id === suggestedPostFormat );\n};\n\nconst PostFormatSuggestion = ( {\n\tsuggestedPostFormat,\n\tsuggestionText,\n\tonUpdatePostFormat,\n} ) => (\n\t<Button\n\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t__next40pxDefaultSize={ false }\n\t\tvariant=\"link\"\n\t\tonClick={ () => onUpdatePostFormat( suggestedPostFormat ) }\n\t>\n\t\t{ suggestionText }\n\t</Button>\n);\n\nexport default function PostFormatPanel() {\n\tconst { currentPostFormat, suggestion } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getSuggestedPostFormat } =\n\t\t\tselect( editorStore );\n\t\tconst supportedFormats =\n\t\t\tselect( coreStore ).getThemeSupports().formats ?? [];\n\t\treturn {\n\t\t\tcurrentPostFormat: getEditedPostAttribute( 'format' ),\n\t\t\tsuggestion: getSuggestion(\n\t\t\t\tsupportedFormats,\n\t\t\t\tgetSuggestedPostFormat()\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst onUpdatePostFormat = ( format ) => editPost( { format } );\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'Use a post format' ) }\n\t\t</span>,\n\t];\n\n\tif ( ! suggestion || suggestion.id === currentPostFormat ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody initialOpen={ false } title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<PostFormatSuggestion\n\t\t\t\t\tonUpdatePostFormat={ onUpdatePostFormat }\n\t\t\t\t\tsuggestedPostFormat={ suggestion.id }\n\t\t\t\t\tsuggestionText={ sprintf(\n\t\t\t\t\t\t/* translators: %s: post format */\n\t\t\t\t\t\t__( 'Apply the \"%1$s\" format.' ),\n\t\t\t\t\t\tsuggestion.caption\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</p>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,SAAS,QAAQ,uBAAuB;AACzD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEnD,MAAMC,aAAa,GAAGA,CAAEC,gBAAgB,EAAEC,mBAAmB,KAAM;EAClE,MAAMC,OAAO,GAAGT,YAAY,CAACU,MAAM,CAAIC,MAAM,IAC5CJ,gBAAgB,EAAEK,QAAQ,CAAED,MAAM,CAACE,EAAG,CACvC,CAAC;EACD,OAAOJ,OAAO,CAACK,IAAI,CAAIH,MAAM,IAAMA,MAAM,CAACE,EAAE,KAAKL,mBAAoB,CAAC;AACvE,CAAC;AAED,MAAMO,oBAAoB,GAAGA,CAAE;EAC9BP,mBAAmB;EACnBQ,cAAc;EACdC;AACD,CAAC,kBACAd,IAAA,CAACX;AACA;AAAA;EACA0B,qBAAqB,EAAG,KAAO;EAC/BC,OAAO,EAAC,MAAM;EACdC,OAAO,EAAGA,CAAA,KAAMH,kBAAkB,CAAET,mBAAoB,CAAG;EAAAa,QAAA,EA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GA,kBAAoB;QACzCT,mBAAmB,EAAGgB,UAAU,CAACX,EAAI;QACrCG,cAAc,EAAGnB,OAAO,EACvB;QACAD,EAAE,CAAE,0BAA2B,CAAC,EAChC4B,UAAU,CAACW,OACZ;MAAG,CACH;IAAC,CACA,CAAC;EAAA,CACM,CAAC;AAEd","ignoreList":[]}
@@ -7,11 +7,6 @@ import { __ } from '@wordpress/i18n';
7
7
  import { store as blockEditorStore } from '@wordpress/block-editor';
8
8
  import { useState } from '@wordpress/element';
9
9
  import { isBlobURL } from '@wordpress/blob';
10
-
11
- /**
12
- * Internal dependencies
13
- */
14
- import { store as editorStore } from '../../store';
15
10
  import { jsx as _jsx } from "react/jsx-runtime";
16
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
17
12
  function flattenBlocks(blocks) {
@@ -62,11 +57,13 @@ function Image(block) {
62
57
  }
63
58
  export default function PostFormatPanel() {
64
59
  const [isUploading, setIsUploading] = useState(false);
60
+ const [isAnimating, setIsAnimating] = useState(false);
61
+ const [hadUploadError, setHadUploadError] = useState(false);
65
62
  const {
66
63
  editorBlocks,
67
64
  mediaUpload
68
65
  } = useSelect(select => ({
69
- editorBlocks: select(editorStore).getEditorBlocks(),
66
+ editorBlocks: select(blockEditorStore).getBlocks(),
70
67
  mediaUpload: select(blockEditorStore).getSettings().mediaUpload
71
68
  }), []);
72
69
  const externalImages = flattenBlocks(editorBlocks).filter(block => block.name === 'core/image' && block.attributes.url && !block.attributes.id);
@@ -82,6 +79,7 @@ export default function PostFormatPanel() {
82
79
  }, "label")];
83
80
  function uploadImages() {
84
81
  setIsUploading(true);
82
+ setHadUploadError(false);
85
83
  Promise.all(externalImages.map(image => window.fetch(image.attributes.url.includes('?') ? image.attributes.url : image.attributes.url + '?').then(response => response.blob()).then(blob => new Promise((resolve, reject) => {
86
84
  mediaUpload({
87
85
  filesList: [blob],
@@ -99,7 +97,9 @@ export default function PostFormatPanel() {
99
97
  reject();
100
98
  }
101
99
  });
102
- })))).finally(() => {
100
+ }).then(() => setIsAnimating(true))).catch(() => {
101
+ setHadUploadError(true);
102
+ }))).finally(() => {
103
103
  setIsUploading(false);
104
104
  });
105
105
  }
@@ -115,16 +115,22 @@ export default function PostFormatPanel() {
115
115
  gap: '8px'
116
116
  },
117
117
  children: [/*#__PURE__*/_jsx(AnimatePresence, {
118
+ onExitComplete: () => setIsAnimating(false),
118
119
  children: externalImages.map(image => {
119
120
  return /*#__PURE__*/_jsx(Image, {
120
121
  ...image
121
122
  }, image.clientId);
122
123
  })
123
- }), isUploading ? /*#__PURE__*/_jsx(Spinner, {}) : /*#__PURE__*/_jsx(Button, {
124
+ }), isUploading || isAnimating ? /*#__PURE__*/_jsx(Spinner, {}) : /*#__PURE__*/_jsx(Button
125
+ // TODO: Switch to `true` (40px size) if possible
126
+ , {
127
+ __next40pxDefaultSize: false,
124
128
  variant: "primary",
125
129
  onClick: uploadImages,
126
130
  children: __('Upload')
127
131
  })]
132
+ }), hadUploadError && /*#__PURE__*/_jsx("p", {
133
+ children: __('Upload failed, try again.')
128
134
  })]
129
135
  });
130
136
  }
@@ -1 +1 @@
1
- {"version":3,"names":["PanelBody","Button","Spinner","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","useSelect","useDispatch","__","store","blockEditorStore","useState","isBlobURL","editorStore","jsx","_jsx","jsxs","_jsxs","flattenBlocks","blocks","result","forEach","block","push","innerBlocks","Image","selectBlock","img","tabIndex","role","onClick","clientId","onKeyDown","event","key","preventDefault","alt","attributes","src","url","animate","opacity","exit","scale","style","width","height","objectFit","borderRadius","cursor","whileHover","PostFormatPanel","isUploading","setIsUploading","editorBlocks","mediaUpload","select","getEditorBlocks","getSettings","externalImages","filter","name","id","updateBlockAttributes","length","panelBodyTitle","className","children","uploadImages","Promise","all","map","image","window","fetch","includes","then","response","blob","resolve","reject","filesList","onFileChange","media","onError","finally","initialOpen","title","display","flexWrap","gap","variant"],"sources":["@wordpress/editor/src/components/post-publish-panel/maybe-upload-media.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\tSpinner,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport { isBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction flattenBlocks( blocks ) {\n\tconst result = [];\n\n\tblocks.forEach( ( block ) => {\n\t\tresult.push( block );\n\t\tresult.push( ...flattenBlocks( block.innerBlocks ) );\n\t} );\n\n\treturn result;\n}\n\nfunction Image( block ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\treturn (\n\t\t<motion.img\n\t\t\ttabIndex={ 0 }\n\t\t\trole=\"button\"\n\t\t\taria-label={ __( 'Select image block.' ) }\n\t\t\tonClick={ () => {\n\t\t\t\tselectBlock( block.clientId );\n\t\t\t} }\n\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\tif ( event.key === 'Enter' || event.key === ' ' ) {\n\t\t\t\t\tselectBlock( block.clientId );\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t} }\n\t\t\tkey={ block.clientId }\n\t\t\talt={ block.attributes.alt }\n\t\t\tsrc={ block.attributes.url }\n\t\t\tanimate={ { opacity: 1 } }\n\t\t\texit={ { opacity: 0, scale: 0 } }\n\t\t\tstyle={ {\n\t\t\t\twidth: '36px',\n\t\t\t\theight: '36px',\n\t\t\t\tobjectFit: 'cover',\n\t\t\t\tborderRadius: '2px',\n\t\t\t\tcursor: 'pointer',\n\t\t\t} }\n\t\t\twhileHover={ { scale: 1.08 } }\n\t\t/>\n\t);\n}\n\nexport default function PostFormatPanel() {\n\tconst [ isUploading, setIsUploading ] = useState( false );\n\tconst { editorBlocks, mediaUpload } = useSelect(\n\t\t( select ) => ( {\n\t\t\teditorBlocks: select( editorStore ).getEditorBlocks(),\n\t\t\tmediaUpload: select( blockEditorStore ).getSettings().mediaUpload,\n\t\t} ),\n\t\t[]\n\t);\n\tconst externalImages = flattenBlocks( editorBlocks ).filter(\n\t\t( block ) =>\n\t\t\tblock.name === 'core/image' &&\n\t\t\tblock.attributes.url &&\n\t\t\t! block.attributes.id\n\t);\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tif ( ! mediaUpload || ! externalImages.length ) {\n\t\treturn null;\n\t}\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'External media' ) }\n\t\t</span>,\n\t];\n\n\tfunction uploadImages() {\n\t\tsetIsUploading( true );\n\t\tPromise.all(\n\t\t\texternalImages.map( ( image ) =>\n\t\t\t\twindow\n\t\t\t\t\t.fetch(\n\t\t\t\t\t\timage.attributes.url.includes( '?' )\n\t\t\t\t\t\t\t? image.attributes.url\n\t\t\t\t\t\t\t: image.attributes.url + '?'\n\t\t\t\t\t)\n\t\t\t\t\t.then( ( response ) => response.blob() )\n\t\t\t\t\t.then(\n\t\t\t\t\t\t( blob ) =>\n\t\t\t\t\t\t\tnew Promise( ( resolve, reject ) => {\n\t\t\t\t\t\t\t\tmediaUpload( {\n\t\t\t\t\t\t\t\t\tfilesList: [ blob ],\n\t\t\t\t\t\t\t\t\tonFileChange: ( [ media ] ) => {\n\t\t\t\t\t\t\t\t\t\tif ( isBlobURL( media.url ) ) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tupdateBlockAttributes( image.clientId, {\n\t\t\t\t\t\t\t\t\t\t\tid: media.id,\n\t\t\t\t\t\t\t\t\t\t\turl: media.url,\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tonError() {\n\t\t\t\t\t\t\t\t\t\treject();\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t)\n\t\t\t)\n\t\t).finally( () => {\n\t\t\tsetIsUploading( false );\n\t\t} );\n\t}\n\n\treturn (\n\t\t<PanelBody initialOpen title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<div\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'inline-flex',\n\t\t\t\t\tflexWrap: 'wrap',\n\t\t\t\t\tgap: '8px',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<AnimatePresence>\n\t\t\t\t\t{ externalImages.map( ( image ) => {\n\t\t\t\t\t\treturn <Image key={ image.clientId } { ...image } />;\n\t\t\t\t\t} ) }\n\t\t\t\t</AnimatePresence>\n\t\t\t\t{ isUploading ? (\n\t\t\t\t\t<Spinner />\n\t\t\t\t) : (\n\t\t\t\t\t<Button variant=\"primary\" onClick={ uploadImages }>\n\t\t\t\t\t\t{ __( 'Upload' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,SAAS,EACTC,MAAM,EACNC,OAAO,EACPC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASH,KAAK,IAAII,WAA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G,CAAIC,KAAK,IAAM;UAClC,oBAAOzD,IAAA,CAACU,KAAK;YAAA,GAA6B+C;UAAK,GAA3BA,KAAK,CAACzC,QAAyB,CAAC;QACrD,CAAE;MAAC,CACa,CAAC,EAChBqB,WAAW,gBACZrC,IAAA,CAACd,OAAO,IAAE,CAAC,gBAEXc,IAAA,CAACf,MAAM;QAAC2F,OAAO,EAAC,SAAS;QAAC7D,OAAO,EAAGsC,YAAc;QAAAD,QAAA,EAC/C3D,EAAE,CAAE,QAAS;MAAC,CACT,CACR;IAAA,CACG,CAAC;EAAA,CACI,CAAC;AAEd","ignoreList":[]}
1
+ {"version":3,"names":["PanelBody","Button","Spinner","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","useSelect","useDispatch","__","store","blockEditorStore","useState","isBlobURL","jsx","_jsx","jsxs","_jsxs","flattenBlocks","blocks","result","forEach","block","push","innerBlocks","Image","selectBlock","img","tabIndex","role","onClick","clientId","onKeyDown","event","key","preventDefault","alt","attributes","src","url","animate","opacity","exit","scale","style","width","height","objectFit","borderRadius","cursor","whileHover","PostFormatPanel","isUploading","setIsUploading","isAnimating","setIsAnimating","hadUploadError","setHadUploadError","editorBlocks","mediaUpload","select","getBlocks","getSettings","externalImages","filter","name","id","updateBlockAttributes","length","panelBodyTitle","className","children","uploadImages","Promise","all","map","image","window","fetch","includes","then","response","blob","resolve","reject","filesList","onFileChange","media","onError","catch","finally","initialOpen","title","display","flexWrap","gap","onExitComplete","__next40pxDefaultSize","variant"],"sources":["@wordpress/editor/src/components/post-publish-panel/maybe-upload-media.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\tSpinner,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport { isBlobURL } from '@wordpress/blob';\n\nfunction flattenBlocks( blocks ) {\n\tconst result = [];\n\n\tblocks.forEach( ( block ) => {\n\t\tresult.push( block );\n\t\tresult.push( ...flattenBlocks( block.innerBlocks ) );\n\t} );\n\n\treturn result;\n}\n\nfunction Image( block ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\treturn (\n\t\t<motion.img\n\t\t\ttabIndex={ 0 }\n\t\t\trole=\"button\"\n\t\t\taria-label={ __( 'Select image block.' ) }\n\t\t\tonClick={ () => {\n\t\t\t\tselectBlock( block.clientId );\n\t\t\t} }\n\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\tif ( event.key === 'Enter' || event.key === ' ' ) {\n\t\t\t\t\tselectBlock( block.clientId );\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t} }\n\t\t\tkey={ block.clientId }\n\t\t\talt={ block.attributes.alt }\n\t\t\tsrc={ block.attributes.url }\n\t\t\tanimate={ { opacity: 1 } }\n\t\t\texit={ { opacity: 0, scale: 0 } }\n\t\t\tstyle={ {\n\t\t\t\twidth: '36px',\n\t\t\t\theight: '36px',\n\t\t\t\tobjectFit: 'cover',\n\t\t\t\tborderRadius: '2px',\n\t\t\t\tcursor: 'pointer',\n\t\t\t} }\n\t\t\twhileHover={ { scale: 1.08 } }\n\t\t/>\n\t);\n}\n\nexport default function PostFormatPanel() {\n\tconst [ isUploading, setIsUploading ] = useState( false );\n\tconst [ isAnimating, setIsAnimating ] = useState( false );\n\tconst [ hadUploadError, setHadUploadError ] = useState( false );\n\tconst { editorBlocks, mediaUpload } = useSelect(\n\t\t( select ) => ( {\n\t\t\teditorBlocks: select( blockEditorStore ).getBlocks(),\n\t\t\tmediaUpload: select( blockEditorStore ).getSettings().mediaUpload,\n\t\t} ),\n\t\t[]\n\t);\n\tconst externalImages = flattenBlocks( editorBlocks ).filter(\n\t\t( block ) =>\n\t\t\tblock.name === 'core/image' &&\n\t\t\tblock.attributes.url &&\n\t\t\t! block.attributes.id\n\t);\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tif ( ! mediaUpload || ! externalImages.length ) {\n\t\treturn null;\n\t}\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'External media' ) }\n\t\t</span>,\n\t];\n\n\tfunction uploadImages() {\n\t\tsetIsUploading( true );\n\t\tsetHadUploadError( false );\n\t\tPromise.all(\n\t\t\texternalImages.map( ( image ) =>\n\t\t\t\twindow\n\t\t\t\t\t.fetch(\n\t\t\t\t\t\timage.attributes.url.includes( '?' )\n\t\t\t\t\t\t\t? image.attributes.url\n\t\t\t\t\t\t\t: image.attributes.url + '?'\n\t\t\t\t\t)\n\t\t\t\t\t.then( ( response ) => response.blob() )\n\t\t\t\t\t.then( ( blob ) =>\n\t\t\t\t\t\tnew Promise( ( resolve, reject ) => {\n\t\t\t\t\t\t\tmediaUpload( {\n\t\t\t\t\t\t\t\tfilesList: [ blob ],\n\t\t\t\t\t\t\t\tonFileChange: ( [ media ] ) => {\n\t\t\t\t\t\t\t\t\tif ( isBlobURL( media.url ) ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tupdateBlockAttributes( image.clientId, {\n\t\t\t\t\t\t\t\t\t\tid: media.id,\n\t\t\t\t\t\t\t\t\t\turl: media.url,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonError() {\n\t\t\t\t\t\t\t\t\treject();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} ).then( () => setIsAnimating( true ) )\n\t\t\t\t\t)\n\t\t\t\t\t.catch( () => {\n\t\t\t\t\t\tsetHadUploadError( true );\n\t\t\t\t\t} )\n\t\t\t)\n\t\t).finally( () => {\n\t\t\tsetIsUploading( false );\n\t\t} );\n\t}\n\n\treturn (\n\t\t<PanelBody initialOpen title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<div\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'inline-flex',\n\t\t\t\t\tflexWrap: 'wrap',\n\t\t\t\t\tgap: '8px',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<AnimatePresence\n\t\t\t\t\tonExitComplete={ () => setIsAnimating( false ) }\n\t\t\t\t>\n\t\t\t\t\t{ externalImages.map( ( image ) => {\n\t\t\t\t\t\treturn <Image key={ image.clientId } { ...image } />;\n\t\t\t\t\t} ) }\n\t\t\t\t</AnimatePresence>\n\t\t\t\t{ isUploading || isAnimating ? (\n\t\t\t\t\t<Spinner />\n\t\t\t\t) : (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ uploadImages }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Upload' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t{ hadUploadError && <p>{ __( 'Upload failed, try again.' ) }</p> }\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,SAAS,EACTC,MAAM,EACNC,OAAO,EACPC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAAS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AEA,oBACCpC,KAAA,CAACjB,SAAS;IAAC2F,WAAW;IAACC,KAAK,EAAGvB,cAAgB;IAAAE,QAAA,gBAC9CxD,IAAA;MAAAwD,QAAA,EACG9D,EAAE,CACH,8IACD;IAAC,CACC,CAAC,eACJQ,KAAA;MACC2B,KAAK,EAAG;QACPiD,OAAO,EAAE,aAAa;QACtBC,QAAQ,EAAE,MAAM;QAChBC,GAAG,EAAE;MACN,CAAG;MAAAxB,QAAA,gBAEHxD,IAAA,CAACT,eAAe;QACf0F,cAAc,EAAGA,CAAA,KAAMzC,cAAc,CAAE,KAAM,CAAG;QAAAgB,QAAA,EAE9CR,cAAc,CAACY,GAAG,CAAIC,KAAK,IAAM;UAClC,oBAAO7D,IAAA,CAACU,KAAK;YAAA,GAA6BmD;UAAK,GAA3BA,KAAK,CAAC7C,QAAyB,CAAC;QACrD,CAAE;MAAC,CACa,CAAC,EAChBqB,WAAW,IAAIE,WAAW,gBAC3BvC,IAAA,CAACb,OAAO,IAAE,CAAC,gBAEXa,IAAA,CAACd;MACA;MAAA;QACAgG,qBAAqB,EAAG,KAAO;QAC/BC,OAAO,EAAC,SAAS;QACjBpE,OAAO,EAAG0C,YAAc;QAAAD,QAAA,EAEtB9D,EAAE,CAAE,QAAS;MAAC,CACT,CACR;IAAA,CACG,CAAC,EACJ+C,cAAc,iBAAIzC,IAAA;MAAAwD,QAAA,EAAK9D,EAAE,CAAE,2BAA4B;IAAC,CAAK,CAAC;EAAA,CACtD,CAAC;AAEd","ignoreList":[]}
@@ -48,6 +48,7 @@ function CopyButton({
48
48
  }) {
49
49
  const ref = useCopyToClipboard(text, onCopy);
50
50
  return /*#__PURE__*/_jsx(Button, {
51
+ __next40pxDefaultSize: true,
51
52
  variant: "secondary",
52
53
  ref: ref,
53
54
  children: children
@@ -120,6 +121,7 @@ class PostPublishPanelPostpublish extends Component {
120
121
  }), /*#__PURE__*/_jsxs("div", {
121
122
  className: "post-publish-panel__postpublish-post-address-container",
122
123
  children: [/*#__PURE__*/_jsx(TextControl, {
124
+ __next40pxDefaultSize: true,
123
125
  __nextHasNoMarginBottom: true,
124
126
  className: "post-publish-panel__postpublish-post-address",
125
127
  readOnly: true,
@@ -140,9 +142,11 @@ class PostPublishPanelPostpublish extends Component {
140
142
  children: [!isScheduled && /*#__PURE__*/_jsx(Button, {
141
143
  variant: "primary",
142
144
  href: link,
145
+ __next40pxDefaultSize: true,
143
146
  children: viewPostLabel
144
147
  }), /*#__PURE__*/_jsx(Button, {
145
148
  variant: isScheduled ? 'primary' : 'secondary',
149
+ __next40pxDefaultSize: true,
146
150
  href: addLink,
147
151
  children: addNewPostLabel
148
152
  })]
@@ -1 +1 @@
1
- {"version":3,"names":["PanelBody","Button","TextControl","__","sprintf","Component","createRef","withSelect","addQueryArgs","safeDecodeURIComponent","decodeEntities","useCopyToClipboard","store","coreStore","PostScheduleLabel","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","POSTNAME","PAGENAME","getFuturePostUrl","post","slug","permalink_template","includes","replace","CopyButton","text","onCopy","children","ref","variant","PostPublishPanelPostpublish","constructor","arguments","state","showCopyConfirmation","bind","onSelectInput","postLink","componentDidMount","props","focusOnMount","current","focus","componentWillUnmount","clearTimeout","dismissCopyConfirmation","setState","setTimeout","event","target","select","render","isScheduled","postType","postLabel","labels","singular_name","viewPostLabel","view_item","addNewPostLabel","add_new_item","link","status","addLink","post_type","type","postPublishNonLinkHeader","className","href","title","__nextHasNoMarginBottom","readOnly","label","value","onFocus","getEditedPostAttribute","getCurrentPost","isCurrentPostScheduled","getPostType"],"sources":["@wordpress/editor/src/components/post-publish-panel/postpublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody, Button, TextControl } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect } 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';\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, onCopy, children } ) {\n\tconst ref = useCopyToClipboard( text, onCopy );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass PostPublishPanelPostpublish extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tshowCopyConfirmation: false,\n\t\t};\n\t\tthis.onCopy = this.onCopy.bind( this );\n\t\tthis.onSelectInput = this.onSelectInput.bind( this );\n\t\tthis.postLink = createRef();\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\tthis.postLink.current.focus();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t}\n\n\tonCopy() {\n\t\tthis.setState( {\n\t\t\tshowCopyConfirmation: true,\n\t\t} );\n\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t\tthis.dismissCopyConfirmation = setTimeout( () => {\n\t\t\tthis.setState( {\n\t\t\t\tshowCopyConfirmation: false,\n\t\t\t} );\n\t\t}, 4000 );\n\t}\n\n\tonSelectInput( event ) {\n\t\tevent.target.select();\n\t}\n\n\trender() {\n\t\tconst { children, isScheduled, post, postType } = this.props;\n\t\tconst postLabel = postType?.labels?.singular_name;\n\t\tconst viewPostLabel = postType?.labels?.view_item;\n\t\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\t\tconst link =\n\t\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\t\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\t\tpost_type: post.type,\n\t\t} );\n\n\t\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t\t<>\n\t\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t\t<PostScheduleLabel />.\n\t\t\t</>\n\t\t) : (\n\t\t\t__( 'is now live.' )\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t\t<a ref={ this.postLink } href={ link }>\n\t\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t\t<strong>{ __( 'What’s next?' ) }</strong>\n\t\t\t\t\t</p>\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\t\tonFocus={ this.onSelectInput }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t\t<CopyButton text={ link } onCopy={ this.onCopy }>\n\t\t\t\t\t\t\t\t{ this.state.showCopyConfirmation\n\t\t\t\t\t\t\t\t\t? __( 'Copied!' )\n\t\t\t\t\t\t\t\t\t: __( 'Copy' ) }\n\t\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t\t<Button variant=\"primary\" href={ link }>\n\t\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditedPostAttribute, getCurrentPost, isCurrentPostScheduled } =\n\t\tselect( editorStore );\n\tconst { getPostType } = select( coreStore );\n\n\treturn {\n\t\tpost: getCurrentPost(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisScheduled: isCurrentPostScheduled(),\n\t};\n} )( PostPublishPanelPostpublish );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,EAAEC,WAAW,QAAQ,uBAAuB;AACtE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,YAAY,EAAEC,sBAAsB,Q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CAAC","ignoreList":[]}
1
+ {"version":3,"names":["PanelBody","Button","TextControl","__","sprintf","Component","createRef","withSelect","addQueryArgs","safeDecodeURIComponent","decodeEntities","useCopyToClipboard","store","coreStore","PostScheduleLabel","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","POSTNAME","PAGENAME","getFuturePostUrl","post","slug","permalink_template","includes","replace","CopyButton","text","onCopy","children","ref","__next40pxDefaultSize","variant","PostPublishPanelPostpublish","constructor","arguments","state","showCopyConfirmation","bind","onSelectInput","postLink","componentDidMount","props","focusOnMount","current","focus","componentWillUnmount","clearTimeout","dismissCopyConfirmation","setState","setTimeout","event","target","select","render","isScheduled","postType","postLabel","labels","singular_name","viewPostLabel","view_item","addNewPostLabel","add_new_item","link","status","addLink","post_type","type","postPublishNonLinkHeader","className","href","title","__nextHasNoMarginBottom","readOnly","label","value","onFocus","getEditedPostAttribute","getCurrentPost","isCurrentPostScheduled","getPostType"],"sources":["@wordpress/editor/src/components/post-publish-panel/postpublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody, Button, TextControl } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect } 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';\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, onCopy, children } ) {\n\tconst ref = useCopyToClipboard( text, onCopy );\n\treturn (\n\t\t<Button __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass PostPublishPanelPostpublish extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tshowCopyConfirmation: false,\n\t\t};\n\t\tthis.onCopy = this.onCopy.bind( this );\n\t\tthis.onSelectInput = this.onSelectInput.bind( this );\n\t\tthis.postLink = createRef();\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\tthis.postLink.current.focus();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t}\n\n\tonCopy() {\n\t\tthis.setState( {\n\t\t\tshowCopyConfirmation: true,\n\t\t} );\n\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t\tthis.dismissCopyConfirmation = setTimeout( () => {\n\t\t\tthis.setState( {\n\t\t\t\tshowCopyConfirmation: false,\n\t\t\t} );\n\t\t}, 4000 );\n\t}\n\n\tonSelectInput( event ) {\n\t\tevent.target.select();\n\t}\n\n\trender() {\n\t\tconst { children, isScheduled, post, postType } = this.props;\n\t\tconst postLabel = postType?.labels?.singular_name;\n\t\tconst viewPostLabel = postType?.labels?.view_item;\n\t\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\t\tconst link =\n\t\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\t\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\t\tpost_type: post.type,\n\t\t} );\n\n\t\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t\t<>\n\t\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t\t<PostScheduleLabel />.\n\t\t\t</>\n\t\t) : (\n\t\t\t__( 'is now live.' )\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t\t<a ref={ this.postLink } href={ link }>\n\t\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t\t<strong>{ __( 'What’s next?' ) }</strong>\n\t\t\t\t\t</p>\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\t\tonFocus={ this.onSelectInput }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t\t<CopyButton text={ link } onCopy={ this.onCopy }>\n\t\t\t\t\t\t\t\t{ this.state.showCopyConfirmation\n\t\t\t\t\t\t\t\t\t? __( 'Copied!' )\n\t\t\t\t\t\t\t\t\t: __( 'Copy' ) }\n\t\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\thref={ link }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditedPostAttribute, getCurrentPost, isCurrentPostScheduled } =\n\t\tselect( editorStore );\n\tconst { getPostType } = select( coreStore );\n\n\treturn {\n\t\tpost: getCurrentPost(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisScheduled: isCurrentPostScheduled(),\n\t};\n} )( PostPublishPanelPostpublish );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,EAAEC,WAAW,QAAQ,uBAAuB;AACtE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,YAAY,EAAEC,sBAAsB,QAAQ,gBAAgB;AACrE,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,SAASF,KAAK,IAAIG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AACa,UAAU;cAACC,IAAI,EAAGqC,IAAM;cAACpC,MAAM,EAAG,IAAI,CAACA,MAAQ;cAAAC,QAAA,EAC7C,IAAI,CAACO,KAAK,CAACC,oBAAoB,GAC9BtC,EAAE,CAAE,SAAU,CAAC,GACfA,EAAE,CAAE,MAAO;YAAC,CACJ;UAAC,CACT,CAAC;QAAA,CACF,CAAC,eAENkB,KAAA;UAAKqD,SAAS,EAAC,yCAAyC;UAAAzC,QAAA,GACrD,CAAE0B,WAAW,iBACd1C,IAAA,CAAChB,MAAM;YACNmC,OAAO,EAAC,SAAS;YACjBuC,IAAI,EAAGP,IAAM;YACbjC,qBAAqB;YAAAF,QAAA,EAEnB+B;UAAa,CACR,CACR,eACD/C,IAAA,CAAChB,MAAM;YACNmC,OAAO,EAAGuB,WAAW,GAAG,SAAS,GAAG,WAAa;YACjDxB,qBAAqB;YACrBwC,IAAI,EAAGL,OAAS;YAAArC,QAAA,EAEdiC;UAAe,CACV,CAAC;QAAA,CACL,CAAC;MAAA,CACI,CAAC,EACVjC,QAAQ;IAAA,CACN,CAAC;EAER;AACD;AAEA,eAAe1B,UAAU,CAAIkD,MAAM,IAAM;EACxC,MAAM;IAAEyB,sBAAsB;IAAEC,cAAc;IAAEC;EAAuB,CAAC,GACvE3B,MAAM,CAAE1C,WAAY,CAAC;EACtB,MAAM;IAAEsE;EAAY,CAAC,GAAG5B,MAAM,CAAE5C,SAAU,CAAC;EAE3C,OAAO;IACNY,IAAI,EAAE0D,cAAc,CAAC,CAAC;IACtBvB,QAAQ,EAAEyB,WAAW,CAAEH,sBAAsB,CAAE,MAAO,CAAE,CAAC;IACzDvB,WAAW,EAAEyB,sBAAsB,CAAC;EACrC,CAAC;AACF,CAAE,CAAC,CAAE/C,2BAA4B,CAAC","ignoreList":[]}
@@ -22,6 +22,7 @@ function PostSlugControl() {
22
22
  } = useDispatch(editorStore);
23
23
  const [forceEmptyField, setForceEmptyField] = useState(false);
24
24
  return /*#__PURE__*/_jsx(TextControl, {
25
+ __next40pxDefaultSize: true,
25
26
  __nextHasNoMarginBottom: true,
26
27
  label: __('Slug'),
27
28
  autoComplete: "off",
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","useSelect","useState","__","safeDecodeURIComponent","cleanForSlug","TextControl","PostSlugCheck","store","editorStore","jsx","_jsx","PostSlugControl","postSlug","select","getEditedPostSlug","editPost","forceEmptyField","setForceEmptyField","__nextHasNoMarginBottom","label","autoComplete","spellCheck","value","onChange","newValue","slug","onBlur","event","target","className","PostSlug","children"],"sources":["@wordpress/editor/src/components/post-slug/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';\nimport { TextControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport PostSlugCheck from './check';\nimport { store as editorStore } from '../../store';\n\nfunction PostSlugControl() {\n\tconst postSlug = useSelect( ( select ) => {\n\t\treturn safeDecodeURIComponent(\n\t\t\tselect( editorStore ).getEditedPostSlug()\n\t\t);\n\t}, [] );\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ forceEmptyField, setForceEmptyField ] = useState( false );\n\n\treturn (\n\t\t<TextControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Slug' ) }\n\t\t\tautoComplete=\"off\"\n\t\t\tspellCheck=\"false\"\n\t\t\tvalue={ forceEmptyField ? '' : postSlug }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\teditPost( { slug: newValue } );\n\t\t\t\t// When we delete the field the permalink gets\n\t\t\t\t// reverted to the original value.\n\t\t\t\t// The forceEmptyField logic allows the user to have\n\t\t\t\t// the field temporarily empty while typing.\n\t\t\t\tif ( ! newValue ) {\n\t\t\t\t\tif ( ! forceEmptyField ) {\n\t\t\t\t\t\tsetForceEmptyField( true );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tonBlur={ ( event ) => {\n\t\t\t\teditPost( {\n\t\t\t\t\tslug: cleanForSlug( event.target.value ),\n\t\t\t\t} );\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tclassName=\"editor-post-slug\"\n\t\t/>\n\t);\n}\n\n/**\n * Renders the PostSlug component. It provide a control for editing the post slug.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function PostSlug() {\n\treturn (\n\t\t<PostSlugCheck>\n\t\t\t<PostSlugControl />\n\t\t</PostSlugCheck>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,sBAAsB,EAAEC,YAAY,QAAQ,gBAAgB;AACrE,SAASC,WAAW,QAAQ,uBAAuB;;AAEnD;AACA;AACA;AACA,OAAOC,aAAa,MAAM,SAAS;AACnC,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,SAASC,eAAeA,CAAA,EAAG;EAC1B,MAAMC,QAAQ,GAAGZ,SAAS,CAAIa,MAAM,IAAM;IACzC,OAAOV,sBAAsB,CAC5BU,MAAM,CAAEL,WAAY,CAAC,CAACM,iBAAiB,CAAC,CACzC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC;EAAS,CAAC,GAAGhB,WAAW,CAAES,WAAY,CAAC;EAC/C,MAAM,CAAEQ,eAAe,EAAEC,kBAAkB,CAAE,GAAGhB,QAAQ,CAAE,KAAM,CAAC;EAEjE,oBACCS,IAAA,CAACL,WAAW;IACXa,uBAAuB;IACvBC,KAAK,EAAGjB,EAAE,CAAE,MAAO,CAAG;IACtBkB,YAAY,EAAC,KAAK;IAClBC,UAAU,EAAC,OAAO;IAClBC,KAAK,EAAGN,eAAe,GAAG,EAAE,GAAGJ,QAAU;IACzCW,QAAQ,EAAKC,QAAQ,IAAM;MAC1BT,QAAQ,CAAE;QAAEU,IAAI,EAAED;MAAS,CAAE,CAAC;MAC9B;MACA;MACA;MACA;MACA,IAAK,CAAEA,QAAQ,EAAG;QACjB,IAAK,CAAER,eAAe,EAAG;UACxBC,kBAAkB,CAAE,IAAK,CAAC;QAC3B;QACA;MACD;MACA,IAAKD,eAAe,EAAG;QACtBC,kBAAkB,CAAE,KAAM,CAAC;MAC5B;IACD,CAAG;IACHS,MAAM,EAAKC,KAAK,IAAM;MACrBZ,QAAQ,CAAE;QACTU,IAAI,EAAErB,YAAY,CAAEuB,KAAK,CAACC,MAAM,CAACN,KAAM;MACxC,CAAE,CAAC;MACH,IAAKN,eAAe,EAAG;QACtBC,kBAAkB,CAAE,KAAM,CAAC;MAC5B;IACD,CAAG;IACHY,SAAS,EAAC;EAAkB,CAC5B,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,QAAQA,CAAA,EAAG;EAClC,oBACCpB,IAAA,CAACJ,aAAa;IAAAyB,QAAA,eACbrB,IAAA,CAACC,eAAe,IAAE;EAAC,CACL,CAAC;AAElB","ignoreList":[]}
1
+ {"version":3,"names":["useDispatch","useSelect","useState","__","safeDecodeURIComponent","cleanForSlug","TextControl","PostSlugCheck","store","editorStore","jsx","_jsx","PostSlugControl","postSlug","select","getEditedPostSlug","editPost","forceEmptyField","setForceEmptyField","__next40pxDefaultSize","__nextHasNoMarginBottom","label","autoComplete","spellCheck","value","onChange","newValue","slug","onBlur","event","target","className","PostSlug","children"],"sources":["@wordpress/editor/src/components/post-slug/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';\nimport { TextControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport PostSlugCheck from './check';\nimport { store as editorStore } from '../../store';\n\nfunction PostSlugControl() {\n\tconst postSlug = useSelect( ( select ) => {\n\t\treturn safeDecodeURIComponent(\n\t\t\tselect( editorStore ).getEditedPostSlug()\n\t\t);\n\t}, [] );\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ forceEmptyField, setForceEmptyField ] = useState( false );\n\n\treturn (\n\t\t<TextControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Slug' ) }\n\t\t\tautoComplete=\"off\"\n\t\t\tspellCheck=\"false\"\n\t\t\tvalue={ forceEmptyField ? '' : postSlug }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\teditPost( { slug: newValue } );\n\t\t\t\t// When we delete the field the permalink gets\n\t\t\t\t// reverted to the original value.\n\t\t\t\t// The forceEmptyField logic allows the user to have\n\t\t\t\t// the field temporarily empty while typing.\n\t\t\t\tif ( ! newValue ) {\n\t\t\t\t\tif ( ! forceEmptyField ) {\n\t\t\t\t\t\tsetForceEmptyField( true );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tonBlur={ ( event ) => {\n\t\t\t\teditPost( {\n\t\t\t\t\tslug: cleanForSlug( event.target.value ),\n\t\t\t\t} );\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tclassName=\"editor-post-slug\"\n\t\t/>\n\t);\n}\n\n/**\n * Renders the PostSlug component. It provide a control for editing the post slug.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function PostSlug() {\n\treturn (\n\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ACtBC,kBAAkB,CAAE,KAAM,CAAC;MAC5B;IACD,CAAG;IACHU,MAAM,EAAKC,KAAK,IAAM;MACrBb,QAAQ,CAAE;QACTW,IAAI,EAAEtB,YAAY,CAAEwB,KAAK,CAACC,MAAM,CAACN,KAAM;MACxC,CAAE,CAAC;MACH,IAAKP,eAAe,EAAG;QACtBC,kBAAkB,CAAE,KAAM,CAAC;MAC5B;IACD,CAAG;IACHa,SAAS,EAAC;EAAkB,CAC5B,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,QAAQA,CAAA,EAAG;EAClC,oBACCrB,IAAA,CAACJ,aAAa;IAAA0B,QAAA,eACbtB,IAAA,CAACC,eAAe,IAAE;EAAC,CACL,CAAC;AAElB","ignoreList":[]}
@@ -157,7 +157,8 @@ export default function PostStatus() {
157
157
  popoverProps: popoverProps,
158
158
  focusOnMount: true,
159
159
  renderToggle: ({
160
- onToggle
160
+ onToggle,
161
+ isOpen
161
162
  }) => /*#__PURE__*/_jsx(Button, {
162
163
  variant: "tertiary",
163
164
  size: "compact",
@@ -165,7 +166,8 @@ export default function PostStatus() {
165
166
  icon: postStatusesInfo[status]?.icon,
166
167
  "aria-label": sprintf(
167
168
  // translators: %s: Current post status.
168
- __('Change post status: %s'), postStatusesInfo[status]?.label),
169
+ __('Change status: %s'), postStatusesInfo[status]?.label),
170
+ "aria-expanded": isOpen,
169
171
  children: postStatusesInfo[status]?.label
170
172
  }),
171
173
  renderContent: ({
@@ -1 +1 @@
1
- {"version":3,"names":["Button","CheckboxControl","Dropdown","__experimentalVStack","VStack","TextControl","RadioControl","__","sprintf","useDispatch","useSelect","useState","useMemo","store","coreStore","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","useInstanceId","drafts","published","scheduled","pending","notAllowed","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","NAVIGATION_POST_TYPE","PostPanelRow","PostSticky","PrivatePostSchedule","editorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","postStatusesInfo","label","icon","draft","private","future","publish","STATUS_OPTIONS","value","description","DESIGN_POST_TYPES","PostStatus","status","date","password","postId","postType","canEdit","select","_getCurrentPost$_link","getEditedPostAttribute","getCurrentPostId","getCurrentPostType","getCurrentPost","_links","showPassword","setShowPassword","passwordInputId","editEntityRecord","popoverAnchor","setPopoverAnchor","popoverProps","anchor","headerTitle","placement","offset","shift","includes","updatePost","newStatus","newPassword","newDate","handleTogglePassword","handleStatus","Date","ref","children","className","contentClassName","focusOnMount","renderToggle","onToggle","variant","size","onClick","renderContent","onClose","title","spacing","hideLabelFromVision","options","onChange","selected","showPopoverHeaderActions","isCompact","as","__nextHasNoMarginBottom","help","checked","placeholder","type","id","__next40pxDefaultSize","maxLength"],"sources":["@wordpress/editor/src/components/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tCheckboxControl,\n\tDropdown,\n\t__experimentalVStack as VStack,\n\tTextControl,\n\tRadioControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../../store/constants';\nimport PostPanelRow from '../post-panel-row';\nimport PostSticky from '../post-sticky';\nimport { PrivatePostSchedule } from '../post-schedule';\nimport { store as editorStore } from '../../store';\n\nconst postStatusesInfo = {\n\t'auto-draft': { label: __( 'Draft' ), icon: drafts },\n\tdraft: { label: __( 'Draft' ), icon: drafts },\n\tpending: { label: __( 'Pending' ), icon: pending },\n\tprivate: { label: __( 'Private' ), icon: notAllowed },\n\tfuture: { label: __( 'Scheduled' ), icon: scheduled },\n\tpublish: { label: __( 'Published' ), icon: published },\n};\n\nexport const STATUS_OPTIONS = [\n\t{\n\t\tlabel: __( 'Draft' ),\n\t\tvalue: 'draft',\n\t\tdescription: __( 'Not ready to publish.' ),\n\t},\n\t{\n\t\tlabel: __( 'Pending' ),\n\t\tvalue: 'pending',\n\t\tdescription: __( 'Waiting for review before publishing.' ),\n\t},\n\t{\n\t\tlabel: __( 'Private' ),\n\t\tvalue: 'private',\n\t\tdescription: __( 'Only visible to site admins and editors.' ),\n\t},\n\t{\n\t\tlabel: __( 'Scheduled' ),\n\t\tvalue: 'future',\n\t\tdescription: __( 'Publish automatically on a chosen date.' ),\n\t},\n\t{\n\t\tlabel: __( 'Published' ),\n\t\tvalue: 'publish',\n\t\tdescription: __( 'Visible to everyone.' ),\n\t},\n];\n\nconst DESIGN_POST_TYPES = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n];\n\nexport default function PostStatus() {\n\tconst { status, date, password, postId, postType, canEdit } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPost,\n\t\t\t} = select( editorStore );\n\t\t\treturn {\n\t\t\t\tstatus: getEditedPostAttribute( 'status' ),\n\t\t\t\tdate: getEditedPostAttribute( 'date' ),\n\t\t\t\tpassword: getEditedPostAttribute( 'password' ),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tcanEdit:\n\t\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst [ showPassword, setShowPassword ] = useState( !! password );\n\tconst passwordInputId = useInstanceId(\n\t\tPostStatus,\n\t\t'editor-change-status__password-input'\n\t);\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': __( 'Status & visibility' ),\n\t\t\theaderTitle: __( 'Status & visibility' ),\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tif ( DESIGN_POST_TYPES.includes( postType ) ) {\n\t\treturn null;\n\t}\n\n\tconst updatePost = ( {\n\t\tstatus: newStatus = status,\n\t\tpassword: newPassword = password,\n\t\tdate: newDate = date,\n\t} ) => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tstatus: newStatus,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\tconst handleTogglePassword = ( value ) => {\n\t\tsetShowPassword( value );\n\t\tif ( ! value ) {\n\t\t\tupdatePost( { password: '' } );\n\t\t}\n\t};\n\n\tconst handleStatus = ( value ) => {\n\t\tlet newDate = date;\n\t\tlet newPassword = password;\n\t\tif ( status === 'future' && new Date( date ) > new Date() ) {\n\t\t\tnewDate = null;\n\t\t}\n\t\tif ( value === 'private' && password ) {\n\t\t\tnewPassword = '';\n\t\t}\n\t\tupdatePost( {\n\t\t\tstatus: value,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<PostPanelRow label={ __( 'Status' ) } ref={ setPopoverAnchor }>\n\t\t\t{ canEdit ? (\n\t\t\t\t<Dropdown\n\t\t\t\t\tclassName=\"editor-post-status\"\n\t\t\t\t\tcontentClassName=\"editor-change-status__content\"\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\ticon={ postStatusesInfo[ status ]?.icon }\n\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Current post status.\n\t\t\t\t\t\t\t\t__( 'Change post status: %s' ),\n\t\t\t\t\t\t\t\tpostStatusesInfo[ status ]?.label\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ postStatusesInfo[ status ]?.label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\t\ttitle={ __( 'Status & visibility' ) }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<form>\n\t\t\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\t\t\t\tclassName=\"editor-change-status__options\"\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Status' ) }\n\t\t\t\t\t\t\t\t\t\toptions={ STATUS_OPTIONS }\n\t\t\t\t\t\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\t\t\t\t\t\tselected={\n\t\t\t\t\t\t\t\t\t\t\tstatus === 'auto-draft'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'draft'\n\t\t\t\t\t\t\t\t\t\t\t\t: status\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ status === 'future' && (\n\t\t\t\t\t\t\t\t\t\t<div className=\"editor-change-status__publish-date-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t<PrivatePostSchedule\n\t\t\t\t\t\t\t\t\t\t\t\tshowPopoverHeaderActions={\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tisCompact\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ status !== 'private' && (\n\t\t\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\t\t\tas=\"fieldset\"\n\t\t\t\t\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-change-status__password-fieldset\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Password protected'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Only visible to those who know the password'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tchecked={ showPassword }\n\t\t\t\t\t\t\t\t\t\t\t\tonChange={\n\t\t\t\t\t\t\t\t\t\t\t\t\thandleTogglePassword\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t{ showPassword && (\n\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"editor-change-status__password-input\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Password'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePost( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpassword: value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tplaceholder={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Use a secure password'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid={ passwordInputId }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmaxLength={ 255 }\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"editor-post-status is-read-only\">\n\t\t\t\t\t{ postStatusesInfo[ status ]?.label }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</PostPanelRow>\n\t);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AC,UAAU;cACbP,OAAO,EAAG,CAAG;cACbX,SAAS,EAAC,yCAAyC;cAAAD,QAAA,gBAEnDnD,IAAA,CAAC/B,eAAe;gBACfsG,uBAAuB;gBACvBjE,KAAK,EAAG/B,EAAE,CACT,oBACD,CAAG;gBACHiG,IAAI,EAAGjG,EAAE,CACR,6CACD,CAAG;gBACHkG,OAAO,EAAG3C,YAAc;gBACxBoC,QAAQ,EACPnB;cACA,CACD,CAAC,EACAjB,YAAY,iBACb9B,IAAA;gBAAKoD,SAAS,EAAC,sCAAsC;gBAAAD,QAAA,eACpDnD,IAAA,CAAC3B,WAAW;kBACXiC,KAAK,EAAG/B,EAAE,CACT,UACD,CAAG;kBACH2F,QAAQ,EAAKrD,KAAK,IACjB8B,UAAU,CAAE;oBACXxB,QAAQ,EAAEN;kBACX,CAAE,CACF;kBACDA,KAAK,EAAGM,QAAU;kBAClBuD,WAAW,EAAGnG,EAAE,CACf,uBACD,CAAG;kBACHoG,IAAI,EAAC,MAAM;kBACXC,EAAE,EAAG5C,eAAiB;kBACtB6C,qBAAqB;kBACrBN,uBAAuB;kBACvBO,SAAS,EAAG;gBAAK,CACjB;cAAC,CACE,CACL;YAAA,CACM,CACR,eACD9E,IAAA,CAACJ,UAAU,IAAE,CAAC;UAAA,CACP;QAAC,CACJ,CAAC;MAAA,CACN;IACA,CACH,CAAC,gBAEFI,IAAA;MAAKoD,SAAS,EAAC,iCAAiC;MAAAD,QAAA,EAC7C9C,gBAAgB,CAAEY,MAAM,CAAE,EAAEX;IAAK,CAC/B;EACL,CACY,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["Button","CheckboxControl","Dropdown","__experimentalVStack","VStack","TextControl","RadioControl","__","sprintf","useDispatch","useSelect","useState","useMemo","store","coreStore","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","useInstanceId","drafts","published","scheduled","pending","notAllowed","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","NAVIGATION_POST_TYPE","PostPanelRow","PostSticky","PrivatePostSchedule","editorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","postStatusesInfo","label","icon","draft","private","future","publish","STATUS_OPTIONS","value","description","DESIGN_POST_TYPES","PostStatus","status","date","password","postId","postType","canEdit","select","_getCurrentPost$_link","getEditedPostAttribute","getCurrentPostId","getCurrentPostType","getCurrentPost","_links","showPassword","setShowPassword","passwordInputId","editEntityRecord","popoverAnchor","setPopoverAnchor","popoverProps","anchor","headerTitle","placement","offset","shift","includes","updatePost","newStatus","newPassword","newDate","handleTogglePassword","handleStatus","Date","ref","children","className","contentClassName","focusOnMount","renderToggle","onToggle","isOpen","variant","size","onClick","renderContent","onClose","title","spacing","hideLabelFromVision","options","onChange","selected","showPopoverHeaderActions","isCompact","as","__nextHasNoMarginBottom","help","checked","placeholder","type","id","__next40pxDefaultSize","maxLength"],"sources":["@wordpress/editor/src/components/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tCheckboxControl,\n\tDropdown,\n\t__experimentalVStack as VStack,\n\tTextControl,\n\tRadioControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../../store/constants';\nimport PostPanelRow from '../post-panel-row';\nimport PostSticky from '../post-sticky';\nimport { PrivatePostSchedule } from '../post-schedule';\nimport { store as editorStore } from '../../store';\n\nconst postStatusesInfo = {\n\t'auto-draft': { label: __( 'Draft' ), icon: drafts },\n\tdraft: { label: __( 'Draft' ), icon: drafts },\n\tpending: { label: __( 'Pending' ), icon: pending },\n\tprivate: { label: __( 'Private' ), icon: notAllowed },\n\tfuture: { label: __( 'Scheduled' ), icon: scheduled },\n\tpublish: { label: __( 'Published' ), icon: published },\n};\n\nexport const STATUS_OPTIONS = [\n\t{\n\t\tlabel: __( 'Draft' ),\n\t\tvalue: 'draft',\n\t\tdescription: __( 'Not ready to publish.' ),\n\t},\n\t{\n\t\tlabel: __( 'Pending' ),\n\t\tvalue: 'pending',\n\t\tdescription: __( 'Waiting for review before publishing.' ),\n\t},\n\t{\n\t\tlabel: __( 'Private' ),\n\t\tvalue: 'private',\n\t\tdescription: __( 'Only visible to site admins and editors.' ),\n\t},\n\t{\n\t\tlabel: __( 'Scheduled' ),\n\t\tvalue: 'future',\n\t\tdescription: __( 'Publish automatically on a chosen date.' ),\n\t},\n\t{\n\t\tlabel: __( 'Published' ),\n\t\tvalue: 'publish',\n\t\tdescription: __( 'Visible to everyone.' ),\n\t},\n];\n\nconst DESIGN_POST_TYPES = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n];\n\nexport default function PostStatus() {\n\tconst { status, date, password, postId, postType, canEdit } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPost,\n\t\t\t} = select( editorStore );\n\t\t\treturn {\n\t\t\t\tstatus: getEditedPostAttribute( 'status' ),\n\t\t\t\tdate: getEditedPostAttribute( 'date' ),\n\t\t\t\tpassword: getEditedPostAttribute( 'password' ),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tcanEdit:\n\t\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst [ showPassword, setShowPassword ] = useState( !! password );\n\tconst passwordInputId = useInstanceId(\n\t\tPostStatus,\n\t\t'editor-change-status__password-input'\n\t);\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': __( 'Status & visibility' ),\n\t\t\theaderTitle: __( 'Status & visibility' ),\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tif ( DESIGN_POST_TYPES.includes( postType ) ) {\n\t\treturn null;\n\t}\n\n\tconst updatePost = ( {\n\t\tstatus: newStatus = status,\n\t\tpassword: newPassword = password,\n\t\tdate: newDate = date,\n\t} ) => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tstatus: newStatus,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\tconst handleTogglePassword = ( value ) => {\n\t\tsetShowPassword( value );\n\t\tif ( ! value ) {\n\t\t\tupdatePost( { password: '' } );\n\t\t}\n\t};\n\n\tconst handleStatus = ( value ) => {\n\t\tlet newDate = date;\n\t\tlet newPassword = password;\n\t\tif ( status === 'future' && new Date( date ) > new Date() ) {\n\t\t\tnewDate = null;\n\t\t}\n\t\tif ( value === 'private' && password ) {\n\t\t\tnewPassword = '';\n\t\t}\n\t\tupdatePost( {\n\t\t\tstatus: value,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<PostPanelRow label={ __( 'Status' ) } ref={ setPopoverAnchor }>\n\t\t\t{ canEdit ? (\n\t\t\t\t<Dropdown\n\t\t\t\t\tclassName=\"editor-post-status\"\n\t\t\t\t\tcontentClassName=\"editor-change-status__content\"\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { onToggle, isOpen } ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\ticon={ postStatusesInfo[ status ]?.icon }\n\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Current post status.\n\t\t\t\t\t\t\t\t__( 'Change status: %s' ),\n\t\t\t\t\t\t\t\tpostStatusesInfo[ status ]?.label\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ postStatusesInfo[ status ]?.label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\t\ttitle={ __( 'Status & visibility' ) }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<form>\n\t\t\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\t\t\t\tclassName=\"editor-change-status__options\"\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Status' ) }\n\t\t\t\t\t\t\t\t\t\toptions={ STATUS_OPTIONS }\n\t\t\t\t\t\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\t\t\t\t\t\tselected={\n\t\t\t\t\t\t\t\t\t\t\tstatus === 'auto-draft'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'draft'\n\t\t\t\t\t\t\t\t\t\t\t\t: status\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ status === 'future' && (\n\t\t\t\t\t\t\t\t\t\t<div className=\"editor-change-status__publish-date-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t<PrivatePostSchedule\n\t\t\t\t\t\t\t\t\t\t\t\tshowPopoverHeaderActions={\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tisCompact\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ status !== 'private' && (\n\t\t\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\t\t\tas=\"fieldset\"\n\t\t\t\t\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-change-status__password-fieldset\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Password protected'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Only visible to those who know the password'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tchecked={ showPassword }\n\t\t\t\t\t\t\t\t\t\t\t\tonChange={\n\t\t\t\t\t\t\t\t\t\t\t\t\thandleTogglePassword\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t{ showPassword && (\n\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"editor-change-status__password-input\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Password'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePost( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpassword: value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tplaceholder={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Use a secure password'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid={ passwordInputId }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmaxLength={ 255 }\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"editor-post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