@wordpress/editor 13.35.0 → 14.0.1

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 (947) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +333 -39
  3. package/build/bindings/index.js +1 -3
  4. package/build/bindings/index.js.map +1 -1
  5. package/build/bindings/pattern-overrides.js +1 -1
  6. package/build/bindings/pattern-overrides.js.map +1 -1
  7. package/build/bindings/post-meta.js +38 -2
  8. package/build/bindings/post-meta.js.map +1 -1
  9. package/build/components/autocompleters/user.js +12 -8
  10. package/build/components/autocompleters/user.js.map +1 -1
  11. package/build/components/block-manager/category.js +19 -17
  12. package/build/components/block-manager/category.js.map +1 -1
  13. package/build/components/block-manager/checklist.js +15 -14
  14. package/build/components/block-manager/checklist.js.map +1 -1
  15. package/build/components/block-manager/index.js +37 -33
  16. package/build/components/block-manager/index.js.map +1 -1
  17. package/build/components/block-removal-warnings/index.js +2 -2
  18. package/build/components/block-removal-warnings/index.js.map +1 -1
  19. package/build/components/block-settings-menu/content-only-settings-menu.js +59 -36
  20. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  21. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  22. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  23. package/build/components/blog-title/index.js +116 -0
  24. package/build/components/blog-title/index.js.map +1 -0
  25. package/build/components/collapsible-block-toolbar/index.js +21 -18
  26. package/build/components/collapsible-block-toolbar/index.js.map +1 -1
  27. package/build/components/commands/index.js +109 -3
  28. package/build/components/commands/index.js.map +1 -1
  29. package/build/components/create-template-part-modal/index.js +167 -0
  30. package/build/components/create-template-part-modal/index.js.map +1 -0
  31. package/build/components/create-template-part-modal/utils.js +64 -0
  32. package/build/components/create-template-part-modal/utils.js.map +1 -0
  33. package/build/components/deprecated.js +2 -2
  34. package/build/components/deprecated.js.map +1 -1
  35. package/build/components/document-bar/index.js +94 -70
  36. package/build/components/document-bar/index.js.map +1 -1
  37. package/build/components/document-outline/index.js +124 -121
  38. package/build/components/document-outline/index.js.map +1 -1
  39. package/build/components/document-outline/item.js +18 -14
  40. package/build/components/document-outline/item.js.map +1 -1
  41. package/build/components/document-tools/index.js +56 -53
  42. package/build/components/document-tools/index.js.map +1 -1
  43. package/build/components/editor/index.js +83 -0
  44. package/build/components/editor/index.js.map +1 -0
  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 +176 -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 +3 -4
  92. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  93. package/build/components/global-styles-provider/index.js +81 -16
  94. package/build/components/global-styles-provider/index.js.map +1 -1
  95. package/build/components/header/back-button.js +37 -0
  96. package/build/components/header/back-button.js.map +1 -0
  97. package/build/components/header/index.js +85 -60
  98. package/build/components/header/index.js.map +1 -1
  99. package/build/components/inserter-sidebar/index.js +45 -19
  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 +53 -48
  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/media-categories/index.js +1 -1
  114. package/build/components/media-categories/index.js.map +1 -1
  115. package/build/components/mode-switcher/index.js +10 -10
  116. package/build/components/mode-switcher/index.js.map +1 -1
  117. package/build/components/more-menu/copy-content-menu-item.js +5 -4
  118. package/build/components/more-menu/copy-content-menu-item.js.map +1 -1
  119. package/build/components/more-menu/index.js +89 -76
  120. package/build/components/more-menu/index.js.map +1 -1
  121. package/build/components/more-menu/tools-more-menu-group.js +2 -2
  122. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  123. package/build/components/more-menu/view-more-menu-group.js +2 -2
  124. package/build/components/more-menu/view-more-menu-group.js.map +1 -1
  125. package/build/components/offline-status/index.native.js +12 -11
  126. package/build/components/offline-status/index.native.js.map +1 -1
  127. package/build/components/page-attributes/order.js +87 -14
  128. package/build/components/page-attributes/order.js.map +1 -1
  129. package/build/components/page-attributes/panel.js +10 -19
  130. package/build/components/page-attributes/panel.js.map +1 -1
  131. package/build/components/page-attributes/parent.js +86 -3
  132. package/build/components/page-attributes/parent.js.map +1 -1
  133. package/build/components/pattern-duplicate-modal/index.js +59 -0
  134. package/build/components/pattern-duplicate-modal/index.js.map +1 -0
  135. package/build/components/pattern-overrides-panel/index.js +2 -2
  136. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  137. package/build/components/pattern-rename-modal/index.js +58 -0
  138. package/build/components/pattern-rename-modal/index.js.map +1 -0
  139. package/build/components/plugin-document-setting-panel/index.js +17 -12
  140. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  141. package/build/components/plugin-post-publish-panel/index.js +10 -7
  142. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  143. package/build/components/plugin-post-status-info/index.js +7 -4
  144. package/build/components/plugin-post-status-info/index.js.map +1 -1
  145. package/build/components/plugin-pre-publish-panel/index.js +10 -7
  146. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  147. package/build/components/plugin-sidebar/index.js +3 -4
  148. package/build/components/plugin-sidebar/index.js.map +1 -1
  149. package/build/components/plugin-sidebar-more-menu-item/index.js +3 -5
  150. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  151. package/build/components/post-actions/actions.js +379 -309
  152. package/build/components/post-actions/actions.js.map +1 -1
  153. package/build/components/post-actions/export-pattern-action.js +64 -0
  154. package/build/components/post-actions/export-pattern-action.js.map +1 -0
  155. package/build/components/post-actions/export-pattern-action.native.js +11 -0
  156. package/build/components/post-actions/export-pattern-action.native.js.map +1 -0
  157. package/build/components/post-actions/index.js +66 -50
  158. package/build/components/post-actions/index.js.map +1 -1
  159. package/build/components/post-author/check.js +6 -6
  160. package/build/components/post-author/check.js.map +1 -1
  161. package/build/components/post-author/combobox.js +4 -3
  162. package/build/components/post-author/combobox.js.map +1 -1
  163. package/build/components/post-author/hook.js +2 -1
  164. package/build/components/post-author/hook.js.map +1 -1
  165. package/build/components/post-author/index.js +3 -3
  166. package/build/components/post-author/index.js.map +1 -1
  167. package/build/components/post-author/panel.js +72 -4
  168. package/build/components/post-author/panel.js.map +1 -1
  169. package/build/components/post-author/select.js +4 -3
  170. package/build/components/post-author/select.js.map +1 -1
  171. package/build/components/post-card-panel/index.js +54 -19
  172. package/build/components/post-card-panel/index.js.map +1 -1
  173. package/build/components/post-comments/index.js +38 -22
  174. package/build/components/post-comments/index.js.map +1 -1
  175. package/build/components/post-content-information/index.js +8 -5
  176. package/build/components/post-content-information/index.js.map +1 -1
  177. package/build/components/post-discussion/panel.js +54 -38
  178. package/build/components/post-discussion/panel.js.map +1 -1
  179. package/build/components/post-excerpt/check.js +6 -6
  180. package/build/components/post-excerpt/check.js.map +1 -1
  181. package/build/components/post-excerpt/index.js +18 -17
  182. package/build/components/post-excerpt/index.js.map +1 -1
  183. package/build/components/post-excerpt/panel.js +59 -42
  184. package/build/components/post-excerpt/panel.js.map +1 -1
  185. package/build/components/post-excerpt/plugin.js +7 -4
  186. package/build/components/post-excerpt/plugin.js.map +1 -1
  187. package/build/components/post-featured-image/check.js +17 -7
  188. package/build/components/post-featured-image/check.js.map +1 -1
  189. package/build/components/post-featured-image/index.js +77 -49
  190. package/build/components/post-featured-image/index.js.map +1 -1
  191. package/build/components/post-featured-image/panel.js +22 -7
  192. package/build/components/post-featured-image/panel.js.map +1 -1
  193. package/build/components/post-format/check.js +14 -4
  194. package/build/components/post-format/check.js.map +1 -1
  195. package/build/components/post-format/index.js +37 -20
  196. package/build/components/post-format/index.js.map +1 -1
  197. package/build/components/post-format/panel.js +73 -7
  198. package/build/components/post-format/panel.js.map +1 -1
  199. package/build/components/post-last-edited-panel/index.js +7 -4
  200. package/build/components/post-last-edited-panel/index.js.map +1 -1
  201. package/build/components/post-last-revision/check.js +13 -5
  202. package/build/components/post-last-revision/check.js.map +1 -1
  203. package/build/components/post-last-revision/index.js +49 -17
  204. package/build/components/post-last-revision/index.js.map +1 -1
  205. package/build/components/post-last-revision/panel.js +12 -5
  206. package/build/components/post-last-revision/panel.js.map +1 -1
  207. package/build/components/post-locked-modal/index.js +57 -35
  208. package/build/components/post-locked-modal/index.js.map +1 -1
  209. package/build/components/post-panel-row/index.js +11 -8
  210. package/build/components/post-panel-row/index.js.map +1 -1
  211. package/build/components/post-panel-section/index.js +5 -4
  212. package/build/components/post-panel-section/index.js.map +1 -1
  213. package/build/components/post-pending-status/check.js +10 -0
  214. package/build/components/post-pending-status/check.js.map +1 -1
  215. package/build/components/post-pending-status/index.js +14 -7
  216. package/build/components/post-pending-status/index.js.map +1 -1
  217. package/build/components/post-pingbacks/index.js +13 -5
  218. package/build/components/post-pingbacks/index.js.map +1 -1
  219. package/build/components/post-preview-button/index.js +46 -21
  220. package/build/components/post-preview-button/index.js.map +1 -1
  221. package/build/components/post-publish-button/index.js +21 -11
  222. package/build/components/post-publish-button/index.js.map +1 -1
  223. package/build/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  224. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  225. package/build/components/post-publish-panel/index.js +47 -33
  226. package/build/components/post-publish-panel/index.js.map +1 -1
  227. package/build/components/post-publish-panel/maybe-category-panel.js +12 -9
  228. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  229. package/build/components/post-publish-panel/maybe-post-format-panel.js +21 -15
  230. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  231. package/build/components/post-publish-panel/maybe-tags-panel.js +13 -10
  232. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  233. package/build/components/post-publish-panel/maybe-upload-media.js +29 -24
  234. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  235. package/build/components/post-publish-panel/postpublish.js +55 -38
  236. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  237. package/build/components/post-publish-panel/prepublish.js +41 -26
  238. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  239. package/build/components/post-saved-state/index.js +8 -8
  240. package/build/components/post-saved-state/index.js.map +1 -1
  241. package/build/components/post-schedule/check.js +8 -0
  242. package/build/components/post-schedule/check.js.map +1 -1
  243. package/build/components/post-schedule/index.js +30 -5
  244. package/build/components/post-schedule/index.js.map +1 -1
  245. package/build/components/post-schedule/label.js +16 -0
  246. package/build/components/post-schedule/label.js.map +1 -1
  247. package/build/components/post-schedule/panel.js +43 -30
  248. package/build/components/post-schedule/panel.js.map +1 -1
  249. package/build/components/post-slug/check.js +5 -4
  250. package/build/components/post-slug/check.js.map +1 -1
  251. package/build/components/post-slug/index.js +5 -3
  252. package/build/components/post-slug/index.js.map +1 -1
  253. package/build/components/post-slug/panel.js +7 -4
  254. package/build/components/post-slug/panel.js.map +1 -1
  255. package/build/components/post-status/index.js +118 -119
  256. package/build/components/post-status/index.js.map +1 -1
  257. package/build/components/post-sticky/index.js +16 -8
  258. package/build/components/post-sticky/index.js.map +1 -1
  259. package/build/components/post-sticky/panel.js +6 -2
  260. package/build/components/post-sticky/panel.js.map +1 -1
  261. package/build/components/post-switch-to-draft-button/index.js +25 -21
  262. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  263. package/build/components/post-sync-status/index.js +8 -6
  264. package/build/components/post-sync-status/index.js.map +1 -1
  265. package/build/components/post-taxonomies/flat-term-selector.js +21 -20
  266. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  267. package/build/components/post-taxonomies/hierarchical-term-selector.js +71 -61
  268. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  269. package/build/components/post-taxonomies/index.js +6 -6
  270. package/build/components/post-taxonomies/index.js.map +1 -1
  271. package/build/components/post-taxonomies/most-used-terms.js +19 -15
  272. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  273. package/build/components/post-taxonomies/panel.js +15 -11
  274. package/build/components/post-taxonomies/panel.js.map +1 -1
  275. package/build/components/post-template/block-theme.js +42 -32
  276. package/build/components/post-template/block-theme.js.map +1 -1
  277. package/build/components/post-template/classic-theme.js +73 -50
  278. package/build/components/post-template/classic-theme.js.map +1 -1
  279. package/build/components/post-template/create-new-template-modal.js +33 -27
  280. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  281. package/build/components/post-template/create-new-template.js +14 -11
  282. package/build/components/post-template/create-new-template.js.map +1 -1
  283. package/build/components/post-template/panel.js +16 -10
  284. package/build/components/post-template/panel.js.map +1 -1
  285. package/build/components/post-template/reset-default-template.js +5 -4
  286. package/build/components/post-template/reset-default-template.js.map +1 -1
  287. package/build/components/post-template/swap-template-button.js +20 -15
  288. package/build/components/post-template/swap-template-button.js.map +1 -1
  289. package/build/components/post-text-editor/index.js +27 -20
  290. package/build/components/post-text-editor/index.js.map +1 -1
  291. package/build/components/post-title/index.js +29 -17
  292. package/build/components/post-title/index.js.map +1 -1
  293. package/build/components/post-title/index.native.js +81 -57
  294. package/build/components/post-title/index.native.js.map +1 -1
  295. package/build/components/post-title/post-title-raw.js +10 -3
  296. package/build/components/post-title/post-title-raw.js.map +1 -1
  297. package/build/components/post-title/use-post-title-focus.js +7 -0
  298. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  299. package/build/components/post-title/use-post-title.js +5 -0
  300. package/build/components/post-title/use-post-title.js.map +1 -1
  301. package/build/components/post-transform-panel/index.js +11 -11
  302. package/build/components/post-transform-panel/index.js.map +1 -1
  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-url/check.js +8 -0
  306. package/build/components/post-url/check.js.map +1 -1
  307. package/build/components/post-url/index.js +98 -73
  308. package/build/components/post-url/index.js.map +1 -1
  309. package/build/components/post-url/label.js +11 -0
  310. package/build/components/post-url/label.js.map +1 -1
  311. package/build/components/post-url/panel.js +56 -26
  312. package/build/components/post-url/panel.js.map +1 -1
  313. package/build/components/post-view-link/index.js +2 -2
  314. package/build/components/post-view-link/index.js.map +1 -1
  315. package/build/components/post-visibility/check.js +9 -0
  316. package/build/components/post-visibility/check.js.map +1 -1
  317. package/build/components/post-visibility/index.js +83 -68
  318. package/build/components/post-visibility/index.js.map +1 -1
  319. package/build/components/post-visibility/label.js +11 -0
  320. package/build/components/post-visibility/label.js.map +1 -1
  321. package/build/components/posts-per-page/index.js +109 -0
  322. package/build/components/posts-per-page/index.js.map +1 -0
  323. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  324. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  325. package/build/components/preferences-modal/index.js +124 -102
  326. package/build/components/preferences-modal/index.js.map +1 -1
  327. package/build/components/preview-dropdown/index.js +47 -31
  328. package/build/components/preview-dropdown/index.js.map +1 -1
  329. package/build/components/provider/disable-non-page-content-blocks.js +5 -3
  330. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  331. package/build/components/provider/index.js +94 -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 +7 -6
  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/header.js +17 -14
  346. package/build/components/sidebar/header.js.map +1 -1
  347. package/build/components/sidebar/index.js +36 -32
  348. package/build/components/sidebar/index.js.map +1 -1
  349. package/build/components/sidebar/post-summary.js +39 -33
  350. package/build/components/sidebar/post-summary.js.map +1 -1
  351. package/build/components/site-discussion/index.js +133 -0
  352. package/build/components/site-discussion/index.js.map +1 -0
  353. package/build/components/start-page-options/index.js +13 -11
  354. package/build/components/start-page-options/index.js.map +1 -1
  355. package/build/components/start-template-options/index.js +29 -23
  356. package/build/components/start-template-options/index.js.map +1 -1
  357. package/build/components/table-of-contents/index.js +4 -4
  358. package/build/components/table-of-contents/index.js.map +1 -1
  359. package/build/components/table-of-contents/panel.js +53 -35
  360. package/build/components/table-of-contents/panel.js.map +1 -1
  361. package/build/components/template-areas/index.js +36 -22
  362. package/build/components/template-areas/index.js.map +1 -1
  363. package/build/components/template-content-panel/index.js +7 -6
  364. package/build/components/template-content-panel/index.js.map +1 -1
  365. package/build/components/template-validation-notice/index.js +25 -21
  366. package/build/components/template-validation-notice/index.js.map +1 -1
  367. package/build/components/text-editor/index.js +73 -0
  368. package/build/components/text-editor/index.js.map +1 -0
  369. package/build/components/time-to-read/index.js +8 -8
  370. package/build/components/time-to-read/index.js.map +1 -1
  371. package/build/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +6 -6
  372. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  373. package/build/components/{editor-canvas → visual-editor}/index.js +115 -74
  374. package/build/components/visual-editor/index.js.map +1 -0
  375. package/build/components/word-count/index.js +5 -4
  376. package/build/components/word-count/index.js.map +1 -1
  377. package/build/hooks/custom-sources-backwards-compatibility.js +3 -4
  378. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  379. package/build/hooks/index.js +1 -0
  380. package/build/hooks/index.js.map +1 -1
  381. package/build/hooks/media-upload.js +10 -0
  382. package/build/hooks/media-upload.js.map +1 -0
  383. package/build/hooks/pattern-overrides.js +15 -11
  384. package/build/hooks/pattern-overrides.js.map +1 -1
  385. package/build/private-apis.js +12 -28
  386. package/build/private-apis.js.map +1 -1
  387. package/build/private-apis.native.js +2 -26
  388. package/build/private-apis.native.js.map +1 -1
  389. package/build/store/constants.js +4 -1
  390. package/build/store/constants.js.map +1 -1
  391. package/build/store/private-actions.js +10 -14
  392. package/build/store/private-actions.js.map +1 -1
  393. package/build/store/private-selectors.js +39 -1
  394. package/build/store/private-selectors.js.map +1 -1
  395. package/build/store/selectors.js +1 -1
  396. package/build/store/selectors.js.map +1 -1
  397. package/build/utils/set-nested-value.js +44 -0
  398. package/build/utils/set-nested-value.js.map +1 -0
  399. package/build-module/bindings/index.js +1 -3
  400. package/build-module/bindings/index.js.map +1 -1
  401. package/build-module/bindings/pattern-overrides.js +1 -1
  402. package/build-module/bindings/pattern-overrides.js.map +1 -1
  403. package/build-module/bindings/post-meta.js +38 -2
  404. package/build-module/bindings/post-meta.js.map +1 -1
  405. package/build-module/components/autocompleters/user.js +14 -9
  406. package/build-module/components/autocompleters/user.js.map +1 -1
  407. package/build-module/components/block-manager/category.js +20 -17
  408. package/build-module/components/block-manager/category.js.map +1 -1
  409. package/build-module/components/block-manager/checklist.js +16 -14
  410. package/build-module/components/block-manager/checklist.js.map +1 -1
  411. package/build-module/components/block-manager/index.js +38 -33
  412. package/build-module/components/block-manager/index.js.map +1 -1
  413. package/build-module/components/block-removal-warnings/index.js +2 -2
  414. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  415. package/build-module/components/block-settings-menu/content-only-settings-menu.js +61 -36
  416. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  417. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  418. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  419. package/build-module/components/blog-title/index.js +110 -0
  420. package/build-module/components/blog-title/index.js.map +1 -0
  421. package/build-module/components/collapsible-block-toolbar/index.js +23 -18
  422. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  423. package/build-module/components/commands/index.js +111 -5
  424. package/build-module/components/commands/index.js.map +1 -1
  425. package/build-module/components/create-template-part-modal/index.js +160 -0
  426. package/build-module/components/create-template-part-modal/index.js.map +1 -0
  427. package/build-module/components/create-template-part-modal/utils.js +54 -0
  428. package/build-module/components/create-template-part-modal/utils.js.map +1 -0
  429. package/build-module/components/deprecated.js +2 -2
  430. package/build-module/components/deprecated.js.map +1 -1
  431. package/build-module/components/document-bar/index.js +93 -68
  432. package/build-module/components/document-bar/index.js.map +1 -1
  433. package/build-module/components/document-outline/index.js +125 -120
  434. package/build-module/components/document-outline/index.js.map +1 -1
  435. package/build-module/components/document-outline/item.js +19 -14
  436. package/build-module/components/document-outline/item.js.map +1 -1
  437. package/build-module/components/document-tools/index.js +58 -53
  438. package/build-module/components/document-tools/index.js.map +1 -1
  439. package/build-module/components/editor/index.js +76 -0
  440. package/build-module/components/editor/index.js.map +1 -0
  441. package/build-module/components/editor-help/add-blocks.native.js +16 -11
  442. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  443. package/build-module/components/editor-help/customize-blocks.native.js +16 -11
  444. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  445. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +33 -22
  446. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  447. package/build-module/components/editor-help/help-get-support-button.native.js +8 -6
  448. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  449. package/build-module/components/editor-help/help-section-title.native.js +8 -6
  450. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  451. package/build-module/components/editor-help/help-topic-row.native.js +7 -6
  452. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  453. package/build-module/components/editor-help/icon-move-blocks.native.js +7 -6
  454. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  455. package/build-module/components/editor-help/index.native.js +96 -76
  456. package/build-module/components/editor-help/index.native.js.map +1 -1
  457. package/build-module/components/editor-help/intro-to-blocks.native.js +43 -37
  458. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  459. package/build-module/components/editor-help/move-blocks.native.js +27 -21
  460. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  461. package/build-module/components/editor-help/remove-blocks.native.js +14 -9
  462. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  463. package/build-module/components/editor-help/view-sections.native.js +25 -19
  464. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  465. package/build-module/components/editor-history/redo.js +2 -2
  466. package/build-module/components/editor-history/redo.js.map +1 -1
  467. package/build-module/components/editor-history/undo.js +2 -2
  468. package/build-module/components/editor-history/undo.js.map +1 -1
  469. package/build-module/components/editor-interface/content-slot-fill.js +16 -0
  470. package/build-module/components/editor-interface/content-slot-fill.js.map +1 -0
  471. package/build-module/components/editor-interface/index.js +170 -0
  472. package/build-module/components/editor-interface/index.js.map +1 -0
  473. package/build-module/components/editor-notices/index.js +25 -9
  474. package/build-module/components/editor-notices/index.js.map +1 -1
  475. package/build-module/components/editor-snackbars/index.js +2 -2
  476. package/build-module/components/editor-snackbars/index.js.map +1 -1
  477. package/build-module/components/entities-saved-states/entity-record-item.js +40 -11
  478. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  479. package/build-module/components/entities-saved-states/entity-type-list.js +26 -22
  480. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  481. package/build-module/components/entities-saved-states/index.js +54 -46
  482. package/build-module/components/entities-saved-states/index.js.map +1 -1
  483. package/build-module/components/error-boundary/index.js +27 -14
  484. package/build-module/components/error-boundary/index.js.map +1 -1
  485. package/build-module/components/error-boundary/index.native.js +46 -35
  486. package/build-module/components/error-boundary/index.native.js.map +1 -1
  487. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +2 -2
  488. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  489. package/build-module/components/global-styles-provider/index.js +82 -17
  490. package/build-module/components/global-styles-provider/index.js.map +1 -1
  491. package/build-module/components/header/back-button.js +31 -0
  492. package/build-module/components/header/back-button.js.map +1 -0
  493. package/build-module/components/header/index.js +86 -60
  494. package/build-module/components/header/index.js.map +1 -1
  495. package/build-module/components/inserter-sidebar/index.js +47 -21
  496. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  497. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  498. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  499. package/build-module/components/keyboard-shortcut-help-modal/index.js +54 -48
  500. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  501. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +32 -26
  502. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  503. package/build-module/components/list-view-sidebar/index.js +60 -47
  504. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  505. package/build-module/components/list-view-sidebar/list-view-outline.js +23 -4
  506. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  507. package/build-module/components/local-autosave-monitor/index.js +15 -2
  508. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  509. package/build-module/components/media-categories/index.js +1 -1
  510. package/build-module/components/media-categories/index.js.map +1 -1
  511. package/build-module/components/mode-switcher/index.js +9 -8
  512. package/build-module/components/mode-switcher/index.js.map +1 -1
  513. package/build-module/components/more-menu/copy-content-menu-item.js +5 -4
  514. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -1
  515. package/build-module/components/more-menu/index.js +91 -76
  516. package/build-module/components/more-menu/index.js.map +1 -1
  517. package/build-module/components/more-menu/tools-more-menu-group.js +2 -2
  518. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  519. package/build-module/components/more-menu/view-more-menu-group.js +2 -2
  520. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -1
  521. package/build-module/components/offline-status/index.native.js +12 -9
  522. package/build-module/components/offline-status/index.native.js.map +1 -1
  523. package/build-module/components/page-attributes/order.js +90 -17
  524. package/build-module/components/page-attributes/order.js.map +1 -1
  525. package/build-module/components/page-attributes/panel.js +13 -21
  526. package/build-module/components/page-attributes/panel.js.map +1 -1
  527. package/build-module/components/page-attributes/parent.js +88 -5
  528. package/build-module/components/page-attributes/parent.js.map +1 -1
  529. package/build-module/components/pattern-duplicate-modal/index.js +51 -0
  530. package/build-module/components/pattern-duplicate-modal/index.js.map +1 -0
  531. package/build-module/components/pattern-overrides-panel/index.js +2 -2
  532. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  533. package/build-module/components/pattern-rename-modal/index.js +50 -0
  534. package/build-module/components/pattern-rename-modal/index.js.map +1 -0
  535. package/build-module/components/plugin-document-setting-panel/index.js +19 -12
  536. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  537. package/build-module/components/plugin-post-publish-panel/index.js +10 -7
  538. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  539. package/build-module/components/plugin-post-status-info/index.js +7 -4
  540. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  541. package/build-module/components/plugin-pre-publish-panel/index.js +10 -7
  542. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  543. package/build-module/components/plugin-sidebar/index.js +2 -2
  544. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  545. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -3
  546. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  547. package/build-module/components/post-actions/actions.js +380 -309
  548. package/build-module/components/post-actions/actions.js.map +1 -1
  549. package/build-module/components/post-actions/export-pattern-action.js +58 -0
  550. package/build-module/components/post-actions/export-pattern-action.js.map +1 -0
  551. package/build-module/components/post-actions/export-pattern-action.native.js +5 -0
  552. package/build-module/components/post-actions/export-pattern-action.native.js.map +1 -0
  553. package/build-module/components/post-actions/index.js +68 -50
  554. package/build-module/components/post-actions/index.js.map +1 -1
  555. package/build-module/components/post-author/check.js +5 -4
  556. package/build-module/components/post-author/check.js.map +1 -1
  557. package/build-module/components/post-author/combobox.js +4 -3
  558. package/build-module/components/post-author/combobox.js.map +1 -1
  559. package/build-module/components/post-author/hook.js +2 -1
  560. package/build-module/components/post-author/hook.js.map +1 -1
  561. package/build-module/components/post-author/index.js +3 -3
  562. package/build-module/components/post-author/index.js.map +1 -1
  563. package/build-module/components/post-author/panel.js +72 -4
  564. package/build-module/components/post-author/panel.js.map +1 -1
  565. package/build-module/components/post-author/select.js +4 -3
  566. package/build-module/components/post-author/select.js.map +1 -1
  567. package/build-module/components/post-card-panel/index.js +54 -20
  568. package/build-module/components/post-card-panel/index.js.map +1 -1
  569. package/build-module/components/post-comments/index.js +40 -22
  570. package/build-module/components/post-comments/index.js.map +1 -1
  571. package/build-module/components/post-content-information/index.js +8 -5
  572. package/build-module/components/post-content-information/index.js.map +1 -1
  573. package/build-module/components/post-discussion/panel.js +56 -39
  574. package/build-module/components/post-discussion/panel.js.map +1 -1
  575. package/build-module/components/post-excerpt/check.js +5 -4
  576. package/build-module/components/post-excerpt/check.js.map +1 -1
  577. package/build-module/components/post-excerpt/index.js +17 -15
  578. package/build-module/components/post-excerpt/index.js.map +1 -1
  579. package/build-module/components/post-excerpt/panel.js +60 -40
  580. package/build-module/components/post-excerpt/panel.js.map +1 -1
  581. package/build-module/components/post-excerpt/plugin.js +7 -4
  582. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  583. package/build-module/components/post-featured-image/check.js +18 -6
  584. package/build-module/components/post-featured-image/check.js.map +1 -1
  585. package/build-module/components/post-featured-image/index.js +78 -49
  586. package/build-module/components/post-featured-image/index.js.map +1 -1
  587. package/build-module/components/post-featured-image/panel.js +22 -7
  588. package/build-module/components/post-featured-image/panel.js.map +1 -1
  589. package/build-module/components/post-format/check.js +14 -4
  590. package/build-module/components/post-format/check.js.map +1 -1
  591. package/build-module/components/post-format/index.js +39 -21
  592. package/build-module/components/post-format/index.js.map +1 -1
  593. package/build-module/components/post-format/panel.js +75 -7
  594. package/build-module/components/post-format/panel.js.map +1 -1
  595. package/build-module/components/post-last-edited-panel/index.js +7 -4
  596. package/build-module/components/post-last-edited-panel/index.js.map +1 -1
  597. package/build-module/components/post-last-revision/check.js +14 -4
  598. package/build-module/components/post-last-revision/check.js.map +1 -1
  599. package/build-module/components/post-last-revision/index.js +48 -17
  600. package/build-module/components/post-last-revision/index.js.map +1 -1
  601. package/build-module/components/post-last-revision/panel.js +13 -4
  602. package/build-module/components/post-last-revision/panel.js.map +1 -1
  603. package/build-module/components/post-locked-modal/index.js +60 -34
  604. package/build-module/components/post-locked-modal/index.js.map +1 -1
  605. package/build-module/components/post-panel-row/index.js +12 -8
  606. package/build-module/components/post-panel-row/index.js.map +1 -1
  607. package/build-module/components/post-panel-section/index.js +5 -4
  608. package/build-module/components/post-panel-section/index.js.map +1 -1
  609. package/build-module/components/post-pending-status/check.js +11 -0
  610. package/build-module/components/post-pending-status/check.js.map +1 -1
  611. package/build-module/components/post-pending-status/index.js +15 -7
  612. package/build-module/components/post-pending-status/index.js.map +1 -1
  613. package/build-module/components/post-pingbacks/index.js +13 -5
  614. package/build-module/components/post-pingbacks/index.js.map +1 -1
  615. package/build-module/components/post-preview-button/index.js +48 -21
  616. package/build-module/components/post-preview-button/index.js.map +1 -1
  617. package/build-module/components/post-publish-button/index.js +22 -11
  618. package/build-module/components/post-publish-button/index.js.map +1 -1
  619. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  620. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  621. package/build-module/components/post-publish-panel/index.js +49 -33
  622. package/build-module/components/post-publish-panel/index.js.map +1 -1
  623. package/build-module/components/post-publish-panel/maybe-category-panel.js +13 -9
  624. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  625. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +22 -15
  626. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  627. package/build-module/components/post-publish-panel/maybe-tags-panel.js +14 -10
  628. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  629. package/build-module/components/post-publish-panel/maybe-upload-media.js +30 -24
  630. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  631. package/build-module/components/post-publish-panel/postpublish.js +57 -38
  632. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  633. package/build-module/components/post-publish-panel/prepublish.js +43 -26
  634. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  635. package/build-module/components/post-saved-state/index.js +8 -6
  636. package/build-module/components/post-saved-state/index.js.map +1 -1
  637. package/build-module/components/post-schedule/check.js +9 -0
  638. package/build-module/components/post-schedule/check.js.map +1 -1
  639. package/build-module/components/post-schedule/index.js +30 -6
  640. package/build-module/components/post-schedule/index.js.map +1 -1
  641. package/build-module/components/post-schedule/label.js +17 -0
  642. package/build-module/components/post-schedule/label.js.map +1 -1
  643. package/build-module/components/post-schedule/panel.js +43 -30
  644. package/build-module/components/post-schedule/panel.js.map +1 -1
  645. package/build-module/components/post-slug/check.js +5 -4
  646. package/build-module/components/post-slug/check.js.map +1 -1
  647. package/build-module/components/post-slug/index.js +5 -3
  648. package/build-module/components/post-slug/index.js.map +1 -1
  649. package/build-module/components/post-slug/panel.js +7 -4
  650. package/build-module/components/post-slug/panel.js.map +1 -1
  651. package/build-module/components/post-status/index.js +121 -120
  652. package/build-module/components/post-status/index.js.map +1 -1
  653. package/build-module/components/post-sticky/index.js +17 -9
  654. package/build-module/components/post-sticky/index.js.map +1 -1
  655. package/build-module/components/post-sticky/panel.js +6 -2
  656. package/build-module/components/post-sticky/panel.js.map +1 -1
  657. package/build-module/components/post-switch-to-draft-button/index.js +27 -21
  658. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  659. package/build-module/components/post-sync-status/index.js +8 -6
  660. package/build-module/components/post-sync-status/index.js.map +1 -1
  661. package/build-module/components/post-taxonomies/flat-term-selector.js +22 -18
  662. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  663. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +71 -59
  664. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  665. package/build-module/components/post-taxonomies/index.js +6 -6
  666. package/build-module/components/post-taxonomies/index.js.map +1 -1
  667. package/build-module/components/post-taxonomies/most-used-terms.js +20 -15
  668. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  669. package/build-module/components/post-taxonomies/panel.js +15 -11
  670. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  671. package/build-module/components/post-template/block-theme.js +44 -32
  672. package/build-module/components/post-template/block-theme.js.map +1 -1
  673. package/build-module/components/post-template/classic-theme.js +74 -50
  674. package/build-module/components/post-template/classic-theme.js.map +1 -1
  675. package/build-module/components/post-template/create-new-template-modal.js +34 -27
  676. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  677. package/build-module/components/post-template/create-new-template.js +16 -11
  678. package/build-module/components/post-template/create-new-template.js.map +1 -1
  679. package/build-module/components/post-template/panel.js +17 -9
  680. package/build-module/components/post-template/panel.js.map +1 -1
  681. package/build-module/components/post-template/reset-default-template.js +5 -4
  682. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  683. package/build-module/components/post-template/swap-template-button.js +22 -15
  684. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  685. package/build-module/components/post-text-editor/index.js +30 -19
  686. package/build-module/components/post-text-editor/index.js.map +1 -1
  687. package/build-module/components/post-title/index.js +29 -18
  688. package/build-module/components/post-title/index.js.map +1 -1
  689. package/build-module/components/post-title/index.native.js +81 -57
  690. package/build-module/components/post-title/index.native.js.map +1 -1
  691. package/build-module/components/post-title/post-title-raw.js +11 -2
  692. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  693. package/build-module/components/post-title/use-post-title-focus.js +8 -0
  694. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  695. package/build-module/components/post-title/use-post-title.js +6 -0
  696. package/build-module/components/post-title/use-post-title.js.map +1 -1
  697. package/build-module/components/post-transform-panel/index.js +12 -12
  698. package/build-module/components/post-transform-panel/index.js.map +1 -1
  699. package/build-module/components/post-trash/index.js +21 -15
  700. package/build-module/components/post-trash/index.js.map +1 -1
  701. package/build-module/components/post-url/check.js +9 -0
  702. package/build-module/components/post-url/check.js.map +1 -1
  703. package/build-module/components/post-url/index.js +100 -72
  704. package/build-module/components/post-url/index.js.map +1 -1
  705. package/build-module/components/post-url/label.js +12 -0
  706. package/build-module/components/post-url/label.js.map +1 -1
  707. package/build-module/components/post-url/panel.js +59 -25
  708. package/build-module/components/post-url/panel.js.map +1 -1
  709. package/build-module/components/post-view-link/index.js +2 -2
  710. package/build-module/components/post-view-link/index.js.map +1 -1
  711. package/build-module/components/post-visibility/check.js +10 -0
  712. package/build-module/components/post-visibility/check.js.map +1 -1
  713. package/build-module/components/post-visibility/index.js +85 -67
  714. package/build-module/components/post-visibility/index.js.map +1 -1
  715. package/build-module/components/post-visibility/label.js +12 -0
  716. package/build-module/components/post-visibility/label.js.map +1 -1
  717. package/build-module/components/posts-per-page/index.js +103 -0
  718. package/build-module/components/posts-per-page/index.js.map +1 -0
  719. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  720. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  721. package/build-module/components/preferences-modal/index.js +126 -102
  722. package/build-module/components/preferences-modal/index.js.map +1 -1
  723. package/build-module/components/preview-dropdown/index.js +49 -31
  724. package/build-module/components/preview-dropdown/index.js.map +1 -1
  725. package/build-module/components/provider/disable-non-page-content-blocks.js +5 -3
  726. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  727. package/build-module/components/provider/index.js +96 -20
  728. package/build-module/components/provider/index.js.map +1 -1
  729. package/build-module/components/provider/index.native.js +58 -20
  730. package/build-module/components/provider/index.native.js.map +1 -1
  731. package/build-module/components/provider/use-block-editor-settings.js +7 -6
  732. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  733. package/build-module/components/provider/with-registry-provider.js +33 -26
  734. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  735. package/build-module/components/resizable-editor/index.js +89 -0
  736. package/build-module/components/resizable-editor/index.js.map +1 -0
  737. package/build-module/components/resizable-editor/resize-handle.js +54 -0
  738. package/build-module/components/resizable-editor/resize-handle.js.map +1 -0
  739. package/build-module/components/save-publish-panels/index.js +37 -26
  740. package/build-module/components/save-publish-panels/index.js.map +1 -1
  741. package/build-module/components/sidebar/header.js +18 -14
  742. package/build-module/components/sidebar/header.js.map +1 -1
  743. package/build-module/components/sidebar/index.js +36 -31
  744. package/build-module/components/sidebar/index.js.map +1 -1
  745. package/build-module/components/sidebar/post-summary.js +34 -25
  746. package/build-module/components/sidebar/post-summary.js.map +1 -1
  747. package/build-module/components/site-discussion/index.js +127 -0
  748. package/build-module/components/site-discussion/index.js.map +1 -0
  749. package/build-module/components/start-page-options/index.js +13 -11
  750. package/build-module/components/start-page-options/index.js.map +1 -1
  751. package/build-module/components/start-template-options/index.js +30 -23
  752. package/build-module/components/start-template-options/index.js.map +1 -1
  753. package/build-module/components/table-of-contents/index.js +4 -4
  754. package/build-module/components/table-of-contents/index.js.map +1 -1
  755. package/build-module/components/table-of-contents/panel.js +55 -35
  756. package/build-module/components/table-of-contents/panel.js.map +1 -1
  757. package/build-module/components/template-areas/index.js +37 -22
  758. package/build-module/components/template-areas/index.js.map +1 -1
  759. package/build-module/components/template-content-panel/index.js +7 -6
  760. package/build-module/components/template-content-panel/index.js.map +1 -1
  761. package/build-module/components/template-validation-notice/index.js +27 -21
  762. package/build-module/components/template-validation-notice/index.js.map +1 -1
  763. package/build-module/components/text-editor/index.js +66 -0
  764. package/build-module/components/text-editor/index.js.map +1 -0
  765. package/build-module/components/time-to-read/index.js +7 -6
  766. package/build-module/components/time-to-read/index.js.map +1 -1
  767. package/build-module/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +5 -4
  768. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  769. package/build-module/components/{editor-canvas → visual-editor}/index.js +118 -75
  770. package/build-module/components/visual-editor/index.js.map +1 -0
  771. package/build-module/components/word-count/index.js +5 -4
  772. package/build-module/components/word-count/index.js.map +1 -1
  773. package/build-module/hooks/custom-sources-backwards-compatibility.js +2 -2
  774. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  775. package/build-module/hooks/index.js +1 -0
  776. package/build-module/hooks/index.js.map +1 -1
  777. package/build-module/hooks/media-upload.js +7 -0
  778. package/build-module/hooks/media-upload.js.map +1 -0
  779. package/build-module/hooks/pattern-overrides.js +17 -11
  780. package/build-module/hooks/pattern-overrides.js.map +1 -1
  781. package/build-module/private-apis.js +12 -28
  782. package/build-module/private-apis.js.map +1 -1
  783. package/build-module/private-apis.native.js +2 -26
  784. package/build-module/private-apis.native.js.map +1 -1
  785. package/build-module/store/constants.js +3 -0
  786. package/build-module/store/constants.js.map +1 -1
  787. package/build-module/store/private-actions.js +10 -14
  788. package/build-module/store/private-actions.js.map +1 -1
  789. package/build-module/store/private-selectors.js +38 -1
  790. package/build-module/store/private-selectors.js.map +1 -1
  791. package/build-module/store/selectors.js +1 -1
  792. package/build-module/store/selectors.js.map +1 -1
  793. package/build-module/utils/set-nested-value.js +38 -0
  794. package/build-module/utils/set-nested-value.js.map +1 -0
  795. package/build-style/style-rtl.css +344 -129
  796. package/build-style/style.css +344 -129
  797. package/package.json +40 -36
  798. package/src/bindings/index.js +1 -4
  799. package/src/bindings/pattern-overrides.js +1 -1
  800. package/src/bindings/post-meta.js +46 -6
  801. package/src/components/block-settings-menu/content-only-settings-menu.js +26 -12
  802. package/src/components/blog-title/index.js +124 -0
  803. package/src/components/blog-title/style.scss +4 -0
  804. package/src/components/collapsible-block-toolbar/style.scss +3 -1
  805. package/src/components/commands/index.js +113 -3
  806. package/src/components/create-template-part-modal/index.js +205 -0
  807. package/src/components/create-template-part-modal/style.scss +69 -0
  808. package/src/components/create-template-part-modal/test/utils.js +60 -0
  809. package/src/components/create-template-part-modal/utils.js +67 -0
  810. package/src/components/document-bar/index.js +32 -21
  811. package/src/components/document-tools/index.js +2 -7
  812. package/src/components/editor/index.js +93 -0
  813. package/src/components/editor-help/help-get-support-button.native.js +1 -1
  814. package/src/components/editor-interface/content-slot-fill.js +15 -0
  815. package/src/components/editor-interface/index.js +230 -0
  816. package/src/components/editor-interface/style.scss +3 -0
  817. package/src/components/editor-notices/index.js +10 -0
  818. package/src/components/entities-saved-states/entity-record-item.js +45 -16
  819. package/src/components/entities-saved-states/style.scss +11 -5
  820. package/src/components/error-boundary/index.js +10 -0
  821. package/src/components/error-boundary/index.native.js +1 -1
  822. package/src/components/global-styles-provider/index.js +100 -8
  823. package/src/components/header/back-button.js +32 -0
  824. package/src/components/header/index.js +26 -18
  825. package/src/components/header/style.scss +6 -1
  826. package/src/components/inserter-sidebar/index.js +65 -32
  827. package/src/components/inserter-sidebar/style.scss +0 -13
  828. package/src/components/local-autosave-monitor/index.js +12 -0
  829. package/src/components/media-categories/index.js +1 -3
  830. package/src/components/page-attributes/order.js +79 -3
  831. package/src/components/page-attributes/panel.js +10 -26
  832. package/src/components/page-attributes/parent.js +98 -2
  833. package/src/components/page-attributes/style.scss +19 -0
  834. package/src/components/pattern-duplicate-modal/index.js +50 -0
  835. package/src/components/pattern-rename-modal/index.js +44 -0
  836. package/src/components/post-actions/actions.js +308 -261
  837. package/src/components/post-actions/export-pattern-action.js +74 -0
  838. package/src/components/post-actions/export-pattern-action.native.js +4 -0
  839. package/src/components/post-actions/index.js +16 -5
  840. package/src/components/post-author/combobox.js +1 -0
  841. package/src/components/post-author/hook.js +1 -1
  842. package/src/components/post-author/panel.js +63 -2
  843. package/src/components/post-author/select.js +1 -0
  844. package/src/components/post-author/style.scss +6 -0
  845. package/src/components/post-card-panel/index.js +69 -22
  846. package/src/components/post-card-panel/style.scss +23 -1
  847. package/src/components/post-comments/index.js +5 -0
  848. package/src/components/post-discussion/panel.js +9 -2
  849. package/src/components/post-discussion/style.scss +1 -3
  850. package/src/components/post-excerpt/panel.js +45 -48
  851. package/src/components/post-excerpt/style.scss +0 -17
  852. package/src/components/post-featured-image/check.js +9 -0
  853. package/src/components/post-featured-image/index.js +15 -0
  854. package/src/components/post-featured-image/panel.js +9 -0
  855. package/src/components/post-format/check.js +8 -0
  856. package/src/components/post-format/index.js +15 -4
  857. package/src/components/post-format/panel.js +71 -6
  858. package/src/components/post-format/style.scss +10 -4
  859. package/src/components/post-last-revision/check.js +8 -0
  860. package/src/components/post-last-revision/index.js +31 -3
  861. package/src/components/post-last-revision/panel.js +5 -0
  862. package/src/components/post-last-revision/style.scss +4 -0
  863. package/src/components/post-locked-modal/index.js +6 -0
  864. package/src/components/post-panel-row/style.scss +16 -0
  865. package/src/components/post-pending-status/check.js +10 -0
  866. package/src/components/post-pending-status/index.js +5 -0
  867. package/src/components/post-pingbacks/index.js +6 -0
  868. package/src/components/post-preview-button/index.js +16 -0
  869. package/src/components/post-preview-button/test/index.js +10 -2
  870. package/src/components/post-publish-button/index.js +17 -4
  871. package/src/components/post-publish-panel/index.js +2 -0
  872. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  873. package/src/components/post-publish-panel/style.scss +28 -36
  874. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +3 -3
  875. package/src/components/post-schedule/check.js +8 -0
  876. package/src/components/post-schedule/index.js +30 -3
  877. package/src/components/post-schedule/label.js +15 -0
  878. package/src/components/post-schedule/panel.js +9 -1
  879. package/src/components/post-schedule/style.scss +0 -11
  880. package/src/components/post-status/index.js +30 -52
  881. package/src/components/post-status/style.scss +4 -34
  882. package/src/components/post-sticky/index.js +12 -7
  883. package/src/components/post-sticky/style.scss +3 -0
  884. package/src/components/post-sync-status/index.js +2 -8
  885. package/src/components/post-template/block-theme.js +1 -0
  886. package/src/components/post-template/classic-theme.js +15 -0
  887. package/src/components/post-template/panel.js +5 -0
  888. package/src/components/post-template/style.scss +0 -8
  889. package/src/components/post-text-editor/index.js +5 -0
  890. package/src/components/post-title/index.js +8 -1
  891. package/src/components/post-title/index.native.js +70 -35
  892. package/src/components/post-title/post-title-raw.js +8 -0
  893. package/src/components/post-title/use-post-title-focus.js +7 -0
  894. package/src/components/post-title/use-post-title.js +5 -0
  895. package/src/components/post-transform-panel/index.js +2 -10
  896. package/src/components/post-url/check.js +8 -0
  897. package/src/components/post-url/index.js +41 -24
  898. package/src/components/post-url/label.js +10 -0
  899. package/src/components/post-url/panel.js +18 -5
  900. package/src/components/post-url/style.scss +0 -9
  901. package/src/components/post-visibility/check.js +9 -0
  902. package/src/components/post-visibility/index.js +7 -0
  903. package/src/components/post-visibility/label.js +10 -0
  904. package/src/components/posts-per-page/index.js +101 -0
  905. package/src/components/posts-per-page/style.scss +4 -0
  906. package/src/components/provider/disable-non-page-content-blocks.js +9 -4
  907. package/src/components/provider/index.js +68 -0
  908. package/src/components/provider/index.native.js +43 -2
  909. package/src/components/provider/use-block-editor-settings.js +4 -6
  910. package/src/components/provider/with-registry-provider.js +32 -31
  911. package/src/components/resizable-editor/index.js +90 -0
  912. package/src/components/resizable-editor/resize-handle.js +62 -0
  913. package/src/components/resizable-editor/style.scss +53 -0
  914. package/src/components/save-publish-panels/index.js +10 -2
  915. package/src/components/save-publish-panels/style.scss +0 -8
  916. package/src/components/sidebar/index.js +0 -4
  917. package/src/components/sidebar/post-summary.js +16 -21
  918. package/src/components/sidebar/style.scss +1 -1
  919. package/src/components/site-discussion/index.js +138 -0
  920. package/src/components/site-discussion/style.scss +19 -0
  921. package/src/components/start-template-options/style.scss +0 -8
  922. package/src/components/template-areas/index.js +15 -6
  923. package/src/components/text-editor/index.js +57 -0
  924. package/src/components/text-editor/style.scss +71 -0
  925. package/src/components/{editor-canvas → visual-editor}/index.js +177 -108
  926. package/src/components/visual-editor/style.scss +37 -0
  927. package/src/hooks/index.js +1 -0
  928. package/src/hooks/media-upload.js +11 -0
  929. package/src/private-apis.js +12 -28
  930. package/src/private-apis.native.js +2 -26
  931. package/src/store/constants.js +7 -0
  932. package/src/store/private-actions.js +22 -50
  933. package/src/store/private-selectors.js +45 -0
  934. package/src/store/selectors.js +1 -1
  935. package/src/style.scss +10 -0
  936. package/src/utils/set-nested-value.js +39 -0
  937. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  938. package/build/components/editor-canvas/index.js.map +0 -1
  939. package/build/components/post-trash/panel.js +0 -18
  940. package/build/components/post-trash/panel.js.map +0 -1
  941. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  942. package/build-module/components/editor-canvas/index.js.map +0 -1
  943. package/build-module/components/post-trash/panel.js +0 -10
  944. package/build-module/components/post-trash/panel.js.map +0 -1
  945. package/src/components/post-trash/panel.js +0 -13
  946. package/src/components/provider/README.md +0 -37
  947. /package/src/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_htmlEntities","_data","_blockEditor","_keycodes","_blocks","_richText","_compose","_dom","_constants","_usePostTitleFocus","_usePostTitle","_postTypeSupportCheck","PostTitle","_","forwardedRef","placeholder","hasFixedToolbar","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","_hasFixedToolbar","isSelected","setIsSelected","useState","ref","focusRef","usePostTitleFocus","title","setTitle","onUpdate","usePostTitle","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","useDispatch","onChange","value","replace","REGEXP_NEWLINES","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","ENTER","preventDefault","onPaste","clipboardData","plainText","html","getData","error1","error2","window","console","log","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","create","newValue","insert","toHTMLString","start","end","decodedPlaceholder","decodeEntities","__","richTextRef","useRichText","selectionStart","selectionEnd","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","className","clsx","DEFAULT_CLASSNAMES","_react","createElement","default","supportKeys","useMergeRefs","contentEditable","role","onFocus","onBlur","onKeyPress","_default","exports","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ENTER } from '@wordpress/keycodes';\nimport { pasteHandler } from '@wordpress/blocks';\nimport {\n\t__unstableUseRichText as useRichText,\n\tcreate,\n\ttoHTMLString,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nfunction PostTitle( _, forwardedRef ) {\n\tconst { placeholder, hasFixedToolbar } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =\n\t\t\tgetSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t\thasFixedToolbar: _hasFixedToolbar,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\n\tconst [ selection, setSelection ] = useState( {} );\n\n\tconst { clearSelectedBlock, insertBlocks, insertDefaultBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onInsertBlockAfter( blocks ) {\n\t\tinsertBlocks( blocks, 0 );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t\tclearSelectedBlock();\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t\tsetSelection( {} );\n\t}\n\n\tfunction onEnterPress() {\n\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tonEnterPress();\n\t\t}\n\t}\n\n\tfunction onPaste( event ) {\n\t\tconst clipboardData = event.clipboardData;\n\n\t\tlet plainText = '';\n\t\tlet html = '';\n\n\t\t// IE11 only supports `Text` as an argument for `getData` and will\n\t\t// otherwise throw an invalid argument error, so we try the standard\n\t\t// arguments first, then fallback to `Text` if they fail.\n\t\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error1 ) {\n\t\t\ttry {\n\t\t\t\thtml = clipboardData.getData( 'Text' );\n\t\t\t} catch ( error2 ) {\n\t\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t\t// behaviour.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\twindow.console.log( 'Received HTML:\\n\\n', html );\n\t\twindow.console.log( 'Received plain text:\\n\\n', plainText );\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\tconst value = {\n\t\t\t\t...create( { html: title } ),\n\t\t\t\t...selection,\n\t\t\t};\n\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t\tsetSelection( {\n\t\t\t\tstart: newValue.start,\n\t\t\t\tend: newValue.end,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst { ref: richTextRef } = useRichText( {\n\t\tvalue: title,\n\t\tonChange,\n\t\tplaceholder: decodedPlaceholder,\n\t\tselectionStart: selection.start,\n\t\tselectionEnd: selection.end,\n\t\tonSelectionChange( newStart, newEnd ) {\n\t\t\tsetSelection( ( sel ) => {\n\t\t\t\tconst { start, end } = sel;\n\t\t\t\tif ( start === newStart && end === newEnd ) {\n\t\t\t\t\treturn sel;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstart: newStart,\n\t\t\t\t\tend: newEnd,\n\t\t\t\t};\n\t\t\t} );\n\t\t},\n\t\t__unstableDisableFormats: false,\n\t} );\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t} );\n\n\treturn (\n\t\t/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t\t<PostTypeSupportCheck supportKeys=\"title\">\n\t\t\t<h1\n\t\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\t\tcontentEditable\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ decodedPlaceholder }\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline=\"true\"\n\t\t\t\tonFocus={ onSelect }\n\t\t\t\tonBlur={ onUnselect }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonKeyPress={ onUnselect }\n\t\t\t\tonPaste={ onPaste }\n\t\t\t/>\n\t\t</PostTypeSupportCheck>\n\t\t/* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t);\n}\n\nexport default forwardRef( PostTitle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,G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AAS,EAAGA,SAAW;MACvBuD,UAAU,EAAG1D,UAAY;MACzBQ,OAAO,EAAGA;IAAS,CACnB,CACoB;IACtB;EAAA;AAEF;AAAC,IAAAmD,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAEc,IAAAU,mBAAU,EAAE/F,SAAU,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_htmlEntities","_data","_blockEditor","_keycodes","_blocks","_richText","_compose","_dom","_constants","_usePostTitleFocus","_usePostTitle","_postTypeSupportCheck","_jsxRuntime","PostTitle","_","forwardedRef","placeholder","hasFixedToolbar","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","_hasFixedToolbar","isSelected","setIsSelected","useState","ref","focusRef","usePostTitleFocus","title","setTitle","onUpdate","usePostTitle","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","useDispatch","onChange","value","replace","REGEXP_NEWLINES","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","ENTER","preventDefault","onPaste","clipboardData","plainText","html","getData","error1","error2","window","console","log","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","create","newValue","insert","toHTMLString","start","end","decodedPlaceholder","decodeEntities","__","richTextRef","useRichText","selectionStart","selectionEnd","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","className","clsx","DEFAULT_CLASSNAMES","jsx","default","supportKeys","children","useMergeRefs","contentEditable","role","onFocus","onBlur","onKeyPress","_default","exports","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ENTER } from '@wordpress/keycodes';\nimport { pasteHandler } from '@wordpress/blocks';\nimport {\n\t__unstableUseRichText as useRichText,\n\tcreate,\n\ttoHTMLString,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nfunction PostTitle( _, forwardedRef ) {\n\tconst { placeholder, hasFixedToolbar } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =\n\t\t\tgetSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t\thasFixedToolbar: _hasFixedToolbar,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\n\tconst [ selection, setSelection ] = useState( {} );\n\n\tconst { clearSelectedBlock, insertBlocks, insertDefaultBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onInsertBlockAfter( blocks ) {\n\t\tinsertBlocks( blocks, 0 );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t\tclearSelectedBlock();\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t\tsetSelection( {} );\n\t}\n\n\tfunction onEnterPress() {\n\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tonEnterPress();\n\t\t}\n\t}\n\n\tfunction onPaste( event ) {\n\t\tconst clipboardData = event.clipboardData;\n\n\t\tlet plainText = '';\n\t\tlet html = '';\n\n\t\t// IE11 only supports `Text` as an argument for `getData` and will\n\t\t// otherwise throw an invalid argument error, so we try the standard\n\t\t// arguments first, then fallback to `Text` if they fail.\n\t\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error1 ) {\n\t\t\ttry {\n\t\t\t\thtml = clipboardData.getData( 'Text' );\n\t\t\t} catch ( error2 ) {\n\t\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t\t// behaviour.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\twindow.console.log( 'Received HTML:\\n\\n', html );\n\t\twindow.console.log( 'Received plain text:\\n\\n', plainText );\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\tconst value = {\n\t\t\t\t...create( { html: title } ),\n\t\t\t\t...selection,\n\t\t\t};\n\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t\tsetSelection( {\n\t\t\t\tstart: newValue.start,\n\t\t\t\tend: newValue.end,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst { ref: richTextRef } = useRichText( {\n\t\tvalue: title,\n\t\tonChange,\n\t\tplaceholder: decodedPlaceholder,\n\t\tselectionStart: selection.start,\n\t\tselectionEnd: selection.end,\n\t\tonSelectionChange( newStart, newEnd ) {\n\t\t\tsetSelection( ( sel ) => {\n\t\t\t\tconst { start, end } = sel;\n\t\t\t\tif ( start === newStart && end === newEnd ) {\n\t\t\t\t\treturn sel;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstart: newStart,\n\t\t\t\t\tend: newEnd,\n\t\t\t\t};\n\t\t\t} );\n\t\t},\n\t\t__unstableDisableFormats: false,\n\t} );\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t} );\n\n\treturn (\n\t\t/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t\t<PostTypeSupportCheck supportKeys=\"title\">\n\t\t\t<h1\n\t\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\t\tcontentEditable\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ decodedPlaceholder }\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline=\"true\"\n\t\t\t\tonFocus={ onSelect }\n\t\t\t\tonBlur={ onUnselect }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonKeyPress={ onUnselect }\n\t\t\t\tonPaste={ onPaste }\n\t\t\t/>\n\t\t</PostTypeSupportCheck>\n\t\t/* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t);\n}\n\n/**\n * Renders the `PostTitle` component.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Forwarded ref for the component.\n *\n * @return {Component} The rendered PostTitle component.\n */\nexport default forwardRef( PostTitle );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAMA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,IAAA,GAAAV,OAAA;AAKA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,kBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,aAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,qBAAA,GAAAf,sBAAA,CAAAC,OAAA;AAA8D,IAAAe,WAAA,GAAAf,OAAA;AA7B9D;AACA;AACA;;AAEA;AACA;AACA;;AAiBA;AACA;AACA;;AAMA,SAASgB,SAASA,CAAEC,CAAC,EAAEC,YAAY,EAAG;EACrC,MAAM;IAAEC,WAAW;IAAEC;EAAgB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACjE,MAAM;MAAEC;IAAY,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IAClD,MAAM;MAAEC,gBAAgB;MAAEL,eAAe,E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,OAAO;UACNZ,KAAK,EAAEU,QAAQ;UACfT,GAAG,EAAEU;QACN,CAAC;MACF,CAAE,CAAC;IACJ,CAAC;IACDE,wBAAwB,EAAE;EAC3B,CAAE,CAAC;;EAEH;EACA;EACA,MAAMC,SAAS,GAAG,IAAAC,aAAI,EAAEC,6BAAkB,EAAE;IAC3C,aAAa,EAAEvE,UAAU;IACzB,mBAAmB,EAAEP;EACtB,CAAE,CAAC;EAEH;IAAA;IACC;IACA,IAAAL,WAAA,CAAAoF,GAAA,EAACrF,qBAAA,CAAAsF,OAAoB;MAACC,WAAW,EAAC,OAAO;MAAAC,QAAA,eACxC,IAAAvF,WAAA,CAAAoF,GAAA;QACCrE,GAAG,EAAG,IAAAyE,qBAAY,EAAE,CAAEhB,WAAW,EAAExD,QAAQ,CAAG,CAAG;QACjDyE,eAAe;QACfR,SAAS,EAAGA,SAAW;QACvB,cAAaZ,kBAAoB;QACjCqB,IAAI,EAAC,SAAS;QACd,kBAAe,MAAM;QACrBC,OAAO,EAAGzD,QAAU;QACpB0D,MAAM,EAAGzD,UAAY;QACrBG,SAAS,EAAGA,SAAW;QACvBuD,UAAU,EAAG1D,UAAY;QACzBQ,OAAO,EAAGA;MAAS,CACnB;IAAC,CACmB;IACtB;EAAA;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAmD,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAQe,IAAAW,mBAAU,EAAE/F,SAAU,CAAC","ignoreList":[]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = require("react");
8
+ exports.insertContentWithTitle = insertContentWithTitle;
9
9
  var _reactNative = require("react-native");
10
10
  var _element = require("@wordpress/element");
11
11
  var _richText = require("@wordpress/rich-text");
@@ -19,6 +19,7 @@ var _blockEditor = require("@wordpress/block-editor");
19
19
  var _editor = require("@wordpress/editor");
20
20
  var _dom = require("@wordpress/dom");
21
21
  var _style = _interopRequireDefault(require("./style.scss"));
22
+ var _jsxRuntime = require("react/jsx-runtime");
22
23
  /**
23
24
  * External dependencies
24
25
  */
@@ -27,10 +28,58 @@ var _style = _interopRequireDefault(require("./style.scss"));
27
28
  * WordPress dependencies
28
29
  */
29
30
 
31
+ /** @typedef {import('./types').RichTextValue} RichTextValue */
32
+
30
33
  /**
31
34
  * Internal dependencies
32
35
  */
33
36
 
37
+ /**
38
+ * Inserts content with title
39
+ *
40
+ * This function processes the given content and title, updating the title
41
+ * and content based on certain conditions. If the content is an array of
42
+ * blocks, it will check the first block for a heading or paragraph to use
43
+ * as the title. If the content is a string, it will strip HTML and update
44
+ * the title and content accordingly.
45
+ *
46
+ * @param {string} title The post title.
47
+ * @param {Array | string} content The content to be processed. It can be an array of blocks or a string.
48
+ * @param {Function} onUpdateTitle Callback function to update the title.
49
+ * @param {Function} onUpdateContent Callback function to update the content.
50
+ * @param {RichTextValue} value The initial value object, default is an object with empty text.
51
+ */
52
+ function insertContentWithTitle(title, content, onUpdateTitle, onUpdateContent, value = (0, _richText.create)({
53
+ text: ''
54
+ })) {
55
+ if (!content.length) {
56
+ return;
57
+ }
58
+ if (typeof content !== 'string') {
59
+ const [firstBlock] = content;
60
+ if (!title && (firstBlock.name === 'core/heading' || firstBlock.name === 'core/paragraph')) {
61
+ // Strip HTML to avoid unwanted HTML being added to the title.
62
+ // In the majority of cases it is assumed that HTML in the title
63
+ // is undesirable.
64
+ const contentNoHTML = (0, _dom.__unstableStripHTML)(firstBlock.attributes.content);
65
+ onUpdateTitle(contentNoHTML);
66
+ onUpdateContent(content.slice(1));
67
+ } else {
68
+ onUpdateContent(content);
69
+ }
70
+ } else {
71
+ // Strip HTML to avoid unwanted HTML being added to the title.
72
+ // In the majority of cases it is assumed that HTML in the title
73
+ // is undesirable.
74
+ const contentNoHTML = (0, _dom.__unstableStripHTML)(content);
75
+ const newValue = (0, _richText.insert)(value, (0, _richText.create)({
76
+ html: contentNoHTML
77
+ }));
78
+ onUpdateTitle((0, _richText.toHTMLString)({
79
+ value: newValue
80
+ }));
81
+ }
82
+ }
34
83
  class PostTitle extends _element.Component {
35
84
  constructor(props) {
36
85
  super(props);
@@ -64,40 +113,14 @@ class PostTitle extends _element.Component {
64
113
  }) {
65
114
  const {
66
115
  title,
67
- onInsertBlockAfter,
116
+ onInsertBlockAfter: onInsertBlocks,
68
117
  onUpdate
69
118
  } = this.props;
70
119
  const content = (0, _blocks.pasteHandler)({
71
120
  HTML: html,
72
121
  plainText
73
122
  });
74
- if (!content.length) {
75
- return;
76
- }
77
- if (typeof content !== 'string') {
78
- const [firstBlock] = content;
79
- if (!title && (firstBlock.name === 'core/heading' || firstBlock.name === 'core/paragraph')) {
80
- // Strip HTML to avoid unwanted HTML being added to the title.
81
- // In the majority of cases it is assumed that HTML in the title
82
- // is undesirable.
83
- const contentNoHTML = (0, _dom.__unstableStripHTML)(firstBlock.attributes.content);
84
- onUpdate(contentNoHTML);
85
- onInsertBlockAfter(content.slice(1));
86
- } else {
87
- onInsertBlockAfter(content);
88
- }
89
- } else {
90
- // Strip HTML to avoid unwanted HTML being added to the title.
91
- // In the majority of cases it is assumed that HTML in the title
92
- // is undesirable.
93
- const contentNoHTML = (0, _dom.__unstableStripHTML)(content);
94
- const newValue = (0, _richText.insert)(value, (0, _richText.create)({
95
- html: contentNoHTML
96
- }));
97
- onUpdate((0, _richText.toHTMLString)({
98
- value: newValue
99
- }));
100
- }
123
+ insertContentWithTitle(title, content, onUpdate, onInsertBlocks, value);
101
124
  }
102
125
  setRef(richText) {
103
126
  this.richTextRef = richText;
@@ -132,40 +155,41 @@ class PostTitle extends _element.Component {
132
155
  placeholderColor: globalStyles.text
133
156
  })
134
157
  };
135
- return (0, _react.createElement)(_reactNative.View, {
158
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
136
159
  testID: "post-title",
137
160
  style: [_style.default.titleContainer, borderStyle, {
138
161
  borderColor
139
162
  }, isDimmed && _style.default.dimmed],
140
163
  accessible: !this.props.isSelected,
141
164
  accessibilityLabel: this.getTitle(title, postType),
142
- accessibilityHint: (0, _i18n.__)('Updates the title.')
143
- }, (0, _react.createElement)(_blockEditor.RichText.Raw, {
144
- ref: this.setRef,
145
- accessibilityLabel: this.getTitle(title, postType),
146
- tagName: 'p',
147
- tagsToEliminate: ['strong'],
148
- unstableOnFocus: this.props.onSelect,
149
- onBlur: this.props.onBlur // Always assign onBlur as a props.
150
- ,
151
- style: titleStyles,
152
- styles: _style.default,
153
- fontSize: 24,
154
- lineHeight: 1,
155
- fontWeight: 'bold',
156
- deleteEnter: true,
157
- onChange: value => {
158
- this.props.onUpdate(value);
159
- },
160
- onPaste: this.onPaste,
161
- placeholder: decodedPlaceholder,
162
- value: title,
163
- onSelectionChange: () => {},
164
- onEnter: this.props.onEnterPress,
165
- disableEditingMenu: true,
166
- __unstableIsSelected: this.props.isSelected,
167
- __unstableOnCreateUndoLevel: () => {}
168
- }));
165
+ accessibilityHint: (0, _i18n.__)('Updates the title.'),
166
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText.Raw, {
167
+ ref: this.setRef,
168
+ accessibilityLabel: this.getTitle(title, postType),
169
+ tagName: "p",
170
+ tagsToEliminate: ['strong'],
171
+ unstableOnFocus: this.props.onSelect,
172
+ onBlur: this.props.onBlur // Always assign onBlur as a props.
173
+ ,
174
+ style: titleStyles,
175
+ styles: _style.default,
176
+ fontSize: 24,
177
+ lineHeight: 1,
178
+ fontWeight: "bold",
179
+ deleteEnter: true,
180
+ onChange: value => {
181
+ this.props.onUpdate(value);
182
+ },
183
+ onPaste: this.onPaste,
184
+ placeholder: decodedPlaceholder,
185
+ value: title,
186
+ onSelectionChange: () => {},
187
+ onEnter: this.props.onEnterPress,
188
+ disableEditingMenu: true,
189
+ __unstableIsSelected: this.props.isSelected,
190
+ __unstableOnCreateUndoLevel: () => {}
191
+ })
192
+ });
169
193
  }
