@wordpress/editor 13.15.0 → 13.17.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 (557) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/autocompleters/index.js +0 -2
  3. package/build/components/autocompleters/index.js.map +1 -1
  4. package/build/components/autocompleters/user.js +2 -9
  5. package/build/components/autocompleters/user.js.map +1 -1
  6. package/build/components/autosave-monitor/index.js +0 -24
  7. package/build/components/autosave-monitor/index.js.map +1 -1
  8. package/build/components/character-count/index.js +1 -4
  9. package/build/components/character-count/index.js.map +1 -1
  10. package/build/components/deprecated.js +1 -11
  11. package/build/components/deprecated.js.map +1 -1
  12. package/build/components/deprecated.native.js +0 -1
  13. package/build/components/deprecated.native.js.map +1 -1
  14. package/build/components/document-outline/check.js +1 -7
  15. package/build/components/document-outline/check.js.map +1 -1
  16. package/build/components/document-outline/index.js +7 -24
  17. package/build/components/document-outline/index.js.map +1 -1
  18. package/build/components/document-outline/item.js +1 -5
  19. package/build/components/document-outline/item.js.map +1 -1
  20. package/build/components/editor-help/add-blocks.native.js +1 -8
  21. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  22. package/build/components/editor-help/customize-blocks.native.js +1 -8
  23. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  24. package/build/components/editor-help/help-detail-navigation-screen.native.js +5 -13
  25. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  26. package/build/components/editor-help/help-get-support-button.native.js +1 -7
  27. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  28. package/build/components/editor-help/help-section-title.native.js +1 -7
  29. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  30. package/build/components/editor-help/help-topic-row.native.js +1 -8
  31. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  32. package/build/components/editor-help/icon-move-blocks.native.js +0 -4
  33. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  34. package/build/components/editor-help/index.native.js +8 -29
  35. package/build/components/editor-help/index.native.js.map +1 -1
  36. package/build/components/editor-help/intro-to-blocks.native.js +1 -9
  37. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  38. package/build/components/editor-help/move-blocks.native.js +1 -8
  39. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  40. package/build/components/editor-help/remove-blocks.native.js +1 -8
  41. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/view-sections.native.js +1 -12
  43. package/build/components/editor-help/view-sections.native.js.map +1 -1
  44. package/build/components/editor-history/redo.js +6 -14
  45. package/build/components/editor-history/redo.js.map +1 -1
  46. package/build/components/editor-history/undo.js +6 -14
  47. package/build/components/editor-history/undo.js.map +1 -1
  48. package/build/components/editor-notices/index.js +1 -10
  49. package/build/components/editor-notices/index.js.map +1 -1
  50. package/build/components/editor-snackbars/index.js +1 -5
  51. package/build/components/editor-snackbars/index.js.map +1 -1
  52. package/build/components/entities-saved-states/entity-record-item.js +3 -10
  53. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  54. package/build/components/entities-saved-states/entity-type-list.js +3 -15
  55. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  56. package/build/components/entities-saved-states/hooks/use-is-dirty.js +5 -14
  57. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  58. package/build/components/entities-saved-states/index.js +8 -27
  59. package/build/components/entities-saved-states/index.js.map +1 -1
  60. package/build/components/error-boundary/index.js +1 -18
  61. package/build/components/error-boundary/index.js.map +1 -1
  62. package/build/components/global-keyboard-shortcuts/index.js +5 -9
  63. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  64. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +1 -8
  65. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  66. package/build/components/index.js +4 -76
  67. package/build/components/index.js.map +1 -1
  68. package/build/components/index.native.js +0 -9
  69. package/build/components/index.native.js.map +1 -1
  70. package/build/components/local-autosave-monitor/index.js +6 -31
  71. package/build/components/local-autosave-monitor/index.js.map +1 -1
  72. package/build/components/media-categories/index.js +30 -45
  73. package/build/components/media-categories/index.js.map +1 -1
  74. package/build/components/page-attributes/check.js +3 -7
  75. package/build/components/page-attributes/check.js.map +1 -1
  76. package/build/components/page-attributes/order.js +17 -42
  77. package/build/components/page-attributes/order.js.map +1 -1
  78. package/build/components/page-attributes/parent.js +8 -34
  79. package/build/components/page-attributes/parent.js.map +1 -1
  80. package/build/components/post-author/check.js +1 -11
  81. package/build/components/post-author/check.js.map +1 -1
  82. package/build/components/post-author/combobox.js +7 -23
  83. package/build/components/post-author/combobox.js.map +1 -1
  84. package/build/components/post-author/constants.js +0 -1
  85. package/build/components/post-author/constants.js.map +1 -1
  86. package/build/components/post-author/index.js +1 -12
  87. package/build/components/post-author/index.js.map +1 -1
  88. package/build/components/post-author/select.js +1 -12
  89. package/build/components/post-author/select.js.map +1 -1
  90. package/build/components/post-comments/index.js +11 -23
  91. package/build/components/post-comments/index.js.map +1 -1
  92. package/build/components/post-excerpt/check.js +6 -8
  93. package/build/components/post-excerpt/check.js.map +1 -1
  94. package/build/components/post-excerpt/index.js +10 -27
  95. package/build/components/post-excerpt/index.js.map +1 -1
  96. package/build/components/post-featured-image/check.js +6 -9
  97. package/build/components/post-featured-image/check.js.map +1 -1
  98. package/build/components/post-featured-image/index.js +13 -42
  99. package/build/components/post-featured-image/index.js.map +1 -1
  100. package/build/components/post-format/check.js +9 -18
  101. package/build/components/post-format/check.js.map +1 -1
  102. package/build/components/post-format/index.js +2 -20
  103. package/build/components/post-format/index.js.map +1 -1
  104. package/build/components/post-last-revision/check.js +15 -22
  105. package/build/components/post-last-revision/check.js.map +1 -1
  106. package/build/components/post-last-revision/index.js +17 -28
  107. package/build/components/post-last-revision/index.js.map +1 -1
  108. package/build/components/post-locked-modal/index.js +8 -28
  109. package/build/components/post-locked-modal/index.js.map +1 -1
  110. package/build/components/post-pending-status/check.js +16 -24
  111. package/build/components/post-pending-status/check.js.map +1 -1
  112. package/build/components/post-pending-status/index.js +10 -28
  113. package/build/components/post-pending-status/index.js.map +1 -1
  114. package/build/components/post-pingbacks/index.js +11 -23
  115. package/build/components/post-pingbacks/index.js.map +1 -1
  116. package/build/components/post-preview-button/index.js +11 -22
  117. package/build/components/post-preview-button/index.js.map +1 -1
  118. package/build/components/post-publish-button/index.js +6 -32
  119. package/build/components/post-publish-button/index.js.map +1 -1
  120. package/build/components/post-publish-button/label.js +1 -10
  121. package/build/components/post-publish-button/label.js.map +1 -1
  122. package/build/components/post-publish-panel/index.js +1 -22
  123. package/build/components/post-publish-panel/index.js.map +1 -1
  124. package/build/components/post-publish-panel/maybe-category-panel.js +4 -14
  125. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  126. package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -18
  127. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  128. package/build/components/post-publish-panel/maybe-tags-panel.js +2 -17
  129. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  130. package/build/components/post-publish-panel/maybe-upload-media.js +1 -18
  131. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  132. package/build/components/post-publish-panel/postpublish.js +3 -27
  133. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  134. package/build/components/post-publish-panel/prepublish.js +1 -26
  135. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  136. package/build/components/post-saved-state/index.js +12 -29
  137. package/build/components/post-saved-state/index.js.map +1 -1
  138. package/build/components/post-schedule/check.js +1 -8
  139. package/build/components/post-schedule/check.js.map +1 -1
  140. package/build/components/post-schedule/index.js +7 -13
  141. package/build/components/post-schedule/index.js.map +1 -1
  142. package/build/components/post-schedule/label.js +18 -29
  143. package/build/components/post-schedule/label.js.map +1 -1
  144. package/build/components/post-slug/check.js +1 -4
  145. package/build/components/post-slug/check.js.map +1 -1
  146. package/build/components/post-slug/index.js +1 -19
  147. package/build/components/post-slug/index.js.map +1 -1
  148. package/build/components/post-sticky/check.js +1 -8
  149. package/build/components/post-sticky/check.js.map +1 -1
  150. package/build/components/post-sticky/index.js +1 -12
  151. package/build/components/post-sticky/index.js.map +1 -1
  152. package/build/components/post-switch-to-draft-button/index.js +1 -14
  153. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  154. package/build/components/post-sync-status/index.js +5 -18
  155. package/build/components/post-sync-status/index.js.map +1 -1
  156. package/build/components/post-taxonomies/check.js +1 -9
  157. package/build/components/post-taxonomies/check.js.map +1 -1
  158. package/build/components/post-taxonomies/flat-term-selector.js +15 -50
  159. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  160. package/build/components/post-taxonomies/hierarchical-term-selector.js +27 -79
  161. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  162. package/build/components/post-taxonomies/index.js +3 -13
  163. package/build/components/post-taxonomies/index.js.map +1 -1
  164. package/build/components/post-taxonomies/most-used-terms.js +1 -9
  165. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  166. package/build/components/post-template/index.js +1 -11
  167. package/build/components/post-template/index.js.map +1 -1
  168. package/build/components/post-text-editor/index.js +3 -17
  169. package/build/components/post-text-editor/index.js.map +1 -1
  170. package/build/components/post-title/index.js +14 -46
  171. package/build/components/post-title/index.js.map +1 -1
  172. package/build/components/post-title/index.native.js +7 -44
  173. package/build/components/post-title/index.native.js.map +1 -1
  174. package/build/components/post-trash/check.js +1 -7
  175. package/build/components/post-trash/check.js.map +1 -1
  176. package/build/components/post-trash/index.js +1 -8
  177. package/build/components/post-trash/index.js.map +1 -1
  178. package/build/components/post-type-support-check/index.js +10 -23
  179. package/build/components/post-type-support-check/index.js.map +1 -1
  180. package/build/components/post-url/check.js +1 -12
  181. package/build/components/post-url/check.js.map +1 -1
  182. package/build/components/post-url/index.js +3 -15
  183. package/build/components/post-url/index.js.map +1 -1
  184. package/build/components/post-url/label.js +1 -5
  185. package/build/components/post-url/label.js.map +1 -1
  186. package/build/components/post-visibility/check.js +1 -7
  187. package/build/components/post-visibility/check.js.map +1 -1
  188. package/build/components/post-visibility/index.js +1 -17
  189. package/build/components/post-visibility/index.js.map +1 -1
  190. package/build/components/post-visibility/label.js +1 -5
  191. package/build/components/post-visibility/label.js.map +1 -1
  192. package/build/components/post-visibility/utils.js +1 -2
  193. package/build/components/post-visibility/utils.js.map +1 -1
  194. package/build/components/provider/index.js +13 -27
  195. package/build/components/provider/index.js.map +1 -1
  196. package/build/components/provider/index.native.js +18 -70
  197. package/build/components/provider/index.native.js.map +1 -1
  198. package/build/components/provider/use-block-editor-settings.js +9 -20
  199. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  200. package/build/components/provider/use-block-editor-settings.native.js +5 -11
  201. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  202. package/build/components/provider/with-registry-provider.js +5 -12
  203. package/build/components/provider/with-registry-provider.js.map +1 -1
  204. package/build/components/table-of-contents/index.js +4 -14
  205. package/build/components/table-of-contents/index.js.map +1 -1
  206. package/build/components/table-of-contents/panel.js +1 -13
  207. package/build/components/table-of-contents/panel.js.map +1 -1
  208. package/build/components/template-validation-notice/index.js +3 -12
  209. package/build/components/template-validation-notice/index.js.map +1 -1
  210. package/build/components/theme-support-check/index.js +3 -12
  211. package/build/components/theme-support-check/index.js.map +1 -1
  212. package/build/components/time-to-read/index.js +2 -10
  213. package/build/components/time-to-read/index.js.map +1 -1
  214. package/build/components/unsaved-changes-warning/index.js +21 -35
  215. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  216. package/build/components/word-count/index.js +2 -7
  217. package/build/components/word-count/index.js.map +1 -1
  218. package/build/hooks/custom-sources-backwards-compatibility.js +8 -42
  219. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  220. package/build/hooks/default-autocompleters.js +3 -4
  221. package/build/hooks/default-autocompleters.js.map +1 -1
  222. package/build/hooks/index.js +0 -1
  223. package/build/hooks/index.js.map +1 -1
  224. package/build/hooks/index.native.js.map +1 -1
  225. package/build/index.js +0 -9
  226. package/build/index.js.map +1 -1
  227. package/build/index.native.js +0 -11
  228. package/build/index.native.js.map +1 -1
  229. package/build/lock-unlock.js +1 -2
  230. package/build/lock-unlock.js.map +1 -1
  231. package/build/private-apis.js +1 -4
  232. package/build/private-apis.js.map +1 -1
  233. package/build/store/actions.js +61 -130
  234. package/build/store/actions.js.map +1 -1
  235. package/build/store/actions.native.js +1 -8
  236. package/build/store/actions.native.js.map +1 -1
  237. package/build/store/constants.js +1 -2
  238. package/build/store/constants.js.map +1 -1
  239. package/build/store/defaults.js +2 -3
  240. package/build/store/defaults.js.map +1 -1
  241. package/build/store/index.js +3 -11
  242. package/build/store/index.js.map +1 -1
  243. package/build/store/local-autosave.js +0 -4
  244. package/build/store/local-autosave.js.map +1 -1
  245. package/build/store/reducer.js +19 -49
  246. package/build/store/reducer.js.map +1 -1
  247. package/build/store/reducer.native.js +3 -17
  248. package/build/store/reducer.native.js.map +1 -1
  249. package/build/store/selectors.js +170 -296
  250. package/build/store/selectors.js.map +1 -1
  251. package/build/store/selectors.native.js +4 -11
  252. package/build/store/selectors.native.js.map +1 -1
  253. package/build/store/utils/notice-builder.js +13 -24
  254. package/build/store/utils/notice-builder.js.map +1 -1
  255. package/build/utils/get-template-part-icon.js +0 -3
  256. package/build/utils/get-template-part-icon.js.map +1 -1
  257. package/build/utils/index.js +0 -4
  258. package/build/utils/index.js.map +1 -1
  259. package/build/utils/index.native.js +0 -2
  260. package/build/utils/index.native.js.map +1 -1
  261. package/build/utils/media-upload/index.js +2 -6
  262. package/build/utils/media-upload/index.js.map +1 -1
  263. package/build/utils/media-upload/index.native.js +0 -1
  264. package/build/utils/media-upload/index.native.js.map +1 -1
  265. package/build/utils/terms.js +8 -18
  266. package/build/utils/terms.js.map +1 -1
  267. package/build/utils/url.js +0 -4
  268. package/build/utils/url.js.map +1 -1
  269. package/build-module/components/autocompleters/index.js.map +1 -1
  270. package/build-module/components/autocompleters/user.js +2 -5
  271. package/build-module/components/autocompleters/user.js.map +1 -1
  272. package/build-module/components/autosave-monitor/index.js +2 -17
  273. package/build-module/components/autosave-monitor/index.js.map +1 -1
  274. package/build-module/components/character-count/index.js +1 -1
  275. package/build-module/components/character-count/index.js.map +1 -1
  276. package/build-module/components/deprecated.js +0 -4
  277. package/build-module/components/deprecated.js.map +1 -1
  278. package/build-module/components/deprecated.native.js +0 -1
  279. package/build-module/components/deprecated.native.js.map +1 -1
  280. package/build-module/components/document-outline/check.js +0 -4
  281. package/build-module/components/document-outline/check.js.map +1 -1
  282. package/build-module/components/document-outline/index.js +9 -13
  283. package/build-module/components/document-outline/index.js.map +1 -1
  284. package/build-module/components/document-outline/item.js +0 -3
  285. package/build-module/components/document-outline/item.js.map +1 -1
  286. package/build-module/components/editor-help/add-blocks.native.js +2 -5
  287. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  288. package/build-module/components/editor-help/customize-blocks.native.js +2 -5
  289. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  290. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +6 -8
  291. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  292. package/build-module/components/editor-help/help-get-support-button.native.js +2 -5
  293. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  294. package/build-module/components/editor-help/help-section-title.native.js +2 -5
  295. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  296. package/build-module/components/editor-help/help-topic-row.native.js +1 -6
  297. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  298. package/build-module/components/editor-help/icon-move-blocks.native.js +0 -1
  299. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  300. package/build-module/components/editor-help/index.native.js +9 -9
  301. package/build-module/components/editor-help/index.native.js.map +1 -1
  302. package/build-module/components/editor-help/intro-to-blocks.native.js +2 -5
  303. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  304. package/build-module/components/editor-help/move-blocks.native.js +2 -5
  305. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  306. package/build-module/components/editor-help/remove-blocks.native.js +2 -5
  307. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  308. package/build-module/components/editor-help/view-sections.native.js +2 -4
  309. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  310. package/build-module/components/editor-history/redo.js +6 -8
  311. package/build-module/components/editor-history/redo.js.map +1 -1
  312. package/build-module/components/editor-history/undo.js +6 -8
  313. package/build-module/components/editor-history/undo.js.map +1 -1
  314. package/build-module/components/editor-notices/index.js +1 -2
  315. package/build-module/components/editor-notices/index.js.map +1 -1
  316. package/build-module/components/editor-snackbars/index.js +0 -1
  317. package/build-module/components/editor-snackbars/index.js.map +1 -1
  318. package/build-module/components/entities-saved-states/entity-record-item.js +3 -4
  319. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  320. package/build-module/components/entities-saved-states/entity-type-list.js +3 -10
  321. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  322. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +4 -7
  323. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  324. package/build-module/components/entities-saved-states/index.js +8 -16
  325. package/build-module/components/entities-saved-states/index.js.map +1 -1
  326. package/build-module/components/error-boundary/index.js +1 -12
  327. package/build-module/components/error-boundary/index.js.map +1 -1
  328. package/build-module/components/global-keyboard-shortcuts/index.js +5 -6
  329. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  330. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +0 -3
  331. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  332. package/build-module/components/index.js +6 -3
  333. package/build-module/components/index.js.map +1 -1
  334. package/build-module/components/index.native.js +4 -2
  335. package/build-module/components/index.native.js.map +1 -1
  336. package/build-module/components/local-autosave-monitor/index.js +6 -21
  337. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  338. package/build-module/components/media-categories/index.js +31 -41
  339. package/build-module/components/media-categories/index.js.map +1 -1
  340. package/build-module/components/page-attributes/check.js +3 -3
  341. package/build-module/components/page-attributes/check.js.map +1 -1
  342. package/build-module/components/page-attributes/order.js +17 -31
  343. package/build-module/components/page-attributes/order.js.map +1 -1
  344. package/build-module/components/page-attributes/parent.js +9 -23
  345. package/build-module/components/page-attributes/parent.js.map +1 -1
  346. package/build-module/components/post-author/check.js +1 -5
  347. package/build-module/components/post-author/check.js.map +1 -1
  348. package/build-module/components/post-author/combobox.js +7 -16
  349. package/build-module/components/post-author/combobox.js.map +1 -1
  350. package/build-module/components/post-author/constants.js +0 -1
  351. package/build-module/components/post-author/constants.js.map +1 -1
  352. package/build-module/components/post-author/index.js +1 -6
  353. package/build-module/components/post-author/index.js.map +1 -1
  354. package/build-module/components/post-author/select.js +1 -6
  355. package/build-module/components/post-author/select.js.map +1 -1
  356. package/build-module/components/post-comments/index.js +12 -19
  357. package/build-module/components/post-comments/index.js.map +1 -1
  358. package/build-module/components/post-excerpt/check.js +5 -6
  359. package/build-module/components/post-excerpt/check.js.map +1 -1
  360. package/build-module/components/post-excerpt/index.js +11 -23
  361. package/build-module/components/post-excerpt/index.js.map +1 -1
  362. package/build-module/components/post-featured-image/check.js +5 -6
  363. package/build-module/components/post-featured-image/check.js.map +1 -1
  364. package/build-module/components/post-featured-image/index.js +13 -31
  365. package/build-module/components/post-featured-image/index.js.map +1 -1
  366. package/build-module/components/post-format/check.js +10 -15
  367. package/build-module/components/post-format/check.js.map +1 -1
  368. package/build-module/components/post-format/index.js +4 -12
  369. package/build-module/components/post-format/index.js.map +1 -1
  370. package/build-module/components/post-last-revision/check.js +17 -17
  371. package/build-module/components/post-last-revision/check.js.map +1 -1
  372. package/build-module/components/post-last-revision/index.js +18 -21
  373. package/build-module/components/post-last-revision/index.js.map +1 -1
  374. package/build-module/components/post-locked-modal/index.js +8 -22
  375. package/build-module/components/post-locked-modal/index.js.map +1 -1
  376. package/build-module/components/post-pending-status/check.js +17 -20
  377. package/build-module/components/post-pending-status/check.js.map +1 -1
  378. package/build-module/components/post-pending-status/index.js +11 -20
  379. package/build-module/components/post-pending-status/index.js.map +1 -1
  380. package/build-module/components/post-pingbacks/index.js +12 -19
  381. package/build-module/components/post-pingbacks/index.js.map +1 -1
  382. package/build-module/components/post-preview-button/index.js +11 -17
  383. package/build-module/components/post-preview-button/index.js.map +1 -1
  384. package/build-module/components/post-publish-button/index.js +7 -23
  385. package/build-module/components/post-publish-button/index.js.map +1 -1
  386. package/build-module/components/post-publish-button/label.js +1 -4
  387. package/build-module/components/post-publish-button/label.js.map +1 -1
  388. package/build-module/components/post-publish-panel/index.js +1 -8
  389. package/build-module/components/post-publish-panel/index.js.map +1 -1
  390. package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -8
  391. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  392. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -12
  393. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  394. package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -9
  395. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  396. package/build-module/components/post-publish-panel/maybe-upload-media.js +1 -12
  397. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  398. package/build-module/components/post-publish-panel/postpublish.js +3 -16
  399. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  400. package/build-module/components/post-publish-panel/prepublish.js +1 -10
  401. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  402. package/build-module/components/post-saved-state/index.js +15 -23
  403. package/build-module/components/post-saved-state/index.js.map +1 -1
  404. package/build-module/components/post-schedule/check.js +1 -3
  405. package/build-module/components/post-schedule/check.js.map +1 -1
  406. package/build-module/components/post-schedule/index.js +8 -8
  407. package/build-module/components/post-schedule/index.js.map +1 -1
  408. package/build-module/components/post-schedule/label.js +18 -22
  409. package/build-module/components/post-schedule/label.js.map +1 -1
  410. package/build-module/components/post-slug/check.js +0 -1
  411. package/build-module/components/post-slug/check.js.map +1 -1
  412. package/build-module/components/post-slug/index.js +1 -8
  413. package/build-module/components/post-slug/index.js.map +1 -1
  414. package/build-module/components/post-sticky/check.js +1 -3
  415. package/build-module/components/post-sticky/check.js.map +1 -1
  416. package/build-module/components/post-sticky/index.js +1 -3
  417. package/build-module/components/post-sticky/index.js.map +1 -1
  418. package/build-module/components/post-switch-to-draft-button/index.js +1 -9
  419. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  420. package/build-module/components/post-sync-status/index.js +5 -11
  421. package/build-module/components/post-sync-status/index.js.map +1 -1
  422. package/build-module/components/post-taxonomies/check.js +1 -3
  423. package/build-module/components/post-taxonomies/check.js.map +1 -1
  424. package/build-module/components/post-taxonomies/flat-term-selector.js +17 -39
  425. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  426. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +29 -66
  427. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  428. package/build-module/components/post-taxonomies/index.js +3 -5
  429. package/build-module/components/post-taxonomies/index.js.map +1 -1
  430. package/build-module/components/post-taxonomies/most-used-terms.js +1 -4
  431. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  432. package/build-module/components/post-template/index.js +1 -5
  433. package/build-module/components/post-template/index.js.map +1 -1
  434. package/build-module/components/post-text-editor/index.js +4 -9
  435. package/build-module/components/post-text-editor/index.js.map +1 -1
  436. package/build-module/components/post-title/index.js +17 -35
  437. package/build-module/components/post-title/index.js.map +1 -1
  438. package/build-module/components/post-title/index.native.js +8 -33
  439. package/build-module/components/post-title/index.native.js.map +1 -1
  440. package/build-module/components/post-trash/check.js +1 -4
  441. package/build-module/components/post-trash/check.js.map +1 -1
  442. package/build-module/components/post-trash/index.js +1 -4
  443. package/build-module/components/post-trash/index.js.map +1 -1
  444. package/build-module/components/post-type-support-check/index.js +14 -20
  445. package/build-module/components/post-type-support-check/index.js.map +1 -1
  446. package/build-module/components/post-url/check.js +1 -9
  447. package/build-module/components/post-url/check.js.map +1 -1
  448. package/build-module/components/post-url/index.js +3 -8
  449. package/build-module/components/post-url/index.js.map +1 -1
  450. package/build-module/components/post-url/label.js +1 -1
  451. package/build-module/components/post-url/label.js.map +1 -1
  452. package/build-module/components/post-visibility/check.js +1 -2
  453. package/build-module/components/post-visibility/check.js.map +1 -1
  454. package/build-module/components/post-visibility/index.js +1 -10
  455. package/build-module/components/post-visibility/index.js.map +1 -1
  456. package/build-module/components/post-visibility/label.js +1 -1
  457. package/build-module/components/post-visibility/label.js.map +1 -1
  458. package/build-module/components/post-visibility/utils.js.map +1 -1
  459. package/build-module/components/provider/index.js +13 -14
  460. package/build-module/components/provider/index.js.map +1 -1
  461. package/build-module/components/provider/index.native.js +21 -52
  462. package/build-module/components/provider/index.native.js.map +1 -1
  463. package/build-module/components/provider/use-block-editor-settings.js +9 -12
  464. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  465. package/build-module/components/provider/use-block-editor-settings.native.js +5 -5
  466. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  467. package/build-module/components/provider/with-registry-provider.js +5 -8
  468. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  469. package/build-module/components/table-of-contents/index.js +4 -7
  470. package/build-module/components/table-of-contents/index.js.map +1 -1
  471. package/build-module/components/table-of-contents/panel.js +1 -5
  472. package/build-module/components/table-of-contents/panel.js.map +1 -1
  473. package/build-module/components/template-validation-notice/index.js +2 -6
  474. package/build-module/components/template-validation-notice/index.js.map +1 -1
  475. package/build-module/components/theme-support-check/index.js +3 -7
  476. package/build-module/components/theme-support-check/index.js.map +1 -1
  477. package/build-module/components/time-to-read/index.js +4 -7
  478. package/build-module/components/time-to-read/index.js.map +1 -1
  479. package/build-module/components/unsaved-changes-warning/index.js +22 -31
  480. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  481. package/build-module/components/word-count/index.js +2 -4
  482. package/build-module/components/word-count/index.js.map +1 -1
  483. package/build-module/hooks/custom-sources-backwards-compatibility.js +11 -39
  484. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  485. package/build-module/hooks/default-autocompleters.js +3 -4
  486. package/build-module/hooks/default-autocompleters.js.map +1 -1
  487. package/build-module/hooks/index.js.map +1 -1
  488. package/build-module/hooks/index.native.js.map +1 -1
  489. package/build-module/index.js +1 -1
  490. package/build-module/index.js.map +1 -1
  491. package/build-module/index.native.js +1 -1
  492. package/build-module/index.native.js.map +1 -1
  493. package/build-module/lock-unlock.js.map +1 -1
  494. package/build-module/private-apis.js.map +1 -1
  495. package/build-module/store/actions.js +63 -85
  496. package/build-module/store/actions.js.map +1 -1
  497. package/build-module/store/actions.native.js +2 -2
  498. package/build-module/store/actions.native.js.map +1 -1
  499. package/build-module/store/constants.js +1 -1
  500. package/build-module/store/constants.js.map +1 -1
  501. package/build-module/store/defaults.js +3 -2
  502. package/build-module/store/defaults.js.map +1 -1
  503. package/build-module/store/index.js +5 -4
  504. package/build-module/store/index.js.map +1 -1
  505. package/build-module/store/local-autosave.js +0 -1
  506. package/build-module/store/local-autosave.js.map +1 -1
  507. package/build-module/store/reducer.js +21 -33
  508. package/build-module/store/reducer.js.map +1 -1
  509. package/build-module/store/reducer.native.js +4 -10
  510. package/build-module/store/reducer.native.js.map +1 -1
  511. package/build-module/store/selectors.js +173 -223
  512. package/build-module/store/selectors.js.map +1 -1
  513. package/build-module/store/selectors.native.js +6 -8
  514. package/build-module/store/selectors.native.js.map +1 -1
  515. package/build-module/store/utils/notice-builder.js +15 -21
  516. package/build-module/store/utils/notice-builder.js.map +1 -1
  517. package/build-module/utils/get-template-part-icon.js +0 -2
  518. package/build-module/utils/get-template-part-icon.js.map +1 -1
  519. package/build-module/utils/index.js.map +1 -1
  520. package/build-module/utils/index.native.js.map +1 -1
  521. package/build-module/utils/media-upload/index.js +2 -4
  522. package/build-module/utils/media-upload/index.js.map +1 -1
  523. package/build-module/utils/media-upload/index.native.js.map +1 -1
  524. package/build-module/utils/terms.js +9 -11
  525. package/build-module/utils/terms.js.map +1 -1
  526. package/build-module/utils/url.js +1 -1
  527. package/build-module/utils/url.js.map +1 -1
  528. package/build-style/style-rtl.css +10 -17
  529. package/build-style/style.css +10 -17
  530. package/package.json +32 -31
  531. package/src/components/editor-help/index.native.js +1 -1
  532. package/src/components/editor-help/style.scss +5 -0
  533. package/src/components/page-attributes/order.js +15 -23
  534. package/src/components/page-attributes/test/order.js +46 -15
  535. package/src/components/post-author/test/check.js +18 -12
  536. package/src/components/post-comments/index.js +11 -17
  537. package/src/components/post-excerpt/check.js +6 -2
  538. package/src/components/post-excerpt/index.js +10 -16
  539. package/src/components/post-featured-image/check.js +4 -2
  540. package/src/components/post-format/check.js +16 -11
  541. package/src/components/post-last-revision/check.js +12 -14
  542. package/src/components/post-last-revision/index.js +12 -10
  543. package/src/components/post-last-revision/test/check.js +28 -16
  544. package/src/components/post-pending-status/check.js +13 -19
  545. package/src/components/post-pending-status/index.js +9 -14
  546. package/src/components/post-pending-status/test/check.js +32 -10
  547. package/src/components/post-pingbacks/index.js +11 -15
  548. package/src/components/post-publish-panel/style.scss +12 -25
  549. package/src/components/post-sync-status/style.scss +4 -1
  550. package/src/components/post-type-support-check/index.js +8 -10
  551. package/src/components/post-type-support-check/test/index.js +36 -20
  552. package/src/components/provider/index.js +3 -2
  553. package/src/components/unsaved-changes-warning/index.js +22 -27
  554. package/src/hooks/custom-sources-backwards-compatibility.js +1 -25
  555. package/src/store/actions.js +1 -1
  556. package/src/store/selectors.js +2 -2
  557. package/src/store/test/selectors.js +13 -13
