@wordpress/editor 13.34.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 (972) hide show
  1. package/CHANGELOG.md +17 -4
  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 +71 -2
  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 +140 -0
  20. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
  21. package/build/components/block-settings-menu/content-only-settings-menu.native.js +11 -0
  22. package/build/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
  23. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  24. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  25. package/build/components/blog-title/index.js +116 -0
  26. package/build/components/blog-title/index.js.map +1 -0
  27. package/build/components/collapsible-block-toolbar/index.js +22 -19
  28. package/build/components/collapsible-block-toolbar/index.js.map +1 -1
  29. package/build/components/commands/index.js +109 -3
  30. package/build/components/commands/index.js.map +1 -1
  31. package/build/components/create-template-part-modal/index.js +167 -0
  32. package/build/components/create-template-part-modal/index.js.map +1 -0
  33. package/build/components/create-template-part-modal/utils.js +64 -0
  34. package/build/components/create-template-part-modal/utils.js.map +1 -0
  35. package/build/components/deprecated.js +2 -2
  36. package/build/components/deprecated.js.map +1 -1
  37. package/build/components/document-bar/index.js +96 -72
  38. package/build/components/document-bar/index.js.map +1 -1
  39. package/build/components/document-outline/index.js +124 -121
  40. package/build/components/document-outline/index.js.map +1 -1
  41. package/build/components/document-outline/item.js +20 -16
  42. package/build/components/document-outline/item.js.map +1 -1
  43. package/build/components/document-tools/index.js +69 -69
  44. package/build/components/document-tools/index.js.map +1 -1
  45. package/build/components/editor-help/add-blocks.native.js +14 -11
  46. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  47. package/build/components/editor-help/customize-blocks.native.js +14 -11
  48. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  49. package/build/components/editor-help/help-detail-navigation-screen.native.js +32 -22
  50. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  51. package/build/components/editor-help/help-get-support-button.native.js +8 -6
  52. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  53. package/build/components/editor-help/help-section-title.native.js +8 -6
  54. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  55. package/build/components/editor-help/help-topic-row.native.js +7 -6
  56. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  57. package/build/components/editor-help/icon-move-blocks.native.js +7 -6
  58. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  59. package/build/components/editor-help/index.native.js +94 -76
  60. package/build/components/editor-help/index.native.js.map +1 -1
  61. package/build/components/editor-help/intro-to-blocks.native.js +41 -37
  62. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  63. package/build/components/editor-help/move-blocks.native.js +25 -21
  64. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  65. package/build/components/editor-help/remove-blocks.native.js +12 -9
  66. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  67. package/build/components/editor-help/view-sections.native.js +24 -19
  68. package/build/components/editor-help/view-sections.native.js.map +1 -1
  69. package/build/components/editor-history/redo.js +2 -2
  70. package/build/components/editor-history/redo.js.map +1 -1
  71. package/build/components/editor-history/undo.js +2 -2
  72. package/build/components/editor-history/undo.js.map +1 -1
  73. package/build/components/editor-interface/content-slot-fill.js +23 -0
  74. package/build/components/editor-interface/content-slot-fill.js.map +1 -0
  75. package/build/components/editor-interface/index.js +178 -0
  76. package/build/components/editor-interface/index.js.map +1 -0
  77. package/build/components/editor-notices/index.js +22 -9
  78. package/build/components/editor-notices/index.js.map +1 -1
  79. package/build/components/editor-snackbars/index.js +2 -2
  80. package/build/components/editor-snackbars/index.js.map +1 -1
  81. package/build/components/entities-saved-states/entity-record-item.js +37 -10
  82. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  83. package/build/components/entities-saved-states/entity-type-list.js +25 -22
  84. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  85. package/build/components/entities-saved-states/index.js +53 -46
  86. package/build/components/entities-saved-states/index.js.map +1 -1
  87. package/build/components/error-boundary/index.js +27 -14
  88. package/build/components/error-boundary/index.js.map +1 -1
  89. package/build/components/error-boundary/index.native.js +45 -35
  90. package/build/components/error-boundary/index.native.js.map +1 -1
  91. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +4 -5
  92. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  93. package/build/components/global-styles-provider/index.js +195 -0
  94. package/build/components/global-styles-provider/index.js.map +1 -0
  95. package/build/components/header/back-button.js +34 -0
  96. package/build/components/header/back-button.js.map +1 -0
  97. package/build/components/header/index.js +176 -0
  98. package/build/components/header/index.js.map +1 -0
  99. package/build/components/inserter-sidebar/index.js +83 -32
  100. package/build/components/inserter-sidebar/index.js.map +1 -1
  101. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  102. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  103. package/build/components/keyboard-shortcut-help-modal/index.js +54 -49
  104. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  105. package/build/components/keyboard-shortcut-help-modal/shortcut.js +30 -26
  106. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  107. package/build/components/list-view-sidebar/index.js +59 -47
  108. package/build/components/list-view-sidebar/index.js.map +1 -1
  109. package/build/components/list-view-sidebar/list-view-outline.js +21 -4
  110. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  111. package/build/components/local-autosave-monitor/index.js +15 -2
  112. package/build/components/local-autosave-monitor/index.js.map +1 -1
  113. package/build/components/mode-switcher/index.js +10 -10
  114. package/build/components/mode-switcher/index.js.map +1 -1
  115. package/build/components/more-menu/copy-content-menu-item.js +5 -4
  116. package/build/components/more-menu/copy-content-menu-item.js.map +1 -1
  117. package/build/components/more-menu/index.js +89 -76
  118. package/build/components/more-menu/index.js.map +1 -1
  119. package/build/components/more-menu/tools-more-menu-group.js +2 -2
  120. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  121. package/build/components/more-menu/view-more-menu-group.js +2 -2
  122. package/build/components/more-menu/view-more-menu-group.js.map +1 -1
  123. package/build/components/offline-status/index.native.js +12 -11
  124. package/build/components/offline-status/index.native.js.map +1 -1
  125. package/build/components/page-attributes/order.js +87 -14
  126. package/build/components/page-attributes/order.js.map +1 -1
  127. package/build/components/page-attributes/panel.js +10 -19
  128. package/build/components/page-attributes/panel.js.map +1 -1
  129. package/build/components/page-attributes/parent.js +86 -3
  130. package/build/components/page-attributes/parent.js.map +1 -1
  131. package/build/components/pattern-duplicate-modal/index.js +59 -0
  132. package/build/components/pattern-duplicate-modal/index.js.map +1 -0
  133. package/build/components/pattern-overrides-panel/index.js +2 -2
  134. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  135. package/build/components/pattern-rename-modal/index.js +58 -0
  136. package/build/components/pattern-rename-modal/index.js.map +1 -0
  137. package/build/components/plugin-document-setting-panel/index.js +17 -12
  138. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  139. package/build/components/plugin-post-publish-panel/index.js +10 -7
  140. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  141. package/build/components/plugin-post-status-info/index.js +7 -4
  142. package/build/components/plugin-post-status-info/index.js.map +1 -1
  143. package/build/components/plugin-pre-publish-panel/index.js +10 -7
  144. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  145. package/build/components/plugin-sidebar/index.js +3 -4
  146. package/build/components/plugin-sidebar/index.js.map +1 -1
  147. package/build/components/plugin-sidebar-more-menu-item/index.js +3 -5
  148. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  149. package/build/components/post-actions/actions.js +454 -327
  150. package/build/components/post-actions/actions.js.map +1 -1
  151. package/build/components/post-actions/export-pattern-action.js +64 -0
  152. package/build/components/post-actions/export-pattern-action.js.map +1 -0
  153. package/build/components/post-actions/export-pattern-action.native.js +11 -0
  154. package/build/components/post-actions/export-pattern-action.native.js.map +1 -0
  155. package/build/components/post-actions/index.js +71 -62
  156. package/build/components/post-actions/index.js.map +1 -1
  157. package/build/components/post-author/check.js +6 -6
  158. package/build/components/post-author/check.js.map +1 -1
  159. package/build/components/post-author/combobox.js +4 -3
  160. package/build/components/post-author/combobox.js.map +1 -1
  161. package/build/components/post-author/hook.js +2 -1
  162. package/build/components/post-author/hook.js.map +1 -1
  163. package/build/components/post-author/index.js +3 -3
  164. package/build/components/post-author/index.js.map +1 -1
  165. package/build/components/post-author/panel.js +72 -4
  166. package/build/components/post-author/panel.js.map +1 -1
  167. package/build/components/post-author/select.js +4 -3
  168. package/build/components/post-author/select.js.map +1 -1
  169. package/build/components/post-card-panel/index.js +46 -35
  170. package/build/components/post-card-panel/index.js.map +1 -1
  171. package/build/components/post-comments/index.js +44 -8
  172. package/build/components/post-comments/index.js.map +1 -1
  173. package/build/components/post-content-information/index.js +8 -5
  174. package/build/components/post-content-information/index.js.map +1 -1
  175. package/build/components/post-discussion/panel.js +122 -24
  176. package/build/components/post-discussion/panel.js.map +1 -1
  177. package/build/components/post-excerpt/check.js +6 -6
  178. package/build/components/post-excerpt/check.js.map +1 -1
  179. package/build/components/post-excerpt/index.js +18 -17
  180. package/build/components/post-excerpt/index.js.map +1 -1
  181. package/build/components/post-excerpt/panel.js +59 -42
  182. package/build/components/post-excerpt/panel.js.map +1 -1
  183. package/build/components/post-excerpt/plugin.js +7 -4
  184. package/build/components/post-excerpt/plugin.js.map +1 -1
  185. package/build/components/post-featured-image/check.js +17 -7
  186. package/build/components/post-featured-image/check.js.map +1 -1
  187. package/build/components/post-featured-image/index.js +77 -49
  188. package/build/components/post-featured-image/index.js.map +1 -1
  189. package/build/components/post-featured-image/panel.js +22 -7
  190. package/build/components/post-featured-image/panel.js.map +1 -1
  191. package/build/components/post-format/check.js +14 -4
  192. package/build/components/post-format/check.js.map +1 -1
  193. package/build/components/post-format/index.js +37 -20
  194. package/build/components/post-format/index.js.map +1 -1
  195. package/build/components/post-format/panel.js +93 -0
  196. package/build/components/post-format/panel.js.map +1 -0
  197. package/build/components/post-last-edited-panel/index.js +7 -4
  198. package/build/components/post-last-edited-panel/index.js.map +1 -1
  199. package/build/components/post-last-revision/check.js +13 -5
  200. package/build/components/post-last-revision/check.js.map +1 -1
  201. package/build/components/post-last-revision/index.js +19 -13
  202. package/build/components/post-last-revision/index.js.map +1 -1
  203. package/build/components/post-last-revision/panel.js +12 -5
  204. package/build/components/post-last-revision/panel.js.map +1 -1
  205. package/build/components/post-locked-modal/index.js +57 -35
  206. package/build/components/post-locked-modal/index.js.map +1 -1
  207. package/build/components/post-panel-row/index.js +13 -10
  208. package/build/components/post-panel-row/index.js.map +1 -1
  209. package/build/components/post-panel-section/index.js +29 -0
  210. package/build/components/post-panel-section/index.js.map +1 -0
  211. package/build/components/post-pending-status/check.js +10 -0
  212. package/build/components/post-pending-status/check.js.map +1 -1
  213. package/build/components/post-pending-status/index.js +14 -7
  214. package/build/components/post-pending-status/index.js.map +1 -1
  215. package/build/components/post-pingbacks/index.js +15 -4
  216. package/build/components/post-pingbacks/index.js.map +1 -1
  217. package/build/components/post-preview-button/index.js +45 -21
  218. package/build/components/post-preview-button/index.js.map +1 -1
  219. package/build/components/post-publish-button/index.js +21 -11
  220. package/build/components/post-publish-button/index.js.map +1 -1
  221. package/build/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  222. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  223. package/build/components/post-publish-panel/index.js +46 -33
  224. package/build/components/post-publish-panel/index.js.map +1 -1
  225. package/build/components/post-publish-panel/maybe-category-panel.js +12 -9
  226. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  227. package/build/components/post-publish-panel/maybe-post-format-panel.js +21 -15
  228. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  229. package/build/components/post-publish-panel/maybe-tags-panel.js +13 -10
  230. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  231. package/build/components/post-publish-panel/maybe-upload-media.js +29 -24
  232. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  233. package/build/components/post-publish-panel/postpublish.js +55 -38
  234. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  235. package/build/components/post-publish-panel/prepublish.js +41 -26
  236. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  237. package/build/components/post-saved-state/index.js +10 -10
  238. package/build/components/post-saved-state/index.js.map +1 -1
  239. package/build/components/post-schedule/check.js +8 -0
  240. package/build/components/post-schedule/check.js.map +1 -1
  241. package/build/components/post-schedule/index.js +30 -5
  242. package/build/components/post-schedule/index.js.map +1 -1
  243. package/build/components/post-schedule/label.js +16 -0
  244. package/build/components/post-schedule/label.js.map +1 -1
  245. package/build/components/post-schedule/panel.js +43 -30
  246. package/build/components/post-schedule/panel.js.map +1 -1
  247. package/build/components/post-slug/check.js +5 -4
  248. package/build/components/post-slug/check.js.map +1 -1
  249. package/build/components/post-slug/index.js +5 -3
  250. package/build/components/post-slug/index.js.map +1 -1
  251. package/build/components/post-slug/panel.js +30 -0
  252. package/build/components/post-slug/panel.js.map +1 -0
  253. package/build/components/post-status/index.js +118 -119
  254. package/build/components/post-status/index.js.map +1 -1
  255. package/build/components/post-sticky/index.js +16 -8
  256. package/build/components/post-sticky/index.js.map +1 -1
  257. package/build/components/post-sticky/panel.js +25 -0
  258. package/build/components/post-sticky/panel.js.map +1 -0
  259. package/build/components/post-switch-to-draft-button/index.js +25 -21
  260. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  261. package/build/components/post-sync-status/index.js +8 -6
  262. package/build/components/post-sync-status/index.js.map +1 -1
  263. package/build/components/post-taxonomies/flat-term-selector.js +21 -20
  264. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  265. package/build/components/post-taxonomies/hierarchical-term-selector.js +71 -61
  266. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  267. package/build/components/post-taxonomies/index.js +6 -6
  268. package/build/components/post-taxonomies/index.js.map +1 -1
  269. package/build/components/post-taxonomies/most-used-terms.js +19 -15
  270. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  271. package/build/components/post-taxonomies/panel.js +15 -11
  272. package/build/components/post-taxonomies/panel.js.map +1 -1
  273. package/build/components/post-template/block-theme.js +42 -32
  274. package/build/components/post-template/block-theme.js.map +1 -1
  275. package/build/components/post-template/classic-theme.js +73 -50
  276. package/build/components/post-template/classic-theme.js.map +1 -1
  277. package/build/components/post-template/create-new-template-modal.js +33 -27
  278. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  279. package/build/components/post-template/create-new-template.js +14 -11
  280. package/build/components/post-template/create-new-template.js.map +1 -1
  281. package/build/components/post-template/panel.js +16 -10
  282. package/build/components/post-template/panel.js.map +1 -1
  283. package/build/components/post-template/reset-default-template.js +5 -4
  284. package/build/components/post-template/reset-default-template.js.map +1 -1
  285. package/build/components/post-template/swap-template-button.js +20 -15
  286. package/build/components/post-template/swap-template-button.js.map +1 -1
  287. package/build/components/post-text-editor/index.js +27 -20
  288. package/build/components/post-text-editor/index.js.map +1 -1
  289. package/build/components/post-title/index.js +31 -19
  290. package/build/components/post-title/index.js.map +1 -1
  291. package/build/components/post-title/index.native.js +81 -57
  292. package/build/components/post-title/index.native.js.map +1 -1
  293. package/build/components/post-title/post-title-raw.js +12 -5
  294. package/build/components/post-title/post-title-raw.js.map +1 -1
  295. package/build/components/post-title/use-post-title-focus.js +7 -0
  296. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  297. package/build/components/post-title/use-post-title.js +5 -0
  298. package/build/components/post-title/use-post-title.js.map +1 -1
  299. package/build/components/post-transform-panel/hooks.js +90 -0
  300. package/build/components/post-transform-panel/hooks.js.map +1 -0
  301. package/build/components/post-transform-panel/index.js +101 -0
  302. package/build/components/post-transform-panel/index.js.map +1 -0
  303. package/build/components/post-trash/index.js +19 -15
  304. package/build/components/post-trash/index.js.map +1 -1
  305. package/build/components/post-type-support-check/index.js +1 -1
  306. package/build/components/post-type-support-check/index.js.map +1 -1
  307. package/build/components/post-url/check.js +8 -0
  308. package/build/components/post-url/check.js.map +1 -1
  309. package/build/components/post-url/index.js +98 -73
  310. package/build/components/post-url/index.js.map +1 -1
  311. package/build/components/post-url/label.js +11 -0
  312. package/build/components/post-url/label.js.map +1 -1
  313. package/build/components/post-url/panel.js +33 -25
  314. package/build/components/post-url/panel.js.map +1 -1
  315. package/build/components/post-view-link/index.js +2 -2
  316. package/build/components/post-view-link/index.js.map +1 -1
  317. package/build/components/post-visibility/check.js +9 -0
  318. package/build/components/post-visibility/check.js.map +1 -1
  319. package/build/components/post-visibility/index.js +83 -68
  320. package/build/components/post-visibility/index.js.map +1 -1
  321. package/build/components/post-visibility/label.js +11 -0
  322. package/build/components/post-visibility/label.js.map +1 -1
  323. package/build/components/posts-per-page/index.js +109 -0
  324. package/build/components/posts-per-page/index.js.map +1 -0
  325. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  326. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  327. package/build/components/preferences-modal/index.js +124 -102
  328. package/build/components/preferences-modal/index.js.map +1 -1
  329. package/build/components/preview-dropdown/index.js +47 -31
  330. package/build/components/preview-dropdown/index.js.map +1 -1
  331. package/build/components/provider/index.js +96 -20
  332. package/build/components/provider/index.js.map +1 -1
  333. package/build/components/provider/index.native.js +55 -19
  334. package/build/components/provider/index.native.js.map +1 -1
  335. package/build/components/provider/use-block-editor-settings.js +23 -4
  336. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  337. package/build/components/provider/with-registry-provider.js +31 -24
  338. package/build/components/provider/with-registry-provider.js.map +1 -1
  339. package/build/components/resizable-editor/index.js +96 -0
  340. package/build/components/resizable-editor/index.js.map +1 -0
  341. package/build/components/resizable-editor/resize-handle.js +59 -0
  342. package/build/components/resizable-editor/resize-handle.js.map +1 -0
  343. package/build/components/save-publish-panels/index.js +35 -26
  344. package/build/components/save-publish-panels/index.js.map +1 -1
  345. package/build/components/sidebar/constants.js +11 -0
  346. package/build/components/sidebar/constants.js.map +1 -0
  347. package/build/components/sidebar/header.js +56 -0
  348. package/build/components/sidebar/header.js.map +1 -0
  349. package/build/components/sidebar/index.js +161 -0
  350. package/build/components/sidebar/index.js.map +1 -0
  351. package/build/components/sidebar/post-summary.js +89 -0
  352. package/build/components/sidebar/post-summary.js.map +1 -0
  353. package/build/components/site-discussion/index.js +133 -0
  354. package/build/components/site-discussion/index.js.map +1 -0
  355. package/build/components/start-page-options/index.js +18 -18
  356. package/build/components/start-page-options/index.js.map +1 -1
  357. package/build/components/start-template-options/index.js +198 -0
  358. package/build/components/start-template-options/index.js.map +1 -0
  359. package/build/components/table-of-contents/index.js +4 -4
  360. package/build/components/table-of-contents/index.js.map +1 -1
  361. package/build/components/table-of-contents/panel.js +53 -35
  362. package/build/components/table-of-contents/panel.js.map +1 -1
  363. package/build/components/template-areas/index.js +36 -22
  364. package/build/components/template-areas/index.js.map +1 -1
  365. package/build/components/template-content-panel/index.js +39 -0
  366. package/build/components/template-content-panel/index.js.map +1 -0
  367. package/build/components/template-validation-notice/index.js +25 -21
  368. package/build/components/template-validation-notice/index.js.map +1 -1
  369. package/build/components/text-editor/index.js +73 -0
  370. package/build/components/text-editor/index.js.map +1 -0
  371. package/build/components/time-to-read/index.js +8 -8
  372. package/build/components/time-to-read/index.js.map +1 -1
  373. package/build/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +6 -6
  374. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  375. package/build/components/{editor-canvas → visual-editor}/index.js +130 -78
  376. package/build/components/visual-editor/index.js.map +1 -0
  377. package/build/components/word-count/index.js +5 -4
  378. package/build/components/word-count/index.js.map +1 -1
  379. package/build/hooks/custom-sources-backwards-compatibility.js +3 -4
  380. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  381. package/build/hooks/index.js +1 -0
  382. package/build/hooks/index.js.map +1 -1
  383. package/build/hooks/media-upload.js +10 -0
  384. package/build/hooks/media-upload.js.map +1 -0
  385. package/build/hooks/pattern-overrides.js +25 -16
  386. package/build/hooks/pattern-overrides.js.map +1 -1
  387. package/build/private-apis.js +15 -38
  388. package/build/private-apis.js.map +1 -1
  389. package/build/private-apis.native.js +48 -0
  390. package/build/private-apis.native.js.map +1 -0
  391. package/build/store/constants.js +4 -1
  392. package/build/store/constants.js.map +1 -1
  393. package/build/store/private-actions.js +10 -14
  394. package/build/store/private-actions.js.map +1 -1
  395. package/build/store/private-selectors.js +45 -2
  396. package/build/store/private-selectors.js.map +1 -1
  397. package/build/store/reducer.js +15 -0
  398. package/build/store/reducer.js.map +1 -1
  399. package/build/store/selectors.js +1 -1
  400. package/build/store/selectors.js.map +1 -1
  401. package/build/utils/set-nested-value.js +44 -0
  402. package/build/utils/set-nested-value.js.map +1 -0
  403. package/build-module/bindings/index.js +1 -3
  404. package/build-module/bindings/index.js.map +1 -1
  405. package/build-module/bindings/pattern-overrides.js +70 -2
  406. package/build-module/bindings/pattern-overrides.js.map +1 -1
  407. package/build-module/bindings/post-meta.js +38 -2
  408. package/build-module/bindings/post-meta.js.map +1 -1
  409. package/build-module/components/autocompleters/user.js +14 -9
  410. package/build-module/components/autocompleters/user.js.map +1 -1
  411. package/build-module/components/block-manager/category.js +20 -17
  412. package/build-module/components/block-manager/category.js.map +1 -1
  413. package/build-module/components/block-manager/checklist.js +16 -14
  414. package/build-module/components/block-manager/checklist.js.map +1 -1
  415. package/build-module/components/block-manager/index.js +38 -33
  416. package/build-module/components/block-manager/index.js.map +1 -1
  417. package/build-module/components/block-removal-warnings/index.js +2 -2
  418. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  419. package/build-module/components/block-settings-menu/content-only-settings-menu.js +135 -0
  420. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
  421. package/build-module/components/block-settings-menu/content-only-settings-menu.native.js +5 -0
  422. package/build-module/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
  423. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  424. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  425. package/build-module/components/blog-title/index.js +110 -0
  426. package/build-module/components/blog-title/index.js.map +1 -0
  427. package/build-module/components/collapsible-block-toolbar/index.js +24 -19
  428. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  429. package/build-module/components/commands/index.js +111 -5
  430. package/build-module/components/commands/index.js.map +1 -1
  431. package/build-module/components/create-template-part-modal/index.js +160 -0
  432. package/build-module/components/create-template-part-modal/index.js.map +1 -0
  433. package/build-module/components/create-template-part-modal/utils.js +54 -0
  434. package/build-module/components/create-template-part-modal/utils.js.map +1 -0
  435. package/build-module/components/deprecated.js +2 -2
  436. package/build-module/components/deprecated.js.map +1 -1
  437. package/build-module/components/document-bar/index.js +95 -70
  438. package/build-module/components/document-bar/index.js.map +1 -1
  439. package/build-module/components/document-outline/index.js +125 -120
  440. package/build-module/components/document-outline/index.js.map +1 -1
  441. package/build-module/components/document-outline/item.js +21 -16
  442. package/build-module/components/document-outline/item.js.map +1 -1
  443. package/build-module/components/document-tools/index.js +72 -70
  444. package/build-module/components/document-tools/index.js.map +1 -1
  445. package/build-module/components/editor-help/add-blocks.native.js +16 -11
  446. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  447. package/build-module/components/editor-help/customize-blocks.native.js +16 -11
  448. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  449. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +33 -22
  450. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  451. package/build-module/components/editor-help/help-get-support-button.native.js +8 -6
  452. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  453. package/build-module/components/editor-help/help-section-title.native.js +8 -6
  454. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  455. package/build-module/components/editor-help/help-topic-row.native.js +7 -6
  456. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  457. package/build-module/components/editor-help/icon-move-blocks.native.js +7 -6
  458. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  459. package/build-module/components/editor-help/index.native.js +96 -76
  460. package/build-module/components/editor-help/index.native.js.map +1 -1
  461. package/build-module/components/editor-help/intro-to-blocks.native.js +43 -37
  462. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  463. package/build-module/components/editor-help/move-blocks.native.js +27 -21
  464. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  465. package/build-module/components/editor-help/remove-blocks.native.js +14 -9
  466. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  467. package/build-module/components/editor-help/view-sections.native.js +25 -19
  468. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  469. package/build-module/components/editor-history/redo.js +2 -2
  470. package/build-module/components/editor-history/redo.js.map +1 -1
  471. package/build-module/components/editor-history/undo.js +2 -2
  472. package/build-module/components/editor-history/undo.js.map +1 -1
  473. package/build-module/components/editor-interface/content-slot-fill.js +16 -0
  474. package/build-module/components/editor-interface/content-slot-fill.js.map +1 -0
  475. package/build-module/components/editor-interface/index.js +172 -0
  476. package/build-module/components/editor-interface/index.js.map +1 -0
  477. package/build-module/components/editor-notices/index.js +25 -9
  478. package/build-module/components/editor-notices/index.js.map +1 -1
  479. package/build-module/components/editor-snackbars/index.js +2 -2
  480. package/build-module/components/editor-snackbars/index.js.map +1 -1
  481. package/build-module/components/entities-saved-states/entity-record-item.js +40 -11
  482. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  483. package/build-module/components/entities-saved-states/entity-type-list.js +26 -22
  484. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  485. package/build-module/components/entities-saved-states/index.js +54 -46
  486. package/build-module/components/entities-saved-states/index.js.map +1 -1
  487. package/build-module/components/error-boundary/index.js +27 -14
  488. package/build-module/components/error-boundary/index.js.map +1 -1
  489. package/build-module/components/error-boundary/index.native.js +46 -35
  490. package/build-module/components/error-boundary/index.native.js.map +1 -1
  491. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
  492. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  493. package/build-module/components/global-styles-provider/index.js +185 -0
  494. package/build-module/components/global-styles-provider/index.js.map +1 -0
  495. package/build-module/components/header/back-button.js +28 -0
  496. package/build-module/components/header/back-button.js.map +1 -0
  497. package/build-module/components/header/index.js +169 -0
  498. package/build-module/components/header/index.js.map +1 -0
  499. package/build-module/components/inserter-sidebar/index.js +85 -34
  500. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  501. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  502. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  503. package/build-module/components/keyboard-shortcut-help-modal/index.js +55 -49
  504. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  505. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +32 -26
  506. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  507. package/build-module/components/list-view-sidebar/index.js +60 -47
  508. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  509. package/build-module/components/list-view-sidebar/list-view-outline.js +23 -4
  510. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  511. package/build-module/components/local-autosave-monitor/index.js +15 -2
  512. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  513. package/build-module/components/mode-switcher/index.js +9 -8
  514. package/build-module/components/mode-switcher/index.js.map +1 -1
  515. package/build-module/components/more-menu/copy-content-menu-item.js +5 -4
  516. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -1
  517. package/build-module/components/more-menu/index.js +91 -76
  518. package/build-module/components/more-menu/index.js.map +1 -1
  519. package/build-module/components/more-menu/tools-more-menu-group.js +2 -2
  520. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  521. package/build-module/components/more-menu/view-more-menu-group.js +2 -2
  522. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -1
  523. package/build-module/components/offline-status/index.native.js +12 -9
  524. package/build-module/components/offline-status/index.native.js.map +1 -1
  525. package/build-module/components/page-attributes/order.js +90 -17
  526. package/build-module/components/page-attributes/order.js.map +1 -1
  527. package/build-module/components/page-attributes/panel.js +13 -21
  528. package/build-module/components/page-attributes/panel.js.map +1 -1
  529. package/build-module/components/page-attributes/parent.js +88 -5
  530. package/build-module/components/page-attributes/parent.js.map +1 -1
  531. package/build-module/components/pattern-duplicate-modal/index.js +51 -0
  532. package/build-module/components/pattern-duplicate-modal/index.js.map +1 -0
  533. package/build-module/components/pattern-overrides-panel/index.js +2 -2
  534. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  535. package/build-module/components/pattern-rename-modal/index.js +50 -0
  536. package/build-module/components/pattern-rename-modal/index.js.map +1 -0
  537. package/build-module/components/plugin-document-setting-panel/index.js +19 -12
  538. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  539. package/build-module/components/plugin-post-publish-panel/index.js +10 -7
  540. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  541. package/build-module/components/plugin-post-status-info/index.js +7 -4
  542. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  543. package/build-module/components/plugin-pre-publish-panel/index.js +10 -7
  544. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  545. package/build-module/components/plugin-sidebar/index.js +2 -2
  546. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  547. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -3
  548. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  549. package/build-module/components/post-actions/actions.js +458 -329
  550. package/build-module/components/post-actions/actions.js.map +1 -1
  551. package/build-module/components/post-actions/export-pattern-action.js +58 -0
  552. package/build-module/components/post-actions/export-pattern-action.js.map +1 -0
  553. package/build-module/components/post-actions/export-pattern-action.native.js +5 -0
  554. package/build-module/components/post-actions/export-pattern-action.native.js.map +1 -0
  555. package/build-module/components/post-actions/index.js +73 -62
  556. package/build-module/components/post-actions/index.js.map +1 -1
  557. package/build-module/components/post-author/check.js +5 -4
  558. package/build-module/components/post-author/check.js.map +1 -1
  559. package/build-module/components/post-author/combobox.js +4 -3
  560. package/build-module/components/post-author/combobox.js.map +1 -1
  561. package/build-module/components/post-author/hook.js +2 -1
  562. package/build-module/components/post-author/hook.js.map +1 -1
  563. package/build-module/components/post-author/index.js +3 -3
  564. package/build-module/components/post-author/index.js.map +1 -1
  565. package/build-module/components/post-author/panel.js +72 -4
  566. package/build-module/components/post-author/panel.js.map +1 -1
  567. package/build-module/components/post-author/select.js +4 -3
  568. package/build-module/components/post-author/select.js.map +1 -1
  569. package/build-module/components/post-card-panel/index.js +49 -38
  570. package/build-module/components/post-card-panel/index.js.map +1 -1
  571. package/build-module/components/post-comments/index.js +47 -9
  572. package/build-module/components/post-comments/index.js.map +1 -1
  573. package/build-module/components/post-content-information/index.js +8 -5
  574. package/build-module/components/post-content-information/index.js.map +1 -1
  575. package/build-module/components/post-discussion/panel.js +125 -26
  576. package/build-module/components/post-discussion/panel.js.map +1 -1
  577. package/build-module/components/post-excerpt/check.js +5 -4
  578. package/build-module/components/post-excerpt/check.js.map +1 -1
  579. package/build-module/components/post-excerpt/index.js +17 -15
  580. package/build-module/components/post-excerpt/index.js.map +1 -1
  581. package/build-module/components/post-excerpt/panel.js +60 -40
  582. package/build-module/components/post-excerpt/panel.js.map +1 -1
  583. package/build-module/components/post-excerpt/plugin.js +7 -4
  584. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  585. package/build-module/components/post-featured-image/check.js +18 -6
  586. package/build-module/components/post-featured-image/check.js.map +1 -1
  587. package/build-module/components/post-featured-image/index.js +78 -49
  588. package/build-module/components/post-featured-image/index.js.map +1 -1
  589. package/build-module/components/post-featured-image/panel.js +22 -7
  590. package/build-module/components/post-featured-image/panel.js.map +1 -1
  591. package/build-module/components/post-format/check.js +14 -4
  592. package/build-module/components/post-format/check.js.map +1 -1
  593. package/build-module/components/post-format/index.js +39 -21
  594. package/build-module/components/post-format/index.js.map +1 -1
  595. package/build-module/components/post-format/panel.js +86 -0
  596. package/build-module/components/post-format/panel.js.map +1 -0
  597. package/build-module/components/post-last-edited-panel/index.js +7 -4
  598. package/build-module/components/post-last-edited-panel/index.js.map +1 -1
  599. package/build-module/components/post-last-revision/check.js +14 -4
  600. package/build-module/components/post-last-revision/check.js.map +1 -1
  601. package/build-module/components/post-last-revision/index.js +21 -13
  602. package/build-module/components/post-last-revision/index.js.map +1 -1
  603. package/build-module/components/post-last-revision/panel.js +13 -4
  604. package/build-module/components/post-last-revision/panel.js.map +1 -1
  605. package/build-module/components/post-locked-modal/index.js +60 -34
  606. package/build-module/components/post-locked-modal/index.js.map +1 -1
  607. package/build-module/components/post-panel-row/index.js +14 -10
  608. package/build-module/components/post-panel-row/index.js.map +1 -1
  609. package/build-module/components/post-panel-section/index.js +21 -0
  610. package/build-module/components/post-panel-section/index.js.map +1 -0
  611. package/build-module/components/post-pending-status/check.js +11 -0
  612. package/build-module/components/post-pending-status/check.js.map +1 -1
  613. package/build-module/components/post-pending-status/index.js +15 -7
  614. package/build-module/components/post-pending-status/index.js.map +1 -1
  615. package/build-module/components/post-pingbacks/index.js +16 -5
  616. package/build-module/components/post-pingbacks/index.js.map +1 -1
  617. package/build-module/components/post-preview-button/index.js +47 -21
  618. package/build-module/components/post-preview-button/index.js.map +1 -1
  619. package/build-module/components/post-publish-button/index.js +22 -11
  620. package/build-module/components/post-publish-button/index.js.map +1 -1
  621. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  622. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  623. package/build-module/components/post-publish-panel/index.js +48 -33
  624. package/build-module/components/post-publish-panel/index.js.map +1 -1
  625. package/build-module/components/post-publish-panel/maybe-category-panel.js +13 -9
  626. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  627. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +22 -15
  628. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  629. package/build-module/components/post-publish-panel/maybe-tags-panel.js +14 -10
  630. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  631. package/build-module/components/post-publish-panel/maybe-upload-media.js +30 -24
  632. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  633. package/build-module/components/post-publish-panel/postpublish.js +57 -38
  634. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  635. package/build-module/components/post-publish-panel/prepublish.js +43 -26
  636. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  637. package/build-module/components/post-saved-state/index.js +10 -8
  638. package/build-module/components/post-saved-state/index.js.map +1 -1
  639. package/build-module/components/post-schedule/check.js +9 -0
  640. package/build-module/components/post-schedule/check.js.map +1 -1
  641. package/build-module/components/post-schedule/index.js +30 -6
  642. package/build-module/components/post-schedule/index.js.map +1 -1
  643. package/build-module/components/post-schedule/label.js +17 -0
  644. package/build-module/components/post-schedule/label.js.map +1 -1
  645. package/build-module/components/post-schedule/panel.js +43 -30
  646. package/build-module/components/post-schedule/panel.js.map +1 -1
  647. package/build-module/components/post-slug/check.js +5 -4
  648. package/build-module/components/post-slug/check.js.map +1 -1
  649. package/build-module/components/post-slug/index.js +5 -3
  650. package/build-module/components/post-slug/index.js.map +1 -1
  651. package/build-module/components/post-slug/panel.js +21 -0
  652. package/build-module/components/post-slug/panel.js.map +1 -0
  653. package/build-module/components/post-status/index.js +121 -120
  654. package/build-module/components/post-status/index.js.map +1 -1
  655. package/build-module/components/post-sticky/index.js +17 -9
  656. package/build-module/components/post-sticky/index.js.map +1 -1
  657. package/build-module/components/post-sticky/panel.js +16 -0
  658. package/build-module/components/post-sticky/panel.js.map +1 -0
  659. package/build-module/components/post-switch-to-draft-button/index.js +27 -21
  660. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  661. package/build-module/components/post-sync-status/index.js +8 -6
  662. package/build-module/components/post-sync-status/index.js.map +1 -1
  663. package/build-module/components/post-taxonomies/flat-term-selector.js +22 -18
  664. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  665. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +71 -59
  666. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  667. package/build-module/components/post-taxonomies/index.js +6 -6
  668. package/build-module/components/post-taxonomies/index.js.map +1 -1
  669. package/build-module/components/post-taxonomies/most-used-terms.js +20 -15
  670. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  671. package/build-module/components/post-taxonomies/panel.js +15 -11
  672. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  673. package/build-module/components/post-template/block-theme.js +44 -32
  674. package/build-module/components/post-template/block-theme.js.map +1 -1
  675. package/build-module/components/post-template/classic-theme.js +74 -50
  676. package/build-module/components/post-template/classic-theme.js.map +1 -1
  677. package/build-module/components/post-template/create-new-template-modal.js +34 -27
  678. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  679. package/build-module/components/post-template/create-new-template.js +16 -11
  680. package/build-module/components/post-template/create-new-template.js.map +1 -1
  681. package/build-module/components/post-template/panel.js +17 -9
  682. package/build-module/components/post-template/panel.js.map +1 -1
  683. package/build-module/components/post-template/reset-default-template.js +5 -4
  684. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  685. package/build-module/components/post-template/swap-template-button.js +22 -15
  686. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  687. package/build-module/components/post-text-editor/index.js +30 -19
  688. package/build-module/components/post-text-editor/index.js.map +1 -1
  689. package/build-module/components/post-title/index.js +31 -20
  690. package/build-module/components/post-title/index.js.map +1 -1
  691. package/build-module/components/post-title/index.native.js +81 -57
  692. package/build-module/components/post-title/index.native.js.map +1 -1
  693. package/build-module/components/post-title/post-title-raw.js +13 -4
  694. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  695. package/build-module/components/post-title/use-post-title-focus.js +8 -0
  696. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  697. package/build-module/components/post-title/use-post-title.js +6 -0
  698. package/build-module/components/post-title/use-post-title.js.map +1 -1
  699. package/build-module/components/post-transform-panel/hooks.js +83 -0
  700. package/build-module/components/post-transform-panel/hooks.js.map +1 -0
  701. package/build-module/components/post-transform-panel/index.js +94 -0
  702. package/build-module/components/post-transform-panel/index.js.map +1 -0
  703. package/build-module/components/post-trash/index.js +21 -15
  704. package/build-module/components/post-trash/index.js.map +1 -1
  705. package/build-module/components/post-type-support-check/index.js +1 -1
  706. package/build-module/components/post-type-support-check/index.js.map +1 -1
  707. package/build-module/components/post-url/check.js +9 -0
  708. package/build-module/components/post-url/check.js.map +1 -1
  709. package/build-module/components/post-url/index.js +100 -72
  710. package/build-module/components/post-url/index.js.map +1 -1
  711. package/build-module/components/post-url/label.js +12 -0
  712. package/build-module/components/post-url/label.js.map +1 -1
  713. package/build-module/components/post-url/panel.js +35 -24
  714. package/build-module/components/post-url/panel.js.map +1 -1
  715. package/build-module/components/post-view-link/index.js +2 -2
  716. package/build-module/components/post-view-link/index.js.map +1 -1
  717. package/build-module/components/post-visibility/check.js +10 -0
  718. package/build-module/components/post-visibility/check.js.map +1 -1
  719. package/build-module/components/post-visibility/index.js +85 -67
  720. package/build-module/components/post-visibility/index.js.map +1 -1
  721. package/build-module/components/post-visibility/label.js +12 -0
  722. package/build-module/components/post-visibility/label.js.map +1 -1
  723. package/build-module/components/posts-per-page/index.js +103 -0
  724. package/build-module/components/posts-per-page/index.js.map +1 -0
  725. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  726. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  727. package/build-module/components/preferences-modal/index.js +126 -102
  728. package/build-module/components/preferences-modal/index.js.map +1 -1
  729. package/build-module/components/preview-dropdown/index.js +49 -31
  730. package/build-module/components/preview-dropdown/index.js.map +1 -1
  731. package/build-module/components/provider/index.js +98 -20
  732. package/build-module/components/provider/index.js.map +1 -1
  733. package/build-module/components/provider/index.native.js +58 -20
  734. package/build-module/components/provider/index.native.js.map +1 -1
  735. package/build-module/components/provider/use-block-editor-settings.js +23 -4
  736. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  737. package/build-module/components/provider/with-registry-provider.js +33 -26
  738. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  739. package/build-module/components/resizable-editor/index.js +89 -0
  740. package/build-module/components/resizable-editor/index.js.map +1 -0
  741. package/build-module/components/resizable-editor/resize-handle.js +54 -0
  742. package/build-module/components/resizable-editor/resize-handle.js.map +1 -0
  743. package/build-module/components/save-publish-panels/index.js +37 -26
  744. package/build-module/components/save-publish-panels/index.js.map +1 -1
  745. package/build-module/components/sidebar/constants.js +5 -0
  746. package/build-module/components/sidebar/constants.js.map +1 -0
  747. package/build-module/components/sidebar/header.js +50 -0
  748. package/build-module/components/sidebar/header.js.map +1 -0
  749. package/build-module/components/sidebar/index.js +154 -0
  750. package/build-module/components/sidebar/index.js.map +1 -0
  751. package/build-module/components/sidebar/post-summary.js +85 -0
  752. package/build-module/components/sidebar/post-summary.js.map +1 -0
  753. package/build-module/components/site-discussion/index.js +127 -0
  754. package/build-module/components/site-discussion/index.js.map +1 -0
  755. package/build-module/components/start-page-options/index.js +18 -18
  756. package/build-module/components/start-page-options/index.js.map +1 -1
  757. package/build-module/components/start-template-options/index.js +192 -0
  758. package/build-module/components/start-template-options/index.js.map +1 -0
  759. package/build-module/components/table-of-contents/index.js +4 -4
  760. package/build-module/components/table-of-contents/index.js.map +1 -1
  761. package/build-module/components/table-of-contents/panel.js +55 -35
  762. package/build-module/components/table-of-contents/panel.js.map +1 -1
  763. package/build-module/components/template-areas/index.js +37 -22
  764. package/build-module/components/template-areas/index.js.map +1 -1
  765. package/build-module/components/template-content-panel/index.js +32 -0
  766. package/build-module/components/template-content-panel/index.js.map +1 -0
  767. package/build-module/components/template-validation-notice/index.js +27 -21
  768. package/build-module/components/template-validation-notice/index.js.map +1 -1
  769. package/build-module/components/text-editor/index.js +66 -0
  770. package/build-module/components/text-editor/index.js.map +1 -0
  771. package/build-module/components/time-to-read/index.js +7 -6
  772. package/build-module/components/time-to-read/index.js.map +1 -1
  773. package/build-module/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +5 -4
  774. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  775. package/build-module/components/{editor-canvas → visual-editor}/index.js +133 -79
  776. package/build-module/components/visual-editor/index.js.map +1 -0
  777. package/build-module/components/word-count/index.js +5 -4
  778. package/build-module/components/word-count/index.js.map +1 -1
  779. package/build-module/hooks/custom-sources-backwards-compatibility.js +2 -2
  780. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  781. package/build-module/hooks/index.js +1 -0
  782. package/build-module/hooks/index.js.map +1 -1
  783. package/build-module/hooks/media-upload.js +7 -0
  784. package/build-module/hooks/media-upload.js.map +1 -0
  785. package/build-module/hooks/pattern-overrides.js +27 -16
  786. package/build-module/hooks/pattern-overrides.js.map +1 -1
  787. package/build-module/private-apis.js +15 -38
  788. package/build-module/private-apis.js.map +1 -1
  789. package/build-module/private-apis.native.js +38 -0
  790. package/build-module/private-apis.native.js.map +1 -0
  791. package/build-module/store/constants.js +3 -0
  792. package/build-module/store/constants.js.map +1 -1
  793. package/build-module/store/private-actions.js +10 -14
  794. package/build-module/store/private-actions.js.map +1 -1
  795. package/build-module/store/private-selectors.js +41 -1
  796. package/build-module/store/private-selectors.js.map +1 -1
  797. package/build-module/store/reducer.js +14 -0
  798. package/build-module/store/reducer.js.map +1 -1
  799. package/build-module/store/selectors.js +1 -1
  800. package/build-module/store/selectors.js.map +1 -1
  801. package/build-module/utils/set-nested-value.js +38 -0
  802. package/build-module/utils/set-nested-value.js.map +1 -0
  803. package/build-style/style-rtl.css +623 -85
  804. package/build-style/style.css +623 -85
  805. package/package.json +43 -37
  806. package/src/bindings/index.js +1 -4
  807. package/src/bindings/pattern-overrides.js +84 -2
  808. package/src/bindings/post-meta.js +46 -6
  809. package/src/components/autocompleters/style.scss +1 -2
  810. package/src/components/block-settings-menu/content-only-settings-menu.js +175 -0
  811. package/src/components/block-settings-menu/content-only-settings-menu.native.js +4 -0
  812. package/src/components/block-settings-menu/style.scss +4 -0
  813. package/src/components/blog-title/index.js +124 -0
  814. package/src/components/blog-title/style.scss +4 -0
  815. package/src/components/collapsible-block-toolbar/index.js +2 -2
  816. package/src/components/commands/index.js +113 -3
  817. package/src/components/create-template-part-modal/index.js +205 -0
  818. package/src/components/create-template-part-modal/style.scss +69 -0
  819. package/src/components/create-template-part-modal/test/utils.js +60 -0
  820. package/src/components/create-template-part-modal/utils.js +67 -0
  821. package/src/components/document-bar/index.js +34 -23
  822. package/src/components/document-outline/item.js +2 -2
  823. package/src/components/document-tools/index.js +21 -28
  824. package/src/components/editor-help/help-get-support-button.native.js +1 -1
  825. package/src/components/editor-interface/content-slot-fill.js +15 -0
  826. package/src/components/editor-interface/index.js +230 -0
  827. package/src/components/editor-notices/index.js +10 -0
  828. package/src/components/entities-saved-states/entity-record-item.js +45 -16
  829. package/src/components/entities-saved-states/style.scss +13 -0
  830. package/src/components/error-boundary/index.js +10 -0
  831. package/src/components/error-boundary/index.native.js +1 -1
  832. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
  833. package/src/components/global-styles-provider/index.js +254 -0
  834. package/src/components/header/back-button.js +27 -0
  835. package/src/components/header/index.js +169 -0
  836. package/src/components/header/style.scss +236 -0
  837. package/src/components/inserter-sidebar/index.js +92 -36
  838. package/src/components/inserter-sidebar/style.scss +1 -7
  839. package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
  840. package/src/components/list-view-sidebar/style.scss +1 -0
  841. package/src/components/local-autosave-monitor/index.js +12 -0
  842. package/src/components/page-attributes/order.js +79 -3
  843. package/src/components/page-attributes/panel.js +10 -26
  844. package/src/components/page-attributes/parent.js +98 -2
  845. package/src/components/page-attributes/style.scss +19 -0
  846. package/src/components/page-attributes/test/order.js +5 -1
  847. package/src/components/pattern-duplicate-modal/index.js +50 -0
  848. package/src/components/pattern-rename-modal/index.js +44 -0
  849. package/src/components/post-actions/actions.js +522 -371
  850. package/src/components/post-actions/export-pattern-action.js +74 -0
  851. package/src/components/post-actions/export-pattern-action.native.js +4 -0
  852. package/src/components/post-actions/index.js +20 -42
  853. package/src/components/post-author/combobox.js +1 -0
  854. package/src/components/post-author/hook.js +1 -1
  855. package/src/components/post-author/panel.js +63 -2
  856. package/src/components/post-author/select.js +1 -0
  857. package/src/components/post-author/style.scss +6 -0
  858. package/src/components/post-card-panel/index.js +56 -55
  859. package/src/components/post-card-panel/style.scss +23 -1
  860. package/src/components/post-comments/index.js +52 -9
  861. package/src/components/post-discussion/panel.js +115 -31
  862. package/src/components/post-discussion/style.scss +24 -0
  863. package/src/components/post-excerpt/panel.js +45 -48
  864. package/src/components/post-excerpt/style.scss +0 -17
  865. package/src/components/post-featured-image/check.js +9 -0
  866. package/src/components/post-featured-image/index.js +15 -0
  867. package/src/components/post-featured-image/panel.js +9 -0
  868. package/src/components/post-format/check.js +8 -0
  869. package/src/components/post-format/index.js +15 -4
  870. package/src/components/post-format/panel.js +87 -0
  871. package/src/components/post-format/style.scss +12 -0
  872. package/src/components/post-last-revision/check.js +8 -0
  873. package/src/components/post-last-revision/index.js +7 -2
  874. package/src/components/post-last-revision/panel.js +5 -0
  875. package/src/components/post-last-revision/test/check.js +5 -1
  876. package/src/components/post-locked-modal/index.js +6 -0
  877. package/src/components/post-panel-row/index.js +2 -2
  878. package/src/components/post-panel-row/style.scss +15 -0
  879. package/src/components/post-panel-section/index.js +19 -0
  880. package/src/components/post-panel-section/style.scss +3 -0
  881. package/src/components/post-pending-status/check.js +10 -0
  882. package/src/components/post-pending-status/index.js +5 -0
  883. package/src/components/post-pingbacks/index.js +17 -2
  884. package/src/components/post-preview-button/index.js +15 -0
  885. package/src/components/post-publish-button/index.js +17 -4
  886. package/src/components/post-publish-panel/index.js +1 -0
  887. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  888. package/src/components/post-publish-panel/style.scss +5 -0
  889. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +3 -3
  890. package/src/components/post-saved-state/index.js +2 -2
  891. package/src/components/post-schedule/check.js +8 -0
  892. package/src/components/post-schedule/index.js +30 -3
  893. package/src/components/post-schedule/label.js +15 -0
  894. package/src/components/post-schedule/panel.js +9 -1
  895. package/src/components/post-schedule/style.scss +0 -11
  896. package/src/components/post-slug/panel.js +22 -0
  897. package/src/components/post-slug/style.scss +5 -0
  898. package/src/components/post-slug/test/index.js +5 -1
  899. package/src/components/post-status/index.js +30 -52
  900. package/src/components/post-status/style.scss +4 -34
  901. package/src/components/post-sticky/index.js +12 -7
  902. package/src/components/post-sticky/panel.js +18 -0
  903. package/src/components/post-sticky/style.scss +3 -0
  904. package/src/components/post-template/block-theme.js +1 -0
  905. package/src/components/post-template/classic-theme.js +15 -0
  906. package/src/components/post-template/panel.js +5 -0
  907. package/src/components/post-template/style.scss +0 -8
  908. package/src/components/post-text-editor/index.js +5 -0
  909. package/src/components/post-title/index.js +10 -3
  910. package/src/components/post-title/index.native.js +70 -35
  911. package/src/components/post-title/post-title-raw.js +10 -2
  912. package/src/components/post-title/use-post-title-focus.js +7 -0
  913. package/src/components/post-title/use-post-title.js +5 -0
  914. package/src/components/post-transform-panel/hooks.js +114 -0
  915. package/src/components/post-transform-panel/index.js +91 -0
  916. package/src/components/post-type-support-check/index.js +1 -1
  917. package/src/components/post-type-support-check/test/index.js +2 -2
  918. package/src/components/post-url/check.js +8 -0
  919. package/src/components/post-url/index.js +41 -24
  920. package/src/components/post-url/label.js +10 -0
  921. package/src/components/post-url/panel.js +6 -1
  922. package/src/components/post-url/style.scss +0 -9
  923. package/src/components/post-visibility/check.js +9 -0
  924. package/src/components/post-visibility/index.js +7 -0
  925. package/src/components/post-visibility/label.js +10 -0
  926. package/src/components/posts-per-page/index.js +101 -0
  927. package/src/components/posts-per-page/style.scss +4 -0
  928. package/src/components/preferences-modal/index.js +3 -3
  929. package/src/components/provider/index.js +72 -0
  930. package/src/components/provider/index.native.js +43 -2
  931. package/src/components/provider/use-block-editor-settings.js +19 -6
  932. package/src/components/provider/with-registry-provider.js +32 -31
  933. package/src/components/resizable-editor/index.js +90 -0
  934. package/src/components/resizable-editor/resize-handle.js +62 -0
  935. package/src/components/resizable-editor/style.scss +53 -0
  936. package/src/components/save-publish-panels/index.js +10 -2
  937. package/src/components/sidebar/constants.js +4 -0
  938. package/src/components/sidebar/header.js +49 -0
  939. package/src/components/sidebar/index.js +196 -0
  940. package/src/components/sidebar/post-summary.js +97 -0
  941. package/src/components/sidebar/style.scss +18 -0
  942. package/src/components/site-discussion/index.js +138 -0
  943. package/src/components/site-discussion/style.scss +19 -0
  944. package/src/components/start-page-options/index.js +6 -4
  945. package/src/components/start-template-options/index.js +219 -0
  946. package/src/components/start-template-options/style.scss +47 -0
  947. package/src/components/template-areas/index.js +15 -6
  948. package/src/components/template-areas/style.scss +0 -1
  949. package/src/components/template-content-panel/index.js +36 -0
  950. package/src/components/text-editor/index.js +57 -0
  951. package/src/components/text-editor/style.scss +71 -0
  952. package/src/components/{editor-canvas → visual-editor}/index.js +191 -110
  953. package/src/components/visual-editor/style.scss +37 -0
  954. package/src/hooks/index.js +1 -0
  955. package/src/hooks/media-upload.js +11 -0
  956. package/src/hooks/pattern-overrides.js +12 -6
  957. package/src/private-apis.js +18 -38
  958. package/src/private-apis.native.js +37 -0
  959. package/src/store/constants.js +7 -0
  960. package/src/store/private-actions.js +22 -50
  961. package/src/store/private-selectors.js +48 -0
  962. package/src/store/reducer.js +12 -0
  963. package/src/store/selectors.js +1 -1
  964. package/src/style.scss +16 -0
  965. package/src/utils/set-nested-value.js +39 -0
  966. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  967. package/build/components/editor-canvas/index.js.map +0 -1
  968. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  969. package/build-module/components/editor-canvas/index.js.map +0 -1
  970. package/src/components/post-slug/test/check.js +0 -17
  971. package/src/components/provider/README.md +0 -37
  972. /package/src/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","Modal","Button","ExternalLink","__experimentalHStack","HStack","useSelect","useDispatch","addQueryArgs","useEffect","createInterpolateElement","addAction","removeAction","useInstanceId","store","coreStore","editorStore","PostLockedModal","instanceId","hookName","autosave","updatePostLock","isLocked","isTakeover","user","postId","postLockUtils","activePostLock","postType","previewLink","select","isPostLocked","isPostLockTakeover","getPostLockUser","getCurrentPostId","getActivePostLock","getEditedPostAttribute","getEditedPostPreviewLink","getEditorSettings","getPostType","sendPostLock","data","lock","post_id","receivePostLock","received","lock_error","name","avatar","avatar_src_2x","new_lock","releasePostLock","window","FormData","append","unlockNonce","navigator","sendBeacon","ajaxUrl","xhr","XMLHttpRequest","open","send","addEventListener","removeEventListener","userDisplayName","userAvatar","unlockUrl","lockKey","post","action","_wpnonce","nonce","allPostsUrl","post_type","slug","allPostsLabel","createElement","title","focusOnMount","shouldCloseOnClickOutside","shouldCloseOnEsc","isDismissible","size","alignment","spacing","src","alt","className","width","height","strong","PreviewLink","href","Fragment","justify","variant"],"sources":["@wordpress/editor/src/components/post-locked-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button variant=\"tertiary\" href={ unlockUrl }>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button variant=\"primary\" href={ allPostsUrl }>\n\t\t\t\t\t\t\t{ allPostsLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</div>\n\t\t\t</HSt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hE;IAAa,GAC/B9B,EAAE,CAAE,SAAU,CACH;EAEhB,CACD,CACE,CACH,EACC,CAAEwB,UAAU,IACbsD,aAAA,CAAAiB,QAAA,QACCjB,aAAA,YACGnE,wBAAwB,CACzBuD,eAAe,GACZjE,OAAO,EACP;EACAD,EAAE,CACD,qIACD,CAAC,EACDkE,eACA,CAAC,GACDlE,EAAE,CACF,8HACA,CAAC,EACJ;IACC4F,MAAM,EAAEd,aAAA,eAAS,CAAC;IAClBe,WAAW,EACVf,aAAA,CAAC1E,YAAY;MAAC0F,IAAI,EAAGhE;IAAa,GAC/B9B,EAAE,CAAE,SAAU,CACH;EAEhB,CACD,CACE,CAAC,EACJ8E,aAAA,YACG9E,EAAE,CACH,0GACD,CACE,CACF,CACF,EAED8E,aAAA,CAACxE,MAAM;IACNmF,SAAS,EAAC,mCAAmC;IAC7CO,OAAO,EAAC;EAAU,GAEhB,CAAExE,UAAU,IACbsD,aAAA,CAAC3E,MAAM;IAAC8F,OAAO,EAAC,UAAU;IAACH,IAAI,EAAG1B;EAAW,GAC1CpE,EAAE,CAAE,WAAY,CACX,CACR,EACD8E,aAAA,CAAC3E,MAAM;IAAC8F,OAAO,EAAC,SAAS;IAACH,IAAI,EAAGpB;EAAa,GAC3CG,aACK,CACD,CACJ,CACE,CACF,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","Modal","Button","ExternalLink","__experimentalHStack","HStack","useSelect","useDispatch","addQueryArgs","useEffect","createInterpolateElement","addAction","removeAction","useInstanceId","store","coreStore","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PostLockedModal","instanceId","hookName","autosave","updatePostLock","isLocked","isTakeover","user","postId","postLockUtils","activePostLock","postType","previewLink","select","isPostLocked","isPostLockTakeover","getPostLockUser","getCurrentPostId","getActivePostLock","getEditedPostAttribute","getEditedPostPreviewLink","getEditorSettings","getPostType","sendPostLock","data","lock","post_id","receivePostLock","received","lock_error","name","avatar","avatar_src_2x","new_lock","releasePostLock","window","FormData","append","unlockNonce","navigator","sendBeacon","ajaxUrl","xhr","XMLHttpRequest","open","send","addEventListener","removeEventListener","userDisplayName","userAvatar","unlockUrl","lockKey","post","action","_wpnonce","nonce","allPostsUrl","post_type","slug","allPostsLabel","title","focusOnMount","shouldCloseOnClickOutside","shouldCloseOnEsc","isDismissible","size","children","alignment","spacing","src","alt","className","width","height","strong","PreviewLink","href","justify","variant"],"sources":["@wordpress/editor/src/components/post-locked-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * A modal component that is displayed when a post is locked for editing by another user.\n * The modal provides information about the lock status and options to take over or exit the editor.\n *\n * @return {JSX.Element|null} The rendered PostLockedModal component.\n */\nexport default function PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button variant=\"tertiary\" href={ unlockUrl }>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button variant=\"primary\" href={ allPostsUrl }>\n\t\t\t\t\t\t\t{ allPostsLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</div>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,KAAK,EACLC,MAAM,EACNC,YAAY,EACZC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,SAAS,EAAEC,wBAAwB,QAAQ,oBAAoB;AACxE,SAASC,SAAS,EAAEC,YAAY,QAAQ,kBAAkB;AAC1D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAMA,eAAe,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAMC,UAAU,GAAGX,aAAa,CAAEU,eAAgB,CAAC;EACnD,MAAME,QAAQ,GAAG,gCAAgC,GAAGD,UAAU;EAC9D,MAAM;IAAEE,QAAQ;IAAEC;EA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yF,SAAS,EAAC,mCAAmC;UAC7CM,OAAO,EAAC,UAAU;UAAAX,QAAA,GAEhB,CAAE5D,UAAU,iBACbX,IAAA,CAAChB,MAAM;YAACmG,OAAO,EAAC,UAAU;YAACF,IAAI,EAAG1B,SAAW;YAAAgB,QAAA,EAC1C1F,EAAE,CAAE,WAAY;UAAC,CACZ,CACR,eACDmB,IAAA,CAAChB,MAAM;YAACmG,OAAO,EAAC,SAAS;YAACF,IAAI,EAAGpB,WAAa;YAAAU,QAAA,EAC3CP;UAAa,CACR,CAAC;QAAA,CACF,CAAC;MAAA,CACL,CAAC;IAAA,CACC;EAAC,CACH,CAAC;AAEV","ignoreList":[]}
