@wordpress/editor 13.35.0 → 14.0.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 (924) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +333 -39
  3. package/build/bindings/index.js +1 -3
  4. package/build/bindings/index.js.map +1 -1
  5. package/build/bindings/pattern-overrides.js +1 -1
  6. package/build/bindings/pattern-overrides.js.map +1 -1
  7. package/build/bindings/post-meta.js +38 -2
  8. package/build/bindings/post-meta.js.map +1 -1
  9. package/build/components/autocompleters/user.js +12 -8
  10. package/build/components/autocompleters/user.js.map +1 -1
  11. package/build/components/block-manager/category.js +19 -17
  12. package/build/components/block-manager/category.js.map +1 -1
  13. package/build/components/block-manager/checklist.js +15 -14
  14. package/build/components/block-manager/checklist.js.map +1 -1
  15. package/build/components/block-manager/index.js +37 -33
  16. package/build/components/block-manager/index.js.map +1 -1
  17. package/build/components/block-removal-warnings/index.js +2 -2
  18. package/build/components/block-removal-warnings/index.js.map +1 -1
  19. package/build/components/block-settings-menu/content-only-settings-menu.js +46 -32
  20. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  21. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  22. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  23. package/build/components/blog-title/index.js +116 -0
  24. package/build/components/blog-title/index.js.map +1 -0
  25. package/build/components/collapsible-block-toolbar/index.js +21 -18
  26. package/build/components/collapsible-block-toolbar/index.js.map +1 -1
  27. package/build/components/commands/index.js +109 -3
  28. package/build/components/commands/index.js.map +1 -1
  29. package/build/components/create-template-part-modal/index.js +167 -0
  30. package/build/components/create-template-part-modal/index.js.map +1 -0
  31. package/build/components/create-template-part-modal/utils.js +64 -0
  32. package/build/components/create-template-part-modal/utils.js.map +1 -0
  33. package/build/components/deprecated.js +2 -2
  34. package/build/components/deprecated.js.map +1 -1
  35. package/build/components/document-bar/index.js +94 -70
  36. package/build/components/document-bar/index.js.map +1 -1
  37. package/build/components/document-outline/index.js +124 -121
  38. package/build/components/document-outline/index.js.map +1 -1
  39. package/build/components/document-outline/item.js +18 -14
  40. package/build/components/document-outline/item.js.map +1 -1
  41. package/build/components/document-tools/index.js +56 -53
  42. package/build/components/document-tools/index.js.map +1 -1
  43. package/build/components/editor-help/add-blocks.native.js +14 -11
  44. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  45. package/build/components/editor-help/customize-blocks.native.js +14 -11
  46. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  47. package/build/components/editor-help/help-detail-navigation-screen.native.js +32 -22
  48. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  49. package/build/components/editor-help/help-get-support-button.native.js +8 -6
  50. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  51. package/build/components/editor-help/help-section-title.native.js +8 -6
  52. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  53. package/build/components/editor-help/help-topic-row.native.js +7 -6
  54. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  55. package/build/components/editor-help/icon-move-blocks.native.js +7 -6
  56. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  57. package/build/components/editor-help/index.native.js +94 -76
  58. package/build/components/editor-help/index.native.js.map +1 -1
  59. package/build/components/editor-help/intro-to-blocks.native.js +41 -37
  60. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  61. package/build/components/editor-help/move-blocks.native.js +25 -21
  62. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  63. package/build/components/editor-help/remove-blocks.native.js +12 -9
  64. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  65. package/build/components/editor-help/view-sections.native.js +24 -19
  66. package/build/components/editor-help/view-sections.native.js.map +1 -1
  67. package/build/components/editor-history/redo.js +2 -2
  68. package/build/components/editor-history/redo.js.map +1 -1
  69. package/build/components/editor-history/undo.js +2 -2
  70. package/build/components/editor-history/undo.js.map +1 -1
  71. package/build/components/editor-interface/content-slot-fill.js +23 -0
  72. package/build/components/editor-interface/content-slot-fill.js.map +1 -0
  73. package/build/components/editor-interface/index.js +178 -0
  74. package/build/components/editor-interface/index.js.map +1 -0
  75. package/build/components/editor-notices/index.js +22 -9
  76. package/build/components/editor-notices/index.js.map +1 -1
  77. package/build/components/editor-snackbars/index.js +2 -2
  78. package/build/components/editor-snackbars/index.js.map +1 -1
  79. package/build/components/entities-saved-states/entity-record-item.js +37 -10
  80. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  81. package/build/components/entities-saved-states/entity-type-list.js +25 -22
  82. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  83. package/build/components/entities-saved-states/index.js +53 -46
  84. package/build/components/entities-saved-states/index.js.map +1 -1
  85. package/build/components/error-boundary/index.js +27 -14
  86. package/build/components/error-boundary/index.js.map +1 -1
  87. package/build/components/error-boundary/index.native.js +45 -35
  88. package/build/components/error-boundary/index.native.js.map +1 -1
  89. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -4
  90. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  91. package/build/components/global-styles-provider/index.js +81 -16
  92. package/build/components/global-styles-provider/index.js.map +1 -1
  93. package/build/components/header/back-button.js +34 -0
  94. package/build/components/header/back-button.js.map +1 -0
  95. package/build/components/header/index.js +88 -59
  96. package/build/components/header/index.js.map +1 -1
  97. package/build/components/inserter-sidebar/index.js +45 -19
  98. package/build/components/inserter-sidebar/index.js.map +1 -1
  99. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  100. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  101. package/build/components/keyboard-shortcut-help-modal/index.js +53 -48
  102. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  103. package/build/components/keyboard-shortcut-help-modal/shortcut.js +30 -26
  104. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  105. package/build/components/list-view-sidebar/index.js +59 -47
  106. package/build/components/list-view-sidebar/index.js.map +1 -1
  107. package/build/components/list-view-sidebar/list-view-outline.js +21 -4
  108. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  109. package/build/components/local-autosave-monitor/index.js +15 -2
  110. package/build/components/local-autosave-monitor/index.js.map +1 -1
  111. package/build/components/mode-switcher/index.js +10 -10
  112. package/build/components/mode-switcher/index.js.map +1 -1
  113. package/build/components/more-menu/copy-content-menu-item.js +5 -4
  114. package/build/components/more-menu/copy-content-menu-item.js.map +1 -1
  115. package/build/components/more-menu/index.js +89 -76
  116. package/build/components/more-menu/index.js.map +1 -1
  117. package/build/components/more-menu/tools-more-menu-group.js +2 -2
  118. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  119. package/build/components/more-menu/view-more-menu-group.js +2 -2
  120. package/build/components/more-menu/view-more-menu-group.js.map +1 -1
  121. package/build/components/offline-status/index.native.js +12 -11
  122. package/build/components/offline-status/index.native.js.map +1 -1
  123. package/build/components/page-attributes/order.js +87 -14
  124. package/build/components/page-attributes/order.js.map +1 -1
  125. package/build/components/page-attributes/panel.js +10 -19
  126. package/build/components/page-attributes/panel.js.map +1 -1
  127. package/build/components/page-attributes/parent.js +86 -3
  128. package/build/components/page-attributes/parent.js.map +1 -1
  129. package/build/components/pattern-duplicate-modal/index.js +59 -0
  130. package/build/components/pattern-duplicate-modal/index.js.map +1 -0
  131. package/build/components/pattern-overrides-panel/index.js +2 -2
  132. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  133. package/build/components/pattern-rename-modal/index.js +58 -0
  134. package/build/components/pattern-rename-modal/index.js.map +1 -0
  135. package/build/components/plugin-document-setting-panel/index.js +17 -12
  136. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  137. package/build/components/plugin-post-publish-panel/index.js +10 -7
  138. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  139. package/build/components/plugin-post-status-info/index.js +7 -4
  140. package/build/components/plugin-post-status-info/index.js.map +1 -1
  141. package/build/components/plugin-pre-publish-panel/index.js +10 -7
  142. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  143. package/build/components/plugin-sidebar/index.js +3 -4
  144. package/build/components/plugin-sidebar/index.js.map +1 -1
  145. package/build/components/plugin-sidebar-more-menu-item/index.js +3 -5
  146. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  147. package/build/components/post-actions/actions.js +378 -309
  148. package/build/components/post-actions/actions.js.map +1 -1
  149. package/build/components/post-actions/export-pattern-action.js +64 -0
  150. package/build/components/post-actions/export-pattern-action.js.map +1 -0
  151. package/build/components/post-actions/export-pattern-action.native.js +11 -0
  152. package/build/components/post-actions/export-pattern-action.native.js.map +1 -0
  153. package/build/components/post-actions/index.js +66 -50
  154. package/build/components/post-actions/index.js.map +1 -1
  155. package/build/components/post-author/check.js +6 -6
  156. package/build/components/post-author/check.js.map +1 -1
  157. package/build/components/post-author/combobox.js +4 -3
  158. package/build/components/post-author/combobox.js.map +1 -1
  159. package/build/components/post-author/hook.js +2 -1
  160. package/build/components/post-author/hook.js.map +1 -1
  161. package/build/components/post-author/index.js +3 -3
  162. package/build/components/post-author/index.js.map +1 -1
  163. package/build/components/post-author/panel.js +72 -4
  164. package/build/components/post-author/panel.js.map +1 -1
  165. package/build/components/post-author/select.js +4 -3
  166. package/build/components/post-author/select.js.map +1 -1
  167. package/build/components/post-card-panel/index.js +54 -19
  168. package/build/components/post-card-panel/index.js.map +1 -1
  169. package/build/components/post-comments/index.js +38 -22
  170. package/build/components/post-comments/index.js.map +1 -1
  171. package/build/components/post-content-information/index.js +8 -5
  172. package/build/components/post-content-information/index.js.map +1 -1
  173. package/build/components/post-discussion/panel.js +54 -38
  174. package/build/components/post-discussion/panel.js.map +1 -1
  175. package/build/components/post-excerpt/check.js +6 -6
  176. package/build/components/post-excerpt/check.js.map +1 -1
  177. package/build/components/post-excerpt/index.js +18 -17
  178. package/build/components/post-excerpt/index.js.map +1 -1
  179. package/build/components/post-excerpt/panel.js +59 -42
  180. package/build/components/post-excerpt/panel.js.map +1 -1
  181. package/build/components/post-excerpt/plugin.js +7 -4
  182. package/build/components/post-excerpt/plugin.js.map +1 -1
  183. package/build/components/post-featured-image/check.js +17 -7
  184. package/build/components/post-featured-image/check.js.map +1 -1
  185. package/build/components/post-featured-image/index.js +77 -49
  186. package/build/components/post-featured-image/index.js.map +1 -1
  187. package/build/components/post-featured-image/panel.js +22 -7
  188. package/build/components/post-featured-image/panel.js.map +1 -1
  189. package/build/components/post-format/check.js +14 -4
  190. package/build/components/post-format/check.js.map +1 -1
  191. package/build/components/post-format/index.js +37 -20
  192. package/build/components/post-format/index.js.map +1 -1
  193. package/build/components/post-format/panel.js +73 -7
  194. package/build/components/post-format/panel.js.map +1 -1
  195. package/build/components/post-last-edited-panel/index.js +7 -4
  196. package/build/components/post-last-edited-panel/index.js.map +1 -1
  197. package/build/components/post-last-revision/check.js +13 -5
  198. package/build/components/post-last-revision/check.js.map +1 -1
  199. package/build/components/post-last-revision/index.js +19 -13
  200. package/build/components/post-last-revision/index.js.map +1 -1
  201. package/build/components/post-last-revision/panel.js +12 -5
  202. package/build/components/post-last-revision/panel.js.map +1 -1
  203. package/build/components/post-locked-modal/index.js +57 -35
  204. package/build/components/post-locked-modal/index.js.map +1 -1
  205. package/build/components/post-panel-row/index.js +11 -8
  206. package/build/components/post-panel-row/index.js.map +1 -1
  207. package/build/components/post-panel-section/index.js +5 -4
  208. package/build/components/post-panel-section/index.js.map +1 -1
  209. package/build/components/post-pending-status/check.js +10 -0
  210. package/build/components/post-pending-status/check.js.map +1 -1
  211. package/build/components/post-pending-status/index.js +14 -7
  212. package/build/components/post-pending-status/index.js.map +1 -1
  213. package/build/components/post-pingbacks/index.js +13 -5
  214. package/build/components/post-pingbacks/index.js.map +1 -1
  215. package/build/components/post-preview-button/index.js +45 -21
  216. package/build/components/post-preview-button/index.js.map +1 -1
  217. package/build/components/post-publish-button/index.js +21 -11
  218. package/build/components/post-publish-button/index.js.map +1 -1
  219. package/build/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  220. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  221. package/build/components/post-publish-panel/index.js +46 -33
  222. package/build/components/post-publish-panel/index.js.map +1 -1
  223. package/build/components/post-publish-panel/maybe-category-panel.js +12 -9
  224. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  225. package/build/components/post-publish-panel/maybe-post-format-panel.js +21 -15
  226. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  227. package/build/components/post-publish-panel/maybe-tags-panel.js +13 -10
  228. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  229. package/build/components/post-publish-panel/maybe-upload-media.js +29 -24
  230. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  231. package/build/components/post-publish-panel/postpublish.js +55 -38
  232. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  233. package/build/components/post-publish-panel/prepublish.js +41 -26
  234. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  235. package/build/components/post-saved-state/index.js +8 -8
  236. package/build/components/post-saved-state/index.js.map +1 -1
  237. package/build/components/post-schedule/check.js +8 -0
  238. package/build/components/post-schedule/check.js.map +1 -1
  239. package/build/components/post-schedule/index.js +30 -5
  240. package/build/components/post-schedule/index.js.map +1 -1
  241. package/build/components/post-schedule/label.js +16 -0
  242. package/build/components/post-schedule/label.js.map +1 -1
  243. package/build/components/post-schedule/panel.js +43 -30
  244. package/build/components/post-schedule/panel.js.map +1 -1
  245. package/build/components/post-slug/check.js +5 -4
  246. package/build/components/post-slug/check.js.map +1 -1
  247. package/build/components/post-slug/index.js +5 -3
  248. package/build/components/post-slug/index.js.map +1 -1
  249. package/build/components/post-slug/panel.js +7 -4
  250. package/build/components/post-slug/panel.js.map +1 -1
  251. package/build/components/post-status/index.js +118 -119
  252. package/build/components/post-status/index.js.map +1 -1
  253. package/build/components/post-sticky/index.js +16 -8
  254. package/build/components/post-sticky/index.js.map +1 -1
  255. package/build/components/post-sticky/panel.js +6 -2
  256. package/build/components/post-sticky/panel.js.map +1 -1
  257. package/build/components/post-switch-to-draft-button/index.js +25 -21
  258. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  259. package/build/components/post-sync-status/index.js +8 -6
  260. package/build/components/post-sync-status/index.js.map +1 -1
  261. package/build/components/post-taxonomies/flat-term-selector.js +21 -20
  262. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  263. package/build/components/post-taxonomies/hierarchical-term-selector.js +71 -61
  264. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  265. package/build/components/post-taxonomies/index.js +6 -6
  266. package/build/components/post-taxonomies/index.js.map +1 -1
  267. package/build/components/post-taxonomies/most-used-terms.js +19 -15
  268. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  269. package/build/components/post-taxonomies/panel.js +15 -11
  270. package/build/components/post-taxonomies/panel.js.map +1 -1
  271. package/build/components/post-template/block-theme.js +42 -32
  272. package/build/components/post-template/block-theme.js.map +1 -1
  273. package/build/components/post-template/classic-theme.js +73 -50
  274. package/build/components/post-template/classic-theme.js.map +1 -1
  275. package/build/components/post-template/create-new-template-modal.js +33 -27
  276. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  277. package/build/components/post-template/create-new-template.js +14 -11
  278. package/build/components/post-template/create-new-template.js.map +1 -1
  279. package/build/components/post-template/panel.js +16 -10
  280. package/build/components/post-template/panel.js.map +1 -1
  281. package/build/components/post-template/reset-default-template.js +5 -4
  282. package/build/components/post-template/reset-default-template.js.map +1 -1
  283. package/build/components/post-template/swap-template-button.js +20 -15
  284. package/build/components/post-template/swap-template-button.js.map +1 -1
  285. package/build/components/post-text-editor/index.js +27 -20
  286. package/build/components/post-text-editor/index.js.map +1 -1
  287. package/build/components/post-title/index.js +29 -17
  288. package/build/components/post-title/index.js.map +1 -1
  289. package/build/components/post-title/index.native.js +81 -57
  290. package/build/components/post-title/index.native.js.map +1 -1
  291. package/build/components/post-title/post-title-raw.js +10 -3
  292. package/build/components/post-title/post-title-raw.js.map +1 -1
  293. package/build/components/post-title/use-post-title-focus.js +7 -0
  294. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  295. package/build/components/post-title/use-post-title.js +5 -0
  296. package/build/components/post-title/use-post-title.js.map +1 -1
  297. package/build/components/post-transform-panel/index.js +11 -11
  298. package/build/components/post-transform-panel/index.js.map +1 -1
  299. package/build/components/post-trash/index.js +19 -15
  300. package/build/components/post-trash/index.js.map +1 -1
  301. package/build/components/post-url/check.js +8 -0
  302. package/build/components/post-url/check.js.map +1 -1
  303. package/build/components/post-url/index.js +98 -73
  304. package/build/components/post-url/index.js.map +1 -1
  305. package/build/components/post-url/label.js +11 -0
  306. package/build/components/post-url/label.js.map +1 -1
  307. package/build/components/post-url/panel.js +33 -25
  308. package/build/components/post-url/panel.js.map +1 -1
  309. package/build/components/post-view-link/index.js +2 -2
  310. package/build/components/post-view-link/index.js.map +1 -1
  311. package/build/components/post-visibility/check.js +9 -0
  312. package/build/components/post-visibility/check.js.map +1 -1
  313. package/build/components/post-visibility/index.js +83 -68
  314. package/build/components/post-visibility/index.js.map +1 -1
  315. package/build/components/post-visibility/label.js +11 -0
  316. package/build/components/post-visibility/label.js.map +1 -1
  317. package/build/components/posts-per-page/index.js +109 -0
  318. package/build/components/posts-per-page/index.js.map +1 -0
  319. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  320. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  321. package/build/components/preferences-modal/index.js +124 -102
  322. package/build/components/preferences-modal/index.js.map +1 -1
  323. package/build/components/preview-dropdown/index.js +47 -31
  324. package/build/components/preview-dropdown/index.js.map +1 -1
  325. package/build/components/provider/index.js +94 -20
  326. package/build/components/provider/index.js.map +1 -1
  327. package/build/components/provider/index.native.js +55 -19
  328. package/build/components/provider/index.native.js.map +1 -1
  329. package/build/components/provider/use-block-editor-settings.js +7 -6
  330. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  331. package/build/components/provider/with-registry-provider.js +31 -24
  332. package/build/components/provider/with-registry-provider.js.map +1 -1
  333. package/build/components/resizable-editor/index.js +96 -0
  334. package/build/components/resizable-editor/index.js.map +1 -0
  335. package/build/components/resizable-editor/resize-handle.js +59 -0
  336. package/build/components/resizable-editor/resize-handle.js.map +1 -0
  337. package/build/components/save-publish-panels/index.js +35 -26
  338. package/build/components/save-publish-panels/index.js.map +1 -1
  339. package/build/components/sidebar/header.js +17 -14
  340. package/build/components/sidebar/header.js.map +1 -1
  341. package/build/components/sidebar/index.js +36 -32
  342. package/build/components/sidebar/index.js.map +1 -1
  343. package/build/components/sidebar/post-summary.js +38 -33
  344. package/build/components/sidebar/post-summary.js.map +1 -1
  345. package/build/components/site-discussion/index.js +133 -0
  346. package/build/components/site-discussion/index.js.map +1 -0
  347. package/build/components/start-page-options/index.js +13 -11
  348. package/build/components/start-page-options/index.js.map +1 -1
  349. package/build/components/start-template-options/index.js +29 -23
  350. package/build/components/start-template-options/index.js.map +1 -1
  351. package/build/components/table-of-contents/index.js +4 -4
  352. package/build/components/table-of-contents/index.js.map +1 -1
  353. package/build/components/table-of-contents/panel.js +53 -35
  354. package/build/components/table-of-contents/panel.js.map +1 -1
  355. package/build/components/template-areas/index.js +36 -22
  356. package/build/components/template-areas/index.js.map +1 -1
  357. package/build/components/template-content-panel/index.js +7 -6
  358. package/build/components/template-content-panel/index.js.map +1 -1
  359. package/build/components/template-validation-notice/index.js +25 -21
  360. package/build/components/template-validation-notice/index.js.map +1 -1
  361. package/build/components/text-editor/index.js +73 -0
  362. package/build/components/text-editor/index.js.map +1 -0
  363. package/build/components/time-to-read/index.js +8 -8
  364. package/build/components/time-to-read/index.js.map +1 -1
  365. package/build/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +6 -6
  366. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  367. package/build/components/{editor-canvas → visual-editor}/index.js +115 -74
  368. package/build/components/visual-editor/index.js.map +1 -0
  369. package/build/components/word-count/index.js +5 -4
  370. package/build/components/word-count/index.js.map +1 -1
  371. package/build/hooks/custom-sources-backwards-compatibility.js +3 -4
  372. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  373. package/build/hooks/index.js +1 -0
  374. package/build/hooks/index.js.map +1 -1
  375. package/build/hooks/media-upload.js +10 -0
  376. package/build/hooks/media-upload.js.map +1 -0
  377. package/build/hooks/pattern-overrides.js +15 -11
  378. package/build/hooks/pattern-overrides.js.map +1 -1
  379. package/build/private-apis.js +10 -28
  380. package/build/private-apis.js.map +1 -1
  381. package/build/private-apis.native.js +2 -26
  382. package/build/private-apis.native.js.map +1 -1
  383. package/build/store/constants.js +4 -1
  384. package/build/store/constants.js.map +1 -1
  385. package/build/store/private-actions.js +10 -14
  386. package/build/store/private-actions.js.map +1 -1
  387. package/build/store/private-selectors.js +39 -1
  388. package/build/store/private-selectors.js.map +1 -1
  389. package/build/store/selectors.js +1 -1
  390. package/build/store/selectors.js.map +1 -1
  391. package/build/utils/set-nested-value.js +44 -0
  392. package/build/utils/set-nested-value.js.map +1 -0
  393. package/build-module/bindings/index.js +1 -3
  394. package/build-module/bindings/index.js.map +1 -1
  395. package/build-module/bindings/pattern-overrides.js +1 -1
  396. package/build-module/bindings/pattern-overrides.js.map +1 -1
  397. package/build-module/bindings/post-meta.js +38 -2
  398. package/build-module/bindings/post-meta.js.map +1 -1
  399. package/build-module/components/autocompleters/user.js +14 -9
  400. package/build-module/components/autocompleters/user.js.map +1 -1
  401. package/build-module/components/block-manager/category.js +20 -17
  402. package/build-module/components/block-manager/category.js.map +1 -1
  403. package/build-module/components/block-manager/checklist.js +16 -14
  404. package/build-module/components/block-manager/checklist.js.map +1 -1
  405. package/build-module/components/block-manager/index.js +38 -33
  406. package/build-module/components/block-manager/index.js.map +1 -1
  407. package/build-module/components/block-removal-warnings/index.js +2 -2
  408. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  409. package/build-module/components/block-settings-menu/content-only-settings-menu.js +48 -32
  410. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  411. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  412. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  413. package/build-module/components/blog-title/index.js +110 -0
  414. package/build-module/components/blog-title/index.js.map +1 -0
  415. package/build-module/components/collapsible-block-toolbar/index.js +23 -18
  416. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  417. package/build-module/components/commands/index.js +111 -5
  418. package/build-module/components/commands/index.js.map +1 -1
  419. package/build-module/components/create-template-part-modal/index.js +160 -0
  420. package/build-module/components/create-template-part-modal/index.js.map +1 -0
  421. package/build-module/components/create-template-part-modal/utils.js +54 -0
  422. package/build-module/components/create-template-part-modal/utils.js.map +1 -0
  423. package/build-module/components/deprecated.js +2 -2
  424. package/build-module/components/deprecated.js.map +1 -1
  425. package/build-module/components/document-bar/index.js +93 -68
  426. package/build-module/components/document-bar/index.js.map +1 -1
  427. package/build-module/components/document-outline/index.js +125 -120
  428. package/build-module/components/document-outline/index.js.map +1 -1
  429. package/build-module/components/document-outline/item.js +19 -14
  430. package/build-module/components/document-outline/item.js.map +1 -1
  431. package/build-module/components/document-tools/index.js +58 -53
  432. package/build-module/components/document-tools/index.js.map +1 -1
  433. package/build-module/components/editor-help/add-blocks.native.js +16 -11
  434. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  435. package/build-module/components/editor-help/customize-blocks.native.js +16 -11
  436. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  437. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +33 -22
  438. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  439. package/build-module/components/editor-help/help-get-support-button.native.js +8 -6
  440. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  441. package/build-module/components/editor-help/help-section-title.native.js +8 -6
  442. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  443. package/build-module/components/editor-help/help-topic-row.native.js +7 -6
  444. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  445. package/build-module/components/editor-help/icon-move-blocks.native.js +7 -6
  446. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  447. package/build-module/components/editor-help/index.native.js +96 -76
  448. package/build-module/components/editor-help/index.native.js.map +1 -1
  449. package/build-module/components/editor-help/intro-to-blocks.native.js +43 -37
  450. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  451. package/build-module/components/editor-help/move-blocks.native.js +27 -21
  452. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  453. package/build-module/components/editor-help/remove-blocks.native.js +14 -9
  454. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  455. package/build-module/components/editor-help/view-sections.native.js +25 -19
  456. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  457. package/build-module/components/editor-history/redo.js +2 -2
  458. package/build-module/components/editor-history/redo.js.map +1 -1
  459. package/build-module/components/editor-history/undo.js +2 -2
  460. package/build-module/components/editor-history/undo.js.map +1 -1
  461. package/build-module/components/editor-interface/content-slot-fill.js +16 -0
  462. package/build-module/components/editor-interface/content-slot-fill.js.map +1 -0
  463. package/build-module/components/editor-interface/index.js +172 -0
  464. package/build-module/components/editor-interface/index.js.map +1 -0
  465. package/build-module/components/editor-notices/index.js +25 -9
  466. package/build-module/components/editor-notices/index.js.map +1 -1
  467. package/build-module/components/editor-snackbars/index.js +2 -2
  468. package/build-module/components/editor-snackbars/index.js.map +1 -1
  469. package/build-module/components/entities-saved-states/entity-record-item.js +40 -11
  470. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  471. package/build-module/components/entities-saved-states/entity-type-list.js +26 -22
  472. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  473. package/build-module/components/entities-saved-states/index.js +54 -46
  474. package/build-module/components/entities-saved-states/index.js.map +1 -1
  475. package/build-module/components/error-boundary/index.js +27 -14
  476. package/build-module/components/error-boundary/index.js.map +1 -1
  477. package/build-module/components/error-boundary/index.native.js +46 -35
  478. package/build-module/components/error-boundary/index.native.js.map +1 -1
  479. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +2 -2
  480. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  481. package/build-module/components/global-styles-provider/index.js +82 -17
  482. package/build-module/components/global-styles-provider/index.js.map +1 -1
  483. package/build-module/components/header/back-button.js +28 -0
  484. package/build-module/components/header/back-button.js.map +1 -0
  485. package/build-module/components/header/index.js +89 -59
  486. package/build-module/components/header/index.js.map +1 -1
  487. package/build-module/components/inserter-sidebar/index.js +47 -21
  488. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  489. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  490. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  491. package/build-module/components/keyboard-shortcut-help-modal/index.js +54 -48
  492. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  493. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +32 -26
  494. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  495. package/build-module/components/list-view-sidebar/index.js +60 -47
  496. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  497. package/build-module/components/list-view-sidebar/list-view-outline.js +23 -4
  498. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  499. package/build-module/components/local-autosave-monitor/index.js +15 -2
  500. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  501. package/build-module/components/mode-switcher/index.js +9 -8
  502. package/build-module/components/mode-switcher/index.js.map +1 -1
  503. package/build-module/components/more-menu/copy-content-menu-item.js +5 -4
  504. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -1
  505. package/build-module/components/more-menu/index.js +91 -76
  506. package/build-module/components/more-menu/index.js.map +1 -1
  507. package/build-module/components/more-menu/tools-more-menu-group.js +2 -2
  508. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  509. package/build-module/components/more-menu/view-more-menu-group.js +2 -2
  510. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -1
  511. package/build-module/components/offline-status/index.native.js +12 -9
  512. package/build-module/components/offline-status/index.native.js.map +1 -1
  513. package/build-module/components/page-attributes/order.js +90 -17
  514. package/build-module/components/page-attributes/order.js.map +1 -1
  515. package/build-module/components/page-attributes/panel.js +13 -21
  516. package/build-module/components/page-attributes/panel.js.map +1 -1
  517. package/build-module/components/page-attributes/parent.js +88 -5
  518. package/build-module/components/page-attributes/parent.js.map +1 -1
  519. package/build-module/components/pattern-duplicate-modal/index.js +51 -0
  520. package/build-module/components/pattern-duplicate-modal/index.js.map +1 -0
  521. package/build-module/components/pattern-overrides-panel/index.js +2 -2
  522. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  523. package/build-module/components/pattern-rename-modal/index.js +50 -0
  524. package/build-module/components/pattern-rename-modal/index.js.map +1 -0
  525. package/build-module/components/plugin-document-setting-panel/index.js +19 -12
  526. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  527. package/build-module/components/plugin-post-publish-panel/index.js +10 -7
  528. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  529. package/build-module/components/plugin-post-status-info/index.js +7 -4
  530. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  531. package/build-module/components/plugin-pre-publish-panel/index.js +10 -7
  532. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  533. package/build-module/components/plugin-sidebar/index.js +2 -2
  534. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  535. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -3
  536. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  537. package/build-module/components/post-actions/actions.js +379 -309
  538. package/build-module/components/post-actions/actions.js.map +1 -1
  539. package/build-module/components/post-actions/export-pattern-action.js +58 -0
  540. package/build-module/components/post-actions/export-pattern-action.js.map +1 -0
  541. package/build-module/components/post-actions/export-pattern-action.native.js +5 -0
  542. package/build-module/components/post-actions/export-pattern-action.native.js.map +1 -0
  543. package/build-module/components/post-actions/index.js +68 -50
  544. package/build-module/components/post-actions/index.js.map +1 -1
  545. package/build-module/components/post-author/check.js +5 -4
  546. package/build-module/components/post-author/check.js.map +1 -1
  547. package/build-module/components/post-author/combobox.js +4 -3
  548. package/build-module/components/post-author/combobox.js.map +1 -1
  549. package/build-module/components/post-author/hook.js +2 -1
  550. package/build-module/components/post-author/hook.js.map +1 -1
  551. package/build-module/components/post-author/index.js +3 -3
  552. package/build-module/components/post-author/index.js.map +1 -1
  553. package/build-module/components/post-author/panel.js +72 -4
  554. package/build-module/components/post-author/panel.js.map +1 -1
  555. package/build-module/components/post-author/select.js +4 -3
  556. package/build-module/components/post-author/select.js.map +1 -1
  557. package/build-module/components/post-card-panel/index.js +54 -20
  558. package/build-module/components/post-card-panel/index.js.map +1 -1
  559. package/build-module/components/post-comments/index.js +40 -22
  560. package/build-module/components/post-comments/index.js.map +1 -1
  561. package/build-module/components/post-content-information/index.js +8 -5
  562. package/build-module/components/post-content-information/index.js.map +1 -1
  563. package/build-module/components/post-discussion/panel.js +56 -39
  564. package/build-module/components/post-discussion/panel.js.map +1 -1
  565. package/build-module/components/post-excerpt/check.js +5 -4
  566. package/build-module/components/post-excerpt/check.js.map +1 -1
  567. package/build-module/components/post-excerpt/index.js +17 -15
  568. package/build-module/components/post-excerpt/index.js.map +1 -1
  569. package/build-module/components/post-excerpt/panel.js +60 -40
  570. package/build-module/components/post-excerpt/panel.js.map +1 -1
  571. package/build-module/components/post-excerpt/plugin.js +7 -4
  572. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  573. package/build-module/components/post-featured-image/check.js +18 -6
  574. package/build-module/components/post-featured-image/check.js.map +1 -1
  575. package/build-module/components/post-featured-image/index.js +78 -49
  576. package/build-module/components/post-featured-image/index.js.map +1 -1
  577. package/build-module/components/post-featured-image/panel.js +22 -7
  578. package/build-module/components/post-featured-image/panel.js.map +1 -1
  579. package/build-module/components/post-format/check.js +14 -4
  580. package/build-module/components/post-format/check.js.map +1 -1
  581. package/build-module/components/post-format/index.js +39 -21
  582. package/build-module/components/post-format/index.js.map +1 -1
  583. package/build-module/components/post-format/panel.js +75 -7
  584. package/build-module/components/post-format/panel.js.map +1 -1
  585. package/build-module/components/post-last-edited-panel/index.js +7 -4
  586. package/build-module/components/post-last-edited-panel/index.js.map +1 -1
  587. package/build-module/components/post-last-revision/check.js +14 -4
  588. package/build-module/components/post-last-revision/check.js.map +1 -1
  589. package/build-module/components/post-last-revision/index.js +21 -13
  590. package/build-module/components/post-last-revision/index.js.map +1 -1
  591. package/build-module/components/post-last-revision/panel.js +13 -4
  592. package/build-module/components/post-last-revision/panel.js.map +1 -1
  593. package/build-module/components/post-locked-modal/index.js +60 -34
  594. package/build-module/components/post-locked-modal/index.js.map +1 -1
  595. package/build-module/components/post-panel-row/index.js +12 -8
  596. package/build-module/components/post-panel-row/index.js.map +1 -1
  597. package/build-module/components/post-panel-section/index.js +5 -4
  598. package/build-module/components/post-panel-section/index.js.map +1 -1
  599. package/build-module/components/post-pending-status/check.js +11 -0
  600. package/build-module/components/post-pending-status/check.js.map +1 -1
  601. package/build-module/components/post-pending-status/index.js +15 -7
  602. package/build-module/components/post-pending-status/index.js.map +1 -1
  603. package/build-module/components/post-pingbacks/index.js +13 -5
  604. package/build-module/components/post-pingbacks/index.js.map +1 -1
  605. package/build-module/components/post-preview-button/index.js +47 -21
  606. package/build-module/components/post-preview-button/index.js.map +1 -1
  607. package/build-module/components/post-publish-button/index.js +22 -11
  608. package/build-module/components/post-publish-button/index.js.map +1 -1
  609. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  610. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  611. package/build-module/components/post-publish-panel/index.js +48 -33
  612. package/build-module/components/post-publish-panel/index.js.map +1 -1
  613. package/build-module/components/post-publish-panel/maybe-category-panel.js +13 -9
  614. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  615. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +22 -15
  616. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  617. package/build-module/components/post-publish-panel/maybe-tags-panel.js +14 -10
  618. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  619. package/build-module/components/post-publish-panel/maybe-upload-media.js +30 -24
  620. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  621. package/build-module/components/post-publish-panel/postpublish.js +57 -38
  622. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  623. package/build-module/components/post-publish-panel/prepublish.js +43 -26
  624. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  625. package/build-module/components/post-saved-state/index.js +8 -6
  626. package/build-module/components/post-saved-state/index.js.map +1 -1
  627. package/build-module/components/post-schedule/check.js +9 -0
  628. package/build-module/components/post-schedule/check.js.map +1 -1
  629. package/build-module/components/post-schedule/index.js +30 -6
  630. package/build-module/components/post-schedule/index.js.map +1 -1
  631. package/build-module/components/post-schedule/label.js +17 -0
  632. package/build-module/components/post-schedule/label.js.map +1 -1
  633. package/build-module/components/post-schedule/panel.js +43 -30
  634. package/build-module/components/post-schedule/panel.js.map +1 -1
  635. package/build-module/components/post-slug/check.js +5 -4
  636. package/build-module/components/post-slug/check.js.map +1 -1
  637. package/build-module/components/post-slug/index.js +5 -3
  638. package/build-module/components/post-slug/index.js.map +1 -1
  639. package/build-module/components/post-slug/panel.js +7 -4
  640. package/build-module/components/post-slug/panel.js.map +1 -1
  641. package/build-module/components/post-status/index.js +121 -120
  642. package/build-module/components/post-status/index.js.map +1 -1
  643. package/build-module/components/post-sticky/index.js +17 -9
  644. package/build-module/components/post-sticky/index.js.map +1 -1
  645. package/build-module/components/post-sticky/panel.js +6 -2
  646. package/build-module/components/post-sticky/panel.js.map +1 -1
  647. package/build-module/components/post-switch-to-draft-button/index.js +27 -21
  648. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  649. package/build-module/components/post-sync-status/index.js +8 -6
  650. package/build-module/components/post-sync-status/index.js.map +1 -1
  651. package/build-module/components/post-taxonomies/flat-term-selector.js +22 -18
  652. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  653. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +71 -59
  654. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  655. package/build-module/components/post-taxonomies/index.js +6 -6
  656. package/build-module/components/post-taxonomies/index.js.map +1 -1
  657. package/build-module/components/post-taxonomies/most-used-terms.js +20 -15
  658. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  659. package/build-module/components/post-taxonomies/panel.js +15 -11
  660. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  661. package/build-module/components/post-template/block-theme.js +44 -32
  662. package/build-module/components/post-template/block-theme.js.map +1 -1
  663. package/build-module/components/post-template/classic-theme.js +74 -50
  664. package/build-module/components/post-template/classic-theme.js.map +1 -1
  665. package/build-module/components/post-template/create-new-template-modal.js +34 -27
  666. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  667. package/build-module/components/post-template/create-new-template.js +16 -11
  668. package/build-module/components/post-template/create-new-template.js.map +1 -1
  669. package/build-module/components/post-template/panel.js +17 -9
  670. package/build-module/components/post-template/panel.js.map +1 -1
  671. package/build-module/components/post-template/reset-default-template.js +5 -4
  672. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  673. package/build-module/components/post-template/swap-template-button.js +22 -15
  674. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  675. package/build-module/components/post-text-editor/index.js +30 -19
  676. package/build-module/components/post-text-editor/index.js.map +1 -1
  677. package/build-module/components/post-title/index.js +29 -18
  678. package/build-module/components/post-title/index.js.map +1 -1
  679. package/build-module/components/post-title/index.native.js +81 -57
  680. package/build-module/components/post-title/index.native.js.map +1 -1
  681. package/build-module/components/post-title/post-title-raw.js +11 -2
  682. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  683. package/build-module/components/post-title/use-post-title-focus.js +8 -0
  684. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  685. package/build-module/components/post-title/use-post-title.js +6 -0
  686. package/build-module/components/post-title/use-post-title.js.map +1 -1
  687. package/build-module/components/post-transform-panel/index.js +12 -12
  688. package/build-module/components/post-transform-panel/index.js.map +1 -1
  689. package/build-module/components/post-trash/index.js +21 -15
  690. package/build-module/components/post-trash/index.js.map +1 -1
  691. package/build-module/components/post-url/check.js +9 -0
  692. package/build-module/components/post-url/check.js.map +1 -1
  693. package/build-module/components/post-url/index.js +100 -72
  694. package/build-module/components/post-url/index.js.map +1 -1
  695. package/build-module/components/post-url/label.js +12 -0
  696. package/build-module/components/post-url/label.js.map +1 -1
  697. package/build-module/components/post-url/panel.js +35 -24
  698. package/build-module/components/post-url/panel.js.map +1 -1
  699. package/build-module/components/post-view-link/index.js +2 -2
  700. package/build-module/components/post-view-link/index.js.map +1 -1
  701. package/build-module/components/post-visibility/check.js +10 -0
  702. package/build-module/components/post-visibility/check.js.map +1 -1
  703. package/build-module/components/post-visibility/index.js +85 -67
  704. package/build-module/components/post-visibility/index.js.map +1 -1
  705. package/build-module/components/post-visibility/label.js +12 -0
  706. package/build-module/components/post-visibility/label.js.map +1 -1
  707. package/build-module/components/posts-per-page/index.js +103 -0
  708. package/build-module/components/posts-per-page/index.js.map +1 -0
  709. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  710. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  711. package/build-module/components/preferences-modal/index.js +126 -102
  712. package/build-module/components/preferences-modal/index.js.map +1 -1
  713. package/build-module/components/preview-dropdown/index.js +49 -31
  714. package/build-module/components/preview-dropdown/index.js.map +1 -1
  715. package/build-module/components/provider/index.js +96 -20
  716. package/build-module/components/provider/index.js.map +1 -1
  717. package/build-module/components/provider/index.native.js +58 -20
  718. package/build-module/components/provider/index.native.js.map +1 -1
  719. package/build-module/components/provider/use-block-editor-settings.js +7 -6
  720. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  721. package/build-module/components/provider/with-registry-provider.js +33 -26
  722. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  723. package/build-module/components/resizable-editor/index.js +89 -0
  724. package/build-module/components/resizable-editor/index.js.map +1 -0
  725. package/build-module/components/resizable-editor/resize-handle.js +54 -0
  726. package/build-module/components/resizable-editor/resize-handle.js.map +1 -0
  727. package/build-module/components/save-publish-panels/index.js +37 -26
  728. package/build-module/components/save-publish-panels/index.js.map +1 -1
  729. package/build-module/components/sidebar/header.js +18 -14
  730. package/build-module/components/sidebar/header.js.map +1 -1
  731. package/build-module/components/sidebar/index.js +36 -31
  732. package/build-module/components/sidebar/index.js.map +1 -1
  733. package/build-module/components/sidebar/post-summary.js +33 -25
  734. package/build-module/components/sidebar/post-summary.js.map +1 -1
  735. package/build-module/components/site-discussion/index.js +127 -0
  736. package/build-module/components/site-discussion/index.js.map +1 -0
  737. package/build-module/components/start-page-options/index.js +13 -11
  738. package/build-module/components/start-page-options/index.js.map +1 -1
  739. package/build-module/components/start-template-options/index.js +30 -23
  740. package/build-module/components/start-template-options/index.js.map +1 -1
  741. package/build-module/components/table-of-contents/index.js +4 -4
  742. package/build-module/components/table-of-contents/index.js.map +1 -1
  743. package/build-module/components/table-of-contents/panel.js +55 -35
  744. package/build-module/components/table-of-contents/panel.js.map +1 -1
  745. package/build-module/components/template-areas/index.js +37 -22
  746. package/build-module/components/template-areas/index.js.map +1 -1
  747. package/build-module/components/template-content-panel/index.js +7 -6
  748. package/build-module/components/template-content-panel/index.js.map +1 -1
  749. package/build-module/components/template-validation-notice/index.js +27 -21
  750. package/build-module/components/template-validation-notice/index.js.map +1 -1
  751. package/build-module/components/text-editor/index.js +66 -0
  752. package/build-module/components/text-editor/index.js.map +1 -0
  753. package/build-module/components/time-to-read/index.js +7 -6
  754. package/build-module/components/time-to-read/index.js.map +1 -1
  755. package/build-module/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +5 -4
  756. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  757. package/build-module/components/{editor-canvas → visual-editor}/index.js +118 -75
  758. package/build-module/components/visual-editor/index.js.map +1 -0
  759. package/build-module/components/word-count/index.js +5 -4
  760. package/build-module/components/word-count/index.js.map +1 -1
  761. package/build-module/hooks/custom-sources-backwards-compatibility.js +2 -2
  762. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  763. package/build-module/hooks/index.js +1 -0
  764. package/build-module/hooks/index.js.map +1 -1
  765. package/build-module/hooks/media-upload.js +7 -0
  766. package/build-module/hooks/media-upload.js.map +1 -0
  767. package/build-module/hooks/pattern-overrides.js +17 -11
  768. package/build-module/hooks/pattern-overrides.js.map +1 -1
  769. package/build-module/private-apis.js +10 -28
  770. package/build-module/private-apis.js.map +1 -1
  771. package/build-module/private-apis.native.js +2 -26
  772. package/build-module/private-apis.native.js.map +1 -1
  773. package/build-module/store/constants.js +3 -0
  774. package/build-module/store/constants.js.map +1 -1
  775. package/build-module/store/private-actions.js +10 -14
  776. package/build-module/store/private-actions.js.map +1 -1
  777. package/build-module/store/private-selectors.js +38 -1
  778. package/build-module/store/private-selectors.js.map +1 -1
  779. package/build-module/store/selectors.js +1 -1
  780. package/build-module/store/selectors.js.map +1 -1
  781. package/build-module/utils/set-nested-value.js +38 -0
  782. package/build-module/utils/set-nested-value.js.map +1 -0
  783. package/build-style/style-rtl.css +318 -90
  784. package/build-style/style.css +318 -90
  785. package/package.json +40 -36
  786. package/src/bindings/index.js +1 -4
  787. package/src/bindings/pattern-overrides.js +1 -1
  788. package/src/bindings/post-meta.js +46 -6
  789. package/src/components/blog-title/index.js +124 -0
  790. package/src/components/blog-title/style.scss +4 -0
  791. package/src/components/commands/index.js +113 -3
  792. package/src/components/create-template-part-modal/index.js +205 -0
  793. package/src/components/create-template-part-modal/style.scss +69 -0
  794. package/src/components/create-template-part-modal/test/utils.js +60 -0
  795. package/src/components/create-template-part-modal/utils.js +67 -0
  796. package/src/components/document-bar/index.js +32 -21
  797. package/src/components/document-tools/index.js +2 -7
  798. package/src/components/editor-help/help-get-support-button.native.js +1 -1
  799. package/src/components/editor-interface/content-slot-fill.js +15 -0
  800. package/src/components/editor-interface/index.js +230 -0
  801. package/src/components/editor-notices/index.js +10 -0
  802. package/src/components/entities-saved-states/entity-record-item.js +45 -16
  803. package/src/components/entities-saved-states/style.scss +13 -0
  804. package/src/components/error-boundary/index.js +10 -0
  805. package/src/components/error-boundary/index.native.js +1 -1
  806. package/src/components/global-styles-provider/index.js +100 -8
  807. package/src/components/header/back-button.js +27 -0
  808. package/src/components/header/index.js +25 -10
  809. package/src/components/header/style.scss +5 -0
  810. package/src/components/inserter-sidebar/index.js +65 -32
  811. package/src/components/inserter-sidebar/style.scss +0 -13
  812. package/src/components/local-autosave-monitor/index.js +12 -0
  813. package/src/components/page-attributes/order.js +79 -3
  814. package/src/components/page-attributes/panel.js +10 -26
  815. package/src/components/page-attributes/parent.js +98 -2
  816. package/src/components/page-attributes/style.scss +19 -0
  817. package/src/components/pattern-duplicate-modal/index.js +50 -0
  818. package/src/components/pattern-rename-modal/index.js +44 -0
  819. package/src/components/post-actions/actions.js +306 -261
  820. package/src/components/post-actions/export-pattern-action.js +74 -0
  821. package/src/components/post-actions/export-pattern-action.native.js +4 -0
  822. package/src/components/post-actions/index.js +16 -5
  823. package/src/components/post-author/combobox.js +1 -0
  824. package/src/components/post-author/hook.js +1 -1
  825. package/src/components/post-author/panel.js +63 -2
  826. package/src/components/post-author/select.js +1 -0
  827. package/src/components/post-author/style.scss +6 -0
  828. package/src/components/post-card-panel/index.js +69 -22
  829. package/src/components/post-card-panel/style.scss +23 -1
  830. package/src/components/post-comments/index.js +5 -0
  831. package/src/components/post-discussion/panel.js +9 -2
  832. package/src/components/post-discussion/style.scss +1 -3
  833. package/src/components/post-excerpt/panel.js +45 -48
  834. package/src/components/post-excerpt/style.scss +0 -17
  835. package/src/components/post-featured-image/check.js +9 -0
  836. package/src/components/post-featured-image/index.js +15 -0
  837. package/src/components/post-featured-image/panel.js +9 -0
  838. package/src/components/post-format/check.js +8 -0
  839. package/src/components/post-format/index.js +15 -4
  840. package/src/components/post-format/panel.js +71 -6
  841. package/src/components/post-format/style.scss +10 -4
  842. package/src/components/post-last-revision/check.js +8 -0
  843. package/src/components/post-last-revision/index.js +7 -2
  844. package/src/components/post-last-revision/panel.js +5 -0
  845. package/src/components/post-locked-modal/index.js +6 -0
  846. package/src/components/post-panel-row/style.scss +15 -0
  847. package/src/components/post-pending-status/check.js +10 -0
  848. package/src/components/post-pending-status/index.js +5 -0
  849. package/src/components/post-pingbacks/index.js +6 -0
  850. package/src/components/post-preview-button/index.js +15 -0
  851. package/src/components/post-publish-button/index.js +17 -4
  852. package/src/components/post-publish-panel/index.js +1 -0
  853. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  854. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +3 -3
  855. package/src/components/post-schedule/check.js +8 -0
  856. package/src/components/post-schedule/index.js +30 -3
  857. package/src/components/post-schedule/label.js +15 -0
  858. package/src/components/post-schedule/panel.js +9 -1
  859. package/src/components/post-schedule/style.scss +0 -11
  860. package/src/components/post-status/index.js +30 -52
  861. package/src/components/post-status/style.scss +4 -34
  862. package/src/components/post-sticky/index.js +12 -7
  863. package/src/components/post-sticky/style.scss +3 -0
  864. package/src/components/post-template/block-theme.js +1 -0
  865. package/src/components/post-template/classic-theme.js +15 -0
  866. package/src/components/post-template/panel.js +5 -0
  867. package/src/components/post-template/style.scss +0 -8
  868. package/src/components/post-text-editor/index.js +5 -0
  869. package/src/components/post-title/index.js +8 -1
  870. package/src/components/post-title/index.native.js +70 -35
  871. package/src/components/post-title/post-title-raw.js +8 -0
  872. package/src/components/post-title/use-post-title-focus.js +7 -0
  873. package/src/components/post-title/use-post-title.js +5 -0
  874. package/src/components/post-transform-panel/index.js +2 -10
  875. package/src/components/post-url/check.js +8 -0
  876. package/src/components/post-url/index.js +41 -24
  877. package/src/components/post-url/label.js +10 -0
  878. package/src/components/post-url/panel.js +6 -1
  879. package/src/components/post-url/style.scss +0 -9
  880. package/src/components/post-visibility/check.js +9 -0
  881. package/src/components/post-visibility/index.js +7 -0
  882. package/src/components/post-visibility/label.js +10 -0
  883. package/src/components/posts-per-page/index.js +101 -0
  884. package/src/components/posts-per-page/style.scss +4 -0
  885. package/src/components/provider/index.js +68 -0
  886. package/src/components/provider/index.native.js +43 -2
  887. package/src/components/provider/use-block-editor-settings.js +4 -6
  888. package/src/components/provider/with-registry-provider.js +32 -31
  889. package/src/components/resizable-editor/index.js +90 -0
  890. package/src/components/resizable-editor/resize-handle.js +62 -0
  891. package/src/components/resizable-editor/style.scss +53 -0
  892. package/src/components/save-publish-panels/index.js +10 -2
  893. package/src/components/sidebar/index.js +0 -4
  894. package/src/components/sidebar/post-summary.js +14 -21
  895. package/src/components/sidebar/style.scss +1 -1
  896. package/src/components/site-discussion/index.js +138 -0
  897. package/src/components/site-discussion/style.scss +19 -0
  898. package/src/components/start-template-options/style.scss +0 -8
  899. package/src/components/template-areas/index.js +15 -6
  900. package/src/components/text-editor/index.js +57 -0
  901. package/src/components/text-editor/style.scss +71 -0
  902. package/src/components/{editor-canvas → visual-editor}/index.js +177 -108
  903. package/src/components/visual-editor/style.scss +37 -0
  904. package/src/hooks/index.js +1 -0
  905. package/src/hooks/media-upload.js +11 -0
  906. package/src/private-apis.js +10 -28
  907. package/src/private-apis.native.js +2 -26
  908. package/src/store/constants.js +7 -0
  909. package/src/store/private-actions.js +22 -50
  910. package/src/store/private-selectors.js +45 -0
  911. package/src/store/selectors.js +1 -1
  912. package/src/style.scss +9 -0
  913. package/src/utils/set-nested-value.js +39 -0
  914. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  915. package/build/components/editor-canvas/index.js.map +0 -1
  916. package/build/components/post-trash/panel.js +0 -18
  917. package/build/components/post-trash/panel.js.map +0 -1
  918. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  919. package/build-module/components/editor-canvas/index.js.map +0 -1
  920. package/build-module/components/post-trash/panel.js +0 -10
  921. package/build-module/components/post-trash/panel.js.map +0 -1
  922. package/src/components/post-trash/panel.js +0 -13
  923. package/src/components/provider/README.md +0 -37
  924. /package/src/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_icons","_url","_coreData","_htmlEntities","_postVisibility","_interopRequireDefault","_label","_postSchedule","_label2","_maybeTagsPanel","_maybePostFormatPanel","_store","_maybeCategoryPanel","_maybeUploadMedia","PostPublishPanelPrepublish","children","isBeingScheduled","isRequestingSiteIcon","hasPublishAction","siteIconUrl","siteTitle","siteHome","useSelect","select","_getCurrentPost$_link","getCurrentPost","isEditedPostBeingScheduled","editorStore","getEntityRecord","isResolving","coreStore","siteData","undefined","_links","site_icon_url","name","home","filterURLForDisplay","siteIcon","_react","createElement","Icon","className","size","icon","wordpress","alt","__","src","prePublishTitle","prePublishBodyText","decodeEntities","default","Fragment","PanelBody","initialOpen","title","key","_default","exports"],"sources":["@wordpress/editor/src/components/post-publish-panel/prepublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, PanelBody } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { wordpress } from '@wordpress/icons';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostVisibilityLabel from '../post-visibility/label';\nimport PostSchedule from '../post-schedule';\nimport PostScheduleLabel from '../post-schedule/label';\nimport MaybeTagsPanel from './maybe-tags-panel';\nimport MaybePostFormatPanel from './maybe-post-format-panel';\nimport { store as editorStore } from '../../store';\nimport MaybeCategoryPanel from './maybe-category-panel';\nimport MaybeUploadMedia from './maybe-upload-media';\n\nfunction PostPublishPanelPrepublish( { children } ) {\n\tconst {\n\t\tisBeingScheduled,\n\t\tisRequestingSiteIcon,\n\t\thasPublishAction,\n\t\tsiteIconUrl,\n\t\tsiteTitle,\n\t\tsiteHome,\n\t} = useSelect( ( select ) => {\n\t\tconst { getCurrentPost, isEditedPostBeingScheduled } =\n\t\t\tselect( editorStore );\n\t\tconst { getEntityRecord, isResolving } = select( coreStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\tsiteTitle: siteData.name,\n\t\t\tsiteHome: siteData.home && filterURLForDisplay( siteData.home ),\n\t\t};\n\t}, [] );\n\n\tlet siteIcon = (\n\t\t<Icon className=\"components-site-icon\" size=\"36px\" icon={ wordpress } />\n\t);\n\n\tif ( siteIconUrl ) {\n\t\tsiteIcon = (\n\t\t\t<img\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"components-site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tsiteIcon = null;\n\t}\n\n\tlet prePublishTitle, prePublishBodyText;\n\n\tif ( ! hasPublishAction ) {\n\t\tprePublishTitle = __( 'Are you ready to submit for review?' );\n\t\tprePublishBodyText = __(\n\t\t\t'When you’re ready, submit your work for review, and an Editor will be able to approve it for you.'\n\t\t);\n\t} else if ( isBeingScheduled ) {\n\t\tprePublishTitle = __( 'Are you ready to schedule?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Your work will be published at the specified date and time.'\n\t\t);\n\t} else {\n\t\tprePublishTitle = __( 'Are you ready to publish?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Double-check your settings before publishing.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"editor-post-publish-panel__prepublish\">\n\t\t\t<div>\n\t\t\t\t<strong>{ prePublishTitle }</strong>\n\t\t\t</div>\n\t\t\t<p>{ prePublishBodyText }</p>\n\t\t\t<div className=\"components-site-card\">\n\t\t\t\t{ siteIcon }\n\t\t\t\t<div className=\"components-site-info\">\n\t\t\t\t\t<span className=\"components-site-name\">\n\t\t\t\t\t\t{ decodeEntities( siteTitle ) || __( '(Untitled)' ) }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"components-site-home\">{ siteHome }</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<MaybeUploadMedia />\n\t\t\t{ hasPublishAction && (\n\t\t\t\t<>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Visibility:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Publish:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostScheduleLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostSchedule />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<MaybePostFormatPanel />\n\t\t\t<MaybeTagsPanel />\n\t\t\t<MaybeCategoryPanel />\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default PostPublishPanelPrepublish;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAKA,IAAAO,eAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,aAAA,GAAAF,sBAAA,CAAAR,OAAA;AACA,IAAAW,OAAA,GAAAH,sBAAA,CAAAR,OAAA;AACA,IAAAY,eAAA,GAAAJ,sBAAA,CAAAR,OAAA;AACA,IAAAa,qBAAA,GAAAL,sBAAA,CAAAR,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,mBAAA,GAAAP,sBAAA,CAAAR,OAAA;AACA,IAAAgB,iBAAA,GAAAR,sBAAA,CAAAR,OAAA;AAtBA;AACA;AACA;;AASA;AACA;AACA;;AAWA,SAASiB,0BAA0BA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACnD,MAAM;IACLC,gBAAgB;IAChBC,oBAAoB;IACpBC,gBAAgB;IAChBC,WAAW;IACXC,SAAS;IACTC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAC5B,MAAM;MAAEC,cAAc;MAAEC;IAA2B,CAAC,GACnDH,MAAM,CAAEI,YAAY,CAAC;IACtB,MAAM;MAAEC,eAAe;MAAEC;IAAY,CAAC,GAAGN,MAAM,CAAEO,eAAU,CAAC;IAC5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A,CAAA8C,OAAmB,MAAE,CACjB,CAAC;EACL,GAEH,IAAAb,MAAA,CAAAC,aAAA,EAACpC,eAAA,CAAAgD,OAAc,MAAE,CACP,CAAC,EACZ,IAAAb,MAAA,CAAAC,aAAA,EAAC1C,WAAA,CAAAwD,SAAS;IACTC,WAAW,EAAG,KAAO;IACrBC,KAAK,EAAG,CACP,IAAAT,QAAE,EAAE,UAAW,CAAC,EAChB,IAAAR,MAAA,CAAAC,aAAA;MACCE,SAAS,EAAC,iCAAiC;MAC3Ce,GAAG,EAAC;IAAO,GAEX,IAAAlB,MAAA,CAAAC,aAAA,EAAChC,OAAA,CAAA4C,OAAiB,MAAE,CACf,CAAC;EACL,GAEH,IAAAb,MAAA,CAAAC,aAAA,EAACjC,aAAA,CAAA6C,OAAY,MAAE,CACL,CACV,CACF,EACD,IAAAb,MAAA,CAAAC,aAAA,EAAC9B,qBAAA,CAAA0C,OAAoB,MAAE,CAAC,EACxB,IAAAb,MAAA,CAAAC,aAAA,EAAC/B,eAAA,CAAA2C,OAAc,MAAE,CAAC,EAClB,IAAAb,MAAA,CAAAC,aAAA,EAAC5B,mBAAA,CAAAwC,OAAkB,MAAE,CAAC,EACpBrC,QACE,CAAC;AAER;AAAC,IAAA2C,QAAA,GAAAC,OAAA,CAAAP,OAAA,GAEctC,0BAA0B","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_icons","_url","_coreData","_htmlEntities","_postVisibility","_interopRequireDefault","_label","_postSchedule","_label2","_maybeTagsPanel","_maybePostFormatPanel","_store","_maybeCategoryPanel","_maybeUploadMedia","_jsxRuntime","PostPublishPanelPrepublish","children","isBeingScheduled","isRequestingSiteIcon","hasPublishAction","siteIconUrl","siteTitle","siteHome","useSelect","select","_getCurrentPost$_link","getCurrentPost","isEditedPostBeingScheduled","editorStore","getEntityRecord","isResolving","coreStore","siteData","undefined","_links","site_icon_url","name","home","filterURLForDisplay","siteIcon","jsx","Icon","className","size","icon","wordpress","alt","__","src","prePublishTitle","prePublishBodyText","jsxs","decodeEntities","default","Fragment","PanelBody","initialOpen","title","_default","exports"],"sources":["@wordpress/editor/src/components/post-publish-panel/prepublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, PanelBody } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { wordpress } from '@wordpress/icons';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostVisibilityLabel from '../post-visibility/label';\nimport PostSchedule from '../post-schedule';\nimport PostScheduleLabel from '../post-schedule/label';\nimport MaybeTagsPanel from './maybe-tags-panel';\nimport MaybePostFormatPanel from './maybe-post-format-panel';\nimport { store as editorStore } from '../../store';\nimport MaybeCategoryPanel from './maybe-category-panel';\nimport MaybeUploadMedia from './maybe-upload-media';\n\nfunction PostPublishPanelPrepublish( { children } ) {\n\tconst {\n\t\tisBeingScheduled,\n\t\tisRequestingSiteIcon,\n\t\thasPublishAction,\n\t\tsiteIconUrl,\n\t\tsiteTitle,\n\t\tsiteHome,\n\t} = useSelect( ( select ) => {\n\t\tconst { getCurrentPost, isEditedPostBeingScheduled } =\n\t\t\tselect( editorStore );\n\t\tconst { getEntityRecord, isResolving } = select( coreStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\tsiteTitle: siteData.name,\n\t\t\tsiteHome: siteData.home && filterURLForDisplay( siteData.home ),\n\t\t};\n\t}, [] );\n\n\tlet siteIcon = (\n\t\t<Icon className=\"components-site-icon\" size=\"36px\" icon={ wordpress } />\n\t);\n\n\tif ( siteIconUrl ) {\n\t\tsiteIcon = (\n\t\t\t<img\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"components-site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tsiteIcon = null;\n\t}\n\n\tlet prePublishTitle, prePublishBodyText;\n\n\tif ( ! hasPublishAction ) {\n\t\tprePublishTitle = __( 'Are you ready to submit for review?' );\n\t\tprePublishBodyText = __(\n\t\t\t'When you’re ready, submit your work for review, and an Editor will be able to approve it for you.'\n\t\t);\n\t} else if ( isBeingScheduled ) {\n\t\tprePublishTitle = __( 'Are you ready to schedule?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Your work will be published at the specified date and time.'\n\t\t);\n\t} else {\n\t\tprePublishTitle = __( 'Are you ready to publish?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Double-check your settings before publishing.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"editor-post-publish-panel__prepublish\">\n\t\t\t<div>\n\t\t\t\t<strong>{ prePublishTitle }</strong>\n\t\t\t</div>\n\t\t\t<p>{ prePublishBodyText }</p>\n\t\t\t<div className=\"components-site-card\">\n\t\t\t\t{ siteIcon }\n\t\t\t\t<div className=\"components-site-info\">\n\t\t\t\t\t<span className=\"components-site-name\">\n\t\t\t\t\t\t{ decodeEntities( siteTitle ) || __( '(Untitled)' ) }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"components-site-home\">{ siteHome }</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<MaybeUploadMedia />\n\t\t\t{ hasPublishAction && (\n\t\t\t\t<>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Visibility:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Publish:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostScheduleLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostSchedule />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<MaybePostFormatPanel />\n\t\t\t<MaybeTagsPanel />\n\t\t\t<MaybeCategoryPanel />\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default PostPublishPanelPrepublish;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAKA,IAAAO,eAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,aAAA,GAAAF,sBAAA,CAAAR,OAAA;AACA,IAAAW,O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AAA;UACCE,SAAS,EAAC,iCAAiC;UAAA1B,QAAA,eAG3C,IAAAF,WAAA,CAAA0B,GAAA,EAAChC,OAAA,CAAA6C,OAAiB,IAAE;QAAC,GAFjB,OAGC,CAAC,CACL;QAAArC,QAAA,eAEH,IAAAF,WAAA,CAAA0B,GAAA,EAACjC,aAAA,CAAA8C,OAAY,IAAE;MAAC,CACN,CAAC;IAAA,CACX,CACF,eACD,IAAAvC,WAAA,CAAA0B,GAAA,EAAC9B,qBAAA,CAAA2C,OAAoB,IAAE,CAAC,eACxB,IAAAvC,WAAA,CAAA0B,GAAA,EAAC/B,eAAA,CAAA4C,OAAc,IAAE,CAAC,eAClB,IAAAvC,WAAA,CAAA0B,GAAA,EAAC5B,mBAAA,CAAAyC,OAAkB,IAAE,CAAC,EACpBrC,QAAQ;EAAA,CACN,CAAC;AAER;AAAC,IAAA0C,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAEctC,0BAA0B","ignoreList":[]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = PostSavedState;
8
- var _react = require("react");
9
8
  var _clsx = _interopRequireDefault(require("clsx"));
10
9
  var _components = require("@wordpress/components");
11
10
  var _compose = require("@wordpress/compose");
@@ -16,6 +15,7 @@ var _icons = require("@wordpress/icons");
16
15
  var _keycodes = require("@wordpress/keycodes");
17
16
  var _preferences = require("@wordpress/preferences");
18
17
  var _store = require("../../store");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
19
  /**
20
20
  * External dependencies
21
21
  */
@@ -36,8 +36,7 @@ var _store = require("../../store");
36
36
  * @param {?boolean} props.forceIsDirty Whether to force the post to be marked
37
37
  * as dirty.
38
38
  * @return {import('react').ComponentType} The component.
39
- */
40
- function PostSavedState({
39
+ */function PostSavedState({
41
40
  forceIsDirty
42
41
  }) {
43
42
  const [forceSavedMessage, setForceSavedMessage] = (0, _element.useState)(false);
@@ -131,7 +130,7 @@ function PostSavedState({
131
130
 
132
131
  // Use common Button instance for all saved states so that focus is not
133
132
  // lost.
134
- return (0, _react.createElement)(_components.Button, {
133
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Button, {
135
134
  className: isSaveable || isSaving ? (0, _clsx.default)({
136
135
  'editor-post-save-draft': !isSavedState,
137
136
  'editor-post-saved-state': isSavedState,
@@ -152,9 +151,10 @@ function PostSavedState({
152
151
  size: "compact",
153
152
  icon: isLargeViewport ? undefined : _icons.cloudUpload,
154
153
  label: text || label,
155
- "aria-disabled": isDisabled
156
- }, isSavedState && (0, _react.createElement)(_icons.Icon, {
157
- icon: isSaved ? _icons.check : _icons.cloud
158
- }), text);
154
+ "aria-disabled": isDisabled,
155
+ children: [isSavedState && /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
156
+ icon: isSaved ? _icons.check : _icons.cloud
157
+ }), text]
158
+ });
159
159
  }
160
160
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_compose","_data","_element","_i18n","_icons","_keycodes","_preferences","_store","PostSavedState","forceIsDirty","forceSavedMessage","setForceSavedMessage","useState","isLargeViewport","useViewportMatch","isAutosaving","isDirty","isNew","isPublished","isSaveable","isSaving","isScheduled","hasPublishAction","showIconLabels","postStatus","postStatusHasChanged","useSelect","select","_getCurrentPost$_link","isEditedPostNew","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostDirty","isSavingPost","isEditedPostSaveable","getCurrentPost","isAutosavingPost","getEditedPostAttribute","getPostEdits","editorStore","get","preferencesStore","_links","status","isPending","savePost","useDispatch","wasSaving","usePrevious","useEffect","timeoutId","setTimeout","clearTimeout","includes","label","__","shortLabel","isSaved","isSavedState","isDisabled","text","_react","createElement","Button","className","clsx","getAnimateClassName","type","undefined","onClick","shortcut","displayShortcut","primary","variant","size","icon","cloudUpload","Icon","check","cloud"],"sources":["@wordpress/editor/src/components/post-saved-state/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport 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 { store as editorStore } from '../../store';\n\n/**\n * Component showing whether the post is saved or not and providing save\n * buttons.\n *\n * @param {Object} props Component props.\n * @param {?boolean} props.forceIsDirty Whether to force the post to be marked\n * as dirty.\n * @return {import('react').ComponentType} The component.\n */\nexport default function PostSavedState( { forceIsDirty } ) {\n\tconst [ forceSavedMessage, setForceSavedMessage ] = useState( false );\n\tconst isLargeViewport = useViewportMatch( 'small' );\n\n\tconst {\n\t\tisAutosaving,\n\t\tisDirty,\n\t\tisNew,\n\t\tisPublished,\n\t\tisSaveable,\n\t\tisSaving,\n\t\tisScheduled,\n\t\thasPublishAction,\n\t\tshowIconLabels,\n\t\tpostStatus,\n\t\tpostStatusHasChanged,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisEditedPostNew,\n\t\t\t\tisCurrentPostPublished,\n\t\t\t\tisCurrentPostScheduled,\n\t\t\t\tisEditedPostDirty,\n\t\t\t\tisSavingPost,\n\t\t\t\tisEditedPostSaveable,\n\t\t\t\tgetCurrentPost,\n\t\t\t\tisAutosavingPost,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetPostEdits,\n\t\t\t} = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\treturn {\n\t\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\t\tisDirty: forceIsDirty || isEditedPostDirty(),\n\t\t\t\tisNew: isEditedPostNew(),\n\t\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\t\tisSaving: isSavingPost(),\n\t\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\t\thasPublishAction:\n\t\t\t\t\tgetCurrentPost()?._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t\t\tpostStatusHasChanged: !! getPostEdits()?.status,\n\t\t\t};\n\t\t},\n\t\t[ forceIsDirty ]\n\t);\n\tconst isPending = postStatus === 'pending';\n\tconst { savePost } = useDispatch( editorStore );\n\n\tconst wasSaving = usePrevious( isSaving );\n\n\tuseEffect( () => {\n\t\tlet timeoutId;\n\n\t\tif ( wasSaving && ! isSaving ) {\n\t\t\tsetForceSavedMessage( true );\n\t\t\ttimeoutId = setTimeout( () => {\n\t\t\t\tsetForceSavedMessage( false );\n\t\t\t}, 1000 );\n\t\t}\n\n\t\treturn () => clearTimeout( timeoutId );\n\t}, [ isSaving ] );\n\n\t// Once the post has been submitted for review this button\n\t// is not needed for the contributor role.\n\tif ( ! hasPublishAction && isPending ) {\n\t\treturn null;\n\t}\n\n\tif (\n\t\tisPublished ||\n\t\tisScheduled ||\n\t\t! [ 'pending', 'draft', 'auto-draft' ].includes( postStatus ) ||\n\t\t( postStatusHasChanged &&\n\t\t\t[ 'pending', 'draft' ].includes( postStatus ) )\n\t) {\n\t\treturn null;\n\t}\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst label = isPending ? __( 'Save as pending' ) : __( 'Save draft' );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst shortLabel = __( 'Save' );\n\n\tconst isSaved = forceSavedMessage || ( ! isNew && ! isDirty );\n\tconst isSavedState = isSaving || isSaved;\n\tconst isDisabled = isSaving || isSaved || ! isSaveable;\n\tlet text;\n\n\tif ( isSaving ) {\n\t\ttext = isAutosaving ? __( 'Autosaving' ) : __( 'Saving' );\n\t} else if ( isSaved ) {\n\t\ttext = __( 'Saved' );\n\t} else if ( isLargeViewport ) {\n\t\ttext = label;\n\t} else if ( showIconLabels ) {\n\t\ttext = shortLabel;\n\t}\n\n\t// Use common Button instance for all saved states so that focus is not\n\t// lost.\n\treturn (\n\t\t<Button\n\t\t\tclassName={\n\t\t\t\tisSaveable || isSaving\n\t\t\t\t\t? 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"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,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,CAAE,GAAI,CAAG;IACpEC,OAAO,EAAC,UAAU;IAClBC,IAAI,EAAC,SAAS;IACdC,IAAI,EAAG9D,eAAe,GAAGuD,SAAS,GAAGQ,kBAAa;IAClDtB,KAAK,EAAGM,IAAI,IAAIN,KAAO;IACvB,iBAAgBK;EAAY,GAE1BD,YAAY,IAAI,IAAAG,MAAA,CAAAC,aAAA,EAAC1D,MAAA,CAAAyE,IAAI;IAACF,IAAI,EAAGlB,OAAO,GAAGqB,YAAK,GAAGC;EAAO,CAAE,CAAC,EACzDnB,IACK,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_compose","_data","_element","_i18n","_icons","_keycodes","_preferences","_store","_jsxRuntime","PostSavedState","forceIsDirty","forceSavedMessage","setForceSavedMessage","useState","isLargeViewport","useViewportMatch","isAutosaving","isDirty","isNew","isPublished","isSaveable","isSaving","isScheduled","hasPublishAction","showIconLabels","postStatus","postStatusHasChanged","useSelect","select","_getCurrentPost$_link","isEditedPostNew","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostDirty","isSavingPost","isEditedPostSaveable","getCurrentPost","isAutosavingPost","getEditedPostAttribute","getPostEdits","editorStore","get","preferencesStore","_links","status","isPending","savePost","useDispatch","wasSaving","usePrevious","useEffect","timeoutId","setTimeout","clearTimeout","includes","label","__","shortLabel","isSaved","isSavedState","isDisabled","text","jsxs","Button","className","clsx","getAnimateClassName","type","undefined","onClick","shortcut","displayShortcut","primary","variant","size","icon","cloudUpload","children","jsx","Icon","check","cloud"],"sources":["@wordpress/editor/src/components/post-saved-state/index.js"],"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 { store as editorStore } from '../../store';\n\n/**\n * Component showing whether the post is saved or not and providing save\n * buttons.\n *\n * @param {Object} props Component props.\n * @param {?boolean} props.forceIsDirty Whether to force the post to be marked\n * as dirty.\n * @return {import('react').ComponentType} The component.\n */\nexport default function PostSavedState( { forceIsDirty } ) {\n\tconst [ forceSavedMessage, setForceSavedMessage ] = useState( false );\n\tconst isLargeViewport = useViewportMatch( 'small' );\n\n\tconst {\n\t\tisAutosaving,\n\t\tisDirty,\n\t\tisNew,\n\t\tisPublished,\n\t\tisSaveable,\n\t\tisSaving,\n\t\tisScheduled,\n\t\thasPublishAction,\n\t\tshowIconLabels,\n\t\tpostStatus,\n\t\tpostStatusHasChanged,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisEditedPostNew,\n\t\t\t\tisCurrentPostPublished,\n\t\t\t\tisCurrentPostScheduled,\n\t\t\t\tisEditedPostDirty,\n\t\t\t\tisSavingPost,\n\t\t\t\tisEditedPostSaveable,\n\t\t\t\tgetCurrentPost,\n\t\t\t\tisAutosavingPost,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetPostEdits,\n\t\t\t} = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\treturn {\n\t\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\t\tisDirty: forceIsDirty || isEditedPostDirty(),\n\t\t\t\tisNew: isEditedPostNew(),\n\t\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\t\tisSaving: isSavingPost(),\n\t\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\t\thasPublishAction:\n\t\t\t\t\tgetCurrentPost()?._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t\t\tpostStatusHasChanged: !! getPostEdits()?.status,\n\t\t\t};\n\t\t},\n\t\t[ forceIsDirty ]\n\t);\n\tconst isPending = postStatus === 'pending';\n\tconst { savePost } = useDispatch( editorStore );\n\n\tconst wasSaving = usePrevious( isSaving );\n\n\tuseEffect( () => {\n\t\tlet timeoutId;\n\n\t\tif ( wasSaving && ! isSaving ) {\n\t\t\tsetForceSavedMessage( true );\n\t\t\ttimeoutId = setTimeout( () => {\n\t\t\t\tsetForceSavedMessage( false );\n\t\t\t}, 1000 );\n\t\t}\n\n\t\treturn () => clearTimeout( timeoutId );\n\t}, [ isSaving ] );\n\n\t// Once the post has been submitted for review this button\n\t// is not needed for the contributor role.\n\tif ( ! hasPublishAction && isPending ) {\n\t\treturn null;\n\t}\n\n\tif (\n\t\tisPublished ||\n\t\tisScheduled ||\n\t\t! [ 'pending', 'draft', 'auto-draft' ].includes( postStatus ) ||\n\t\t( postStatusHasChanged &&\n\t\t\t[ 'pending', 'draft' ].includes( postStatus ) )\n\t) {\n\t\treturn null;\n\t}\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst label = isPending ? __( 'Save as pending' ) : __( 'Save draft' );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst shortLabel = __( 'Save' );\n\n\tconst isSaved = forceSavedMessage || ( ! isNew && ! isDirty );\n\tconst isSavedState = isSaving || isSaved;\n\tconst isDisabled = isSaving || isSaved || ! isSaveable;\n\tlet text;\n\n\tif ( isSaving ) {\n\t\ttext = isAutosaving ? __( 'Autosaving' ) : __( 'Saving' );\n\t} else if ( isSaved ) {\n\t\ttext = __( 'Saved' );\n\t} else if ( isLargeViewport ) {\n\t\ttext = label;\n\t} else if ( showIconLabels ) {\n\t\ttext = shortLabel;\n\t}\n\n\t// Use common Button instance for all saved states so that focus is not\n\t// lost.\n\treturn (\n\t\t<Button\n\t\t\tclassName={\n\t\t\t\tisSaveable || isSaving\n\t\t\t\t\t? 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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AAAmD,IAAAU,WAAA,GAAAV,OAAA;AAvBnD;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAGA;AACA;AACA;AAC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,iBAAgBK,UAAY;IAAAiB,QAAA,GAE1BlB,YAAY,iBAAI,IAAAnD,WAAA,CAAAsE,GAAA,EAAC1E,MAAA,CAAA2E,IAAI;MAACJ,IAAI,EAAGjB,OAAO,GAAGsB,YAAK,GAAGC;IAAO,CAAE,CAAC,EACzDpB,IAAI;EAAA,CACC,CAAC;AAEX","ignoreList":[]}
@@ -14,6 +14,14 @@ var _store = require("../../store");
14
14
  * Internal dependencies
15
15
  */
16
16
 
17
+ /**
18
+ * Wrapper component that renders its children only if post has a publish action.
19
+ *
20
+ * @param {Object} props Props.
21
+ * @param {Element} props.children Children to be rendered.
22
+ *
23
+ * @return {Component} - The component to be rendered or null if there is no publish action.
24
+ */
17
25
  function PostScheduleCheck({
18
26
  children
19
27
  }) {
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_store","PostScheduleCheck","children","hasPublishAction","useSelect","select","_select$getCurrentPos","editorStore","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-schedule/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostScheduleCheck( { children } ) {\n\tconst hasPublishAction = useSelect( ( select ) => {\n\t\treturn (\n\t\t\tselect( editorStore ).getCurrentPost()._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false\n\t\t);\n\t}, [] );\n\n\tif ( ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGe,SAASE,iBAAiBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACzD,MAAMC,gBAAgB,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,qBAAA;IACjD,QAAAA,qBAAA,GACCD,MAAM,CAAEE,YAAY,CAAC,CAACC,cAAc,CAAC,CAAC,CAACC,MAAM,GAC5C,mBAAmB,CACnB,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;EAEZ,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEH,gBAAgB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_store","PostScheduleCheck","children","hasPublishAction","useSelect","select","_select$getCurrentPos","editorStore","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-schedule/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if post has a publish action.\n *\n * @param {Object} props Props.\n * @param {Element} props.children Children to be rendered.\n *\n * @return {Component} - 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"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,iBAAiBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACzD,MAAMC,gBAAgB,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,qBAAA;IACjD,QAAAA,qBAAA,GACCD,MAAM,CAAEE,YAAY,CAAC,CAACC,cAAc,CAAC,CAAC,CAACC,MAAM,GAC5C,mBAAmB,CACnB,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;EAEZ,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEH,gBAAgB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.PrivatePostSchedule = PrivatePostSchedule;
6
7
  exports.default = PostSchedule;
7
- var _react = require("react");
8
8
  var _dateFns = require("date-fns");
9
9
  var _date = require("@wordpress/date");
10
10
  var _data = require("@wordpress/data");
@@ -12,6 +12,8 @@ var _blockEditor = require("@wordpress/block-editor");
12
12
  var _element = require("@wordpress/element");
13
13
  var _coreData = require("@wordpress/core-data");
14
14
  var _store = require("../../store");
15
+ var _lockUnlock = require("../../lock-unlock");
16
+ var _jsxRuntime = require("react/jsx-runtime");
15
17
  /**
16
18
  * External dependencies
17
19
  */
@@ -24,8 +26,29 @@ var _store = require("../../store");
24
26
  * Internal dependencies
25
27
  */
26
28
 
27
- function PostSchedule({
28
- onClose
29
+ const {
30
+ PrivatePublishDateTimePicker
31
+ } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
32
+
33
+ /**
34
+ * Renders the PostSchedule component. It allows the user to schedule a post.
35
+ *
36
+ * @param {Object} props Props.
37
+ * @param {Function} props.onClose Function to close the component.
38
+ *
39
+ * @return {Component} The component to be rendered.
40
+ */
41
+ function PostSchedule(props) {
42
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(PrivatePostSchedule, {
43
+ ...props,
44
+ showPopoverHeaderActions: true,
45
+ isCompact: false
46
+ });
47
+ }
48
+ function PrivatePostSchedule({
49
+ onClose,
50
+ showPopoverHeaderActions,
51
+ isCompact
29
52
  }) {
30
53
  const {
31
54
  postDate,
@@ -64,13 +87,15 @@ function PostSchedule({
64
87
  .replace(/\\\\/g, '') // Replace "//" with empty strings.
65
88
  .split('').reverse().join('') // Reverse the string and test for "a" not followed by a slash.
66
89
  );
67
- return (0, _react.createElement)(_blockEditor.__experimentalPublishDateTimePicker, {
90
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(PrivatePublishDateTimePicker, {
68
91
  currentDate: postDate,
69
92
  onChange: onUpdateDate,
70
93
  is12Hour: is12HourTime,
71
94
  events: events,
72
95
  onMonthPreviewed: date => setPreviewedMonth((0, _dateFns.parseISO)(date)),
73
- onClose: onClose
96
+ onClose: onClose,
97
+ isCompact: isCompact,
98
+ showPopoverHeaderActions: showPopoverHeaderActions
74
99
  });
75
100
  }
76
101
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_dateFns","require","_date","_data","_blockEditor","_element","_coreData","_store","PostSchedule","onClose","postDate","postType","useSelect","select","editorStore","getEditedPostAttribute","getCurrentPostType","editPost","useDispatch","onUpdateDate","date","previewedMonth","setPreviewedMonth","useState","startOfMonth","Date","eventsByPostType","coreStore","getEntityRecords","status","after","toISOString","before","endOfMonth","exclude","getCurrentPostId","per_page","_fields","events","useMemo","map","eventDate","settings","getSettings","is12HourTime","test","formats","time","toLowerCase","replace","split","reverse","join","_react","createElement","__experimentalPublishDateTimePicker","currentDate","onChange","is12Hour","onMonthPreviewed","parseISO"],"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { parseISO, endOfMonth, startOfMonth } from 'date-fns';\n\n/**\n * WordPress dependencies\n */\nimport { getSettings } from '@wordpress/date';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __experimentalPublishDateTimePicker as PublishDateTimePicker } from '@wordpress/block-editor';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostSchedule( { onClose } ) {\n\tconst { postDate, postType } = useSelect(\n\t\t( select ) => ( {\n\t\t\tpostDate: select( editorStore ).getEditedPostAttribute( 'date' ),\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onUpdateDate = ( date ) => editPost( { date } );\n\n\tconst [ previewedMonth, setPreviewedMonth ] = useState(\n\t\tstartOfMonth( new Date( postDate ) )\n\t);\n\n\t// Pick up published and schduled site posts.\n\tconst eventsByPostType = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords( 'postType', postType, {\n\t\t\t\tstatus: 'publish,future',\n\t\t\t\tafter: startOfMonth( previewedMonth ).toISOString(),\n\t\t\t\tbefore: endOfMonth( previewedMonth ).toISOString(),\n\t\t\t\texclude: [ select( editorStore ).getCurrentPostId() ],\n\t\t\t\tper_page: 100,\n\t\t\t\t_fields: 'id,date',\n\t\t\t} ),\n\t\t[ previewedMonth, postType ]\n\t);\n\n\tconst events = useMemo(\n\t\t() =>\n\t\t\t( eventsByPostType || [] ).map( ( { date: eventDate } ) => ( {\n\t\t\t\tdate: new Date( eventDate ),\n\t\t\t} ) ),\n\t\t[ eventsByPostType ]\n\t);\n\n\tconst settings = getSettings();\n\n\t// To know if the current timezone is a 12 hour time with look for \"a\" in the time format\n\t// We also make sure this a is not escaped by a \"/\"\n\tconst is12HourTime = /a(?!\\\\)/i.test(\n\t\tsettings.formats.time\n\t\t\t.toLowerCase() // Test only the lower case a.\n\t\t\t.replace( /\\\\\\\\/g, '' ) // Replace \"//\" with empty strings.\n\t\t\t.split( '' )\n\t\t\t.reverse()\n\t\t\t.join( '' ) // Reverse the string and test for \"a\" not followed by a slash.\n\t);\n\n\treturn (\n\t\t<PublishDateTimePicker\n\t\t\tcurrentDate={ postDate }\n\t\t\tonChange={ onUpdateDate }\n\t\t\tis12Hour={ is12HourTime }\n\t\t\tevents={ events }\n\t\t\tonMonthPreviewed={ ( date ) =>\n\t\t\t\tsetPreviewedMonth( parseISO( date ) )\n\t\t\t}\n\t\t\tonClose={ onClose }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC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AC,CAACqB,gBAAgB,CAAC,CAAC,CAAE;IACrDC,QAAQ,EAAE,GAAG;IACbC,OAAO,EAAE;EACV,CAAE,CAAC,EACJ,CAAEhB,cAAc,EAAEV,QAAQ,CAC3B,CAAC;EAED,MAAM2B,MAAM,GAAG,IAAAC,gBAAO,EACrB,MACC,CAAEb,gBAAgB,IAAI,EAAE,EAAGc,GAAG,CAAE,CAAE;IAAEpB,IAAI,EAAEqB;EAAU,CAAC,MAAQ;IAC5DrB,IAAI,EAAE,IAAIK,IAAI,CAAEgB,SAAU;EAC3B,CAAC,CAAG,CAAC,EACN,CAAEf,gBAAgB,CACnB,CAAC;EAED,MAAMgB,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;;EAE9B;EACA;EACA,MAAMC,YAAY,GAAG,UAAU,CAACC,IAAI,CACnCH,QAAQ,CAACI,OAAO,CAACC,IAAI,CACnBC,WAAW,CAAC,CAAC,CAAC;EAAA,CACdC,OAAO,CAAE,OAAO,EAAE,EAAG,CAAC,CAAC;EAAA,CACvBC,KAAK,CAAE,EAAG,CAAC,CACXC,OAAO,CAAC,CAAC,CACTC,IAAI,CAAE,EAAG,CAAC,CAAC;EACd,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAClD,YAAA,CAAAmD,mCAAqB;IACrBC,WAAW,EAAG9C,QAAU;IACxB+C,QAAQ,EAAGtC,YAAc;IACzBuC,QAAQ,EAAGd,YAAc;IACzBN,MAAM,EAAGA,MAAQ;IACjBqB,gBAAgB,EAAKvC,IAAI,IACxBE,iBAAiB,CAAE,IAAAsC,iBAAQ,EAAExC,IAAK,CAAE,CACpC;IACDX,OAAO,EAAGA;EAAS,CACnB,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_dateFns","require","_date","_data","_blockEditor","_element","_coreData","_store","_lockUnlock","_jsxRuntime","PrivatePublishDateTimePicker","unlock","blockEditorPrivateApis","PostSchedule","props","jsx","PrivatePostSchedule","showPopoverHeaderActions","isCompact","onClose","postDate","postType","useSelect","select","editorStore","getEditedPostAttribute","getCurrentPostType","editPost","useDispatch","onUpdateDate","date","previewedMonth","setPreviewedMonth","useState","startOfMonth","Date","eventsByPostType","coreStore","getEntityRecords","status","after","toISOString","before","endOfMonth","exclude","getCurrentPostId","per_page","_fields","events","useMemo","map","eventDate","settings","getSettings","is12HourTime","test","formats","time","toLowerCase","replace","split","reverse","join","currentDate","onChange","is12Hour","onMonthPreviewed","parseISO"],"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { parseISO, endOfMonth, startOfMonth } from 'date-fns';\n\n/**\n * WordPress dependencies\n */\nimport { getSettings } from '@wordpress/date';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { 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 {Component} The component to be rendered.\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 schduled site posts.\n\tconst eventsByPostType = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords( 'postType', postType, {\n\t\t\t\tstatus: 'publish,future',\n\t\t\t\tafter: startOfMonth( previewedMonth ).toISOString(),\n\t\t\t\tbefore: endOfMonth( previewedMonth ).toISOString(),\n\t\t\t\texclude: [ select( editorStore ).getCurrentPostId() ],\n\t\t\t\tper_page: 100,\n\t\t\t\t_fields: 'id,date',\n\t\t\t} ),\n\t\t[ previewedMonth, postType ]\n\t);\n\n\tconst events = useMemo(\n\t\t() =>\n\t\t\t( eventsByPostType || [] ).map( ( { date: eventDate } ) => ( {\n\t\t\t\tdate: new Date( eventDate ),\n\t\t\t} ) ),\n\t\t[ eventsByPostType ]\n\t);\n\n\tconst settings = getSettings();\n\n\t// To know if the current timezone is a 12 hour time with look for \"a\" in the time format\n\t// We also make sure this a is not escaped by a \"/\"\n\tconst is12HourTime = /a(?!\\\\)/i.test(\n\t\tsettings.formats.time\n\t\t\t.toLowerCase() // Test only the lower case a.\n\t\t\t.replace( /\\\\\\\\/g, '' ) // Replace \"//\" with empty strings.\n\t\t\t.split( '' )\n\t\t\t.reverse()\n\t\t\t.join( '' ) // Reverse the string and test for \"a\" not followed by a slash.\n\t);\n\n\treturn (\n\t\t<PrivatePublishDateTimePicker\n\t\t\tcurrentDate={ postDate }\n\t\t\tonChange={ onUpdateDate }\n\t\t\tis12Hour={ is12HourTime }\n\t\t\tevents={ events }\n\t\t\tonMonthPreviewed={ ( date ) =>\n\t\t\t\tsetPreviewedMonth( parseISO( date ) )\n\t\t\t}\n\t\t\tonClose={ onClose }\n\t\t\tisCompact={ isCompact }\n\t\t\tshowPopoverHeaderActions={ showPopoverHeaderActions }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAA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M,EAAGA,MAAQ;IACjBkB,gBAAgB,EAAKpC,IAAI,IACxBE,iBAAiB,CAAE,IAAAmC,iBAAQ,EAAErC,IAAK,CAAE,CACpC;IACDX,OAAO,EAAGA,OAAS;IACnBD,SAAS,EAAGA,SAAW;IACvBD,wBAAwB,EAAGA;EAA0B,CACrD,CAAC;AAEJ","ignoreList":[]}
@@ -19,9 +19,25 @@ var _store = require("../../store");
19
19
  * Internal dependencies
20
20
  */
21
21
 
22
+ /**
23
+ * Renders the PostScheduleLabel component.
24
+ *
25
+ * @param {Object} props Props.
26
+ *
27
+ * @return {Component} The component to be rendered.
28
+ */
22
29
  function PostScheduleLabel(props) {
23
30
  return usePostScheduleLabel(props);
24
31
  }
32
+
33
+ /**
34
+ * Custom hook to get the label for post schedule.
35
+ *
36
+ * @param {Object} options Options for the hook.
37
+ * @param {boolean} options.full Whether to get the full label or not. Default is false.
38
+ *
39
+ * @return {string} The label for post schedule.
40
+ */
25
41
  function usePostScheduleLabel({
26
42
  full = false
27
43
  } = {}) {
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_date","_data","_store","PostScheduleLabel","props","usePostScheduleLabel","full","date","isFloating","useSelect","select","editorStore","getEditedPostAttribute","isEditedPostDateFloating","getFullPostScheduleLabel","getPostScheduleLabel","dateAttribute","getDate","timezoneAbbreviation","getTimezoneAbbreviation","formattedDate","dateI18n","_x","isRTL","now","Date","__","isTimezoneSameAsSiteTimezone","isSameDay","sprintf","tomorrow","setDate","getFullYear","timezone","getSettings","abbr","isNaN","Number","symbol","offset","offsetFormatted","siteOffset","dateOffset","getTimezoneOffset","left","right","getMonth"],"sources":["@wordpress/editor/src/components/post-schedule/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { getSettings, getDate, dateI18n } from '@wordpress/date';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostScheduleLabel( props ) {\n\treturn usePostScheduleLabel( props );\n}\n\nexport function usePostScheduleLabel( { full = false } = {} ) {\n\tconst { date, isFloating } = useSelect(\n\t\t( select ) => ( {\n\t\t\tdate: select( editorStore ).getEditedPostAttribute( 'date' ),\n\t\t\tisFloating: select( editorStore ).isEditedPostDateFloating(),\n\t\t} ),\n\t\t[]\n\t);\n\n\treturn full\n\t\t? getFullPostScheduleLabel( date )\n\t\t: getPostScheduleLabel( date, { isFloating } );\n}\n\nexport function getFullPostScheduleLabel( dateAttribute ) {\n\tconst date = getDate( dateAttribute );\n\n\tconst timezoneAbbreviation = getTimezoneAbbreviation();\n\tconst formattedDate = dateI18n(\n\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t_x( 'F j, Y g:i\\xa0a', 'post schedule full date format' ),\n\t\tdate\n\t);\n\treturn isRTL()\n\t\t? `${ timezoneAbbreviation } ${ formattedDate }`\n\t\t: `${ formattedDate } ${ timezoneAbbreviation }`;\n}\n\nexport function getPostScheduleLabel(\n\tdateAttribute,\n\t{ isFloating = false, now = new Date() } = {}\n) {\n\tif ( ! dateAttribute || isFloating ) {\n\t\treturn __( 'Immediately' );\n\t}\n\n\t// If the user timezone does not equal the site timezone then using words\n\t// like 'tomorrow' is confusing, so show the full date.\n\tif ( ! isTimezoneSameAsSiteTimezone( now ) ) {\n\t\treturn getFullPostScheduleLabel( dateAttribute );\n\t}\n\n\tconst date = getDate( dateAttribute );\n\n\tif ( isSameDay( date, now ) ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: Time of day the post is scheduled for.\n\t\t\t__( 'Today at %s' ),\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\tdateI18n( _x( 'g:i\\xa0a', 'post schedule time format' ), date )\n\t\t);\n\t}\n\n\tconst tomorrow = new Date( now );\n\ttomorrow.setDate( tomorrow.getDate() + 1 );\n\n\tif ( isSameDay( date, tomorrow ) ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: Time of day the post is scheduled for.\n\t\t\t__( 'Tomorrow at %s' ),\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\tdateI18n( _x( 'g:i\\xa0a', 'post schedule time format' ), date )\n\t\t);\n\t}\n\n\tif ( date.getFullYear() === now.getFullYear() ) {\n\t\treturn dateI18n(\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\t_x( 'F j g:i\\xa0a', 'post schedule date format without year' ),\n\t\t\tdate\n\t\t);\n\t}\n\n\treturn dateI18n(\n\t\t// translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.\n\t\t_x( 'F j, Y g:i\\xa0a', 'post schedule full date format' ),\n\t\tdate\n\t);\n}\n\nfunction getTimezoneAbbreviation() {\n\tconst { timezone } = getSettings();\n\n\tif ( timezone.abbr && isNaN( Number( timezone.abbr ) ) ) {\n\t\treturn timezone.abbr;\n\t}\n\n\tconst symbol = timezone.offset < 0 ? '' : '+';\n\treturn `UTC${ symbol }${ timezone.offsetFormatted }`;\n}\n\nfunction isTimezoneSameAsSiteTimezone( date ) {\n\tconst { timezone } = getSettings();\n\n\tconst siteOffset = Number( timezone.offset );\n\tconst dateOffset = -1 * ( date.getTimezoneOffset() / 60 );\n\treturn siteOffset === dateOffset;\n}\n\nfunction isSameDay( left, right ) {\n\treturn (\n\t\tleft.getDate() === right.getDate() &&\n\t\tleft.getMonth() === right.getMonth() &&\n\t\tleft.getFullYear() === right.getFullYear()\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGe,SAASI,iBAAiBA,CAAEC,KAAK,EAAG;EAClD,OAAOC,oBAAoB,CAAED,KAAM,CAAC;AACrC;AAEO,SAASC,oBAAoBA,CAAE;EAAEC,IAAI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,OAAQ,MAAMD,MAAQ,GAAGL,QAAQ,CAACO,eAAiB,EAAC;AACrD;AAEA,SAASb,4BAA4BA,CAAEpB,IAAI,EAAG;EAC7C,MAAM;IAAE0B;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAElC,MAAMO,UAAU,GAAGJ,MAAM,CAAEJ,QAAQ,CAACM,MAAO,CAAC;EAC5C,MAAMG,UAAU,GAAG,CAAC,CAAC,IAAKnC,IAAI,CAACoC,iBAAiB,CAAC,CAAC,GAAG,EAAE,CAAE;EACzD,OAAOF,UAAU,KAAKC,UAAU;AACjC;AAEA,SAASd,SAASA,CAAEgB,IAAI,EAAEC,KAAK,EAAG;EACjC,OACCD,IAAI,CAAC3B,OAAO,CAAC,CAAC,KAAK4B,KAAK,CAAC5B,OAAO,CAAC,CAAC,IAClC2B,IAAI,CAACE,QAAQ,CAAC,CAAC,KAAKD,KAAK,CAACC,QAAQ,CAAC,CAAC,IACpCF,IAAI,CAACZ,WAAW,CAAC,CAAC,KAAKa,KAAK,CAACb,WAAW,CAAC,CAAC;AAE5C","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_date","_data","_store","PostScheduleLabel","props","usePostScheduleLabel","full","date","isFloating","useSelect","select","editorStore","getEditedPostAttribute","isEditedPostDateFloating","getFullPostScheduleLabel","getPostScheduleLabel","dateAttribute","getDate","timezoneAbbreviation","getTimezoneAbbreviation","formattedDate","dateI18n","_x","isRTL","now","Date","__","isTimezoneSameAsSiteTimezone","isSameDay","sprintf","tomorrow","setDate","getFullYear","timezone","getSettings","abbr","isNaN","Number","symbol","offset","offsetFormatted","siteOffset","dateOffset","getTimezoneOffset","left","right","getMonth"],"sources":["@wordpress/editor/src/components/post-schedule/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { getSettings, getDate, dateI18n } from '@wordpress/date';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the PostScheduleLabel component.\n *\n * @param {Object} props Props.\n *\n * @return {Component} The component to be rendered.\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: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t_x( 'F j, Y g:i\\xa0a', 'post schedule full date format' ),\n\t\tdate\n\t);\n\treturn isRTL()\n\t\t? `${ timezoneAbbreviation } ${ formattedDate }`\n\t\t: `${ formattedDate } ${ timezoneAbbreviation }`;\n}\n\nexport function getPostScheduleLabel(\n\tdateAttribute,\n\t{ isFloating = false, now = new Date() } = {}\n) {\n\tif ( ! dateAttribute || isFloating ) {\n\t\treturn __( 'Immediately' );\n\t}\n\n\t// If the user timezone does not equal the site timezone then using words\n\t// like 'tomorrow' is confusing, so show the full date.\n\tif ( ! isTimezoneSameAsSiteTimezone( now ) ) {\n\t\treturn getFullPostScheduleLabel( dateAttribute );\n\t}\n\n\tconst date = getDate( dateAttribute );\n\n\tif ( isSameDay( date, now ) ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: Time of day the post is scheduled for.\n\t\t\t__( 'Today at %s' ),\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\tdateI18n( _x( 'g:i\\xa0a', 'post schedule time format' ), date )\n\t\t);\n\t}\n\n\tconst tomorrow = new Date( now );\n\ttomorrow.setDate( tomorrow.getDate() + 1 );\n\n\tif ( isSameDay( date, tomorrow ) ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: Time of day the post is scheduled for.\n\t\t\t__( 'Tomorrow at %s' ),\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\tdateI18n( _x( 'g:i\\xa0a', 'post schedule time format' ), date )\n\t\t);\n\t}\n\n\tif ( date.getFullYear() === now.getFullYear() ) {\n\t\treturn dateI18n(\n\t\t\t// translators: If using a space between 'g:i' and 'a', use a non-breaking space.\n\t\t\t_x( 'F j g:i\\xa0a', 'post schedule date format without year' ),\n\t\t\tdate\n\t\t);\n\t}\n\n\treturn dateI18n(\n\t\t// translators: Use a non-breaking space between 'g:i' and 'a' if appropriate.\n\t\t_x( 'F j, Y g:i\\xa0a', 'post schedule full date format' ),\n\t\tdate\n\t);\n}\n\nfunction getTimezoneAbbreviation() {\n\tconst { timezone } = getSettings();\n\n\tif ( timezone.abbr && isNaN( Number( timezone.abbr ) ) ) {\n\t\treturn timezone.abbr;\n\t}\n\n\tconst symbol = timezone.offset < 0 ? '' : '+';\n\treturn `UTC${ symbol }${ timezone.offsetFormatted }`;\n}\n\nfunction isTimezoneSameAsSiteTimezone( date ) {\n\tconst { timezone } = getSettings();\n\n\tconst siteOffset = Number( timezone.offset );\n\tconst dateOffset = -1 * ( date.getTimezoneOffset() / 60 );\n\treturn siteOffset === dateOffset;\n}\n\nfunction isSameDay( left, right ) {\n\treturn (\n\t\tleft.getDate() === right.getDate() &&\n\t\tleft.getMonth() === right.getMonth() &&\n\t\tleft.getFullYear() === right.getFullYear()\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA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AClC,MAAM;IAAEc;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAElC,IAAKD,QAAQ,CAACE,IAAI,IAAIC,KAAK,CAAEC,MAAM,CAAEJ,QAAQ,CAACE,IAAK,CAAE,CAAC,EAAG;IACxD,OAAOF,QAAQ,CAACE,IAAI;EACrB;EAEA,MAAMG,MAAM,GAAGL,QAAQ,CAACM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG;EAC7C,OAAQ,MAAMD,MAAQ,GAAGL,QAAQ,CAACO,eAAiB,EAAC;AACrD;AAEA,SAASb,4BAA4BA,CAAEpB,IAAI,EAAG;EAC7C,MAAM;IAAE0B;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAElC,MAAMO,UAAU,GAAGJ,MAAM,CAAEJ,QAAQ,CAACM,MAAO,CAAC;EAC5C,MAAMG,UAAU,GAAG,CAAC,CAAC,IAAKnC,IAAI,CAACoC,iBAAiB,CAAC,CAAC,GAAG,EAAE,CAAE;EACzD,OAAOF,UAAU,KAAKC,UAAU;AACjC;AAEA,SAASd,SAASA,CAAEgB,IAAI,EAAEC,KAAK,EAAG;EACjC,OACCD,IAAI,CAAC3B,OAAO,CAAC,CAAC,KAAK4B,KAAK,CAAC5B,OAAO,CAAC,CAAC,IAClC2B,IAAI,CAACE,QAAQ,CAAC,CAAC,KAAKD,KAAK,CAACC,QAAQ,CAAC,CAAC,IACpCF,IAAI,CAACZ,WAAW,CAAC,CAAC,KAAKa,KAAK,CAACb,WAAW,CAAC,CAAC;AAE5C","ignoreList":[]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = PostSchedulePanel;
8
- var _react = require("react");
9
8
  var _components = require("@wordpress/components");
10
9
  var _i18n = require("@wordpress/i18n");
11
10
  var _element = require("@wordpress/element");
@@ -16,6 +15,7 @@ var _label = require("./label");
16
15
  var _postPanelRow = _interopRequireDefault(require("../post-panel-row"));
17
16
  var _store = require("../../store");
18
17
  var _constants = require("../../store/constants");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
19
  /**
20
20
  * WordPress dependencies
21
21
  */
@@ -25,6 +25,12 @@ var _constants = require("../../store/constants");
25
25
  */
26
26
 
27
27
  const DESIGN_POST_TYPES = [_constants.TEMPLATE_POST_TYPE, _constants.TEMPLATE_PART_POST_TYPE, _constants.PATTERN_POST_TYPE, _constants.NAVIGATION_POST_TYPE];
28
+
29
+ /**
30
+ * Renders the Post Schedule Panel component.
31
+ *
32
+ * @return {Component} The component to be rendered.
33
+ */
28
34
  function PostSchedulePanel() {
29
35
  const [popoverAnchor, setPopoverAnchor] = (0, _element.useState)(null);
30
36
  const postType = (0, _data.useSelect)(select => select(_store.store).getCurrentPostType(), []);
@@ -34,7 +40,9 @@ function PostSchedulePanel() {
34
40
  // move around when the label changes.
35
41
  anchor: popoverAnchor,
36
42
  'aria-label': (0, _i18n.__)('Change publish date'),
37
- placement: 'bottom-end'
43
+ placement: 'left-start',
44
+ offset: 36,
45
+ shift: true
38
46
  }), [popoverAnchor]);
39
47
  const label = (0, _label.usePostScheduleLabel)();
40
48
  const fullLabel = (0, _label.usePostScheduleLabel)({
@@ -43,34 +51,39 @@ function PostSchedulePanel() {
43
51
  if (DESIGN_POST_TYPES.includes(postType)) {
44
52
  return null;
45
53
  }
46
- return (0, _react.createElement)(_check.default, null, (0, _react.createElement)(_postPanelRow.default, {
47
- label: (0, _i18n.__)('Publish'),
48
- ref: setPopoverAnchor
49
- }, (0, _react.createElement)(_components.Dropdown, {
50
- popoverProps: popoverProps,
51
- focusOnMount: true,
52
- className: "editor-post-schedule__panel-dropdown",
53
- contentClassName: "editor-post-schedule__dialog",
54
- renderToggle: ({
55
- onToggle,
56
- isOpen
57
- }) => (0, _react.createElement)(_components.Button, {
58
- size: "compact",
59
- className: "editor-post-schedule__dialog-toggle",
60
- variant: "tertiary",
61
- onClick: onToggle,
62
- "aria-label": (0, _i18n.sprintf)(
63
- // translators: %s: Current post date.
64
- (0, _i18n.__)('Change date: %s'), label),
65
- label: fullLabel,
66
- showTooltip: label !== fullLabel,
67
- "aria-expanded": isOpen
68
- }, label),
69
- renderContent: ({
70
- onClose
71
- }) => (0, _react.createElement)(_index.default, {
72
- onClose: onClose
54
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_check.default, {
55
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_postPanelRow.default, {
56
+ label: (0, _i18n.__)('Publish'),
57
+ ref: setPopoverAnchor,
58
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, {
59
+ popoverProps: popoverProps,
60
+ focusOnMount: true,
61
+ className: "editor-post-schedule__panel-dropdown",
62
+ contentClassName: "editor-post-schedule__dialog",
63
+ renderToggle: ({
64
+ onToggle,
65
+ isOpen
66
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
67
+ size: "compact",
68
+ className: "editor-post-schedule__dialog-toggle",
69
+ variant: "tertiary",
70
+ tooltipPosition: "middle left",
71
+ onClick: onToggle,
72
+ "aria-label": (0, _i18n.sprintf)(
73
+ // translators: %s: Current post date.
74
+ (0, _i18n.__)('Change date: %s'), label),
75
+ label: fullLabel,
76
+ showTooltip: label !== fullLabel,
77
+ "aria-expanded": isOpen,
78
+ children: label
79
+ }),
80
+ renderContent: ({
81
+ onClose
82
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
83
+ onClose: onClose
84
+ })
85
+ })
73
86
  })
74
- })));
87
+ });
75
88
  }
76
89
  //# sourceMappingURL=panel.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_element","_data","_check","_interopRequireDefault","_index","_label","_postPanelRow","_store","_constants","DESIGN_POST_TYPES","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","NAVIGATION_POST_TYPE","PostSchedulePanel","popoverAnchor","setPopoverAnchor","useState","postType","useSelect","select","editorStore","getCurrentPostType","popoverProps","useMemo","anchor","__","placement","label","usePostScheduleLabel","fullLabel","full","includes","_react","createElement","default","ref","Dropdown","focusOnMount","className","contentClassName","renderToggle","onToggle","isOpen","Button","size","variant","onClick","sprintf","showTooltip","renderContent","onClose"],"sources":["@wordpress/editor/src/components/post-schedule/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Dropdown } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleCheck from './check';\nimport PostScheduleForm from './index';\nimport { usePostScheduleLabel } from './label';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../../store/constants';\n\nconst DESIGN_POST_TYPES = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n];\n\nexport default function PostSchedulePanel() {\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst postType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': __( 'Change publish date' ),\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst label = usePostScheduleLabel();\n\tconst fullLabel = usePostScheduleLabel( { full: true } );\n\tif ( DESIGN_POST_TYPES.includes( postType ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostScheduleCheck>\n\t\t\t<PostPanelRow label={ __( 'Publish' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\tclassName=\"editor-post-schedule__panel-dropdown\"\n\t\t\t\t\tcontentClassName=\"editor-post-schedule__dialog\"\n\t\t\t\t\trenderToggle={ ( { onToggle, isOpen } ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\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\tonClick={ onToggle }\n\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Current post date.\n\t\t\t\t\t\t\t\t__( 'Change date: %s' ),\n\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ fullLabel }\n\t\t\t\t\t\t\tshowTooltip={ label !== fullLabel }\n\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostScheduleForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostScheduleCheck>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAH,sBAAA,CAAAL,OAAA;AAC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AC,8BAA8B;IAC/CC,YAAY,EAAGA,CAAE;MAAEC,QAAQ;MAAEC;IAAO,CAAC,KACpC,IAAAV,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAA+C,MAAM;MACNC,IAAI,EAAC,SAAS;MACdN,SAAS,EAAC,qCAAqC;MAC/CO,OAAO,EAAC,UAAU;MAClBC,OAAO,EAAGL,QAAU;MACpB,cAAa,IAAAM,aAAO;MACnB;MACA,IAAAtB,QAAE,EAAE,iBAAkB,CAAC,EACvBE,KACD,CAAG;MACHA,KAAK,EAAGE,SAAW;MACnBmB,WAAW,EAAGrB,KAAK,KAAKE,SAAW;MACnC,iBAAgBa;IAAQ,GAEtBf,KACK,CACN;IACHsB,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KAC5B,IAAAlB,MAAA,CAAAC,aAAA,EAAC9B,MAAA,CAAA+B,OAAgB;MAACgB,OAAO,EAAGA;IAAS,CAAE;EACrC,CACH,CACY,CACI,CAAC;AAEtB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_element","_data","_check","_interopRequireDefault","_index","_label","_postPanelRow","_store","_constants","_jsxRuntime","DESIGN_POST_TYPES","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","NAVIGATION_POST_TYPE","PostSchedulePanel","popoverAnchor","setPopoverAnchor","useState","postType","useSelect","select","editorStore","getCurrentPostType","popoverProps","useMemo","anchor","__","placement","offset","shift","label","usePostScheduleLabel","fullLabel","full","includes","jsx","default","children","ref","Dropdown","focusOnMount","className","contentClassName","renderToggle","onToggle","isOpen","Button","size","variant","tooltipPosition","onClick","sprintf","showTooltip","renderContent","onClose"],"sources":["@wordpress/editor/src/components/post-schedule/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Dropdown } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleCheck from './check';\nimport PostScheduleForm from './index';\nimport { usePostScheduleLabel } from './label';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../../store/constants';\n\nconst DESIGN_POST_TYPES = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n];\n\n/**\n * Renders the Post Schedule Panel component.\n *\n * @return {Component} The component to be rendered.\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\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostScheduleForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostScheduleCheck>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAH,sBAAA,CAAAL,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAK+B,IAAAW,WAAA,GAAAX,OAAA;AArB/B;AACA;AACA;;AAMA;AACA;AACA;;AAaA,MAAMY,iBAAiB,GAAG,CACzBC,6BAAkB,EAClBC,kCAAuB,EACvBC,4BAAiB,EACjBC,+BAAoB,CACpB;;AAED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C,WAAA,CAAA2B,GAAA,EAACvC,WAAA,CAAAkD,MAAM;UACNC,IAAI,EAAC,SAAS;UACdN,SAAS,EAAC,qCAAqC;UAC/CO,OAAO,EAAC,UAAU;UAClBC,eAAe,EAAC,aAAa;UAC7BC,OAAO,EAAGN,QAAU;UACpB,cAAa,IAAAO,aAAO;UACnB;UACA,IAAAzB,QAAE,EAAE,iBAAkB,CAAC,EACvBI,KACD,CAAG;UACHA,KAAK,EAAGE,SAAW;UACnBoB,WAAW,EAAGtB,KAAK,KAAKE,SAAW;UACnC,iBAAgBa,MAAQ;UAAAR,QAAA,EAEtBP;QAAK,CACA,CACN;QACHuB,aAAa,EAAGA,CAAE;UAAEC;QAAQ,CAAC,kBAC5B,IAAA9C,WAAA,CAAA2B,GAAA,EAAChC,MAAA,CAAAiC,OAAgB;UAACkB,OAAO,EAAGA;QAAS,CAAE;MACrC,CACH;IAAC,CACW;EAAC,CACG,CAAC;AAEtB","ignoreList":[]}
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = PostSlugCheck;
8
- var _react = require("react");
9
8
  var _postTypeSupportCheck = _interopRequireDefault(require("../post-type-support-check"));
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
10
  /**
11
11
  * Internal dependencies
12
12
  */
@@ -14,8 +14,9 @@ var _postTypeSupportCheck = _interopRequireDefault(require("../post-type-support
14
14
  function PostSlugCheck({
15
15
  children
16
16
  }) {
17
- return (0, _react.createElement)(_postTypeSupportCheck.default, {
18
- supportKeys: "slug"
19
- }, children);
17
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_postTypeSupportCheck.default, {
18
+ supportKeys: "slug",
19
+ children: children
20
+ });
20
21
  }
21
22
  //# sourceMappingURL=check.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_postTypeSupportCheck","_interopRequireDefault","require","PostSlugCheck","children","_react","createElement","default","supportKeys"],"sources":["@wordpress/editor/src/components/post-slug/check.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nexport default function PostSlugCheck( { children } ) {\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"slug\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGe,SAASC,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACrD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACN,qBAAA,CAAAO,OAAoB;IAACC,WAAW,EAAC;EAAM,GACrCJ,QACmB,CAAC;AAEzB","ignoreList":[]}
1
+ {"version":3,"names":["_postTypeSupportCheck","_interopRequireDefault","require","_jsxRuntime","PostSlugCheck","children","jsx","default","supportKeys"],"sources":["@wordpress/editor/src/components/post-slug/check.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nexport default function PostSlugCheck( { children } ) {\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"slug\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8D,IAAAC,WAAA,GAAAD,OAAA;AAH9D;AACA;AACA;;AAGe,SAASE,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACrD,oBACC,IAAAF,WAAA,CAAAG,GAAA,EAACN,qBAAA,CAAAO,OAAoB;IAACC,WAAW,EAAC,MAAM;IAAAH,QAAA,EACrCA;EAAQ,CACW,CAAC;AAEzB","ignoreList":[]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = PostSlug;
8
- var _react = require("react");
9
8
  var _data = require("@wordpress/data");
10
9
  var _element = require("@wordpress/element");
11
10
  var _i18n = require("@wordpress/i18n");
@@ -13,6 +12,7 @@ var _url = require("@wordpress/url");
13
12
  var _components = require("@wordpress/components");
14
13
  var _check = _interopRequireDefault(require("./check"));
15
14
  var _store = require("../../store");
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
16
  /**
17
17
  * WordPress dependencies
18
18
  */
@@ -29,7 +29,7 @@ function PostSlugControl() {
29
29
  editPost
30
30
  } = (0, _data.useDispatch)(_store.store);
31
31
  const [forceEmptyField, setForceEmptyField] = (0, _element.useState)(false);
32
- return (0, _react.createElement)(_components.TextControl, {
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
33
33
  __nextHasNoMarginBottom: true,
34
34
  label: (0, _i18n.__)('Slug'),
35
35
  autoComplete: "off",
@@ -65,6 +65,8 @@ function PostSlugControl() {
65
65
  });
66
66
  }
67
67
  function PostSlug() {
68
- return (0, _react.createElement)(_check.default, null, (0, _react.createElement)(PostSlugControl, null));
68
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_check.default, {
69
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PostSlugControl, {})
70
+ });
69
71
  }
70
72
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_element","_i18n","_url","_components","_check","_interopRequireDefault","_store","PostSlugControl","postSlug","useSelect","select","safeDecodeURIComponent","editorStore","getEditedPostSlug","editPost","useDispatch","forceEmptyField","setForceEmptyField","useState","_react","createElement","TextControl","__nextHasNoMarginBottom","label","__","autoComplete","spellCheck","value","onChange","newValue","slug","onBlur","event","cleanForSlug","target","className","PostSlug","default"],"sources":["@wordpress/editor/src/components/post-slug/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';\nimport { TextControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport PostSlugCheck from './check';\nimport { store as editorStore } from '../../store';\n\nfunction PostSlugControl() {\n\tconst postSlug = useSelect( ( select ) => {\n\t\treturn safeDecodeURIComponent(\n\t\t\tselect( editorStore ).getEditedPostSlug()\n\t\t);\n\t}, [] );\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ forceEmptyField, setForceEmptyField ] = useState( false );\n\n\treturn (\n\t\t<TextControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Slug' ) }\n\t\t\tautoComplete=\"off\"\n\t\t\tspellCheck=\"false\"\n\t\t\tvalue={ forceEmptyField ? '' : postSlug }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\teditPost( { slug: newValue } );\n\t\t\t\t// When we delete the field the permalink gets\n\t\t\t\t// reverted to the original value.\n\t\t\t\t// The forceEmptyField logic allows the user to have\n\t\t\t\t// the field temporarily empty while typing.\n\t\t\t\tif ( ! newValue ) {\n\t\t\t\t\tif ( ! forceEmptyField ) {\n\t\t\t\t\t\tsetForceEmptyField( true );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tonBlur={ ( event ) => {\n\t\t\t\teditPost( {\n\t\t\t\t\tslug: cleanForSlug( event.target.value ),\n\t\t\t\t} );\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tclassName=\"editor-post-slug\"\n\t\t/>\n\t);\n}\n\nexport default function PostSlug() {\n\treturn (\n\t\t<PostSlugCheck>\n\t\t\t<PostSlugControl />\n\t\t</PostSlugCheck>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,WAA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AM,CAAC;MAC5B;IACD,CAAG;IACHkB,SAAS,EAAC;EAAkB,CAC5B,CAAC;AAEJ;AAEe,SAASC,QAAQA,CAAA,EAAG;EAClC,OACC,IAAAjB,MAAA,CAAAC,aAAA,EAAChB,MAAA,CAAAiC,OAAa,QACb,IAAAlB,MAAA,CAAAC,aAAA,EAACb,eAAe,MAAE,CACJ,CAAC;AAElB","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_element","_i18n","_url","_components","_check","_interopRequireDefault","_store","_jsxRuntime","PostSlugControl","postSlug","useSelect","select","safeDecodeURIComponent","editorStore","getEditedPostSlug","editPost","useDispatch","forceEmptyField","setForceEmptyField","useState","jsx","TextControl","__nextHasNoMarginBottom","label","__","autoComplete","spellCheck","value","onChange","newValue","slug","onBlur","event","cleanForSlug","target","className","PostSlug","default","children"],"sources":["@wordpress/editor/src/components/post-slug/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';\nimport { TextControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport PostSlugCheck from './check';\nimport { store as editorStore } from '../../store';\n\nfunction PostSlugControl() {\n\tconst postSlug = useSelect( ( select ) => {\n\t\treturn safeDecodeURIComponent(\n\t\t\tselect( editorStore ).getEditedPostSlug()\n\t\t);\n\t}, [] );\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ forceEmptyField, setForceEmptyField ] = useState( false );\n\n\treturn (\n\t\t<TextControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Slug' ) }\n\t\t\tautoComplete=\"off\"\n\t\t\tspellCheck=\"false\"\n\t\t\tvalue={ forceEmptyField ? '' : postSlug }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\teditPost( { slug: newValue } );\n\t\t\t\t// When we delete the field the permalink gets\n\t\t\t\t// reverted to the original value.\n\t\t\t\t// The forceEmptyField logic allows the user to have\n\t\t\t\t// the field temporarily empty while typing.\n\t\t\t\tif ( ! newValue ) {\n\t\t\t\t\tif ( ! forceEmptyField ) {\n\t\t\t\t\t\tsetForceEmptyField( true );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tonBlur={ ( event ) => {\n\t\t\t\teditPost( {\n\t\t\t\t\tslug: cleanForSlug( event.target.value ),\n\t\t\t\t} );\n\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tclassName=\"editor-post-slug\"\n\t\t/>\n\t);\n}\n\nexport default function PostSlug() {\n\treturn (\n\t\t<PostSlugCheck>\n\t\t\t<PostSlugControl />\n\t\t</PostSlugCheck>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAmD,IAAAQ,WAAA,GAAAR,OAAA;AAbnD;AACA;AACA;;AAOA;AACA;AACA;;AAIA,SAASS,eAAeA,CAAA,EAAG;EAC1B,MAAMC,QAAQ,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzC,OAAO,IAAAC,2BAAsB,EAC5BD,MAAM,CAAEE,YAAY,CAAC,CAACC,iBAAiB,CAAC,CACzC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAY,CAAC;EAC/C,MAAM,CAAEI,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