@@ -1,27 +1,24 @@
1
1
  import { createElement, Fragment } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * External dependencies
5
4
  */
6
5
  import classnames from 'classnames';
6
+
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
-
11
10
  import { Button } from '@wordpress/components';
12
11
  import { Component, createRef } from '@wordpress/element';
13
12
  import { withSelect, withDispatch } from '@wordpress/data';
14
13
  import { compose } from '@wordpress/compose';
15
14
  import { __ } from '@wordpress/i18n';
15
+
16
16
  /**
17
17
  * Internal dependencies
18
18
  */
19
-
20
19
  import PublishButtonLabel from './label';
21
20
  import { store as editorStore } from '../../store';
22
-
23
21
  const noop = () => {};
24
-
25
22
  export class PostPublishButton extends Component {
26
23
  constructor(props) {
27
24
  super(props);
@@ -32,7 +29,6 @@ export class PostPublishButton extends Component {
32
29
  entitiesSavedStatesCallback: false
33
30
  };
34
31
  }
35
-
36
32
  componentDidMount() {
37
33
  if (this.props.focusOnMount) {
38
34
  // This timeout is necessary to make sure the `useEffect` hook of
@@ -43,41 +39,38 @@ export class PostPublishButton extends Component {
43
39
  }, 0);
44
40
  }
45
41
  }