@@ -1,27 +1,31 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * External dependencies
4
3
  */
5
- import classnames from 'classnames';
4
+ import clsx from 'clsx';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
9
8
  */
10
9
  import { __experimentalHStack as HStack } from '@wordpress/components';
11
10
  import { forwardRef } from '@wordpress/element';
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
13
  const PostPanelRow = forwardRef(({
13
14
  className,
14
15
  label,
15
16
  children
16
17
  }, ref) => {
17
- return createElement(HStack, {
18
- className: classnames('editor-post-panel__row', className),
19
- ref: ref
20
- }, label && createElement("div", {
21
- className: "editor-post-panel__row-label"
22
- }, label), createElement("div", {
23
- className: "editor-post-panel__row-control"
24
- }, children));
18
+ return /*#__PURE__*/_jsxs(HStack, {
19
+ className: clsx('editor-post-panel__row', className),
20
+ ref: ref,
21
+ children: [label && /*#__PURE__*/_jsx("div", {
22
+ className: "editor-post-panel__row-label",
23
+ children: label
24
+ }), /*#__PURE__*/_jsx("div", {
25
+ className: "editor-post-panel__row-control",
26
+ children: children
27
+ })]
28
+ });
25
29
  });
26
30
  export default PostPanelRow;
27
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__experimentalHStack","HStack","forwardRef","PostPanelRow","className","label","children","ref","createElement"],"sources":["@wordpress/editor/src/components/post-panel-row/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\n\nconst PostPanelRow = forwardRef( ( { className, label, children }, ref ) => {\n\treturn (\n\t\t<HStack\n\t\t\tclassName={ classnames( 'editor-post-panel__row', className ) }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ label && (\n\t\t\t\t<div className=\"editor-post-panel__row-label\">{ label }</div>\n\t\t\t) }\n\t\t\t<div className=\"editor-post-panel__row-control\">{ children }</div>\n\t\t</HStack>\n\t);\n} );\n\nexport default PostPanelRow;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,UAAU,QAAQ,oBAAoB;AAE/C,MAAMC,YAAY,GAAGD,UAAU,CAAE,CAAE;EAAEE,SAAS;EAAEC,KAAK;EAAEC;AAAS,CAAC,EAAEC,GAAG,KAAM;EAC3E,OACCC,aAAA,CAACP,MAAM;IACNG,SAAS,EAAGL,UAAU,CAAE,wBAAwB,EAAEK,SAAU,CAAG;IAC/DG,GAAG,EAAGA;EAAK,GAETF,KAAK,IACNG,aAAA;IAAKJ,SAAS,EAAC;EAA8B,GAAGC,KAAY,CAC5D,EACDG,aAAA;IAAKJ,SAAS,EAAC;EAAgC,GAAGE,QAAe,CAC1D,CAAC;AAEX,CAAE,CAAC;AAEH,eAAeH,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__experimentalHStack","HStack","forwardRef","jsx","_jsx","jsxs","_jsxs","PostPanelRow","className","label","children","ref"],"sources":["@wordpress/editor/src/components/post-panel-row/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\n\nconst PostPanelRow = forwardRef( ( { className, label, children }, ref ) => {\n\treturn (\n\t\t<HStack\n\t\t\tclassName={ clsx( 'editor-post-panel__row', className ) }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ label && (\n\t\t\t\t<div className=\"editor-post-panel__row-label\">{ label }</div>\n\t\t\t) }\n\t\t\t<div className=\"editor-post-panel__row-control\">{ children }</div>\n\t\t</HStack>\n\t);\n} );\n\nexport default PostPanelRow;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AACtE,SAASC,UAAU,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEhD,MAAMC,YAAY,GAAGL,UAAU,CAAE,CAAE;EAAEM,SAAS;EAAEC,KAAK;EAAEC;AAAS,CAAC,EAAEC,GAAG,KAAM;EAC3E,oBACCL,KAAA,CAACL,MAAM;IACNO,SAAS,EAAGT,IAAI,CAAE,wBAAwB,EAAES,SAAU,CAAG;IACzDG,GAAG,EAAGA,GAAK;IAAAD,QAAA,GAETD,KAAK,iBACNL,IAAA;MAAKI,SAAS,EAAC,8BAA8B;MAAAE,QAAA,EAAGD;IAAK,CAAO,CAC5D,eACDL,IAAA;MAAKI,SAAS,EAAC,gCAAgC;MAAAE,QAAA,EAAGA;IAAQ,CAAO,CAAC;EAAA,CAC3D,CAAC;AAEX,CAAE,CAAC;AAEH,eAAeH,YAAY","ignoreList":[]}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { __experimentalVStack as VStack } from '@wordpress/components';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ function PostPanelSection({
12
+ className,
13
+ children
14
+ }) {
15
+ return /*#__PURE__*/_jsx(VStack, {
16
+ className: clsx('editor-post-panel__section', className),
17
+ children: children
18
+ });
19
+ }
20
+ export default PostPanelSection;
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["clsx","__experimentalVStack","VStack","jsx","_jsx","PostPanelSection","className","children"],"sources":["@wordpress/editor/src/components/post-panel-section/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalVStack as VStack } from '@wordpress/components';\n\nfunction PostPanelSection( { className, children } ) {\n\treturn (\n\t\t<VStack className={ clsx( 'editor-post-panel__section', className ) }>\n\t\t\t{ children }\n\t\t</VStack>\n\t);\n}\n\nexport default PostPanelSection;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEvE,SAASC,gBAAgBA,CAAE;EAAEC,SAAS;EAAEC;AAAS,CAAC,EAAG;EACpD,oBACCH,IAAA,CAACF,MAAM;IAACI,SAAS,EAAGN,IAAI,CAAE,4BAA4B,EAAEM,SAAU,CAAG;IAAAC,QAAA,EAClEA;EAAQ,CACH,CAAC;AAEX;AAEA,eAAeF,gBAAgB","ignoreList":[]}
@@ -7,6 +7,17 @@ import { useSelect } from '@wordpress/data';
7
7
  * Internal dependencies
8
8
  */
9
9
  import { store as editorStore } from '../../store';
10
+
11
+ /**
12
+ * This component checks the publishing status of the current post.
13
+ * If the post is already published or the user doesn't have the
14
+ * capability to publish, it returns null.
15
+ *
16
+ * @param {Object} props Component properties.
17
+ * @param {Element} props.children Children to be rendered.
18
+ *
19
+ * @return {JSX.Element|null} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.
20
+ */
10
21
  export function PostPendingStatusCheck({
11
22
  children
12
23
  }) {
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","editorStore","PostPendingStatusCheck","children","hasPublishAction","isPublished","select","_getCurrentPost$_link","isCurrentPostPublished","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-pending-status/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 function PostPendingStatusCheck( { children } ) {\n\tconst { hasPublishAction, isPublished } = useSelect( ( select ) => {\n\t\tconst { isCurrentPostPublished, getCurrentPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t};\n\t}, [] );\n\n\tif ( isPublished || ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PostPendingStatusCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,OAAO,SAASC,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC,gBAAgB;IAAEC;EAAY,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAClE,MAAM;MAAEC,sBAAsB;MAAEC;IAAe,CAAC,GAC/CH,MAAM,CAAEL,WAAY,CAAC;IACtB,OAAO;MACNG,gBAAgB,GAAAG,qBAAA,GACfE,cAAc,CAAC,CAAC,CAACC,MAAM,GAAI,mBAAmB,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;MAC1DF,WAAW,EAAEG,sBAAsB,CAAC;IACrC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKH,WAAW,IAAI,CAAED,gBAAgB,EAAG;IACxC,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB;AAEA,eAAeD,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","store","editorStore","PostPendingStatusCheck","children","hasPublishAction","isPublished","select","_getCurrentPost$_link","isCurrentPostPublished","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-pending-status/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 * This component checks the publishing status of the current post.\n * If the post is already published or the user doesn't have the\n * capability to publish, it returns null.\n *\n * @param {Object} props Component properties.\n * @param {Element} props.children Children to be rendered.\n *\n * @return {JSX.Element|null} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.\n */\nexport function PostPendingStatusCheck( { children } ) {\n\tconst { hasPublishAction, isPublished } = useSelect( ( select ) => {\n\t\tconst { isCurrentPostPublished, getCurrentPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t};\n\t}, [] );\n\n\tif ( isPublished || ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PostPendingStatusCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC,gBAAgB;IAAEC;EAAY,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAClE,MAAM;MAAEC,sBAAsB;MAAEC;IAAe,CAAC,GAC/CH,MAAM,CAAEL,WAAY,CAAC;IACtB,OAAO;MACNG,gBAAgB,GAAAG,qBAAA,GACfE,cAAc,CAAC,CAAC,CAACC,MAAM,GAAI,mBAAmB,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;MAC1DF,WAAW,EAAEG,sBAAsB,CAAC;IACrC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKH,WAAW,IAAI,CAAED,gBAAgB,EAAG;IACxC,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB;AAEA,eAAeD,sBAAsB","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -11,6 +10,13 @@ import { useDispatch, useSelect } from '@wordpress/data';
11
10
  */
12
11
  import PostPendingStatusCheck from './check';
13
12
  import { store as editorStore } from '../../store';
13
+
14
+ /**
15
+ * A component for displaying and toggling the pending status of a post.
16
+ *
17
+ * @return {JSX.Element} The rendered component.
18
+ */
19
+ import { jsx as _jsx } from "react/jsx-runtime";
14
20
  export function PostPendingStatus() {
15
21
  const status = useSelect(select => select(editorStore).getEditedPostAttribute('status'), []);
16
22
  const {
@@ -22,12 +28,14 @@ export function PostPendingStatus() {
22
28
  status: updatedStatus
23
29
  });
24
30
  };
25
- return createElement(PostPendingStatusCheck, null, createElement(CheckboxControl, {
26
- __nextHasNoMarginBottom: true,
27
- label: __('Pending review'),
28
- checked: status === 'pending',
29
- onChange: togglePendingStatus
30
- }));
31
+ return /*#__PURE__*/_jsx(PostPendingStatusCheck, {
32
+ children: /*#__PURE__*/_jsx(CheckboxControl, {
33
+ __nextHasNoMarginBottom: true,
34
+ label: __('Pending review'),
35
+ checked: status === 'pending',
36
+ onChange: togglePendingStatus
37
+ })
38
+ });
31
39
  }
32
40
  export default PostPendingStatus;
33
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","CheckboxControl","useDispatch","useSelect","PostPendingStatusCheck","store","editorStore","PostPendingStatus","status","select","getEditedPostAttribute","editPost","togglePendingStatus","updatedStatus","createElement","__nextHasNoMarginBottom","label","checked","onChange"],"sources":["@wordpress/editor/src/components/post-pending-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPendingStatusCheck from './check';\nimport { store as editorStore } from '../../store';\n\nexport function PostPendingStatus() {\n\tconst status = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst togglePendingStatus = () => {\n\t\tconst updatedStatus = status === 'pending' ? 'draft' : 'pending';\n\t\teditPost( { status: updatedStatus } );\n\t};\n\n\treturn (\n\t\t<PostPendingStatusCheck>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Pending review' ) }\n\t\t\t\tchecked={ status === 'pending' }\n\t\t\t\tonChange={ togglePendingStatus }\n\t\t\t/>\n\t\t</PostPendingStatusCheck>\n\t);\n}\n\nexport default PostPendingStatus;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,SAAS;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EACnC,MAAMC,MAAM,GAAGL,SAAS,CACrBM,MAAM,IAAMA,MAAM,CAAEH,WAAY,CAAC,CAACI,sBAAsB,CAAE,QAAS,CAAC,EACtE,EACD,CAAC;EACD,MAAM;IAAEC;EAAS,CAAC,GAAGT,WAAW,CAAEI,WAAY,CAAC;EAC/C,MAAMM,mBAAmB,GAAGA,CAAA,KAAM;IACjC,MAAMC,aAAa,GAAGL,MAAM,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS;IAChEG,QAAQ,CAAE;MAAEH,MAAM,EAAEK;IAAc,CAAE,CAAC;EACtC,CAAC;EAED,OACCC,aAAA,CAACV,sBAAsB,QACtBU,aAAA,CAACb,eAAe;IACfc,uBAAuB;IACvBC,KAAK,EAAGhB,EAAE,CAAE,gBAAiB,CAAG;IAChCiB,OAAO,EAAGT,MAAM,KAAK,SAAW;IAChCU,QAAQ,EAAGN;EAAqB,CAChC,CACsB,CAAC;AAE3B;AAEA,eAAeL,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["__","CheckboxControl","useDispatch","useSelect","PostPendingStatusCheck","store","editorStore","jsx","_jsx","PostPendingStatus","status","select","getEditedPostAttribute","editPost","togglePendingStatus","updatedStatus","children","__nextHasNoMarginBottom","label","checked","onChange"],"sources":["@wordpress/editor/src/components/post-pending-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPendingStatusCheck from './check';\nimport { store as editorStore } from '../../store';\n\n/**\n * A component for displaying and toggling the pending status of a post.\n *\n * @return {JSX.Element} The rendered component.\n */\nexport function PostPendingStatus() {\n\tconst status = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst togglePendingStatus = () => {\n\t\tconst updatedStatus = status === 'pending' ? 'draft' : 'pending';\n\t\teditPost( { status: updatedStatus } );\n\t};\n\n\treturn (\n\t\t<PostPendingStatusCheck>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Pending review' ) }\n\t\t\t\tchecked={ status === 'pending' }\n\t\t\t\tonChange={ togglePendingStatus }\n\t\t\t/>\n\t\t</PostPendingStatusCheck>\n\t);\n}\n\nexport default PostPendingStatus;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,SAAS;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EACnC,MAAMC,MAAM,GAAGP,SAAS,CACrBQ,MAAM,IAAMA,MAAM,CAAEL,WAAY,CAAC,CAACM,sBAAsB,CAAE,QAAS,CAAC,EACtE,EACD,CAAC;EACD,MAAM;IAAEC;EAAS,CAAC,GAAGX,WAAW,CAAEI,WAAY,CAAC;EAC/C,MAAMQ,mBAAmB,GAAGA,CAAA,KAAM;IACjC,MAAMC,aAAa,GAAGL,MAAM,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS;IAChEG,QAAQ,CAAE;MAAEH,MAAM,EAAEK;IAAc,CAAE,CAAC;EACtC,CAAC;EAED,oBACCP,IAAA,CAACJ,sBAAsB;IAAAY,QAAA,eACtBR,IAAA,CAACP,eAAe;MACfgB,uBAAuB;MACvBC,KAAK,EAAGlB,EAAE,CAAE,gBAAiB,CAAG;MAChCmB,OAAO,EAAGT,MAAM,KAAK,SAAW;MAChCU,QAAQ,EAAGN;IAAqB,CAChC;EAAC,CACqB,CAAC;AAE3B;AAEA,eAAeL,iBAAiB","ignoreList":[]}
@@ -1,15 +1,15 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
5
4
  import { __ } from '@wordpress/i18n';
6
- import { CheckboxControl } from '@wordpress/components';
5
+ import { CheckboxControl, ExternalLink } from '@wordpress/components';
7
6
  import { useDispatch, useSelect } from '@wordpress/data';
8
7
 
9
8
  /**
10
9
  * Internal dependencies
11
10
  */
12
11
  import { store as editorStore } from '../../store';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  function PostPingbacks() {
14
14
  const pingStatus = useSelect(select => {
15
15
  var _select$getEditedPost;
@@ -21,12 +21,23 @@ function PostPingbacks() {
21
21
  const onTogglePingback = () => editPost({
22
22
  ping_status: pingStatus === 'open' ? 'closed' : 'open'
23
23
  });
24
- return createElement(CheckboxControl, {
24
+ return /*#__PURE__*/_jsx(CheckboxControl, {
25
25
  __nextHasNoMarginBottom: true,
26
- label: __('Allow pingbacks & trackbacks'),
26
+ label: __('Enable pingbacks & trackbacks'),
27
27
  checked: pingStatus === 'open',
28
- onChange: onTogglePingback
28
+ onChange: onTogglePingback,
29
+ help: /*#__PURE__*/_jsx(ExternalLink, {
30
+ href: __('https://wordpress.org/documentation/article/trackbacks-and-pingbacks/'),
31
+ children: __('Learn more about pingbacks & trackbacks')
32
+ })
29
33
  });
30
34
  }
35
+
36
+ /**
37
+ * Renders a control for enabling or disabling pingbacks and trackbacks
38
+ * in a WordPress post.
39
+ *
40
+ * @module PostPingbacks
41
+ */
31
42
  export default PostPingbacks;
32
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","CheckboxControl","useDispatch","useSelect","store","editorStore","PostPingbacks","pingStatus","select","_select$getEditedPost","getEditedPostAttribute","editPost","onTogglePingback","ping_status","createElement","__nextHasNoMarginBottom","label","checked","onChange"],"sources":["@wordpress/editor/src/components/post-pingbacks/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostPingbacks() {\n\tconst pingStatus = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'ping_status' ) ??\n\t\t\t'open',\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onTogglePingback = () =>\n\t\teditPost( {\n\t\t\tping_status: pingStatus === 'open' ? 'closed' : 'open',\n\t\t} );\n\n\treturn (\n\t\t<CheckboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Allow pingbacks & trackbacks' ) }\n\t\t\tchecked={ pingStatus === 'open' }\n\t\t\tonChange={ onTogglePingback }\n\t\t/>\n\t);\n}\n\nexport default PostPingbacks;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,aAAaA,CAAA,EAAG;EACxB,MAAMC,UAAU,GAAGJ,SAAS,CACzBK,MAAM;IAAA,IAAAC,qBAAA;IAAA,QAAAA,qBAAA,GACPD,MAAM,CAAEH,WAAY,CAAC,CAACK,sBAAsB,CAAE,aAAc,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAC7D,MAAM;EAAA,GACP,EACD,CAAC;EACD,MAAM;IAAEE;EAAS,CAAC,GAAGT,WAAW,CAAEG,WAAY,CAAC;EAC/C,MAAMO,gBAAgB,GAAGA,CAAA,KACxBD,QAAQ,CAAE;IACTE,WAAW,EAAEN,UAAU,KAAK,MAAM,GAAG,QAAQ,GAAG;EACjD,CAAE,CAAC;EAEJ,OACCO,aAAA,CAACb,eAAe;IACfc,uBAAuB;IACvBC,KAAK,EAAGhB,EAAE,CAAE,8BAA+B,CAAG;IAC9CiB,OAAO,EAAGV,UAAU,KAAK,MAAQ;IACjCW,QAAQ,EAAGN;EAAkB,CAC7B,CAAC;AAEJ;AAEA,eAAeN,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["__","CheckboxControl","ExternalLink","useDispatch","useSelect","store","editorStore","jsx","_jsx","PostPingbacks","pingStatus","select","_select$getEditedPost","getEditedPostAttribute","editPost","onTogglePingback","ping_status","__nextHasNoMarginBottom","label","checked","onChange","help","href","children"],"sources":["@wordpress/editor/src/components/post-pingbacks/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl, ExternalLink } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostPingbacks() {\n\tconst pingStatus = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'ping_status' ) ??\n\t\t\t'open',\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onTogglePingback = () =>\n\t\teditPost( {\n\t\t\tping_status: pingStatus === 'open' ? 'closed' : 'open',\n\t\t} );\n\n\treturn (\n\t\t<CheckboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Enable pingbacks & trackbacks' ) }\n\t\t\tchecked={ pingStatus === 'open' }\n\t\t\tonChange={ onTogglePingback }\n\t\t\thelp={\n\t\t\t\t<ExternalLink\n\t\t\t\t\thref={ __(\n\t\t\t\t\t\t'https://wordpress.org/documentation/article/trackbacks-and-pingbacks/'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Learn more about pingbacks & trackbacks' ) }\n\t\t\t\t</ExternalLink>\n\t\t\t}\n\t\t/>\n\t);\n}\n\n/**\n * Renders a control for enabling or disabling pingbacks and trackbacks\n * in a WordPress post.\n *\n * @module PostPingbacks\n */\nexport default PostPingbacks;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,EAAEC,YAAY,QAAQ,uBAAuB;AACrE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,SAASC,aAAaA,CAAA,EAAG;EACxB,MAAMC,UAAU,GAAGN,SAAS,CACzBO,MAAM;IAAA,IAAAC,qBAAA;IAAA,QAAAA,qBAAA,GACPD,MAAM,CAAEL,WAAY,CAAC,CAACO,sBAAsB,CAAE,aAAc,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAC7D,MAAM;EAAA,GACP,EACD,CAAC;EACD,MAAM;IAAEE;EAAS,CAAC,GAAGX,WAAW,CAAEG,WAAY,CAAC;EAC/C,MAAMS,gBAAgB,GAAGA,CAAA,KACxBD,QAAQ,CAAE;IACTE,WAAW,EAAEN,UAAU,KAAK,MAAM,GAAG,QAAQ,GAAG;EACjD,CAAE,CAAC;EAEJ,oBACCF,IAAA,CAACP,eAAe;IACfgB,uBAAuB;IACvBC,KAAK,EAAGlB,EAAE,CAAE,+BAAgC,CAAG;IAC/CmB,OAAO,EAAGT,UAAU,KAAK,MAAQ;IACjCU,QAAQ,EAAGL,gBAAkB;IAC7BM,IAAI,eACHb,IAAA,CAACN,YAAY;MACZoB,IAAI,EAAGtB,EAAE,CACR,uEACD,CAAG;MAAAuB,QAAA,EAEDvB,EAAE,CAAE,yCAA0C;IAAC,CACpC;EACd,CACD,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeS,aAAa","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement, Fragment } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -13,21 +12,28 @@ import { store as coreStore } from '@wordpress/core-data';
13
12
  * Internal dependencies
14
13
  */
15
14
  import { store as editorStore } from '../../store';
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ import { jsxs as _jsxs } from "react/jsx-runtime";
17
+ import { Fragment as _Fragment } from "react/jsx-runtime";
16
18
  function writeInterstitialMessage(targetDocument) {
17
- let markup = renderToString(createElement("div", {
18
- className: "editor-post-preview-button__interstitial-message"
19
- }, createElement(SVG, {
20
- xmlns: "http://www.w3.org/2000/svg",
21
- viewBox: "0 0 96 96"
22
- }, createElement(Path, {
23
- className: "outer",
24
- d: "M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",
25
- fill: "none"
26
- }), createElement(Path, {
27
- className: "inner",
28
- d: "M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",
29
- fill: "none"
30
- })), createElement("p", null, __('Generating preview…'))));
19
+ let markup = renderToString( /*#__PURE__*/_jsxs("div", {
20
+ className: "editor-post-preview-button__interstitial-message",
21
+ children: [/*#__PURE__*/_jsxs(SVG, {
22
+ xmlns: "http://www.w3.org/2000/svg",
23
+ viewBox: "0 0 96 96",
24
+ children: [/*#__PURE__*/_jsx(Path, {
25
+ className: "outer",
26
+ d: "M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",
27
+ fill: "none"
28
+ }), /*#__PURE__*/_jsx(Path, {
29
+ className: "inner",
30
+ d: "M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",
31
+ fill: "none"
32
+ })]
33
+ }), /*#__PURE__*/_jsx("p", {
34
+ children: __('Generating preview…')
35
+ })]
36
+ }));
31
37
  markup += `
32
38
  <style>
33
39
  body {
@@ -93,6 +99,22 @@ function writeInterstitialMessage(targetDocument) {
93
99
  targetDocument.title = __('Generating preview…');
94
100
  targetDocument.close();
95
101
  }
102
+
103
+ /**
104
+ * Renders a button that opens a new window or tab for the preview,
105
+ * writes the interstitial message to this window, and then navigates
106
+ * to the actual preview link. The button is not rendered if the post
107
+ * is not viewable and disabled if the post is not saveable.
108
+ *
109
+ * @param {Object} props The component props.
110
+ * @param {string} props.className The class name for the button.
111
+ * @param {string} props.textContent The text content for the button.
112
+ * @param {boolean} props.forceIsAutosaveable Whether to force autosave.
113
+ * @param {string} props.role The role attribute for the button.
114
+ * @param {Function} props.onPreview The callback function for preview event.
115
+ *
116
+ * @return {JSX.Element|null} The rendered button component.
117
+ */
96
118
  export default function PostPreviewButton({
97
119
  className,
98
120
  textContent,
@@ -153,7 +175,7 @@ export default function PostPreviewButton({
153
175
  // changes that were autosaved since the post was last published. Otherwise,
154
176
  // just link to the post's URL.
155
177
  const href = previewLink || currentPostLink;
156
- return createElement(Button, {
178
+ return /*#__PURE__*/_jsx(Button, {
157
179
  variant: !className ? 'tertiary' : undefined,
158
180
  className: className || 'editor-post-preview',
159
181
  href: href,
@@ -161,10 +183,14 @@ export default function PostPreviewButton({
161
183
  disabled: !isSaveable,
162
184
  onClick: openPreviewWindow,
163
185
  role: role,
164
- size: "compact"
165
- }, textContent || createElement(Fragment, null, _x('Preview', 'imperative verb'), createElement(VisuallyHidden, {
166
- as: "span"
167
- }, /* translators: accessibility text */
168
- __('(opens in a new tab)'))));
186
+ size: "compact",
187
+ children: textContent || /*#__PURE__*/_jsxs(_Fragment, {
188
+ children: [_x('Preview', 'imperative verb'), /*#__PURE__*/_jsx(VisuallyHidden, {
189
+ as: "span",
190
+ children: /* translators: accessibility text */
191
+ __('(opens in a new tab)')
192
+ })]
193
+ })
194
+ });
169
195
  }
170
196
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["renderToString","Button","Path","SVG","VisuallyHidden","__","_x","useSelect","useDispatch","applyFilters","store","coreStore","editorStore","writeInterstitialMessage","targetDocument","markup","createElement","className","xmlns","viewBox","d","fill","write","title","close","PostPreviewButton","textContent","forceIsAutosaveable","role","onPreview","postId","currentPostLink","previewLink","isSaveable","isViewable","select","_postType$viewable","editor","core","postType","getPostType","getCurrentPostType","getCurrentPostId","getCurrentPostAttribute","getEditedPostPreviewLink","isEditedPostSaveable","viewable","__unstableSaveForPreview","targetId","openPreviewWindow","event","preventDefault","previewWindow","window","open","focus","document","link","location","href","variant","undefined","target","disabled","onClick","size","Fragment","as"],"sources":["@wordpress/editor/src/components/post-preview-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport { Button, Path, SVG, VisuallyHidden } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction writeInterstitialMessage( targetDocument ) {\n\tlet markup = renderToString(\n\t\t<div className=\"editor-post-preview-button__interstitial-message\">\n\t\t\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\">\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"outer\"\n\t\t\t\t\td=\"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"inner\"\n\t\t\t\t\td=\"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t\t<p>{ __( 'Generating preview…' ) }</p>\n\t\t</div>\n\t);\n\n\tmarkup += `\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\t\t}\n\t\t</style>\n\t`;\n\n\t/**\n\t * Filters the interstitial message shown when generating previews.\n\t *\n\t * @param {string} markup The preview interstitial markup.\n\t */\n\tmarkup = applyFilters( 'editor.PostPreview.interstitialMarkup', markup );\n\n\ttargetDocument.write( markup );\n\ttargetDocument.title = __( 'Generating preview…' );\n\ttargetDocument.close();\n}\n\nexport default function PostPreviewButton( {\n\tclassName,\n\ttextContent,\n\tforceIsAutosaveable,\n\trole,\n\tonPreview,\n} ) {\n\tconst { postId, currentPostLink, previewLink, isSaveable, isViewable } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst editor = select( editorStore );\n\t\t\tconst core = select( coreStore );\n\n\t\t\tconst postType = core.getPostType(\n\t\t\t\teditor.getCurrentPostType( 'type' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tpostId: editor.getCurrentPostId(),\n\t\t\t\tcurrentPostLink: editor.getCurrentPostAttribute( 'link' ),\n\t\t\t\tpreviewLink: editor.getEditedPostPreviewLink(),\n\t\t\t\tisSaveable: editor.isEditedPostSaveable(),\n\t\t\t\tisViewable: postType?.viewable ?? false,\n\t\t\t};\n\t\t}, [] );\n\n\tconst { __unstableSaveForPreview } = useDispatch( editorStore );\n\n\tif ( ! isViewable ) {\n\t\treturn null;\n\t}\n\n\tconst targetId = `wp-preview-${ postId }`;\n\n\tconst openPreviewWindow = async ( event ) => {\n\t\t// Our Preview button has its 'href' and 'target' set correctly for a11y\n\t\t// purposes. Unfortunately, though, we can't rely on the default 'click'\n\t\t// handler since sometimes it incorrectly opens a new tab instead of reusing\n\t\t// the existing one.\n\t\t// https://github.com/WordPress/gutenberg/pull/8330\n\t\tevent.preventDefault();\n\n\t\t// Open up a Preview tab if needed. This is where we'll show the preview.\n\t\tconst previewWindow = window.open( '', targetId );\n\n\t\t// Focus the Preview tab. This might not do anything, depending on the browser's\n\t\t// and user's preferences.\n\t\t// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus\n\t\tpreviewWindow.focus();\n\n\t\twriteInterstitialMessage( previewWindow.document );\n\n\t\tconst link = await __unstableSaveForPreview( { forceIsAutosaveable } );\n\n\t\tpreviewWindow.location = link;\n\n\t\tonPreview?.();\n\t};\n\n\t// Link to the `?preview=true` URL if we have it, since this lets us see\n\t// changes that were autosaved since the post was last published. Otherwise,\n\t// just link to the post's URL.\n\tconst href = previewLink || currentPostLink;\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ ! className ? 'tertiary' : undefined }\n\t\t\tclassName={ className || 'editor-post-preview' }\n\t\t\thref={ href }\n\t\t\ttarget={ targetId }\n\t\t\tdisabled={ ! isSaveable }\n\t\t\tonClick={ openPreviewWindow }\n\t\t\trole={ role }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t{ textContent || (\n\t\t\t\t<>\n\t\t\t\t\t{ _x( 'Preview', 'imperative verb' ) }\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,oBAAoB;AACnD,SAASC,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,cAAc,QAAQ,uBAAuB;AACzE,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,EAAEC,WAAW,QAAQ,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,MAAMV,wBAAwB,CAAE;MAAEpB;IAAoB,CAAE,CAAC;IAEtEyB,aAAa,CAACM,QAAQ,GAAGD,IAAI;IAE7B5B,SAAS,GAAG,CAAC;EACd,CAAC;;EAED;EACA;EACA;EACA,MAAM8B,IAAI,GAAG3B,WAAW,IAAID,eAAe;EAE3C,OACCf,aAAA,CAACf,MAAM;IACN2D,OAAO,EAAG,CAAE3C,SAAS,GAAG,UAAU,GAAG4C,SAAW;IAChD5C,SAAS,EAAGA,SAAS,IAAI,qBAAuB;IAChD0C,IAAI,EAAGA,IAAM;IACbG,MAAM,EAAGd,QAAU;IACnBe,QAAQ,EAAG,CAAE9B,UAAY;IACzB+B,OAAO,EAAGf,iBAAmB;IAC7BrB,IAAI,EAAGA,IAAM;IACbqC,IAAI,EAAC;EAAS,GAEZvC,WAAW,IACZV,aAAA,CAAAkD,QAAA,QACG5D,EAAE,CAAE,SAAS,EAAE,iBAAkB,CAAC,EACpCU,aAAA,CAACZ,cAAc;IAAC+D,EAAE,EAAC;EAAM,GAEvB;EACA9D,EAAE,CAAE,sBAAuB,CAEb,CACf,CAEI,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["renderToString","Button","Path","SVG","VisuallyHidden","__","_x","useSelect","useDispatch","applyFilters","store","coreStore","editorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","writeInterstitialMessage","targetDocument","markup","className","children","xmlns","viewBox","d","fill","write","title","close","PostPreviewButton","textContent","forceIsAutosaveable","role","onPreview","postId","currentPostLink","previewLink","isSaveable","isViewable","select","_postType$viewable","editor","core","postType","getPostType","getCurrentPostType","getCurrentPostId","getCurrentPostAttribute","getEditedPostPreviewLink","isEditedPostSaveable","viewable","__unstableSaveForPreview","targetId","openPreviewWindow","event","preventDefault","previewWindow","window","open","focus","document","link","location","href","variant","undefined","target","disabled","onClick","size","as"],"sources":["@wordpress/editor/src/components/post-preview-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport { Button, Path, SVG, VisuallyHidden } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction writeInterstitialMessage( targetDocument ) {\n\tlet markup = renderToString(\n\t\t<div className=\"editor-post-preview-button__interstitial-message\">\n\t\t\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\">\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"outer\"\n\t\t\t\t\td=\"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"inner\"\n\t\t\t\t\td=\"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t\t<p>{ __( 'Generating preview…' ) }</p>\n\t\t</div>\n\t);\n\n\tmarkup += `\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\t\t}\n\t\t</style>\n\t`;\n\n\t/**\n\t * Filters the interstitial message shown when generating previews.\n\t *\n\t * @param {string} markup The preview interstitial markup.\n\t */\n\tmarkup = applyFilters( 'editor.PostPreview.interstitialMarkup', markup );\n\n\ttargetDocument.write( markup );\n\ttargetDocument.title = __( 'Generating preview…' );\n\ttargetDocument.close();\n}\n\n/**\n * Renders a button that opens a new window or tab for the preview,\n * writes the interstitial message to this window, and then navigates\n * to the actual preview link. The button is not rendered if the post\n * is not viewable and disabled if the post is not saveable.\n *\n * @param {Object} props The component props.\n * @param {string} props.className The class name for the button.\n * @param {string} props.textContent The text content for the button.\n * @param {boolean} props.forceIsAutosaveable Whether to force autosave.\n * @param {string} props.role The role attribute for the button.\n * @param {Function} props.onPreview The callback function for preview event.\n *\n * @return {JSX.Element|null} The rendered button component.\n */\nexport default function PostPreviewButton( {\n\tclassName,\n\ttextContent,\n\tforceIsAutosaveable,\n\trole,\n\tonPreview,\n} ) {\n\tconst { postId, currentPostLink, previewLink, isSaveable, isViewable } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst editor = select( editorStore );\n\t\t\tconst core = select( coreStore );\n\n\t\t\tconst postType = core.getPostType(\n\t\t\t\teditor.getCurrentPostType( 'type' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tpostId: editor.getCurrentPostId(),\n\t\t\t\tcurrentPostLink: editor.getCurrentPostAttribute( 'link' ),\n\t\t\t\tpreviewLink: editor.getEditedPostPreviewLink(),\n\t\t\t\tisSaveable: editor.isEditedPostSaveable(),\n\t\t\t\tisViewable: postType?.viewable ?? false,\n\t\t\t};\n\t\t}, [] );\n\n\tconst { __unstableSaveForPreview } = useDispatch( editorStore );\n\n\tif ( ! isViewable ) {\n\t\treturn null;\n\t}\n\n\tconst targetId = `wp-preview-${ postId }`;\n\n\tconst openPreviewWindow = async ( event ) => {\n\t\t// Our Preview button has its 'href' and 'target' set correctly for a11y\n\t\t// purposes. Unfortunately, though, we can't rely on the default 'click'\n\t\t// handler since sometimes it incorrectly opens a new tab instead of reusing\n\t\t// the existing one.\n\t\t// https://github.com/WordPress/gutenberg/pull/8330\n\t\tevent.preventDefault();\n\n\t\t// Open up a Preview tab if needed. This is where we'll show the preview.\n\t\tconst previewWindow = window.open( '', targetId );\n\n\t\t// Focus the Preview tab. This might not do anything, depending on the browser's\n\t\t// and user's preferences.\n\t\t// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus\n\t\tpreviewWindow.focus();\n\n\t\twriteInterstitialMessage( previewWindow.document );\n\n\t\tconst link = await __unstableSaveForPreview( { forceIsAutosaveable } );\n\n\t\tpreviewWindow.location = link;\n\n\t\tonPreview?.();\n\t};\n\n\t// Link to the `?preview=true` URL if we have it, since this lets us see\n\t// changes that were autosaved since the post was last published. Otherwise,\n\t// just link to the post's URL.\n\tconst href = previewLink || currentPostLink;\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ ! className ? 'tertiary' : undefined }\n\t\t\tclassName={ className || 'editor-post-preview' }\n\t\t\thref={ href }\n\t\t\ttarget={ targetId }\n\t\t\tdisabled={ ! isSaveable }\n\t\t\tonClick={ openPreviewWindow }\n\t\t\trole={ role }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t{ textContent || (\n\t\t\t\t<>\n\t\t\t\t\t{ _x( 'Preview', 'imperative verb' ) }\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,oBAAoB;AACnD,SAASC,MAAM,EAAEC,IAAI,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encies
4
3
  */
@@ -12,6 +11,9 @@ import { compose } from '@wordpress/compose';
12
11
  */
13
12
  import PublishButtonLabel from './label';
14
13
  import { store as editorStore } from '../../store';
14
+ import { unlock } from '../../lock-unlock';
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ import { Fragment as _Fragment } from "react/jsx-runtime";
15
17
  const noop = () => {};
16
18
  export class PostPublishButton extends Component {
17
19
  constructor(props) {
@@ -40,14 +42,18 @@ export class PostPublishButton extends Component {
40
42
  return (...args) => {
41
43
  const {
42
44
  hasNonPostEntityChanges,
43
- setEntitiesSavedStatesCallback
45
+ hasPostMetaChanges,
46
+ setEntitiesSavedStatesCallback,
47
+ isPublished
44
48
  } = this.props;
45
49
  // If a post with non-post entities is published, but the user
46
50
  // elects to not save changes to the non-post entities, those
47
51
  // entities will still be dirty when the Publish button is clicked.
48
52
  // We also need to check that the `setEntitiesSavedStatesCallback`
49
53
  // prop was passed. See https://github.com/WordPress/gutenberg/pull/37383
50
- if (hasNonPostEntityChanges && setEntitiesSavedStatesCallback) {
54
+ //
55
+ // TODO: Explore how to manage `hasPostMetaChanges` and pre-publish workflow properly.
56
+ if ((hasNonPostEntityChanges || hasPostMetaChanges && isPublished) && setEntitiesSavedStatesCallback) {
51
57
  // The modal for multiple entity saving will open,
52
58
  // hold the callback for saving/publishing the post
53
59
  // so that we can call it if the post entity is checked.
@@ -153,12 +159,15 @@ export class PostPublishButton extends Component {
153
159
  onClick: this.createOnClick(onClickToggle)
154
160
  };
155
161
  const componentProps = isToggle ? toggleProps : buttonProps;
156
- return createElement(Fragment, null, createElement(Button, {
157
- ref: this.buttonNode,
158
- ...componentProps,
159
- className: `${componentProps.className} editor-post-publish-button__button`,
160
- size: "compact"
161
- }, createElement(PublishButtonLabel, null)));
162
+ return /*#__PURE__*/_jsx(_Fragment, {
163
+ children: /*#__PURE__*/_jsx(Button, {
164
+ ref: this.buttonNode,
165
+ ...componentProps,
166
+ className: `${componentProps.className} editor-post-publish-button__button`,
167
+ size: "compact",
168
+ children: /*#__PURE__*/_jsx(PublishButtonLabel, {})
169
+ })
170
+ });
162
171
  }
163
172
  }
164
173
  export default compose([withSelect(select => {
@@ -178,8 +187,9 @@ export default compose([withSelect(select => {
178
187
  hasNonPostEntityChanges,
179
188
  isSavingNonPostEntityChanges,
180
189
  getEditedPostAttribute,
181
- getPostEdits
182
- } = select(editorStore);
190
+ getPostEdits,
191
+ hasPostMetaChanges
192
+ } = unlock(select(editorStore));
183
193
  return {
184
194
  isSaving: isSavingPost(),
185
195
  isAutoSaving: isAutosavingPost(),
@@ -195,6 +205,7 @@ export default compose([withSelect(select => {
195
205
  postStatus: getEditedPostAttribute('status'),
196
206
  postStatusHasChanged: getPostEdits()?.status,
197
207
  hasNonPostEntityChanges: hasNonPostEntityChanges(),
208
+ hasPostMetaChanges: hasPostMetaChanges(),
198
209
  isSavingNonPostEntityChanges: isSavingNonPostEntityChanges()
199
210
  };
200
211
  }), withDispatch(dispatch => {