@wordpress/editor 12.0.1 → 12.0.5

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 (331) hide show
  1. package/build/components/autocompleters/user.js +1 -1
  2. package/build/components/autosave-monitor/index.js +7 -1
  3. package/build/components/autosave-monitor/index.js.map +1 -1
  4. package/build/components/deprecated.js +6 -4
  5. package/build/components/deprecated.js.map +1 -1
  6. package/build/components/deprecated.native.js +26 -26
  7. package/build/components/document-outline/check.js +5 -4
  8. package/build/components/document-outline/check.js.map +1 -1
  9. package/build/components/document-outline/index.js +13 -9
  10. package/build/components/document-outline/index.js.map +1 -1
  11. package/build/components/document-outline/item.js +25 -22
  12. package/build/components/document-outline/item.js.map +1 -1
  13. package/build/components/editor-help/help-detail-navigation-screen.native.js +5 -4
  14. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  15. package/build/components/editor-help/help-get-support-button.native.js +5 -4
  16. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  17. package/build/components/editor-help/help-topic-row.native.js +6 -5
  18. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  19. package/build/components/editor-help/index.native.js +23 -18
  20. package/build/components/editor-help/index.native.js.map +1 -1
  21. package/build/components/editor-help/view-sections.native.js +16 -13
  22. package/build/components/editor-help/view-sections.native.js.map +1 -1
  23. package/build/components/editor-notices/index.js +5 -4
  24. package/build/components/editor-notices/index.js.map +1 -1
  25. package/build/components/entities-saved-states/entity-record-item.js +7 -6
  26. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  27. package/build/components/entities-saved-states/entity-type-list.js +30 -20
  28. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  29. package/build/components/entities-saved-states/index.js +51 -26
  30. package/build/components/entities-saved-states/index.js.map +1 -1
  31. package/build/components/error-boundary/index.js +5 -4
  32. package/build/components/error-boundary/index.js.map +1 -1
  33. package/build/components/global-keyboard-shortcuts/save-shortcut.js +4 -3
  34. package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  35. package/build/components/index.js +22 -22
  36. package/build/components/index.native.js +4 -4
  37. package/build/components/page-attributes/check.js +4 -3
  38. package/build/components/page-attributes/check.js.map +1 -1
  39. package/build/components/page-attributes/order.js +5 -4
  40. package/build/components/page-attributes/order.js.map +1 -1
  41. package/build/components/page-attributes/parent.js +6 -3
  42. package/build/components/page-attributes/parent.js.map +1 -1
  43. package/build/components/post-author/check.js +4 -3
  44. package/build/components/post-author/check.js.map +1 -1
  45. package/build/components/post-author/combobox.js +6 -3
  46. package/build/components/post-author/combobox.js.map +1 -1
  47. package/build/components/post-comments/index.js +6 -4
  48. package/build/components/post-comments/index.js.map +1 -1
  49. package/build/components/post-excerpt/index.js +5 -4
  50. package/build/components/post-excerpt/index.js.map +1 -1
  51. package/build/components/post-featured-image/index.js +51 -41
  52. package/build/components/post-featured-image/index.js.map +1 -1
  53. package/build/components/post-format/check.js +5 -4
  54. package/build/components/post-format/check.js.map +1 -1
  55. package/build/components/post-format/index.js +1 -1
  56. package/build/components/post-last-revision/check.js +7 -5
  57. package/build/components/post-last-revision/check.js.map +1 -1
  58. package/build/components/post-last-revision/index.js +5 -4
  59. package/build/components/post-last-revision/index.js.map +1 -1
  60. package/build/components/post-pending-status/check.js +7 -5
  61. package/build/components/post-pending-status/check.js.map +1 -1
  62. package/build/components/post-pending-status/index.js +6 -4
  63. package/build/components/post-pending-status/index.js.map +1 -1
  64. package/build/components/post-pingbacks/index.js +6 -4
  65. package/build/components/post-pingbacks/index.js.map +1 -1
  66. package/build/components/post-preview-button/index.js +11 -7
  67. package/build/components/post-preview-button/index.js.map +1 -1
  68. package/build/components/post-publish-button/index.js +12 -4
  69. package/build/components/post-publish-button/index.js.map +1 -1
  70. package/build/components/post-publish-button/label.js +15 -12
  71. package/build/components/post-publish-button/label.js.map +1 -1
  72. package/build/components/post-publish-panel/index.js +4 -3
  73. package/build/components/post-publish-panel/index.js.map +1 -1
  74. package/build/components/post-publish-panel/maybe-post-format-panel.js +11 -8
  75. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  76. package/build/components/post-publish-panel/maybe-tags-panel.js +7 -4
  77. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  78. package/build/components/post-publish-panel/postpublish.js +6 -5
  79. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  80. package/build/components/post-publish-panel/prepublish.js +4 -3
  81. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  82. package/build/components/post-saved-state/index.js +6 -5
  83. package/build/components/post-saved-state/index.js.map +1 -1
  84. package/build/components/post-schedule/check.js +6 -4
  85. package/build/components/post-schedule/check.js.map +1 -1
  86. package/build/components/post-schedule/index.js +15 -10
  87. package/build/components/post-schedule/index.js.map +1 -1
  88. package/build/components/post-schedule/label.js +5 -4
  89. package/build/components/post-schedule/label.js.map +1 -1
  90. package/build/components/post-slug/check.js +4 -3
  91. package/build/components/post-slug/check.js.map +1 -1
  92. package/build/components/post-slug/index.js +6 -5
  93. package/build/components/post-slug/index.js.map +1 -1
  94. package/build/components/post-sticky/check.js +7 -5
  95. package/build/components/post-sticky/check.js.map +1 -1
  96. package/build/components/post-sticky/index.js +5 -4
  97. package/build/components/post-sticky/index.js.map +1 -1
  98. package/build/components/post-switch-to-draft-button/index.js +7 -6
  99. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  100. package/build/components/post-taxonomies/check.js +6 -5
  101. package/build/components/post-taxonomies/check.js.map +1 -1
  102. package/build/components/post-taxonomies/flat-term-selector.js +155 -211
  103. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  104. package/build/components/post-taxonomies/hierarchical-term-selector.js +6 -5
  105. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  106. package/build/components/post-taxonomies/index.js +6 -5
  107. package/build/components/post-taxonomies/index.js.map +1 -1
  108. package/build/components/post-taxonomies/most-used-terms.js +5 -4
  109. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  110. package/build/components/post-template/index.js +2 -1
  111. package/build/components/post-template/index.js.map +1 -1
  112. package/build/components/post-title/index.js +4 -2
  113. package/build/components/post-title/index.js.map +1 -1
  114. package/build/components/post-title/index.native.js +6 -5
  115. package/build/components/post-title/index.native.js.map +1 -1
  116. package/build/components/post-trash/check.js +8 -6
  117. package/build/components/post-trash/check.js.map +1 -1
  118. package/build/components/post-trash/index.js +8 -6
  119. package/build/components/post-trash/index.js.map +1 -1
  120. package/build/components/post-type-support-check/index.js +6 -5
  121. package/build/components/post-type-support-check/index.js.map +1 -1
  122. package/build/components/post-visibility/check.js +5 -4
  123. package/build/components/post-visibility/check.js.map +1 -1
  124. package/build/components/post-visibility/index.js +28 -24
  125. package/build/components/post-visibility/index.js.map +1 -1
  126. package/build/components/post-visibility/label.js +5 -3
  127. package/build/components/post-visibility/label.js.map +1 -1
  128. package/build/components/provider/index.js +9 -8
  129. package/build/components/provider/index.js.map +1 -1
  130. package/build/components/provider/index.native.js +17 -11
  131. package/build/components/provider/index.native.js.map +1 -1
  132. package/build/components/provider/use-block-editor-settings.js +1 -1
  133. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  134. package/build/components/table-of-contents/index.js +33 -26
  135. package/build/components/table-of-contents/index.js.map +1 -1
  136. package/build/components/table-of-contents/panel.js +5 -4
  137. package/build/components/table-of-contents/panel.js.map +1 -1
  138. package/build/components/template-validation-notice/index.js +6 -4
  139. package/build/components/template-validation-notice/index.js.map +1 -1
  140. package/build/components/theme-support-check/index.js +7 -6
  141. package/build/components/theme-support-check/index.js.map +1 -1
  142. package/build/hooks/custom-sources-backwards-compatibility.js +12 -8
  143. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  144. package/build/hooks/default-autocompleters.js +2 -1
  145. package/build/hooks/default-autocompleters.js.map +1 -1
  146. package/build/index.js +4 -4
  147. package/build/store/actions.js +51 -30
  148. package/build/store/actions.js.map +1 -1
  149. package/build/store/actions.native.js +3 -2
  150. package/build/store/actions.native.js.map +1 -1
  151. package/build/store/constants.js +1 -1
  152. package/build/store/controls.js +10 -9
  153. package/build/store/controls.js.map +1 -1
  154. package/build/store/defaults.js +1 -1
  155. package/build/store/index.js +5 -3
  156. package/build/store/index.js.map +1 -1
  157. package/build/store/reducer.js +52 -22
  158. package/build/store/reducer.js.map +1 -1
  159. package/build/store/reducer.native.js +14 -4
  160. package/build/store/reducer.native.js.map +1 -1
  161. package/build/store/selectors.js +56 -37
  162. package/build/store/selectors.js.map +1 -1
  163. package/build/store/selectors.native.js +1 -1
  164. package/build/store/utils/notice-builder.js +1 -1
  165. package/build/utils/index.js +6 -6
  166. package/build/utils/media-upload/index.js +15 -11
  167. package/build/utils/media-upload/index.js.map +1 -1
  168. package/build/utils/url.js +1 -1
  169. package/build-module/components/autosave-monitor/index.js +7 -1
  170. package/build-module/components/autosave-monitor/index.js.map +1 -1
  171. package/build-module/components/deprecated.js +4 -3
  172. package/build-module/components/deprecated.js.map +1 -1
  173. package/build-module/components/document-outline/check.js +5 -4
  174. package/build-module/components/document-outline/check.js.map +1 -1
  175. package/build-module/components/document-outline/index.js +13 -9
  176. package/build-module/components/document-outline/index.js.map +1 -1
  177. package/build-module/components/document-outline/item.js +25 -22
  178. package/build-module/components/document-outline/item.js.map +1 -1
  179. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +5 -4
  180. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  181. package/build-module/components/editor-help/help-get-support-button.native.js +5 -4
  182. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  183. package/build-module/components/editor-help/help-topic-row.native.js +6 -5
  184. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  185. package/build-module/components/editor-help/index.native.js +23 -19
  186. package/build-module/components/editor-help/index.native.js.map +1 -1
  187. package/build-module/components/editor-help/view-sections.native.js +15 -12
  188. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  189. package/build-module/components/editor-notices/index.js +5 -4
  190. package/build-module/components/editor-notices/index.js.map +1 -1
  191. package/build-module/components/entities-saved-states/entity-record-item.js +7 -6
  192. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  193. package/build-module/components/entities-saved-states/entity-type-list.js +31 -19
  194. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  195. package/build-module/components/entities-saved-states/index.js +50 -25
  196. package/build-module/components/entities-saved-states/index.js.map +1 -1
  197. package/build-module/components/error-boundary/index.js +5 -4
  198. package/build-module/components/error-boundary/index.js.map +1 -1
  199. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +4 -3
  200. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  201. package/build-module/components/page-attributes/check.js +4 -3
  202. package/build-module/components/page-attributes/check.js.map +1 -1
  203. package/build-module/components/page-attributes/order.js +5 -4
  204. package/build-module/components/page-attributes/order.js.map +1 -1
  205. package/build-module/components/page-attributes/parent.js +5 -2
  206. package/build-module/components/page-attributes/parent.js.map +1 -1
  207. package/build-module/components/post-author/check.js +4 -3
  208. package/build-module/components/post-author/check.js.map +1 -1
  209. package/build-module/components/post-author/combobox.js +6 -3
  210. package/build-module/components/post-author/combobox.js.map +1 -1
  211. package/build-module/components/post-comments/index.js +6 -4
  212. package/build-module/components/post-comments/index.js.map +1 -1
  213. package/build-module/components/post-excerpt/index.js +5 -4
  214. package/build-module/components/post-excerpt/index.js.map +1 -1
  215. package/build-module/components/post-featured-image/index.js +51 -41
  216. package/build-module/components/post-featured-image/index.js.map +1 -1
  217. package/build-module/components/post-format/check.js +5 -4
  218. package/build-module/components/post-format/check.js.map +1 -1
  219. package/build-module/components/post-last-revision/check.js +7 -5
  220. package/build-module/components/post-last-revision/check.js.map +1 -1
  221. package/build-module/components/post-last-revision/index.js +5 -4
  222. package/build-module/components/post-last-revision/index.js.map +1 -1
  223. package/build-module/components/post-pending-status/check.js +7 -5
  224. package/build-module/components/post-pending-status/check.js.map +1 -1
  225. package/build-module/components/post-pending-status/index.js +6 -4
  226. package/build-module/components/post-pending-status/index.js.map +1 -1
  227. package/build-module/components/post-pingbacks/index.js +6 -4
  228. package/build-module/components/post-pingbacks/index.js.map +1 -1
  229. package/build-module/components/post-preview-button/index.js +11 -7
  230. package/build-module/components/post-preview-button/index.js.map +1 -1
  231. package/build-module/components/post-publish-button/index.js +12 -4
  232. package/build-module/components/post-publish-button/index.js.map +1 -1
  233. package/build-module/components/post-publish-button/label.js +15 -12
  234. package/build-module/components/post-publish-button/label.js.map +1 -1
  235. package/build-module/components/post-publish-panel/index.js +4 -3
  236. package/build-module/components/post-publish-panel/index.js.map +1 -1
  237. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +11 -8
  238. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  239. package/build-module/components/post-publish-panel/maybe-tags-panel.js +7 -4
  240. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  241. package/build-module/components/post-publish-panel/postpublish.js +6 -5
  242. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  243. package/build-module/components/post-publish-panel/prepublish.js +4 -3
  244. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  245. package/build-module/components/post-saved-state/index.js +6 -5
  246. package/build-module/components/post-saved-state/index.js.map +1 -1
  247. package/build-module/components/post-schedule/check.js +6 -4
  248. package/build-module/components/post-schedule/check.js.map +1 -1
  249. package/build-module/components/post-schedule/index.js +15 -10
  250. package/build-module/components/post-schedule/index.js.map +1 -1
  251. package/build-module/components/post-schedule/label.js +6 -4
  252. package/build-module/components/post-schedule/label.js.map +1 -1
  253. package/build-module/components/post-slug/check.js +4 -3
  254. package/build-module/components/post-slug/check.js.map +1 -1
  255. package/build-module/components/post-slug/index.js +6 -5
  256. package/build-module/components/post-slug/index.js.map +1 -1
  257. package/build-module/components/post-sticky/check.js +7 -5
  258. package/build-module/components/post-sticky/check.js.map +1 -1
  259. package/build-module/components/post-sticky/index.js +5 -4
  260. package/build-module/components/post-sticky/index.js.map +1 -1
  261. package/build-module/components/post-switch-to-draft-button/index.js +7 -6
  262. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  263. package/build-module/components/post-taxonomies/check.js +6 -5
  264. package/build-module/components/post-taxonomies/check.js.map +1 -1
  265. package/build-module/components/post-taxonomies/flat-term-selector.js +157 -214
  266. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  267. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -3
  268. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  269. package/build-module/components/post-taxonomies/index.js +6 -5
  270. package/build-module/components/post-taxonomies/index.js.map +1 -1
  271. package/build-module/components/post-taxonomies/most-used-terms.js +5 -4
  272. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  273. package/build-module/components/post-template/index.js +2 -1
  274. package/build-module/components/post-template/index.js.map +1 -1
  275. package/build-module/components/post-title/index.js +4 -2
  276. package/build-module/components/post-title/index.js.map +1 -1
  277. package/build-module/components/post-title/index.native.js +6 -5
  278. package/build-module/components/post-title/index.native.js.map +1 -1
  279. package/build-module/components/post-trash/check.js +8 -6
  280. package/build-module/components/post-trash/check.js.map +1 -1
  281. package/build-module/components/post-trash/index.js +8 -6
  282. package/build-module/components/post-trash/index.js.map +1 -1
  283. package/build-module/components/post-type-support-check/index.js +6 -5
  284. package/build-module/components/post-type-support-check/index.js.map +1 -1
  285. package/build-module/components/post-visibility/check.js +5 -4
  286. package/build-module/components/post-visibility/check.js.map +1 -1
  287. package/build-module/components/post-visibility/index.js +28 -24
  288. package/build-module/components/post-visibility/index.js.map +1 -1
  289. package/build-module/components/post-visibility/label.js +5 -3
  290. package/build-module/components/post-visibility/label.js.map +1 -1
  291. package/build-module/components/provider/index.js +9 -8
  292. package/build-module/components/provider/index.js.map +1 -1
  293. package/build-module/components/provider/index.native.js +13 -9
  294. package/build-module/components/provider/index.native.js.map +1 -1
  295. package/build-module/components/provider/use-block-editor-settings.js +1 -1
  296. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  297. package/build-module/components/table-of-contents/index.js +33 -26
  298. package/build-module/components/table-of-contents/index.js.map +1 -1
  299. package/build-module/components/table-of-contents/panel.js +5 -4
  300. package/build-module/components/table-of-contents/panel.js.map +1 -1
  301. package/build-module/components/template-validation-notice/index.js +6 -4
  302. package/build-module/components/template-validation-notice/index.js.map +1 -1
  303. package/build-module/components/theme-support-check/index.js +7 -6
  304. package/build-module/components/theme-support-check/index.js.map +1 -1
  305. package/build-module/hooks/custom-sources-backwards-compatibility.js +12 -8
  306. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  307. package/build-module/hooks/default-autocompleters.js +2 -1
  308. package/build-module/hooks/default-autocompleters.js.map +1 -1
  309. package/build-module/store/actions.js +27 -12
  310. package/build-module/store/actions.js.map +1 -1
  311. package/build-module/store/actions.native.js +2 -1
  312. package/build-module/store/actions.native.js.map +1 -1
  313. package/build-module/store/controls.js +8 -7
  314. package/build-module/store/controls.js.map +1 -1
  315. package/build-module/store/reducer.js +44 -14
  316. package/build-module/store/reducer.js.map +1 -1
  317. package/build-module/store/reducer.native.js +12 -3
  318. package/build-module/store/reducer.native.js.map +1 -1
  319. package/build-module/store/selectors.js +7 -4
  320. package/build-module/store/selectors.js.map +1 -1
  321. package/build-module/utils/media-upload/index.js +15 -11
  322. package/build-module/utils/media-upload/index.js.map +1 -1
  323. package/package.json +31 -31
  324. package/src/components/autosave-monitor/index.js +5 -0
  325. package/src/components/autosave-monitor/test/index.js +10 -4
  326. package/src/components/editor-help/index.native.js +116 -110
  327. package/src/components/entities-saved-states/entity-type-list.js +29 -10
  328. package/src/components/entities-saved-states/index.js +38 -8
  329. package/src/components/post-taxonomies/flat-term-selector.js +220 -254
  330. package/src/components/post-title/index.js +4 -2
  331. package/src/components/provider/use-block-editor-settings.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-saved-state/index.js"],"names":["classnames","__unstableGetAnimateClassName","getAnimateClassName","Button","usePrevious","useViewportMatch","useDispatch","useSelect","useEffect","useState","__","Icon","check","cloud","cloudUpload","displayShortcut","PostSwitchToDraftButton","store","editorStore","PostSavedState","forceIsDirty","forceIsSaving","showIconLabels","forceSavedMessage","setForceSavedMessage","isLargeViewport","isAutosaving","isDirty","isNew","isPending","isPublished","isSaveable","isSaving","isScheduled","hasPublishAction","select","isEditedPostNew","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostDirty","isSavingPost","isEditedPostSaveable","getCurrentPost","isAutosavingPost","getEditedPostAttribute","_links","savePost","wasSaving","timeoutId","setTimeout","clearTimeout","label","shortLabel","isSaved","isSavedState","isDisabled","text","type","undefined","primary"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,6BAA6B,IAAIC,mBADlC,EAECC,MAFD,QAGO,uBAHP;AAIA,SAASC,WAAT,EAAsBC,gBAAtB,QAA8C,oBAA9C;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,SAAT,EAAoBC,QAApB,QAAoC,oBAApC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,IAAT,EAAeC,KAAf,EAAsBC,KAAtB,EAA6BC,WAA7B,QAAgD,kBAAhD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,gCAApC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,cAAT,CAAyB;AACvCC,EAAAA,YADuC;AAEvCC,EAAAA,aAFuC;AAGvCC,EAAAA,cAAc,GAAG;AAHsB,CAAzB,EAIX;AACH,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8Cf,QAAQ,CAAE,KAAF,CAA5D;AACA,QAAMgB,eAAe,GAAGpB,gBAAgB,CAAE,OAAF,CAAxC;AAEA,QAAM;AACLqB,I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ACC,IAAA,SAAS,EACRrB,UAAU,IAAIC,QAAd,GACGhC,UAAU,CAAE;AACZ,gCAA0B,CAAEsD,YADhB;AAEZ,iCAA2BA,YAFf;AAGZ,mBAAatB,QAHD;AAIZ,uBAAiBN,YAJL;AAKZ,kBAAY2B,OALA;AAMZ,OAAEnD,mBAAmB,CAAE;AACtBuD,QAAAA,IAAI,EAAE;AADgB,OAAF,CAArB,GAEOzB;AARK,KAAF,CADb,GAWG0B,SAbL;AAeC,IAAA,OAAO,EAAGH,UAAU,GAAGG,SAAH,GAAe,MAAMZ,QAAQ,EAflD;AAgBC,IAAA,QAAQ,EAAG/B,eAAe,CAAC4C,OAAhB,CAAyB,GAAzB,CAhBZ;AAiBC,IAAA,OAAO,EAAGlC,eAAe,GAAG,UAAH,GAAgBiC,SAjB1C;AAkBC,IAAA,IAAI,EAAGjC,eAAe,GAAGiC,SAAH,GAAe5C,WAlBtC;AAmBC,IAAA,KAAK,EAAGqC,KAnBT;AAoBC,qBAAgBI;AApBjB,KAsBGD,YAAY,IAAI,cAAC,IAAD;AAAM,IAAA,IAAI,EAAGD,OAAO,GAAGzC,KAAH,GAAWC;AAA/B,IAtBnB,EAuBG2C,IAvBH,CADD;AA2BA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__unstableGetAnimateClassName as getAnimateClassName,\n\tButton,\n} from '@wordpress/components';\nimport { usePrevious, useViewportMatch } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, check, cloud, cloudUpload } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport PostSwitchToDraftButton from '../post-switch-to-draft-button';\nimport { store as editorStore } from '../../store';\n\n/**\n * Component showing whether the post is saved or not and providing save\n * buttons.\n *\n * @param {Object} props Component props.\n * @param {?boolean} props.forceIsDirty Whether to force the post to be marked\n * as dirty.\n * @param {?boolean} props.forceIsSaving Whether to force the post to be marked\n * as being saved.\n * @param {?boolean} props.showIconLabels Whether interface buttons show labels instead of icons\n * @return {import('@wordpress/element').WPComponent} The component.\n */\nexport default function PostSavedState( {\n\tforceIsDirty,\n\tforceIsSaving,\n\tshowIconLabels = false,\n} ) {\n\tconst [ forceSavedMessage, setForceSavedMessage ] = useState( false );\n\tconst isLargeViewport = useViewportMatch( 'small' );\n\n\tconst {\n\t\tisAutosaving,\n\t\tisDirty,\n\t\tisNew,\n\t\tisPending,\n\t\tisPublished,\n\t\tisSaveable,\n\t\tisSaving,\n\t\tisScheduled,\n\t\thasPublishAction,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisEditedPostNew,\n\t\t\t\tisCurrentPostPublished,\n\t\t\t\tisCurrentPostScheduled,\n\t\t\t\tisEditedPostDirty,\n\t\t\t\tisSavingPost,\n\t\t\t\tisEditedPostSaveable,\n\t\t\t\tgetCurrentPost,\n\t\t\t\tisAutosavingPost,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore );\n\n\t\t\treturn {\n\t\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\t\tisDirty: forceIsDirty || isEditedPostDirty(),\n\t\t\t\tisNew: isEditedPostNew(),\n\t\t\t\tisPending: 'pending' === getEditedPostAttribute( 'status' ),\n\t\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\t\tisSaving: forceIsSaving || isSavingPost(),\n\t\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\t\thasPublishAction:\n\t\t\t\t\tgetCurrentPost()?._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\t};\n\t\t},\n\t\t[ forceIsDirty, forceIsSaving ]\n\t);\n\n\tconst { savePost } = useDispatch( editorStore );\n\n\tconst wasSaving = usePrevious( isSaving );\n\n\tuseEffect( () => {\n\t\tlet timeoutId;\n\n\t\tif ( wasSaving && ! isSaving ) {\n\t\t\tsetForceSavedMessage( true );\n\t\t\ttimeoutId = setTimeout( () => {\n\t\t\t\tsetForceSavedMessage( false );\n\t\t\t}, 1000 );\n\t\t}\n\n\t\treturn () => clearTimeout( timeoutId );\n\t}, [ isSaving ] );\n\n\t// Once the post has been submitted for review this button\n\t// is not needed for the contributor role.\n\tif ( ! hasPublishAction && isPending ) {\n\t\treturn null;\n\t}\n\n\tif ( isPublished || isScheduled ) {\n\t\treturn <PostSwitchToDraftButton />;\n\t}\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst label = isPending ? __( 'Save as pending' ) : __( 'Save draft' );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst shortLabel = __( 'Save' );\n\n\tconst isSaved = forceSavedMessage || ( ! isNew && ! isDirty );\n\tconst isSavedState = isSaving || isSaved;\n\tconst isDisabled = isSaving || isSaved || ! isSaveable;\n\n\tlet text;\n\n\tif ( isSaving ) {\n\t\ttext = isAutosaving ? __( 'Autosaving' ) : __( 'Saving' );\n\t} else if ( isSaved ) {\n\t\ttext = __( 'Saved' );\n\t} else if ( isLargeViewport ) {\n\t\ttext = label;\n\t} else if ( showIconLabels ) {\n\t\ttext = shortLabel;\n\t}\n\n\t// Use common Button instance for all saved states so that focus is not\n\t// lost.\n\treturn (\n\t\t<Button\n\t\t\tclassName={\n\t\t\t\tisSaveable || isSaving\n\t\t\t\t\t? classnames( {\n\t\t\t\t\t\t\t'editor-post-save-draft': ! isSavedState,\n\t\t\t\t\t\t\t'editor-post-saved-state': isSavedState,\n\t\t\t\t\t\t\t'is-saving': isSaving,\n\t\t\t\t\t\t\t'is-autosaving': isAutosaving,\n\t\t\t\t\t\t\t'is-saved': isSaved,\n\t\t\t\t\t\t\t[ getAnimateClassName( {\n\t\t\t\t\t\t\t\ttype: 'loading',\n\t\t\t\t\t\t\t} ) ]: isSaving,\n\t\t\t\t\t } )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tonClick={ isDisabled ? undefined : () => savePost() }\n\t\t\tshortcut={ displayShortcut.primary( 's' ) }\n\t\t\tvariant={ isLargeViewport ? 'tertiary' : undefined }\n\t\t\ticon={ isLargeViewport ? undefined : cloudUpload }\n\t\t\tlabel={ label }\n\t\t\taria-disabled={ isDisabled }\n\t\t>\n\t\t\t{ isSavedState && <Icon icon={ isSaved ? check : cloud } /> }\n\t\t\t{ text }\n\t\t</Button>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-saved-state/index.js"],"names":["classnames","__unstableGetAnimateClassName","getAnimateClassName","Button","usePrevious","useViewportMatch","useDispatch","useSelect","useEffect","useState","__","Icon","check","cloud","cloudUpload","displayShortcut","PostSwitchToDraftButton","store","editorStore","PostSavedState","forceIsDirty","forceIsSaving","showIconLabels","forceSavedMessage","setForceSavedMessage","isLargeViewport","isAutosaving","isDirty","isNew","isPending","isPublished","isSaveable","isSaving","isScheduled","hasPublishAction","select","isEditedPostNew","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostDirty","isSavingPost","isEditedPostSaveable","getCurrentPost","isAutosavingPost","getEditedPostAttribute","_links","savePost","wasSaving","timeoutId","setTimeout","clearTimeout","label","shortLabel","isSaved","isSavedState","isDisabled","text","type","undefined","primary"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,6BAA6B,IAAIC,mBADlC,EAECC,MAFD,QAGO,uBAHP;AAIA,SAASC,WAAT,EAAsBC,gBAAtB,QAA8C,oBAA9C;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,SAAT,EAAoBC,QAApB,QAAoC,oBAApC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,IAAT,EAAeC,KAAf,EAAsBC,KAAtB,EAA6BC,WAA7B,QAAgD,kBAAhD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AAEA;AACA;AAC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WordPress dependencies\n */\nimport {\n\t__unstableGetAnimateClassName as getAnimateClassName,\n\tButton,\n} from '@wordpress/components';\nimport { usePrevious, useViewportMatch } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, check, cloud, cloudUpload } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport PostSwitchToDraftButton from '../post-switch-to-draft-button';\nimport { store as editorStore } from '../../store';\n\n/**\n * Component showing whether the post is saved or not and providing save\n * buttons.\n *\n * @param {Object} props Component props.\n * @param {?boolean} props.forceIsDirty Whether to force the post to be marked\n * as dirty.\n * @param {?boolean} props.forceIsSaving Whether to force the post to be marked\n * as being saved.\n * @param {?boolean} props.showIconLabels Whether interface buttons show labels instead of icons\n * @return {import('@wordpress/element').WPComponent} The component.\n */\nexport default function PostSavedState( {\n\tforceIsDirty,\n\tforceIsSaving,\n\tshowIconLabels = false,\n} ) {\n\tconst [ forceSavedMessage, setForceSavedMessage ] = useState( false );\n\tconst isLargeViewport = useViewportMatch( 'small' );\n\n\tconst {\n\t\tisAutosaving,\n\t\tisDirty,\n\t\tisNew,\n\t\tisPending,\n\t\tisPublished,\n\t\tisSaveable,\n\t\tisSaving,\n\t\tisScheduled,\n\t\thasPublishAction,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisEditedPostNew,\n\t\t\t\tisCurrentPostPublished,\n\t\t\t\tisCurrentPostScheduled,\n\t\t\t\tisEditedPostDirty,\n\t\t\t\tisSavingPost,\n\t\t\t\tisEditedPostSaveable,\n\t\t\t\tgetCurrentPost,\n\t\t\t\tisAutosavingPost,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore );\n\n\t\t\treturn {\n\t\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\t\tisDirty: forceIsDirty || isEditedPostDirty(),\n\t\t\t\tisNew: isEditedPostNew(),\n\t\t\t\tisPending: 'pending' === getEditedPostAttribute( 'status' ),\n\t\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\t\tisSaving: forceIsSaving || isSavingPost(),\n\t\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\t\thasPublishAction:\n\t\t\t\t\tgetCurrentPost()?._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\t};\n\t\t},\n\t\t[ forceIsDirty, forceIsSaving ]\n\t);\n\n\tconst { savePost } = useDispatch( editorStore );\n\n\tconst wasSaving = usePrevious( isSaving );\n\n\tuseEffect( () => {\n\t\tlet timeoutId;\n\n\t\tif ( wasSaving && ! isSaving ) {\n\t\t\tsetForceSavedMessage( true );\n\t\t\ttimeoutId = setTimeout( () => {\n\t\t\t\tsetForceSavedMessage( false );\n\t\t\t}, 1000 );\n\t\t}\n\n\t\treturn () => clearTimeout( timeoutId );\n\t}, [ isSaving ] );\n\n\t// Once the post has been submitted for review this button\n\t// is not needed for the contributor role.\n\tif ( ! hasPublishAction && isPending ) {\n\t\treturn null;\n\t}\n\n\tif ( isPublished || isScheduled ) {\n\t\treturn <PostSwitchToDraftButton />;\n\t}\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst label = isPending ? __( 'Save as pending' ) : __( 'Save draft' );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst shortLabel = __( 'Save' );\n\n\tconst isSaved = forceSavedMessage || ( ! isNew && ! isDirty );\n\tconst isSavedState = isSaving || isSaved;\n\tconst isDisabled = isSaving || isSaved || ! isSaveable;\n\n\tlet text;\n\n\tif ( isSaving ) {\n\t\ttext = isAutosaving ? __( 'Autosaving' ) : __( 'Saving' );\n\t} else if ( isSaved ) {\n\t\ttext = __( 'Saved' );\n\t} else if ( isLargeViewport ) {\n\t\ttext = label;\n\t} else if ( showIconLabels ) {\n\t\ttext = shortLabel;\n\t}\n\n\t// Use common Button instance for all saved states so that focus is not\n\t// lost.\n\treturn (\n\t\t<Button\n\t\t\tclassName={\n\t\t\t\tisSaveable || isSaving\n\t\t\t\t\t? classnames( {\n\t\t\t\t\t\t\t'editor-post-save-draft': ! isSavedState,\n\t\t\t\t\t\t\t'editor-post-saved-state': isSavedState,\n\t\t\t\t\t\t\t'is-saving': isSaving,\n\t\t\t\t\t\t\t'is-autosaving': isAutosaving,\n\t\t\t\t\t\t\t'is-saved': isSaved,\n\t\t\t\t\t\t\t[ getAnimateClassName( {\n\t\t\t\t\t\t\t\ttype: 'loading',\n\t\t\t\t\t\t\t} ) ]: isSaving,\n\t\t\t\t\t } )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tonClick={ isDisabled ? undefined : () => savePost() }\n\t\t\tshortcut={ displayShortcut.primary( 's' ) }\n\t\t\tvariant={ isLargeViewport ? 'tertiary' : undefined }\n\t\t\ticon={ isLargeViewport ? undefined : cloudUpload }\n\t\t\tlabel={ label }\n\t\t\taria-disabled={ isDisabled }\n\t\t>\n\t\t\t{ isSavedState && <Icon icon={ isSaved ? check : cloud } /> }\n\t\t\t{ text }\n\t\t</Button>\n\t);\n}\n"]}