46
-
47
42
  componentWillUnmount() {
48
43
  clearTimeout(this.timeoutID);
49
44
  }
50
-
51
45
  createOnClick(callback) {
52
46
  return (...args) => {
53
47
  const {
54
48
  hasNonPostEntityChanges,
55
49
  setEntitiesSavedStatesCallback
56
- } = this.props; // If a post with non-post entities is published, but the user
50
+ } = this.props;
51
+ // If a post with non-post entities is published, but the user
57
52
  // elects to not save changes to the non-post entities, those
58
53
  // entities will still be dirty when the Publish button is clicked.
59
54
  // We also need to check that the `setEntitiesSavedStatesCallback`
60
55
  // prop was passed. See https://github.com/WordPress/gutenberg/pull/37383
61
-
62
56
  if (hasNonPostEntityChanges && setEntitiesSavedStatesCallback) {
63
57
  // The modal for multiple entity saving will open,
64
58
  // hold the callback for saving/publishing the post
65
59
  // so that we can call it if the post entity is checked.
66
60
  this.setState({
67
61
  entitiesSavedStatesCallback: () => callback(...args)
68
- }); // Open the save panel by setting its callback.
62
+ });
63
+
64
+ // Open the save panel by setting its callback.
69
65
  // To set a function on the useState hook, we must set it
70
66
  // with another function (() => myFunction). Passing the
71
67
  // function on its own will cause an error when called.
72
-
73
68
  setEntitiesSavedStatesCallback(() => this.closeEntitiesSavedStates);
74
69
  return noop;
75
70
  }
76
-
77
71
  return callback(...args);
78
72
  };
79
73
  }
