@wordpress/editor 14.33.5 → 14.34.1-next.2f1c7c01b.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 (1245) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/api.js +2 -0
  3. package/build/bindings/api.js.map +1 -1
  4. package/build/bindings/pattern-overrides.js +3 -1
  5. package/build/bindings/pattern-overrides.js.map +1 -1
  6. package/build/bindings/post-data.js +4 -2
  7. package/build/bindings/post-data.js.map +1 -1
  8. package/build/bindings/post-meta.js +2 -0
  9. package/build/bindings/post-meta.js.map +1 -1
  10. package/build/bindings/term-data.js +3 -1
  11. package/build/bindings/term-data.js.map +1 -1
  12. package/build/components/autocompleters/index.js +2 -0
  13. package/build/components/autocompleters/index.js.map +1 -1
  14. package/build/components/autocompleters/user.js +3 -1
  15. package/build/components/autocompleters/user.js.map +1 -1
  16. package/build/components/autosave-monitor/index.js +4 -2
  17. package/build/components/autosave-monitor/index.js.map +1 -1
  18. package/build/components/block-removal-warnings/index.js +6 -4
  19. package/build/components/block-removal-warnings/index.js.map +1 -1
  20. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +6 -4
  21. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  22. package/build/components/block-visibility/index.js +5 -3
  23. package/build/components/block-visibility/index.js.map +1 -1
  24. package/build/components/blog-title/index.js +4 -2
  25. package/build/components/blog-title/index.js.map +1 -1
  26. package/build/components/character-count/index.js +2 -0
  27. package/build/components/character-count/index.js.map +1 -1
  28. package/build/components/collab-sidebar/add-comment.js +10 -8
  29. package/build/components/collab-sidebar/add-comment.js.map +2 -2
  30. package/build/components/collab-sidebar/comment-author-info.js +3 -1
  31. package/build/components/collab-sidebar/comment-author-info.js.map +1 -1
  32. package/build/components/collab-sidebar/comment-form.js +3 -1
  33. package/build/components/collab-sidebar/comment-form.js.map +1 -1
  34. package/build/components/collab-sidebar/comment-indicator-toolbar.js +5 -3
  35. package/build/components/collab-sidebar/comment-indicator-toolbar.js.map +1 -1
  36. package/build/components/collab-sidebar/comment-menu-item.js +6 -4
  37. package/build/components/collab-sidebar/comment-menu-item.js.map +1 -1
  38. package/build/components/collab-sidebar/comments.js +40 -31
  39. package/build/components/collab-sidebar/comments.js.map +2 -2
  40. package/build/components/collab-sidebar/constants.js +5 -3
  41. package/build/components/collab-sidebar/constants.js.map +1 -1
  42. package/build/components/collab-sidebar/hooks.js +3 -1
  43. package/build/components/collab-sidebar/hooks.js.map +1 -1
  44. package/build/components/collab-sidebar/index.js +15 -13
  45. package/build/components/collab-sidebar/index.js.map +2 -2
  46. package/build/components/collab-sidebar/utils.js +5 -6
  47. package/build/components/collab-sidebar/utils.js.map +2 -2
  48. package/build/components/collapsible-block-toolbar/index.js +4 -2
  49. package/build/components/collapsible-block-toolbar/index.js.map +1 -1
  50. package/build/components/commands/index.js +6 -4
  51. package/build/components/commands/index.js.map +1 -1
  52. package/build/components/deprecated.js +55 -53
  53. package/build/components/deprecated.js.map +1 -1
  54. package/build/components/document-bar/index.js +20 -5
  55. package/build/components/document-bar/index.js.map +2 -2
  56. package/build/components/document-outline/check.js +2 -0
  57. package/build/components/document-outline/check.js.map +1 -1
  58. package/build/components/document-outline/index.js +9 -7
  59. package/build/components/document-outline/index.js.map +1 -1
  60. package/build/components/document-outline/item.js +4 -2
  61. package/build/components/document-outline/item.js.map +1 -1
  62. package/build/components/document-tools/index.js +3 -1
  63. package/build/components/document-tools/index.js.map +1 -1
  64. package/build/components/editor/index.js +26 -5
  65. package/build/components/editor/index.js.map +3 -3
  66. package/build/components/editor-history/redo.js +3 -1
  67. package/build/components/editor-history/redo.js.map +1 -1
  68. package/build/components/editor-history/undo.js +3 -1
  69. package/build/components/editor-history/undo.js.map +1 -1
  70. package/build/components/editor-interface/index.js +19 -12
  71. package/build/components/editor-interface/index.js.map +3 -3
  72. package/build/components/editor-notices/index.js +3 -1
  73. package/build/components/editor-notices/index.js.map +1 -1
  74. package/build/components/editor-snackbars/index.js +4 -2
  75. package/build/components/editor-snackbars/index.js.map +1 -1
  76. package/build/components/entities-saved-states/entity-record-item.js +3 -1
  77. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  78. package/build/components/entities-saved-states/entity-type-list.js +22 -16
  79. package/build/components/entities-saved-states/entity-type-list.js.map +3 -3
  80. package/build/components/entities-saved-states/hooks/use-is-dirty.js +3 -1
  81. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  82. package/build/components/entities-saved-states/index.js +3 -1
  83. package/build/components/entities-saved-states/index.js.map +1 -1
  84. package/build/components/error-boundary/index.js +5 -3
  85. package/build/components/error-boundary/index.js.map +1 -1
  86. package/build/components/global-keyboard-shortcuts/index.js +2 -0
  87. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  88. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -1
  89. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  90. package/build/components/global-styles/block-link.js +72 -0
  91. package/build/components/global-styles/block-link.js.map +7 -0
  92. package/build/components/global-styles/header.js +56 -0
  93. package/build/components/global-styles/header.js.map +7 -0
  94. package/build/components/global-styles/hooks.js +178 -0
  95. package/build/components/global-styles/hooks.js.map +7 -0
  96. package/build/components/global-styles/index.js +140 -0
  97. package/build/components/global-styles/index.js.map +7 -0
  98. package/build/components/global-styles/menu.js +97 -0
  99. package/build/components/global-styles/menu.js.map +7 -0
  100. package/build/components/global-styles-provider/index.js +5 -49
  101. package/build/components/global-styles-provider/index.js.map +3 -3
  102. package/build/components/global-styles-renderer/index.js +57 -0
  103. package/build/components/global-styles-renderer/index.js.map +7 -0
  104. package/build/components/global-styles-sidebar/default-sidebar.js +68 -0
  105. package/build/components/global-styles-sidebar/default-sidebar.js.map +7 -0
  106. package/build/components/global-styles-sidebar/index.js +184 -0
  107. package/build/components/global-styles-sidebar/index.js.map +7 -0
  108. package/build/components/global-styles-sidebar/welcome-guide-image.js +39 -0
  109. package/build/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
  110. package/build/components/global-styles-sidebar/welcome-guide.js +145 -0
  111. package/build/components/global-styles-sidebar/welcome-guide.js.map +7 -0
  112. package/build/components/header/back-button.js +8 -6
  113. package/build/components/header/back-button.js.map +1 -1
  114. package/build/components/header/index.js +17 -12
  115. package/build/components/header/index.js.map +2 -2
  116. package/build/components/index.js +4 -2
  117. package/build/components/index.js.map +2 -2
  118. package/build/components/inserter-sidebar/index.js +4 -2
  119. package/build/components/inserter-sidebar/index.js.map +1 -1
  120. package/build/components/keyboard-shortcut-help-modal/config.js +3 -1
  121. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  122. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -1
  123. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  124. package/build/components/keyboard-shortcut-help-modal/index.js +7 -5
  125. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  126. package/build/components/keyboard-shortcut-help-modal/shortcut.js +3 -1
  127. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  128. package/build/components/list-view-sidebar/index.js +4 -2
  129. package/build/components/list-view-sidebar/index.js.map +1 -1
  130. package/build/components/list-view-sidebar/list-view-outline.js +3 -1
  131. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  132. package/build/components/local-autosave-monitor/index.js +6 -4
  133. package/build/components/local-autosave-monitor/index.js.map +1 -1
  134. package/build/components/media-categories/index.js +8 -6
  135. package/build/components/media-categories/index.js.map +1 -1
  136. package/build/components/mode-switcher/index.js +4 -2
  137. package/build/components/mode-switcher/index.js.map +1 -1
  138. package/build/components/more-menu/copy-content-menu-item.js +3 -1
  139. package/build/components/more-menu/copy-content-menu-item.js.map +1 -1
  140. package/build/components/more-menu/index.js +3 -1
  141. package/build/components/more-menu/index.js.map +1 -1
  142. package/build/components/more-menu/tools-more-menu-group.js +4 -2
  143. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  144. package/build/components/more-menu/view-more-menu-group.js +4 -2
  145. package/build/components/more-menu/view-more-menu-group.js.map +1 -1
  146. package/build/components/page-attributes/check.js +2 -0
  147. package/build/components/page-attributes/check.js.map +1 -1
  148. package/build/components/page-attributes/order.js +3 -1
  149. package/build/components/page-attributes/order.js.map +1 -1
  150. package/build/components/page-attributes/panel.js +4 -2
  151. package/build/components/page-attributes/panel.js.map +1 -1
  152. package/build/components/page-attributes/parent.js +4 -2
  153. package/build/components/page-attributes/parent.js.map +1 -1
  154. package/build/components/pattern-duplicate-modal/index.js +5 -3
  155. package/build/components/pattern-duplicate-modal/index.js.map +1 -1
  156. package/build/components/pattern-overrides-panel/index.js +4 -2
  157. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  158. package/build/components/pattern-rename-modal/index.js +5 -3
  159. package/build/components/pattern-rename-modal/index.js.map +1 -1
  160. package/build/components/plugin-document-setting-panel/index.js +5 -3
  161. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  162. package/build/components/plugin-more-menu-item/index.js +3 -1
  163. package/build/components/plugin-more-menu-item/index.js.map +1 -1
  164. package/build/components/plugin-post-publish-panel/index.js +5 -3
  165. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  166. package/build/components/plugin-post-status-info/index.js +5 -3
  167. package/build/components/plugin-post-status-info/index.js.map +1 -1
  168. package/build/components/plugin-pre-publish-panel/index.js +5 -3
  169. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  170. package/build/components/plugin-preview-menu-item/index.js +3 -1
  171. package/build/components/plugin-preview-menu-item/index.js.map +1 -1
  172. package/build/components/plugin-sidebar/index.js +3 -1
  173. package/build/components/plugin-sidebar/index.js.map +1 -1
  174. package/build/components/plugin-sidebar-more-menu-item/index.js +3 -1
  175. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  176. package/build/components/post-actions/actions.js +3 -1
  177. package/build/components/post-actions/actions.js.map +1 -1
  178. package/build/components/post-actions/index.js +4 -2
  179. package/build/components/post-actions/index.js.map +1 -1
  180. package/build/components/post-actions/set-as-homepage.js +5 -3
  181. package/build/components/post-actions/set-as-homepage.js.map +1 -1
  182. package/build/components/post-actions/set-as-posts-page.js +5 -3
  183. package/build/components/post-actions/set-as-posts-page.js.map +1 -1
  184. package/build/components/post-author/check.js +3 -1
  185. package/build/components/post-author/check.js.map +1 -1
  186. package/build/components/post-author/combobox.js +3 -1
  187. package/build/components/post-author/combobox.js.map +1 -1
  188. package/build/components/post-author/constants.js +4 -2
  189. package/build/components/post-author/constants.js.map +1 -1
  190. package/build/components/post-author/hook.js +2 -0
  191. package/build/components/post-author/hook.js.map +1 -1
  192. package/build/components/post-author/index.js +4 -2
  193. package/build/components/post-author/index.js.map +1 -1
  194. package/build/components/post-author/panel.js +3 -1
  195. package/build/components/post-author/panel.js.map +1 -1
  196. package/build/components/post-author/select.js +3 -1
  197. package/build/components/post-author/select.js.map +1 -1
  198. package/build/components/post-card-panel/index.js +4 -2
  199. package/build/components/post-card-panel/index.js.map +1 -1
  200. package/build/components/post-comments/index.js +4 -2
  201. package/build/components/post-comments/index.js.map +1 -1
  202. package/build/components/post-content-information/index.js +4 -2
  203. package/build/components/post-content-information/index.js.map +1 -1
  204. package/build/components/post-discussion/panel.js +4 -2
  205. package/build/components/post-discussion/panel.js.map +1 -1
  206. package/build/components/post-excerpt/check.js +3 -1
  207. package/build/components/post-excerpt/check.js.map +1 -1
  208. package/build/components/post-excerpt/index.js +3 -1
  209. package/build/components/post-excerpt/index.js.map +1 -1
  210. package/build/components/post-excerpt/panel.js +4 -2
  211. package/build/components/post-excerpt/panel.js.map +1 -1
  212. package/build/components/post-excerpt/plugin.js +5 -3
  213. package/build/components/post-excerpt/plugin.js.map +1 -1
  214. package/build/components/post-featured-image/check.js +3 -1
  215. package/build/components/post-featured-image/check.js.map +1 -1
  216. package/build/components/post-featured-image/index.js +41 -8
  217. package/build/components/post-featured-image/index.js.map +3 -3
  218. package/build/components/post-featured-image/panel.js +4 -2
  219. package/build/components/post-featured-image/panel.js.map +1 -1
  220. package/build/components/post-fields/index.js +2 -0
  221. package/build/components/post-fields/index.js.map +1 -1
  222. package/build/components/post-format/check.js +3 -1
  223. package/build/components/post-format/check.js.map +1 -1
  224. package/build/components/post-format/index.js +4 -2
  225. package/build/components/post-format/index.js.map +1 -1
  226. package/build/components/post-format/panel.js +3 -1
  227. package/build/components/post-format/panel.js.map +1 -1
  228. package/build/components/post-last-edited-panel/index.js +3 -1
  229. package/build/components/post-last-edited-panel/index.js.map +1 -1
  230. package/build/components/post-last-revision/check.js +3 -1
  231. package/build/components/post-last-revision/check.js.map +1 -1
  232. package/build/components/post-last-revision/index.js +3 -1
  233. package/build/components/post-last-revision/index.js.map +1 -1
  234. package/build/components/post-last-revision/panel.js +3 -1
  235. package/build/components/post-last-revision/panel.js.map +1 -1
  236. package/build/components/post-locked-modal/index.js +3 -1
  237. package/build/components/post-locked-modal/index.js.map +1 -1
  238. package/build/components/post-panel-row/index.js +4 -2
  239. package/build/components/post-panel-row/index.js.map +1 -1
  240. package/build/components/post-panel-section/index.js +3 -1
  241. package/build/components/post-panel-section/index.js.map +1 -1
  242. package/build/components/post-pending-status/check.js +2 -0
  243. package/build/components/post-pending-status/check.js.map +1 -1
  244. package/build/components/post-pending-status/index.js +3 -1
  245. package/build/components/post-pending-status/index.js.map +1 -1
  246. package/build/components/post-pingbacks/index.js +3 -1
  247. package/build/components/post-pingbacks/index.js.map +1 -1
  248. package/build/components/post-preview-button/index.js +3 -1
  249. package/build/components/post-preview-button/index.js.map +1 -1
  250. package/build/components/post-publish-button/index.js +6 -4
  251. package/build/components/post-publish-button/index.js.map +1 -1
  252. package/build/components/post-publish-button/label.js +2 -0
  253. package/build/components/post-publish-button/label.js.map +1 -1
  254. package/build/components/post-publish-button/post-publish-button-or-toggle.js +5 -3
  255. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  256. package/build/components/post-publish-panel/index.js +5 -3
  257. package/build/components/post-publish-panel/index.js.map +1 -1
  258. package/build/components/post-publish-panel/maybe-category-panel.js +3 -1
  259. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  260. package/build/components/post-publish-panel/maybe-post-format-panel.js +5 -3
  261. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  262. package/build/components/post-publish-panel/maybe-tags-panel.js +5 -3
  263. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  264. package/build/components/post-publish-panel/maybe-upload-media.js +3 -1
  265. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  266. package/build/components/post-publish-panel/media-util.js +2 -0
  267. package/build/components/post-publish-panel/media-util.js.map +1 -1
  268. package/build/components/post-publish-panel/postpublish.js +6 -4
  269. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  270. package/build/components/post-publish-panel/prepublish.js +3 -1
  271. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  272. package/build/components/post-saved-state/index.js +3 -1
  273. package/build/components/post-saved-state/index.js.map +1 -1
  274. package/build/components/post-schedule/check.js +2 -0
  275. package/build/components/post-schedule/check.js.map +1 -1
  276. package/build/components/post-schedule/index.js +4 -2
  277. package/build/components/post-schedule/index.js.map +1 -1
  278. package/build/components/post-schedule/label.js +2 -0
  279. package/build/components/post-schedule/label.js.map +1 -1
  280. package/build/components/post-schedule/panel.js +4 -2
  281. package/build/components/post-schedule/panel.js.map +1 -1
  282. package/build/components/post-status/index.js +6 -4
  283. package/build/components/post-status/index.js.map +1 -1
  284. package/build/components/post-sticky/check.js +2 -0
  285. package/build/components/post-sticky/check.js.map +1 -1
  286. package/build/components/post-sticky/index.js +3 -1
  287. package/build/components/post-sticky/index.js.map +1 -1
  288. package/build/components/post-sticky/panel.js +3 -1
  289. package/build/components/post-sticky/panel.js.map +1 -1
  290. package/build/components/post-switch-to-draft-button/index.js +3 -1
  291. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  292. package/build/components/post-sync-status/index.js +3 -1
  293. package/build/components/post-sync-status/index.js.map +1 -1
  294. package/build/components/post-taxonomies/check.js +2 -0
  295. package/build/components/post-taxonomies/check.js.map +1 -1
  296. package/build/components/post-taxonomies/flat-term-selector.js +9 -7
  297. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  298. package/build/components/post-taxonomies/hierarchical-term-selector.js +8 -6
  299. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  300. package/build/components/post-taxonomies/index.js +4 -2
  301. package/build/components/post-taxonomies/index.js.map +1 -1
  302. package/build/components/post-taxonomies/most-used-terms.js +5 -3
  303. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  304. package/build/components/post-taxonomies/panel.js +3 -1
  305. package/build/components/post-taxonomies/panel.js.map +1 -1
  306. package/build/components/post-template/block-theme.js +3 -1
  307. package/build/components/post-template/block-theme.js.map +1 -1
  308. package/build/components/post-template/classic-theme.js +3 -1
  309. package/build/components/post-template/classic-theme.js.map +1 -1
  310. package/build/components/post-template/create-new-template-modal.js +4 -2
  311. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  312. package/build/components/post-template/create-new-template.js +3 -1
  313. package/build/components/post-template/create-new-template.js.map +1 -1
  314. package/build/components/post-template/hooks.js +2 -0
  315. package/build/components/post-template/hooks.js.map +1 -1
  316. package/build/components/post-template/panel.js +3 -1
  317. package/build/components/post-template/panel.js.map +1 -1
  318. package/build/components/post-template/reset-default-template.js +3 -1
  319. package/build/components/post-template/reset-default-template.js.map +1 -1
  320. package/build/components/post-template/swap-template-button.js +3 -1
  321. package/build/components/post-template/swap-template-button.js.map +1 -1
  322. package/build/components/post-text-editor/index.js +3 -1
  323. package/build/components/post-text-editor/index.js.map +1 -1
  324. package/build/components/post-title/constants.js +4 -2
  325. package/build/components/post-title/constants.js.map +1 -1
  326. package/build/components/post-title/index.js +7 -5
  327. package/build/components/post-title/index.js.map +1 -1
  328. package/build/components/post-title/post-title-raw.js +3 -1
  329. package/build/components/post-title/post-title-raw.js.map +1 -1
  330. package/build/components/post-title/use-post-title-focus.js +2 -0
  331. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  332. package/build/components/post-title/use-post-title.js +2 -0
  333. package/build/components/post-title/use-post-title.js.map +1 -1
  334. package/build/components/post-transform-panel/hooks.js +3 -1
  335. package/build/components/post-transform-panel/hooks.js.map +1 -1
  336. package/build/components/post-transform-panel/index.js +3 -1
  337. package/build/components/post-transform-panel/index.js.map +1 -1
  338. package/build/components/post-trash/check.js +2 -0
  339. package/build/components/post-trash/check.js.map +1 -1
  340. package/build/components/post-trash/index.js +3 -1
  341. package/build/components/post-trash/index.js.map +1 -1
  342. package/build/components/post-type-support-check/index.js +2 -0
  343. package/build/components/post-type-support-check/index.js.map +1 -1
  344. package/build/components/post-url/check.js +2 -0
  345. package/build/components/post-url/check.js.map +1 -1
  346. package/build/components/post-url/index.js +3 -1
  347. package/build/components/post-url/index.js.map +1 -1
  348. package/build/components/post-url/label.js +2 -0
  349. package/build/components/post-url/label.js.map +1 -1
  350. package/build/components/post-url/panel.js +3 -1
  351. package/build/components/post-url/panel.js.map +1 -1
  352. package/build/components/post-view-link/index.js +3 -1
  353. package/build/components/post-view-link/index.js.map +1 -1
  354. package/build/components/post-visibility/check.js +2 -0
  355. package/build/components/post-visibility/check.js.map +1 -1
  356. package/build/components/post-visibility/index.js +3 -1
  357. package/build/components/post-visibility/index.js.map +1 -1
  358. package/build/components/post-visibility/label.js +2 -0
  359. package/build/components/post-visibility/label.js.map +1 -1
  360. package/build/components/post-visibility/utils.js +3 -1
  361. package/build/components/post-visibility/utils.js.map +1 -1
  362. package/build/components/posts-per-page/index.js +3 -1
  363. package/build/components/posts-per-page/index.js.map +1 -1
  364. package/build/components/preferences-modal/enable-panel.js +4 -2
  365. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  366. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +5 -3
  367. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  368. package/build/components/preferences-modal/enable-publish-sidebar.js +4 -2
  369. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  370. package/build/components/preferences-modal/index.js +5 -3
  371. package/build/components/preferences-modal/index.js.map +2 -2
  372. package/build/components/preview-dropdown/index.js +3 -1
  373. package/build/components/preview-dropdown/index.js.map +1 -1
  374. package/build/components/provider/disable-non-page-content-blocks.js +2 -0
  375. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  376. package/build/components/provider/index.js +8 -8
  377. package/build/components/provider/index.js.map +3 -3
  378. package/build/components/provider/navigation-block-editing-mode.js +2 -0
  379. package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
  380. package/build/components/provider/use-auto-switch-editor-sidebars.js +2 -0
  381. package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -1
  382. package/build/components/provider/use-block-editor-settings.js +5 -3
  383. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  384. package/build/components/provider/use-hide-blocks-from-inserter.js +3 -1
  385. package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  386. package/build/components/provider/use-post-content-blocks.js +3 -1
  387. package/build/components/provider/use-post-content-blocks.js.map +1 -1
  388. package/build/components/provider/with-registry-provider.js +4 -2
  389. package/build/components/provider/with-registry-provider.js.map +1 -1
  390. package/build/components/resizable-editor/index.js +4 -2
  391. package/build/components/resizable-editor/index.js.map +1 -1
  392. package/build/components/resizable-editor/resize-handle.js +4 -2
  393. package/build/components/resizable-editor/resize-handle.js.map +1 -1
  394. package/build/components/save-publish-panels/index.js +5 -3
  395. package/build/components/save-publish-panels/index.js.map +1 -1
  396. package/build/components/sidebar/constants.js +3 -1
  397. package/build/components/sidebar/constants.js.map +1 -1
  398. package/build/components/sidebar/header.js +5 -3
  399. package/build/components/sidebar/header.js.map +1 -1
  400. package/build/components/sidebar/index.js +7 -5
  401. package/build/components/sidebar/index.js.map +1 -1
  402. package/build/components/sidebar/post-summary.js +4 -2
  403. package/build/components/sidebar/post-summary.js.map +1 -1
  404. package/build/components/site-discussion/index.js +4 -2
  405. package/build/components/site-discussion/index.js.map +1 -1
  406. package/build/components/start-page-options/index.js +7 -6
  407. package/build/components/start-page-options/index.js.map +2 -2
  408. package/build/components/start-template-options/index.js +3 -1
  409. package/build/components/start-template-options/index.js.map +1 -1
  410. package/build/components/style-book/categories.js +88 -0
  411. package/build/components/style-book/categories.js.map +7 -0
  412. package/build/components/style-book/color-examples.js +66 -0
  413. package/build/components/style-book/color-examples.js.map +7 -0
  414. package/build/components/style-book/constants.js +321 -0
  415. package/build/components/style-book/constants.js.map +7 -0
  416. package/build/components/style-book/duotone-examples.js +70 -0
  417. package/build/components/style-book/duotone-examples.js.map +7 -0
  418. package/build/components/style-book/examples.js +239 -0
  419. package/build/components/style-book/examples.js.map +7 -0
  420. package/build/components/style-book/index.js +629 -0
  421. package/build/components/style-book/index.js.map +7 -0
  422. package/build/components/style-book/types.js +19 -0
  423. package/build/components/style-book/types.js.map +7 -0
  424. package/build/components/styles-canvas/index.js +140 -0
  425. package/build/components/styles-canvas/index.js.map +7 -0
  426. package/build/components/styles-canvas/revisions.js +123 -0
  427. package/build/components/styles-canvas/revisions.js.map +7 -0
  428. package/build/components/styles-canvas/style-book.js +70 -0
  429. package/build/components/styles-canvas/style-book.js.map +7 -0
  430. package/build/components/table-of-contents/index.js +3 -1
  431. package/build/components/table-of-contents/index.js.map +1 -1
  432. package/build/components/table-of-contents/panel.js +3 -1
  433. package/build/components/table-of-contents/panel.js.map +1 -1
  434. package/build/components/template-content-panel/index.js +6 -4
  435. package/build/components/template-content-panel/index.js.map +1 -1
  436. package/build/components/template-part-content-panel/index.js +4 -2
  437. package/build/components/template-part-content-panel/index.js.map +1 -1
  438. package/build/components/template-part-menu-items/convert-to-regular.js +3 -1
  439. package/build/components/template-part-menu-items/convert-to-regular.js.map +1 -1
  440. package/build/components/template-part-menu-items/convert-to-template-part.js +3 -1
  441. package/build/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
  442. package/build/components/template-part-menu-items/index.js +3 -1
  443. package/build/components/template-part-menu-items/index.js.map +1 -1
  444. package/build/components/template-validation-notice/index.js +3 -1
  445. package/build/components/template-validation-notice/index.js.map +1 -1
  446. package/build/components/text-editor/index.js +3 -1
  447. package/build/components/text-editor/index.js.map +1 -1
  448. package/build/components/theme-support-check/index.js +2 -0
  449. package/build/components/theme-support-check/index.js.map +1 -1
  450. package/build/components/time-to-read/index.js +4 -2
  451. package/build/components/time-to-read/index.js.map +1 -1
  452. package/build/components/unsaved-changes-warning/index.js +2 -0
  453. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  454. package/build/components/visual-editor/edit-template-blocks-notification.js +3 -1
  455. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  456. package/build/components/visual-editor/index.js +7 -4
  457. package/build/components/visual-editor/index.js.map +2 -2
  458. package/build/components/visual-editor/use-select-nearest-editable-block.js +3 -1
  459. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  460. package/build/components/visual-editor/use-zoom-out-mode-exit.js +2 -0
  461. package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -1
  462. package/build/components/word-count/index.js +3 -1
  463. package/build/components/word-count/index.js.map +1 -1
  464. package/build/components/zoom-out-toggle/index.js +4 -2
  465. package/build/components/zoom-out-toggle/index.js.map +1 -1
  466. package/build/dataviews/api.js +2 -0
  467. package/build/dataviews/api.js.map +1 -1
  468. package/build/dataviews/fields/content-preview/content-preview-view.js +4 -2
  469. package/build/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
  470. package/build/dataviews/fields/content-preview/index.js +3 -1
  471. package/build/dataviews/fields/content-preview/index.js.map +1 -1
  472. package/build/dataviews/store/private-actions.js +3 -1
  473. package/build/dataviews/store/private-actions.js.map +1 -1
  474. package/build/dataviews/store/private-selectors.js +3 -1
  475. package/build/dataviews/store/private-selectors.js.map +1 -1
  476. package/build/dataviews/store/reducer.js +2 -0
  477. package/build/dataviews/store/reducer.js.map +1 -1
  478. package/build/hooks/custom-sources-backwards-compatibility.js +4 -2
  479. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  480. package/build/hooks/default-autocompleters.js +2 -0
  481. package/build/hooks/default-autocompleters.js.map +1 -1
  482. package/build/hooks/index.js +3 -0
  483. package/build/hooks/index.js.map +2 -2
  484. package/build/hooks/media-upload.js +17 -4
  485. package/build/hooks/media-upload.js.map +3 -3
  486. package/build/hooks/navigation-link-view-button.js +5 -3
  487. package/build/hooks/navigation-link-view-button.js.map +1 -1
  488. package/build/hooks/pattern-overrides.js +5 -3
  489. package/build/hooks/pattern-overrides.js.map +1 -1
  490. package/build/hooks/push-changes-to-global-styles/index.js +324 -0
  491. package/build/hooks/push-changes-to-global-styles/index.js.map +7 -0
  492. package/build/hooks/template-part-navigation-edit-button.js +7 -5
  493. package/build/hooks/template-part-navigation-edit-button.js.map +1 -1
  494. package/build/hooks/use-global-styles-output.js +76 -0
  495. package/build/hooks/use-global-styles-output.js.map +7 -0
  496. package/build/index.js +2 -0
  497. package/build/index.js.map +1 -1
  498. package/build/lock-unlock.js +3 -1
  499. package/build/lock-unlock.js.map +1 -1
  500. package/build/private-apis.js +14 -7
  501. package/build/private-apis.js.map +3 -3
  502. package/build/store/actions.js +53 -51
  503. package/build/store/actions.js.map +1 -1
  504. package/build/store/constants.js +15 -13
  505. package/build/store/constants.js.map +1 -1
  506. package/build/store/defaults.js +3 -1
  507. package/build/store/defaults.js.map +1 -1
  508. package/build/store/index.js +4 -2
  509. package/build/store/index.js.map +1 -1
  510. package/build/store/local-autosave.js +2 -0
  511. package/build/store/local-autosave.js.map +1 -1
  512. package/build/store/private-actions.js +32 -7
  513. package/build/store/private-actions.js.map +2 -2
  514. package/build/store/private-selectors.js +20 -8
  515. package/build/store/private-selectors.js.map +2 -2
  516. package/build/store/reducer.js +26 -0
  517. package/build/store/reducer.js.map +2 -2
  518. package/build/store/selectors.js +80 -78
  519. package/build/store/selectors.js.map +2 -2
  520. package/build/store/utils/is-template-revertable.js +2 -0
  521. package/build/store/utils/is-template-revertable.js.map +1 -1
  522. package/build/store/utils/notice-builder.js +2 -0
  523. package/build/store/utils/notice-builder.js.map +1 -1
  524. package/build/utils/get-item-title.js +2 -0
  525. package/build/utils/get-item-title.js.map +1 -1
  526. package/build/utils/get-template-info.js +4 -2
  527. package/build/utils/get-template-info.js.map +1 -1
  528. package/build/utils/get-template-part-icon.js +2 -0
  529. package/build/utils/get-template-part-icon.js.map +1 -1
  530. package/build/utils/index.js +2 -0
  531. package/build/utils/index.js.map +1 -1
  532. package/build/utils/media-sideload/index.js +3 -1
  533. package/build/utils/media-sideload/index.js.map +1 -1
  534. package/build/utils/media-upload/index.js +3 -1
  535. package/build/utils/media-upload/index.js.map +1 -1
  536. package/build/utils/pageTypeBadge.js +2 -0
  537. package/build/utils/pageTypeBadge.js.map +1 -1
  538. package/build/utils/search-templates.js +2 -0
  539. package/build/utils/search-templates.js.map +1 -1
  540. package/build/{components/editor-interface/content-slot-fill.js → utils/set-nested-value.js} +26 -10
  541. package/build/utils/set-nested-value.js.map +7 -0
  542. package/build/utils/terms.js +5 -3
  543. package/build/utils/terms.js.map +1 -1
  544. package/build/utils/url.js +2 -0
  545. package/build/utils/url.js.map +1 -1
  546. package/build-module/bindings/api.js +1 -0
  547. package/build-module/bindings/api.js.map +1 -1
  548. package/build-module/bindings/pattern-overrides.js +2 -1
  549. package/build-module/bindings/pattern-overrides.js.map +1 -1
  550. package/build-module/bindings/post-data.js +3 -2
  551. package/build-module/bindings/post-data.js.map +1 -1
  552. package/build-module/bindings/post-meta.js +1 -0
  553. package/build-module/bindings/post-meta.js.map +1 -1
  554. package/build-module/bindings/term-data.js +2 -1
  555. package/build-module/bindings/term-data.js.map +1 -1
  556. package/build-module/components/autocompleters/index.js +1 -0
  557. package/build-module/components/autocompleters/index.js.map +1 -1
  558. package/build-module/components/autocompleters/user.js +2 -1
  559. package/build-module/components/autocompleters/user.js.map +1 -1
  560. package/build-module/components/autosave-monitor/index.js +3 -2
  561. package/build-module/components/autosave-monitor/index.js.map +1 -1
  562. package/build-module/components/block-removal-warnings/index.js +5 -4
  563. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  564. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +5 -4
  565. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  566. package/build-module/components/block-visibility/index.js +4 -3
  567. package/build-module/components/block-visibility/index.js.map +1 -1
  568. package/build-module/components/blog-title/index.js +3 -2
  569. package/build-module/components/blog-title/index.js.map +1 -1
  570. package/build-module/components/character-count/index.js +1 -0
  571. package/build-module/components/character-count/index.js.map +1 -1
  572. package/build-module/components/collab-sidebar/add-comment.js +9 -8
  573. package/build-module/components/collab-sidebar/add-comment.js.map +2 -2
  574. package/build-module/components/collab-sidebar/comment-author-info.js +2 -1
  575. package/build-module/components/collab-sidebar/comment-author-info.js.map +1 -1
  576. package/build-module/components/collab-sidebar/comment-form.js +2 -1
  577. package/build-module/components/collab-sidebar/comment-form.js.map +1 -1
  578. package/build-module/components/collab-sidebar/comment-indicator-toolbar.js +4 -3
  579. package/build-module/components/collab-sidebar/comment-indicator-toolbar.js.map +1 -1
  580. package/build-module/components/collab-sidebar/comment-menu-item.js +5 -4
  581. package/build-module/components/collab-sidebar/comment-menu-item.js.map +1 -1
  582. package/build-module/components/collab-sidebar/comments.js +39 -31
  583. package/build-module/components/collab-sidebar/comments.js.map +2 -2
  584. package/build-module/components/collab-sidebar/constants.js +4 -3
  585. package/build-module/components/collab-sidebar/constants.js.map +1 -1
  586. package/build-module/components/collab-sidebar/hooks.js +2 -1
  587. package/build-module/components/collab-sidebar/hooks.js.map +1 -1
  588. package/build-module/components/collab-sidebar/index.js +14 -13
  589. package/build-module/components/collab-sidebar/index.js.map +2 -2
  590. package/build-module/components/collab-sidebar/utils.js +4 -6
  591. package/build-module/components/collab-sidebar/utils.js.map +2 -2
  592. package/build-module/components/collapsible-block-toolbar/index.js +3 -2
  593. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  594. package/build-module/components/commands/index.js +5 -4
  595. package/build-module/components/commands/index.js.map +1 -1
  596. package/build-module/components/deprecated.js +54 -53
  597. package/build-module/components/deprecated.js.map +1 -1
  598. package/build-module/components/document-bar/index.js +19 -5
  599. package/build-module/components/document-bar/index.js.map +2 -2
  600. package/build-module/components/document-outline/check.js +1 -0
  601. package/build-module/components/document-outline/check.js.map +1 -1
  602. package/build-module/components/document-outline/index.js +8 -7
  603. package/build-module/components/document-outline/index.js.map +1 -1
  604. package/build-module/components/document-outline/item.js +3 -2
  605. package/build-module/components/document-outline/item.js.map +1 -1
  606. package/build-module/components/document-tools/index.js +2 -1
  607. package/build-module/components/document-tools/index.js.map +1 -1
  608. package/build-module/components/editor/index.js +25 -5
  609. package/build-module/components/editor/index.js.map +2 -2
  610. package/build-module/components/editor-history/redo.js +2 -1
  611. package/build-module/components/editor-history/redo.js.map +1 -1
  612. package/build-module/components/editor-history/undo.js +2 -1
  613. package/build-module/components/editor-history/undo.js.map +1 -1
  614. package/build-module/components/editor-interface/index.js +18 -12
  615. package/build-module/components/editor-interface/index.js.map +2 -2
  616. package/build-module/components/editor-notices/index.js +2 -1
  617. package/build-module/components/editor-notices/index.js.map +1 -1
  618. package/build-module/components/editor-snackbars/index.js +3 -2
  619. package/build-module/components/editor-snackbars/index.js.map +1 -1
  620. package/build-module/components/entities-saved-states/entity-record-item.js +2 -1
  621. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  622. package/build-module/components/entities-saved-states/entity-type-list.js +20 -15
  623. package/build-module/components/entities-saved-states/entity-type-list.js.map +2 -2
  624. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +2 -1
  625. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  626. package/build-module/components/entities-saved-states/index.js +2 -1
  627. package/build-module/components/entities-saved-states/index.js.map +1 -1
  628. package/build-module/components/error-boundary/index.js +4 -3
  629. package/build-module/components/error-boundary/index.js.map +1 -1
  630. package/build-module/components/global-keyboard-shortcuts/index.js +1 -0
  631. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  632. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +2 -1
  633. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  634. package/build-module/components/global-styles/block-link.js +47 -0
  635. package/build-module/components/global-styles/block-link.js.map +7 -0
  636. package/build-module/components/global-styles/header.js +42 -0
  637. package/build-module/components/global-styles/header.js.map +7 -0
  638. package/build-module/components/global-styles/hooks.js +155 -0
  639. package/build-module/components/global-styles/hooks.js.map +7 -0
  640. package/build-module/components/global-styles/index.js +113 -0
  641. package/build-module/components/global-styles/index.js.map +7 -0
  642. package/build-module/components/global-styles/menu.js +72 -0
  643. package/build-module/components/global-styles/menu.js.map +7 -0
  644. package/build-module/components/global-styles-provider/index.js +4 -37
  645. package/build-module/components/global-styles-provider/index.js.map +2 -2
  646. package/build-module/components/global-styles-renderer/index.js +32 -0
  647. package/build-module/components/global-styles-renderer/index.js.map +7 -0
  648. package/build-module/components/global-styles-sidebar/default-sidebar.js +50 -0
  649. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +7 -0
  650. package/build-module/components/global-styles-sidebar/index.js +153 -0
  651. package/build-module/components/global-styles-sidebar/index.js.map +7 -0
  652. package/build-module/components/global-styles-sidebar/welcome-guide-image.js +18 -0
  653. package/build-module/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
  654. package/build-module/components/global-styles-sidebar/welcome-guide.js +114 -0
  655. package/build-module/components/global-styles-sidebar/welcome-guide.js.map +7 -0
  656. package/build-module/components/header/back-button.js +7 -6
  657. package/build-module/components/header/back-button.js.map +1 -1
  658. package/build-module/components/header/index.js +16 -12
  659. package/build-module/components/header/index.js.map +2 -2
  660. package/build-module/components/index.js +3 -2
  661. package/build-module/components/index.js.map +1 -1
  662. package/build-module/components/inserter-sidebar/index.js +3 -2
  663. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  664. package/build-module/components/keyboard-shortcut-help-modal/config.js +2 -1
  665. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  666. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -1
  667. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  668. package/build-module/components/keyboard-shortcut-help-modal/index.js +6 -5
  669. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  670. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +5 -4
  671. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  672. package/build-module/components/list-view-sidebar/index.js +3 -2
  673. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  674. package/build-module/components/list-view-sidebar/list-view-outline.js +2 -1
  675. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  676. package/build-module/components/local-autosave-monitor/index.js +5 -4
  677. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  678. package/build-module/components/media-categories/index.js +7 -6
  679. package/build-module/components/media-categories/index.js.map +1 -1
  680. package/build-module/components/mode-switcher/index.js +3 -2
  681. package/build-module/components/mode-switcher/index.js.map +1 -1
  682. package/build-module/components/more-menu/copy-content-menu-item.js +2 -1
  683. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -1
  684. package/build-module/components/more-menu/index.js +2 -1
  685. package/build-module/components/more-menu/index.js.map +1 -1
  686. package/build-module/components/more-menu/tools-more-menu-group.js +3 -2
  687. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  688. package/build-module/components/more-menu/view-more-menu-group.js +3 -2
  689. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -1
  690. package/build-module/components/page-attributes/check.js +1 -0
  691. package/build-module/components/page-attributes/check.js.map +1 -1
  692. package/build-module/components/page-attributes/order.js +2 -1
  693. package/build-module/components/page-attributes/order.js.map +1 -1
  694. package/build-module/components/page-attributes/panel.js +3 -2
  695. package/build-module/components/page-attributes/panel.js.map +1 -1
  696. package/build-module/components/page-attributes/parent.js +3 -2
  697. package/build-module/components/page-attributes/parent.js.map +1 -1
  698. package/build-module/components/pattern-duplicate-modal/index.js +4 -3
  699. package/build-module/components/pattern-duplicate-modal/index.js.map +1 -1
  700. package/build-module/components/pattern-overrides-panel/index.js +3 -2
  701. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  702. package/build-module/components/pattern-rename-modal/index.js +4 -3
  703. package/build-module/components/pattern-rename-modal/index.js.map +1 -1
  704. package/build-module/components/plugin-document-setting-panel/index.js +4 -3
  705. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  706. package/build-module/components/plugin-more-menu-item/index.js +2 -1
  707. package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
  708. package/build-module/components/plugin-post-publish-panel/index.js +4 -3
  709. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  710. package/build-module/components/plugin-post-status-info/index.js +4 -3
  711. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  712. package/build-module/components/plugin-pre-publish-panel/index.js +4 -3
  713. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  714. package/build-module/components/plugin-preview-menu-item/index.js +2 -1
  715. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
  716. package/build-module/components/plugin-sidebar/index.js +2 -1
  717. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  718. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -1
  719. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  720. package/build-module/components/post-actions/actions.js +2 -1
  721. package/build-module/components/post-actions/actions.js.map +1 -1
  722. package/build-module/components/post-actions/index.js +3 -2
  723. package/build-module/components/post-actions/index.js.map +1 -1
  724. package/build-module/components/post-actions/set-as-homepage.js +4 -3
  725. package/build-module/components/post-actions/set-as-homepage.js.map +1 -1
  726. package/build-module/components/post-actions/set-as-posts-page.js +4 -3
  727. package/build-module/components/post-actions/set-as-posts-page.js.map +1 -1
  728. package/build-module/components/post-author/check.js +2 -1
  729. package/build-module/components/post-author/check.js.map +1 -1
  730. package/build-module/components/post-author/combobox.js +2 -1
  731. package/build-module/components/post-author/combobox.js.map +1 -1
  732. package/build-module/components/post-author/constants.js +3 -2
  733. package/build-module/components/post-author/constants.js.map +1 -1
  734. package/build-module/components/post-author/hook.js +1 -0
  735. package/build-module/components/post-author/hook.js.map +1 -1
  736. package/build-module/components/post-author/index.js +3 -2
  737. package/build-module/components/post-author/index.js.map +1 -1
  738. package/build-module/components/post-author/panel.js +2 -1
  739. package/build-module/components/post-author/panel.js.map +1 -1
  740. package/build-module/components/post-author/select.js +2 -1
  741. package/build-module/components/post-author/select.js.map +1 -1
  742. package/build-module/components/post-card-panel/index.js +3 -2
  743. package/build-module/components/post-card-panel/index.js.map +1 -1
  744. package/build-module/components/post-comments/index.js +3 -2
  745. package/build-module/components/post-comments/index.js.map +1 -1
  746. package/build-module/components/post-content-information/index.js +3 -2
  747. package/build-module/components/post-content-information/index.js.map +1 -1
  748. package/build-module/components/post-discussion/panel.js +3 -2
  749. package/build-module/components/post-discussion/panel.js.map +1 -1
  750. package/build-module/components/post-excerpt/check.js +2 -1
  751. package/build-module/components/post-excerpt/check.js.map +1 -1
  752. package/build-module/components/post-excerpt/index.js +2 -1
  753. package/build-module/components/post-excerpt/index.js.map +1 -1
  754. package/build-module/components/post-excerpt/panel.js +3 -2
  755. package/build-module/components/post-excerpt/panel.js.map +1 -1
  756. package/build-module/components/post-excerpt/plugin.js +4 -3
  757. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  758. package/build-module/components/post-featured-image/check.js +2 -1
  759. package/build-module/components/post-featured-image/check.js.map +1 -1
  760. package/build-module/components/post-featured-image/index.js +42 -9
  761. package/build-module/components/post-featured-image/index.js.map +2 -2
  762. package/build-module/components/post-featured-image/panel.js +3 -2
  763. package/build-module/components/post-featured-image/panel.js.map +1 -1
  764. package/build-module/components/post-fields/index.js +1 -0
  765. package/build-module/components/post-fields/index.js.map +1 -1
  766. package/build-module/components/post-format/check.js +2 -1
  767. package/build-module/components/post-format/check.js.map +1 -1
  768. package/build-module/components/post-format/index.js +3 -2
  769. package/build-module/components/post-format/index.js.map +1 -1
  770. package/build-module/components/post-format/panel.js +2 -1
  771. package/build-module/components/post-format/panel.js.map +1 -1
  772. package/build-module/components/post-last-edited-panel/index.js +2 -1
  773. package/build-module/components/post-last-edited-panel/index.js.map +1 -1
  774. package/build-module/components/post-last-revision/check.js +2 -1
  775. package/build-module/components/post-last-revision/check.js.map +1 -1
  776. package/build-module/components/post-last-revision/index.js +2 -1
  777. package/build-module/components/post-last-revision/index.js.map +1 -1
  778. package/build-module/components/post-last-revision/panel.js +2 -1
  779. package/build-module/components/post-last-revision/panel.js.map +1 -1
  780. package/build-module/components/post-locked-modal/index.js +2 -1
  781. package/build-module/components/post-locked-modal/index.js.map +1 -1
  782. package/build-module/components/post-panel-row/index.js +3 -2
  783. package/build-module/components/post-panel-row/index.js.map +1 -1
  784. package/build-module/components/post-panel-section/index.js +2 -1
  785. package/build-module/components/post-panel-section/index.js.map +1 -1
  786. package/build-module/components/post-pending-status/check.js +1 -0
  787. package/build-module/components/post-pending-status/check.js.map +1 -1
  788. package/build-module/components/post-pending-status/index.js +2 -1
  789. package/build-module/components/post-pending-status/index.js.map +1 -1
  790. package/build-module/components/post-pingbacks/index.js +2 -1
  791. package/build-module/components/post-pingbacks/index.js.map +1 -1
  792. package/build-module/components/post-preview-button/index.js +2 -1
  793. package/build-module/components/post-preview-button/index.js.map +1 -1
  794. package/build-module/components/post-publish-button/index.js +5 -4
  795. package/build-module/components/post-publish-button/index.js.map +1 -1
  796. package/build-module/components/post-publish-button/label.js +1 -0
  797. package/build-module/components/post-publish-button/label.js.map +1 -1
  798. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +4 -3
  799. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  800. package/build-module/components/post-publish-panel/index.js +4 -3
  801. package/build-module/components/post-publish-panel/index.js.map +1 -1
  802. package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -1
  803. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  804. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +4 -3
  805. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  806. package/build-module/components/post-publish-panel/maybe-tags-panel.js +4 -3
  807. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  808. package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -1
  809. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  810. package/build-module/components/post-publish-panel/media-util.js +1 -0
  811. package/build-module/components/post-publish-panel/media-util.js.map +1 -1
  812. package/build-module/components/post-publish-panel/postpublish.js +5 -4
  813. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  814. package/build-module/components/post-publish-panel/prepublish.js +2 -1
  815. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  816. package/build-module/components/post-saved-state/index.js +2 -1
  817. package/build-module/components/post-saved-state/index.js.map +1 -1
  818. package/build-module/components/post-schedule/check.js +1 -0
  819. package/build-module/components/post-schedule/check.js.map +1 -1
  820. package/build-module/components/post-schedule/index.js +3 -2
  821. package/build-module/components/post-schedule/index.js.map +1 -1
  822. package/build-module/components/post-schedule/label.js +1 -0
  823. package/build-module/components/post-schedule/label.js.map +1 -1
  824. package/build-module/components/post-schedule/panel.js +3 -2
  825. package/build-module/components/post-schedule/panel.js.map +1 -1
  826. package/build-module/components/post-status/index.js +5 -4
  827. package/build-module/components/post-status/index.js.map +1 -1
  828. package/build-module/components/post-sticky/check.js +1 -0
  829. package/build-module/components/post-sticky/check.js.map +1 -1
  830. package/build-module/components/post-sticky/index.js +2 -1
  831. package/build-module/components/post-sticky/index.js.map +1 -1
  832. package/build-module/components/post-sticky/panel.js +2 -1
  833. package/build-module/components/post-sticky/panel.js.map +1 -1
  834. package/build-module/components/post-switch-to-draft-button/index.js +2 -1
  835. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  836. package/build-module/components/post-sync-status/index.js +2 -1
  837. package/build-module/components/post-sync-status/index.js.map +1 -1
  838. package/build-module/components/post-taxonomies/check.js +1 -0
  839. package/build-module/components/post-taxonomies/check.js.map +1 -1
  840. package/build-module/components/post-taxonomies/flat-term-selector.js +8 -7
  841. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  842. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +7 -6
  843. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  844. package/build-module/components/post-taxonomies/index.js +3 -2
  845. package/build-module/components/post-taxonomies/index.js.map +1 -1
  846. package/build-module/components/post-taxonomies/most-used-terms.js +4 -3
  847. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  848. package/build-module/components/post-taxonomies/panel.js +2 -1
  849. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  850. package/build-module/components/post-template/block-theme.js +2 -1
  851. package/build-module/components/post-template/block-theme.js.map +1 -1
  852. package/build-module/components/post-template/classic-theme.js +2 -1
  853. package/build-module/components/post-template/classic-theme.js.map +1 -1
  854. package/build-module/components/post-template/create-new-template-modal.js +3 -2
  855. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  856. package/build-module/components/post-template/create-new-template.js +2 -1
  857. package/build-module/components/post-template/create-new-template.js.map +1 -1
  858. package/build-module/components/post-template/hooks.js +1 -0
  859. package/build-module/components/post-template/hooks.js.map +1 -1
  860. package/build-module/components/post-template/panel.js +2 -1
  861. package/build-module/components/post-template/panel.js.map +1 -1
  862. package/build-module/components/post-template/reset-default-template.js +2 -1
  863. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  864. package/build-module/components/post-template/swap-template-button.js +2 -1
  865. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  866. package/build-module/components/post-text-editor/index.js +2 -1
  867. package/build-module/components/post-text-editor/index.js.map +1 -1
  868. package/build-module/components/post-title/constants.js +3 -2
  869. package/build-module/components/post-title/constants.js.map +1 -1
  870. package/build-module/components/post-title/index.js +3 -2
  871. package/build-module/components/post-title/index.js.map +1 -1
  872. package/build-module/components/post-title/post-title-raw.js +2 -1
  873. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  874. package/build-module/components/post-title/use-post-title-focus.js +1 -0
  875. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  876. package/build-module/components/post-title/use-post-title.js +1 -0
  877. package/build-module/components/post-title/use-post-title.js.map +1 -1
  878. package/build-module/components/post-transform-panel/hooks.js +2 -1
  879. package/build-module/components/post-transform-panel/hooks.js.map +1 -1
  880. package/build-module/components/post-transform-panel/index.js +2 -1
  881. package/build-module/components/post-transform-panel/index.js.map +1 -1
  882. package/build-module/components/post-trash/check.js +1 -0
  883. package/build-module/components/post-trash/check.js.map +1 -1
  884. package/build-module/components/post-trash/index.js +2 -1
  885. package/build-module/components/post-trash/index.js.map +1 -1
  886. package/build-module/components/post-type-support-check/index.js +1 -0
  887. package/build-module/components/post-type-support-check/index.js.map +1 -1
  888. package/build-module/components/post-url/check.js +1 -0
  889. package/build-module/components/post-url/check.js.map +1 -1
  890. package/build-module/components/post-url/index.js +2 -1
  891. package/build-module/components/post-url/index.js.map +1 -1
  892. package/build-module/components/post-url/label.js +1 -0
  893. package/build-module/components/post-url/label.js.map +1 -1
  894. package/build-module/components/post-url/panel.js +2 -1
  895. package/build-module/components/post-url/panel.js.map +1 -1
  896. package/build-module/components/post-view-link/index.js +2 -1
  897. package/build-module/components/post-view-link/index.js.map +1 -1
  898. package/build-module/components/post-visibility/check.js +1 -0
  899. package/build-module/components/post-visibility/check.js.map +1 -1
  900. package/build-module/components/post-visibility/index.js +2 -1
  901. package/build-module/components/post-visibility/index.js.map +1 -1
  902. package/build-module/components/post-visibility/label.js +1 -0
  903. package/build-module/components/post-visibility/label.js.map +1 -1
  904. package/build-module/components/post-visibility/utils.js +2 -1
  905. package/build-module/components/post-visibility/utils.js.map +1 -1
  906. package/build-module/components/posts-per-page/index.js +2 -1
  907. package/build-module/components/posts-per-page/index.js.map +1 -1
  908. package/build-module/components/preferences-modal/enable-panel.js +3 -2
  909. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  910. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +4 -3
  911. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  912. package/build-module/components/preferences-modal/enable-publish-sidebar.js +3 -2
  913. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  914. package/build-module/components/preferences-modal/index.js +4 -3
  915. package/build-module/components/preferences-modal/index.js.map +2 -2
  916. package/build-module/components/preview-dropdown/index.js +2 -1
  917. package/build-module/components/preview-dropdown/index.js.map +1 -1
  918. package/build-module/components/provider/disable-non-page-content-blocks.js +1 -0
  919. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  920. package/build-module/components/provider/index.js +7 -8
  921. package/build-module/components/provider/index.js.map +2 -2
  922. package/build-module/components/provider/navigation-block-editing-mode.js +1 -0
  923. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
  924. package/build-module/components/provider/use-auto-switch-editor-sidebars.js +1 -0
  925. package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -1
  926. package/build-module/components/provider/use-block-editor-settings.js +4 -3
  927. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  928. package/build-module/components/provider/use-hide-blocks-from-inserter.js +2 -1
  929. package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  930. package/build-module/components/provider/use-post-content-blocks.js +2 -1
  931. package/build-module/components/provider/use-post-content-blocks.js.map +1 -1
  932. package/build-module/components/provider/with-registry-provider.js +3 -2
  933. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  934. package/build-module/components/resizable-editor/index.js +3 -2
  935. package/build-module/components/resizable-editor/index.js.map +1 -1
  936. package/build-module/components/resizable-editor/resize-handle.js +3 -2
  937. package/build-module/components/resizable-editor/resize-handle.js.map +1 -1
  938. package/build-module/components/save-publish-panels/index.js +4 -3
  939. package/build-module/components/save-publish-panels/index.js.map +1 -1
  940. package/build-module/components/sidebar/constants.js +2 -1
  941. package/build-module/components/sidebar/constants.js.map +1 -1
  942. package/build-module/components/sidebar/header.js +4 -3
  943. package/build-module/components/sidebar/header.js.map +1 -1
  944. package/build-module/components/sidebar/index.js +6 -5
  945. package/build-module/components/sidebar/index.js.map +1 -1
  946. package/build-module/components/sidebar/post-summary.js +3 -2
  947. package/build-module/components/sidebar/post-summary.js.map +1 -1
  948. package/build-module/components/site-discussion/index.js +3 -2
  949. package/build-module/components/site-discussion/index.js.map +1 -1
  950. package/build-module/components/start-page-options/index.js +7 -7
  951. package/build-module/components/start-page-options/index.js.map +2 -2
  952. package/build-module/components/start-template-options/index.js +2 -1
  953. package/build-module/components/start-template-options/index.js.map +1 -1
  954. package/build-module/components/style-book/categories.js +65 -0
  955. package/build-module/components/style-book/categories.js.map +7 -0
  956. package/build-module/components/style-book/color-examples.js +38 -0
  957. package/build-module/components/style-book/color-examples.js.map +7 -0
  958. package/build-module/components/style-book/constants.js +291 -0
  959. package/build-module/components/style-book/constants.js.map +7 -0
  960. package/build-module/components/style-book/duotone-examples.js +49 -0
  961. package/build-module/components/style-book/duotone-examples.js.map +7 -0
  962. package/build-module/components/style-book/examples.js +209 -0
  963. package/build-module/components/style-book/examples.js.map +7 -0
  964. package/build-module/components/style-book/index.js +619 -0
  965. package/build-module/components/style-book/index.js.map +7 -0
  966. package/build-module/components/style-book/types.js +1 -0
  967. package/build-module/components/style-book/types.js.map +7 -0
  968. package/build-module/components/styles-canvas/index.js +105 -0
  969. package/build-module/components/styles-canvas/index.js.map +7 -0
  970. package/build-module/components/styles-canvas/revisions.js +108 -0
  971. package/build-module/components/styles-canvas/revisions.js.map +7 -0
  972. package/build-module/components/styles-canvas/style-book.js +39 -0
  973. package/build-module/components/styles-canvas/style-book.js.map +7 -0
  974. package/build-module/components/table-of-contents/index.js +2 -1
  975. package/build-module/components/table-of-contents/index.js.map +1 -1
  976. package/build-module/components/table-of-contents/panel.js +2 -1
  977. package/build-module/components/table-of-contents/panel.js.map +1 -1
  978. package/build-module/components/template-content-panel/index.js +5 -4
  979. package/build-module/components/template-content-panel/index.js.map +1 -1
  980. package/build-module/components/template-part-content-panel/index.js +3 -2
  981. package/build-module/components/template-part-content-panel/index.js.map +1 -1
  982. package/build-module/components/template-part-menu-items/convert-to-regular.js +2 -1
  983. package/build-module/components/template-part-menu-items/convert-to-regular.js.map +1 -1
  984. package/build-module/components/template-part-menu-items/convert-to-template-part.js +2 -1
  985. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
  986. package/build-module/components/template-part-menu-items/index.js +2 -1
  987. package/build-module/components/template-part-menu-items/index.js.map +1 -1
  988. package/build-module/components/template-validation-notice/index.js +2 -1
  989. package/build-module/components/template-validation-notice/index.js.map +1 -1
  990. package/build-module/components/text-editor/index.js +2 -1
  991. package/build-module/components/text-editor/index.js.map +1 -1
  992. package/build-module/components/theme-support-check/index.js +1 -0
  993. package/build-module/components/theme-support-check/index.js.map +1 -1
  994. package/build-module/components/time-to-read/index.js +3 -2
  995. package/build-module/components/time-to-read/index.js.map +1 -1
  996. package/build-module/components/unsaved-changes-warning/index.js +1 -0
  997. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  998. package/build-module/components/visual-editor/edit-template-blocks-notification.js +2 -1
  999. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  1000. package/build-module/components/visual-editor/index.js +6 -4
  1001. package/build-module/components/visual-editor/index.js.map +2 -2
  1002. package/build-module/components/visual-editor/use-select-nearest-editable-block.js +2 -1
  1003. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  1004. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +1 -0
  1005. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -1
  1006. package/build-module/components/word-count/index.js +2 -1
  1007. package/build-module/components/word-count/index.js.map +1 -1
  1008. package/build-module/components/zoom-out-toggle/index.js +3 -2
  1009. package/build-module/components/zoom-out-toggle/index.js.map +1 -1
  1010. package/build-module/dataviews/api.js +1 -0
  1011. package/build-module/dataviews/api.js.map +1 -1
  1012. package/build-module/dataviews/fields/content-preview/content-preview-view.js +3 -2
  1013. package/build-module/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
  1014. package/build-module/dataviews/fields/content-preview/index.js +2 -1
  1015. package/build-module/dataviews/fields/content-preview/index.js.map +1 -1
  1016. package/build-module/dataviews/store/private-actions.js +2 -1
  1017. package/build-module/dataviews/store/private-actions.js.map +1 -1
  1018. package/build-module/dataviews/store/private-selectors.js +2 -1
  1019. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  1020. package/build-module/dataviews/store/reducer.js +1 -0
  1021. package/build-module/dataviews/store/reducer.js.map +1 -1
  1022. package/build-module/hooks/custom-sources-backwards-compatibility.js +3 -2
  1023. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  1024. package/build-module/hooks/default-autocompleters.js +1 -0
  1025. package/build-module/hooks/default-autocompleters.js.map +1 -1
  1026. package/build-module/hooks/index.js +2 -0
  1027. package/build-module/hooks/index.js.map +2 -2
  1028. package/build-module/hooks/media-upload.js +20 -5
  1029. package/build-module/hooks/media-upload.js.map +2 -2
  1030. package/build-module/hooks/navigation-link-view-button.js +4 -3
  1031. package/build-module/hooks/navigation-link-view-button.js.map +1 -1
  1032. package/build-module/hooks/pattern-overrides.js +4 -3
  1033. package/build-module/hooks/pattern-overrides.js.map +1 -1
  1034. package/build-module/hooks/push-changes-to-global-styles/index.js +310 -0
  1035. package/build-module/hooks/push-changes-to-global-styles/index.js.map +7 -0
  1036. package/build-module/hooks/template-part-navigation-edit-button.js +6 -5
  1037. package/build-module/hooks/template-part-navigation-edit-button.js.map +1 -1
  1038. package/build-module/hooks/use-global-styles-output.js +50 -0
  1039. package/build-module/hooks/use-global-styles-output.js.map +7 -0
  1040. package/build-module/index.js +1 -0
  1041. package/build-module/index.js.map +1 -1
  1042. package/build-module/lock-unlock.js +2 -1
  1043. package/build-module/lock-unlock.js.map +1 -1
  1044. package/build-module/private-apis.js +13 -10
  1045. package/build-module/private-apis.js.map +2 -2
  1046. package/build-module/store/actions.js +52 -51
  1047. package/build-module/store/actions.js.map +1 -1
  1048. package/build-module/store/constants.js +14 -13
  1049. package/build-module/store/constants.js.map +1 -1
  1050. package/build-module/store/defaults.js +2 -1
  1051. package/build-module/store/defaults.js.map +1 -1
  1052. package/build-module/store/index.js +3 -2
  1053. package/build-module/store/index.js.map +1 -1
  1054. package/build-module/store/local-autosave.js +1 -0
  1055. package/build-module/store/local-autosave.js.map +1 -1
  1056. package/build-module/store/private-actions.js +28 -7
  1057. package/build-module/store/private-actions.js.map +2 -2
  1058. package/build-module/store/private-selectors.js +17 -8
  1059. package/build-module/store/private-selectors.js.map +2 -2
  1060. package/build-module/store/reducer.js +23 -0
  1061. package/build-module/store/reducer.js.map +2 -2
  1062. package/build-module/store/selectors.js +79 -78
  1063. package/build-module/store/selectors.js.map +2 -2
  1064. package/build-module/store/utils/is-template-revertable.js +1 -0
  1065. package/build-module/store/utils/is-template-revertable.js.map +1 -1
  1066. package/build-module/store/utils/notice-builder.js +1 -0
  1067. package/build-module/store/utils/notice-builder.js.map +1 -1
  1068. package/build-module/utils/get-item-title.js +1 -0
  1069. package/build-module/utils/get-item-title.js.map +1 -1
  1070. package/build-module/utils/get-template-info.js +3 -2
  1071. package/build-module/utils/get-template-info.js.map +1 -1
  1072. package/build-module/utils/get-template-part-icon.js +1 -0
  1073. package/build-module/utils/get-template-part-icon.js.map +1 -1
  1074. package/build-module/utils/index.js +1 -0
  1075. package/build-module/utils/index.js.map +1 -1
  1076. package/build-module/utils/media-sideload/index.js +2 -1
  1077. package/build-module/utils/media-sideload/index.js.map +1 -1
  1078. package/build-module/utils/media-upload/index.js +2 -1
  1079. package/build-module/utils/media-upload/index.js.map +1 -1
  1080. package/build-module/utils/pageTypeBadge.js +1 -0
  1081. package/build-module/utils/pageTypeBadge.js.map +1 -1
  1082. package/build-module/utils/search-templates.js +1 -0
  1083. package/build-module/utils/search-templates.js.map +1 -1
  1084. package/build-module/utils/set-nested-value.js +24 -0
  1085. package/build-module/utils/set-nested-value.js.map +7 -0
  1086. package/build-module/utils/terms.js +4 -3
  1087. package/build-module/utils/terms.js.map +1 -1
  1088. package/build-module/utils/url.js +1 -0
  1089. package/build-module/utils/url.js.map +1 -1
  1090. package/build-style/style-rtl.css +3020 -13
  1091. package/build-style/style.css +3021 -13
  1092. package/build-types/components/collab-sidebar/add-comment.d.ts +3 -3
  1093. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
  1094. package/build-types/components/collab-sidebar/comments.d.ts +3 -3
  1095. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  1096. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  1097. package/build-types/components/collab-sidebar/utils.d.ts +2 -2
  1098. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  1099. package/build-types/components/document-bar/index.d.ts +2 -2
  1100. package/build-types/components/document-bar/index.d.ts.map +1 -1
  1101. package/build-types/components/editor/index.d.ts.map +1 -1
  1102. package/build-types/components/editor-interface/index.d.ts +1 -3
  1103. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  1104. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
  1105. package/build-types/components/global-styles/block-link.d.ts +12 -0
  1106. package/build-types/components/global-styles/block-link.d.ts.map +1 -0
  1107. package/build-types/components/global-styles/header.d.ts +7 -0
  1108. package/build-types/components/global-styles/header.d.ts.map +1 -0
  1109. package/build-types/components/global-styles/hooks.d.ts +24 -0
  1110. package/build-types/components/global-styles/hooks.d.ts.map +1 -0
  1111. package/build-types/components/global-styles/index.d.ts +6 -0
  1112. package/build-types/components/global-styles/index.d.ts.map +1 -0
  1113. package/build-types/components/global-styles/menu.d.ts +13 -0
  1114. package/build-types/components/global-styles/menu.d.ts.map +1 -0
  1115. package/build-types/components/global-styles-provider/index.d.ts +1 -5
  1116. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  1117. package/build-types/components/global-styles-renderer/index.d.ts +4 -0
  1118. package/build-types/components/global-styles-renderer/index.d.ts.map +1 -0
  1119. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts +13 -0
  1120. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts.map +1 -0
  1121. package/build-types/components/global-styles-sidebar/index.d.ts +2 -0
  1122. package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -0
  1123. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts +5 -0
  1124. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts.map +1 -0
  1125. package/build-types/components/global-styles-sidebar/welcome-guide.d.ts +2 -0
  1126. package/build-types/components/global-styles-sidebar/welcome-guide.d.ts.map +1 -0
  1127. package/build-types/components/header/index.d.ts +1 -3
  1128. package/build-types/components/header/index.d.ts.map +1 -1
  1129. package/build-types/components/provider/index.d.ts.map +1 -1
  1130. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  1131. package/build-types/components/style-book/categories.d.ts +18 -0
  1132. package/build-types/components/style-book/categories.d.ts.map +1 -0
  1133. package/build-types/components/style-book/color-examples.d.ts +7 -0
  1134. package/build-types/components/style-book/color-examples.d.ts.map +1 -0
  1135. package/build-types/components/style-book/constants.d.ts +11 -0
  1136. package/build-types/components/style-book/constants.d.ts.map +1 -0
  1137. package/build-types/components/style-book/duotone-examples.d.ts +9 -0
  1138. package/build-types/components/style-book/duotone-examples.d.ts.map +1 -0
  1139. package/build-types/components/style-book/examples.d.ts +12 -0
  1140. package/build-types/components/style-book/examples.d.ts.map +1 -0
  1141. package/build-types/components/style-book/index.d.ts +31 -0
  1142. package/build-types/components/style-book/index.d.ts.map +1 -0
  1143. package/build-types/components/style-book/types.d.ts +72 -0
  1144. package/build-types/components/style-book/types.d.ts.map +1 -0
  1145. package/build-types/components/styles-canvas/index.d.ts +16 -0
  1146. package/build-types/components/styles-canvas/index.d.ts.map +1 -0
  1147. package/build-types/components/styles-canvas/revisions.d.ts +5 -0
  1148. package/build-types/components/styles-canvas/revisions.d.ts.map +1 -0
  1149. package/build-types/components/styles-canvas/style-book.d.ts +6 -0
  1150. package/build-types/components/styles-canvas/style-book.d.ts.map +1 -0
  1151. package/build-types/components/visual-editor/index.d.ts +1 -2
  1152. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  1153. package/build-types/dataviews/fields/content-preview/content-preview-view.d.ts.map +1 -1
  1154. package/build-types/hooks/push-changes-to-global-styles/index.d.ts +2 -0
  1155. package/build-types/hooks/push-changes-to-global-styles/index.d.ts.map +1 -0
  1156. package/build-types/hooks/use-global-styles-output.d.ts +18 -0
  1157. package/build-types/hooks/use-global-styles-output.d.ts.map +1 -0
  1158. package/build-types/private-apis.d.ts.map +1 -1
  1159. package/build-types/store/private-actions.d.ts +20 -0
  1160. package/build-types/store/private-actions.d.ts.map +1 -1
  1161. package/build-types/store/private-selectors.d.ts +14 -0
  1162. package/build-types/store/private-selectors.d.ts.map +1 -1
  1163. package/build-types/store/reducer.d.ts +20 -0
  1164. package/build-types/store/reducer.d.ts.map +1 -1
  1165. package/build-types/store/selectors.d.ts.map +1 -1
  1166. package/build-types/utils/set-nested-value.d.ts +20 -0
  1167. package/build-types/utils/set-nested-value.d.ts.map +1 -0
  1168. package/package.json +40 -40
  1169. package/src/components/collab-sidebar/add-comment.js +10 -6
  1170. package/src/components/collab-sidebar/comments.js +42 -28
  1171. package/src/components/collab-sidebar/index.js +14 -12
  1172. package/src/components/collab-sidebar/style.scss +2 -1
  1173. package/src/components/collab-sidebar/utils.js +3 -12
  1174. package/src/components/document-bar/index.js +18 -3
  1175. package/src/components/editor/index.js +25 -1
  1176. package/src/components/editor-help/style.scss +1 -1
  1177. package/src/components/editor-interface/index.js +40 -39
  1178. package/src/components/entities-saved-states/entity-type-list.js +19 -17
  1179. package/src/components/global-styles/block-link.js +65 -0
  1180. package/src/components/global-styles/header.js +48 -0
  1181. package/src/components/global-styles/hooks.js +216 -0
  1182. package/src/components/global-styles/index.js +125 -0
  1183. package/src/components/global-styles/menu.js +101 -0
  1184. package/src/components/global-styles/style.scss +11 -0
  1185. package/src/components/global-styles-provider/index.js +3 -45
  1186. package/src/components/global-styles-renderer/index.js +39 -0
  1187. package/src/components/global-styles-sidebar/default-sidebar.js +46 -0
  1188. package/src/components/global-styles-sidebar/index.js +177 -0
  1189. package/src/components/global-styles-sidebar/style.scss +119 -0
  1190. package/src/components/global-styles-sidebar/welcome-guide-image.js +11 -0
  1191. package/src/components/global-styles-sidebar/welcome-guide.js +136 -0
  1192. package/src/components/header/index.js +11 -6
  1193. package/src/components/post-featured-image/index.js +44 -1
  1194. package/src/components/post-last-revision/style.scss +1 -1
  1195. package/src/components/post-panel-row/style.scss +1 -0
  1196. package/src/components/post-publish-panel/style.scss +1 -1
  1197. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  1198. package/src/components/preferences-modal/index.js +1 -1
  1199. package/src/components/provider/index.js +0 -2
  1200. package/src/components/start-page-options/index.js +5 -6
  1201. package/src/components/start-page-options/style.scss +1 -1
  1202. package/src/components/style-book/categories.ts +97 -0
  1203. package/src/components/style-book/color-examples.tsx +56 -0
  1204. package/src/components/style-book/constants.ts +308 -0
  1205. package/src/components/style-book/duotone-examples.tsx +56 -0
  1206. package/src/components/style-book/examples.tsx +273 -0
  1207. package/src/components/style-book/index.js +794 -0
  1208. package/src/components/style-book/style.scss +44 -0
  1209. package/src/components/style-book/test/categories.js +166 -0
  1210. package/src/components/style-book/types.ts +80 -0
  1211. package/src/components/styles-canvas/index.js +126 -0
  1212. package/src/components/styles-canvas/revisions.js +144 -0
  1213. package/src/components/styles-canvas/style-book.js +57 -0
  1214. package/src/components/styles-canvas/style.scss +40 -0
  1215. package/src/components/visual-editor/index.js +2 -1
  1216. package/src/dataviews/fields/content-preview/content-preview-view.tsx +2 -0
  1217. package/src/hooks/index.js +1 -0
  1218. package/src/hooks/media-upload.js +25 -5
  1219. package/src/hooks/push-changes-to-global-styles/index.js +391 -0
  1220. package/src/hooks/push-changes-to-global-styles/style.scss +4 -0
  1221. package/src/hooks/use-global-styles-output.js +76 -0
  1222. package/src/private-apis.js +10 -8
  1223. package/src/store/private-actions.js +37 -0
  1224. package/src/store/private-selectors.js +20 -0
  1225. package/src/store/reducer.js +36 -0
  1226. package/src/store/selectors.js +0 -2
  1227. package/src/style.scss +7 -1
  1228. package/src/utils/set-nested-value.js +39 -0
  1229. package/tsconfig.json +3 -0
  1230. package/tsconfig.tsbuildinfo +1 -1
  1231. package/build/components/block-settings-menu/content-only-settings-menu.js +0 -186
  1232. package/build/components/block-settings-menu/content-only-settings-menu.js.map +0 -7
  1233. package/build/components/editor-interface/content-slot-fill.js.map +0 -7
  1234. package/build-module/components/block-settings-menu/content-only-settings-menu.js +0 -161
  1235. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +0 -7
  1236. package/build-module/components/editor-interface/content-slot-fill.js +0 -9
  1237. package/build-module/components/editor-interface/content-slot-fill.js.map +0 -7
  1238. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts +0 -2
  1239. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +0 -1
  1240. package/build-types/components/editor-interface/content-slot-fill.d.ts +0 -14
  1241. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +0 -1
  1242. package/src/components/block-settings-menu/content-only-settings-menu.js +0 -185
  1243. package/src/components/block-settings-menu/content-only-settings-menu.native.js +0 -4
  1244. package/src/components/block-settings-menu/style.scss +0 -6
  1245. package/src/components/editor-interface/content-slot-fill.js +0 -10
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-button/post-publish-button-or-toggle.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from './index';\nimport { store as editorStore } from '../../store';\n\nconst IS_TOGGLE = 'toggle';\nconst IS_BUTTON = 'button';\n\nexport default function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\tsetEntitiesSavedStatesCallback,\n} ) {\n\tlet component;\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tconst { togglePublishSidebar } = useDispatch( editorStore );\n\tconst {\n\t\thasPublishAction,\n\t\tisBeingScheduled,\n\t\tisPending,\n\t\tisPublished,\n\t\tisPublishSidebarEnabled,\n\t\tisPublishSidebarOpened,\n\t\tisScheduled,\n\t\tpostStatus,\n\t\tpostStatusHasChanged,\n\t} = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\t!! select( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t\t'wp:action-publish'\n\t\t\t\t],\n\t\t\tisBeingScheduled:\n\t\t\t\tselect( editorStore ).isEditedPostBeingScheduled(),\n\t\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled:\n\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t\t\tpostStatus:\n\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t\tpostStatusHasChanged: select( editorStore ).getPostEdits()?.status,\n\t\t};\n\t}, [] );\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - post status has changed explicitly to something different than 'future' or 'publish'\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport || isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n"],
5
- "mappings": "AA2FE;AAxFF,SAAS,wBAAwB;AACjC,SAAS,aAAa,iBAAiB;AAKvC,OAAO,uBAAuB;AAC9B,SAAS,SAAS,mBAAmB;AAErC,MAAM,YAAY;AAClB,MAAM,YAAY;AAEH,SAAR,0BAA4C;AAAA,EAClD;AAAA,EACA;AACD,GAAI;AACH,MAAI;AACJ,QAAM,8BAA8B,iBAAkB,UAAU,GAAI;AACpE,QAAM,EAAE,qBAAqB,IAAI,YAAa,WAAY;AAC1D,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,WAAO;AAAA,MACN,kBACC,CAAC,CAAE,OAAQ,WAAY,EAAE,eAAe,GAAG,SAC1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AAC5B,WAAO;AAAA,MACN,kBACC,CAAC,CAAE,OAAQ,WAAY,EAAE,eAAe,GAAG,SAC1C,mBACD;AAAA,MACD,kBACC,OAAQ,WAAY,EAAE,2BAA2B;AAAA,MAClD,WAAW,OAAQ,WAAY,EAAE,qBAAqB;AAAA,MACtD,aAAa,OAAQ,WAAY,EAAE,uBAAuB;AAAA,MAC1D,yBACC,OAAQ,WAAY,EAAE,wBAAwB;AAAA,MAC/C,wBACC,OAAQ,WAAY,EAAE,uBAAuB;AAAA,MAC9C,aAAa,OAAQ,WAAY,EAAE,uBAAuB;AAAA,MAC1D,YACC,OAAQ,WAAY,EAAE,uBAAwB,QAAS;AAAA,MACxD,sBAAsB,OAAQ,WAAY,EAAE,aAAa,GAAG;AAAA,IAC7D;AAAA,EACD,GAAG,CAAC,CAAE;AAyBN,MACC,eACE,wBACD,CAAE,CAAE,UAAU,SAAU,EAAE,SAAU,UAAW,KAC9C,eAAe,oBACf,aAAa,CAAE,oBAAoB,CAAE,6BACtC;AACD,gBAAY;AAAA,EACb,WAAY,+BAA+B,yBAA0B;AACpE,gBAAY;AAAA,EACb,OAAO;AACN,gBAAY;AAAA,EACb;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,QAAS;AAAA,MACT,UAAW,cAAc;AAAA,MACzB,UAAW;AAAA,MACX;AAAA;AAAA,EACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-publish-panel/index.js
2
2
  import { __ } from "@wordpress/i18n";