@@ -13,10 +13,12 @@ import { withSelect } from '@wordpress/data';
13
13
  */
14
14
 
15
15
  import { store as editorStore } from '../../store';
16
- export function PostScheduleCheck({
17
- hasPublishAction,
18
- children
19
- }) {
16
+ export function PostScheduleCheck(_ref) {
17
+ let {
18
+ hasPublishAction,
19
+ children
20
+ } = _ref;
21
+
20
22
  if (!hasPublishAction) {
21
23
  return null;
22
24
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-schedule/check.js"],"names":["get","compose","withSelect","store","editorStore","PostScheduleCheck","hasPublishAction","children","select","getCurrentPost","getCurrentPostType","postType"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,iBAAT,CAA4B;AAAEC,EAAAA,gBAAF;AAAoBC,EAAAA;AAApB,CAA5B,EAA6D;AACnE,MAAK,CAAED,gBAAP,EAA0B;AACzB,WAAO,IAAP;AACA;;AAED,SAAOC,QAAP;AACA;AAED,eAAeN,OAAO,CAAE,CACvBC,UAAU,CAAIM,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAyCF,MAAM,CAAEJ,WAAF,CAArD;AACA,SAAO;AACNE,IAAAA,gBAAgB,EAAEN,GAAG,CACpBS,cAAc,EADM,EAEpB,CAAE,QAAF,EAAY,mBAAZ,CAFoB,EAGpB,KAHoB,CADf;AAMNE,IAAAA,QAAQ,EAAED,kBAAkB;AANtB,GAAP;AAQA,CAVS,CADa,CAAF,CAAP,CAYVL,iBAZU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\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 PostScheduleCheck( { hasPublishAction, children } ) {\n\tif ( ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getCurrentPost, getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\thasPublishAction: get(\n\t\t\t\tgetCurrentPost(),\n\t\t\t\t[ '_links', 'wp:action-publish' ],\n\t\t\t\tfalse\n\t\t\t),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t} ),\n] )( PostScheduleCheck );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-schedule/check.js"],"names":["get","compose","withSelect","store","editorStore","PostScheduleCheck","hasPublishAction","children","select","getCurrentPost","getCurrentPostType","postType"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,iBAAT,OAA6D;AAAA,MAAjC;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,GAAiC;;AACnE,MAAK,CAAED,gBAAP,EAA0B;AACzB,WAAO,IAAP;AACA;;AAED,SAAOC,QAAP;AACA;AAED,eAAeN,OAAO,CAAE,CACvBC,UAAU,CAAIM,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAyCF,MAAM,CAAEJ,WAAF,CAArD;AACA,SAAO;AACNE,IAAAA,gBAAgB,EAAEN,GAAG,CACpBS,cAAc,EADM,EAEpB,CAAE,QAAF,EAAY,mBAAZ,CAFoB,EAGpB,KAHoB,CADf;AAMNE,IAAAA,QAAQ,EAAED,kBAAkB;AANtB,GAAP;AAQA,CAVS,CADa,CAAF,CAAP,CAYVL,iBAZU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\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 PostScheduleCheck( { hasPublishAction, children } ) {\n\tif ( ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getCurrentPost, getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\thasPublishAction: get(\n\t\t\t\tgetCurrentPost(),\n\t\t\t\t[ '_links', 'wp:action-publish' ],\n\t\t\t\tfalse\n\t\t\t),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t} ),\n] )( PostScheduleCheck );\n"]}
@@ -14,7 +14,9 @@ import { store as coreStore } from '@wordpress/core-data';
14
14
 
15
15
  import { store as editorStore } from '../../store';
16
16
 
17
- function getDayOfTheMonth(date = new Date(), firstDay = true) {
17
+ function getDayOfTheMonth() {
18
+ let date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
19
+ let firstDay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
18
20
  const d = new Date(date);
19
21
  return new Date(d.getFullYear(), d.getMonth() + (firstDay ? 0 : 1), firstDay ? 1 : 0).toISOString();
20
22
  }
@@ -43,15 +45,18 @@ export default function PostSchedule() {
43
45
  before: getDayOfTheMonth(previewedMonth, false),
44
46
  exclude: [select(editorStore).getCurrentPostId()]
45
47
  }), [previewedMonth, postType]);