170
194
  }
171
195
  var _default = exports.default = (0, _compose.compose)((0, _data.withSelect)(select => {
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_element","_richText","_htmlEntities","_data","_components","_compose","_i18n","_blocks","_blockEditor","_editor","_dom","_style","_interopRequireDefault","PostTitle","Component","constructor","props","setRef","bind","onPaste","componentDidUpdate","prevProps","isSelected","isAnyBlockSelected","richTextRef","blur","onUnselect","componentDidMount","innerRef","handleFocusOutside","focus","onSelect","value","plainText","html","title","onInsertBlockAfter","onUpdate","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","newValue","insert","create","toHTMLString","richText","getTitle","postType","__","sprintf","render","placeholder","style","focusedBorderColor","borderStyle","isDimmed","globalStyles","decodedPlaceholder","decodeEntities","borderColor","titleStyles","text","color","placeholderColor","_react","createElement","View","testID","styles","titleContainer","dimmed","accessible","accessibilityLabel","accessibilityHint","RichText","Raw","ref","tagName","tagsToEliminate","unstableOnFocus","onBlur","fontSize","lineHeight","fontWeight","deleteEnter","onChange","onSelectionChange","onEnter","onEnterPress","disableEditingMenu","__unstableIsSelected","__unstableOnCreateUndoLevel","_default","exports","default","compose","withSelect","select","isPostTitleSelected","getEditedPostAttribute","editorStore","getSelectedBlockClientId","getBlockRootClientId","getSettings","blockEditorStore","selectedId","selectionIsNested","__experimentalGlobalStylesBaseStyles","withDispatch","dispatch","undo","redo","togglePostTitleSelection","editPost","clearSelectedBlock","insertDefaultBlock","insertBlocks","undefined","onUndo","onRedo","blocks","withInstanceId","withFocusOutside"],"sources":["@wordpress/editor/src/components/post-title/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { create, toHTMLString, insert } from '@wordpress/rich-text';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { withFocusOutside } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { pasteHandler } from '@wordpress/blocks';\nimport { store as blockEditorStore, RichText } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nclass PostTitle extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.setRef = this.setRef.bind( this );\n\t\tthis.onPaste = this.onPaste.bind( this );\n\t}\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Unselect if any other block is selected and blur the RichText.\n\t\tif (\n\t\t\tthis.props.isSelected &&\n\t\t\t! prevProps.isAnyBlockSelected &&\n\t\t\tthis.props.isAnyBlockSelected\n\t\t) {\n\t\t\tif ( this.richTextRef ) {\n\t\t\t\tthis.richTextRef.blur();\n\t\t\t}\n\t\t\tthis.props.onUnselect();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.innerRef ) {\n\t\t\tthis.props.innerRef( this );\n\t\t}\n\t}\n\n\thandleFocusOutside() {\n\t\tthis.props.onUnselect();\n\t}\n\n\tfocus() {\n\t\tthis.props.onSelect();\n\t}\n\n\tonPaste( { value, plainText, html } ) {\n\t\tconst { title, onInsertBlockAfter, onUpdate } = this.props;\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t}\n\t}\n\n\tsetRef( richText ) {\n\t\tthis.richTextRef = richText;\n\t}\n\n\tgetTitle( title, postType ) {\n\t\tif ( 'page' === postType ) {\n\t\t\treturn ! title\n\t\t\t\t? /* translators: accessibility text. empty page title. */\n\t\t\t\t __( 'Page title. Empty' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. %s: text content of the page title. */\n\t\t\t\t\t\t__( 'Page title. %s' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t );\n\t\t}\n\n\t\treturn ! title\n\t\t\t? /* translators: accessibility text. empty post title. */\n\t\t\t __( 'Post title. Empty' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: text content of the post title. */\n\t\t\t\t\t__( 'Post title. %s' ),\n\t\t\t\t\ttitle\n\t\t\t );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tstyle,\n\t\t\ttitle,\n\t\t\tfocusedBorderColor,\n\t\t\tborderStyle,\n\t\t\tisDimmed,\n\t\t\tpostType,\n\t\t\tglobalStyles,\n\t\t} = this.props;\n\n\t\tconst decodedPlaceholder = decodeEntities( placeholder );\n\t\tconst borderColor = this.props.isSelected\n\t\t\t? focusedBorderColor\n\t\t\t: 'transparent';\n\t\tconst titleStyles = {\n\t\t\t...style,\n\t\t\t...( globalStyles?.text && {\n\t\t\t\tcolor: globalStyles.text,\n\t\t\t\tplaceholderColor: globalStyles.text,\n\t\t\t} ),\n\t\t};\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\ttestID=\"post-title\"\n\t\t\t\tstyle={ [\n\t\t\t\t\tstyles.titleContainer,\n\t\t\t\t\tborderStyle,\n\t\t\t\t\t{ borderColor },\n\t\t\t\t\tisDimmed && styles.dimmed,\n\t\t\t\t] }\n\t\t\t\taccessible={ ! this.props.isSelected }\n\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\taccessibilityHint={ __( 'Updates the title.' ) }\n\t\t\t>\n\t\t\t\t<RichText.Raw\n\t\t\t\t\tref={ this.setRef }\n\t\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\t\ttagName={ 'p' }\n\t\t\t\t\ttagsToEliminate={ [ 'strong' ] }\n\t\t\t\t\tunstableOnFocus={ this.props.onSelect }\n\t\t\t\t\tonBlur={ this.props.onBlur } // Always assign onBlur as a props.\n\t\t\t\t\tstyle={ titleStyles }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tfontSize={ 24 }\n\t\t\t\t\tlineHeight={ 1 }\n\t\t\t\t\tfontWeight={ 'bold' }\n\t\t\t\t\tdeleteEnter\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tthis.props.onUpdate( value );\n\t\t\t\t\t} }\n\t\t\t\t\tonPaste={ this.onPaste }\n\t\t\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonSelectionChange={ () => {} }\n\t\t\t\t\tonEnter={ this.props.onEnterPress }\n\t\t\t\t\tdisableEditingMenu\n\t\t\t\t\t__unstableIsSelected={ this.props.isSelected }\n\t\t\t\t\t__unstableOnCreateUndoLevel={ () => {} }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default compose(\n\twithSelect( ( select ) => {\n\t\tconst { isPostTitleSelected, getEditedPostAttribute } =\n\t\t\tselect( editorStore );\n\t\tconst { getSelectedBlockClientId, getBlockRootClientId, getSettings } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst selectedId = getSelectedBlockClientId();\n\t\tconst selectionIsNested = !! getBlockRootClientId( selectedId );\n\t\tconst globalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles?.color;\n\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tisAnyBlockSelected: !! selectedId,\n\t\t\tisSelected: isPostTitleSelected(),\n\t\t\tisDimmed: selectionIsNested,\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { undo, redo, togglePostTitleSelection, editPost } =\n\t\t\tdispatch( editorStore );\n\n\t\tconst { clearSelectedBlock, insertDefaultBlock, insertBlocks } =\n\t\t\tdispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tonEnterPress() {\n\t\t\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t\t\t},\n\t\t\tonUndo: undo,\n\t\t\tonRedo: redo,\n\t\t\tonSelect() {\n\t\t\t\ttogglePostTitleSelection( true );\n\t\t\t\tclearSelectedBlock();\n\t\t\t},\n\t\t\tonUnselect() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tonUpdate( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\tonInsertBlockAfter( blocks ) {\n\t\t\t\tinsertBlocks( blocks, 0 );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithFocusOutside\n)( PostTitle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,K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AAC,CAAEpH,SAAU,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_element","_richText","_htmlEntities","_data","_components","_compose","_i18n","_blocks","_blockEditor","_editor","_dom","_style","_interopRequireDefault","_jsxRuntime","insertContentWithTitle","title","content","onUpdateTitle","onUpdateContent","value","create","text","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","newValue","insert","html","toHTMLString","PostTitle","Component","constructor","props","setRef","bind","onPaste","componentDidUpdate","prevProps","isSelected","isAnyBlockSelected","richTextRef","blur","onUnselect","componentDidMount","innerRef","handleFocusOutside","focus","onSelect","plainText","onInsertBlockAfter","onInsertBlocks","onUpdate","pasteHandler","HTML","richText","getTitle","postType","__","sprintf","render","placeholder","style","focusedBorderColor","borderStyle","isDimmed","globalStyles","decodedPlaceholder","decodeEntities","borderColor","titleStyles","color","placeholderColor","jsx","View","testID","styles","titleContainer","dimmed","accessible","accessibilityLabel","accessibilityHint","children","RichText","Raw","ref","tagName","tagsToEliminate","unstableOnFocus","onBlur","fontSize","lineHeight","fontWeight","deleteEnter","onChange","onSelectionChange","onEnter","onEnterPress","disableEditingMenu","__unstableIsSelected","__unstableOnCreateUndoLevel","_default","exports","default","compose","withSelect","select","isPostTitleSelected","getEditedPostAttribute","editorStore","getSelectedBlockClientId","getBlockRootClientId","getSettings","blockEditorStore","selectedId","selectionIsNested","__experimentalGlobalStylesBaseStyles","withDispatch","dispatch","undo","redo","togglePostTitleSelection","editPost","clearSelectedBlock","insertDefaultBlock","insertBlocks","undefined","onUndo","onRedo","blocks","withInstanceId","withFocusOutside"],"sources":["@wordpress/editor/src/components/post-title/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { create, toHTMLString, insert } from '@wordpress/rich-text';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { withFocusOutside } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { pasteHandler } from '@wordpress/blocks';\nimport { store as blockEditorStore, RichText } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/** @typedef {import('./types').RichTextValue} RichTextValue */\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\n/**\n * Inserts content with title\n *\n * This function processes the given content and title, updating the title\n * and content based on certain conditions. If the content is an array of\n * blocks, it will check the first block for a heading or paragraph to use\n * as the title. If the content is a string, it will strip HTML and update\n * the title and content accordingly.\n *\n * @param {string} title The post title.\n * @param {Array | string} content The content to be processed. It can be an array of blocks or a string.\n * @param {Function} onUpdateTitle Callback function to update the title.\n * @param {Function} onUpdateContent Callback function to update the content.\n * @param {RichTextValue} value The initial value object, default is an object with empty text.\n */\nexport function insertContentWithTitle(\n\ttitle,\n\tcontent,\n\tonUpdateTitle,\n\tonUpdateContent,\n\tvalue = create( { text: '' } )\n) {\n\tif ( ! content.length ) {\n\t\treturn;\n\t}\n\n\tif ( typeof content !== 'string' ) {\n\t\tconst [ firstBlock ] = content;\n\n\t\tif (\n\t\t\t! title &&\n\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t) {\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( firstBlock.attributes.content );\n\t\t\tonUpdateTitle( contentNoHTML );\n\t\t\tonUpdateContent( content.slice( 1 ) );\n\t\t} else {\n\t\t\tonUpdateContent( content );\n\t\t}\n\t} else {\n\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t// is undesirable.\n\t\tconst contentNoHTML = stripHTML( content );\n\n\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\tonUpdateTitle( toHTMLString( { value: newValue } ) );\n\t}\n}\n\nclass PostTitle extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.setRef = this.setRef.bind( this );\n\t\tthis.onPaste = this.onPaste.bind( this );\n\t}\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Unselect if any other block is selected and blur the RichText.\n\t\tif (\n\t\t\tthis.props.isSelected &&\n\t\t\t! prevProps.isAnyBlockSelected &&\n\t\t\tthis.props.isAnyBlockSelected\n\t\t) {\n\t\t\tif ( this.richTextRef ) {\n\t\t\t\tthis.richTextRef.blur();\n\t\t\t}\n\t\t\tthis.props.onUnselect();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.innerRef ) {\n\t\t\tthis.props.innerRef( this );\n\t\t}\n\t}\n\n\thandleFocusOutside() {\n\t\tthis.props.onUnselect();\n\t}\n\n\tfocus() {\n\t\tthis.props.onSelect();\n\t}\n\n\tonPaste( { value, plainText, html } ) {\n\t\tconst {\n\t\t\ttitle,\n\t\t\tonInsertBlockAfter: onInsertBlocks,\n\t\t\tonUpdate,\n\t\t} = this.props;\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tinsertContentWithTitle(\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\tonUpdate,\n\t\t\tonInsertBlocks,\n\t\t\tvalue\n\t\t);\n\t}\n\n\tsetRef( richText ) {\n\t\tthis.richTextRef = richText;\n\t}\n\n\tgetTitle( title, postType ) {\n\t\tif ( 'page' === postType ) {\n\t\t\treturn ! title\n\t\t\t\t? /* translators: accessibility text. empty page title. */\n\t\t\t\t __( 'Page title. Empty' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. %s: text content of the page title. */\n\t\t\t\t\t\t__( 'Page title. %s' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t );\n\t\t}\n\n\t\treturn ! title\n\t\t\t? /* translators: accessibility text. empty post title. */\n\t\t\t __( 'Post title. Empty' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: text content of the post title. */\n\t\t\t\t\t__( 'Post title. %s' ),\n\t\t\t\t\ttitle\n\t\t\t );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tstyle,\n\t\t\ttitle,\n\t\t\tfocusedBorderColor,\n\t\t\tborderStyle,\n\t\t\tisDimmed,\n\t\t\tpostType,\n\t\t\tglobalStyles,\n\t\t} = this.props;\n\n\t\tconst decodedPlaceholder = decodeEntities( placeholder );\n\t\tconst borderColor = this.props.isSelected\n\t\t\t? focusedBorderColor\n\t\t\t: 'transparent';\n\t\tconst titleStyles = {\n\t\t\t...style,\n\t\t\t...( globalStyles?.text && {\n\t\t\t\tcolor: globalStyles.text,\n\t\t\t\tplaceholderColor: globalStyles.text,\n\t\t\t} ),\n\t\t};\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\ttestID=\"post-title\"\n\t\t\t\tstyle={ [\n\t\t\t\t\tstyles.titleContainer,\n\t\t\t\t\tborderStyle,\n\t\t\t\t\t{ borderColor },\n\t\t\t\t\tisDimmed && styles.dimmed,\n\t\t\t\t] }\n\t\t\t\taccessible={ ! this.props.isSelected }\n\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\taccessibilityHint={ __( 'Updates the title.' ) }\n\t\t\t>\n\t\t\t\t<RichText.Raw\n\t\t\t\t\tref={ this.setRef }\n\t\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\t\ttagName=\"p\"\n\t\t\t\t\ttagsToEliminate={ [ 'strong' ] }\n\t\t\t\t\tunstableOnFocus={ this.props.onSelect }\n\t\t\t\t\tonBlur={ this.props.onBlur } // Always assign onBlur as a props.\n\t\t\t\t\tstyle={ titleStyles }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tfontSize={ 24 }\n\t\t\t\t\tlineHeight={ 1 }\n\t\t\t\t\tfontWeight=\"bold\"\n\t\t\t\t\tdeleteEnter\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tthis.props.onUpdate( value );\n\t\t\t\t\t} }\n\t\t\t\t\tonPaste={ this.onPaste }\n\t\t\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonSelectionChange={ () => {} }\n\t\t\t\t\tonEnter={ this.props.onEnterPress }\n\t\t\t\t\tdisableEditingMenu\n\t\t\t\t\t__unstableIsSelected={ this.props.isSelected }\n\t\t\t\t\t__unstableOnCreateUndoLevel={ () => {} }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default compose(\n\twithSelect( ( select ) => {\n\t\tconst { isPostTitleSelected, getEditedPostAttribute } =\n\t\t\tselect( editorStore );\n\t\tconst { getSelectedBlockClientId, getBlockRootClientId, getSettings } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst selectedId = getSelectedBlockClientId();\n\t\tconst selectionIsNested = !! getBlockRootClientId( selectedId );\n\t\tconst globalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles?.color;\n\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tisAnyBlockSelected: !! selectedId,\n\t\t\tisSelected: isPostTitleSelected(),\n\t\t\tisDimmed: selectionIsNested,\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { undo, redo, togglePostTitleSelection, editPost } =\n\t\t\tdispatch( editorStore );\n\n\t\tconst { clearSelectedBlock, insertDefaultBlock, insertBlocks } =\n\t\t\tdispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tonEnterPress() {\n\t\t\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t\t\t},\n\t\t\tonUndo: undo,\n\t\t\tonRedo: redo,\n\t\t\tonSelect() {\n\t\t\t\ttogglePostTitleSelection( true );\n\t\t\t\tclearSelectedBlock();\n\t\t\t},\n\t\t\tonUnselect() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tonUpdate( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\tonInsertBlockAfter( blocks ) {\n\t\t\t\tinsertBlocks( blocks, 0 );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithFocusOutside\n)( PostTitle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,IAAA,GAAAX,OAAA;AAOA,IAAAY,MAAA,GAAAC,sBAAA,CAAAb,OAAA;AAAkC,IAAAc,WAAA,GAAAd,OAAA;AAzBlC;AACA;AACA;;AAGA;AACA;AACA;;AAaA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASe,sBAAsBA,CACrCC,KAAK,EACLC,OAAO,EACPC,aAAa,EACbC,eAAe,EACfC,KAAK,GAAG,IAAAC,gBAAM,EAAE;EAAEC,IAAI,EAAE;AAAG,CAAE,CAAC,EAC7B;EACD,IAAK,CAAEL,OAAO,CAACM,MAAM,EAAG;IACvB;EACD;EAEA,IAAK,OAAON,OAAO,KAAK,QAAQ,EAAG;IAClC,MAAM,CAAEO,UAAU,CAAE,GAAGP,OAAO;IAE9B,IACC,CAAED,KAAK,KACLQ,UA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IACjC3E,UAAU,EAAEoE,mBAAmB,CAAC,CAAC;IACjC1C,QAAQ,EAAEkD,iBAAiB;IAC3BjD;EACD,CAAC;AACF,CAAE,CAAC,EACH,IAAAmD,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC,IAAI;IAAEC,IAAI;IAAEC,wBAAwB;IAAEC;EAAS,CAAC,GACvDJ,QAAQ,CAAET,aAAY,CAAC;EAExB,MAAM;IAAEc,kBAAkB;IAAEC,kBAAkB;IAAEC;EAAa,CAAC,GAC7DP,QAAQ,CAAEL,kBAAiB,CAAC;EAE7B,OAAO;IACNhB,YAAYA,CAAA,EAAG;MACd2B,kBAAkB,CAAEE,SAAS,EAAEA,SAAS,EAAE,CAAE,CAAC;IAC9C,CAAC;IACDC,MAAM,EAAER,IAAI;IACZS,MAAM,EAAER,IAAI;IACZxE,QAAQA,CAAA,EAAG;MACVyE,wBAAwB,CAAE,IAAK,CAAC;MAChCE,kBAAkB,CAAC,CAAC;IACrB,CAAC;IACDhF,UAAUA,CAAA,EAAG;MACZ8E,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACDrE,QAAQA,CAAExC,KAAK,EAAG;MACjB8G,QAAQ,CAAE;QAAE9G;MAAM,CAAE,CAAC;IACtB,CAAC;IACDsC,kBAAkBA,CAAE+E,MAAM,EAAG;MAC5BJ,YAAY,CAAEI,MAAM,EAAE,CAAE,CAAC;IAC1B;EACD,CAAC;AACF,CAAE,CAAC,EACHC,uBAAc,EACdC,4BACD,CAAC,CAAErG,SAAU,CAAC","ignoreList":[]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = require("react");
9
8
  var _clsx = _interopRequireDefault(require("clsx"));
10
9
  var _components = require("@wordpress/components");
11
10
  var _i18n = require("@wordpress/i18n");
@@ -16,6 +15,7 @@ var _element = require("@wordpress/element");
16
15
  var _constants = require("./constants");
17
16
  var _usePostTitleFocus = _interopRequireDefault(require("./use-post-title-focus"));
18
17
  var _usePostTitle = _interopRequireDefault(require("./use-post-title"));
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
19
  /**
20
20
  * External dependencies
21
21
  */
@@ -28,7 +28,14 @@ var _usePostTitle = _interopRequireDefault(require("./use-post-title"));
28
28
  * Internal dependencies
29
29
  */
30
30
 
31
- function PostTitleRaw(_, forwardedRef) {
31
+ /**
32
+ * Renders a raw post title input field.
33
+ *
34
+ * @param {Object} _ Unused parameter.
35
+ * @param {Element} forwardedRef Reference to the component's DOM node.
36
+ *
37
+ * @return {Component} The rendered component.
38
+ */function PostTitleRaw(_, forwardedRef) {
32
39
  const {
33
40
  placeholder,
34
41
  hasFixedToolbar
@@ -71,7 +78,7 @@ function PostTitleRaw(_, forwardedRef) {
71
78
  'is-raw-text': true
72
79
  });
73
80
  const decodedPlaceholder = (0, _htmlEntities.decodeEntities)(placeholder) || (0, _i18n.__)('Add title');
74
- return (0, _react.createElement)(_components.TextareaControl, {
81
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextareaControl, {
75
82
  ref: focusRef,
76
83
  value: title,
77
84
  onChange: onChange,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_htmlEntities","_data","_blockEditor","_element","_constants","_usePostTitleFocus","_usePostTitle","PostTitleRaw","_","forwardedRef","placeholder","hasFixedToolbar","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","_hasFixedToolbar","isSelected","setIsSelected","useState","title","setTitle","onUpdate","usePostTitle","ref","focusRef","usePostTitleFocus","onChange","value","replace","REGEXP_NEWLINES","onSelect","onUnselect","className","clsx","DEFAULT_CLASSNAMES","decodedPlaceholder","decodeEntities","__","_react","createElement","TextareaControl","onFocus","onBlur","label","hideLabelFromVision","autoComplete","dir","rows","__nextHasNoMarginBottom","_default","exports","default","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/post-title-raw.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { TextareaControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\n\nfunction PostTitleRaw( _, forwardedRef ) {\n\tconst { placeholder, hasFixedToolbar } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =\n\t\t\tgetSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t\thasFixedToolbar: _hasFixedToolbar,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t}\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'is-raw-text': true,\n\t} );\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\treturn (\n\t\t<TextareaControl\n\t\t\tref={ focusRef }\n\t\t\tvalue={ title }\n\t\t\tonChange={ onChange }\n\t\t\tonFocus={ onSelect }\n\t\t\tonBlur={ onUnselect }\n\t\t\tlabel={ placeholder }\n\t\t\tclassName={ className }\n\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\thideLabelFromVision\n\t\t\tautoComplete=\"off\"\n\t\t\tdir=\"auto\"\n\t\t\trows={ 1 }\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n}\n\nexport default forwardRef( PostTitleRaw );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,aAAA,GAAAV,sBAAA,CAAAC,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAKA,SAASU,YAAYA,CAAEC,CAAC,EAAEC,YAAY,EAAG;EACxC,MAAM;IAAEC,WAAW;IAAEC;EAAgB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACjE,MAAM;MAAEC;IAAY,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IAClD,MAAM;MAAEC,gBAAgB;MAAEL,eAAe,EAAEM;IAAiB,CAAC,GAC5DH,WAAW,CAAC,CAAC;IAEd,OAAO;MACNJ,WAAW,EAAEM,gBAAgB;MAC7BL,eAAe,EAAEM;IAClB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM,CAAEC,UAAU,EAAEC,aAAa,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAEvD,MAAM;IAAEC,KAAK;IAAEC,QAAQ,EAAEC;EAAS,CAAC,GAAG,IAAAC,qBAAY,EAAC,CAAC;EACpD,MAAM;IAAEC,GAAG,EAAEC;EAAS,CAAC,GAAG,IAAAC,0BAAiB,EAAElB,YAAa,CAAC;EAE3D,SAASmB,QAAQA,CAAEC,KAAK,EAAG;IAC1BN,QAAQ,CAAEM,KAAK,CAACC,OAAO,CAAEC,0BAAe,EAAE,GAAI,CAAE,CAAC;EAClD;EAEA,SAASC,QAAQA,CAAA,EAAG;IACnBb,aAAa,CAAE,IAAK,CAAC;EACtB;EAEA,SAASc,UAAUA,CAAA,EAAG;IACrBd,aAAa,CAAE,KAAM,CAAC;EACvB;;EAEA;EACA;EACA,MAAMe,SAAS,GAAG,IAAAC,aAAI,EAAEC,6BAAkB,EAAE;IAC3C,aAAa,EAAElB,UAAU;IACzB,mBAAmB,EAAEP,eAAe;IACpC,aAAa,EAAE;EAChB,CAAE,CAAC;EAEH,MAAM0B,kBAAkB,GACvB,IAAAC,4BAAc,EAAE5B,WAAY,CAAC,IAAI,IAAA6B,QAAE,EAAE,WAAY,CAAC;EAEnD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAC3C,WAAA,CAAA4C,eAAe;IACfjB,GAAG,EAAGC,QAAU;IAChBG,KAAK,EAAGR,KAAO;IACfO,QAAQ,EAAGA,QAAU;IACrBe,OAAO,EAAGX,QAAU;IACpBY,MAAM,EAAGX,UAAY;IACrBY,KAAK,EAAGnC,WAAa;IACrBwB,SAAS,EAAGA,SAAW;IACvBxB,WAAW,EAAG2B,kBAAoB;IAClCS,mBAAmB;IACnBC,YAAY,EAAC,KAAK;IAClBC,GAAG,EAAC,MAAM;IACVC,IAAI,EAAG,CAAG;IACVC,uBAAuB;EAAA,CACvB,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,mBAAU,EAAE/C,YAAa,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_htmlEntities","_data","_blockEditor","_element","_constants","_usePostTitleFocus","_usePostTitle","_jsxRuntime","PostTitleRaw","_","forwardedRef","placeholder","hasFixedToolbar","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","_hasFixedToolbar","isSelected","setIsSelected","useState","title","setTitle","onUpdate","usePostTitle","ref","focusRef","usePostTitleFocus","onChange","value","replace","REGEXP_NEWLINES","onSelect","onUnselect","className","clsx","DEFAULT_CLASSNAMES","decodedPlaceholder","decodeEntities","__","jsx","TextareaControl","onFocus","onBlur","label","hideLabelFromVision","autoComplete","dir","rows","__nextHasNoMarginBottom","_default","exports","default","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/post-title-raw.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { TextareaControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\n\n/**\n * Renders a raw post title input field.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Reference to the component's DOM node.\n *\n * @return {Component} The rendered component.\n */\nfunction PostTitleRaw( _, forwardedRef ) {\n\tconst { placeholder, hasFixedToolbar } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =\n\t\t\tgetSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t\thasFixedToolbar: _hasFixedToolbar,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t}\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'is-raw-text': true,\n\t} );\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\treturn (\n\t\t<TextareaControl\n\t\t\tref={ focusRef }\n\t\t\tvalue={ title }\n\t\t\tonChange={ onChange }\n\t\t\tonFocus={ onSelect }\n\t\t\tonBlur={ onUnselect }\n\t\t\tlabel={ placeholder }\n\t\t\tclassName={ className }\n\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\thideLabelFromVision\n\t\t\tautoComplete=\"off\"\n\t\t\tdir=\"auto\"\n\t\t\trows={ 1 }\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n}\n\nexport default forwardRef( PostTitleRaw );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,aAAA,GAAAV,sBAAA,CAAAC,OAAA;AAA4C,IAAAU,WAAA,GAAAV,OAAA;AApB5C;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASW,YAAYA,CAAEC,CAAC,E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,EAAGC,QAAU;IAChBG,KAAK,EAAGR,KAAO;IACfO,QAAQ,EAAGA,QAAU;IACrBc,OAAO,EAAGV,QAAU;IACpBW,MAAM,EAAGV,UAAY;IACrBW,KAAK,EAAGlC,WAAa;IACrBwB,SAAS,EAAGA,SAAW;IACvBxB,WAAW,EAAG2B,kBAAoB;IAClCQ,mBAAmB;IACnBC,YAAY,EAAC,KAAK;IAClBC,GAAG,EAAC,MAAM;IACVC,IAAI,EAAG,CAAG;IACVC,uBAAuB;EAAA,CACvB,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,mBAAU,EAAE9C,YAAa,CAAC","ignoreList":[]}
@@ -15,6 +15,13 @@ var _store = require("../../store");
15
15
  * Internal dependencies
16
16
  */
17
17
 
18
+ /**
19
+ * Custom hook that manages the focus behavior of the post title input field.
20
+ *
21
+ * @param {Element} forwardedRef - The forwarded ref for the input field.
22
+ *
23
+ * @return {Object} - The ref object.
24
+ */
18
25
  function usePostTitleFocus(forwardedRef) {
19
26
  const ref = (0, _element.useRef)();
20
27
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_store","usePostTitleFocus","forwardedRef","ref","useRef","isCleanNewPost","useSelect","select","_isCleanNewPost","editorStore","useImperativeHandle","focus","current","useEffect","defaultView","ownerDocument","name","parent","document","activeElement","body"],"sources":["@wordpress/editor/src/components/post-title/use-post-title-focus.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useImperativeHandle, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function usePostTitleFocus( forwardedRef ) {\n\tconst ref = useRef();\n\n\tconst { isCleanNewPost } = useSelect( ( select ) => {\n\t\tconst { isCleanNewPost: _isCleanNewPost } = select( editorStore );\n\n\t\treturn {\n\t\t\tisCleanNewPost: _isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseImperativeHandle( forwardedRef, () => ( {\n\t\tfocus: () => {\n\t\t\tref?.current?.focus();\n\t\t},\n\t} ) );\n\n\tuseEffect( () => {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { defaultView } = ref.current.ownerDocument;\n\t\tconst { name, parent } = defaultView;\n\t\tconst ownerDocument =\n\t\t\tname === 'editor-canvas' ? parent.document : defaultView.document;\n\t\tconst { activeElement, body } = ownerDocument;\n\n\t\t// Only autofocus the title when the post is entirely empty. This should\n\t\t// only happen for a new post, which means we focus the title on new\n\t\t// post so the author can start typing right away, without needing to\n\t\t// click anything.\n\t\tif ( isCleanNewPost && ( ! activeElement || body === activeElement ) ) {\n\t\t\tref.current.focus();\n\t\t}\n\t}, [ isCleanNewPost ] );\n\n\treturn { ref };\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,SAASG,iBAAiBA,CAAEC,YAAY,EAAG;EACzD,MAAMC,GAAG,GAAG,IAAAC,eAAM,EAAC,CAAC;EAEpB,MAAM;IAAEC;EAAe,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACnD,MAAM;MAAEF,cAAc,EAAEG;IAAgB,CAAC,GAAGD,MAAM,CAAEE,YAAY,CAAC;IAEjE,OAAO;MACNJ,cAAc,EAAEG,eAAe,CAAC;IACjC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAE,4BAAmB,EAAER,YAAY,EAAE,OAAQ;IAC1CS,KAAK,EAAEA,CAAA,KAAM;MACZR,GAAG,EAAES,OAAO,EAAED,KAAK,CAAC,CAAC;IACtB;EACD,CAAC,CAAG,CAAC;EAEL,IAAAE,kBAAS,EAAE,MAAM;IAChB,IAAK,CAAEV,GAAG,CAACS,OAAO,EAAG;MACpB;IACD;IAEA,MAAM;MAAEE;IAAY,CAAC,GAAGX,GAAG,CAACS,OAAO,CAACG,aAAa;IACjD,MAAM;MAAEC,IAAI;MAAEC;IAAO,CAAC,GAAGH,WAAW;IACpC,MAAMC,aAAa,GAClBC,IAAI,KAAK,eAAe,GAAGC,MAAM,CAACC,QAAQ,GAAGJ,WAAW,CAACI,QAAQ;IAClE,MAAM;MAAEC,aAAa;MAAEC;IAAK,CAAC,GAAGL,aAAa;;IAE7C;IACA;IACA;IACA;IACA,IAAKV,cAAc,KAAM,CAAEc,aAAa,IAAIC,IAAI,KAAKD,aAAa,CAAE,EAAG;MACtEhB,GAAG,CAACS,OAAO,CAACD,KAAK,CAAC,CAAC;IACpB;EACD,CAAC,EAAE,CAAEN,cAAc,CAAG,CAAC;EAEvB,OAAO;IAAEF;EAAI,CAAC;AACf","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_store","usePostTitleFocus","forwardedRef","ref","useRef","isCleanNewPost","useSelect","select","_isCleanNewPost","editorStore","useImperativeHandle","focus","current","useEffect","defaultView","ownerDocument","name","parent","document","activeElement","body"],"sources":["@wordpress/editor/src/components/post-title/use-post-title-focus.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useImperativeHandle, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Custom hook that manages the focus behavior of the post title input field.\n *\n * @param {Element} forwardedRef - The forwarded ref for the input field.\n *\n * @return {Object} - The ref object.\n */\nexport default function usePostTitleFocus( forwardedRef ) {\n\tconst ref = useRef();\n\n\tconst { isCleanNewPost } = useSelect( ( select ) => {\n\t\tconst { isCleanNewPost: _isCleanNewPost } = select( editorStore );\n\n\t\treturn {\n\t\t\tisCleanNewPost: _isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseImperativeHandle( forwardedRef, () => ( {\n\t\tfocus: () => {\n\t\t\tref?.current?.focus();\n\t\t},\n\t} ) );\n\n\tuseEffect( () => {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { defaultView } = ref.current.ownerDocument;\n\t\tconst { name, parent } = defaultView;\n\t\tconst ownerDocument =\n\t\t\tname === 'editor-canvas' ? parent.document : defaultView.document;\n\t\tconst { activeElement, body } = ownerDocument;\n\n\t\t// Only autofocus the title when the post is entirely empty. This should\n\t\t// only happen for a new post, which means we focus the title on new\n\t\t// post so the author can start typing right away, without needing to\n\t\t// click anything.\n\t\tif ( isCleanNewPost && ( ! activeElement || body === activeElement ) ) {\n\t\t\tref.current.focus();\n\t\t}\n\t}, [ isCleanNewPost ] );\n\n\treturn { ref };\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,iBAAiBA,CAAEC,YAAY,EAAG;EACzD,MAAMC,GAAG,GAAG,IAAAC,eAAM,EAAC,CAAC;EAEpB,MAAM;IAAEC;EAAe,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACnD,MAAM;MAAEF,cAAc,EAAEG;IAAgB,CAAC,GAAGD,MAAM,CAAEE,YAAY,CAAC;IAEjE,OAAO;MACNJ,cAAc,EAAEG,eAAe,CAAC;IACjC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAE,4BAAmB,EAAER,YAAY,EAAE,OAAQ;IAC1CS,KAAK,EAAEA,CAAA,KAAM;MACZR,GAAG,EAAES,OAAO,EAAED,KAAK,CAAC,CAAC;IACtB;EACD,CAAC,CAAG,CAAC;EAEL,IAAAE,kBAAS,EAAE,MAAM;IAChB,IAAK,CAAEV,GAAG,CAACS,OAAO,EAAG;MACpB;IACD;IAEA,MAAM;MAAEE;IAAY,CAAC,GAAGX,GAAG,CAACS,OAAO,CAACG,aAAa;IACjD,MAAM;MAAEC,IAAI;MAAEC;IAAO,CAAC,GAAGH,WAAW;IACpC,MAAMC,aAAa,GAClBC,IAAI,KAAK,eAAe,GAAGC,MAAM,CAACC,QAAQ,GAAGJ,WAAW,CAACI,QAAQ;IAClE,MAAM;MAAEC,aAAa;MAAEC;IAAK,CAAC,GAAGL,aAAa;;IAE7C;IACA;IACA;IACA;IACA,IAAKV,cAAc,KAAM,CAAEc,aAAa,IAAIC,IAAI,KAAKD,aAAa,CAAE,EAAG;MACtEhB,GAAG,CAACS,OAAO,CAACD,KAAK,CAAC,CAAC;IACpB;EACD,CAAC,EAAE,CAAEN,cAAc,CAAG,CAAC;EAEvB,OAAO;IAAEF;EAAI,CAAC;AACf","ignoreList":[]}
@@ -14,6 +14,11 @@ var _store = require("../../store");
14
14
  * Internal dependencies
15
15
  */
16
16
 
17
+ /**
18
+ * Custom hook for managing the post title in the editor.
19
+ *
20
+ * @return {Object} An object containing the current title and a function to update the title.
21
+ */
17
22
  function usePostTitle() {
18
23
  const {
19
24
  editPost
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_store","usePostTitle","editPost","useDispatch","editorStore","title","useSelect","select","getEditedPostAttribute","updateTitle","newTitle","setTitle"],"sources":["@wordpress/editor/src/components/post-title/use-post-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function usePostTitle() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { title } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t}, [] );\n\n\tfunction updateTitle( newTitle ) {\n\t\teditPost( { title: newTitle } );\n\t}\n\n\treturn { title, setTitle: updateTitle };\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAPA;AACA;AACA;;AAEA;AACA;AACA;;AAGe,SAASE,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAY,CAAC;EAC/C,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC1C,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEH,YAAY,CAAC;IAExD,OAAO;MACNC,KAAK,EAAEG,sBAAsB,CAAE,OAAQ;IACxC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,SAASC,WAAWA,CAAEC,QAAQ,EAAG;IAChCR,QAAQ,CAAE;MAAEG,KAAK,EAAEK;IAAS,CAAE,CAAC;EAChC;EAEA,OAAO;IAAEL,KAAK;IAAEM,QAAQ,EAAEF;EAAY,CAAC;AACxC","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_store","usePostTitle","editPost","useDispatch","editorStore","title","useSelect","select","getEditedPostAttribute","updateTitle","newTitle","setTitle"],"sources":["@wordpress/editor/src/components/post-title/use-post-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Custom hook for managing the post title in the editor.\n *\n * @return {Object} An object containing the current title and a function to update the title.\n */\nexport default function usePostTitle() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { title } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t}, [] );\n\n\tfunction updateTitle( newTitle ) {\n\t\teditPost( { title: newTitle } );\n\t}\n\n\treturn { title, setTitle: updateTitle };\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAPA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACe,SAASE,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAY,CAAC;EAC/C,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC1C,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEH,YAAY,CAAC;IAExD,OAAO;MACNC,KAAK,EAAEG,sBAAsB,CAAE,OAAQ;IACxC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,SAASC,WAAWA,CAAEC,QAAQ,EAAG;IAChCR,QAAQ,CAAE;MAAEG,KAAK,EAAEK;IAAS,CAAE,CAAC;EAChC;EAEA,OAAO;IAAEL,KAAK;IAAEM,QAAQ,EAAEF;EAAY,CAAC;AACxC","ignoreList":[]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = PostTransformPanel;
7
- var _react = require("react");
8
7
  var _data = require("@wordpress/data");
9
8
  var _coreData = require("@wordpress/core-data");
10
9
  var _components = require("@wordpress/components");
@@ -15,6 +14,7 @@ var _blocks = require("@wordpress/blocks");
15
14
  var _store = require("../../store");
16
15
  var _hooks = require("./hooks");
17
16
  var _constants = require("../../store/constants");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
18
  /**
19
19
  * WordPress dependencies
20
20
  */
@@ -31,7 +31,7 @@ function TemplatesList({
31
31
  if (!availableTemplates || availableTemplates?.length === 0) {
32
32
  return null;
33
33
  }
34
- return (0, _react.createElement)(_blockEditor.__experimentalBlockPatternsList, {
34
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.__experimentalBlockPatternsList, {
35
35
  label: (0, _i18n.__)('Templates'),
36
36
  blockPatterns: availableTemplates,
37
37
  shownPatterns: shownTemplates,
@@ -73,14 +73,14 @@ function PostTransform() {
73
73
  if (!availablePatterns?.length) {
74
74
  return null;
75
75
  }
76
- return (0, _react.createElement)(_components.PanelBody, {
77
- title: (0, _i18n.__)('Transform into:'),
78
- initialOpen: record.type === _constants.TEMPLATE_PART_POST_TYPE
79
- }, (0, _react.createElement)(_components.PanelRow, null, (0, _react.createElement)("p", null, (0, _i18n.__)('Choose a predefined pattern to switch up the look of your template.' // TODO - make this dynamic?
80
- ))), (0, _react.createElement)(TemplatesList, {
81
- availableTemplates: availablePatterns,
82
- onSelect: onTemplateSelect
83
- }));
76
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelBody, {
77
+ title: (0, _i18n.__)('Design'),
78
+ initialOpen: record.type === _constants.TEMPLATE_PART_POST_TYPE,
79
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TemplatesList, {
80
+ availableTemplates: availablePatterns,
81
+ onSelect: onTemplateSelect
82
+ })
83
+ });
84
84
  }
85
85
  function PostTransformPanel() {
86
86
  const {
@@ -96,6 +96,6 @@ function PostTransformPanel() {
96
96
  if (![_constants.TEMPLATE_PART_POST_TYPE, _constants.TEMPLATE_POST_TYPE].includes(postType)) {
97
97
  return null;
98
98
  }
99
- return (0, _react.createElement)(PostTransform, null);
99
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(PostTransform, {});
100
100
  }
101
101
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_coreData","_components","_i18n","_compose","_blockEditor","_blocks","_store","_hooks","_constants","TemplatesList","availableTemplates","onSelect","shownTemplates","useAsyncList","length","_react","createElement","__experimentalBlockPatternsList","label","__","blockPatterns","shownPatterns","onClickPattern","showTitlesAsTooltip","PostTransform","record","postType","postId","useSelect","select","getCurrentPostType","getCurrentPostId","editorStore","getEditedEntityRecord","coreStore","type","id","editEntityRecord","useDispatch","availablePatterns","useAvailablePatterns","onTemplateSelect","selectedTemplate","blocks","content","serialize","PanelBody","title","initialOpen","TEMPLATE_PART_POST_TYPE","PanelRow","PostTransformPanel","TEMPLATE_POST_TYPE","includes"],"sources":["@wordpress/editor/src/components/post-transform-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useAsyncList } from '@wordpress/compose';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAvailablePatterns } from './hooks';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\n\nfunction TemplatesList( { availableTemplates, onSelect } ) {\n\tconst shownTemplates = useAsyncList( availableTemplates );\n\tif ( ! availableTemplates || availableTemplates?.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tlabel={ __( 'Templates' ) }\n\t\t\tblockPatterns={ availableTemplates }\n\t\t\tshownPatterns={ shownTemplates }\n\t\t\tonClickPattern={ onSelect }\n\t\t\tshowTitlesAsTooltip\n\t\t/>\n\t);\n}\n\nfunction PostTransform() {\n\tconst { record, postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst type = getCurrentPostType();\n\t\tconst id = getCurrentPostId();\n\t\treturn {\n\t\t\tpostType: type,\n\t\t\tpostId: id,\n\t\t\trecord: getEditedEntityRecord( 'postType', type, id ),\n\t\t};\n\t}, [] );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst availablePatterns = useAvailablePatterns( record );\n\tconst onTemplateSelect = async ( selectedTemplate ) => {\n\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\tblocks: selectedTemplate.blocks,\n\t\t\tcontent: serialize( selectedTemplate.blocks ),\n\t\t} );\n\t};\n\tif ( ! availablePatterns?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ __( 'Transform into:' ) }\n\t\t\tinitialOpen={ record.type === TEMPLATE_PART_POST_TYPE }\n\t\t>\n\t\t\t<PanelRow>\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Choose a predefined pattern to switch up the look of your template.' // TODO - make this dynamic?\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</PanelRow>\n\n\t\t\t<TemplatesList\n\t\t\t\tavailableTemplates={ availablePatterns }\n\t\t\t\tonSelect={ onTemplateSelect }\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function PostTransformPanel() {\n\tconst { postType } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\tif (\n\t\t! [ TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE ].includes( postType )\n\t) {\n\t\treturn null;\n\t}\n\n\treturn <PostTransform />;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAhBA;AACA;AACA;;AASA;AACA;AACA;;AAQA,SAASU,aAAaA,CAAE;EAAEC,kBAAkB;EAAEC;AAAS,CAAC,EAAG;EAC1D,MAAMC,cAAc,GAAG,IAAAC,qBAAY,EAAEH,kBAAmB,CAAC;EACzD,IAAK,CAAEA,kBAAkB,IAAIA,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AC;EACD,IAAK,CAAEJ,iBAAiB,EAAEzB,MAAM,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAA6C,SAAS;IACTC,KAAK,EAAG,IAAA5B,QAAE,EAAE,iBAAkB,CAAG;IACjC6B,WAAW,EAAGvB,MAAM,CAACU,IAAI,KAAKc;EAAyB,GAEvD,IAAAlC,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAiD,QAAQ,QACR,IAAAnC,MAAA,CAAAC,aAAA,aACG,IAAAG,QAAE,EACH,qEAAqE,CAAC;EACvE,CACE,CACM,CAAC,EAEX,IAAAJ,MAAA,CAAAC,aAAA,EAACP,aAAa;IACbC,kBAAkB,EAAG6B,iBAAmB;IACxC5B,QAAQ,EAAG8B;EAAkB,CAC7B,CACS,CAAC;AAEd;AAEe,SAASU,kBAAkBA,CAAA,EAAG;EAC5C,MAAM;IAAEzB;EAAS,CAAC,GAAG,IAAAE,eAAS,EAAIC,MAAM,IAAM;IAC7C,MAAM;MAAEC;IAAmB,CAAC,GAAGD,MAAM,CAAEG,YAAY,CAAC;IACpD,OAAO;MACNN,QAAQ,EAAEI,kBAAkB,CAAC;IAC9B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IACC,CAAE,CAAEmB,kCAAuB,EAAEG,6BAAkB,CAAE,CAACC,QAAQ,CAAE3B,QAAS,CAAC,EACrE;IACD,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAX,MAAA,CAAAC,aAAA,EAACQ,aAAa,MAAE,CAAC;AACzB","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_coreData","_components","_i18n","_compose","_blockEditor","_blocks","_store","_hooks","_constants","_jsxRuntime","TemplatesList","availableTemplates","onSelect","shownTemplates","useAsyncList","length","jsx","__experimentalBlockPatternsList","label","__","blockPatterns","shownPatterns","onClickPattern","showTitlesAsTooltip","PostTransform","record","postType","postId","useSelect","select","getCurrentPostType","getCurrentPostId","editorStore","getEditedEntityRecord","coreStore","type","id","editEntityRecord","useDispatch","availablePatterns","useAvailablePatterns","onTemplateSelect","selectedTemplate","blocks","content","serialize","PanelBody","title","initialOpen","TEMPLATE_PART_POST_TYPE","children","PostTransformPanel","TEMPLATE_POST_TYPE","includes"],"sources":["@wordpress/editor/src/components/post-transform-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useAsyncList } from '@wordpress/compose';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAvailablePatterns } from './hooks';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\n\nfunction TemplatesList( { availableTemplates, onSelect } ) {\n\tconst shownTemplates = useAsyncList( availableTemplates );\n\tif ( ! availableTemplates || availableTemplates?.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tlabel={ __( 'Templates' ) }\n\t\t\tblockPatterns={ availableTemplates }\n\t\t\tshownPatterns={ shownTemplates }\n\t\t\tonClickPattern={ onSelect }\n\t\t\tshowTitlesAsTooltip\n\t\t/>\n\t);\n}\n\nfunction PostTransform() {\n\tconst { record, postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst type = getCurrentPostType();\n\t\tconst id = getCurrentPostId();\n\t\treturn {\n\t\t\tpostType: type,\n\t\t\tpostId: id,\n\t\t\trecord: getEditedEntityRecord( 'postType', type, id ),\n\t\t};\n\t}, [] );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst availablePatterns = useAvailablePatterns( record );\n\tconst onTemplateSelect = async ( selectedTemplate ) => {\n\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\tblocks: selectedTemplate.blocks,\n\t\t\tcontent: serialize( selectedTemplate.blocks ),\n\t\t} );\n\t};\n\tif ( ! availablePatterns?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tinitialOpen={ record.type === TEMPLATE_PART_POST_TYPE }\n\t\t>\n\t\t\t<TemplatesList\n\t\t\t\tavailableTemplates={ availablePatterns }\n\t\t\t\tonSelect={ onTemplateSelect }\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function PostTransformPanel() {\n\tconst { postType } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\tif (\n\t\t! [ TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE ].includes( postType )\n\t) {\n\t\treturn null;\n\t}\n\n\treturn <PostTransform />;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAG+B,IAAAU,WAAA,GAAAV,OAAA;AAnB/B;AACA;AACA;;AASA;AACA;AACA;;AAQA,SAASW,aAAaA,CAAE;EAAEC,kBAAkB;EAAEC;AAAS,CAAC,EAAG;EAC1D,MAAMC,cAAc,GAAG,IAAAC,qBAAY,EAAEH,kBAAmB,CAAC;EACzD,IAAK,CAA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CAAE,CAAC;EACJ,CAAC;EACD,IAAK,CAAEJ,iBAAiB,EAAExB,MAAM,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAN,WAAA,CAAAO,GAAA,EAACf,WAAA,CAAA6C,SAAS;IACTC,KAAK,EAAG,IAAA5B,QAAE,EAAE,QAAS,CAAG;IACxB6B,WAAW,EAAGvB,MAAM,CAACU,IAAI,KAAKc,kCAAyB;IAAAC,QAAA,eAEvD,IAAAzC,WAAA,CAAAO,GAAA,EAACN,aAAa;MACbC,kBAAkB,EAAG4B,iBAAmB;MACxC3B,QAAQ,EAAG6B;IAAkB,CAC7B;EAAC,CACQ,CAAC;AAEd;AAEe,SAASU,kBAAkBA,CAAA,EAAG;EAC5C,MAAM;IAAEzB;EAAS,CAAC,GAAG,IAAAE,eAAS,EAAIC,MAAM,IAAM;IAC7C,MAAM;MAAEC;IAAmB,CAAC,GAAGD,MAAM,CAAEG,YAAY,CAAC;IACpD,OAAO;MACNN,QAAQ,EAAEI,kBAAkB,CAAC;IAC9B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IACC,CAAE,CAAEmB,kCAAuB,EAAEG,6BAAkB,CAAE,CAACC,QAAQ,CAAE3B,QAAS,CAAC,EACrE;IACD,OAAO,IAAI;EACZ;EAEA,oBAAO,IAAAjB,WAAA,CAAAO,GAAA,EAACQ,aAAa,IAAE,CAAC;AACzB","ignoreList":[]}
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = PostTrash;
7
- var _react = require("react");
8
7
  var _i18n = require("@wordpress/i18n");
9
8
  var _components = require("@wordpress/components");
10
9
  var _data = require("@wordpress/data");
11
10
  var _element = require("@wordpress/element");
12
11
  var _store = require("../../store");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
13
  /**
14
14
  * WordPress dependencies
15
15
  */
@@ -42,19 +42,23 @@ function PostTrash() {
42
42
  setShowConfirmDialog(false);
43
43
  trashPost();
44
44
  };
45
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.Button, {
46
- __next40pxDefaultSize: true,
47
- className: "editor-post-trash",
48
- isDestructive: true,
49
- variant: "secondary",
50
- isBusy: isDeleting,
51
- "aria-disabled": isDeleting,
52
- onClick: isDeleting ? undefined : () => setShowConfirmDialog(true)
53
- }, (0, _i18n.__)('Move to trash')), (0, _react.createElement)(_components.__experimentalConfirmDialog, {
54
- isOpen: showConfirmDialog,
55
- onConfirm: handleConfirm,
56
- onCancel: () => setShowConfirmDialog(false),
57
- confirmButtonText: (0, _i18n.__)('Move to trash')
58
- }, (0, _i18n.__)('Are you sure you want to move this post to the trash?')));
45
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
46
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
47
+ __next40pxDefaultSize: true,
48
+ className: "editor-post-trash",
49
+ isDestructive: true,
50
+ variant: "secondary",
51
+ isBusy: isDeleting,
52
+ "aria-disabled": isDeleting,
53
+ onClick: isDeleting ? undefined : () => setShowConfirmDialog(true),
54
+ children: (0, _i18n.__)('Move to trash')
55
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalConfirmDialog, {
56
+ isOpen: showConfirmDialog,
57
+ onConfirm: handleConfirm,
58
+ onCancel: () => setShowConfirmDialog(false),
59
+ confirmButtonText: (0, _i18n.__)('Move to trash'),
60
+ children: (0, _i18n.__)('Are you sure you want to move this post to the trash?')
61
+ })]
62
+ });
59
63
  }
60
64
  //# sourceMappingURL=index.js.map