3
3
  import { Component, createRef } from "@wordpress/element";
4
4
  import {
@@ -16,7 +16,8 @@ import PostPublishButton from "../post-publish-button";
16
16
  import PostPublishPanelPrepublish from "./prepublish";
17
17
  import PostPublishPanelPostpublish from "./postpublish";
18
18
  import { store as editorStore } from "../../store";
19
- class PostPublishPanel extends Component {
19
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
20
+ var PostPublishPanel = class extends Component {
20
21
  constructor() {
21
22
  super(...arguments);
22
23
  this.onSubmit = this.onSubmit.bind(this);
@@ -112,7 +113,7 @@ class PostPublishPanel extends Component {
112
113
  ) })
113
114
  ] });
114
115
  }
115
- }
116
+ };
116
117
  var post_publish_panel_default = compose([
117
118
  withSelect((select) => {
118
119
  const { getPostType } = select(coreStore);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-panel/index.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport {\n\tButton,\n\tSpinner,\n\tCheckboxControl,\n\twithFocusReturn,\n\twithConstrainedTabbing,\n} from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { closeSmall } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from '../post-publish-button';\nimport PostPublishPanelPrepublish from './prepublish';\nimport PostPublishPanelPostpublish from './postpublish';\nimport { store as editorStore } from '../../store';\n\nexport class PostPublishPanel extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.onSubmit = this.onSubmit.bind( this );\n\t\tthis.cancelButtonNode = createRef();\n\t}\n\n\tcomponentDidMount() {\n\t\t// This timeout is necessary to make sure the `useEffect` hook of\n\t\t// `useFocusReturn` gets the correct element (the button that opens the\n\t\t// PostPublishPanel) otherwise it will get this button.\n\t\tthis.timeoutID = setTimeout( () => {\n\t\t\tthis.cancelButtonNode.current.focus();\n\t\t}, 0 );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timeoutID );\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Automatically collapse the publish sidebar when a post\n\t\t// is published and the user makes an edit.\n\t\tif (\n\t\t\t( prevProps.isPublished &&\n\t\t\t\t! this.props.isSaving &&\n\t\t\t\tthis.props.isDirty ) ||\n\t\t\tthis.props.currentPostId !== prevProps.currentPostId\n\t\t) {\n\t\t\tthis.props.onClose();\n\t\t}\n\t}\n\n\tonSubmit() {\n\t\tconst { onClose, hasPublishAction, isPostTypeViewable } = this.props;\n\t\tif ( ! hasPublishAction || ! isPostTypeViewable ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\tisBeingScheduled,\n\t\t\tisPublished,\n\t\t\tisPublishSidebarEnabled,\n\t\t\tisScheduled,\n\t\t\tisSaving,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tonClose,\n\t\t\tonTogglePublishSidebar,\n\t\t\tPostPublishExtension,\n\t\t\tPrePublishExtension,\n\t\t\tcurrentPostId,\n\t\t\t...additionalProps\n\t\t} = this.props;\n\t\tconst {\n\t\t\thasPublishAction,\n\t\t\tisDirty,\n\t\t\tisPostTypeViewable,\n\t\t\t...propsForPanel\n\t\t} = additionalProps;\n\t\tconst isPublishedOrScheduled =\n\t\t\tisPublished || ( isScheduled && isBeingScheduled );\n\t\tconst isPrePublish = ! isPublishedOrScheduled && ! isSaving;\n\t\tconst isPostPublish = isPublishedOrScheduled && ! isSaving;\n\t\treturn (\n\t\t\t<div className=\"editor-post-publish-panel\" { ...propsForPanel }>\n\t\t\t\t<div className=\"editor-post-publish-panel__header\">\n\t\t\t\t\t{ isPostPublish ? (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-cancel-button\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tref={ this.cancelButtonNode }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ isSavingNonPostEntityChanges }\n\t\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-publish-button\">\n\t\t\t\t\t\t\t\t<PostPublishButton\n\t\t\t\t\t\t\t\t\tonSubmit={ this.onSubmit }\n\t\t\t\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__content\">\n\t\t\t\t\t{ isPrePublish && (\n\t\t\t\t\t\t<PostPublishPanelPrepublish>\n\t\t\t\t\t\t\t{ PrePublishExtension && <PrePublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPrepublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isPostPublish && (\n\t\t\t\t\t\t<PostPublishPanelPostpublish focusOnMount>\n\t\t\t\t\t\t\t{ PostPublishExtension && <PostPublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPostpublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isSaving && <Spinner /> }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__footer\">\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Always show pre-publish checks.' ) }\n\t\t\t\t\t\tchecked={ isPublishSidebarEnabled }\n\t\t\t\t\t\tonChange={ onTogglePublishSidebar }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\n/**\n * Renders a panel for publishing a post.\n */\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst {\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditedPostAttribute,\n\t\t\tisCurrentPostPublished,\n\t\t\tisCurrentPostScheduled,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisEditedPostDirty,\n\t\t\tisAutosavingPost,\n\t\t\tisSavingPost,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\tconst { isPublishSidebarEnabled } = select( editorStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPostTypeViewable: postType?.viewable,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled: isPublishSidebarEnabled(),\n\t\t\tisSaving: isSavingPost() && ! isAutosavingPost(),\n\t\t\tisSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\tcurrentPostId: getCurrentPostId(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { isPublishSidebarEnabled } ) => {\n\t\tconst { disablePublishSidebar, enablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonTogglePublishSidebar: () => {\n\t\t\t\tif ( isPublishSidebarEnabled ) {\n\t\t\t\t\tdisablePublishSidebar();\n\t\t\t\t} else {\n\t\t\t\t\tenablePublishSidebar();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t} ),\n\twithFocusReturn,\n\twithConstrainedTabbing,\n] )( PostPublishPanel );\n"],
5
- "mappings": "AA+FM,SAOA,UAPA,KAOA,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uB;AAAA,MACpC,yBAAyB,wBAAwB;AAAA,MACjD,UAAU,aAAa,KAAK,CAAE,iBAAiB;AAAA,MAC/C,8BAA8B,6BAA6B;AAAA,MAC3D,aAAa,uBAAuB;AAAA,MACpC,eAAe,iBAAiB;AAAA,IACjC;AAAA,EACD,CAAE;AAAA,EACF,aAAc,CAAE,UAAU,EAAE,wBAAwB,MAAO;AAC1D,UAAM,EAAE,uBAAuB,qBAAqB,IACnD,SAAU,WAAY;AACvB,WAAO;AAAA,MACN,wBAAwB,MAAM;AAC7B,YAAK,yBAA0B;AAC9B,gCAAsB;AAAA,QACvB,OAAO;AACN,+BAAqB;AAAA,QACtB;AAAA,MACD;AAAA,IACD;AAAA,EACD,CAAE;AAAA,EACF;AAAA,EACA;AACD,CAAE,EAAG,gBAAiB;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-publish-panel/maybe-category-panel.js
2
2
  import { __ } from "@wordpress/i18n";
3
3
  import { useSelect } from "@wordpress/data";
4
4
  import { PanelBody } from "@wordpress/components";
@@ -6,6 +6,7 @@ import { store as coreStore } from "@wordpress/core-data";
6
6
  import { useState, useEffect } from "@wordpress/element";
7
7
  import HierarchicalTermSelector from "../post-taxonomies/hierarchical-term-selector";
8
8
  import { store as editorStore } from "../../store";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
9
10
  function MaybeCategoryPanel() {
10
11
  const { hasNoCategory, hasSiteCategories } = useSelect((select) => {
11
12
  const postType = select(editorStore).getCurrentPostType();
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-panel/maybe-category-panel.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport HierarchicalTermSelector from '../post-taxonomies/hierarchical-term-selector';\nimport { store as editorStore } from '../../store';\n\nfunction MaybeCategoryPanel() {\n\tconst { hasNoCategory, hasSiteCategories } = useSelect( ( select ) => {\n\t\tconst postType = select( editorStore ).getCurrentPostType();\n\t\tconst { canUser, getEntityRecord } = select( coreStore );\n\t\tconst categoriesTaxonomy = getEntityRecord(\n\t\t\t'root',\n\t\t\t'taxonomy',\n\t\t\t'category'\n\t\t);\n\t\tconst defaultCategoryId = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEntityRecord( 'root', 'site' )?.default_category\n\t\t\t: undefined;\n\t\tconst defaultCategory = defaultCategoryId\n\t\t\t? getEntityRecord( 'taxonomy', 'category', defaultCategoryId )\n\t\t\t: undefined;\n\t\tconst postTypeSupportsCategories =\n\t\t\tcategoriesTaxonomy &&\n\t\t\tcategoriesTaxonomy.types.some( ( type ) => type === postType );\n\t\tconst categories =\n\t\t\tcategoriesTaxonomy &&\n\t\t\tselect( editorStore ).getEditedPostAttribute(\n\t\t\t\tcategoriesTaxonomy.rest_base\n\t\t\t);\n\t\tconst siteCategories = postTypeSupportsCategories\n\t\t\t? !! select( coreStore ).getEntityRecords( 'taxonomy', 'category', {\n\t\t\t\t\texclude: [ defaultCategoryId ],\n\t\t\t\t\tper_page: 1,\n\t\t\t } )?.length\n\t\t\t: false;\n\n\t\t// This boolean should return true if everything is loaded\n\t\t// ( categoriesTaxonomy, defaultCategory )\n\t\t// and the post has not been assigned a category different than \"uncategorized\".\n\t\tconst noCategory =\n\t\t\t!! categoriesTaxonomy &&\n\t\t\t!! defaultCategory &&\n\t\t\tpostTypeSupportsCategories &&\n\t\t\t( categories?.length === 0 ||\n\t\t\t\t( categories?.length === 1 &&\n\t\t\t\t\tdefaultCategory?.id === categories[ 0 ] ) );\n\n\t\treturn {\n\t\t\thasNoCategory: noCategory,\n\t\t\thasSiteCategories: siteCategories,\n\t\t};\n\t}, [] );\n\n\tconst [ shouldShowPanel, setShouldShowPanel ] = useState( false );\n\tuseEffect( () => {\n\t\t// We use state to avoid hiding the panel if the user edits the categories\n\t\t// and adds one within the panel itself (while visible).\n\t\tif ( hasNoCategory ) {\n\t\t\tsetShouldShowPanel( true );\n\t\t}\n\t}, [ hasNoCategory ] );\n\n\t// We only want to show the category panel:\n\t// if the post type supports categories,\n\t// if the site has categories other than the default category,\n\t// and if the post has no other categories than the default category.\n\tif ( ! shouldShowPanel || ! hasSiteCategories ) {\n\t\treturn null;\n\t}\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'Assign a category' ) }\n\t\t</span>,\n\t];\n\n\treturn (\n\t\t<PanelBody initialOpen={ false } title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<HierarchicalTermSelector slug=\"category\" />\n\t\t</PanelBody>\n\t);\n}\n\nexport default MaybeCategoryPanel;\n"],
5
- "mappings": "AAoFE,cAMA,YANA;AAjFF,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,UAAU,iBAAiB;AAKpC,OAAO,8BAA8B;AACrC,SAAS,SAAS,mBAAmB;AAErC,SAAS,qBAAqB;AAC7B,QAAM,EAAE,eAAe,kBAAkB,IAAI,UAAW,CAAE,WAAY;AACrE,UAAM,WAAW,OAAQ,WAAY,EAAE,mBAAmB;AAC1D,UAAM,EAAE,SAAS,gBAAgB,IAAI,OAAQ,SAAU;AACvD,UAAM,qBAAqB;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,IACD;AACA,UAAM,oBAAoB,QAAS,QAAQ;AAAA,MAC1C,MAAM;AAAA,MAC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AMrB,MAAK,CAAE,mBAAmB,CAAE,mBAAoB;AAC/C,WAAO;AAAA,EACR;AAEA,QAAM,iBAAiB;AAAA,IACtB,GAAI,aAAc;AAAA,IAClB,oBAAC,UAAK,WAAU,mCACb,aAAI,mBAAoB,KAD2B,OAEtD;AAAA,EACD;AAEA,SACC,qBAAC,aAAU,aAAc,OAAQ,OAAQ,gBACxC;AAAA,wBAAC,OACE;AAAA,MACD;AAAA,IACD,GACD;AAAA,IACA,oBAAC,4BAAyB,MAAK,YAAW;AAAA,KAC3C;AAEF;AAEA,IAAO,+BAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,17 +1,18 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-publish-panel/maybe-post-format-panel.js
2
2
  import { Button, PanelBody } from "@wordpress/components";
3
3
  import { useDispatch, useSelect } from "@wordpress/data";
4
4
  import { __, sprintf } from "@wordpress/i18n";
5
5
  import { store as coreStore } from "@wordpress/core-data";
6
6
  import { POST_FORMATS } from "../post-format";
7
7
  import { store as editorStore } from "../../store";
8
- const getSuggestion = (supportedFormats, suggestedPostFormat) => {
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var getSuggestion = (supportedFormats, suggestedPostFormat) => {
9
10
  const formats = POST_FORMATS.filter(
10
11
  (format) => supportedFormats?.includes(format.id)
11
12
  );
12
13
  return formats.find((format) => format.id === suggestedPostFormat);
13
14
  };
14
- const PostFormatSuggestion = ({
15
+ var PostFormatSuggestion = ({
15
16
  suggestedPostFormat,
16
17
  suggestionText,
17
18
  onUpdatePostFormat
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-panel/maybe-post-format-panel.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Button, PanelBody } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { POST_FORMATS } from '../post-format';\nimport { store as editorStore } from '../../store';\n\nconst getSuggestion = ( supportedFormats, suggestedPostFormat ) => {\n\tconst formats = POST_FORMATS.filter( ( format ) =>\n\t\tsupportedFormats?.includes( format.id )\n\t);\n\treturn formats.find( ( format ) => format.id === suggestedPostFormat );\n};\n\nconst PostFormatSuggestion = ( {\n\tsuggestedPostFormat,\n\tsuggestionText,\n\tonUpdatePostFormat,\n} ) => (\n\t<Button\n\t\t__next40pxDefaultSize\n\t\tvariant=\"link\"\n\t\tonClick={ () => onUpdatePostFormat( suggestedPostFormat ) }\n\t>\n\t\t{ suggestionText }\n\t</Button>\n);\n\nexport default function PostFormatPanel() {\n\tconst { currentPostFormat, suggestion } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getSuggestedPostFormat } =\n\t\t\tselect( editorStore );\n\t\tconst supportedFormats =\n\t\t\tselect( coreStore ).getThemeSupports().formats ?? [];\n\t\treturn {\n\t\t\tcurrentPostFormat: getEditedPostAttribute( 'format' ),\n\t\t\tsuggestion: getSuggestion(\n\t\t\t\tsupportedFormats,\n\t\t\t\tgetSuggestedPostFormat()\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst onUpdatePostFormat = ( format ) => editPost( { format } );\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'Use a post format' ) }\n\t\t</span>,\n\t];\n\n\tif ( ! suggestion || suggestion.id === currentPostFormat ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody initialOpen={ false } title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<PostFormatSuggestion\n\t\t\t\t\tonUpdatePostFormat={ onUpdatePostFormat }\n\t\t\t\t\tsuggestedPostFormat={ suggestion.id }\n\t\t\t\t\tsuggestionText={ sprintf(\n\t\t\t\t\t\t/* translators: %1s: post format */\n\t\t\t\t\t\t__( 'Apply the \"%1$s\" format.' ),\n\t\t\t\t\t\tsuggestion.caption\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</p>\n\t\t</PanelBody>\n\t);\n}\n"],
5
- "mappings": "AA0BC,cAwCC,YAxCD;AAvBD,SAAS,QAAQ,iBAAiB;AAClC,SAAS,aAAa,iBAAiB;AACvC,SAAS,IAAI,eAAe;AAC5B,SAAS,SAAS,iBAAiB;AAKnC,SAAS,oBAAoB;AAC7B,SAAS,SAAS,mBAAmB;AAErC,MAAM,gBAAgB,CAAE,kBAAkB,wBAAyB;AAClE,QAAM,UAAU,aAAa;AAAA,IAAQ,CAAE,WACtC,kBAAkB,SAAU,OAAO,EAAG;AAAA,EACvC;AACA,SAAO,QAAQ,KAAM,CAAE,WAAY,OAAO,OAAO,mBAAoB;AACtE;AAEA,MAAM,uBAAuB,CAAE;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACD,MACC;AAAA,EAAC;AAAA;AAAA,IACA,uBAAqB;AAAA,IACrB,SAAQ;AAAA,IACR,SAAU,MAAM,mBAAoB,mBAAoB;AAAA,IAEtD;AAAA;AACH;AAGc,SAAR,kBAAmC;AACzC,QAAM,EAAE,mBAAmB,WAAW,IAAI,UAAW,CAAE,WAAY;AAClE,UAAM,EAAE,wBAAwB,uBAAuB,IACtD,OAAQ,WAAY;AACrB,UAAM,mBACL,OAAQ,SAAU,EAAE,iBAAiB,EAAE,WAAW,CAAC;AACpD,WAAO;AAAA,MACN,mBAAmB,uBAAwB,QAAS;AAAA,MACpD,YAAY;AAAA,QACX;AAAA,QACA,uBAAuB;AAAA,MACxB;AAAA,IACD;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,EAAE,SAAS,IAAI,YAAa,WAAY;AA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,IACtD,OAAQ,WAAY;AACrB,UAAM,mBACL,OAAQ,SAAU,EAAE,iBAAiB,EAAE,WAAW,CAAC;AACpD,WAAO;AAAA,MACN,mBAAmB,uBAAwB,QAAS;AAAA,MACpD,YAAY;AAAA,QACX;AAAA,QACA,uBAAuB;AAAA,MACxB;AAAA,IACD;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,EAAE,SAAS,IAAI,YAAa,WAAY;AAE9C,QAAM,qBAAqB,CAAE,WAAY,SAAU,EAAE,OAAO,CAAE;AAE9D,QAAM,iBAAiB;AAAA,IACtB,GAAI,aAAc;AAAA,IAClB,oBAAC,UAAK,WAAU,mCACb,aAAI,mBAAoB,KAD2B,OAEtD;AAAA,EACD;AAEA,MAAK,CAAE,cAAc,WAAW,OAAO,mBAAoB;AAC1D,WAAO;AAAA,EACR;AAEA,SACC,qBAAC,aAAU,aAAc,OAAQ,OAAQ,gBACxC;AAAA,wBAAC,OACE;AAAA,MACD;AAAA,IACD,GACD;AAAA,IACA,oBAAC,OACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,qBAAsB,WAAW;AAAA,QACjC,gBAAiB;AAAA;AAAA,UAEhB,GAAI,0BAA2B;AAAA,UAC/B,WAAW;AAAA,QACZ;AAAA;AAAA,IACD,GACD;AAAA,KACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-publish-panel/maybe-tags-panel.js
2
2
  import { __, sprintf } from "@wordpress/i18n";
3
3
  import { useState } from "@wordpress/element";
4
4
  import { useSelect } from "@wordpress/data";
@@ -6,7 +6,8 @@ import { PanelBody } from "@wordpress/components";
6
6
  import { store as coreStore } from "@wordpress/core-data";
7
7
  import FlatTermSelector from "../post-taxonomies/flat-term-selector";
8
8
  import { store as editorStore } from "../../store";
9
- const TagsPanel = () => {
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ var TagsPanel = () => {
10
11
  const tagLabels = useSelect((select) => {
11
12
  const taxonomy = select(coreStore).getTaxonomy("post_tag");
12
13
  return taxonomy?.labels;
@@ -28,7 +29,7 @@ const TagsPanel = () => {
28
29
  /* @__PURE__ */ jsx(FlatTermSelector, { slug: "post_tag", __nextHasNoMarginBottom: true })
29
30
  ] });
30
31
  };
31
- const MaybeTagsPanel = () => {
32
+ var MaybeTagsPanel = () => {
32
33
  const { postHasTags, siteHasTags, isPostTypeSupported } = useSelect(
33
34
  (select) => {
34
35
  const postType = select(editorStore).getCurrentPostType();
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-panel/maybe-tags-panel.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport FlatTermSelector from '../post-taxonomies/flat-term-selector';\nimport { store as editorStore } from '../../store';\n\nconst TagsPanel = () => {\n\tconst tagLabels = useSelect( ( select ) => {\n\t\tconst taxonomy = select( coreStore ).getTaxonomy( 'post_tag' );\n\t\treturn taxonomy?.labels;\n\t}, [] );\n\n\tconst addNewItem = tagLabels?.add_new_item ?? __( 'Add tag' );\n\tconst tagLabel = tagLabels?.name ?? __( 'Tags' );\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ addNewItem }\n\t\t</span>,\n\t];\n\n\treturn (\n\t\t<PanelBody initialOpen={ false } title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s is the taxonomy name (e.g., \"Tags\").\n\t\t\t\t\t__(\n\t\t\t\t\t\t'%s help users and search engines navigate your site and find your content. Add a few keywords to describe your post.'\n\t\t\t\t\t),\n\t\t\t\t\ttagLabel\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<FlatTermSelector slug=\"post_tag\" __nextHasNoMarginBottom />\n\t\t</PanelBody>\n\t);\n};\n\nconst MaybeTagsPanel = () => {\n\tconst { postHasTags, siteHasTags, isPostTypeSupported } = useSelect(\n\t\t( select ) => {\n\t\t\tconst postType = select( editorStore ).getCurrentPostType();\n\t\t\tconst tagsTaxonomy = select( coreStore ).getEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'taxonomy',\n\t\t\t\t'post_tag'\n\t\t\t);\n\t\t\tconst _isPostTypeSupported =\n\t\t\t\ttagsTaxonomy?.types?.includes( postType );\n\t\t\tconst areTagsFetched = tagsTaxonomy !== undefined;\n\t\t\tconst tags =\n\t\t\t\ttagsTaxonomy &&\n\t\t\t\tselect( editorStore ).getEditedPostAttribute(\n\t\t\t\t\ttagsTaxonomy.rest_base\n\t\t\t\t);\n\t\t\tconst siteTags = _isPostTypeSupported\n\t\t\t\t? !! select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'taxonomy',\n\t\t\t\t\t\t'post_tag',\n\t\t\t\t\t\t{ per_page: 1 }\n\t\t\t\t )?.length\n\t\t\t\t: false;\n\n\t\t\treturn {\n\t\t\t\tpostHasTags: !! tags?.length,\n\t\t\t\tsiteHasTags: siteTags,\n\t\t\t\tisPostTypeSupported: areTagsFetched && _isPostTypeSupported,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst [ hadTagsWhenOpeningThePanel ] = useState( postHasTags );\n\n\t/**\n\t * We only want to show the tag panel if the post type supports\n\t * tags and the site has tags.\n\t */\n\tif ( ! isPostTypeSupported || ! siteHasTags ) {\n\t\treturn null;\n\t}\n\n\t/*\n\t * We only want to show the tag panel if the post didn't have\n\t * any tags when the user hit the Publish button.\n\t *\n\t * We can't use the prop.postHasTags because it'll change to true\n\t * if the user adds a new tag within the pre-publish panel.\n\t * This would force a re-render and a new prop.postHasTags check,\n\t * hiding this panel and keeping the user from adding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AC;AAAA,KAC3D;AAEF;AAEA,IAAM,iBAAiB,MAAM;AAC5B,QAAM,EAAE,aAAa,aAAa,oBAAoB,IAAI;AAAA,IACzD,CAAE,WAAY;AACb,YAAM,WAAW,OAAQ,WAAY,EAAE,mBAAmB;AAC1D,YAAM,eAAe,OAAQ,SAAU,EAAE;AAAA,QACxC;AAAA,QACA;AAAA,QACA;AAAA,MACD;AACA,YAAM,uBACL,cAAc,OAAO,SAAU,QAAS;AACzC,YAAM,iBAAiB,iBAAiB;AACxC,YAAM,OACL,gBACA,OAAQ,WAAY,EAAE;AAAA,QACrB,aAAa;AAAA,MACd;AACD,YAAM,WAAW,uBACd,CAAC,CAAE,OAAQ,SAAU,EAAE;AAAA,QACvB;AAAA,QACA;AAAA,QACA,EAAE,UAAU,EAAE;AAAA,MACd,GAAG,SACH;AAEH,aAAO;AAAA,QACN,aAAa,CAAC,CAAE,MAAM;AAAA,QACtB,aAAa;AAAA,QACb,qBAAqB,kBAAkB;AAAA,MACxC;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AACA,QAAM,CAAE,0BAA2B,IAAI,SAAU,WAAY;AAM7D,MAAK,CAAE,uBAAuB,CAAE,aAAc;AAC7C,WAAO;AAAA,EACR;AAYA,MAAK,CAAE,4BAA6B;AACnC,WAAO,oBAAC,aAAU;AAAA,EACnB;AAEA,SAAO;AACR;AAEA,IAAO,2BAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-publish-panel/maybe-upload-media.js
2
2
  import {
3
3
  PanelBody,
4
4
  Button,
@@ -12,6 +12,7 @@ import { store as blockEditorStore } from "@wordpress/block-editor";
12
12
  import { useState } from "@wordpress/element";
13
13
  import { isBlobURL } from "@wordpress/blob";
14
14
  import { fetchMedia } from "./media-util";
15
+ import { jsx, jsxs } from "react/jsx-runtime";
15
16
  function flattenBlocks(blocks) {
16
17
  const result = [];
17
18
  blocks.forEach((block) => {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-panel/maybe-upload-media.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\tSpinner,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport { isBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport { fetchMedia } from './media-util';\n\nfunction flattenBlocks( blocks ) {\n\tconst result = [];\n\n\tblocks.forEach( ( block ) => {\n\t\tresult.push( block );\n\t\tresult.push( ...flattenBlocks( block.innerBlocks ) );\n\t} );\n\n\treturn result;\n}\n\n/**\n * Determine whether a block has external media.\n *\n * Different blocks use different attribute names (and potentially\n * different logic as well) in determining whether the media is\n * present, and whether it's external.\n *\n * @param {{name: string, attributes: Object}} block The block.\n * @return {boolean?} Whether the block has external media\n */\nfunction hasExternalMedia( block ) {\n\tif ( block.name === 'core/image' || block.name === 'core/cover' ) {\n\t\treturn block.attributes.url && ! block.attributes.id;\n\t}\n\n\tif ( block.name === 'core/media-text' ) {\n\t\treturn block.attributes.mediaUrl && ! block.attributes.mediaId;\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Retrieve media info from a block.\n *\n * Different blocks use different attribute names, so we need this\n * function to normalize things into a consistent naming scheme.\n *\n * @param {{name: string, attributes: Object}} block The block.\n * @return {{url: ?string, alt: ?string, id: ?number}} The media info for the block.\n */\nfunction getMediaInfo( block ) {\n\tif ( block.name === 'core/image' || block.name === 'core/cover' ) {\n\t\tconst { url, alt, id } = block.attributes;\n\t\treturn { url, alt, id };\n\t}\n\n\tif ( block.name === 'core/media-text' ) {\n\t\tconst { mediaUrl: url, mediaAlt: alt, mediaId: id } = block.attributes;\n\t\treturn { url, alt, id };\n\t}\n\n\treturn {};\n}\n\n// Image component to represent a single image in the upload dialog.\nfunction Image( { clientId, alt, url } ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\treturn (\n\t\t<motion.img\n\t\t\ttabIndex={ 0 }\n\t\t\trole=\"button\"\n\t\t\taria-label={ __( 'Select image block.' ) }\n\t\t\tonClick={ () => {\n\t\t\t\tselectBlock( clientId );\n\t\t\t} }\n\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\tif ( event.key === 'Enter' || event.key === ' ' ) {\n\t\t\t\t\tselectBlock( clientId );\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t} }\n\t\t\tkey={ clientId }\n\t\t\talt={ alt }\n\t\t\tsrc={ url }\n\t\t\tanimate={ { opacity: 1 } }\n\t\t\texit={ { opacity: 0, scale: 0 } }\n\t\t\tstyle={ {\n\t\t\t\twidth: '32px',\n\t\t\t\theight: '32px',\n\t\t\t\tobjectFit: 'cover',\n\t\t\t\tborderRadius: '2px',\n\t\t\t\tcursor: 'pointer',\n\t\t\t} }\n\t\t\twhileHover={ { scale: 1.08 } }\n\t\t/>\n\t);\n}\n\nexport default function MaybeUploadMediaPanel() {\n\tconst [ isUploading, setIsUploading ] = useState( false );\n\tconst [ isAnimating, setIsAnimating ] = useState( false );\n\tconst [ hadUploadError, setHadUploadError ] = useState( false );\n\tconst { editorBlocks, mediaUpload } = useSelect(\n\t\t( select ) => ( {\n\t\t\teditorBlocks: select( blockEditorStore ).getBlocks(),\n\t\t\tmediaUpload: select( blockEditorStore ).getSettings().mediaUpload,\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Get a list of blocks with external media.\n\tconst blocksWithExternalMedia = flattenBlocks( editorBlocks ).filter(\n\t\t( block ) => hasExternalMedia( block )\n\t);\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tif ( ! mediaUpload || ! blocksWithExternalMedia.length ) {\n\t\treturn null;\n\t}\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'External media' ) }\n\t\t</span>,\n\t];\n\n\t/**\n\t * Update an individual block to point to newly-added library media.\n\t *\n\t * Different blocks use different attribute names, so we need this\n\t * function to ensure we modify the correct attributes for each type.\n\t *\n\t * @param {{name: string, attributes: Object}} block The block.\n\t * @param {{id: number, url: string}} media Media library file info.\n\t */\n\tfunction updateBlockWithUploadedMedia( block, media ) {\n\t\tif ( block.name === 'core/image' || block.name === 'core/cover' ) {\n\t\t\tupdateBlockAttributes( block.clientId, {\n\t\t\t\tid: media.id,\n\t\t\t\turl: media.url,\n\t\t\t} );\n\t\t}\n\n\t\tif ( block.name === 'core/media-text' ) {\n\t\t\tupdateBlockAttributes( block.clientId, {\n\t\t\t\tmediaId: media.id,\n\t\t\t\tmediaUrl: media.url,\n\t\t\t} );\n\t\t}\n\t}\n\n\t// Handle fetching and uploading all external media in the post.\n\tfunction uploadImages() {\n\t\tsetIsUploading( true );\n\t\tsetHadUploadError( false );\n\n\t\t// Multiple blocks can be using the same URL, so we\n\t\t// should ensure we only fetch and upload each of them once.\n\t\tconst mediaUrls = new Set(\n\t\t\tblocksWithExternalMedia.map( ( block ) => {\n\t\t\t\tconst { url } = getMediaInfo( block );\n\t\t\t\treturn url;\n\t\t\t} )\n\t\t);\n\n\t\t// Create an upload promise for each URL, that we can wait for in all\n\t\t// blocks that make use of that media.\n\t\tconst uploadPromises = Object.fromEntries(\n\t\t\tObject.entries( fetchMedia( [ ...mediaUrls ] ) ).map(\n\t\t\t\t( [ url, filePromise ] ) => {\n\t\t\t\t\tconst uploadPromise = filePromise.then(\n\t\t\t\t\t\t( blob ) =>\n\t\t\t\t\t\t\tnew Promise( ( resolve, reject ) => {\n\t\t\t\t\t\t\t\tmediaUpload( {\n\t\t\t\t\t\t\t\t\tfilesList: [ blob ],\n\t\t\t\t\t\t\t\t\tonFileChange: ( [ media ] ) => {\n\t\t\t\t\t\t\t\t\t\tif ( isBlobURL( media.url ) ) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tresolve( media );\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tonError() {\n\t\t\t\t\t\t\t\t\t\treject();\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\n\t\t\t\t\treturn [ url, uploadPromise ];\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\n\t\t// Wait for all blocks to be updated with library media.\n\t\tPromise.allSettled(\n\t\t\tblocksWithExternalMedia.map( ( block ) => {\n\t\t\t\tconst { url } = getMediaInfo( block );\n\n\t\t\t\treturn uploadPromises[ url ]\n\t\t\t\t\t.then( ( media ) =>\n\t\t\t\t\t\tupdateBlockWithUploadedMedia( block, media )\n\t\t\t\t\t)\n\t\t\t\t\t.then( () => setIsAnimating( true ) )\n\t\t\t\t\t.catch( () => setHadUploadError( true ) );\n\t\t\t} )\n\t\t).finally( () => {\n\t\t\tsetIsUploading( false );\n\t\t} );\n\t}\n\n\treturn (\n\t\t<PanelBody initialOpen title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<div\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'inline-flex',\n\t\t\t\t\tflexWrap: 'wrap',\n\t\t\t\t\tgap: '8px',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<AnimatePresence\n\t\t\t\t\tonExitComplete={ () => setIsAnimating( false ) }\n\t\t\t\t>\n\t\t\t\t\t{ blocksWithExternalMedia.map( ( block ) => {\n\t\t\t\t\t\tconst { url, alt } = getMediaInfo( block );\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\tkey={ block.clientId }\n\t\t\t\t\t\t\t\tclientId={ block.clientId }\n\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</AnimatePresence>\n\t\t\t\t{ isUploading || isAnimating ? (\n\t\t\t\t\t<Spinner />\n\t\t\t\t) : (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ uploadImages }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ _x( 'Upload', 'verb' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t{ hadUploadError && <p>{ __( 'Upload failed, try again.' ) }</p> }\n\t\t</PanelBody>\n\t);\n}\n"],
5
- "mappings": "AAiFE,cAuJC,YAvJD;AA9EF;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,OACvB;AACP,SAAS,WAAW,mBAAmB;AACvC,SAAS,IAAI,UAAU;AACvB,SAAS,SAAS,wBAAwB;AAC1C,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAK1B,SAAS,kBAAkB;AAE3B,SAAS,cAAe,QAAS;AAChC,QAAM,SAAS,CAAC;AAEhB,SAAO,QAAS,CAAE,UAAW;AAC5B,WAAO,KAAM,KAAM;AACnB,WAAO,KAAM,GAAG,cAAe,MAAM,WAAY,CAAE;AAAA,EACpD,CAAE;AAEF,SAAO;AACR;AAYA,SAAS,iBAAkB,OAAQ;AAClC,MAAK,MAAM,SAAS,gBAAgB,MAAM,SAAS,cAAe;AACjE,WAAO,MAAM,WAAW,OAAO,CAAE,MAAM,WAAW;AAAA,EACnD;AAEA,MAAK,MAAM,SAAS,mBAAoB;AACvC,WAAO,MAAM,WAAW,YAA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aAAI,2BAA4B,GAAG;AAAA,KAC7D;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-publish-panel/media-util.js
1
2
  import { v4 as uuid } from "uuid";
2
3
  import { getFilename } from "@wordpress/url";
3
4
  function generateUniqueBasenames(urls) {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-panel/media-util.js"],
4
4
  "sourcesContent": ["/**\n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport { getFilename } from '@wordpress/url';\n\n/**\n * Generate a list of unique basenames given a list of URLs.\n *\n * We want all basenames to be unique, since sometimes the extension\n * doesn't reflect the mime type, and may end up getting changed by\n * the server, on upload.\n *\n * @param {string[]} urls The list of URLs\n * @return {Record< string, string >} A URL => basename record.\n */\nexport function generateUniqueBasenames( urls ) {\n\tconst basenames = new Set();\n\n\treturn Object.fromEntries(\n\t\turls.map( ( url ) => {\n\t\t\t// We prefer to match the remote filename, if possible.\n\t\t\tconst filename = getFilename( url );\n\t\t\tlet basename = '';\n\n\t\t\tif ( filename ) {\n\t\t\t\tconst parts = filename.split( '.' );\n\t\t\t\tif ( parts.length > 1 ) {\n\t\t\t\t\t// Assume the last part is the extension.\n\t\t\t\t\tparts.pop();\n\t\t\t\t}\n\t\t\t\tbasename = parts.join( '.' );\n\t\t\t}\n\n\t\t\tif ( ! basename ) {\n\t\t\t\t// It looks like we don't have a basename, so let's use a UUID.\n\t\t\t\tbasename = uuid();\n\t\t\t}\n\n\t\t\tif ( basenames.has( basename ) ) {\n\t\t\t\t// Append a UUID to deduplicate the basename.\n\t\t\t\t// The server will try to deduplicate on its own if we don't do this,\n\t\t\t\t// but it may run into a race condition\n\t\t\t\t// (see https://github.com/WordPress/gutenberg/issues/64899).\n\t\t\t\t// Deduplicating the filenames before uploading is safer.\n\t\t\t\tbasename = `${ basename }-${ uuid() }`;\n\t\t\t}\n\n\t\t\tbasenames.add( basename );\n\n\t\t\treturn [ url, basename ];\n\t\t} )\n\t);\n}\n\n/**\n * Fetch a list of URLs, turning those into promises for files with\n * unique filenames.\n *\n * @param {string[]} urls The list of URLs\n * @return {Record< string, Promise< File > >} A URL => File promise record.\n */\nexport function fetchMedia( urls ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( generateUniqueBasenames( urls ) ).map(\n\t\t\t( [ url, basename ] ) => {\n\t\t\t\tconst filePromise = window\n\t\t\t\t\t.fetch( url.includes( '?' ) ? url : url + '?' )\n\t\t\t\t\t.then( ( response ) => response.blob() )\n\t\t\t\t\t.then( ( blob ) => {\n\t\t\t\t\t\t// The server will reject the upload if it doesn't have an extension,\n\t\t\t\t\t\t// even though it'll rewrite the file name to match the mime type.\n\t\t\t\t\t\t// Here we provide it with a safe extension to get it past that check.\n\t\t\t\t\t\treturn new File( [ blob ], `${ basename }.png`, {\n\t\t\t\t\t\t\ttype: blob.type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\n\t\t\t\treturn [ url, filePromise ];\n\t\t\t}\n\t\t)\n\t);\n}\n"],
5
- "mappings": "AAGA,SAAS,MAAM,YAAY;AAK3B,SAAS,mBAAmB;AAYrB,SAAS,wBAAyB,MAAO;AAC/C,QAAM,YAAY,oBAAI,IAAI;AAE1B,SAAO,OAAO;AAAA,IACb,KAAK,IAAK,CAAE,QAAS;AAEpB,YAAM,WAAW,YAAa,GAAI;AAClC,UAAI,WAAW;AAEf,UAAK,UAAW;AACf,cAAM,QAAQ,SAAS,MAAO,GAAI;AAClC,YAAK,MAAM,SAAS,GAAI;AAEvB,gBAAM,IAAI;AAAA,QACX;AACA,mBAAW,MAAM,KAAM,GAAI;AAAA,MAC5B;AAEA,UAAK,CAAE,UAAW;AAEjB,mBAAW,KAAK;AAAA,MACjB;AAEA,UAAK,UAAU,IAAK,QAAS,GAAI;AAMhC,mBAAW,GAAI,QAAS,IAAK,KAAK,CAAE;AAAA,MACrC;AAEA,gBAAU,IAAK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AAK,CAAE,EAAE;AAAA,MACjD,CAAE,CAAE,KAAK,QAAS,MAAO;AACxB,cAAM,cAAc,OAClB,MAAO,IAAI,SAAU,GAAI,IAAI,MAAM,MAAM,GAAI,EAC7C,KAAM,CAAE,aAAc,SAAS,KAAK,CAAE,EACtC,KAAM,CAAE,SAAU;AAIlB,iBAAO,IAAI,KAAM,CAAE,IAAK,GAAG,GAAI,QAAS,QAAQ;AAAA,YAC/C,MAAM,KAAK;AAAA,UACZ,CAAE;AAAA,QACH,CAAE;AAEH,eAAO,CAAE,KAAK,WAAY;AAAA,MAC3B;AAAA,IACD;AAAA,EACD;AACD;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-publish-panel/postpublish.js
2
2
  import {
3
3
  PanelBody,
4
4
  Button,
@@ -16,9 +16,10 @@ import { store as coreStore } from "@wordpress/core-data";
16
16
  import { external } from "@wordpress/icons";
17
17
  import PostScheduleLabel from "../post-schedule/label";
18
18
  import { store as editorStore } from "../../store";
19
- const POSTNAME = "%postname%";
20
- const PAGENAME = "%pagename%";
21
- const getFuturePostUrl = (post) => {
19
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
20
+ var POSTNAME = "%postname%";
21
+ var PAGENAME = "%pagename%";
22
+ var getFuturePostUrl = (post) => {
22
23
  const { slug } = post;
23
24
  if (post.permalink_template.includes(POSTNAME)) {
24
25
  return post.permalink_template.replace(POSTNAME, slug);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-panel/postpublish.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\tTextControl,\n\tExternalLink,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useEffect, useState, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { addQueryArgs, safeDecodeURIComponent } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { external } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleLabel from '../post-schedule/label';\nimport { store as editorStore } from '../../store';\n\nconst POSTNAME = '%postname%';\nconst PAGENAME = '%pagename%';\n\n/**\n * Returns URL for a future post.\n *\n * @param {Object} post Post object.\n *\n * @return {string} PostPublish URL.\n */\n\nconst getFuturePostUrl = ( post ) => {\n\tconst { slug } = post;\n\n\tif ( post.permalink_template.includes( POSTNAME ) ) {\n\t\treturn post.permalink_template.replace( POSTNAME, slug );\n\t}\n\n\tif ( post.permalink_template.includes( PAGENAME ) ) {\n\t\treturn post.permalink_template.replace( PAGENAME, slug );\n\t}\n\n\treturn post.permalink_template;\n};\n\nfunction CopyButton( { text } ) {\n\tconst [ showCopyConfirmation, setShowCopyConfirmation ] = useState( false );\n\tconst timeoutIdRef = useRef();\n\tconst ref = useCopyToClipboard( text, () => {\n\t\tsetShowCopyConfirmation( true );\n\t\tif ( timeoutIdRef.current ) {\n\t\t\tclearTimeout( timeoutIdRef.current );\n\t\t}\n\t\ttimeoutIdRef.current = setTimeout( () => {\n\t\t\tsetShowCopyConfirmation( false );\n\t\t}, 4000 );\n\t} );\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( timeoutIdRef.current ) {\n\t\t\t\tclearTimeout( timeoutIdRef.current );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Button __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ showCopyConfirmation ? __( 'Copied!' ) : __( 'Copy' ) }\n\t\t</Button>\n\t);\n}\n\nexport default function PostPublishPanelPostpublish( {\n\tfocusOnMount,\n\tchildren,\n} ) {\n\tconst { post, postType, isScheduled } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetCurrentPost,\n\t\t\tisCurrentPostScheduled,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\tpost: getCurrentPost(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t};\n\t}, [] );\n\n\tconst postLabel = postType?.labels?.singular_name;\n\tconst viewPostLabel = postType?.labels?.view_item;\n\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\tconst link =\n\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\tpost_type: post.type,\n\t} );\n\n\tconst postLinkRef = useCallback(\n\t\t( node ) => {\n\t\t\tif ( focusOnMount && node ) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t},\n\t\t[ focusOnMount ]\n\t);\n\n\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t<>\n\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t<PostScheduleLabel />.\n\t\t</>\n\t) : (\n\t\t__( 'is now live.' )\n\t);\n\n\treturn (\n\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t<ExternalLink ref={ postLinkRef } href={ link }>\n\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t</ExternalLink>{ ' ' }\n\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t</PanelBody>\n\t\t\t<PanelBody>\n\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t<strong>{ __( 'What\u2019s next?' ) }</strong>\n\t\t\t\t</p>\n\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\treadOnly\n\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\tonFocus={ ( event ) => event.target.select() }\n\t\t\t\t\t/>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t<CopyButton text={ link } />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\thref={ link }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</PanelBody>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n"],
5
- "mappings": "AA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D;AAAA,MAEA,qBAAC,SAAI,WAAU,2CACZ;AAAA,SAAE,eACH;AAAA,UAAC;AAAA;AAAA,YACA,SAAQ;AAAA,YACR,MAAO;AAAA,YACP,uBAAqB;AAAA,YACrB,MAAO;AAAA,YACP,cAAa;AAAA,YACb,QAAO;AAAA,YAEL;AAAA;AAAA,cACF,oBAAC;AAAA,gBAAe,IAAG;AAAA;AAAA,gBAGjB,aAAI,sBAAuB;AAAA,eAE7B;AAAA;AAAA;AAAA,QACD;AAAA,QAED;AAAA,UAAC;AAAA;AAAA,YACA,SAAU,cAAc,YAAY;AAAA,YACpC,uBAAqB;AAAA,YACrB,MAAO;AAAA,YAEL;AAAA;AAAA,QACH;AAAA,SACD;AAAA,OACD;AAAA,IACE;AAAA,KACH;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-publish-panel/prepublish.js
2
2
  import { __ } from "@wordpress/i18n";
3
3
  import { Icon, PanelBody } from "@wordpress/components";
4
4
  import { useSelect } from "@wordpress/data";
@@ -15,6 +15,7 @@ import MaybePostFormatPanel from "./maybe-post-format-panel";
15
15
  import { store as editorStore } from "../../store";
16
16
  import MaybeCategoryPanel from "./maybe-category-panel";
17
17
  import MaybeUploadMedia from "./maybe-upload-media";
18
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
18
19
  function PostPublishPanelPrepublish({ children }) {
19
20
  const {
20
21
  isBeingScheduled,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-publish-panel/prepublish.js"],
4
4
  "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'Your work will be reviewed and then approved.'\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"],
5
- "mappings": "AAuDE,SAqDE,UArDF,KA4CE,YA5CF;AApDF,SAAS,UAAU;AACnB,SAAS,MAAM,iBAAiB;AAChC,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,2BAA2B;AACpC,SAAS,SAAS,iBAAiB;AACnC,SAAS,sBAAsB;AAK/B,OAAO,oBAAoB;AAC3B,OAAO,yBAAyB;AAChC,OAAO,kBAAkB;AACzB,OAAO,uBAAuB;AAC9B,OAAO,oBAAoB;AAC3B,OAAO,0BAA0B;AACjC,SAAS,SAAS,mBAAmB;AACrC,OAAO,wBAAwB;AAC/B,OAAO,sBAAsB;AAE7B,SAAS,2BAA4B,EAAE,SAAS,GAAI;AACnD,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM,EAAE,gBAAgB,2BAA2B,IAClD,OAAQ,WAAY;AACrB,UAAM,EAAE,iBAAiB,YAAY,IAAI,OAAQ,SAAU;AAC3D,UAAM,WACL,gBAAiB,QAAQ,kBAAkB,MAAU,KAAK,CAAC;AAE5D,W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AU,wBACb,yBAAgB,SAAU,KAAK,GAAI,YAAa,GACnD;AAAA,QACA,oBAAC,UAAK,WAAU,wBAAyB,oBAAU;AAAA,SACpD;AAAA,OACD;AAAA,IACA,oBAAC,oBAAiB;AAAA,IAChB,oBACD,iCACC;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,aAAc;AAAA,UACd,OAAQ;AAAA,YACP,GAAI,aAAc;AAAA,YAClB;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBAGV,8BAAC,uBAAoB;AAAA;AAAA,cAFjB;AAAA,YAGL;AAAA,UACD;AAAA,UAEA,8BAAC,kBAAe;AAAA;AAAA,MACjB;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,aAAc;AAAA,UACd,OAAQ;AAAA,YACP,GAAI,UAAW;AAAA,YACf;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBAGV,8BAAC,qBAAkB;AAAA;AAAA,cAFf;AAAA,YAGL;AAAA,UACD;AAAA,UAEA,8BAAC,gBAAa;AAAA;AAAA,MACf;AAAA,OACD;AAAA,IAED,oBAAC,wBAAqB;AAAA,IACtB,oBAAC,kBAAe;AAAA,IAChB,oBAAC,sBAAmB;AAAA,IAClB;AAAA,KACH;AAEF;AAEA,IAAO,qBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-saved-state/index.js
2
2
  import clsx from "clsx";
3
3
  import {
4
4
  __unstableGetAnimateClassName as getAnimateClassName,
@@ -13,6 +13,7 @@ import { displayShortcut } from "@wordpress/keycodes";
13
13
  import { store as preferencesStore } from "@wordpress/preferences";
14
14
  import { STATUS_OPTIONS } from "../../components/post-status";
15
15
  import { store as editorStore } from "../../store";
16
+ import { jsx, jsxs } from "react/jsx-runtime";
16
17
  function PostSavedState({ forceIsDirty }) {
17
18
  const [forceSavedMessage, setForceSavedMessage] = useState(false);
18
19
  const isLargeViewport = useViewportMatch("small");
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-saved-state/index.js"],
4
4
  "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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 { STATUS_OPTIONS } from '../../components/post-status';\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\t// We shouldn't render the button if the post has not one of the following statuses: pending, draft, auto-draft.\n\t// The reason for this is that this button handles the `save as pending` and `save draft` actions.\n\t// An exception for this is when the post has a custom status and there should be a way to save changes without\n\t// having to publish. This should be handled better in the future when custom statuses have better support.\n\t// @see https://github.com/WordPress/gutenberg/issues/3144.\n\tconst isIneligibleStatus =\n\t\t! [ 'pending', 'draft', 'auto-draft' ].includes( postStatus ) &&\n\t\tSTATUS_OPTIONS.map( ( { value } ) => value ).includes( postStatus );\n\n\tif (\n\t\tisPublished ||\n\t\tisScheduled ||\n\t\tisIneligibleStatus ||\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? clsx( {\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"],
5
- "mappings": "AAsJE,SA2BmB,KA3BnB;AAnJF,OAAO,UAAU;AAKjB;AAAA,EACC,iCAAiC;AAAA,EACjC;AAAA,OACM;AACP,SAAS,aAAa,wBAAwB;AAC9C,SAAS,aAAa,iBAAiB;AACvC,SAAS,WAAW,gBAAgB;AACpC,SAAS,UAAU;AACnB,SAAS,MAAM,OAAO,OAAO,mBAAmB;AAChD,SAAS,uBAAuB;AAChC,SAAS,SAAS,wBAAwB;AAK1C,SAAS,sBAAsB;AAC/B,SAAS,SAAS,mBAAmB;AAWtB,SAAR,eAAiC,EAAE,aAAa,GAAI;AAC1D,QAAM,CAAE,mBAAmB,oBAAqB,IAAI,SAAU,KAAM;AACpE,QAAM,kBAAkB,iBAAkB,OAAQ;AAElD,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AAAA,IACH,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,WAAY;AACxB,YAAM,EAAE,IAAI,IAAI,OAAQ,gBAAiB;AACzC,aAAO;AAAA,QACN,cAAc,iBAAiB;AAAA,QAC/B,SAAS,gBAAgB,kBAAkB;AAAA,QAC3C,OAAO,gBAAgB;AAAA,QACvB,aAAa,uBAAuB;AAAA,QACpC,UAAU,aAAa;AAAA,QACvB,YAAY,qBAAqB;AAAA,QACjC,aAAa,uBAAuB;AAAA,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AC5C;AACD,WAAO;AAAA,EACR;AAGA,QAAM,QAAQ,YAAY,GAAI,iBAAkB,IAAI,GAAI,YAAa;AAGrE,QAAM,aAAa,GAAI,MAAO;AAE9B,QAAM,UAAU,qBAAuB,CAAE,SAAS,CAAE;AACpD,QAAM,eAAe,YAAY;AACjC,QAAM,aAAa,YAAY,WAAW,CAAE;AAC5C,MAAI;AAEJ,MAAK,UAAW;AACf,WAAO,eAAe,GAAI,YAAa,IAAI,GAAI,QAAS;AAAA,EACzD,WAAY,SAAU;AACrB,WAAO,GAAI,OAAQ;AAAA,EACpB,WAAY,iBAAkB;AAC7B,WAAO;AAAA,EACR,WAAY,gBAAiB;AAC5B,WAAO;AAAA,EACR;AAIA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WACC,cAAc,WACX,KAAM;AAAA,QACN,0BAA0B,CAAE;AAAA,QAC5B,2BAA2B;AAAA,QAC3B,aAAa;AAAA,QACb,iBAAiB;AAAA,QACjB,YAAY;AAAA,QACZ,CAAE,oBAAqB;AAAA,UACtB,MAAM;AAAA,QACP,CAAE,CAAE,GAAG;AAAA,MACP,CAAE,IACF;AAAA,MAEJ,SAAU,aAAa,SAAY,MAAM,SAAS;AAAA,MAKlD,UAAW,aAAa,SAAY,gBAAgB,QAAS,GAAI;AAAA,MACjE,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,MAAO,kBAAkB,SAAY;AAAA,MACrC,OAAQ,QAAQ;AAAA,MAChB,iBAAgB;AAAA,MAEd;AAAA,wBAAgB,oBAAC,QAAK,MAAO,UAAU,QAAQ,OAAQ;AAAA,QACvD;AAAA;AAAA;AAAA,EACH;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-schedule/check.js
1
2
  import { useSelect } from "@wordpress/data";
2
3
  import { store as editorStore } from "../../store";
3
4
  function PostScheduleCheck({ children }) {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-schedule/check.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if post has a publish action.\n *\n * @param {Object} props Props.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @return {React.ReactNode} - The component to be rendered or null if there is no publish action.\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"],
5
- "mappings": "AAGA,SAAS,iBAAiB;AAK1B,SAAS,SAAS,mBAAmB;AAUtB,SAAR,kBAAoC,EAAE,SAAS,GAAI;AACzD,QAAM,mBAAmB,UAAW,CAAE,WAAY;AACjD,WACC,OAAQ,WAAY,EAAE,eAAe,EAAE,SACtC,mBACD,KAAK;AAAA,EAEP,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,kBAAmB;AACzB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
5
+ "mappings": ";AAGA,SAAS,iBAAiB;AAK1B,SAAS,SAAS,mBAAmB;AAUtB,SAAR,kBAAoC,EAAE,SAAS,GAAI;AACzD,QAAM,mBAAmB,UAAW,CAAE,WAAY;AACjD,WACC,OAAQ,WAAY,EAAE,eAAe,EAAE,SACtC,mBACD,KAAK;AAAA,EAEP,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,kBAAmB;AACzB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-schedule/index.js
2
2
  import { parseISO, endOfMonth, startOfMonth } from "date-fns";
3
3
  import { getSettings } from "@wordpress/date";
4
4
  import { _x } from "@wordpress/i18n";
@@ -8,7 +8,8 @@ import { useState, useMemo } from "@wordpress/element";
8
8
  import { store as coreStore } from "@wordpress/core-data";
9
9
  import { store as editorStore } from "../../store";
10
10
  import { unlock } from "../../lock-unlock";
11
- const { PrivatePublishDateTimePicker } = unlock(blockEditorPrivateApis);
11
+ import { jsx } from "react/jsx-runtime";
12
+ var { PrivatePublishDateTimePicker } = unlock(blockEditorPrivateApis);
12
13
  function PostSchedule(props) {
13
14
  return /* @__PURE__ */ jsx(
14
15
  PrivatePostSchedule,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-schedule/index.js"],
4
4
  "sourcesContent": ["/**\n * External dependencies\n */\nimport { parseISO, endOfMonth, startOfMonth } from 'date-fns';\n\n/**\n * WordPress dependencies\n */\nimport { getSettings } from '@wordpress/date';\nimport { _x } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } 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';\nimport { unlock } from '../../lock-unlock';\n\nconst { PrivatePublishDateTimePicker } = unlock( blockEditorPrivateApis );\n\n/**\n * Renders the PostSchedule component. It allows the user to schedule a post.\n *\n * @param {Object} props Props.\n * @param {Function} props.onClose Function to close the component.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PostSchedule( props ) {\n\treturn (\n\t\t<PrivatePostSchedule\n\t\t\t{ ...props }\n\t\t\tshowPopoverHeaderActions\n\t\t\tisCompact={ false }\n\t\t/>\n\t);\n}\n\nexport function PrivatePostSchedule( {\n\tonClose,\n\tshowPopoverHeaderActions,\n\tisCompact,\n} ) {\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 scheduled 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<PrivatePublishDateTimePicker\n\t\t\tcurrentDate={ postDate }\n\t\t\tonChange={ onUpdateDate }\n\t\t\tis12Hour={ is12HourTime }\n\t\t\tdateOrder={\n\t\t\t\t/* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */\n\t\t\t\t_x( 'dmy', 'date order' )\n\t\t\t}\n\t\t\tevents={ events }\n\t\t\tonMonthPreviewed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AAA,QAEC,GAAI,OAAO,YAAa;AAAA;AAAA,MAEzB;AAAA,MACA,kBAAmB,CAAE,SACpB,kBAAmB,SAAU,IAAK,CAAE;AAAA,MAErC;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-schedule/label.js
1
2
  import { __, _x, sprintf, isRTL } from "@wordpress/i18n";
2
3
  import { getSettings, getDate, dateI18n } from "@wordpress/date";
3
4
  import { useSelect } from "@wordpress/data";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-schedule/label.js"],
4
4
  "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\n/**\n * Renders the PostScheduleLabel component.\n *\n * @param {Object} props Props.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PostScheduleLabel( props ) {\n\treturn usePostScheduleLabel( props );\n}\n\n/**\n * Custom hook to get the label for post schedule.\n *\n * @param {Object} options Options for the hook.\n * @param {boolean} options.full Whether to get the full label or not. Default is false.\n *\n * @return {string} The label for post schedule.\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: 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\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"],
5
- "mappings": "AAGA,SAAS,IAAI,IAAI,SAAS,aAAa;AACvC,SAAS,aAAa,SAAS,gBAAgB;AAC/C,SAAS,iBAAiB;AAK1B,SAAS,SAAS,mBAAmB;AAStB,SAAR,kBAAoC,OAAQ;AAClD,SAAO,qBAAsB,KAAM;AACpC;AAUO,SAAS,qBAAsB,EAAE,OAAO,MAAM,IAAI,CAAC,GAAI;AAC7D,QAAM,EAAE,MAAM,WAAW,IAAI;AAAA,IAC5B,CAAE,YAAc;AAAA,MACf,MAAM,OAAQ,WAAY,EAAE,uBAAwB,MAAO;AAAA,MAC3D,YAAY,OAAQ,WAAY,EAAE,yBAAyB;AAAA,IAC5D;AAAA,IACA,CAAC;AAAA,EACF;AAEA,SAAO,OACJ,yBAA0B,IAAK,IAC/B,qBAAsB,MAAM,EAAE,WAAW,CAAE;AAC/C;AAEO,SAAS,yBAA0B,eAAgB;AACzD,QAAM,OAAO,QAAS,aAAc;AAEpC,QAAM,uBAAuB,wBAAwB;AACrD,QAAM,gBAAgB;AAAA;AAAA,IAErB,GAAI,mBAAmB,gCAAiC;AAAA,IACxD;AAAA,EACD;AACA,SAAO,MAAM,IACV,GAAI,oBAAqB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AAM,SAAS,KACnC,KAAK,YAAY,MAAM,MAAM,YAAY;AAE3C;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-schedule/panel.js
2
2
  import { Button, Dropdown } from "@wordpress/components";
3
3
  import { __, sprintf } from "@wordpress/i18n";
4
4
  import { useState, useMemo } from "@wordpress/element";
@@ -14,7 +14,8 @@ import {
14
14
  PATTERN_POST_TYPE,
15
15
  NAVIGATION_POST_TYPE
16
16
  } from "../../store/constants";
17
- const DESIGN_POST_TYPES = [
17
+ import { jsx } from "react/jsx-runtime";
18
+ var DESIGN_POST_TYPES = [
18
19
  TEMPLATE_POST_TYPE,
19
20
  TEMPLATE_PART_POST_TYPE,
20
21
  PATTERN_POST_TYPE,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-schedule/panel.js"],
4
4
  "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\n/**\n * Renders the Post Schedule Panel component.\n *\n * @return {React.ReactNode} The rendered component.\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: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\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\tsize=\"compact\"\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\ttooltipPosition=\"middle left\"\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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