46
- const events = useMemo(() => (eventsByPostType || []).map(({
47
- title,
48
- type,
49
- date: eventDate
50
- }) => ({
51
- title: title === null || title === void 0 ? void 0 : title.rendered,
52
- type,
53
- date: new Date(eventDate)
54
- })), [eventsByPostType]);
48
+ const events = useMemo(() => (eventsByPostType || []).map(_ref => {
49
+ let {
50
+ title,
51
+ type,
52
+ date: eventDate
53
+ } = _ref;
54
+ return {
55
+ title: title === null || title === void 0 ? void 0 : title.rendered,
56
+ type,
57
+ date: new Date(eventDate)
58
+ };
59
+ }), [eventsByPostType]);
55
60
  const ref = useRef();
56
61
 
57
62
  const settings = __experimentalGetSettings(); // To know if the current timezone is a 12 hour time with look for "a" in the time format
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"names":["__experimentalGetSettings","useDispatch","useSelect","DateTimePicker","useRef","useState","useMemo","store","coreStore","editorStore","getDayOfTheMonth","date","Date","firstDay","d","getFullYear","getMonth","toISOString","PostSchedule","postDate","postType","select","getEditedPostAttribute","getCurrentPostType","editPost","onUpdateDate","previewedMonth","setPreviewedMonth","eventsByPostType","getEntityRecords","status","after","before","exclude","getCurrentPostId","events","map","title","type","eventDate","rendered","ref","settings","is12HourTime","test","formats","time","toLowerCase","replace","split","reverse","join","onChange","newDate","ownerDocument","current","activeElement","blur"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,yBAAT,QAA0C,iBAA1C;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,cAAT,QAA+B,uBAA/B;AACA,SAASC,MAAT,EAAiBC,QAAjB,EAA2BC,OAA3B,QAA0C,oBAA1C;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;;AAEA,SAASC,gBAAT,CAA2BC,IAAI,GAAG,IAAIC,IAAJ,EAAlC,EAA8CC,QAAQ,GAAG,IAAzD,EAAgE;AAC/D,QAAMC,CAAC,GAAG,IAAIF,IAAJ,CAAUD,IAAV,CAAV;AACA,SAAO,IAAIC,IAAJ,CACNE,CAAC,CAACC,WAAF,EADM,EAEND,CAAC,CAACE,QAAF,MAAiBH,QAAQ,GAAG,CAAH,GAAO,CAAhC,CAFM,EAGNA,QAAQ,GAAG,CAAH,GAAO,CAHT,EAILI,WAJK,EAAP;AAKA;;AAED,eAAe,SAASC,YAAT,GAAwB;AACtC,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBlB,SAAS,CACrCmB,MAAF,KAAgB;AACfF,IAAAA,QAAQ,EAAEE,MAAM,CAAEZ,WAAF,CAAN,CAAsBa,sBAAtB,CAA8C,MAA9C,CADK;AAEfF,IAAAA,QAAQ,EAAEC,MAAM,CAAEZ,WAAF,CAAN,CAAsBc,kBAAtB;AAFK,GAAhB,CADuC,EAKvC,EALuC,CAAxC;AAQA,QAAM;AAAEC,IAAAA;AAAF,MAAevB,WAAW,CAAEQ,WAAF,CAAhC;;AACA,QAAMgB,YAAY,GAAKd,IAAF,IAAYa,QAAQ,CAAE;AAAEb,IAAAA;AAAF,GAAF,CAAzC;;AAEA,QAAM,C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AAFzB,GAGEC,KAHF,CAGS,EAHT,EAIEC,OAJF,GAKEC,IALF,CAKQ,EALR,CADoB,CAMP;AANO,GAArB;;AASA,WAASC,QAAT,CAAmBC,OAAnB,EAA6B;AAC5B5B,IAAAA,YAAY,CAAE4B,OAAF,CAAZ;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAoBb,GAAG,CAACc,OAA9B;AACAD,IAAAA,aAAa,CAACE,aAAd,CAA4BC,IAA5B;AACA;;AAED,SACC,cAAC,cAAD;AACC,IAAA,GAAG,EAAGhB,GADP;AAEC,IAAA,WAAW,EAAGtB,QAFf;AAGC,IAAA,QAAQ,EAAGiC,QAHZ;AAIC,IAAA,QAAQ,EAAGT,YAJZ;AAKC,IAAA,MAAM,EAAGR,MALV;AAMC,IAAA,gBAAgB,EAAGR;AANpB,IADD;AAUA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalGetSettings } from '@wordpress/date';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { DateTimePicker } from '@wordpress/components';\nimport { useRef, useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction getDayOfTheMonth( date = new Date(), firstDay = true ) {\n\tconst d = new Date( date );\n\treturn new Date(\n\t\td.getFullYear(),\n\t\td.getMonth() + ( firstDay ? 0 : 1 ),\n\t\tfirstDay ? 1 : 0\n\t).toISOString();\n}\n\nexport default function PostSchedule() {\n\tconst { postDate, postType } = useSelect(\n\t\t( select ) => ( {\n\t\t\tpostDate: select( editorStore ).getEditedPostAttribute( 'date' ),\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onUpdateDate = ( date ) => editPost( { date } );\n\n\tconst [ previewedMonth, setPreviewedMonth ] = useState(\n\t\tgetDayOfTheMonth( postDate )\n\t);\n\n\t// Pick up published and schduled site posts.\n\tconst eventsByPostType = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords( 'postType', postType, {\n\t\t\t\tstatus: 'publish,future',\n\t\t\t\tafter: getDayOfTheMonth( previewedMonth ),\n\t\t\t\tbefore: getDayOfTheMonth( previewedMonth, false ),\n\t\t\t\texclude: [ select( editorStore ).getCurrentPostId() ],\n\t\t\t} ),\n\t\t[ previewedMonth, postType ]\n\t);\n\n\tconst events = useMemo(\n\t\t() =>\n\t\t\t( eventsByPostType || [] ).map(\n\t\t\t\t( { title, type, date: eventDate } ) => ( {\n\t\t\t\t\ttitle: title?.rendered,\n\t\t\t\t\ttype,\n\t\t\t\t\tdate: new Date( eventDate ),\n\t\t\t\t} )\n\t\t\t),\n\t\t[ eventsByPostType ]\n\t);\n\n\tconst ref = useRef();\n\tconst settings = __experimentalGetSettings();\n\n\t// To know if the current timezone is a 12 hour time with look for \"a\" in the time format\n\t// We also make sure this a is not escaped by a \"/\"\n\tconst is12HourTime = /a(?!\\\\)/i.test(\n\t\tsettings.formats.time\n\t\t\t.toLowerCase() // Test only the lower case a\n\t\t\t.replace( /\\\\\\\\/g, '' ) // Replace \"//\" with empty strings\n\t\t\t.split( '' )\n\t\t\t.reverse()\n\t\t\t.join( '' ) // Reverse the string and test for \"a\" not followed by a slash\n\t);\n\n\tfunction onChange( newDate ) {\n\t\tonUpdateDate( newDate );\n\t\tconst { ownerDocument } = ref.current;\n\t\townerDocument.activeElement.blur();\n\t}\n\n\treturn (\n\t\t<DateTimePicker\n\t\t\tref={ ref }\n\t\t\tcurrentDate={ postDate }\n\t\t\tonChange={ onChange }\n\t\t\tis12Hour={ is12HourTime }\n\t\t\tevents={ events }\n\t\t\tonMonthPreviewed={ setPreviewedMonth }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"names":["__experimentalGetSettings","useDispatch","useSelect","DateTimePicker","useRef","useState","useMemo","store","coreStore","editorStore","getDayOfTheMonth","date","Date","firstDay","d","getFullYear","getMonth","toISOString","PostSchedule","postDate","postType","select","getEditedPostAttribute","getCurrentPostType","editPost","onUpdateDate","previewedMonth","setPreviewedMonth","eventsByPostType","getEntityRecords","status","after","before","exclude","getCurrentPostId","events","map","title","type","eventDate","rendered","ref","settings","is12HourTime","test","formats","time","toLowerCase","replace","split","reverse","join","onChange","newDate","ownerDocument","current","activeElement","blur"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,yBAAT,QAA0C,iBAA1C;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,cAAT,QAA+B,uBAA/B;AACA,SAASC,MAAT,EAAiBC,QAAjB,EAA2BC,OAA3B,QAA0C,oBAA1C;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;;AAEA,SAASC,gBAAT,GAAgE;AAAA,MAArCC,IAAqC,uEAA9B,IAAIC,IAAJ,EAA8B;AAAA,MAAlBC,QAAkB,uEAAP,IAAO;AAC/D,QAAMC,CAAC,GAAG,IAAIF,IAAJ,CAAUD,IAAV,CAAV;AACA,SAAO,IAAIC,IAAJ,CACNE,CAAC,CAACC,WAAF,EADM,EAEND,CAAC,CAACE,QAAF,MAAiBH,QAAQ,GAAG,CAAH,GAAO,CAAhC,CAFM,EAGNA,QAAQ,GAAG,CAAH,GAAO,CAHT,EAILI,WAJK,EAAP;AAKA;;AAED,eAAe,SAASC,YAAT,GAAwB;AACtC,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBlB,SAAS,CACrCmB,MAAF,KAAgB;AACfF,IAAAA,QAAQ,EAAEE,MAAM,CAAEZ,WAAF,CAAN,CAAsBa,sBAAtB,CAA8C,MAA9C,CADK;AAEfF,IAAAA,QAAQ,EAAEC,MAAM,CAAEZ,WAAF,CAAN,CAAsBc,kBAAtB;AAFK,GAAhB,CADuC,E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,QAAQ,GAAG1C,yBAAyB,EAA1C,CAzCsC,CA2CtC;AACA;;;AACA,QAAM2C,YAAY,GAAG,WAAWC,IAAX,CACpBF,QAAQ,CAACG,OAAT,CAAiBC,IAAjB,CACEC,WADF,GACgB;AADhB,GAEEC,OAFF,CAEW,OAFX,EAEoB,EAFpB,EAEyB;AAFzB,GAGEC,KAHF,CAGS,EAHT,EAIEC,OAJF,GAKEC,IALF,CAKQ,EALR,CADoB,CAMP;AANO,GAArB;;AASA,WAASC,QAAT,CAAmBC,OAAnB,EAA6B;AAC5B5B,IAAAA,YAAY,CAAE4B,OAAF,CAAZ;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAoBb,GAAG,CAACc,OAA9B;AACAD,IAAAA,aAAa,CAACE,aAAd,CAA4BC,IAA5B;AACA;;AAED,SACC,cAAC,cAAD;AACC,IAAA,GAAG,EAAGhB,GADP;AAEC,IAAA,WAAW,EAAGtB,QAFf;AAGC,IAAA,QAAQ,EAAGiC,QAHZ;AAIC,IAAA,QAAQ,EAAGT,YAJZ;AAKC,IAAA,MAAM,EAAGR,MALV;AAMC,IAAA,gBAAgB,EAAGR;AANpB,IADD;AAUA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalGetSettings } from '@wordpress/date';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { DateTimePicker } from '@wordpress/components';\nimport { useRef, useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction getDayOfTheMonth( date = new Date(), firstDay = true ) {\n\tconst d = new Date( date );\n\treturn new Date(\n\t\td.getFullYear(),\n\t\td.getMonth() + ( firstDay ? 0 : 1 ),\n\t\tfirstDay ? 1 : 0\n\t).toISOString();\n}\n\nexport default function PostSchedule() {\n\tconst { postDate, postType } = useSelect(\n\t\t( select ) => ( {\n\t\t\tpostDate: select( editorStore ).getEditedPostAttribute( 'date' ),\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onUpdateDate = ( date ) => editPost( { date } );\n\n\tconst [ previewedMonth, setPreviewedMonth ] = useState(\n\t\tgetDayOfTheMonth( postDate )\n\t);\n\n\t// Pick up published and schduled site posts.\n\tconst eventsByPostType = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords( 'postType', postType, {\n\t\t\t\tstatus: 'publish,future',\n\t\t\t\tafter: getDayOfTheMonth( previewedMonth ),\n\t\t\t\tbefore: getDayOfTheMonth( previewedMonth, false ),\n\t\t\t\texclude: [ select( editorStore ).getCurrentPostId() ],\n\t\t\t} ),\n\t\t[ previewedMonth, postType ]\n\t);\n\n\tconst events = useMemo(\n\t\t() =>\n\t\t\t( eventsByPostType || [] ).map(\n\t\t\t\t( { title, type, date: eventDate } ) => ( {\n\t\t\t\t\ttitle: title?.rendered,\n\t\t\t\t\ttype,\n\t\t\t\t\tdate: new Date( eventDate ),\n\t\t\t\t} )\n\t\t\t),\n\t\t[ eventsByPostType ]\n\t);\n\n\tconst ref = useRef();\n\tconst settings = __experimentalGetSettings();\n\n\t// To know if the current timezone is a 12 hour time with look for \"a\" in the time format\n\t// We also make sure this a is not escaped by a \"/\"\n\tconst is12HourTime = /a(?!\\\\)/i.test(\n\t\tsettings.formats.time\n\t\t\t.toLowerCase() // Test only the lower case a\n\t\t\t.replace( /\\\\\\\\/g, '' ) // Replace \"//\" with empty strings\n\t\t\t.split( '' )\n\t\t\t.reverse()\n\t\t\t.join( '' ) // Reverse the string and test for \"a\" not followed by a slash\n\t);\n\n\tfunction onChange( newDate ) {\n\t\tonUpdateDate( newDate );\n\t\tconst { ownerDocument } = ref.current;\n\t\townerDocument.activeElement.blur();\n\t}\n\n\treturn (\n\t\t<DateTimePicker\n\t\t\tref={ ref }\n\t\t\tcurrentDate={ postDate }\n\t\t\tonChange={ onChange }\n\t\t\tis12Hour={ is12HourTime }\n\t\t\tevents={ events }\n\t\t\tonMonthPreviewed={ setPreviewedMonth }\n\t\t/>\n\t);\n}\n"]}
@@ -9,10 +9,12 @@ import { withSelect } from '@wordpress/data';
9
9
  */
10
10
 
11
11
  import { store as editorStore } from '../../store';
12
- export function PostScheduleLabel({
13
- date,
14
- isFloating
15
- }) {
12
+ export function PostScheduleLabel(_ref) {
13
+ let {
14
+ date,
15
+ isFloating
16
+ } = _ref;
17
+
16
18
  const settings = __experimentalGetSettings();
17
19
 
18
20
  return date && !isFloating ? format(`${settings.formats.date} ${settings.formats.time}`, date) : __('Immediately');
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-schedule/label.js"],"names":["__","format","__experimentalGetSettings","withSelect","store","editorStore","PostScheduleLabel","date","isFloating","settings","formats","time","select","getEditedPostAttribute","isEditedPostDateFloating"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,yBAAjB,QAAkD,iBAAlD;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,iBAAT,CAA4B;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,CAA5B,EAAmD;AACzD,QAAMC,QAAQ,GAAGP,yBAAyB,EAA1C;;AACA,SAAOK,IAAI,IAAI,CAAEC,UAAV,GACJP,MAAM,CACL,GAAGQ,QAAQ,CAACC,OAAT,CAAiBH,IAAM,IAAIE,QAAQ,CAACC,OAAT,CAAiBC,IAAM,EADhD,EAENJ,IAFM,CADF,GAKJP,EAAE,CAAE,aAAF,CALL;AAMA;AAED,eAAeG,UAAU,CAAIS,MAAF,IAAc;AACxC,SAAO;AACNL,IAAAA,IAAI,EAAEK,MAAM,CAAEP,WAAF,CAAN,CAAsBQ,sBAAtB,CAA8C,MAA9C,CADA;AAENL,IAAAA,UAAU,EAAEI,MAAM,CAAEP,WAAF,CAAN,CAAsBS,wBAAtB;AAFN,GAAP;AAIA,CALwB,CAAV,CAKVR,iBALU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { format, __experimentalGetSettings } from '@wordpress/date';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PostScheduleLabel( { date, isFloating } ) {\n\tconst settings = __experimentalGetSettings();\n\treturn date && ! isFloating\n\t\t? format(\n\t\t\t\t`${ settings.formats.date } ${ settings.formats.time }`,\n\t\t\t\tdate\n\t\t )\n\t\t: __( 'Immediately' );\n}\n\nexport default withSelect( ( select ) => {\n\treturn {\n\t\tdate: select( editorStore ).getEditedPostAttribute( 'date' ),\n\t\tisFloating: select( editorStore ).isEditedPostDateFloating(),\n\t};\n} )( PostScheduleLabel );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-schedule/label.js"],"names":["__","format","__experimentalGetSettings","withSelect","store","editorStore","PostScheduleLabel","date","isFloating","settings","formats","time","select","getEditedPostAttribute","isEditedPostDateFloating"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,yBAAjB,QAAkD,iBAAlD;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,iBAAT,OAAmD;AAAA,MAAvB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAuB;;AACzD,QAAMC,QAAQ,GAAGP,yBAAyB,EAA1C;;AACA,SAAOK,IAAI,IAAI,CAAEC,UAAV,GACJP,MAAM,CACL,GAAGQ,QAAQ,CAACC,OAAT,CAAiBH,IAAM,IAAIE,QAAQ,CAACC,OAAT,CAAiBC,IAAM,EADhD,EAENJ,IAFM,CADF,GAKJP,EAAE,CAAE,aAAF,CALL;AAMA;AAED,eAAeG,UAAU,CAAIS,MAAF,IAAc;AACxC,SAAO;AACNL,IAAAA,IAAI,EAAEK,MAAM,CAAEP,WAAF,CAAN,CAAsBQ,sBAAtB,CAA8C,MAA9C,CADA;AAENL,IAAAA,UAAU,EAAEI,MAAM,CAAEP,WAAF,CAAN,CAAsBS,wBAAtB;AAFN,GAAP;AAIA,CALwB,CAAV,CAKVR,iBALU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { format, __experimentalGetSettings } from '@wordpress/date';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PostScheduleLabel( { date, isFloating } ) {\n\tconst settings = __experimentalGetSettings();\n\treturn date && ! isFloating\n\t\t? format(\n\t\t\t\t`${ settings.formats.date } ${ settings.formats.time }`,\n\t\t\t\tdate\n\t\t )\n\t\t: __( 'Immediately' );\n}\n\nexport default withSelect( ( select ) => {\n\treturn {\n\t\tdate: select( editorStore ).getEditedPostAttribute( 'date' ),\n\t\tisFloating: select( editorStore ).isEditedPostDateFloating(),\n\t};\n} )( PostScheduleLabel );\n"]}
@@ -4,9 +4,10 @@ import { createElement } from "@wordpress/element";
4
4
  * Internal dependencies
5
5
  */
6
6
  import PostTypeSupportCheck from '../post-type-support-check';
7
- export default function PostSlugCheck({
8
- children
9
- }) {
7
+ export default function PostSlugCheck(_ref) {
8
+ let {
9
+ children
10
+ } = _ref;
10
11
  return createElement(PostTypeSupportCheck, {
11
12
  supportKeys: "slug"
12
13
  }, children);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-slug/check.js"],"names":["PostTypeSupportCheck","PostSlugCheck","children"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,oBAAP,MAAiC,4BAAjC;AAEA,eAAe,SAASC,aAAT,CAAwB;AAAEC,EAAAA;AAAF,CAAxB,EAAuC;AACrD,SACC,cAAC,oBAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACGA,QADH,CADD;AAKA","sourcesContent":["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nexport default function PostSlugCheck( { children } ) {\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"slug\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-slug/check.js"],"names":["PostTypeSupportCheck","PostSlugCheck","children"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,oBAAP,MAAiC,4BAAjC;AAEA,eAAe,SAASC,aAAT,OAAuC;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACrD,SACC,cAAC,oBAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACGA,QADH,CADD;AAKA","sourcesContent":["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nexport default function PostSlugCheck( { children } ) {\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"slug\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"]}
@@ -16,11 +16,12 @@ import PostSlugCheck from './check';
16
16
  import { cleanForSlug } from '../../utils/url';
17
17
  import { store as editorStore } from '../../store';
18
18
  export class PostSlug extends Component {
19
- constructor({
20
- postSlug,
21
- postTitle,
22
- postID
23
- }) {
19
+ constructor(_ref) {
20
+ let {
21
+ postSlug,
22
+ postTitle,
23
+ postID
24
+ } = _ref;
24
25
  super(...arguments);
25
26
  this.state = {
26
27
  editedSlug: safeDecodeURIComponent(postSlug) || cleanForSlug(postTitle) || postID
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-slug/index.js"],"names":["withDispatch","withSelect","Component","__","withInstanceId","compose","safeDecodeURIComponent","PostSlugCheck","cleanForSlug","store","editorStore","PostSlug","constructor","postSlug","postTitle","postID","arguments","state","editedSlug","setSlug","bind","event","onUpdateSlug","props","value","target","render","instanceId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sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { safeDecodeURIComponent } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PostSlugCheck from './check';\nimport { cleanForSlug } from '../../utils/url';\nimport { store as editorStore } from '../../store';\n\nexport class PostSlug extends Component {\n\tconstructor( { postSlug, postTitle, postID } ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\teditedSlug:\n\t\t\t\tsafeDecodeURIComponent( postSlug ) ||\n\t\t\t\tcleanForSlug( postTitle ) ||\n\t\t\t\tpostID,\n\t\t};\n\n\t\tthis.setSlug = this.setSlug.bind( this );\n\t}\n\n\tsetSlug( event ) {\n\t\tconst { postSlug, onUpdateSlug } = this.props;\n\t\tconst { value } = event.target;\n\n\t\tconst editedSlug = cleanForSlug( value );\n\n\t\tif ( editedSlug === postSlug ) {\n\t\t\treturn;\n\t\t}\n\n\t\tonUpdateSlug( editedSlug );\n\t}\n\n\trender() {\n\t\tconst { instanceId } = this.props;\n\t\tconst { editedSlug } = this.state;\n\n\t\tconst inputId = 'editor-post-slug-' + instanceId;\n\n\t\treturn (\n\t\t\t<PostSlugCheck>\n\t\t\t\t<label htmlFor={ inputId }>{ __( 'Slug' ) }</label>\n\t\t\t\t<input\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tid={ inputId }\n\t\t\t\t\tvalue={ editedSlug }\n\t\t\t\t\tonChange={ ( event ) =>\n\t\t\t\t\t\tthis.setState( { editedSlug: event.target.value } )\n\t\t\t\t\t}\n\t\t\t\t\tonBlur={ this.setSlug }\n\t\t\t\t\tclassName=\"editor-post-slug__input\"\n\t\t\t\t/>\n\t\t\t</PostSlugCheck>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getCurrentPost, getEditedPostAttribute } = select(\n\t\t\teditorStore\n\t\t);\n\n\t\tconst { id } = getCurrentPost();\n\t\treturn {\n\t\t\tpostSlug: getEditedPostAttribute( 'slug' ),\n\t\t\tpostTitle: getEditedPostAttribute( 'title' ),\n\t\t\tpostID: id,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonUpdateSlug( slug ) {\n\t\t\t\teditPost( { slug } );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n] )( PostSlug );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-slug/index.js"],"names":["withDispatch","withSelect","Component","__","withInstanceId","compose","safeDecodeURIComponent","PostSlugCheck","cleanForSlug","store","editorStore","PostSlug","constructor","postSlug","postTitle","postID","arguments","state","editedSlug","setSlug","bind","event","onUpdateSlug","props","value","target","render","instanceId","inputId","setState","select","getCurrentPost","getEditedPostAttribute","id","dispatch","editPost","slug"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,EAAyBC,OAAzB,QAAwC,oBAAxC;AACA,SAASC,sBAAT,QAAuC,gBAAvC;AAEA;AACA;AACA;;AACA,OAAOC,aAAP,MAA0B,SAA1B;AACA,SAASC,YAAT,QAA6B,iBAA7B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,MAAMC,QAAN,SAAuBT,SAAvB,CAAiC;AACvCU,EAAAA,WAAW,OAAoC;AAAA,QAAlC;AAAEC,MAAAA,QAAF;AAAYC,MAAAA,SAAZ;AAAuBC,MAAAA;AAAvB,KAAkC;AAC9C,UAAO,GAAGC,SAAV;AAEA,SAAKC,KAAL,GAAa;AACZC,MAAAA,UAAU,EAC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AA,cAAF;AAAkBC,IAAAA;AAAlB,MAA6CF,MAAM,CACxDpB,WADwD,CAAzD;AAIA,QAAM;AAAEuB,IAAAA;AAAF,MAASF,cAAc,EAA7B;AACA,SAAO;AACNlB,IAAAA,QAAQ,EAAEmB,sBAAsB,CAAE,MAAF,CAD1B;AAENlB,IAAAA,SAAS,EAAEkB,sBAAsB,CAAE,OAAF,CAF3B;AAGNjB,IAAAA,MAAM,EAAEkB;AAHF,GAAP;AAKA,CAXS,CADa,EAavBjC,YAAY,CAAIkC,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA;AAAF,MAAeD,QAAQ,CAAExB,WAAF,CAA7B;AACA,SAAO;AACNY,IAAAA,YAAY,CAAEc,IAAF,EAAS;AACpBD,MAAAA,QAAQ,CAAE;AAAEC,QAAAA;AAAF,OAAF,CAAR;AACA;;AAHK,GAAP;AAKA,CAPW,CAbW,EAqBvBhC,cArBuB,CAAF,CAAP,CAsBVO,QAtBU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { safeDecodeURIComponent } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PostSlugCheck from './check';\nimport { cleanForSlug } from '../../utils/url';\nimport { store as editorStore } from '../../store';\n\nexport class PostSlug extends Component {\n\tconstructor( { postSlug, postTitle, postID } ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\teditedSlug:\n\t\t\t\tsafeDecodeURIComponent( postSlug ) ||\n\t\t\t\tcleanForSlug( postTitle ) ||\n\t\t\t\tpostID,\n\t\t};\n\n\t\tthis.setSlug = this.setSlug.bind( this );\n\t}\n\n\tsetSlug( event ) {\n\t\tconst { postSlug, onUpdateSlug } = this.props;\n\t\tconst { value } = event.target;\n\n\t\tconst editedSlug = cleanForSlug( value );\n\n\t\tif ( editedSlug === postSlug ) {\n\t\t\treturn;\n\t\t}\n\n\t\tonUpdateSlug( editedSlug );\n\t}\n\n\trender() {\n\t\tconst { instanceId } = this.props;\n\t\tconst { editedSlug } = this.state;\n\n\t\tconst inputId = 'editor-post-slug-' + instanceId;\n\n\t\treturn (\n\t\t\t<PostSlugCheck>\n\t\t\t\t<label htmlFor={ inputId }>{ __( 'Slug' ) }</label>\n\t\t\t\t<input\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tid={ inputId }\n\t\t\t\t\tvalue={ editedSlug }\n\t\t\t\t\tonChange={ ( event ) =>\n\t\t\t\t\t\tthis.setState( { editedSlug: event.target.value } )\n\t\t\t\t\t}\n\t\t\t\t\tonBlur={ this.setSlug }\n\t\t\t\t\tclassName=\"editor-post-slug__input\"\n\t\t\t\t/>\n\t\t\t</PostSlugCheck>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getCurrentPost, getEditedPostAttribute } = select(\n\t\t\teditorStore\n\t\t);\n\n\t\tconst { id } = getCurrentPost();\n\t\treturn {\n\t\t\tpostSlug: getEditedPostAttribute( 'slug' ),\n\t\t\tpostTitle: getEditedPostAttribute( 'title' ),\n\t\t\tpostID: id,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonUpdateSlug( slug ) {\n\t\t\t\teditPost( { slug } );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n] )( PostSlug );\n"]}
@@ -13,11 +13,13 @@ import { withSelect } from '@wordpress/data';
13
13
  */
14
14
 
15
15
  import { store as editorStore } from '../../store';
16
- export function PostStickyCheck({
17
- hasStickyAction,
18
- postType,
19
- children
20
- }) {
16
+ export function PostStickyCheck(_ref) {
17
+ let {
18
+ hasStickyAction,
19
+ postType,
20
+ children
21
+ } = _ref;
22
+
21
23
  if (postType !== 'post' || !hasStickyAction) {
22
24
  return null;
23
25
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-sticky/check.js"],"names":["get","compose","withSelect","store","editorStore","PostStickyCheck","hasStickyAction","postType","children","select","post","getCurrentPost","getCurrentPostType"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,eAAT,CAA0B;AAAEC,EAAAA,eAAF;AAAmBC,EAAAA,QAAnB;AAA6BC,EAAAA;AAA7B,CAA1B,EAAoE;AAC1E,MAAKD,QAAQ,KAAK,MAAb,IAAuB,CAAED,eAA9B,EAAgD;AAC/C,WAAO,IAAP;AACA;;AAED,SAAOE,QAAP;AACA;AAED,eAAeP,OAAO,CAAE,CACvBC,UAAU,CAAIO,MAAF,IAAc;AACzB,QAAMC,IAAI,GAAGD,MAAM,CAAEL,WAAF,CAAN,CAAsBO,cAAtB,EAAb;AACA,SAAO;AACNL,IAAAA,eAAe,EAAEN,GAAG,CACnBU,IADmB,EAEnB,CAAE,QAAF,EAAY,kBAAZ,CAFmB,EAGnB,KAHmB,CADd;AAMNH,IAAAA,QAAQ,EAAEE,MAAM,CAAEL,WAAF,CAAN,CAAsBQ,kBAAtB;AANJ,GAAP;AAQA,CAVS,CADa,CAAF,CAAP,CAYVP,eAZU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\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 PostStickyCheck( { hasStickyAction, postType, children } ) {\n\tif ( postType !== 'post' || ! hasStickyAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\treturn {\n\t\t\thasStickyAction: get(\n\t\t\t\tpost,\n\t\t\t\t[ '_links', 'wp:action-sticky' ],\n\t\t\t\tfalse\n\t\t\t),\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t};\n\t} ),\n] )( PostStickyCheck );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-sticky/check.js"],"names":["get","compose","withSelect","store","editorStore","PostStickyCheck","hasStickyAction","postType","children","select","post","getCurrentPost","getCurrentPostType"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,eAAT,OAAoE;AAAA,MAA1C;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA,QAAnB;AAA6BC,IAAAA;AAA7B,GAA0C;;AAC1E,MAAKD,QAAQ,KAAK,MAAb,IAAuB,CAAED,eAA9B,EAAgD;AAC/C,WAAO,IAAP;AACA;;AAED,SAAOE,QAAP;AACA;AAED,eAAeP,OAAO,CAAE,CACvBC,UAAU,CAAIO,MAAF,IAAc;AACzB,QAAMC,IAAI,GAAGD,MAAM,CAAEL,WAAF,CAAN,CAAsBO,cAAtB,EAAb;AACA,SAAO;AACNL,IAAAA,eAAe,EAAEN,GAAG,CACnBU,IADmB,EAEnB,CAAE,QAAF,EAAY,kBAAZ,CAFmB,EAGnB,KAHmB,CADd;AAMNH,IAAAA,QAAQ,EAAEE,MAAM,CAAEL,WAAF,CAAN,CAAsBQ,kBAAtB;AANJ,GAAP;AAQA,CAVS,CADa,CAAF,CAAP,CAYVP,eAZU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\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 PostStickyCheck( { hasStickyAction, postType, children } ) {\n\tif ( postType !== 'post' || ! hasStickyAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\treturn {\n\t\t\thasStickyAction: get(\n\t\t\t\tpost,\n\t\t\t\t[ '_links', 'wp:action-sticky' ],\n\t\t\t\tfalse\n\t\t\t),\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t};\n\t} ),\n] )( PostStickyCheck );\n"]}
@@ -13,10 +13,11 @@ import { compose } from '@wordpress/compose';
13
13
 
14
14
  import PostStickyCheck from './check';
15
15
  import { store as editorStore } from '../../store';
16
- export function PostSticky({
17
- onUpdateSticky,
18
- postSticky = false
19
- }) {
16
+ export function PostSticky(_ref) {
17
+ let {
18
+ onUpdateSticky,
19
+ postSticky = false
20
+ } = _ref;
20
21
  return createElement(PostStickyCheck, null, createElement(CheckboxControl, {
21
22
  label: __('Stick to the top of the blog'),
22
23
  checked: postSticky,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-sticky/index.js"],"names":["__","CheckboxControl","withSelect","withDispatch","compose","PostStickyCheck","store","editorStore","PostSticky","onUpdateSticky","postSticky","select","getEditedPostAttribute","dispatch","editPost","sticky"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,uBAAhC;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,SAA5B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,UAAT,CAAqB;AAAEC,EAAAA,cAAF;AAAkBC,EAAAA,UAAU,GAAG;AAA/B,CAArB,EAA8D;AACpE,SACC,cAAC,eAAD,QACC,cAAC,eAAD;AACC,IAAA,KAAK,EAAGV,EAAE,CAAE,8BAAF,CADX;AAEC,IAAA,OAAO,EAAGU,UAFX;AAGC,IAAA,QAAQ,EAAG,MAAMD,cAAc,CAAE,CAAEC,UAAJ;AAHhC,IADD,CADD;AASA;AAED,eAAeN,OAAO,CAAE,CACvBF,UAAU,CAAIS,MAAF,IAAc;AACzB,SAAO;AACND,IAAAA,UAAU,EAAEC,MAAM,CAAEJ,WAAF,CAAN,CAAsBK,sBAAtB,CACX,QADW;AADN,GAAP;AAKA,CANS,CADa,EAQvBT,YAAY,CAAIU,QAAF,IAAgB;AAC7B,SAAO;AACNJ,IAAAA,cAAc,CAAEC,UAAF,EAAe;AAC5BG,MAAAA,QAAQ,CAAEN,WAAF,CAAR,CAAwBO,QAAxB,CAAkC;AAAEC,QAAAA,MAAM,EAAEL;AAAV,OAAlC;AACA;;AAHK,GAAP;AAKA,CANW,CARW,CAAF,CAAP,CAeVF,UAfU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostStickyCheck from './check';\nimport { store as editorStore } from '../../store';\n\nexport function PostSticky( { onUpdateSticky, postSticky = false } ) {\n\treturn (\n\t\t<PostStickyCheck>\n\t\t\t<CheckboxControl\n\t\t\t\tlabel={ __( 'Stick to the top of the blog' ) }\n\t\t\t\tchecked={ postSticky }\n\t\t\t\tonChange={ () => onUpdateSticky( ! postSticky ) }\n\t\t\t/>\n\t\t</PostStickyCheck>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostSticky: select( editorStore ).getEditedPostAttribute(\n\t\t\t\t'sticky'\n\t\t\t),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\treturn {\n\t\t\tonUpdateSticky( postSticky ) {\n\t\t\t\tdispatch( editorStore ).editPost( { sticky: postSticky } );\n\t\t\t},\n\t\t};\n\t} ),\n] )( PostSticky );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-sticky/index.js"],"names":["__","CheckboxControl","withSelect","withDispatch","compose","PostStickyCheck","store","editorStore","PostSticky","onUpdateSticky","postSticky","select","getEditedPostAttribute","dispatch","editPost","sticky"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,uBAAhC;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,SAA5B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,UAAT,OAA8D;AAAA,MAAzC;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,UAAU,GAAG;AAA/B,GAAyC;AACpE,SACC,cAAC,eAAD,QACC,cAAC,eAAD;AACC,IAAA,KAAK,EAAGV,EAAE,CAAE,8BAAF,CADX;AAEC,IAAA,OAAO,EAAGU,UAFX;AAGC,IAAA,QAAQ,EAAG,MAAMD,cAAc,CAAE,CAAEC,UAAJ;AAHhC,IADD,CADD;AASA;AAED,eAAeN,OAAO,CAAE,CACvBF,UAAU,CAAIS,MAAF,IAAc;AACzB,SAAO;AACND,IAAAA,UAAU,EAAEC,MAAM,CAAEJ,WAAF,CAAN,CAAsBK,sBAAtB,CACX,QADW;AADN,GAAP;AAKA,CANS,CADa,EAQvBT,YAAY,CAAIU,QAAF,IAAgB;AAC7B,SAAO;AACNJ,IAAAA,cAAc,CAAEC,UAAF,EAAe;AAC5BG,MAAAA,QAAQ,CAAEN,WAAF,CAAR,CAAwBO,QAAxB,CAAkC;AAAEC,QAAAA,MAAM,EAAEL;AAAV,OAAlC;AACA;;AAHK,GAAP;AAKA,CANW,CARW,CAAF,CAAP,CAeVF,UAfU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostStickyCheck from './check';\nimport { store as editorStore } from '../../store';\n\nexport function PostSticky( { onUpdateSticky, postSticky = false } ) {\n\treturn (\n\t\t<PostStickyCheck>\n\t\t\t<CheckboxControl\n\t\t\t\tlabel={ __( 'Stick to the top of the blog' ) }\n\t\t\t\tchecked={ postSticky }\n\t\t\t\tonChange={ () => onUpdateSticky( ! postSticky ) }\n\t\t\t/>\n\t\t</PostStickyCheck>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostSticky: select( editorStore ).getEditedPostAttribute(\n\t\t\t\t'sticky'\n\t\t\t),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\treturn {\n\t\t\tonUpdateSticky( postSticky ) {\n\t\t\t\tdispatch( editorStore ).editPost( { sticky: postSticky } );\n\t\t\t},\n\t\t};\n\t} ),\n] )( PostSticky );\n"]}
@@ -13,12 +13,13 @@ import { compose, useViewportMatch } from '@wordpress/compose';
13
13
 
14
14
  import { store as editorStore } from '../../store';
15
15
 
16
- function PostSwitchToDraftButton({
17
- isSaving,
18
- isPublished,
19
- isScheduled,
20
- onClick
21
- }) {
16
+ function PostSwitchToDraftButton(_ref) {
17
+ let {
18
+ isSaving,
19
+ isPublished,
20
+ isScheduled,
21
+ onClick
22
+ } = _ref;
22
23
  const isMobileViewport = useViewportMatch('small', '<');
23
24
 
24
25
  if (!isPublished && !isScheduled) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-switch-to-draft-button/index.js"],"names":["Button","__","withSelect","withDispatch","compose","useViewportMatch","store","editorStore","PostSwitchToDraftButton","isSaving","isPublished","isScheduled","onClick","isMobileViewport","onSwitch","alertMessage","window","confirm","select","isSavingPost","isCurrentPostPublished","isCurrentPostScheduled","dispatch","editPost","savePost","status"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,EAAkBC,gBAAlB,QAA0C,oBAA1C;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;;AAEA,SAASC,uBAAT,CAAkC;AACjCC,EAAAA,QADiC;AAEjCC,EAAAA,WAFiC;AAGjCC,EAAAA,WAHiC;AAIjCC,EAAAA;AAJiC,CAAlC,EAKI;AACH,QAAMC,gBAAgB,GAAGR,gBAAgB,CAAE,OAAF,EAAW,GAAX,CAAzC;;AAEA,MAAK,CAAEK,WAAF,IAAiB,CAAEC,WAAxB,EAAsC;AACrC,WAAO,IAAP;AACA;;AAED,QAAMG,QAAQ,GAAG,MAAM;AACtB,QAAIC,YAAJ;;AACA,QAAKL,WAAL,EAAmB;AAClBK,MAAAA,YAAY,GAAGd,EAAE,CAChB,+CADgB,CAAjB;AAGA,KAJD,MAIO,IAAKU,WAAL,EAAmB;AACzBI,MAAAA,YAAY,GAAGd,EAAE,CAChB,gDADgB,CAAjB;AAGA,KAVqB,CAWtB;;;AACA,QAAKe,MAAM,CAACC,OAAP,CAAgBF,YAAhB,CAAL,EAAsC;AACrCH,MAAAA,OAAO;AACP;AACD,GAfD;;AAiBA,SACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,6BADX;AAEC,IAAA,OAAO,EAAGE,QAFX;AAGC,IAAA,QAAQ,EAAGL,QAHZ;AAIC,IAAA,OAAO,EAAC;AAJT,KAMGI,gBAAgB,GAAGZ,EAAE,CAAE,OAAF,CAAL,GAAmBA,EAAE,CAAE,iBAAF,CANxC,CADD;AAUA;;AAED,eAAeG,OAAO,CAAE,CACvBF,UAAU,CAAIgB,MAAF,IAAc;AACzB,QAAM;AACLC,IAAAA,YADK;AAELC,IAAAA,sBAFK;AAGLC,IAAAA;AAHK,MAIFH,MAAM,CAAEX,WAAF,CAJV;AAKA,SAAO;AACNE,IAAAA,QAAQ,EAAEU,YAAY,EADhB;AAENT,IAAAA,WAAW,EAAEU,sBAAsB,EAF7B;AAGNT,IAAAA,WAAW,EAAEU,sBAAsB;AAH7B,GAAP;AAKA,CAXS,CADa,EAavBlB,YAAY,CAAImB,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBF,QAAQ,CAAEf,WAAF,CAAvC;AACA,SAAO;AACNK,IAAAA,OAAO,EAAE,MAAM;AACdW,MAAAA,QAAQ,CAAE;AAAEE,QAAAA,MAAM,EAAE;AAAV,OAAF,CAAR;AACAD,MAAAA,QAAQ;AACR;AAJK,GAAP;AAMA,CARW,CAbW,CAAF,CAAP,CAsBVhB,uBAtBU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose, useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostSwitchToDraftButton( {\n\tisSaving,\n\tisPublished,\n\tisScheduled,\n\tonClick,\n} ) {\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\n\tif ( ! isPublished && ! isScheduled ) {\n\t\treturn null;\n\t}\n\n\tconst onSwitch = () => {\n\t\tlet alertMessage;\n\t\tif ( isPublished ) {\n\t\t\talertMessage = __(\n\t\t\t\t'Are you sure you want to unpublish this post?'\n\t\t\t);\n\t\t} else if ( isScheduled ) {\n\t\t\talertMessage = __(\n\t\t\t\t'Are you sure you want to unschedule this post?'\n\t\t\t);\n\t\t}\n\t\t// eslint-disable-next-line no-alert\n\t\tif ( window.confirm( alertMessage ) ) {\n\t\t\tonClick();\n\t\t}\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"editor-post-switch-to-draft\"\n\t\t\tonClick={ onSwitch }\n\t\t\tdisabled={ isSaving }\n\t\t\tvariant=\"tertiary\"\n\t\t>\n\t\t\t{ isMobileViewport ? __( 'Draft' ) : __( 'Switch to draft' ) }\n\t\t</Button>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisSavingPost,\n\t\t\tisCurrentPostPublished,\n\t\t\tisCurrentPostScheduled,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, savePost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonClick: () => {\n\t\t\t\teditPost( { status: 'draft' } );\n\t\t\t\tsavePost();\n\t\t\t},\n\t\t};\n\t} ),\n] )( PostSwitchToDraftButton );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-switch-to-draft-button/index.js"],"names":["Button","__","withSelect","withDispatch","compose","useViewportMatch","store","editorStore","PostSwitchToDraftButton","isSaving","isPublished","isScheduled","onClick","isMobileViewport","onSwitch","alertMessage","window","confirm","select","isSavingPost","isCurrentPostPublished","isCurrentPostScheduled","dispatch","editPost","savePost","status"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,EAAkBC,gBAAlB,QAA0C,oBAA1C;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;;AAEA,SAASC,u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AAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBF,QAAQ,CAAEf,WAAF,CAAvC;AACA,SAAO;AACNK,IAAAA,OAAO,EAAE,MAAM;AACdW,MAAAA,QAAQ,CAAE;AAAEE,QAAAA,MAAM,EAAE;AAAV,OAAF,CAAR;AACAD,MAAAA,QAAQ;AACR;AAJK,GAAP;AAMA,CARW,CAbW,CAAF,CAAP,CAsBVhB,uBAtBU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose, useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostSwitchToDraftButton( {\n\tisSaving,\n\tisPublished,\n\tisScheduled,\n\tonClick,\n} ) {\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\n\tif ( ! isPublished && ! isScheduled ) {\n\t\treturn null;\n\t}\n\n\tconst onSwitch = () => {\n\t\tlet alertMessage;\n\t\tif ( isPublished ) {\n\t\t\talertMessage = __(\n\t\t\t\t'Are you sure you want to unpublish this post?'\n\t\t\t);\n\t\t} else if ( isScheduled ) {\n\t\t\talertMessage = __(\n\t\t\t\t'Are you sure you want to unschedule this post?'\n\t\t\t);\n\t\t}\n\t\t// eslint-disable-next-line no-alert\n\t\tif ( window.confirm( alertMessage ) ) {\n\t\t\tonClick();\n\t\t}\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"editor-post-switch-to-draft\"\n\t\t\tonClick={ onSwitch }\n\t\t\tdisabled={ isSaving }\n\t\t\tvariant=\"tertiary\"\n\t\t>\n\t\t\t{ isMobileViewport ? __( 'Draft' ) : __( 'Switch to draft' ) }\n\t\t</Button>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisSavingPost,\n\t\t\tisCurrentPostPublished,\n\t\t\tisCurrentPostScheduled,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, savePost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonClick: () => {\n\t\t\t\teditPost( { status: 'draft' } );\n\t\t\t\tsavePost();\n\t\t\t},\n\t\t};\n\t} ),\n] )( PostSwitchToDraftButton );\n"]}
@@ -14,11 +14,12 @@ import { store as coreStore } from '@wordpress/core-data';
14
14
  */
15
15
 
16
16
  import { store as editorStore } from '../../store';
17
- export function PostTaxonomiesCheck({
18
- postType,
19
- taxonomies,
20
- children
21
- }) {
17
+ export function PostTaxonomiesCheck(_ref) {
18
+ let {
19
+ postType,
20
+ taxonomies,
21
+ children
22
+ } = _ref;
22
23
  const hasTaxonomies = some(taxonomies, taxonomy => includes(taxonomy.types, postType));
23
24
 
24
25
  if (!hasTaxonomies) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/check.js"],"names":["some","includes","compose","withSelect","store","coreStore","editorStore","PostTaxonomiesCheck","postType","taxonomies","children","hasTaxonomies","taxonomy","types","select","getCurrentPostType","getTaxonomies","per_page"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,QAAf,QAA+B,QAA/B;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,mBAAT,CAA8B;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,UAAZ;AAAwBC,EAAAA;AAAxB,CAA9B,EAAmE;AACzE,QAAMC,aAAa,GAAGX,IAAI,CAAES,UAAF,EAAgBG,QAAF,IACvCX,QAAQ,CAAEW,QAAQ,CAACC,KAAX,EAAkBL,QAAlB,CADiB,CAA1B;;AAGA,MAAK,CAAEG,aAAP,EAAuB;AACtB,WAAO,IAAP;AACA;;AAED,SAAOD,QAAP;AACA;AAED,eAAeR,OAAO,CAAE,CACvBC,UAAU,CAAIW,MAAF,IAAc;AACzB,SAAO;AACNN,IAAAA,QAAQ,EAAEM,MAAM,CAAER,WAAF,CAAN,CAAsBS,kBAAtB,EADJ;AAENN,IAAAA,UAAU,EAAEK,MAAM,CAAET,SAAF,CAAN,CAAoBW,aAApB,CAAmC;AAAEC,MAAAA,QAAQ,EAAE,CAAC;AAAb,KAAnC;AAFN,GAAP;AAIA,CALS,CADa,CAAF,CAAP,CAOVV,mBAPU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { some, includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PostTaxonomiesCheck( { postType, taxonomies, children } ) {\n\tconst hasTaxonomies = some( taxonomies, ( taxonomy ) =>\n\t\tincludes( taxonomy.types, postType )\n\t);\n\tif ( ! hasTaxonomies ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t\ttaxonomies: select( coreStore ).getTaxonomies( { per_page: -1 } ),\n\t\t};\n\t} ),\n] )( PostTaxonomiesCheck );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/check.js"],"names":["some","includes","compose","withSelect","store","coreStore","editorStore","PostTaxonomiesCheck","postType","taxonomies","children","hasTaxonomies","taxonomy","types","select","getCurrentPostType","getTaxonomies","per_page"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,QAAf,QAA+B,QAA/B;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,mBAAT,OAAmE;AAAA,MAArC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,UAAZ;AAAwBC,IAAAA;AAAxB,GAAqC;AACzE,QAAMC,aAAa,GAAGX,IAAI,CAAES,UAAF,EAAgBG,QAAF,IACvCX,QAAQ,CAAEW,QAAQ,CAACC,KAAX,EAAkBL,QAAlB,CADiB,CAA1B;;AAGA,MAAK,CAAEG,aAAP,EAAuB;AACtB,WAAO,IAAP;AACA;;AAED,SAAOD,QAAP;AACA;AAED,eAAeR,OAAO,CAAE,CACvBC,UAAU,CAAIW,MAAF,IAAc;AACzB,SAAO;AACNN,IAAAA,QAAQ,EAAEM,MAAM,CAAER,WAAF,CAAN,CAAsBS,kBAAtB,EADJ;AAENN,IAAAA,UAAU,EAAEK,MAAM,CAAET,SAAF,CAAN,CAAoBW,aAApB,CAAmC;AAAEC,MAAAA,QAAQ,EAAE,CAAC;AAAb,KAAnC;AAFN,GAAP;AAIA,CALS,CADa,CAAF,CAAP,CAOVV,mBAPU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { some, includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PostTaxonomiesCheck( { postType, taxonomies, children } ) {\n\tconst hasTaxonomies = some( taxonomies, ( taxonomy ) =>\n\t\tincludes( taxonomy.types, postType )\n\t);\n\tif ( ! hasTaxonomies ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t\ttaxonomies: select( coreStore ).getTaxonomies( { per_page: -1 } ),\n\t\t};\n\t} ),\n] )( PostTaxonomiesCheck );\n"]}