80
-
81
74
  closeEntitiesSavedStates(savedEntities) {
82
75
  const {
83
76
  postType,
@@ -95,7 +88,6 @@ export class PostPublishButton extends Component {
95
88
  }
96
89
  });
97
90
  }
98
-
99
91
  render() {
100
92
  const {
101
93
  forceIsDirty,
@@ -120,7 +112,6 @@ export class PostPublishButton extends Component {
120
112
  const isButtonDisabled = (isSaving || !isSaveable || isPostSavingLocked || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges);
121
113
  const isToggleDisabled = (isPublished || isSaving || !isSaveable || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges);
122
114
  let publishStatus;
123
-
124
115
  if (!hasPublishAction) {
125
116
  publishStatus = 'pending';
126
117
  } else if (visibility === 'private') {
@@ -130,25 +121,20 @@ export class PostPublishButton extends Component {
130
121
  } else {
131
122
  publishStatus = 'publish';
132
123
  }
133
-
134
124
  const onClickButton = () => {
135
125
  if (isButtonDisabled) {
136
126
  return;
137
127
  }
138
-
139
128
  onSubmit();
140
129
  onStatusChange(publishStatus);
141
130
  onSave();
142
131
  };
143
-
144
132
  const onClickToggle = () => {
145
133
  if (isToggleDisabled) {
146
134
  return;
147
135
  }
148
-
149
136
  onToggle();
150
137
  };
151
-
152
138
  const buttonProps = {
153
139
  'aria-disabled': isButtonDisabled,
154
140
  className: 'editor-post-publish-button',
@@ -178,11 +164,9 @@ export class PostPublishButton extends Component {
178
164
  })
179
165
  }, componentChildren));
180
166
  }
181
-
182
167
  }
