@wordpress/editor 13.31.0 → 13.33.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 (647) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +1080 -0
  3. package/build/bindings/index.js.map +1 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/bindings/post-meta.js +12 -30
  6. package/build/bindings/post-meta.js.map +1 -1
  7. package/build/components/autocompleters/index.js.map +1 -1
  8. package/build/components/autocompleters/user.js.map +1 -1
  9. package/build/components/autosave-monitor/index.js +10 -0
  10. package/build/components/autosave-monitor/index.js.map +1 -1
  11. package/build/components/block-manager/category.js.map +1 -1
  12. package/build/components/block-manager/checklist.js.map +1 -1
  13. package/build/components/block-manager/index.js.map +1 -1
  14. package/build/components/block-removal-warnings/index.js.map +1 -1
  15. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +107 -0
  16. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
  17. package/build/components/character-count/index.js.map +1 -1
  18. package/build/components/commands/index.js +20 -1
  19. package/build/components/commands/index.js.map +1 -1
  20. package/build/components/commands/index.native.js.map +1 -1
  21. package/build/components/deprecated.js +158 -0
  22. package/build/components/deprecated.js.map +1 -1
  23. package/build/components/deprecated.native.js.map +1 -1
  24. package/build/components/document-bar/index.js +5 -8
  25. package/build/components/document-bar/index.js.map +1 -1
  26. package/build/components/document-outline/check.js.map +1 -1
  27. package/build/components/document-outline/index.js.map +1 -1
  28. package/build/components/document-outline/item.js.map +1 -1
  29. package/build/components/document-tools/index.js +1 -1
  30. package/build/components/document-tools/index.js.map +1 -1
  31. package/build/components/editor-canvas/edit-template-blocks-notification.js +12 -38
  32. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  33. package/build/components/editor-canvas/index.js +5 -2
  34. package/build/components/editor-canvas/index.js.map +1 -1
  35. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  36. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  37. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  38. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  39. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  40. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  41. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/index.native.js.map +1 -1
  43. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  44. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  45. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  46. package/build/components/editor-help/view-sections.native.js.map +1 -1
  47. package/build/components/editor-history/redo.js.map +1 -1
  48. package/build/components/editor-history/undo.js.map +1 -1
  49. package/build/components/editor-notices/index.js.map +1 -1
  50. package/build/components/editor-snackbars/index.js.map +1 -1
  51. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  52. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  53. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  54. package/build/components/entities-saved-states/index.js +11 -85
  55. package/build/components/entities-saved-states/index.js.map +1 -1
  56. package/build/components/error-boundary/index.js.map +1 -1
  57. package/build/components/error-boundary/index.native.js.map +1 -1
  58. package/build/components/global-keyboard-shortcuts/index.js +24 -0
  59. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  60. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  61. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  62. package/build/components/index.js +57 -1
  63. package/build/components/index.js.map +1 -1
  64. package/build/components/index.native.js.map +1 -1
  65. package/build/components/inserter-sidebar/index.js +5 -1
  66. package/build/components/inserter-sidebar/index.js.map +1 -1
  67. package/build/components/keyboard-shortcut-help-modal/config.js +78 -0
  68. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  69. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
  70. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  71. package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
  72. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  73. package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
  74. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  75. package/build/components/list-view-sidebar/index.js +2 -1
  76. package/build/components/list-view-sidebar/index.js.map +1 -1
  77. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  78. package/build/components/local-autosave-monitor/index.js.map +1 -1
  79. package/build/components/media-categories/index.js.map +1 -1
  80. package/build/components/mode-switcher/index.js.map +1 -1
  81. package/build/components/offline-status/index.native.js.map +1 -1
  82. package/build/components/page-attributes/check.js.map +1 -1
  83. package/build/components/page-attributes/order.js.map +1 -1
  84. package/build/components/page-attributes/panel.js.map +1 -1
  85. package/build/components/page-attributes/parent.js.map +1 -1
  86. package/build/components/pattern-overrides-panel/index.js +30 -0
  87. package/build/components/pattern-overrides-panel/index.js.map +1 -0
  88. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  89. package/build/components/plugin-more-menu-item/index.js +78 -0
  90. package/build/components/plugin-more-menu-item/index.js.map +1 -0
  91. package/build/components/plugin-post-publish-panel/index.js +68 -0
  92. package/build/components/plugin-post-publish-panel/index.js.map +1 -0
  93. package/build/components/plugin-post-status-info/index.js +73 -0
  94. package/build/components/plugin-post-status-info/index.js.map +1 -0
  95. package/build/components/plugin-pre-publish-panel/index.js +71 -0
  96. package/build/components/plugin-pre-publish-panel/index.js.map +1 -0
  97. package/build/components/plugin-sidebar/index.js +108 -0
  98. package/build/components/plugin-sidebar/index.js.map +1 -0
  99. package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
  100. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  101. package/build/components/post-actions/actions.js +656 -0
  102. package/build/components/post-actions/actions.js.map +1 -0
  103. package/build/components/post-actions/index.js +137 -0
  104. package/build/components/post-actions/index.js.map +1 -0
  105. package/build/components/post-author/check.js.map +1 -1
  106. package/build/components/post-author/combobox.js.map +1 -1
  107. package/build/components/post-author/constants.js.map +1 -1
  108. package/build/components/post-author/hook.js.map +1 -1
  109. package/build/components/post-author/index.js.map +1 -1
  110. package/build/components/post-author/panel.js.map +1 -1
  111. package/build/components/post-author/select.js.map +1 -1
  112. package/build/components/post-card-panel/index.js +127 -0
  113. package/build/components/post-card-panel/index.js.map +1 -0
  114. package/build/components/post-comments/index.js.map +1 -1
  115. package/build/components/post-discussion/panel.js.map +1 -1
  116. package/build/components/post-excerpt/check.js +8 -0
  117. package/build/components/post-excerpt/check.js.map +1 -1
  118. package/build/components/post-excerpt/index.js.map +1 -1
  119. package/build/components/post-excerpt/panel.js.map +1 -1
  120. package/build/components/post-excerpt/plugin.js.map +1 -1
  121. package/build/components/post-featured-image/check.js.map +1 -1
  122. package/build/components/post-featured-image/index.js.map +1 -1
  123. package/build/components/post-featured-image/panel.js.map +1 -1
  124. package/build/components/post-format/check.js.map +1 -1
  125. package/build/components/post-format/index.js.map +1 -1
  126. package/build/components/post-last-revision/check.js.map +1 -1
  127. package/build/components/post-last-revision/index.js.map +1 -1
  128. package/build/components/post-last-revision/panel.js.map +1 -1
  129. package/build/components/post-locked-modal/index.js.map +1 -1
  130. package/build/components/post-panel-row/index.js.map +1 -1
  131. package/build/components/post-pending-status/check.js.map +1 -1
  132. package/build/components/post-pending-status/index.js.map +1 -1
  133. package/build/components/post-pingbacks/index.js.map +1 -1
  134. package/build/components/post-preview-button/index.js.map +1 -1
  135. package/build/components/post-publish-button/index.js +31 -31
  136. package/build/components/post-publish-button/index.js.map +1 -1
  137. package/build/components/post-publish-button/label.js +51 -43
  138. package/build/components/post-publish-button/label.js.map +1 -1
  139. package/build/components/post-publish-panel/index.js.map +1 -1
  140. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  141. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  142. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  143. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  144. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  145. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  146. package/build/components/post-saved-state/index.js +10 -6
  147. package/build/components/post-saved-state/index.js.map +1 -1
  148. package/build/components/post-schedule/check.js.map +1 -1
  149. package/build/components/post-schedule/index.js.map +1 -1
  150. package/build/components/post-schedule/label.js.map +1 -1
  151. package/build/components/post-schedule/panel.js +8 -0
  152. package/build/components/post-schedule/panel.js.map +1 -1
  153. package/build/components/post-slug/check.js.map +1 -1
  154. package/build/components/post-slug/index.js +43 -68
  155. package/build/components/post-slug/index.js.map +1 -1
  156. package/build/components/post-status/index.js +239 -0
  157. package/build/components/post-status/index.js.map +1 -0
  158. package/build/components/post-sticky/check.js.map +1 -1
  159. package/build/components/post-sticky/index.js.map +1 -1
  160. package/build/components/post-switch-to-draft-button/index.js +6 -1
  161. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  162. package/build/components/post-sync-status/index.js.map +1 -1
  163. package/build/components/post-taxonomies/check.js.map +1 -1
  164. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  165. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  166. package/build/components/post-taxonomies/index.js.map +1 -1
  167. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  168. package/build/components/post-taxonomies/panel.js.map +1 -1
  169. package/build/components/post-template/block-theme.js +6 -2
  170. package/build/components/post-template/block-theme.js.map +1 -1
  171. package/build/components/post-template/classic-theme.js.map +1 -1
  172. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  173. package/build/components/post-template/create-new-template.js.map +1 -1
  174. package/build/components/post-template/hooks.js.map +1 -1
  175. package/build/components/post-template/panel.js.map +1 -1
  176. package/build/components/post-template/reset-default-template.js.map +1 -1
  177. package/build/components/post-template/swap-template-button.js.map +1 -1
  178. package/build/components/post-text-editor/index.js.map +1 -1
  179. package/build/components/post-title/constants.js.map +1 -1
  180. package/build/components/post-title/index.js.map +1 -1
  181. package/build/components/post-title/index.native.js +1 -1
  182. package/build/components/post-title/index.native.js.map +1 -1
  183. package/build/components/post-title/post-title-raw.js.map +1 -1
  184. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  185. package/build/components/post-title/use-post-title.js.map +1 -1
  186. package/build/components/post-trash/check.js +23 -25
  187. package/build/components/post-trash/check.js.map +1 -1
  188. package/build/components/post-trash/index.js +2 -1
  189. package/build/components/post-trash/index.js.map +1 -1
  190. package/build/components/post-type-support-check/index.js.map +1 -1
  191. package/build/components/post-url/check.js.map +1 -1
  192. package/build/components/post-url/index.js +44 -19
  193. package/build/components/post-url/index.js.map +1 -1
  194. package/build/components/post-url/label.js.map +1 -1
  195. package/build/components/post-url/panel.js +14 -7
  196. package/build/components/post-url/panel.js.map +1 -1
  197. package/build/components/post-view-link/index.js.map +1 -1
  198. package/build/components/post-visibility/check.js.map +1 -1
  199. package/build/components/post-visibility/index.js +2 -1
  200. package/build/components/post-visibility/index.js.map +1 -1
  201. package/build/components/post-visibility/label.js.map +1 -1
  202. package/build/components/post-visibility/utils.js.map +1 -1
  203. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  204. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  205. package/build/components/preferences-modal/index.js +19 -17
  206. package/build/components/preferences-modal/index.js.map +1 -1
  207. package/build/components/preview-dropdown/index.js.map +1 -1
  208. package/build/components/provider/disable-non-page-content-blocks.js +36 -20
  209. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  210. package/build/components/provider/index.js +4 -2
  211. package/build/components/provider/index.js.map +1 -1
  212. package/build/components/provider/index.native.js +6 -1
  213. package/build/components/provider/index.native.js.map +1 -1
  214. package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
  215. package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
  216. package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  217. package/build/components/provider/use-block-editor-settings.js +70 -50
  218. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  219. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  220. package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  221. package/build/components/provider/with-registry-provider.js +1 -0
  222. package/build/components/provider/with-registry-provider.js.map +1 -1
  223. package/build/components/start-page-options/index.js +139 -0
  224. package/build/components/start-page-options/index.js.map +1 -0
  225. package/build/components/table-of-contents/index.js.map +1 -1
  226. package/build/components/table-of-contents/panel.js.map +1 -1
  227. package/build/components/template-areas/index.js +70 -0
  228. package/build/components/template-areas/index.js.map +1 -0
  229. package/build/components/template-validation-notice/index.js +23 -29
  230. package/build/components/template-validation-notice/index.js.map +1 -1
  231. package/build/components/theme-support-check/index.js +10 -16
  232. package/build/components/theme-support-check/index.js.map +1 -1
  233. package/build/components/time-to-read/index.js.map +1 -1
  234. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  235. package/build/components/word-count/index.js.map +1 -1
  236. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  237. package/build/hooks/default-autocompleters.js.map +1 -1
  238. package/build/hooks/index.js.map +1 -1
  239. package/build/hooks/index.native.js.map +1 -1
  240. package/build/hooks/pattern-overrides.js +22 -10
  241. package/build/hooks/pattern-overrides.js.map +1 -1
  242. package/build/hooks/use-select-nearest-editable-block.js +87 -0
  243. package/build/hooks/use-select-nearest-editable-block.js.map +1 -0
  244. package/build/index.js.map +1 -1
  245. package/build/index.native.js.map +1 -1
  246. package/build/lock-unlock.js.map +1 -1
  247. package/build/private-apis.js +26 -1
  248. package/build/private-apis.js.map +1 -1
  249. package/build/store/actions.js +46 -6
  250. package/build/store/actions.js.map +1 -1
  251. package/build/store/actions.native.js.map +1 -1
  252. package/build/store/constants.js +10 -1
  253. package/build/store/constants.js.map +1 -1
  254. package/build/store/defaults.js.map +1 -1
  255. package/build/store/index.js +1 -1
  256. package/build/store/index.js.map +1 -1
  257. package/build/store/local-autosave.js.map +1 -1
  258. package/build/store/private-actions.js +253 -1
  259. package/build/store/private-actions.js.map +1 -1
  260. package/build/store/private-selectors.js +50 -3
  261. package/build/store/private-selectors.js.map +1 -1
  262. package/build/store/reducer.js +14 -1
  263. package/build/store/reducer.js.map +1 -1
  264. package/build/store/reducer.native.js.map +1 -1
  265. package/build/store/selectors.js +25 -20
  266. package/build/store/selectors.js.map +1 -1
  267. package/build/store/selectors.native.js.map +1 -1
  268. package/build/store/utils/get-filtered-template-parts.js +71 -0
  269. package/build/store/utils/get-filtered-template-parts.js.map +1 -0
  270. package/build/store/utils/is-template-revertable.js +28 -0
  271. package/build/store/utils/is-template-revertable.js.map +1 -0
  272. package/build/store/utils/notice-builder.js.map +1 -1
  273. package/build/utils/get-template-part-icon.js.map +1 -1
  274. package/build/utils/index.js.map +1 -1
  275. package/build/utils/index.native.js.map +1 -1
  276. package/build/utils/media-upload/index.js.map +1 -1
  277. package/build/utils/media-upload/index.native.js.map +1 -1
  278. package/build/utils/terms.js.map +1 -1
  279. package/build/utils/url.js.map +1 -1
  280. package/build-module/bindings/index.js.map +1 -1
  281. package/build-module/bindings/pattern-overrides.js.map +1 -1
  282. package/build-module/bindings/post-meta.js +14 -31
  283. package/build-module/bindings/post-meta.js.map +1 -1
  284. package/build-module/components/autocompleters/index.js.map +1 -1
  285. package/build-module/components/autocompleters/user.js.map +1 -1
  286. package/build-module/components/autosave-monitor/index.js +10 -0
  287. package/build-module/components/autosave-monitor/index.js.map +1 -1
  288. package/build-module/components/block-manager/category.js.map +1 -1
  289. package/build-module/components/block-manager/checklist.js.map +1 -1
  290. package/build-module/components/block-manager/index.js.map +1 -1
  291. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  292. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +100 -0
  293. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
  294. package/build-module/components/character-count/index.js.map +1 -1
  295. package/build-module/components/commands/index.js +21 -2
  296. package/build-module/components/commands/index.js.map +1 -1
  297. package/build-module/components/commands/index.native.js.map +1 -1
  298. package/build-module/components/deprecated.js +159 -0
  299. package/build-module/components/deprecated.js.map +1 -1
  300. package/build-module/components/deprecated.native.js.map +1 -1
  301. package/build-module/components/document-bar/index.js +6 -9
  302. package/build-module/components/document-bar/index.js.map +1 -1
  303. package/build-module/components/document-outline/check.js.map +1 -1
  304. package/build-module/components/document-outline/index.js.map +1 -1
  305. package/build-module/components/document-outline/item.js.map +1 -1
  306. package/build-module/components/document-tools/index.js +1 -1
  307. package/build-module/components/document-tools/index.js.map +1 -1
  308. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +14 -40
  309. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  310. package/build-module/components/editor-canvas/index.js +5 -2
  311. package/build-module/components/editor-canvas/index.js.map +1 -1
  312. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  313. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  314. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  315. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  316. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  317. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  318. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  319. package/build-module/components/editor-help/index.native.js.map +1 -1
  320. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  321. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  322. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  323. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  324. package/build-module/components/editor-history/redo.js.map +1 -1
  325. package/build-module/components/editor-history/undo.js.map +1 -1
  326. package/build-module/components/editor-notices/index.js.map +1 -1
  327. package/build-module/components/editor-snackbars/index.js.map +1 -1
  328. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  329. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  330. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  331. package/build-module/components/entities-saved-states/index.js +11 -85
  332. package/build-module/components/entities-saved-states/index.js.map +1 -1
  333. package/build-module/components/error-boundary/index.js.map +1 -1
  334. package/build-module/components/error-boundary/index.native.js.map +1 -1
  335. package/build-module/components/global-keyboard-shortcuts/index.js +24 -0
  336. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  337. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  338. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  339. package/build-module/components/index.js +7 -0
  340. package/build-module/components/index.js.map +1 -1
  341. package/build-module/components/index.native.js.map +1 -1
  342. package/build-module/components/inserter-sidebar/index.js +5 -1
  343. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  344. package/build-module/components/keyboard-shortcut-help-modal/config.js +71 -0
  345. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  346. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
  347. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  348. package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
  349. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  350. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
  351. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  352. package/build-module/components/list-view-sidebar/index.js +2 -1
  353. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  354. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  355. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  356. package/build-module/components/media-categories/index.js.map +1 -1
  357. package/build-module/components/mode-switcher/index.js.map +1 -1
  358. package/build-module/components/offline-status/index.native.js.map +1 -1
  359. package/build-module/components/page-attributes/check.js.map +1 -1
  360. package/build-module/components/page-attributes/order.js.map +1 -1
  361. package/build-module/components/page-attributes/panel.js.map +1 -1
  362. package/build-module/components/page-attributes/parent.js.map +1 -1
  363. package/build-module/components/pattern-overrides-panel/index.js +23 -0
  364. package/build-module/components/pattern-overrides-panel/index.js.map +1 -0
  365. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  366. package/build-module/components/plugin-more-menu-item/index.js +73 -0
  367. package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
  368. package/build-module/components/plugin-post-publish-panel/index.js +61 -0
  369. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -0
  370. package/build-module/components/plugin-post-status-info/index.js +66 -0
  371. package/build-module/components/plugin-post-status-info/index.js.map +1 -0
  372. package/build-module/components/plugin-pre-publish-panel/index.js +64 -0
  373. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -0
  374. package/build-module/components/plugin-sidebar/index.js +102 -0
  375. package/build-module/components/plugin-sidebar/index.js.map +1 -0
  376. package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
  377. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  378. package/build-module/components/post-actions/actions.js +648 -0
  379. package/build-module/components/post-actions/actions.js.map +1 -0
  380. package/build-module/components/post-actions/index.js +130 -0
  381. package/build-module/components/post-actions/index.js.map +1 -0
  382. package/build-module/components/post-author/check.js.map +1 -1
  383. package/build-module/components/post-author/combobox.js.map +1 -1
  384. package/build-module/components/post-author/constants.js.map +1 -1
  385. package/build-module/components/post-author/hook.js.map +1 -1
  386. package/build-module/components/post-author/index.js.map +1 -1
  387. package/build-module/components/post-author/panel.js.map +1 -1
  388. package/build-module/components/post-author/select.js.map +1 -1
  389. package/build-module/components/post-card-panel/index.js +119 -0
  390. package/build-module/components/post-card-panel/index.js.map +1 -0
  391. package/build-module/components/post-comments/index.js.map +1 -1
  392. package/build-module/components/post-discussion/panel.js.map +1 -1
  393. package/build-module/components/post-excerpt/check.js +9 -0
  394. package/build-module/components/post-excerpt/check.js.map +1 -1
  395. package/build-module/components/post-excerpt/index.js.map +1 -1
  396. package/build-module/components/post-excerpt/panel.js.map +1 -1
  397. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  398. package/build-module/components/post-featured-image/check.js.map +1 -1
  399. package/build-module/components/post-featured-image/index.js.map +1 -1
  400. package/build-module/components/post-featured-image/panel.js.map +1 -1
  401. package/build-module/components/post-format/check.js.map +1 -1
  402. package/build-module/components/post-format/index.js.map +1 -1
  403. package/build-module/components/post-last-revision/check.js.map +1 -1
  404. package/build-module/components/post-last-revision/index.js.map +1 -1
  405. package/build-module/components/post-last-revision/panel.js.map +1 -1
  406. package/build-module/components/post-locked-modal/index.js.map +1 -1
  407. package/build-module/components/post-panel-row/index.js.map +1 -1
  408. package/build-module/components/post-pending-status/check.js.map +1 -1
  409. package/build-module/components/post-pending-status/index.js.map +1 -1
  410. package/build-module/components/post-pingbacks/index.js.map +1 -1
  411. package/build-module/components/post-preview-button/index.js.map +1 -1
  412. package/build-module/components/post-publish-button/index.js +31 -31
  413. package/build-module/components/post-publish-button/index.js.map +1 -1
  414. package/build-module/components/post-publish-button/label.js +51 -42
  415. package/build-module/components/post-publish-button/label.js.map +1 -1
  416. package/build-module/components/post-publish-panel/index.js.map +1 -1
  417. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  418. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  419. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  420. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  421. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  422. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  423. package/build-module/components/post-saved-state/index.js +10 -6
  424. package/build-module/components/post-saved-state/index.js.map +1 -1
  425. package/build-module/components/post-schedule/check.js.map +1 -1
  426. package/build-module/components/post-schedule/index.js.map +1 -1
  427. package/build-module/components/post-schedule/label.js.map +1 -1
  428. package/build-module/components/post-schedule/panel.js +8 -0
  429. package/build-module/components/post-schedule/panel.js.map +1 -1
  430. package/build-module/components/post-slug/check.js.map +1 -1
  431. package/build-module/components/post-slug/index.js +44 -68
  432. package/build-module/components/post-slug/index.js.map +1 -1
  433. package/build-module/components/post-status/index.js +231 -0
  434. package/build-module/components/post-status/index.js.map +1 -0
  435. package/build-module/components/post-sticky/check.js.map +1 -1
  436. package/build-module/components/post-sticky/index.js.map +1 -1
  437. package/build-module/components/post-switch-to-draft-button/index.js +7 -1
  438. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  439. package/build-module/components/post-sync-status/index.js.map +1 -1
  440. package/build-module/components/post-taxonomies/check.js.map +1 -1
  441. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  442. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  443. package/build-module/components/post-taxonomies/index.js.map +1 -1
  444. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  445. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  446. package/build-module/components/post-template/block-theme.js +7 -3
  447. package/build-module/components/post-template/block-theme.js.map +1 -1
  448. package/build-module/components/post-template/classic-theme.js.map +1 -1
  449. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  450. package/build-module/components/post-template/create-new-template.js.map +1 -1
  451. package/build-module/components/post-template/hooks.js.map +1 -1
  452. package/build-module/components/post-template/panel.js.map +1 -1
  453. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  454. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  455. package/build-module/components/post-text-editor/index.js.map +1 -1
  456. package/build-module/components/post-title/constants.js.map +1 -1
  457. package/build-module/components/post-title/index.js.map +1 -1
  458. package/build-module/components/post-title/index.native.js +1 -1
  459. package/build-module/components/post-title/index.native.js.map +1 -1
  460. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  461. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  462. package/build-module/components/post-title/use-post-title.js.map +1 -1
  463. package/build-module/components/post-trash/check.js +24 -26
  464. package/build-module/components/post-trash/check.js.map +1 -1
  465. package/build-module/components/post-trash/index.js +2 -1
  466. package/build-module/components/post-trash/index.js.map +1 -1
  467. package/build-module/components/post-type-support-check/index.js.map +1 -1
  468. package/build-module/components/post-url/check.js.map +1 -1
  469. package/build-module/components/post-url/index.js +46 -21
  470. package/build-module/components/post-url/index.js.map +1 -1
  471. package/build-module/components/post-url/label.js.map +1 -1
  472. package/build-module/components/post-url/panel.js +14 -7
  473. package/build-module/components/post-url/panel.js.map +1 -1
  474. package/build-module/components/post-view-link/index.js.map +1 -1
  475. package/build-module/components/post-visibility/check.js.map +1 -1
  476. package/build-module/components/post-visibility/index.js +2 -1
  477. package/build-module/components/post-visibility/index.js.map +1 -1
  478. package/build-module/components/post-visibility/label.js.map +1 -1
  479. package/build-module/components/post-visibility/utils.js.map +1 -1
  480. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  481. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  482. package/build-module/components/preferences-modal/index.js +19 -17
  483. package/build-module/components/preferences-modal/index.js.map +1 -1
  484. package/build-module/components/preview-dropdown/index.js.map +1 -1
  485. package/build-module/components/provider/disable-non-page-content-blocks.js +36 -20
  486. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  487. package/build-module/components/provider/index.js +5 -3
  488. package/build-module/components/provider/index.js.map +1 -1
  489. package/build-module/components/provider/index.native.js.map +1 -1
  490. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
  491. package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
  492. package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  493. package/build-module/components/provider/use-block-editor-settings.js +73 -53
  494. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  495. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  496. package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  497. package/build-module/components/provider/with-registry-provider.js +1 -0
  498. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  499. package/build-module/components/start-page-options/index.js +132 -0
  500. package/build-module/components/start-page-options/index.js.map +1 -0
  501. package/build-module/components/table-of-contents/index.js.map +1 -1
  502. package/build-module/components/table-of-contents/panel.js.map +1 -1
  503. package/build-module/components/template-areas/index.js +63 -0
  504. package/build-module/components/template-areas/index.js.map +1 -0
  505. package/build-module/components/template-validation-notice/index.js +25 -31
  506. package/build-module/components/template-validation-notice/index.js.map +1 -1
  507. package/build-module/components/theme-support-check/index.js +11 -16
  508. package/build-module/components/theme-support-check/index.js.map +1 -1
  509. package/build-module/components/time-to-read/index.js.map +1 -1
  510. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  511. package/build-module/components/word-count/index.js.map +1 -1
  512. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  513. package/build-module/hooks/default-autocompleters.js.map +1 -1
  514. package/build-module/hooks/index.js.map +1 -1
  515. package/build-module/hooks/index.native.js.map +1 -1
  516. package/build-module/hooks/pattern-overrides.js +22 -10
  517. package/build-module/hooks/pattern-overrides.js.map +1 -1
  518. package/build-module/hooks/use-select-nearest-editable-block.js +80 -0
  519. package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -0
  520. package/build-module/index.js.map +1 -1
  521. package/build-module/index.native.js.map +1 -1
  522. package/build-module/lock-unlock.js.map +1 -1
  523. package/build-module/private-apis.js +24 -1
  524. package/build-module/private-apis.js.map +1 -1
  525. package/build-module/store/actions.js +37 -3
  526. package/build-module/store/actions.js.map +1 -1
  527. package/build-module/store/actions.native.js.map +1 -1
  528. package/build-module/store/constants.js +9 -0
  529. package/build-module/store/constants.js.map +1 -1
  530. package/build-module/store/defaults.js.map +1 -1
  531. package/build-module/store/index.js.map +1 -1
  532. package/build-module/store/local-autosave.js.map +1 -1
  533. package/build-module/store/private-actions.js +249 -1
  534. package/build-module/store/private-actions.js.map +1 -1
  535. package/build-module/store/private-selectors.js +50 -4
  536. package/build-module/store/private-selectors.js.map +1 -1
  537. package/build-module/store/reducer.js +13 -1
  538. package/build-module/store/reducer.js.map +1 -1
  539. package/build-module/store/reducer.native.js.map +1 -1
  540. package/build-module/store/selectors.js +20 -16
  541. package/build-module/store/selectors.js.map +1 -1
  542. package/build-module/store/selectors.native.js.map +1 -1
  543. package/build-module/store/utils/get-filtered-template-parts.js +64 -0
  544. package/build-module/store/utils/get-filtered-template-parts.js.map +1 -0
  545. package/build-module/store/utils/is-template-revertable.js +22 -0
  546. package/build-module/store/utils/is-template-revertable.js.map +1 -0
  547. package/build-module/store/utils/notice-builder.js.map +1 -1
  548. package/build-module/utils/get-template-part-icon.js.map +1 -1
  549. package/build-module/utils/index.js.map +1 -1
  550. package/build-module/utils/index.native.js.map +1 -1
  551. package/build-module/utils/media-upload/index.js.map +1 -1
  552. package/build-module/utils/media-upload/index.native.js.map +1 -1
  553. package/build-module/utils/terms.js.map +1 -1
  554. package/build-module/utils/url.js.map +1 -1
  555. package/build-style/style-rtl.css +565 -49
  556. package/build-style/style.css +565 -49
  557. package/package.json +36 -36
  558. package/src/bindings/post-meta.js +11 -27
  559. package/src/components/autosave-monitor/index.js +9 -0
  560. package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +108 -0
  561. package/src/components/commands/index.js +21 -2
  562. package/src/components/deprecated.js +157 -0
  563. package/src/components/document-bar/index.js +9 -15
  564. package/src/components/document-bar/style.scss +9 -12
  565. package/src/components/document-tools/index.js +16 -14
  566. package/src/components/document-tools/style.scss +4 -11
  567. package/src/components/editor-canvas/edit-template-blocks-notification.js +17 -53
  568. package/src/components/editor-canvas/index.js +8 -4
  569. package/src/components/entities-saved-states/index.js +12 -113
  570. package/src/components/error-boundary/style.native.scss +1 -1
  571. package/src/components/global-keyboard-shortcuts/index.js +25 -0
  572. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +20 -0
  573. package/src/components/index.js +7 -0
  574. package/src/components/inserter-sidebar/index.js +7 -1
  575. package/src/components/keyboard-shortcut-help-modal/config.js +53 -0
  576. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
  577. package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
  578. package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
  579. package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
  580. package/src/components/list-view-sidebar/index.js +1 -0
  581. package/src/components/list-view-sidebar/style.scss +1 -1
  582. package/src/components/pattern-overrides-panel/index.js +26 -0
  583. package/src/components/plugin-more-menu-item/index.js +73 -0
  584. package/src/components/plugin-post-publish-panel/index.js +64 -0
  585. package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +39 -0
  586. package/src/components/plugin-post-publish-panel/test/index.js +33 -0
  587. package/src/components/plugin-post-status-info/index.js +63 -0
  588. package/src/components/plugin-pre-publish-panel/index.js +67 -0
  589. package/src/components/plugin-pre-publish-panel/test/index.js +33 -0
  590. package/src/components/plugin-sidebar/index.js +98 -0
  591. package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
  592. package/src/components/post-actions/actions.js +862 -0
  593. package/src/components/post-actions/index.js +156 -0
  594. package/src/components/post-actions/style.scss +3 -0
  595. package/src/components/post-card-panel/index.js +168 -0
  596. package/src/components/post-card-panel/style.scss +32 -0
  597. package/src/components/post-excerpt/check.js +8 -0
  598. package/src/components/post-featured-image/style.scss +3 -2
  599. package/src/components/post-publish-button/index.js +23 -36
  600. package/src/components/post-publish-button/label.js +54 -39
  601. package/src/components/post-publish-button/test/index.js +15 -26
  602. package/src/components/post-publish-button/test/label.js +44 -21
  603. package/src/components/post-saved-state/index.js +13 -6
  604. package/src/components/post-saved-state/test/index.js +4 -0
  605. package/src/components/post-schedule/panel.js +22 -0
  606. package/src/components/post-slug/index.js +50 -68
  607. package/src/components/post-slug/test/index.js +29 -6
  608. package/src/components/post-status/index.js +310 -0
  609. package/src/components/post-status/style.scss +75 -0
  610. package/src/components/post-switch-to-draft-button/index.js +5 -0
  611. package/src/components/post-template/block-theme.js +31 -22
  612. package/src/components/post-title/index.native.js +1 -1
  613. package/src/components/post-trash/check.js +19 -19
  614. package/src/components/post-trash/index.js +1 -0
  615. package/src/components/post-url/index.js +131 -101
  616. package/src/components/post-url/panel.js +20 -7
  617. package/src/components/post-url/style.scss +8 -6
  618. package/src/components/post-visibility/index.js +1 -0
  619. package/src/components/preferences-modal/index.js +26 -22
  620. package/src/components/provider/disable-non-page-content-blocks.js +40 -20
  621. package/src/components/provider/index.js +17 -8
  622. package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
  623. package/src/components/provider/use-block-editor-settings.js +70 -44
  624. package/src/components/provider/with-registry-provider.js +1 -0
  625. package/src/components/start-page-options/index.js +135 -0
  626. package/src/components/start-page-options/style.scss +26 -0
  627. package/src/components/template-areas/index.js +85 -0
  628. package/src/components/template-areas/style.scss +23 -0
  629. package/src/components/template-validation-notice/index.js +48 -50
  630. package/src/components/theme-support-check/index.js +9 -16
  631. package/src/components/theme-support-check/test/index.js +44 -43
  632. package/src/hooks/pattern-overrides.js +25 -14
  633. package/src/hooks/use-select-nearest-editable-block.js +95 -0
  634. package/src/private-apis.js +21 -0
  635. package/src/store/actions.js +37 -3
  636. package/src/store/constants.js +9 -0
  637. package/src/store/private-actions.js +377 -1
  638. package/src/store/private-selectors.js +101 -18
  639. package/src/store/reducer.js +13 -0
  640. package/src/store/selectors.js +51 -46
  641. package/src/store/utils/get-filtered-template-parts.js +69 -0
  642. package/src/store/utils/is-template-revertable.js +23 -0
  643. package/src/store/utils/test/get-filtered-template-parts.js +189 -0
  644. package/src/style.scss +8 -2
  645. package/src/components/post-publish-button/style.scss +0 -8
  646. package/src/components/provider/test/disable-non-page-content-blocks.js +0 -90
  647. package/src/components/template-validation-notice/style.scss +0 -9
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_element","_data","_url","_htmlEntities","_compose","_coreData","_label","_interopRequireDefault","_store","POSTNAME","PAGENAME","getFuturePostUrl","post","slug","permalink_template","includes","replace","CopyButton","text","onCopy","children","ref","useCopyToClipboard","_react","createElement","Button","variant","PostPublishPanelPostpublish","Component","constructor","arguments","state","showCopyConfirmation","bind","onSelectInput","postLink","createRef","componentDidMount","props","focusOnMount","current","focus","componentWillUnmount","clearTimeout","dismissCopyConfirmation","setState","setTimeout","event","target","select","render","isScheduled","postType","postLabel","labels","singular_name","viewPostLabel","view_item","addNewPostLabel","add_new_item","link","status","addLink","addQueryArgs","post_type","type","postPublishNonLinkHeader","Fragment","__","default","className","PanelBody","href","decodeEntities","title","TextControl","__nextHasNoMarginBottom","readOnly","label","sprintf","value","safeDecodeURIComponent","onFocus","_default","exports","withSelect","getEditedPostAttribute","getCurrentPost","isCurrentPostScheduled","editorStore","getPostType","coreStore"],"sources":["@wordpress/editor/src/components/post-publish-panel/postpublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody, Button, TextControl } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs, safeDecodeURIComponent } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleLabel from '../post-schedule/label';\nimport { store as editorStore } from '../../store';\n\nconst POSTNAME = '%postname%';\nconst PAGENAME = '%pagename%';\n\n/**\n * Returns URL for a future post.\n *\n * @param {Object} post Post object.\n *\n * @return {string} PostPublish URL.\n */\n\nconst getFuturePostUrl = ( post ) => {\n\tconst { slug } = post;\n\n\tif ( post.permalink_template.includes( POSTNAME ) ) {\n\t\treturn post.permalink_template.replace( POSTNAME, slug );\n\t}\n\n\tif ( post.permalink_template.includes( PAGENAME ) ) {\n\t\treturn post.permalink_template.replace( PAGENAME, slug );\n\t}\n\n\treturn post.permalink_template;\n};\n\nfunction CopyButton( { text, onCopy, children } ) {\n\tconst ref = useCopyToClipboard( text, onCopy );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass PostPublishPanelPostpublish extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tshowCopyConfirmation: false,\n\t\t};\n\t\tthis.onCopy = this.onCopy.bind( this );\n\t\tthis.onSelectInput = this.onSelectInput.bind( this );\n\t\tthis.postLink = createRef();\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\tthis.postLink.current.focus();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t}\n\n\tonCopy() {\n\t\tthis.setState( {\n\t\t\tshowCopyConfirmation: true,\n\t\t} );\n\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t\tthis.dismissCopyConfirmation = setTimeout( () => {\n\t\t\tthis.setState( {\n\t\t\t\tshowCopyConfirmation: false,\n\t\t\t} );\n\t\t}, 4000 );\n\t}\n\n\tonSelectInput( event ) {\n\t\tevent.target.select();\n\t}\n\n\trender() {\n\t\tconst { children, isScheduled, post, postType } = this.props;\n\t\tconst postLabel = postType?.labels?.singular_name;\n\t\tconst viewPostLabel = postType?.labels?.view_item;\n\t\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\t\tconst link =\n\t\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\t\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\t\tpost_type: post.type,\n\t\t} );\n\n\t\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t\t<>\n\t\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t\t<PostScheduleLabel />.\n\t\t\t</>\n\t\t) : (\n\t\t\t__( 'is now live.' )\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t\t<a ref={ this.postLink } href={ link }>\n\t\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t\t<strong>{ __( 'What’s next?' ) }</strong>\n\t\t\t\t\t</p>\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\t\tonFocus={ this.onSelectInput }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t\t<CopyButton text={ link } onCopy={ this.onCopy }>\n\t\t\t\t\t\t\t\t{ this.state.showCopyConfirmation\n\t\t\t\t\t\t\t\t\t? __( 'Copied!' )\n\t\t\t\t\t\t\t\t\t: __( 'Copy' ) }\n\t\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t\t<Button variant=\"primary\" href={ link }>\n\t\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditedPostAttribute, getCurrentPost, isCurrentPostScheduled } =\n\t\tselect( editorStore );\n\tconst { getPostType } = select( coreStore );\n\n\treturn {\n\t\tpost: getCurrentPost(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisScheduled: isCurrentPostScheduled(),\n\t};\n} )( PostPublishPanelPostpublish );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAhBA;AACA;AACA;;AAUA;AACA;AACA;;AAIA,MAAMW,QAAQ,GAAG,YAAY;AAC7B,MAAMC,QAAQ,GAAG,YAAY;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,gBAAgB,GAAKC,IAAI,IAAM;EACpC,MAAM;IAAEC;EAAK,CAAC,GAAGD,IAAI;EAErB,IAAKA,IAAI,CAACE,kBAAkB,CAACC,QAAQ,CAAEN,QAAS,CAAC,EAAG;IACnD,OAAOG,IAAI,CAACE,kBAAkB,CAACE,OAAO,CAAEP,QAAQ,EAAEI,IAAK,CAAC;EACzD;EAEA,IAAKD,IAAI,CAACE,kBAAkB,CAACC,QAAQ,CAAEL,QAAS,CAAC,EAAG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IAAI,EAAGZ;IAAM,GACpCJ,aACK,CACR,EACD,IAAAjC,MAAA,CAAAC,aAAA,EAAC3B,WAAA,CAAA4B,MAAM;MACNC,OAAO,EAAGyB,WAAW,GAAG,SAAS,GAAG,WAAa;MACjDqB,IAAI,EAAGV;IAAS,GAEdJ,eACK,CACJ,CACK,CAAC,EACVtC,QACE,CAAC;EAER;AACD;AAAC,IAAA+D,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEc,IAAAgB,gBAAU,EAAIpC,MAAM,IAAM;EACxC,MAAM;IAAEqC,sBAAsB;IAAEC,cAAc;IAAEC;EAAuB,CAAC,GACvEvC,MAAM,CAAEwC,YAAY,CAAC;EACtB,MAAM;IAAEC;EAAY,CAAC,GAAGzC,MAAM,CAAE0C,eAAU,CAAC;EAE3C,OAAO;IACN/E,IAAI,EAAE2E,cAAc,CAAC,CAAC;IACtBnC,QAAQ,EAAEsC,WAAW,CAAEJ,sBAAsB,CAAE,MAAO,CAAE,CAAC;IACzDnC,WAAW,EAAEqC,sBAAsB,CAAC;EACrC,CAAC;AACF,CAAE,CAAC,CAAE7D,2BAA4B,CAAC"}
1
+ {"version":3,"names":["_components","require","_i18n","_element","_data","_url","_htmlEntities","_compose","_coreData","_label","_interopRequireDefault","_store","POSTNAME","PAGENAME","getFuturePostUrl","post","slug","permalink_template","includes","replace","CopyButton","text","onCopy","children","ref","useCopyToClipboard","_react","createElement","Button","variant","PostPublishPanelPostpublish","Component","constructor","arguments","state","showCopyConfirmation","bind","onSelectInput","postLink","createRef","componentDidMount","props","focusOnMount","current","focus","componentWillUnmount","clearTimeout","dismissCopyConfirmation","setState","setTimeout","event","target","select","render","isScheduled","postType","postLabel","labels","singular_name","viewPostLabel","view_item","addNewPostLabel","add_new_item","link","status","addLink","addQueryArgs","post_type","type","postPublishNonLinkHeader","Fragment","__","default","className","PanelBody","href","decodeEntities","title","TextControl","__nextHasNoMarginBottom","readOnly","label","sprintf","value","safeDecodeURIComponent","onFocus","_default","exports","withSelect","getEditedPostAttribute","getCurrentPost","isCurrentPostScheduled","editorStore","getPostType","coreStore"],"sources":["@wordpress/editor/src/components/post-publish-panel/postpublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody, Button, TextControl } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs, safeDecodeURIComponent } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleLabel from '../post-schedule/label';\nimport { store as editorStore } from '../../store';\n\nconst POSTNAME = '%postname%';\nconst PAGENAME = '%pagename%';\n\n/**\n * Returns URL for a future post.\n *\n * @param {Object} post Post object.\n *\n * @return {string} PostPublish URL.\n */\n\nconst getFuturePostUrl = ( post ) => {\n\tconst { slug } = post;\n\n\tif ( post.permalink_template.includes( POSTNAME ) ) {\n\t\treturn post.permalink_template.replace( POSTNAME, slug );\n\t}\n\n\tif ( post.permalink_template.includes( PAGENAME ) ) {\n\t\treturn post.permalink_template.replace( PAGENAME, slug );\n\t}\n\n\treturn post.permalink_template;\n};\n\nfunction CopyButton( { text, onCopy, children } ) {\n\tconst ref = useCopyToClipboard( text, onCopy );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass PostPublishPanelPostpublish extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tshowCopyConfirmation: false,\n\t\t};\n\t\tthis.onCopy = this.onCopy.bind( this );\n\t\tthis.onSelectInput = this.onSelectInput.bind( this );\n\t\tthis.postLink = createRef();\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\tthis.postLink.current.focus();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t}\n\n\tonCopy() {\n\t\tthis.setState( {\n\t\t\tshowCopyConfirmation: true,\n\t\t} );\n\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t\tthis.dismissCopyConfirmation = setTimeout( () => {\n\t\t\tthis.setState( {\n\t\t\t\tshowCopyConfirmation: false,\n\t\t\t} );\n\t\t}, 4000 );\n\t}\n\n\tonSelectInput( event ) {\n\t\tevent.target.select();\n\t}\n\n\trender() {\n\t\tconst { children, isScheduled, post, postType } = this.props;\n\t\tconst postLabel = postType?.labels?.singular_name;\n\t\tconst viewPostLabel = postType?.labels?.view_item;\n\t\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\t\tconst link =\n\t\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\t\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\t\tpost_type: post.type,\n\t\t} );\n\n\t\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t\t<>\n\t\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t\t<PostScheduleLabel />.\n\t\t\t</>\n\t\t) : (\n\t\t\t__( 'is now live.' )\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t\t<a ref={ this.postLink } href={ link }>\n\t\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t\t<strong>{ __( 'What’s next?' ) }</strong>\n\t\t\t\t\t</p>\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\t\tonFocus={ this.onSelectInput }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t\t<CopyButton text={ link } onCopy={ this.onCopy }>\n\t\t\t\t\t\t\t\t{ this.state.showCopyConfirmation\n\t\t\t\t\t\t\t\t\t? __( 'Copied!' )\n\t\t\t\t\t\t\t\t\t: __( 'Copy' ) }\n\t\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t\t<Button variant=\"primary\" href={ link }>\n\t\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditedPostAttribute, getCurrentPost, isCurrentPostScheduled } =\n\t\tselect( editorStore );\n\tconst { getPostType } = select( coreStore );\n\n\treturn {\n\t\tpost: getCurrentPost(),\n\t\tpostType: getPostType( getEditedPostAttribute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AEC,cAAc;IAAEC;EAAuB,CAAC,GACvEvC,MAAM,CAAEwC,YAAY,CAAC;EACtB,MAAM;IAAEC;EAAY,CAAC,GAAGzC,MAAM,CAAE0C,eAAU,CAAC;EAE3C,OAAO;IACN/E,IAAI,EAAE2E,cAAc,CAAC,CAAC;IACtBnC,QAAQ,EAAEsC,WAAW,CAAEJ,sBAAsB,CAAE,MAAO,CAAE,CAAC;IACzDnC,WAAW,EAAEqC,sBAAsB,CAAC;EACrC,CAAC;AACF,CAAE,CAAC,CAAE7D,2BAA4B,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_icons","_url","_coreData","_htmlEntities","_postVisibility","_interopRequireDefault","_label","_postSchedule","_label2","_maybeTagsPanel","_maybePostFormatPanel","_store","_maybeCategoryPanel","_maybeUploadMedia","PostPublishPanelPrepublish","children","isBeingScheduled","isRequestingSiteIcon","hasPublishAction","siteIconUrl","siteTitle","siteHome","useSelect","select","_getCurrentPost$_link","getCurrentPost","isEditedPostBeingScheduled","editorStore","getEntityRecord","isResolving","coreStore","siteData","undefined","_links","site_icon_url","name","home","filterURLForDisplay","siteIcon","_react","createElement","Icon","className","size","icon","wordpress","alt","__","src","prePublishTitle","prePublishBodyText","decodeEntities","default","Fragment","PanelBody","initialOpen","title","key","_default","exports"],"sources":["@wordpress/editor/src/components/post-publish-panel/prepublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, PanelBody } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { wordpress } from '@wordpress/icons';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostVisibilityLabel from '../post-visibility/label';\nimport PostSchedule from '../post-schedule';\nimport PostScheduleLabel from '../post-schedule/label';\nimport MaybeTagsPanel from './maybe-tags-panel';\nimport MaybePostFormatPanel from './maybe-post-format-panel';\nimport { store as editorStore } from '../../store';\nimport MaybeCategoryPanel from './maybe-category-panel';\nimport MaybeUploadMedia from './maybe-upload-media';\n\nfunction PostPublishPanelPrepublish( { children } ) {\n\tconst {\n\t\tisBeingScheduled,\n\t\tisRequestingSiteIcon,\n\t\thasPublishAction,\n\t\tsiteIconUrl,\n\t\tsiteTitle,\n\t\tsiteHome,\n\t} = useSelect( ( select ) => {\n\t\tconst { getCurrentPost, isEditedPostBeingScheduled } =\n\t\t\tselect( editorStore );\n\t\tconst { getEntityRecord, isResolving } = select( coreStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\tsiteTitle: siteData.name,\n\t\t\tsiteHome: siteData.home && filterURLForDisplay( siteData.home ),\n\t\t};\n\t}, [] );\n\n\tlet siteIcon = (\n\t\t<Icon className=\"components-site-icon\" size=\"36px\" icon={ wordpress } />\n\t);\n\n\tif ( siteIconUrl ) {\n\t\tsiteIcon = (\n\t\t\t<img\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"components-site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tsiteIcon = null;\n\t}\n\n\tlet prePublishTitle, prePublishBodyText;\n\n\tif ( ! hasPublishAction ) {\n\t\tprePublishTitle = __( 'Are you ready to submit for review?' );\n\t\tprePublishBodyText = __(\n\t\t\t'When you’re ready, submit your work for review, and an Editor will be able to approve it for you.'\n\t\t);\n\t} else if ( isBeingScheduled ) {\n\t\tprePublishTitle = __( 'Are you ready to schedule?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Your work will be published at the specified date and time.'\n\t\t);\n\t} else {\n\t\tprePublishTitle = __( 'Are you ready to publish?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Double-check your settings before publishing.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"editor-post-publish-panel__prepublish\">\n\t\t\t<div>\n\t\t\t\t<strong>{ prePublishTitle }</strong>\n\t\t\t</div>\n\t\t\t<p>{ prePublishBodyText }</p>\n\t\t\t<div className=\"components-site-card\">\n\t\t\t\t{ siteIcon }\n\t\t\t\t<div className=\"components-site-info\">\n\t\t\t\t\t<span className=\"components-site-name\">\n\t\t\t\t\t\t{ decodeEntities( siteTitle ) || __( '(Untitled)' ) }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"components-site-home\">{ siteHome }</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<MaybeUploadMedia />\n\t\t\t{ hasPublishAction && (\n\t\t\t\t<>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Visibility:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Publish:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostScheduleLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostSchedule />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<MaybePostFormatPanel />\n\t\t\t<MaybeTagsPanel />\n\t\t\t<MaybeCategoryPanel />\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default PostPublishPanelPrepublish;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAKA,IAAAO,eAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,aAAA,GAAAF,sBAAA,CAAAR,OAAA;AACA,IAAAW,OAAA,GAAAH,sBAAA,CAAAR,OAAA;AACA,IAAAY,eAAA,GAAAJ,sBAAA,CAAAR,OAAA;AACA,IAAAa,qBAAA,GAAAL,sBAAA,CAAAR,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,mBAAA,GAAAP,sBAAA,CAAAR,OAAA;AACA,IAAAgB,iBAAA,GAAAR,sBAAA,CAAAR,OAAA;AAtBA;AACA;AACA;;AASA;AACA;AACA;;AAWA,SAASiB,0BAA0BA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACnD,MAAM;IACLC,gBAAgB;IAChBC,oBAAoB;IACpBC,gBAAgB;IAChBC,WAAW;IACXC,SAAS;IACTC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM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O;IACrBC,KAAK,EAAG,CACP,IAAAT,QAAE,EAAE,aAAc,CAAC,EACnB,IAAAR,MAAA,CAAAC,aAAA;MACCE,SAAS,EAAC,iCAAiC;MAC3Ce,GAAG,EAAC;IAAO,GAEX,IAAAlB,MAAA,CAAAC,aAAA,EAAClC,MAAA,CAAA8C,OAAmB,MAAE,CACjB,CAAC;EACL,GAEH,IAAAb,MAAA,CAAAC,aAAA,EAACpC,eAAA,CAAAgD,OAAc,MAAE,CACP,CAAC,EACZ,IAAAb,MAAA,CAAAC,aAAA,EAAC1C,WAAA,CAAAwD,SAAS;IACTC,WAAW,EAAG,KAAO;IACrBC,KAAK,EAAG,CACP,IAAAT,QAAE,EAAE,UAAW,CAAC,EAChB,IAAAR,MAAA,CAAAC,aAAA;MACCE,SAAS,EAAC,iCAAiC;MAC3Ce,GAAG,EAAC;IAAO,GAEX,IAAAlB,MAAA,CAAAC,aAAA,EAAChC,OAAA,CAAA4C,OAAiB,MAAE,CACf,CAAC;EACL,GAEH,IAAAb,MAAA,CAAAC,aAAA,EAACjC,aAAA,CAAA6C,OAAY,MAAE,CACL,CACV,CACF,EACD,IAAAb,MAAA,CAAAC,aAAA,EAAC9B,qBAAA,CAAA0C,OAAoB,MAAE,CAAC,EACxB,IAAAb,MAAA,CAAAC,aAAA,EAAC/B,eAAA,CAAA2C,OAAc,MAAE,CAAC,EAClB,IAAAb,MAAA,CAAAC,aAAA,EAAC5B,mBAAA,CAAAwC,OAAkB,MAAE,CAAC,EACpBrC,QACE,CAAC;AAER;AAAC,IAAA2C,QAAA,GAAAC,OAAA,CAAAP,OAAA,GAEctC,0BAA0B"}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_icons","_url","_coreData","_htmlEntities","_postVisibility","_interopRequireDefault","_label","_postSchedule","_label2","_maybeTagsPanel","_maybePostFormatPanel","_store","_maybeCategoryPanel","_maybeUploadMedia","PostPublishPanelPrepublish","children","isBeingScheduled","isRequestingSiteIcon","hasPublishAction","siteIconUrl","siteTitle","siteHome","useSelect","select","_getCurrentPost$_link","getCurrentPost","isEditedPostBeingScheduled","editorStore","getEntityRecord","isResolving","coreStore","siteData","undefined","_links","site_icon_url","name","home","filterURLForDisplay","siteIcon","_react","createElement","Icon","className","size","icon","wordpress","alt","__","src","prePublishTitle","prePublishBodyText","decodeEntities","default","Fragment","PanelBody","initialOpen","title","key","_default","exports"],"sources":["@wordpress/editor/src/components/post-publish-panel/prepublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, PanelBody } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { wordpress } from '@wordpress/icons';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostVisibilityLabel from '../post-visibility/label';\nimport PostSchedule from '../post-schedule';\nimport PostScheduleLabel from '../post-schedule/label';\nimport MaybeTagsPanel from './maybe-tags-panel';\nimport MaybePostFormatPanel from './maybe-post-format-panel';\nimport { store as editorStore } from '../../store';\nimport MaybeCategoryPanel from './maybe-category-panel';\nimport MaybeUploadMedia from './maybe-upload-media';\n\nfunction PostPublishPanelPrepublish( { children } ) {\n\tconst {\n\t\tisBeingScheduled,\n\t\tisRequestingSiteIcon,\n\t\thasPublishAction,\n\t\tsiteIconUrl,\n\t\tsiteTitle,\n\t\tsiteHome,\n\t} = useSelect( ( select ) => {\n\t\tconst { getCurrentPost, isEditedPostBeingScheduled } =\n\t\t\tselect( editorStore );\n\t\tconst { getEntityRecord, isResolving } = select( coreStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\tsiteTitle: siteData.name,\n\t\t\tsiteHome: siteData.home && filterURLForDisplay( siteData.home ),\n\t\t};\n\t}, [] );\n\n\tlet siteIcon = (\n\t\t<Icon className=\"components-site-icon\" size=\"36px\" icon={ wordpress } />\n\t);\n\n\tif ( siteIconUrl ) {\n\t\tsiteIcon = (\n\t\t\t<img\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"components-site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tsiteIcon = null;\n\t}\n\n\tlet prePublishTitle, prePublishBodyText;\n\n\tif ( ! hasPublishAction ) {\n\t\tprePublishTitle = __( 'Are you ready to submit for review?' );\n\t\tprePublishBodyText = __(\n\t\t\t'When you’re ready, submit your work for review, and an Editor will be able to approve it for you.'\n\t\t);\n\t} else if ( isBeingScheduled ) {\n\t\tprePublishTitle = __( 'Are you ready to schedule?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Your work will be published at the specified date and time.'\n\t\t);\n\t} else {\n\t\tprePublishTitle = __( 'Are you ready to publish?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Double-check your settings before publishing.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"editor-post-publish-panel__prepublish\">\n\t\t\t<div>\n\t\t\t\t<strong>{ prePublishTitle }</strong>\n\t\t\t</div>\n\t\t\t<p>{ prePublishBodyText }</p>\n\t\t\t<div className=\"components-site-card\">\n\t\t\t\t{ siteIcon }\n\t\t\t\t<div className=\"components-site-info\">\n\t\t\t\t\t<span className=\"components-site-name\">\n\t\t\t\t\t\t{ decodeEntities( siteTitle ) || __( '(Untitled)' ) }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"components-site-home\">{ siteHome }</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<MaybeUploadMedia />\n\t\t\t{ hasPublishAction && (\n\t\t\t\t<>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Visibility:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Publish:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostScheduleLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostSchedule />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<MaybePostFormatPanel />\n\t\t\t<MaybeTagsPanel />\n\t\t\t<MaybeCategoryPanel />\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default PostPublishPanelPrepublish;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,a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AAiB,MAAE,CACf,CAAC;EACL,GAEH,IAAAb,MAAA,CAAAC,aAAA,EAACjC,aAAA,CAAA6C,OAAY,MAAE,CACL,CACV,CACF,EACD,IAAAb,MAAA,CAAAC,aAAA,EAAC9B,qBAAA,CAAA0C,OAAoB,MAAE,CAAC,EACxB,IAAAb,MAAA,CAAAC,aAAA,EAAC/B,eAAA,CAAA2C,OAAc,MAAE,CAAC,EAClB,IAAAb,MAAA,CAAAC,aAAA,EAAC5B,mBAAA,CAAAwC,OAAkB,MAAE,CAAC,EACpBrC,QACE,CAAC;AAER;AAAC,IAAA2C,QAAA,GAAAC,OAAA,CAAAP,OAAA,GAEctC,0BAA0B","ignoreList":[]}
@@ -46,13 +46,14 @@ function PostSavedState({
46
46
  isAutosaving,
47
47
  isDirty,
48
48
  isNew,
49
- isPending,
50
49
  isPublished,
51
50
  isSaveable,
52
51
  isSaving,
53
52
  isScheduled,
54
53
  hasPublishAction,
55
- showIconLabels
54
+ showIconLabels,
55
+ postStatus,
56
+ postStatusHasChanged
56
57
  } = (0, _data.useSelect)(select => {
57
58
  var _getCurrentPost$_link;
58
59
  const {
@@ -64,7 +65,8 @@ function PostSavedState({
64
65
  isEditedPostSaveable,
65
66
  getCurrentPost,
66
67
  isAutosavingPost,
67
- getEditedPostAttribute
68
+ getEditedPostAttribute,
69
+ getPostEdits
68
70
  } = select(_store.store);
69
71
  const {
70
72
  get
@@ -73,15 +75,17 @@ function PostSavedState({
73
75
  isAutosaving: isAutosavingPost(),
74
76
  isDirty: forceIsDirty || isEditedPostDirty(),
75
77
  isNew: isEditedPostNew(),
76
- isPending: 'pending' === getEditedPostAttribute('status'),
77
78
  isPublished: isCurrentPostPublished(),
78
79
  isSaving: isSavingPost(),
79
80
  isSaveable: isEditedPostSaveable(),
80
81
  isScheduled: isCurrentPostScheduled(),
81
82
  hasPublishAction: (_getCurrentPost$_link = getCurrentPost()?._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
82
- showIconLabels: get('core', 'showIconLabels')
83
+ showIconLabels: get('core', 'showIconLabels'),
84
+ postStatus: getEditedPostAttribute('status'),
85
+ postStatusHasChanged: !!getPostEdits()?.status
83
86
  };
84
87
  }, [forceIsDirty]);
88
+ const isPending = postStatus === 'pending';
85
89
  const {
86
90
  savePost
87
91
  } = (0, _data.useDispatch)(_store.store);
@@ -102,7 +106,7 @@ function PostSavedState({
102
106
  if (!hasPublishAction && isPending) {
103
107
  return null;
104
108
  }
105
- if (isPublished || isScheduled) {
109
+ if (isPublished || isScheduled || !['pending', 'draft', 'auto-draft'].includes(postStatus) || postStatusHasChanged && ['pending', 'draft'].includes(postStatus)) {
106
110
  return null;
107
111
  }
108
112
 
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_compose","_data","_element","_i18n","_icons","_keycodes","_preferences","_store","PostSavedState","forceIsDirty","forceSavedMessage","setForceSavedMessage","useState","isLargeViewport","useViewportMatch","isAutosaving","isDirty","isNew","isPending","isPublished","isSaveable","isSaving","isScheduled","hasPublishAction","showIconLabels","useSelect","select","_getCurrentPost$_link","isEditedPostNew","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostDirty","isSavingPost","isEditedPostSaveable","getCurrentPost","isAutosavingPost","getEditedPostAttribute","editorStore","get","preferencesStore","_links","savePost","useDispatch","wasSaving","usePrevious","useEffect","timeoutId","setTimeout","clearTimeout","label","__","shortLabel","isSaved","isSavedState","isDisabled","text","_react","createElement","Button","className","classnames","getAnimateClassName","type","undefined","onClick","shortcut","displayShortcut","primary","variant","size","icon","cloudUpload","Icon","check","cloud"],"sources":["@wordpress/editor/src/components/post-saved-state/index.js"],"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';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\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 * @return {import('react').ComponentType} The component.\n */\nexport default function PostSavedState( { forceIsDirty } ) {\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\tshowIconLabels,\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\t\t\tconst { get } = select( preferencesStore );\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: 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\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t},\n\t\t[ forceIsDirty ]\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 null;\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\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ isDisabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\tvariant=\"tertiary\"\n\t\t\tsize=\"compact\"\n\t\t\ticon={ isLargeViewport ? undefined : cloudUpload }\n\t\t\tlabel={ text || 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"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASU,cAAcA,CAAE;EAAEC;AAAa,CAAC,EAAG;EAC1D,MAAM,CAAEC,iBAAiB,EAAEC,oBAAoB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACrE,MAAMC,eAAe,GAAG,IAAAC,yBAAgB,EAAE,OA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OACC,IAAAK,MAAA,CAAAC,aAAA,EAAC1D,WAAA,CAAA2D,MAAM;IACNC,SAAS,EACRvC,UAAU,IAAIC,QAAQ,GACnB,IAAAuC,mBAAU,EAAE;MACZ,wBAAwB,EAAE,CAAEP,YAAY;MACxC,yBAAyB,EAAEA,YAAY;MACvC,WAAW,EAAEhC,QAAQ;MACrB,eAAe,EAAEN,YAAY;MAC7B,UAAU,EAAEqC,OAAO;MACnB,CAAE,IAAAS,yCAAmB,EAAE;QACtBC,IAAI,EAAE;MACP,CAAE,CAAC,GAAIzC;IACP,CAAE,CAAC,GACH0C,SACH;IACDC,OAAO,EAAGV,UAAU,GAAGS,SAAS,GAAG,MAAMtB,QAAQ,CAAC;IAClD;AACH;AACA;AACA,OAHG;IAIAwB,QAAQ,EAAGX,UAAU,GAAGS,SAAS,GAAGG,yBAAe,CAACC,OAAO,CAAE,GAAI,CAAG;IACpEC,OAAO,EAAC,UAAU;IAClBC,IAAI,EAAC,SAAS;IACdC,IAAI,EAAGzD,eAAe,GAAGkD,SAAS,GAAGQ,kBAAa;IAClDtB,KAAK,EAAGM,IAAI,IAAIN,KAAO;IACvB,iBAAgBK;EAAY,GAE1BD,YAAY,IAAI,IAAAG,MAAA,CAAAC,aAAA,EAACrD,MAAA,CAAAoE,IAAI;IAACF,IAAI,EAAGlB,OAAO,GAAGqB,YAAK,GAAGC;EAAO,CAAE,CAAC,EACzDnB,IACK,CAAC;AAEX"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_compose","_data","_element","_i18n","_icons","_keycodes","_preferences","_store","PostSavedState","forceIsDirty","forceSavedMessage","setForceSavedMessage","useState","isLargeViewport","useViewportMatch","isAutosaving","isDirty","isNew","isPublished","isSaveable","isSaving","isScheduled","hasPublishAction","showIconLabels","postStatus","postStatusHasChanged","useSelect","select","_getCurrentPost$_link","isEditedPostNew","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostDirty","isSavingPost","isEditedPostSaveable","getCurrentPost","isAutosavingPost","getEditedPostAttribute","getPostEdits","editorStore","get","preferencesStore","_links","status","isPending","savePost","useDispatch","wasSaving","usePrevious","useEffect","timeoutId","setTimeout","clearTimeout","includes","label","__","shortLabel","isSaved","isSavedState","isDisabled","text","_react","createElement","Button","className","classnames","getAnimateClassName","type","undefined","onClick","shortcut","displayShortcut","primary","variant","size","icon","cloudUpload","Icon","check","cloud"],"sources":["@wordpress/editor/src/components/post-saved-state/index.js"],"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';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\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 * @return {import('react').ComponentType} The component.\n */\nexport default function PostSavedState( { forceIsDirty } ) {\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\tisPublished,\n\t\tisSaveable,\n\t\tisSaving,\n\t\tisScheduled,\n\t\thasPublishAction,\n\t\tshowIconLabels,\n\t\tpostStatus,\n\t\tpostStatusHasChanged,\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\tgetPostEdits,\n\t\t\t} = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\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\tisPublished: isCurrentPostPublished(),\n\t\t\t\tisSaving: 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\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t\t\tpostStatusHasChanged: !! getPostEdits()?.status,\n\t\t\t};\n\t\t},\n\t\t[ forceIsDirty ]\n\t);\n\tconst isPending = postStatus === 'pending';\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 (\n\t\tisPublished ||\n\t\tisScheduled ||\n\t\t! [ 'pending', 'draft', 'auto-draft' ].includes( postStatus ) ||\n\t\t( postStatusHasChanged &&\n\t\t\t[ 'pending', 'draft' ].includes( postStatus ) )\n\t) {\n\t\treturn null;\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\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\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ isDisabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\tvariant=\"tertiary\"\n\t\t\tsize=\"compact\"\n\t\t\ticon={ isLargeViewport ? undefined : cloudUpload }\n\t\t\tlabel={ text || label }\n\t\t\taria-disabled={ isDisabled }\n\t\t>\n\t\t\t{ isSavedState && <Icon icon={ isS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AAY;MAC7B,UAAU,EAAE0C,OAAO;MACnB,CAAE,IAAAS,yCAAmB,EAAE;QACtBC,IAAI,EAAE;MACP,CAAE,CAAC,GAAI/C;IACP,CAAE,CAAC,GACHgD,SACH;IACDC,OAAO,EAAGV,UAAU,GAAGS,SAAS,GAAG,MAAMvB,QAAQ,CAAC;IAClD;AACH;AACA;AACA,OAHG;IAIAyB,QAAQ,EAAGX,UAAU,GAAGS,SAAS,GAAGG,yBAAe,CAACC,OAAO,CAAE,GAAI,CAAG;IACpEC,OAAO,EAAC,UAAU;IAClBC,IAAI,EAAC,SAAS;IACdC,IAAI,EAAG9D,eAAe,GAAGuD,SAAS,GAAGQ,kBAAa;IAClDtB,KAAK,EAAGM,IAAI,IAAIN,KAAO;IACvB,iBAAgBK;EAAY,GAE1BD,YAAY,IAAI,IAAAG,MAAA,CAAAC,aAAA,EAAC1D,MAAA,CAAAyE,IAAI;IAACF,IAAI,EAAGlB,OAAO,GAAGqB,YAAK,GAAGC;EAAO,CAAE,CAAC,EACzDnB,IACK,CAAC;AAEX","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_store","PostScheduleCheck","children","hasPublishAction","useSelect","select","_select$getCurrentPos","editorStore","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-schedule/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostScheduleCheck( { children } ) {\n\tconst hasPublishAction = useSelect( ( select ) => {\n\t\treturn (\n\t\t\tselect( editorStore ).getCurrentPost()._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false\n\t\t);\n\t}, [] );\n\n\tif ( ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGe,SAASE,iBAAiBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACzD,MAAMC,gBAAgB,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,qBAAA;IACjD,QAAAA,qBAAA,GACCD,MAAM,CAAEE,YAAY,CAAC,CAACC,cAAc,CAAC,CAAC,CAACC,MAAM,GAC5C,mBAAmB,CACnB,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;EAEZ,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEH,gBAAgB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB"}
1
+ {"version":3,"names":["_data","require","_store","PostScheduleCheck","children","hasPublishAction","useSelect","select","_select$getCurrentPos","editorStore","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-schedule/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostScheduleCheck( { children } ) {\n\tconst hasPublishAction = useSelect( ( select ) => {\n\t\treturn (\n\t\t\tselect( editorStore ).getCurrentPost()._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false\n\t\t);\n\t}, [] );\n\n\tif ( ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGe,SAASE,iBAAiBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACzD,MAAMC,gBAAgB,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,qBAAA;IACjD,QAAAA,qBAAA,GACCD,MAAM,CAAEE,YAAY,CAAC,CAACC,cAAc,CAAC,CAAC,CAACC,MAAM,GAC5C,mBAAmB,CACnB,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;EAEZ,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEH,gBAAgB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_dateFns","require","_date","_data","_blockEditor","_element","_coreData","_store","PostSchedule","onClose","postDate","postType","useSelect","select","editorStore","getEditedPostAttribute","getCurrentPostType","editPost","useDispatch","onUpdateDate","date","previewedMonth","setPreviewedMonth","useState","startOfMonth","Date","eventsByPostType","coreStore","getEntityRecords","status","after","toISOString","before","endOfMonth","exclude","getCurrentPostId","per_page","_fields","events","useMemo","map","eventDate","settings","getSettings","is12HourTime","test","formats","time","toLowerCase","replace","split","reverse","join","_react","createElement","__experimentalPublishDateTimePicker","currentDate","onChange","is12Hour","onMonthPreviewed","parseISO"],"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { parseISO, endOfMonth, startOfMonth } from 'date-fns';\n\n/**\n * WordPress dependencies\n */\nimport { getSettings } from '@wordpress/date';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __experimentalPublishDateTimePicker as PublishDateTimePicker } from '@wordpress/block-editor';\nimport { 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\nexport default function PostSchedule( { onClose } ) {\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\tstartOfMonth( new Date( 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: startOfMonth( previewedMonth ).toISOString(),\n\t\t\t\tbefore: endOfMonth( previewedMonth ).toISOString(),\n\t\t\t\texclude: [ select( editorStore ).getCurrentPostId() ],\n\t\t\t\tper_page: 100,\n\t\t\t\t_fields: 'id,date',\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( ( { date: eventDate } ) => ( {\n\t\t\t\tdate: new Date( eventDate ),\n\t\t\t} ) ),\n\t\t[ eventsByPostType ]\n\t);\n\n\tconst settings = getSettings();\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\treturn (\n\t\t<PublishDateTimePicker\n\t\t\tcurrentDate={ postDate }\n\t\t\tonChange={ onUpdateDate }\n\t\t\tis12Hour={ is12HourTime }\n\t\t\tevents={ events }\n\t\t\tonMonthPreviewed={ ( date ) =>\n\t\t\t\tsetPreviewedMonth( parseISO( date ) )\n\t\t\t}\n\t\t\tonClose={ onClose }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,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,EACrB,MACC,CAAEb,gBAAgB,IAAI,EAAE,EAAGc,GAAG,CAAE,CAAE;IAAEpB,IAAI,EAAEqB;EAAU,CAAC,MAAQ;IAC5DrB,IAAI,EAAE,IAAIK,IAAI,CAAEgB,SAAU;EAC3B,CAAC,CAAG,CAAC,EACN,CAAEf,gBAAgB,CACnB,CAAC;EAED,MAAMgB,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;;EAE9B;EACA;EACA,MAAMC,YAAY,GAAG,UAAU,CAACC,IAAI,CACnCH,QAAQ,CAACI,OAAO,CAACC,IAAI,CACnBC,WAAW,CAAC,CAAC,CAAC;EAAA,CACdC,OAAO,CAAE,OAAO,EAAE,EAAG,CAAC,CAAC;EAAA,CACvBC,KAAK,CAAE,EAAG,CAAC,CACXC,OAAO,CAAC,CAAC,CACTC,IAAI,CAAE,EAAG,CAAC,CAAC;EACd,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAClD,YAAA,CAAAmD,mCAAqB;IACrBC,WAAW,EAAG9C,QAAU;IACxB+C,QAAQ,EAAGtC,YAAc;IACzBuC,QAAQ,EAAGd,YAAc;IACzBN,MAAM,EAAGA,MAAQ;IACjBqB,gBAAgB,EAAKvC,IAAI,IACxBE,iBAAiB,CAAE,IAAAsC,iBAAQ,EAAExC,IAAK,CAAE,CACpC;IACDX,OAAO,EAAGA;EAAS,CACnB,CAAC;AAEJ"}
1
+ {"version":3,"names":["_dateFns","require","_date","_data","_blockEditor","_element","_coreData","_store","PostSchedule","onClose","postDate","postType","useSelect","select","editorStore","getEditedPostAttribute","getCurrentPostType","editPost","useDispatch","onUpdateDate","date","previewedMonth","setPreviewedMonth","useState","startOfMonth","Date","eventsByPostType","coreStore","getEntityRecords","status","after","toISOString","before","endOfMonth","exclude","getCurrentPostId","per_page","_fields","events","useMemo","map","eventDate","settings","getSettings","is12HourTime","test","formats","time","toLowerCase","replace","split","reverse","join","_react","createElement","__experimentalPublishDateTimePicker","currentDate","onChange","is12Hour","onMonthPreviewed","parseISO"],"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { parseISO, endOfMonth, startOfMonth } from 'date-fns';\n\n/**\n * WordPress dependencies\n */\nimport { getSettings } from '@wordpress/date';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __experimentalPublishDateTimePicker as PublishDateTimePicker } from '@wordpress/block-editor';\nimport { 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\nexport default function PostSchedule( { onClose } ) {\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\tstartOfMonth( new Date( 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: startOfMonth( previewedMonth ).toISOString(),\n\t\t\t\tbefore: endOfMonth( previewedMonth ).toISOString(),\n\t\t\t\texclude: [ select( editorStore ).getCurrentPostId() ],\n\t\t\t\tper_page: 100,\n\t\t\t\t_fields: 'id,date',\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( ( { date: eventDate } ) => ( {\n\t\t\t\tdate: new Date( eventDate ),\n\t\t\t} ) ),\n\t\t[ eventsByPostType ]\n\t);\n\n\tconst settings = getSettings();\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\treturn (\n\t\t<PublishDateTimePicker\n\t\t\tcurrentDate={ postDate }\n\t\t\tonChange={ onUpdateDate }\n\t\t\tis12Hour={ is12HourTime }\n\t\t\tevents={ events }\n\t\t\tonMonthPreviewed={ ( date ) =>\n\t\t\t\tsetPreviewedMonth( parseISO( date ) )\n\t\t\t}\n\t\t\tonClose={ onClose }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAGe,SAASO,YAAYA,CAAE;EAAEC;AAAQ,CAAC,EAAG;EACnD,MAAM;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EACrCC,MAAM,KAAQ;IACfH,QAAQ,EAAEG,MAAM,CAAEC,YAAY,CAAC,CAACC,sBAAsB,CAAE,MAAO,CAAC;IAChEJ,QAAQ,EAAEE,MAAM,CAAEC,YAAY,CAAC,CAACE,kBAAkB,CAAC;EACpD,CAAC,CAAE,EACH,EACD,CAAC;EAED,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEJ,YAAY,CAAC;EAC/C,MAAMK,YAAY,GAAKC,IAAI,IAAMH,QAAQ,CAAE;IAAEG;EAAK,CAAE,CA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G,CAAC,CAAC;EACd,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAClD,YAAA,CAAAmD,mCAAqB;IACrBC,WAAW,EAAG9C,QAAU;IACxB+C,QAAQ,EAAGtC,YAAc;IACzBuC,QAAQ,EAAGd,YAAc;IACzBN,MAAM,EAAGA,MAAQ;IACjBqB,gBAAgB,EAAKvC,IAAI,IACxBE,iBAAiB,CAAE,IAAAsC,iBAAQ,EAAExC,IAAK,CAAE,CACpC;IACDX,OAAO,EAAGA;EAAS,CACnB,CAAC;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_date","_data","_store","PostScheduleLabel","props","usePostScheduleLabel","full","date","isFloating","useSelect","select","editorStore","getEditedPostAttribute","isEditedPostDateFloating","getFullPostScheduleLabel","getPostScheduleLabel","dateAttribute","getDate","timezoneAbbreviation","getTimezoneAbbreviation","formattedDate","dateI18n","_x","isRTL","now","Date","__","isTimezoneSameAsSiteTimezone","isSameDay","sprintf","tomorrow","setDate","getFullYear","timezone","getSettings","abbr","isNaN","Number","symbol","offset","offsetFormatted","siteOffset","dateOffset","getTimezoneOffset","left","right","getMonth"],"sources":["@wordpress/editor/src/components/post-schedule/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { getSettings, getDate, dateI18n } from '@wordpress/date';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostScheduleLabel( props ) {\n\treturn usePostScheduleLabel( props );\n}\n\nexport function usePostScheduleLabel( { full = false } = {} ) {\n\tconst { date, isFloating } = useSelect(\n\t\t( select ) => ( {\n\t\t\tdate: select( editorStore ).getEditedPostAttribute( 'date' ),\n\t\t\tisFloating: select( editorStore ).isEditedPostDateFloating(),\n\t\t} ),\n\t\t[]\n\t);\n\n\treturn full\n\t\t? getFullPostScheduleLabel( date )\n\t\t: getPostScheduleLabel( date, { isFloating } );\n}\n\nexport function getFullPostScheduleLabel( dateAttribute ) {\n\tconst date = getDate( dateAttribute );\n\n\tconst timezoneAbbreviation = getTimezoneAbbreviation();\n\tconst formattedDate = dateI18n(\n\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t_x( 'F j, Y g:i\\xa0a', 'post schedule full date format' ),\n\t\tdate\n\t);\n\treturn isRTL()\n\t\t? `${ timezoneAbbreviation } ${ formattedDate }`\n\t\t: `${ formattedDate } ${ timezoneAbbreviation }`;\n}\n\nexport function getPostScheduleLabel(\n\tdateAttribute,\n\t{ isFloating = false, now = new Date() } = {}\n) {\n\tif ( ! dateAttribute || isFloating ) {\n\t\treturn __( 'Immediately' );\n\t}\n\n\t// If the user timezone does not equal the site timezone then using words\n\t// like 'tomorrow' is confusing, so show the full date.\n\tif ( ! isTimezoneSameAsSiteTimezone( now ) ) {\n\t\treturn getFullPostScheduleLabel( dateAttribute );\n\t}\n\n\tconst date = getDate( dateAttribute );\n\n\tif ( isSameDay( date, now ) ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: Time of day the post is scheduled for.\n\t\t\t__( 'Today at %s' ),\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\tdateI18n( _x( 'g:i\\xa0a', 'post schedule time format' ), date )\n\t\t);\n\t}\n\n\tconst tomorrow = new Date( now );\n\ttomorrow.setDate( tomorrow.getDate() + 1 );\n\n\tif ( isSameDay( date, tomorrow ) ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: Time of day the post is scheduled for.\n\t\t\t__( 'Tomorrow at %s' ),\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\tdateI18n( _x( 'g:i\\xa0a', 'post schedule time format' ), date )\n\t\t);\n\t}\n\n\tif ( date.getFullYear() === now.getFullYear() ) {\n\t\treturn dateI18n(\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\t_x( 'F j g:i\\xa0a', 'post schedule date format without year' ),\n\t\t\tdate\n\t\t);\n\t}\n\n\treturn dateI18n(\n\t\t// translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.\n\t\t_x( 'F j, Y g:i\\xa0a', 'post schedule full date format' ),\n\t\tdate\n\t);\n}\n\nfunction getTimezoneAbbreviation() {\n\tconst { timezone } = getSettings();\n\n\tif ( timezone.abbr && isNaN( Number( timezone.abbr ) ) ) {\n\t\treturn timezone.abbr;\n\t}\n\n\tconst symbol = timezone.offset < 0 ? '' : '+';\n\treturn `UTC${ symbol }${ timezone.offsetFormatted }`;\n}\n\nfunction isTimezoneSameAsSiteTimezone( date ) {\n\tconst { timezone } = getSettings();\n\n\tconst siteOffset = Number( timezone.offset );\n\tconst dateOffset = -1 * ( date.getTimezoneOffset() / 60 );\n\treturn siteOffset === dateOffset;\n}\n\nfunction isSameDay( left, right ) {\n\treturn (\n\t\tleft.getDate() === right.getDate() &&\n\t\tleft.getMonth() === right.getMonth() &&\n\t\tleft.getFullYear() === right.getFullYear()\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGe,SAASI,iBAAiBA,CAAEC,KAAK,EAAG;EAClD,OAAOC,oBAAoB,CAAED,KAAM,CAAC;AACrC;AAEO,SAASC,oBAAoBA,CAAE;EAAEC,IAAI,GAAG;AAAM,CAAC,GAAG,CAAC,CAAC,EAAG;EAC7D,MAAM;IAAEC,IAAI;IAAEC;EAAW,CAAC,GAAG,IAAAC,eAAS,EACnCC,MAAM,KAAQ;IACfH,IAAI,EAAEG,MAAM,CAAEC,YAAY,CAAC,CAACC,sBAAsB,CAAE,MAAO,CAAC;IAC5DJ,UAAU,EAAEE,MAAM,CAAEC,YAAY,CAAC,CAACE,wBAAwB,CAAC;EAC5D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KnC,IAAI,CAACoC,iBAAiB,CAAC,CAAC,GAAG,EAAE,CAAE;EACzD,OAAOF,UAAU,KAAKC,UAAU;AACjC;AAEA,SAASd,SAASA,CAAEgB,IAAI,EAAEC,KAAK,EAAG;EACjC,OACCD,IAAI,CAAC3B,OAAO,CAAC,CAAC,KAAK4B,KAAK,CAAC5B,OAAO,CAAC,CAAC,IAClC2B,IAAI,CAACE,QAAQ,CAAC,CAAC,KAAKD,KAAK,CAACC,QAAQ,CAAC,CAAC,IACpCF,IAAI,CAACZ,WAAW,CAAC,CAAC,KAAKa,KAAK,CAACb,WAAW,CAAC,CAAC;AAE5C"}
1
+ {"version":3,"names":["_i18n","require","_date","_data","_store","PostScheduleLabel","props","usePostScheduleLabel","full","date","isFloating","useSelect","select","editorStore","getEditedPostAttribute","isEditedPostDateFloating","getFullPostScheduleLabel","getPostScheduleLabel","dateAttribute","getDate","timezoneAbbreviation","getTimezoneAbbreviation","formattedDate","dateI18n","_x","isRTL","now","Date","__","isTimezoneSameAsSiteTimezone","isSameDay","sprintf","tomorrow","setDate","getFullYear","timezone","getSettings","abbr","isNaN","Number","symbol","offset","offsetFormatted","siteOffset","dateOffset","getTimezoneOffset","left","right","getMonth"],"sources":["@wordpress/editor/src/components/post-schedule/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { getSettings, getDate, dateI18n } from '@wordpress/date';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostScheduleLabel( props ) {\n\treturn usePostScheduleLabel( props );\n}\n\nexport function usePostScheduleLabel( { full = false } = {} ) {\n\tconst { date, isFloating } = useSelect(\n\t\t( select ) => ( {\n\t\t\tdate: select( editorStore ).getEditedPostAttribute( 'date' ),\n\t\t\tisFloating: select( editorStore ).isEditedPostDateFloating(),\n\t\t} ),\n\t\t[]\n\t);\n\n\treturn full\n\t\t? getFullPostScheduleLabel( date )\n\t\t: getPostScheduleLabel( date, { isFloating } );\n}\n\nexport function getFullPostScheduleLabel( dateAttribute ) {\n\tconst date = getDate( dateAttribute );\n\n\tconst timezoneAbbreviation = getTimezoneAbbreviation();\n\tconst formattedDate = dateI18n(\n\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t_x( 'F j, Y g:i\\xa0a', 'post schedule full date format' ),\n\t\tdate\n\t);\n\treturn isRTL()\n\t\t? `${ timezoneAbbreviation } ${ formattedDate }`\n\t\t: `${ formattedDate } ${ timezoneAbbreviation }`;\n}\n\nexport function getPostScheduleLabel(\n\tdateAttribute,\n\t{ isFloating = false, now = new Date() } = {}\n) {\n\tif ( ! dateAttribute || isFloating ) {\n\t\treturn __( 'Immediately' );\n\t}\n\n\t// If the user timezone does not equal the site timezone then using words\n\t// like 'tomorrow' is confusing, so show the full date.\n\tif ( ! isTimezoneSameAsSiteTimezone( now ) ) {\n\t\treturn getFullPostScheduleLabel( dateAttribute );\n\t}\n\n\tconst date = getDate( dateAttribute );\n\n\tif ( isSameDay( date, now ) ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: Time of day the post is scheduled for.\n\t\t\t__( 'Today at %s' ),\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\tdateI18n( _x( 'g:i\\xa0a', 'post schedule time format' ), date )\n\t\t);\n\t}\n\n\tconst tomorrow = new Date( now );\n\ttomorrow.setDate( tomorrow.getDate() + 1 );\n\n\tif ( isSameDay( date, tomorrow ) ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: Time of day the post is scheduled for.\n\t\t\t__( 'Tomorrow at %s' ),\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\tdateI18n( _x( 'g:i\\xa0a', 'post schedule time format' ), date )\n\t\t);\n\t}\n\n\tif ( date.getFullYear() === now.getFullYear() ) {\n\t\treturn dateI18n(\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\t_x( 'F j g:i\\xa0a', 'post schedule date format without year' ),\n\t\t\tdate\n\t\t);\n\t}\n\n\treturn dateI18n(\n\t\t// translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.\n\t\t_x( 'F j, Y g:i\\xa0a', 'post schedule full date format' ),\n\t\tdate\n\t);\n}\n\nfunction getTimezoneAbbreviation() {\n\tconst { timezone } = getSettings();\n\n\tif ( timezone.abbr && isNaN( Number( timezone.abbr ) ) ) {\n\t\treturn timezone.abbr;\n\t}\n\n\tconst symbol = timezone.offset < 0 ? '' : '+';\n\treturn `UTC${ symbol }${ timezone.offsetFormatted }`;\n}\n\nfunction isTimezoneSameAsSiteTimezone( date ) {\n\tconst { timezone } = getSettings();\n\n\tconst siteOffset = Number( timezone.offset );\n\tconst dateOffset = -1 * ( date.getTimezoneOffset() / 60 );\n\treturn siteOffset === dateOffset;\n}\n\nfunction isSameDay( left, right ) {\n\treturn (\n\t\tleft.getDate() === right.getDate() &&\n\t\tleft.getMonth() === right.getMonth() &&\n\t\tleft.getFullYear() === right.getFullYear()\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGe,SAASI,iBAAiBA,CAAEC,KAAK,EAAG;EAClD,OAAOC,oBAAoB,CAAED,KAAM,CAAC;AACrC;AAEO,SAASC,oBAAoBA,CAAE;EAAEC,IAAI,GAAG;AAAM,CAAC,GAAG,CAAC,CAAC,EAAG;EAC7D,MAAM;IAAEC,IAAI;IAAEC;EAAW,CAAC,GAAG,IAAAC,eAAS,EACnCC,MAAM,KAAQ;IACfH,IAAI,EAAEG,MAAM,CAAEC,YAAY,CAAC,CAACC,sBAAsB,CAAE,MAAO,CAAC;IAC5DJ,UAAU,EAAEE,MAAM,CAAEC,YAAY,CAAC,C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AU,GAAG,CAAC,CAAC,IAAKnC,IAAI,CAACoC,iBAAiB,CAAC,CAAC,GAAG,EAAE,CAAE;EACzD,OAAOF,UAAU,KAAKC,UAAU;AACjC;AAEA,SAASd,SAASA,CAAEgB,IAAI,EAAEC,KAAK,EAAG;EACjC,OACCD,IAAI,CAAC3B,OAAO,CAAC,CAAC,KAAK4B,KAAK,CAAC5B,OAAO,CAAC,CAAC,IAClC2B,IAAI,CAACE,QAAQ,CAAC,CAAC,KAAKD,KAAK,CAACC,QAAQ,CAAC,CAAC,IACpCF,IAAI,CAACZ,WAAW,CAAC,CAAC,KAAKa,KAAK,CAACb,WAAW,CAAC,CAAC;AAE5C","ignoreList":[]}
@@ -9,10 +9,13 @@ var _react = require("react");
9
9
  var _components = require("@wordpress/components");
10
10
  var _i18n = require("@wordpress/i18n");
11
11
  var _element = require("@wordpress/element");
12
+ var _data = require("@wordpress/data");
12
13
  var _check = _interopRequireDefault(require("./check"));
13
14
  var _index = _interopRequireDefault(require("./index"));
14
15
  var _label = require("./label");
15
16
  var _postPanelRow = _interopRequireDefault(require("../post-panel-row"));
17
+ var _store = require("../../store");
18
+ var _constants = require("../../store/constants");
16
19
  /**
17
20
  * WordPress dependencies
18
21
  */
@@ -21,8 +24,10 @@ var _postPanelRow = _interopRequireDefault(require("../post-panel-row"));
21
24
  * Internal dependencies
22
25
  */
23
26
 
27
+ const DESIGN_POST_TYPES = [_constants.TEMPLATE_POST_TYPE, _constants.TEMPLATE_PART_POST_TYPE, _constants.PATTERN_POST_TYPE, _constants.NAVIGATION_POST_TYPE];
24
28
  function PostSchedulePanel() {
25
29
  const [popoverAnchor, setPopoverAnchor] = (0, _element.useState)(null);
30
+ const postType = (0, _data.useSelect)(select => select(_store.store).getCurrentPostType(), []);
26
31
  // Memoize popoverProps to avoid returning a new object every time.
27
32
  const popoverProps = (0, _element.useMemo)(() => ({
28
33
  // Anchor the popover to the middle of the entire row so that it doesn't
@@ -35,6 +40,9 @@ function PostSchedulePanel() {
35
40
  const fullLabel = (0, _label.usePostScheduleLabel)({
36
41
  full: true
37
42
  });
43
+ if (DESIGN_POST_TYPES.includes(postType)) {
44
+ return null;
45
+ }
38
46
  return (0, _react.createElement)(_check.default, null, (0, _react.createElement)(_postPanelRow.default, {
39
47
  label: (0, _i18n.__)('Publish'),
40
48
  ref: setPopoverAnchor
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_element","_check","_interopRequireDefault","_index","_label","_postPanelRow","PostSchedulePanel","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","__","placement","label","usePostScheduleLabel","fullLabel","full","_react","createElement","default","ref","Dropdown","focusOnMount","className","contentClassName","renderToggle","onToggle","isOpen","Button","__next40pxDefaultSize","variant","onClick","sprintf","showTooltip","renderContent","onClose"],"sources":["@wordpress/editor/src/components/post-schedule/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Dropdown } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleCheck from './check';\nimport PostScheduleForm from './index';\nimport { usePostScheduleLabel } from './label';\nimport PostPanelRow from '../post-panel-row';\n\nexport default function PostSchedulePanel() {\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': __( 'Change publish date' ),\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst label = usePostScheduleLabel();\n\tconst fullLabel = usePostScheduleLabel( { full: true } );\n\n\treturn (\n\t\t<PostScheduleCheck>\n\t\t\t<PostPanelRow label={ __( 'Publish' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\tclassName=\"editor-post-schedule__panel-dropdown\"\n\t\t\t\t\tcontentClassName=\"editor-post-schedule__dialog\"\n\t\t\t\t\trenderToggle={ ( { onToggle, isOpen } ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"editor-post-schedule__dialog-toggle\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Current post date.\n\t\t\t\t\t\t\t\t__( 'Change date: %s' ),\n\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ fullLabel }\n\t\t\t\t\t\t\tshowTooltip={ label !== fullLabel }\n\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostScheduleForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostScheduleCheck>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAbA;AACA;AACA;;AAKA;AACA;AACA;;AAMe,SAASQ,iBAAiBA,CAAA,EAAG;EAC3C,MAAM,CAAEC,aAAa,EAAEC,gBAAgB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B,MAAA,CAAAC,aAAA,EAACjB,MAAA,CAAAkB,OAAgB;MAACgB,OAAO,EAAGA;IAAS,CAAE;EACrC,CACH,CACY,CACI,CAAC;AAEtB"}
1
+ {"version":3,"names":["_components","require","_i18n","_element","_data","_check","_interopRequireDefault","_index","_label","_postPanelRow","_store","_constants","DESIGN_POST_TYPES","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","NAVIGATION_POST_TYPE","PostSchedulePanel","popoverAnchor","setPopoverAnchor","useState","postType","useSelect","select","editorStore","getCurrentPostType","popoverProps","useMemo","anchor","__","placement","label","usePostScheduleLabel","fullLabel","full","includes","_react","createElement","default","ref","Dropdown","focusOnMount","className","contentClassName","renderToggle","onToggle","isOpen","Button","__next40pxDefaultSize","variant","onClick","sprintf","showTooltip","renderContent","onClose"],"sources":["@wordpress/editor/src/components/post-schedule/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Dropdown } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleCheck from './check';\nimport PostScheduleForm from './index';\nimport { usePostScheduleLabel } from './label';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../../store/constants';\n\nconst DESIGN_POST_TYPES = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n];\n\nexport default function PostSchedulePanel() {\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst postType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': __( 'Change publish date' ),\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst label = usePostScheduleLabel();\n\tconst fullLabel = usePostScheduleLabel( { full: true } );\n\tif ( DESIGN_POST_TYPES.includes( postType ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostScheduleCheck>\n\t\t\t<PostPanelRow label={ __( 'Publish' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\tclassName=\"editor-post-schedule__panel-dropdown\"\n\t\t\t\t\tcontentClassName=\"editor-post-schedule__dialog\"\n\t\t\t\t\trenderToggle={ ( { onToggle, isOpen } ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"editor-post-schedule__dialog-toggle\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Current post date.\n\t\t\t\t\t\t\t\t__( 'Change date: %s' ),\n\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ fullLabel }\n\t\t\t\t\t\t\tshowTooltip={ label !== fullLabel }\n\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostScheduleForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\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IAAI;EACZ;EAEA,OACC,IAAAe,MAAA,CAAAC,aAAA,EAAChC,MAAA,CAAAiC,OAAiB,QACjB,IAAAF,MAAA,CAAAC,aAAA,EAAC5B,aAAA,CAAA6B,OAAY;IAACP,KAAK,EAAG,IAAAF,QAAE,EAAE,SAAU,CAAG;IAACU,GAAG,EAAGpB;EAAkB,GAC/D,IAAAiB,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAAwC,QAAQ;IACRd,YAAY,EAAGA,YAAc;IAC7Be,YAAY;IACZC,SAAS,EAAC,sCAAsC;IAChDC,gBAAgB,EAAC,8BAA8B;IAC/CC,YAAY,EAAGA,CAAE;MAAEC,QAAQ;MAAEC;IAAO,CAAC,KACpC,IAAAV,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAA+C,MAAM;MACNC,qBAAqB;MACrBN,SAAS,EAAC,qCAAqC;MAC/CO,OAAO,EAAC,UAAU;MAClBC,OAAO,EAAGL,QAAU;MACpB,cAAa,IAAAM,aAAO;MACnB;MACA,IAAAtB,QAAE,EAAE,iBAAkB,CAAC,EACvBE,KACD,CAAG;MACHA,KAAK,EAAGE,SAAW;MACnBmB,WAAW,EAAGrB,KAAK,KAAKE,SAAW;MACnC,iBAAgBa;IAAQ,GAEtBf,KACK,CACN;IACHsB,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KAC5B,IAAAlB,MAAA,CAAAC,aAAA,EAAC9B,MAAA,CAAA+B,OAAgB;MAACgB,OAAO,EAAGA;IAAS,CAAE;EACrC,CACH,CACY,CACI,CAAC;AAEtB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_postTypeSupportCheck","_interopRequireDefault","require","PostSlugCheck","children","_react","createElement","default","supportKeys"],"sources":["@wordpress/editor/src/components/post-slug/check.js"],"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"],"mappings":";;;;;;;;AAGA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGe,SAASC,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACrD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACN,qBAAA,CAAAO,OAAoB;IAACC,WAAW,EAAC;EAAM,GACrCJ,QACmB,CAAC;AAEzB"}
1
+ {"version":3,"names":["_postTypeSupportCheck","_interopRequireDefault","require","PostSlugCheck","children","_react","createElement","default","supportKeys"],"sources":["@wordpress/editor/src/components/post-slug/check.js"],"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"],"mappings":";;;;;;;;AAGA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGe,SAASC,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACrD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACN,qBAAA,CAAAO,OAAoB;IAACC,WAAW,EAAC;EAAM,GACrCJ,QACmB,CAAC;AAEzB","ignoreList":[]}
@@ -4,12 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = exports.PostSlug = void 0;
7
+ exports.default = PostSlug;
8
8
  var _react = require("react");
9
9
  var _data = require("@wordpress/data");
10
10
  var _element = require("@wordpress/element");
11
11
  var _i18n = require("@wordpress/i18n");
12
- var _compose = require("@wordpress/compose");
13
12
  var _url = require("@wordpress/url");
14
13
  var _components = require("@wordpress/components");
15
14
  var _check = _interopRequireDefault(require("./check"));
@@ -22,74 +21,50 @@ var _store = require("../../store");
22
21
  * Internal dependencies
23
22
  */
24
23
 
25
- class PostSlug extends _element.Component {
26
- constructor({
27
- postSlug,
28
- postTitle,
29
- postID
30
- }) {
31
- super(...arguments);
32
- this.state = {
33
- editedSlug: (0, _url.safeDecodeURIComponent)(postSlug) || (0, _url.cleanForSlug)(postTitle) || postID
34
- };
35
- this.setSlug = this.setSlug.bind(this);
36
- }
37
- setSlug(event) {
38
- const {
39
- postSlug,
40
- onUpdateSlug
41
- } = this.props;
42
- const {
43
- value
44
- } = event.target;
45
- const editedSlug = (0, _url.cleanForSlug)(value);
46
- if (editedSlug === postSlug) {
47
- return;
48
- }
49
- onUpdateSlug(editedSlug);
50
- }
51
- render() {
52
- const {
53
- editedSlug
54
- } = this.state;
55
- return (0, _react.createElement)(_check.default, null, (0, _react.createElement)(_components.TextControl, {
56
- __nextHasNoMarginBottom: true,
57
- label: (0, _i18n.__)('Slug'),
58
- autoComplete: "off",
59
- spellCheck: "false",
60
- value: editedSlug,
61
- onChange: slug => this.setState({
62
- editedSlug: slug
63
- }),
64
- onBlur: this.setSlug,
65
- className: "editor-post-slug"
66
- }));
67
- }
68
- }
69
- exports.PostSlug = PostSlug;
70
- var _default = exports.default = (0, _compose.compose)([(0, _data.withSelect)(select => {
71
- const {
72
- getCurrentPost,
73
- getEditedPostAttribute
74
- } = select(_store.store);
75
- const {
76
- id
77
- } = getCurrentPost();
78
- return {
79
- postSlug: getEditedPostAttribute('slug'),
80
- postTitle: getEditedPostAttribute('title'),
81
- postID: id
82
- };
83
- }), (0, _data.withDispatch)(dispatch => {
24
+ function PostSlugControl() {
25
+ const postSlug = (0, _data.useSelect)(select => {
26
+ return (0, _url.safeDecodeURIComponent)(select(_store.store).getEditedPostSlug());
27
+ }, []);
84
28
  const {
85
29
  editPost
86
- } = dispatch(_store.store);
87
- return {
88
- onUpdateSlug(slug) {
30
+ } = (0, _data.useDispatch)(_store.store);
31
+ const [forceEmptyField, setForceEmptyField] = (0, _element.useState)(false);
32
+ return (0, _react.createElement)(_components.TextControl, {
33
+ __nextHasNoMarginBottom: true,
34
+ label: (0, _i18n.__)('Slug'),
35
+ autoComplete: "off",
36
+ spellCheck: "false",
37
+ value: forceEmptyField ? '' : postSlug,
38
+ onChange: newValue => {
89
39
  editPost({
90
- slug
40
+ slug: newValue
91
41
  });
92
- }
93
- };
94
- })])(PostSlug);
42
+ // When we delete the field the permalink gets
43
+ // reverted to the original value.
44
+ // The forceEmptyField logic allows the user to have
45
+ // the field temporarily empty while typing.
46
+ if (!newValue) {
47
+ if (!forceEmptyField) {
48
+ setForceEmptyField(true);
49
+ }
50
+ return;
51
+ }
52
+ if (forceEmptyField) {
53
+ setForceEmptyField(false);
54
+ }
55
+ },
56
+ onBlur: event => {
57
+ editPost({
58
+ slug: (0, _url.cleanForSlug)(event.target.value)
59
+ });
60
+ if (forceEmptyField) {
61
+ setForceEmptyField(false);
62
+ }
63
+ },
64
+ className: "editor-post-slug"
65
+ });
66
+ }
67
+ function PostSlug() {
68
+ return (0, _react.createElement)(_check.default, null, (0, _react.createElement)(PostSlugControl, null));
69
+ }
95
70
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_element","_i18n","_compose","_url","_components","_check","_interopRequireDefault","_store","PostSlug","Component","constructor","postSlug","postTitle","postID","arguments","state","editedSlug","safeDecodeURIComponent","cleanForSlug","setSlug","bind","event","onUpdateSlug","props","value","target","render","_react","createElement","default","TextControl","__nextHasNoMarginBottom","label","__","autoComplete","spellCheck","onChange","slug","setState","onBlur","className","exports","_default","compose","withSelect","select","getCurrentPost","getEditedPostAttribute","editorStore","id","withDispatch","dispatch","editPost"],"sources":["@wordpress/editor/src/components/post-slug/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { compose } from '@wordpress/compose';\nimport { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';\nimport { TextControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport PostSlugCheck from './check';\nimport { store as editorStore } from '../../store';\n\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 { editedSlug } = this.state;\n\t\treturn (\n\t\t\t<PostSlugCheck>\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Slug' ) }\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\tvalue={ editedSlug }\n\t\t\t\t\tonChange={ ( slug ) =>\n\t\t\t\t\t\tthis.setState( { editedSlug: slug } )\n\t\t\t\t\t}\n\t\t\t\t\tonBlur={ this.setSlug }\n\t\t\t\t\tclassName=\"editor-post-slug\"\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 } =\n\t\t\tselect( editorStore );\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(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AA,EAACvB,MAAA,CAAAwB,OAAa,QACb,IAAAF,MAAA,CAAAC,aAAA,EAACxB,WAAA,CAAA0B,WAAW;MACXC,uBAAuB;MACvBC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;MACtBC,YAAY,EAAC,KAAK;MAClBC,UAAU,EAAC,OAAO;MAClBX,KAAK,EAAGR,UAAY;MACpBoB,QAAQ,EAAKC,IAAI,IAChB,IAAI,CAACC,QAAQ,CAAE;QAAEtB,UAAU,EAAEqB;MAAK,CAAE,CACpC;MACDE,MAAM,EAAG,IAAI,CAACpB,OAAS;MACvBqB,SAAS,EAAC;IAAkB,CAC5B,CACa,CAAC;EAElB;AACD;AAACC,OAAA,CAAAjC,QAAA,GAAAA,QAAA;AAAA,IAAAkC,QAAA,GAAAD,OAAA,CAAAZ,OAAA,GAEc,IAAAc,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC,cAAc;IAAEC;EAAuB,CAAC,GAC/CF,MAAM,CAAEG,YAAY,CAAC;EAEtB,MAAM;IAAEC;EAAG,CAAC,GAAGH,cAAc,CAAC,CAAC;EAC/B,OAAO;IACNnC,QAAQ,EAAEoC,sBAAsB,CAAE,MAAO,CAAC;IAC1CnC,SAAS,EAAEmC,sBAAsB,CAAE,OAAQ,CAAC;IAC5ClC,MAAM,EAAEoC;EACT,CAAC;AACF,CAAE,CAAC,EACH,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC;EAAS,CAAC,GAAGD,QAAQ,CAAEH,YAAY,CAAC;EAC5C,OAAO;IACN1B,YAAYA,CAAEe,IAAI,EAAG;MACpBe,QAAQ,CAAE;QAAEf;MAAK,CAAE,CAAC;IACrB;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAE7B,QAAS,CAAC"}
1
+ {"version":3,"names":["_data","require","_element","_i18n","_url","_components","_check","_interopRequireDefault","_store","PostSlugControl","postSlug","useSelect","select","safeDecodeURIComponent","editorStore","getEditedPostSlug","editPost","useDispatch","forceEmptyField","setForceEmptyField","useState","_react","createElement","TextControl","__nextHasNoMarginBottom","label","__","autoComplete","spellCheck","value","onChange","newValue","slug","onBlur","event","cleanForSlug","target","className","PostSlug","default"],"sources":["@wordpress/editor/src/components/post-slug/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';\nimport { TextControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport PostSlugCheck from './check';\nimport { store as editorStore } from '../../store';\n\nfunction PostSlugControl() {\n\tconst postSlug = useSelect( ( select ) => {\n\t\treturn safeDecodeURIComponent(\n\t\t\tselect( editorStore ).getEditedPostSlug()\n\t\t);\n\t}, [] );\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ forceEmptyField, setForceEmptyField ] = useState( false );\n\n\treturn (\n\t\t<TextControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Slug' ) }\n\t\t\tautoComplete=\"off\"\n\t\t\tspellCheck=\"false\"\n\t\t\tvalue={ forceEmptyField ? '' : postSlug }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\teditPost( { slug: newValue } );\n\t\t\t\t// When we delete the field the permalink gets\n\t\t\t\t// reverted to the original value.\n\t\t\t\t// The forceEmptyField logic allows the user to have\n\t\t\t\t// the field temporarily empty while typing.\n\t\t\t\tif ( ! newValue ) {\n\t\t\t\t\tif ( ! forceEmptyField ) {\n\t\t\t\t\t\tsetForceEmptyField( true );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tonBlur={ ( event ) => {\n\t\t\t\teditPost( {\n\t\t\t\t\tslug: cleanForSlug( event.target.value ),\n\t\t\t\t} );\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tclassName=\"editor-post-slug\"\n\t\t/>\n\t);\n}\n\nexport default function PostSlug() {\n\treturn (\n\t\t<PostSlugCheck>\n\t\t\t<PostSlugControl />\n\t\t</PostSlugCheck>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAbA;AACA;AACA;;AAOA;AACA;AACA;;AAIA,SAASQ,eAAeA,CAAA,EAAG;EAC1B,MAAMC,QAAQ,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzC,OAAO,IAAAC,2BAAsB,EAC5BD,MAAM,CAAEE,YAAY,CAAC,CAACC,iBAAiB,CAAC,CACzC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAY,CAAC;EAC/C,MAAM,CAAEI,eAAe,EAAEC,kBAAkB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAEjE,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACjB,WAAA,CAAAkB,WAAW;IACXC,uBAAuB;IACvBC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;IACtBC,YAAY,EAAC,KAAK;IAClBC,UAAU,EAAC,OAAO;IAClBC,KAAK,EAAGX,eAAe,GAAG,EAAE,GAAGR,QAAU;IACzCoB,QAAQ,EAAKC,QAAQ,IAAM;MAC1Bf,QAAQ,CAAE;QAAEgB,IAAI,EAA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