183
168
  export default compose([withSelect(select => {
184
169
  var _getCurrentPost$_link;
185
-
186
170
  const {
187
171
  isSavingPost,
188
172
  isAutosavingPost,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-publish-button/index.js"],"names":["classnames","Button","Component","createRef","withSelect","withDispatch","compose","__","PublishButtonLabel","store","editorStore","noop","PostPublishButton","constructor","props","buttonNode","createOnClick","bind","closeEntitiesSavedStates","state","entitiesSavedStatesCallback","componentDidMount","focusOnMount","timeoutID","setTimeout","current","focus","componentWillUnmount","clearTimeout","callback","args","hasNonPostEntityChanges","setEntitiesSavedStatesCallback","setState","savedEntities","postType","postId","some","elt","kind","name","key","render","forceIsDirty","hasPublishAction","isBeingScheduled","isOpen","isPostSavingLocked","isPublishable","isPublished","isSaveable","isSaving","isAutoSaving","isToggle","onSave","onStatusChange","onSubmit","onToggle","visibility","isSavingNonPostEntityChanges","isButtonDisabled","isToggleDisabled","publishStatus","onClickButton","onClickToggle","buttonProps","className","isBusy","variant","onClick","toggleProps","toggleChildren","buttonChildren","componentProps","componentChildren","select","isSavingPost","isAutosavingPost","isEditedPostBeingScheduled","getEditedPostVisibility","isCurrentPostPublished","isEditedPostSaveable","isEditedPostPublishable","getCurrentPost","getCurrentPostType","getCurrentPostId","_links","dispatch","editPost","savePost","status","undoIgnore"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,EAAoBC,SAApB,QAAqC,oBAArC;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,kBAAP,MAA+B,SAA/B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,OAAO,MAAMC,iBAAN,SAAgCV,SAAhC,CAA0C;AAChDW,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAOA,KAAP;AACA,SAAKC,UAAL,GAAkBZ,SAAS,EAA3B;AAEA,SAAKa,aAAL,GAAqB,KAAKA,aAAL,CAAmBC,IAAnB,CAAyB,IAAzB,CAArB;AACA,SAAKC,wBAAL,GACC,KAAKA,wBAAL,CAA8BD,IAA9B,CAAoC,IAApC,CADD;AAGA,SAAKE,KAAL,GAAa;AACZC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E7E,WAAF,CAAvC;AACA,SAAO;AACN6C,IAAAA,cAAc,EAAImC,MAAF,IACfF,QAAQ,CAAE;AAAEE,MAAAA;AAAF,KAAF,EAAc;AAAEC,MAAAA,UAAU,EAAE;AAAd,KAAd,CAFH;AAGNrC,IAAAA,MAAM,EAAEmC;AAHF,GAAP;AAKA,CAPW,CAlCW,CAAF,CAAP,CA0CV7E,iBA1CU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PublishButtonLabel from './label';\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\nexport class PostPublishButton extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.buttonNode = createRef();\n\n\t\tthis.createOnClick = this.createOnClick.bind( this );\n\t\tthis.closeEntitiesSavedStates =\n\t\t\tthis.closeEntitiesSavedStates.bind( this );\n\n\t\tthis.state = {\n\t\t\tentitiesSavedStatesCallback: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\t// This timeout is necessary to make sure the `useEffect` hook of\n\t\t\t// `useFocusReturn` gets the correct element (the button that opens the\n\t\t\t// PostPublishPanel) otherwise it will get this button.\n\t\t\tthis.timeoutID = setTimeout( () => {\n\t\t\t\tthis.buttonNode.current.focus();\n\t\t\t}, 0 );\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeoutID );\n\t}\n\n\tcreateOnClick( callback ) {\n\t\treturn ( ...args ) => {\n\t\t\tconst { hasNonPostEntityChanges, setEntitiesSavedStatesCallback } =\n\t\t\t\tthis.props;\n\t\t\t// If a post with non-post entities is published, but the user\n\t\t\t// elects to not save changes to the non-post entities, those\n\t\t\t// entities will still be dirty when the Publish button is clicked.\n\t\t\t// We also need to check that the `setEntitiesSavedStatesCallback`\n\t\t\t// prop was passed. See https://github.com/WordPress/gutenberg/pull/37383\n\t\t\tif ( hasNonPostEntityChanges && setEntitiesSavedStatesCallback ) {\n\t\t\t\t// The modal for multiple entity saving will open,\n\t\t\t\t// hold the callback for saving/publishing the post\n\t\t\t\t// so that we can call it if the post entity is checked.\n\t\t\t\tthis.setState( {\n\t\t\t\t\tentitiesSavedStatesCallback: () => callback( ...args ),\n\t\t\t\t} );\n\n\t\t\t\t// Open the save panel by setting its callback.\n\t\t\t\t// To set a function on the useState hook, we must set it\n\t\t\t\t// with another function (() => myFunction). Passing the\n\t\t\t\t// function on its own will cause an error when called.\n\t\t\t\tsetEntitiesSavedStatesCallback(\n\t\t\t\t\t() => this.closeEntitiesSavedStates\n\t\t\t\t);\n\t\t\t\treturn noop;\n\t\t\t}\n\n\t\t\treturn callback( ...args );\n\t\t};\n\t}\n\n\tcloseEntitiesSavedStates( savedEntities ) {\n\t\tconst { postType, postId } = this.props;\n\t\tconst { entitiesSavedStatesCallback } = this.state;\n\t\tthis.setState( { entitiesSavedStatesCallback: false }, () => {\n\t\t\tif (\n\t\t\t\tsavedEntities &&\n\t\t\t\tsavedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === 'postType' &&\n\t\t\t\t\t\telt.name === postType &&\n\t\t\t\t\t\telt.key === postId\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// The post entity was checked, call the held callback from `createOnClick`.\n\t\t\t\tentitiesSavedStatesCallback();\n\t\t\t}\n\t\t} );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\thasPublishAction,\n\t\t\tisBeingScheduled,\n\t\t\tisOpen,\n\t\t\tisPostSavingLocked,\n\t\t\tisPublishable,\n\t\t\tisPublished,\n\t\t\tisSaveable,\n\t\t\tisSaving,\n\t\t\tisAutoSaving,\n\t\t\tisToggle,\n\t\t\tonSave,\n\t\t\tonStatusChange,\n\t\t\tonSubmit = noop,\n\t\t\tonToggle,\n\t\t\tvisibility,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t} = this.props;\n\n\t\tconst isButtonDisabled =\n\t\t\t( isSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\tisPostSavingLocked ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );\n\n\t\tconst isToggleDisabled =\n\t\t\t( isPublished ||\n\t\t\t\tisSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );\n\n\t\tlet publishStatus;\n\t\tif ( ! hasPublishAction ) {\n\t\t\tpublishStatus = 'pending';\n\t\t} else if ( visibility === 'private' ) {\n\t\t\tpublishStatus = 'private';\n\t\t} else if ( isBeingScheduled ) {\n\t\t\tpublishStatus = 'future';\n\t\t} else {\n\t\t\tpublishStatus = 'publish';\n\t\t}\n\n\t\tconst onClickButton = () => {\n\t\t\tif ( isButtonDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonSubmit();\n\t\t\tonStatusChange( publishStatus );\n\t\t\tonSave();\n\t\t};\n\n\t\tconst onClickToggle = () => {\n\t\t\tif ( isToggleDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonToggle();\n\t\t};\n\n\t\tconst buttonProps = {\n\t\t\t'aria-disabled': isButtonDisabled,\n\t\t\tclassName: 'editor-post-publish-button',\n\t\t\tisBusy: ! isAutoSaving && isSaving,\n\t\t\tvariant: 'primary',\n\t\t\tonClick: this.createOnClick( onClickButton ),\n\t\t};\n\n\t\tconst toggleProps = {\n\t\t\t'aria-disabled': isToggleDisabled,\n\t\t\t'aria-expanded': isOpen,\n\t\t\tclassName: 'editor-post-publish-panel__toggle',\n\t\t\tisBusy: isSaving && isPublished,\n\t\t\tvariant: 'primary',\n\t\t\tonClick: this.createOnClick( onClickToggle ),\n\t\t};\n\n\t\tconst toggleChildren = isBeingScheduled\n\t\t\t? __( 'Schedule…' )\n\t\t\t: __( 'Publish' );\n\t\tconst buttonChildren = (\n\t\t\t<PublishButtonLabel\n\t\t\t\thasNonPostEntityChanges={ hasNonPostEntityChanges }\n\t\t\t/>\n\t\t);\n\n\t\tconst componentProps = isToggle ? toggleProps : buttonProps;\n\t\tconst componentChildren = isToggle ? toggleChildren : buttonChildren;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button\n\t\t\t\t\tref={ this.buttonNode }\n\t\t\t\t\t{ ...componentProps }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\tcomponentProps.className,\n\t\t\t\t\t\t'editor-post-publish-button__button',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'has-changes-dot': hasNonPostEntityChanges,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ componentChildren }\n\t\t\t\t</Button>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisSavingPost,\n\t\t\tisAutosavingPost,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tgetEditedPostVisibility,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostSaveable,\n\t\t\tisEditedPostPublishable,\n\t\t\tisPostSavingLocked,\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisAutoSaving: isAutosavingPost(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tvisibility: getEditedPostVisibility(),\n\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\tisPostSavingLocked: isPostSavingLocked(),\n\t\t\tisPublishable: isEditedPostPublishable(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\thasNonPostEntityChanges: hasNonPostEntityChanges(),\n\t\t\tisSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, savePost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonStatusChange: ( status ) =>\n\t\t\t\teditPost( { status }, { undoIgnore: true } ),\n\t\t\tonSave: savePost,\n\t\t};\n\t} ),\n] )( PostPublishButton );\n"]}
1
+ {"version":3,"names":["classnames","Button","Component","createRef","withSelect","withDispatch","compose","__","PublishButtonLabel","store","editorStore","noop","PostPublishButton","constructor","props","buttonNode","createOnClick","bind","closeEntitiesSavedStates","state","entitiesSavedStatesCallback","componentDidMount","focusOnMount","timeoutID","setTimeout","current","focus","componentWillUnmount","clearTimeout","callback","args","hasNonPostEntityChanges","setEntitiesSavedStatesCallback","setState","savedEntities","postType","postId","some","elt","kind","name","key","render","forceIsDirty","hasPublishAction","isBeingScheduled","isOpen","isPostSavingLocked","isPublishable","isPublished","isSaveable","isSaving","isAutoSaving","isToggle","onSave","onStatusChange","onSubmit","onToggle","visibility","isSavingNonPostEntityChanges","isButtonDisabled","isToggleDisabled","publishStatus","onClickButton","onClickToggle","buttonProps","className","isBusy","variant","onClick","toggleProps","toggleChildren","buttonChildren","createElement","componentProps","componentChildren","Fragment","ref","select","_getCurrentPost$_link","isSavingPost","isAutosavingPost","isEditedPostBeingScheduled","getEditedPostVisibility","isCurrentPostPublished","isEditedPostSaveable","isEditedPostPublishable","getCurrentPost","getCurrentPostType","getCurrentPostId","_links","dispatch","editPost","savePost","status","undoIgnore"],"sources":["@wordpress/editor/src/components/post-publish-button/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PublishButtonLabel from './label';\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\nexport class PostPublishButton extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.buttonNode = createRef();\n\n\t\tthis.createOnClick = this.createOnClick.bind( this );\n\t\tthis.closeEntitiesSavedStates =\n\t\t\tthis.closeEntitiesSavedStates.bind( this );\n\n\t\tthis.state = {\n\t\t\tentitiesSavedStatesCallback: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\t// This timeout is necessary to make sure the `useEffect` hook of\n\t\t\t// `useFocusReturn` gets the correct element (the button that opens the\n\t\t\t// PostPublishPanel) otherwise it will get this button.\n\t\t\tthis.timeoutID = setTimeout( () => {\n\t\t\t\tthis.buttonNode.current.focus();\n\t\t\t}, 0 );\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeoutID );\n\t}\n\n\tcreateOnClick( callback ) {\n\t\treturn ( ...args ) => {\n\t\t\tconst { hasNonPostEntityChanges, setEntitiesSavedStatesCallback } =\n\t\t\t\tthis.props;\n\t\t\t// If a post with non-post entities is published, but the user\n\t\t\t// elects to not save changes to the non-post entities, those\n\t\t\t// entities will still be dirty when the Publish button is clicked.\n\t\t\t// We also need to check that the `setEntitiesSavedStatesCallback`\n\t\t\t// prop was passed. See https://github.com/WordPress/gutenberg/pull/37383\n\t\t\tif ( hasNonPostEntityChanges && setEntitiesSavedStatesCallback ) {\n\t\t\t\t// The modal for multiple entity saving will open,\n\t\t\t\t// hold the callback for saving/publishing the post\n\t\t\t\t// so that we can call it if the post entity is checked.\n\t\t\t\tthis.setState( {\n\t\t\t\t\tentitiesSavedStatesCallback: () => callback( ...args ),\n\t\t\t\t} );\n\n\t\t\t\t// Open the save panel by setting its callback.\n\t\t\t\t// To set a function on the useState hook, we must set it\n\t\t\t\t// with another function (() => myFunction). Passing the\n\t\t\t\t// function on its own will cause an error when called.\n\t\t\t\tsetEntitiesSavedStatesCallback(\n\t\t\t\t\t() => this.closeEntitiesSavedStates\n\t\t\t\t);\n\t\t\t\treturn noop;\n\t\t\t}\n\n\t\t\treturn callback( ...args );\n\t\t};\n\t}\n\n\tcloseEntitiesSavedStates( savedEntities ) {\n\t\tconst { postType, postId } = this.props;\n\t\tconst { entitiesSavedStatesCallback } = this.state;\n\t\tthis.setState( { entitiesSavedStatesCallback: false }, () => {\n\t\t\tif (\n\t\t\t\tsavedEntities &&\n\t\t\t\tsavedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === 'postType' &&\n\t\t\t\t\t\telt.name === postType &&\n\t\t\t\t\t\telt.key === postId\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// The post entity was checked, call the held callback from `createOnClick`.\n\t\t\t\tentitiesSavedStatesCallback();\n\t\t\t}\n\t\t} );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\thasPublishAction,\n\t\t\tisBeingScheduled,\n\t\t\tisOpen,\n\t\t\tisPostSavingLocked,\n\t\t\tisPublishable,\n\t\t\tisPublished,\n\t\t\tisSaveable,\n\t\t\tisSaving,\n\t\t\tisAutoSaving,\n\t\t\tisToggle,\n\t\t\tonSave,\n\t\t\tonStatusChange,\n\t\t\tonSubmit = noop,\n\t\t\tonToggle,\n\t\t\tvisibility,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t} = this.props;\n\n\t\tconst isButtonDisabled =\n\t\t\t( isSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\tisPostSavingLocked ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );\n\n\t\tconst isToggleDisabled =\n\t\t\t( isPublished ||\n\t\t\t\tisSaving ||\n\t\t\t\t! isSaveable ||\n\t\t\t\t( ! isPublishable && ! forceIsDirty ) ) &&\n\t\t\t( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );\n\n\t\tlet publishStatus;\n\t\tif ( ! hasPublishAction ) {\n\t\t\tpublishStatus = 'pending';\n\t\t} else if ( visibility === 'private' ) {\n\t\t\tpublishStatus = 'private';\n\t\t} else if ( isBeingScheduled ) {\n\t\t\tpublishStatus = 'future';\n\t\t} else {\n\t\t\tpublishStatus = 'publish';\n\t\t}\n\n\t\tconst onClickButton = () => {\n\t\t\tif ( isButtonDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonSubmit();\n\t\t\tonStatusChange( publishStatus );\n\t\t\tonSave();\n\t\t};\n\n\t\tconst onClickToggle = () => {\n\t\t\tif ( isToggleDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonToggle();\n\t\t};\n\n\t\tconst buttonProps = {\n\t\t\t'aria-disabled': isButtonDisabled,\n\t\t\tclassName: 'editor-post-publish-button',\n\t\t\tisBusy: ! isAutoSaving && isSaving,\n\t\t\tvariant: 'primary',\n\t\t\tonClick: this.createOnClick( onClickButton ),\n\t\t};\n\n\t\tconst toggleProps = {\n\t\t\t'aria-disabled': isToggleDisabled,\n\t\t\t'aria-expanded': isOpen,\n\t\t\tclassName: 'editor-post-publish-panel__toggle',\n\t\t\tisBusy: isSaving && isPublished,\n\t\t\tvariant: 'primary',\n\t\t\tonClick: this.createOnClick( onClickToggle ),\n\t\t};\n\n\t\tconst toggleChildren = isBeingScheduled\n\t\t\t? __( 'Schedule…' )\n\t\t\t: __( 'Publish' );\n\t\tconst buttonChildren = (\n\t\t\t<PublishButtonLabel\n\t\t\t\thasNonPostEntityChanges={ hasNonPostEntityChanges }\n\t\t\t/>\n\t\t);\n\n\t\tconst componentProps = isToggle ? toggleProps : buttonProps;\n\t\tconst componentChildren = isToggle ? toggleChildren : buttonChildren;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button\n\t\t\t\t\tref={ this.buttonNode }\n\t\t\t\t\t{ ...componentProps }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\tcomponentProps.className,\n\t\t\t\t\t\t'editor-post-publish-button__button',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'has-changes-dot': hasNonPostEntityChanges,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ componentChildren }\n\t\t\t\t</Button>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisSavingPost,\n\t\t\tisAutosavingPost,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tgetEditedPostVisibility,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostSaveable,\n\t\t\tisEditedPostPublishable,\n\t\t\tisPostSavingLocked,\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\thasNonPostEntityChanges,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisAutoSaving: isAutosavingPost(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tvisibility: getEditedPostVisibility(),\n\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\tisPostSavingLocked: isPostSavingLocked(),\n\t\t\tisPublishable: isEditedPostPublishable(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\thasNonPostEntityChanges: hasNonPostEntityChanges(),\n\t\t\tisSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, savePost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonStatusChange: ( status ) =>\n\t\t\t\teditPost( { status }, { undoIgnore: true } ),\n\t\t\tonSave: savePost,\n\t\t};\n\t} ),\n] )( PostPublishButton );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,SAAS;AACxC,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,OAAO,MAAMC,iBAAiB,SAASV,SAAS,CAAC;EAChDW,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IACd,IAAI,CAACC,UAAU,GAAGZ,SAAS,CAAC,CAAC;IAE7B,IAAI,CAACa,aAAa,GAAG,IAAI,CAACA,aAAa,CAACC,IAAI,CAAE,IAAK,CAAC;IACpD,IAAI,CAACC,wBAAwB,GAC5B,IAAI,CAACA,wBAAwB,CAACD,IAAI,CAAE,IAAK,CAAC;IAE3C,IAAI,CAACE,KAAK,GAAG;MACZC,2BAA2B,EAAE;IAC9B,CAAC;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IACnB,IAAK,IAAI,CAACP,KAAK,CAACQ,YAAY,EAAG;MAC9B;MACA;MACA;MACA,IAAI,CAACC,SAAS,GAAGC,UAAU,CA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;IACvB4B;EACD,CAAC,GAAGmB,MAAM,CAAEpE,WAAY,CAAC;EACzB,OAAO;IACNyC,QAAQ,EAAE6B,YAAY,CAAC,CAAC;IACxB5B,YAAY,EAAE6B,gBAAgB,CAAC,CAAC;IAChCpC,gBAAgB,EAAEqC,0BAA0B,CAAC,CAAC;IAC9CxB,UAAU,EAAEyB,uBAAuB,CAAC,CAAC;IACrCjC,UAAU,EAAEmC,oBAAoB,CAAC,CAAC;IAClCtC,kBAAkB,EAAEA,kBAAkB,CAAC,CAAC;IACxCC,aAAa,EAAEsC,uBAAuB,CAAC,CAAC;IACxCrC,WAAW,EAAEmC,sBAAsB,CAAC,CAAC;IACrCxC,gBAAgB,GAAAmC,qBAAA,GACfQ,cAAc,CAAC,CAAC,CAACG,MAAM,GAAI,mBAAmB,CAAE,cAAAX,qBAAA,cAAAA,qBAAA,GAAI,KAAK;IAC1D5C,QAAQ,EAAEqD,kBAAkB,CAAC,CAAC;IAC9BpD,MAAM,EAAEqD,gBAAgB,CAAC,CAAC;IAC1B1D,uBAAuB,EAAEA,uBAAuB,CAAC,CAAC;IAClD4B,4BAA4B,EAAEA,4BAA4B,CAAC;EAC5D,CAAC;AACF,CAAE,CAAC,EACHtD,YAAY,CAAIsF,QAAQ,IAAM;EAC7B,MAAM;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGF,QAAQ,CAAEjF,WAAY,CAAC;EACtD,OAAO;IACN6C,cAAc,EAAIuC,MAAM,IACvBF,QAAQ,CAAE;MAAEE;IAAO,CAAC,EAAE;MAAEC,UAAU,EAAE;IAAK,CAAE,CAAC;IAC7CzC,MAAM,EAAEuC;EACT,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEjF,iBAAkB,CAAC"}
@@ -4,10 +4,10 @@
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { compose } from '@wordpress/compose';
6
6
  import { withSelect } from '@wordpress/data';
7
+
7
8
  /**
8
9
  * Internal dependencies
9
10
  */
10
-
11
11
  import { store as editorStore } from '../../store';
12
12
  export function PublishButtonLabel({
13
13
  isPublished,
@@ -28,7 +28,6 @@ export function PublishButtonLabel({
28
28
  /* translators: button label text should, if possible, be under 16 characters. */
29
29
  return __('Scheduling…');
30
30
  }
31
-
32
31
  if (!hasPublishAction) {
33
32
  return hasNonPostEntityChanges ? __('Submit for Review…') : __('Submit for Review');
34
33
  } else if (isPublished) {
@@ -36,12 +35,10 @@ export function PublishButtonLabel({
36
35
  } else if (isBeingScheduled) {
37
36
  return hasNonPostEntityChanges ? __('Schedule…') : __('Schedule');
38
37
  }
39
-
40
38
  return __('Publish');
41
39
  }
42
40
  export default compose([withSelect(select => {
43
41
  var _getCurrentPost$_link;
44
-
45
42
  const {
46
43
  isCurrentPostPublished,
47
44
  isEditedPostBeingScheduled,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-publish-button/label.js"],"names":["__","compose","withSelect","store","editorStore","PublishButtonLabel","isPublished","isBeingScheduled","isSaving","isPublishing","hasPublishAction","isAutosaving","hasNonPostEntityChanges","select","isCurrentPostPublished","isEditedPostBeingScheduled","isSavingPost","isPublishingPost","getCurrentPost","getCurrentPostType","isAutosavingPost","_links","postType"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,kBAAT,CAA6B;AACnCC,EAAAA,WADmC;AAEnCC,EAAAA,gBAFmC;AAGnCC,EAAAA,QAHmC;AAInCC,EAAAA,YAJmC;AAKnCC,EAAAA,gBALmC;AAMnCC,EAAAA,YANmC;AAOnCC,EAAAA;AAPmC,CAA7B,EAQH;AACH,MAAKH,YAAL,EAAoB;AACnB;AACA,WAAOT,EAAE,CAAE,aAAF,CAAT;AACA,GAHD,MAGO,IAAKM,WAAW,IAAIE,Q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AAUA,CApBS,CADa,CAAF,CAAP,CAsBVf,kBAtBU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PublishButtonLabel( {\n\tisPublished,\n\tisBeingScheduled,\n\tisSaving,\n\tisPublishing,\n\thasPublishAction,\n\tisAutosaving,\n\thasNonPostEntityChanges,\n} ) {\n\tif ( isPublishing ) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Publishing…' );\n\t} else if ( isPublished && isSaving && ! isAutosaving ) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Updating…' );\n\t} else if ( isBeingScheduled && isSaving && ! isAutosaving ) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Scheduling…' );\n\t}\n\n\tif ( ! hasPublishAction ) {\n\t\treturn hasNonPostEntityChanges\n\t\t\t? __( 'Submit for Review…' )\n\t\t\t: __( 'Submit for Review' );\n\t} else if ( isPublished ) {\n\t\treturn hasNonPostEntityChanges ? __( 'Update…' ) : __( 'Update' );\n\t} else if ( isBeingScheduled ) {\n\t\treturn hasNonPostEntityChanges ? __( 'Schedule…' ) : __( 'Schedule' );\n\t}\n\n\treturn __( 'Publish' );\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisSavingPost,\n\t\t\tisPublishingPost,\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostType,\n\t\t\tisAutosavingPost,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisPublishing: isPublishingPost(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t};\n\t} ),\n] )( PublishButtonLabel );\n"]}
1
+ {"version":3,"names":["__","compose","withSelect","store","editorStore","PublishButtonLabel","isPublished","isBeingScheduled","isSaving","isPublishing","hasPublishAction","isAutosaving","hasNonPostEntityChanges","select","_getCurrentPost$_link","isCurrentPostPublished","isEditedPostBeingScheduled","isSavingPost","isPublishingPost","getCurrentPost","getCurrentPostType","isAutosavingPost","_links","postType"],"sources":["@wordpress/editor/src/components/post-publish-button/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PublishButtonLabel( {\n\tisPublished,\n\tisBeingScheduled,\n\tisSaving,\n\tisPublishing,\n\thasPublishAction,\n\tisAutosaving,\n\thasNonPostEntityChanges,\n} ) {\n\tif ( isPublishing ) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Publishing…' );\n\t} else if ( isPublished && isSaving && ! isAutosaving ) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Updating…' );\n\t} else if ( isBeingScheduled && isSaving && ! isAutosaving ) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Scheduling…' );\n\t}\n\n\tif ( ! hasPublishAction ) {\n\t\treturn hasNonPostEntityChanges\n\t\t\t? __( 'Submit for Review…' )\n\t\t\t: __( 'Submit for Review' );\n\t} else if ( isPublished ) {\n\t\treturn hasNonPostEntityChanges ? __( 'Update…' ) : __( 'Update' );\n\t} else if ( isBeingScheduled ) {\n\t\treturn hasNonPostEntityChanges ? __( 'Schedule…' ) : __( 'Schedule' );\n\t}\n\n\treturn __( 'Publish' );\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisSavingPost,\n\t\t\tisPublishingPost,\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostType,\n\t\t\tisAutosavingPost,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisPublishing: isPublishingPost(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t};\n\t} ),\n] )( PublishButtonLabel );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,iBAAiB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,OAAO,SAASC,kBAAkBA,CAAE;EACnCC,WAAW;EACXC,gBAAgB;EAChBC,QAAQ;EACRC,YAAY;EACZC,gBAAgB;EAChBC,YAAY;EACZC;AACD,CAAC,EAAG;EACH,IAAKH,YAAY,EAAG;IACnB;IACA,OAAOT,EAAE,CAAE,aAAc,CAAC;EAC3B,CAAC,MAAM,IAAKM,WAAW,IAAIE,QAAQ,IAAI,CAAEG,YAAY,EAAG;IACvD;IACA,OAAOX,EAAE,CAAE,WAAY,CAAC;EACzB,CAAC,MAAM,IAAKO,gBAAgB,IAAIC,QAAQ,IAAI,CAAEG,YAAY,EAAG;IAC5D;IACA,OAAOX,EAAE,CAAE,aAAc,CAAC;EAC3B;EAEA,IAAK,CAAEU,gBAAgB,EAAG;IACzB,OAAOE,uBAAuB,GAC3BZ,EAAE,CAAE,oBAAqB,CAAC,GAC1BA,EAAE,CAAE,mBAAoB,CAAC;EAC7B,CAAC,MAAM,IAAKM,WAAW,EAAG;IACzB,OAAOM,uBAAuB,GAAGZ,EAAE,CAAE,SAAU,CAAC,GAAGA,EAAE,CAAE,QAAS,CAAC;EAClE,CAAC,MAAM,IAAKO,gBAAgB,EAAG;IAC9B,OAAOK,uBAAuB,GAAGZ,EAAE,CAAE,WAAY,CAAC,GAAGA,EAAE,CAAE,UAAW,CAAC;EACtE;EAEA,OAAOA,EAAE,CAAE,SAAU,CAAC;AACvB;AAEA,eAAeC,OAAO,CAAE,CACvBC,UAAU,CAAIW,MAAM,IAAM;EAAA,IAAAC,qBAAA;EACzB,MAAM;IACLC,sBAAsB;IACtBC,0BAA0B;IAC1BC,YAAY;IACZC,gBAAgB;IAChBC,cAAc;IACdC,kBAAkB;IAClBC;EACD,CAAC,GAAGR,MAAM,CAAET,WAAY,CAAC;EACzB,OAAO;IACNE,WAAW,EAAES,sBAAsB,CAAC,CAAC;IACrCR,gBAAgB,EAAES,0BAA0B,CAAC,CAAC;IAC9CR,QAAQ,EAAES,YAAY,CAAC,CAAC;IACxBR,YAAY,EAAES,gBAAgB,CAAC,CAAC;IAChCR,gBAAgB,GAAAI,qBAAA,GACfK,cAAc,CAAC,CAAC,CAACG,MAAM,GAAI,mBAAmB,CAAE,cAAAR,qBAAA,cAAAA,qBAAA,GAAI,KAAK;IAC1DS,QAAQ,EAAEH,kBAAkB,CAAC,CAAC;IAC9BT,YAAY,EAAEU,gBAAgB,CAAC;EAChC,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEhB,kBAAmB,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { createElement, Fragment } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -10,10 +9,10 @@ import { withSelect, withDispatch } from '@wordpress/data';
10
9
  import { compose } from '@wordpress/compose';
11
10
  import { closeSmall } from '@wordpress/icons';
12
11
  import { store as coreStore } from '@wordpress/core-data';
12
+
13
13
  /**
14
14
  * Internal dependencies
15
15
  */
16
-
17
16
  import PostPublishButton from '../post-publish-button';
18
17
  import PostPublishPanelPrepublish from './prepublish';
19
18
  import PostPublishPanelPostpublish from './postpublish';
@@ -23,7 +22,6 @@ export class PostPublishPanel extends Component {
23
22
  super(...arguments);
24
23
  this.onSubmit = this.onSubmit.bind(this);
25
24
  }
26
-
27
25
  componentDidUpdate(prevProps) {
28
26
  // Automatically collapse the publish sidebar when a post
29
27
  // is published and the user makes an edit.
@@ -31,19 +29,16 @@ export class PostPublishPanel extends Component {
31
29
  this.props.onClose();
32
30
  }
33
31
  }
34
-
35
32
  onSubmit() {
36
33
  const {
37
34
  onClose,
38
35
  hasPublishAction,
39
36
  isPostTypeViewable
40
37
  } = this.props;
41
-
42
38
  if (!hasPublishAction || !isPostTypeViewable) {
43
39
  onClose();
44
40
  }
45
41
  }
46
-
47
42
  render() {
48
43
  const {
49
44
  forceIsDirty,
@@ -102,11 +97,9 @@ export class PostPublishPanel extends Component {
102
97
  onChange: onTogglePublishSidebar
103
98
  })));
104
99
  }
105
-
106
100
  }
107
101
  export default compose([withSelect(select => {
108
102
  var _getCurrentPost$_link;
109
-
110
103
  const {
111
104
  getPostType
112
105
  } = select(coreStore);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-publish-panel/index.js"],"names":["__","Component","Button","Spinner","CheckboxControl","withFocusReturn","withConstrainedTabbing","withSelect","withDispatch","compose","closeSmall","store","coreStore","PostPublishButton","PostPublishPanelPrepublish","PostPublishPanelPostpublish","editorStore","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","select","getPostType","getCurrentPost","getEditedPostAttribute","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostBeingScheduled","isEditedPostDirty","isAutosavingPost","isSavingPost","postType","_links","viewable","dispatch","disablePublishSidebar","enablePublishSidebar"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SACCC,MADD,EAECC,OAFD,EAGCC,eAHD,EAICC,eAJD,EAKCC,sBALD,QAMO,uBANP;AAOA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,wBAA9B;AACA,OAAOC,0BAAP,MAAuC,cAAvC;AACA,OAAOC,2BAAP,MAAwC,eAAxC;AACA,SAASJ,KAAK,IAAIK,WAAlB,QAAqC,aAArC;AAEA,OAAO,MAAMC,gBAAN,SAA+BhB,SAA/B,CAAyC;AAC/CiB,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AACA,SAAKC,QAAL,GAAgB,KAAKA,QAAL,CAAcC,IAAd,CAAoB,IAApB,CAAhB;AACA;;AAEDC,EAAAA,kBAAkB,CAAEC,SAAF,EAAc;AAC/B;AACA;AACA,QACCA,SAAS,CAACC,WAAV,IACA,CAAE,KAAKC,KAAL,CAAWC,QADb,IAEA,KAAKD,KAAL,CAAWE,OAHZ,EAIE;AACD,WAAKF,KAAL,CAAWG,OAAX;AACA;AACD;;AAEDR,EAAAA,QAAQ,GAAG;AACV,UAAM;AAAEQ,MAAAA,OAAF;AAAWC,MAAAA,gBAAX;AAA6BC,MAAAA;AAA7B,QAAoD,KAAKL,KAA/D;;AACA,QAAK,CAAEI,gBAAF,IAAsB,CAAEC,kBAA7B,EAAkD;AACjDF,MAAAA,OAAO;AACP;AACD;;AAEDG,EAAAA,MAAM,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sB,EAN7B;AAONf,IAAAA,uBAAuB,EAAEA,uBAAuB,EAP1C;AAQNR,IAAAA,QAAQ,EAAE4B,YAAY,MAAM,CAAED,gBAAgB,EARxC;AASNjB,IAAAA,4BAA4B,EAAEA,4BAA4B,EATpD;AAUND,IAAAA,WAAW,EAAEe,sBAAsB;AAV7B,GAAP;AAYA,CA5BS,CADa,EA8BvB1C,YAAY,CAAE,CAAEkD,QAAF,EAAY;AAAExB,EAAAA;AAAF,CAAZ,KAA6C;AAC1D,QAAM;AAAEyB,IAAAA,qBAAF;AAAyBC,IAAAA;AAAzB,MACLF,QAAQ,CAAE1C,WAAF,CADT;AAEA,SAAO;AACNqB,IAAAA,sBAAsB,EAAE,MAAM;AAC7B,UAAKH,uBAAL,EAA+B;AAC9ByB,QAAAA,qBAAqB;AACrB,OAFD,MAEO;AACNC,QAAAA,oBAAoB;AACpB;AACD;AAPK,GAAP;AASA,CAZW,CA9BW,EA2CvBvD,eA3CuB,EA4CvBC,sBA5CuB,CAAF,CAAP,CA6CVW,gBA7CU,CAAf","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\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>\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={ true }>\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\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"]}
1
+ {"version":3,"names":["__","Component","Button","Spinner","CheckboxControl","withFocusReturn","withConstrainedTabbing","withSelect","withDispatch","compose","closeSmall","store","coreStore","PostPublishButton","PostPublishPanelPrepublish","PostPublishPanelPostpublish","editorStore","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","createElement","className","onClick","icon","label","Fragment","focusOnMount","disabled","variant","__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\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>\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={ true }>\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\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,S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xB,CAAC,MAAM;QACNC,oBAAoB,CAAC,CAAC;MACvB;IACD;EACD,CAAC;AACF,CAAE,CAAC,EACHpE,eAAe,EACfC,sBAAsB,CACrB,CAAC,CAAEW,gBAAiB,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -8,13 +7,12 @@ import { useSelect } from '@wordpress/data';
8
7
  import { PanelBody } from '@wordpress/components';
9
8
  import { store as coreStore } from '@wordpress/core-data';
10
9
  import { useState, useEffect } from '@wordpress/element';
10
+
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
-
15
14
  import HierarchicalTermSelector from '../post-taxonomies/hierarchical-term-selector';
16
15
  import { store as editorStore } from '../../store';
17
-
18
16
  function MaybeCategoryPanel() {
19
17
  const hasNoCategory = useSelect(select => {
20
18
  const postType = select(editorStore).getCurrentPostType();
@@ -27,10 +25,11 @@ function MaybeCategoryPanel() {
27
25
  const defaultCategoryId = canUser('read', 'settings') ? getEntityRecord('root', 'site')?.default_category : undefined;
28
26
  const defaultCategory = defaultCategoryId ? getEntityRecord('taxonomy', 'category', defaultCategoryId) : undefined;
29
27
  const postTypeSupportsCategories = categoriesTaxonomy && categoriesTaxonomy.types.some(type => type === postType);
30
- const categories = categoriesTaxonomy && select(editorStore).getEditedPostAttribute(categoriesTaxonomy.rest_base); // This boolean should return true if everything is loaded
28
+ const categories = categoriesTaxonomy && select(editorStore).getEditedPostAttribute(categoriesTaxonomy.rest_base);
29
+
30
+ // This boolean should return true if everything is loaded
31
31
  // ( categoriesTaxonomy, defaultCategory )
32
32
  // and the post has not been assigned a category different than "uncategorized".
33
-
34
33
  return !!categoriesTaxonomy && !!defaultCategory && postTypeSupportsCategories && (categories?.length === 0 || categories?.length === 1 && defaultCategory?.id === categories[0]);
35
34
  }, []);
36
35
  const [shouldShowPanel, setShouldShowPanel] = useState(false);
@@ -41,11 +40,9 @@ function MaybeCategoryPanel() {
41
40
  setShouldShowPanel(true);
42
41
  }
43
42
  }, [hasNoCategory]);
44
-
45
43
  if (!shouldShowPanel) {
46
44
  return null;
47
45
  }
48
-
49
46
  const panelBodyTitle = [__('Suggestion:'), createElement("span", {
50
47
  className: "editor-post-publish-panel__link",
51
48
  key: "label"
@@ -57,6 +54,5 @@ function MaybeCategoryPanel() {
57
54
  slug: "category"
58
55
  }));
59
56
  }
60
-
61
57
  export default MaybeCategoryPanel;
62
58
  //# sourceMappingURL=maybe-category-panel.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-publish-panel/maybe-category-panel.js"],"names":["__","useSelect","PanelBody","store","coreStore","useState","useEffect","HierarchicalTermSelector","editorStore","MaybeCategoryPanel","hasNoCategory","select","postType","getCurrentPostType","canUser","getEntityRecord","getTaxonomy","categoriesTaxonomy","defaultCategoryId","default_category","undefined","defaultCategory","postTypeSupportsCategories","types","some","type","categories","getEditedPostAttribute","rest_base","length","id","shouldShowPanel","setShouldShowPanel","panelBodyTitle"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AAEA;AACA;AACA;;AACA,OAAOC,wBAAP,MAAqC,+CAArC;AACA,SAASJ,KAAK,IAAIK,WAAlB,QAAqC,aAArC;;AAEA,SAASC,kBAAT,GAA8B;AAC7B,QAAMC,aAAa,GAAGT,SAAS,CAAIU,MAAF,IAAc;AAC9C,UAAMC,QAAQ,GAAGD,MAAM,CAAEH,WAAF,CAAN,CAAsBK,kBAAtB,EAAjB;AACA,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,eAAX;AAA4BC,MAAAA;AAA5B,QAA4CL,MAAM,CAAEP,SAAF,CAAxD;AACA,UAAMa,kBA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KACGA,EAAE,CAAE,mBAAF,CADL,CAFsB,CAAvB;AAOA,SACC,cAAC,SAAD;AAAW,IAAA,WAAW,EAAG,KAAzB;AAAiC,IAAA,KAAK,EAAGiC;AAAzC,KACC,yBACGjC,EAAE,CACH,oHADG,CADL,CADD,EAMC,cAAC,wBAAD;AAA0B,IAAA,IAAI,EAAC;AAA/B,IAND,CADD;AAUA;;AAED,eAAeS,kBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport HierarchicalTermSelector from '../post-taxonomies/hierarchical-term-selector';\nimport { store as editorStore } from '../../store';\n\nfunction MaybeCategoryPanel() {\n\tconst hasNoCategory = useSelect( ( select ) => {\n\t\tconst postType = select( editorStore ).getCurrentPostType();\n\t\tconst { canUser, getEntityRecord, getTaxonomy } = select( coreStore );\n\t\tconst categoriesTaxonomy = getTaxonomy( 'category' );\n\t\tconst defaultCategoryId = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )?.default_category\n\t\t\t: undefined;\n\t\tconst defaultCategory = defaultCategoryId\n\t\t\t? getEntityRecord( 'taxonomy', 'category', defaultCategoryId )\n\t\t\t: undefined;\n\t\tconst postTypeSupportsCategories =\n\t\t\tcategoriesTaxonomy &&\n\t\t\tcategoriesTaxonomy.types.some( ( type ) => type === postType );\n\t\tconst categories =\n\t\t\tcategoriesTaxonomy &&\n\t\t\tselect( editorStore ).getEditedPostAttribute(\n\t\t\t\tcategoriesTaxonomy.rest_base\n\t\t\t);\n\n\t\t// This boolean should return true if everything is loaded\n\t\t// ( categoriesTaxonomy, defaultCategory )\n\t\t// and the post has not been assigned a category different than \"uncategorized\".\n\t\treturn (\n\t\t\t!! categoriesTaxonomy &&\n\t\t\t!! defaultCategory &&\n\t\t\tpostTypeSupportsCategories &&\n\t\t\t( categories?.length === 0 ||\n\t\t\t\t( categories?.length === 1 &&\n\t\t\t\t\tdefaultCategory?.id === categories[ 0 ] ) )\n\t\t);\n\t}, [] );\n\tconst [ shouldShowPanel, setShouldShowPanel ] = useState( false );\n\tuseEffect( () => {\n\t\t// We use state to avoid hiding the panel if the user edits the categories\n\t\t// and adds one within the panel itself (while visible).\n\t\tif ( hasNoCategory ) {\n\t\t\tsetShouldShowPanel( true );\n\t\t}\n\t}, [ hasNoCategory ] );\n\n\tif ( ! shouldShowPanel ) {\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{ __( 'Assign a category' ) }\n\t\t</span>,\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'Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<HierarchicalTermSelector slug=\"category\" />\n\t\t</PanelBody>\n\t);\n}\n\nexport default MaybeCategoryPanel;\n"]}
1
+ {"version":3,"names":["__","useSelect","PanelBody","store","coreStore","useState","useEffect","HierarchicalTermSelector","editorStore","MaybeCategoryPanel","hasNoCategory","select","postType","getCurrentPostType","canUser","getEntityRecord","getTaxonomy","categoriesTaxonomy","defaultCategoryId","default_category","undefined","defaultCategory","postTypeSupportsCategories","types","some","type","categories","getEditedPostAttribute","rest_base","length","id","shouldShowPanel","setShouldShowPanel","panelBodyTitle","createElement","className","key","initialOpen","title","slug"],"sources":["@wordpress/editor/src/components/post-publish-panel/maybe-category-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport HierarchicalTermSelector from '../post-taxonomies/hierarchical-term-selector';\nimport { store as editorStore } from '../../store';\n\nfunction MaybeCategoryPanel() {\n\tconst hasNoCategory = useSelect( ( select ) => {\n\t\tconst postType = select( editorStore ).getCurrentPostType();\n\t\tconst { canUser, getEntityRecord, getTaxonomy } = select( coreStore );\n\t\tconst categoriesTaxonomy = getTaxonomy( 'category' );\n\t\tconst defaultCategoryId = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )?.default_category\n\t\t\t: undefined;\n\t\tconst defaultCategory = defaultCategoryId\n\t\t\t? getEntityRecord( 'taxonomy', 'category', defaultCategoryId )\n\t\t\t: undefined;\n\t\tconst postTypeSupportsCategories =\n\t\t\tcategoriesTaxonomy &&\n\t\t\tcategoriesTaxonomy.types.some( ( type ) => type === postType );\n\t\tconst categories =\n\t\t\tcategoriesTaxonomy &&\n\t\t\tselect( editorStore ).getEditedPostAttribute(\n\t\t\t\tcategoriesTaxonomy.rest_base\n\t\t\t);\n\n\t\t// This boolean should return true if everything is loaded\n\t\t// ( categoriesTaxonomy, defaultCategory )\n\t\t// and the post has not been assigned a category different than \"uncategorized\".\n\t\treturn (\n\t\t\t!! categoriesTaxonomy &&\n\t\t\t!! defaultCategory &&\n\t\t\tpostTypeSupportsCategories &&\n\t\t\t( categories?.length === 0 ||\n\t\t\t\t( categories?.length === 1 &&\n\t\t\t\t\tdefaultCategory?.id === categories[ 0 ] ) )\n\t\t);\n\t}, [] );\n\tconst [ shouldShowPanel, setShouldShowPanel ] = useState( false );\n\tuseEffect( () => {\n\t\t// We use state to avoid hiding the panel if the user edits the categories\n\t\t// and adds one within the panel itself (while visible).\n\t\tif ( hasNoCategory ) {\n\t\t\tsetShouldShowPanel( true );\n\t\t}\n\t}, [ hasNoCategory ] );\n\n\tif ( ! shouldShowPanel ) {\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{ __( 'Assign a category' ) }\n\t\t</span>,\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'Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<HierarchicalTermSelector slug=\"category\" />\n\t\t</PanelBody>\n\t);\n}\n\nexport default MaybeCategoryPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,+CAA+C;AACpF,SAASJ,KAAK,IAAIK,WAAW,QAAQ,aAAa;AAElD,SAASC,kBAAkBA,CAAA,EAAG;EAC7B,MAAMC,aAAa,GAAGT,SAAS,CAAIU,MAAM,IAAM;IAC9C,MAAMC,QAAQ,GAAGD,MAAM,CAAEH,WAAY,CAAC,CAACK,kBAAkB,CAAC,CAAC;IAC3D,MAAM;MAAEC,OAAO;MAAEC,eAAe;MAAEC;IAAY,CAAC,GAAGL,MAAM,CAAEP,SAAU,CAAC;IACrE,MAAMa,kBAAkB,GAAGD,WAAW,CAAE,UAAW,CAAC;IACpD,MAAME,iBAAiB,GAAGJ,OAAO,CAAE,MAAM,EAAE,UAAW,CAAC,GACpDC,eAAe,CAAE,MAAM,EAAE,MAAO,CAAC,EAAEI,gBAAgB,GACnDC,SAAS;IACZ,MAAMC,eAAe,GAAGH,iBAAiB,GACtCH,eAAe,CAAE,UAAU,EAAE,UAAU,EAAEG,iBAAkB,CAAC,GAC5DE,SAAS;IACZ,MAAME,0BAA0B,GA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  * WordPress dependencies
5
4
  */
@@ -7,18 +6,16 @@ import { Button, PanelBody } from '@wordpress/components';
7
6
  import { useDispatch, useSelect } from '@wordpress/data';
8
7
  import { __, sprintf } from '@wordpress/i18n';
9
8
  import { store as coreStore } from '@wordpress/core-data';
9
+
10
10
  /**
11
11
  * Internal dependencies
12
12
  */
13
-
14
13
  import { POST_FORMATS } from '../post-format';
15
14
  import { store as editorStore } from '../../store';
16
-
17
15
  const getSuggestion = (supportedFormats, suggestedPostFormat) => {
18
16
  const formats = POST_FORMATS.filter(format => supportedFormats?.includes(format.id));
19
17
  return formats.find(format => format.id === suggestedPostFormat);
20
18
  };
21
-
22
19
  const PostFormatSuggestion = ({
23
20
  suggestedPostFormat,
24
21
  suggestionText,
@@ -27,14 +24,12 @@ const PostFormatSuggestion = ({
27
24
  variant: "link",
28
25
  onClick: () => onUpdatePostFormat(suggestedPostFormat)
29
26
  }, suggestionText);
30
-
31
27
  export default function PostFormatPanel() {
32
28
  const {
33
29
  currentPostFormat,
34
30
  suggestion
35
31
  } = useSelect(select => {
36
32
  var _select$getThemeSuppo;
37
-
38
33
  const {
39
34
  getEditedPostAttribute,
40
35
  getSuggestedPostFormat
@@ -48,28 +43,23 @@ export default function PostFormatPanel() {
48
43
  const {
49
44
  editPost
50
45
  } = useDispatch(editorStore);
51
-
52
46
  const onUpdatePostFormat = format => editPost({
53
47
  format
54
48
  });
55
-
56
49
  const panelBodyTitle = [__('Suggestion:'), createElement("span", {
57
50
  className: "editor-post-publish-panel__link",
58
51
  key: "label"
59
52
  }, __('Use a post format'))];
60
-
61
53
  if (!suggestion || suggestion.id === currentPostFormat) {
62
54
  return null;
63
55
  }
64
-
65
56
  return createElement(PanelBody, {
66
57
  initialOpen: false,
67
58
  title: panelBodyTitle
68
59
  }, createElement("p", null, __('Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.')), createElement("p", null, createElement(PostFormatSuggestion, {
69
60
  onUpdatePostFormat: onUpdatePostFormat,
70
61
  suggestedPostFormat: suggestion.id,
71
- suggestionText: sprintf(
72
- /* translators: %s: post format */
62
+ suggestionText: sprintf( /* translators: %s: post format */
73
63
  __('Apply the "%1$s" format.'), suggestion.caption)
74
64
  })));
75
65
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-publish-panel/maybe-post-format-panel.js"],"names":["Button","PanelBody","useDispatch","useSelect","__","sprintf","store","coreStore","POST_FORMATS","editorStore","getSuggestion","supportedFormats","suggestedPostFormat","formats","filter","format","includes","id","find","PostFormatSuggestion","suggestionText","onUpdatePostFormat","PostFormatPanel","currentPostFormat","suggestion","select","getEditedPostAttribute","getSuggestedPostFormat","getThemeSupports","editPost","panelBodyTitle","caption"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,SAAjB,QAAkC,uBAAlC;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASF,KAAK,IAAIG,WAAlB,QAAqC,aAArC;;AAEA,MAAMC,aAAa,GAAG,CAAEC,gBAAF,EAAoBC,mBAApB,KAA6C;AAClE,QAAMC,OAAO,GAAGL,YAAY,CAACM,MAAb,CAAuBC,MAAF,IACpCJ,gBAAgB,EAAEK,QAAlB,CAA4BD,MAAM,CAACE,EAAnC,CADe,CAAhB;AAGA,SAAOJ,OAAO,CAACK,IAAR,CAAgBH,MAAF,IAAcA,MAAM,CAACE,EAAP,KAAcL,mBAA1C,CAAP;AACA,CALD;;AAOA,MAAMO,oBAAoB,GAAG,CAAE;AAC9BP,EAAAA,mBAD8B;AAE9BQ,EAAAA,cAF8B;AAG9BC,EAAAA;AAH8B,CAAF,KAK5B,cAAC,MAAD;AACC,EAAA,OAAO,EAAC,MADT;AAEC,EAAA,OAAO,E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C;AAGC,IAAA,cAAc,EAAGZ,OAAO;AACvB;AACAD,IAAAA,EAAE,CAAE,0BAAF,CAFqB,EAGvBoB,UAAU,CAACO,OAHY;AAHzB,IADD,CAND,CADD;AAoBA","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"]}
1
+ {"version":3,"names":["Button","PanelBody","useDispatch","useSelect","__","sprintf","store","coreStore","POST_FORMATS","editorStore","getSuggestion","supportedFormats","suggestedPostFormat","formats","filter","format","includes","id","find","PostFormatSuggestion","suggestionText","onUpdatePostFormat","createElement","variant","onClick","PostFormatPanel","currentPostFormat","suggestion","select","_select$getThemeSuppo","getEditedPostAttribute","getSuggestedPostFormat","getThemeSupports","editPost","panelBodyTitle","className","key","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) }\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AI,EAAE;IACrD,OAAO;MACNH,iBAAiB,EAAEI,sBAAsB,CAAE,QAAS,CAAC;MACrDH,UAAU,EAAEjB,aAAa,CACxBC,gBAAgB,EAChBoB,sBAAsB,CAAC,CACxB;IACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEE;EAAS,CAAC,GAAG/B,WAAW,CAAEO,WAAY,CAAC;EAE/C,MAAMY,kBAAkB,GAAKN,MAAM,IAAMkB,QAAQ,CAAE;IAAElB;EAAO,CAAE,CAAC;EAE/D,MAAMmB,cAAc,GAAG,CACtB9B,EAAE,CAAE,aAAc,CAAC,EACnBkB,aAAA;IAAMa,SAAS,EAAC,iCAAiC;IAACC,GAAG,EAAC;EAAO,GAC1DhC,EAAE,CAAE,mBAAoB,CACrB,CAAC,CACP;EAED,IAAK,CAAEuB,UAAU,IAAIA,UAAU,CAACV,EAAE,KAAKS,iBAAiB,EAAG;IAC1D,OAAO,IAAI;EACZ;EAEA,OACCJ,aAAA,CAACrB,SAAS;IAACoC,WAAW,EAAG,KAAO;IAACC,KAAK,EAAGJ;EAAgB,GACxDZ,aAAA,YACGlB,EAAE,CACH,+IACD,CACE,CAAC,EACJkB,aAAA,YACCA,aAAA,CAACH,oBAAoB;IACpBE,kBAAkB,EAAGA,kBAAoB;IACzCT,mBAAmB,EAAGe,UAAU,CAACV,EAAI;IACrCG,cAAc,EAAGf,OAAO,EACvB;IACAD,EAAE,CAAE,0BAA2B,CAAC,EAChCuB,UAAU,CAACY,OACZ;EAAG,CACH,CACC,CACO,CAAC;AAEd"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -9,13 +8,12 @@ import { compose, ifCondition } from '@wordpress/compose';
9
8
  import { withSelect } from '@wordpress/data';
10
9
  import { PanelBody } from '@wordpress/components';
11
10
  import { store as coreStore } from '@wordpress/core-data';
11
+
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
-
16
15
  import FlatTermSelector from '../post-taxonomies/flat-term-selector';
17
16
  import { store as editorStore } from '../../store';
18
-
19
17
  const TagsPanel = () => {
20
18
  const panelBodyTitle = [__('Suggestion:'), createElement("span", {
21
19
  className: "editor-post-publish-panel__link",
@@ -28,7 +26,6 @@ const TagsPanel = () => {
28
26
  slug: 'post_tag'
29
27
  }));
30
28
  };
31
-
32
29
  class MaybeTagsPanel extends Component {
33
30
  constructor(props) {
34
31
  super(props);
@@ -36,6 +33,7 @@ class MaybeTagsPanel extends Component {
36
33
  hadTagsWhenOpeningThePanel: props.hasTags
37
34
  };
38
35
  }
36
+
39
37
  /*
40
38
  * We only want to show the tag panel if the post didn't have
41
39
  * any tags when the user hit the Publish button.
@@ -46,18 +44,13 @@ class MaybeTagsPanel extends Component {
46
44
  * hiding this panel and keeping the user from adding
47
45
  * more than one tag.
48
46
  */
49
-
50
-
51
47
  render() {
52
48
  if (!this.state.hadTagsWhenOpeningThePanel) {
53
49
  return createElement(TagsPanel, null);
54
50
  }
55
-
56
51
  return null;
57
52
  }
58
-
59
53
  }
60
-
61
54
  export default compose(withSelect(select => {
62
55
  const postType = select(editorStore).getCurrentPostType();
63
56
  const tagsTaxonomy = select(coreStore).getTaxonomy('post_tag');