@wordpress/editor 14.8.8 → 14.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/bindings/api.js +0 -29
  3. package/build/bindings/api.js.map +1 -1
  4. package/build/components/autocompleters/user.js.map +1 -1
  5. package/build/components/block-manager/index.js +2 -2
  6. package/build/components/block-manager/index.js.map +1 -1
  7. package/build/components/block-settings-menu/content-only-settings-menu.js +15 -18
  8. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  9. package/build/components/commands/index.js.map +1 -1
  10. package/build/components/create-template-part-modal/index.js.map +1 -1
  11. package/build/components/create-template-part-modal/utils.js.map +1 -1
  12. package/build/components/document-outline/index.js.map +1 -1
  13. package/build/components/document-outline/item.js.map +1 -1
  14. package/build/components/document-tools/index.js +2 -7
  15. package/build/components/document-tools/index.js.map +1 -1
  16. package/build/components/entities-saved-states/index.js +1 -1
  17. package/build/components/entities-saved-states/index.js.map +1 -1
  18. package/build/components/header/index.js +19 -16
  19. package/build/components/header/index.js.map +1 -1
  20. package/build/components/inserter-sidebar/index.js +8 -9
  21. package/build/components/inserter-sidebar/index.js.map +1 -1
  22. package/build/components/media-categories/index.js.map +1 -1
  23. package/build/components/page-attributes/parent.js +1 -1
  24. package/build/components/page-attributes/parent.js.map +1 -1
  25. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  26. package/build/components/post-actions/index.js.map +1 -1
  27. package/build/components/post-content-information/index.js +1 -1
  28. package/build/components/post-content-information/index.js.map +1 -1
  29. package/build/components/post-featured-image/index.js.map +1 -1
  30. package/build/components/post-format/index.js +1 -1
  31. package/build/components/post-format/index.js.map +1 -1
  32. package/build/components/post-last-revision/index.js +1 -1
  33. package/build/components/post-last-revision/index.js.map +1 -1
  34. package/build/components/post-locked-modal/index.js +2 -2
  35. package/build/components/post-locked-modal/index.js.map +1 -1
  36. package/build/components/post-preview-button/index.js +1 -1
  37. package/build/components/post-preview-button/index.js.map +1 -1
  38. package/build/components/post-publish-button/index.js.map +1 -1
  39. package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -1
  40. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  41. package/build/components/post-publish-panel/maybe-upload-media.js +1 -0
  42. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  43. package/build/components/post-publish-panel/media-util.js +1 -0
  44. package/build/components/post-publish-panel/media-util.js.map +1 -1
  45. package/build/components/post-publish-panel/postpublish.js +1 -1
  46. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  47. package/build/components/post-schedule/label.js.map +1 -1
  48. package/build/components/post-taxonomies/flat-term-selector.js +4 -4
  49. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  50. package/build/components/post-taxonomies/hierarchical-term-selector.js +3 -2
  51. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  52. package/build/components/post-taxonomies/index.js +1 -1
  53. package/build/components/post-taxonomies/index.js.map +1 -1
  54. package/build/components/post-taxonomies/panel.js.map +1 -1
  55. package/build/components/post-template/classic-theme.js +2 -4
  56. package/build/components/post-template/classic-theme.js.map +1 -1
  57. package/build/components/post-text-editor/index.js.map +1 -1
  58. package/build/components/post-title/index.js +15 -19
  59. package/build/components/post-title/index.js.map +1 -1
  60. package/build/components/post-title/index.native.js +2 -2
  61. package/build/components/post-title/index.native.js.map +1 -1
  62. package/build/components/post-url/index.js +76 -63
  63. package/build/components/post-url/index.js.map +1 -1
  64. package/build/components/post-url/panel.js +46 -26
  65. package/build/components/post-url/panel.js.map +1 -1
  66. package/build/components/post-visibility/index.js.map +1 -1
  67. package/build/components/preferences-modal/index.js.map +1 -1
  68. package/build/components/preview-dropdown/index.js.map +1 -1
  69. package/build/components/provider/disable-non-page-content-blocks.js +17 -18
  70. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  71. package/build/components/provider/index.js +1 -1
  72. package/build/components/provider/index.js.map +1 -1
  73. package/build/components/provider/use-post-content-blocks.js +34 -0
  74. package/build/components/provider/use-post-content-blocks.js.map +1 -0
  75. package/build/components/resizable-editor/resize-handle.js +4 -0
  76. package/build/components/resizable-editor/resize-handle.js.map +1 -1
  77. package/build/components/time-to-read/index.js +1 -1
  78. package/build/components/time-to-read/index.js.map +1 -1
  79. package/build/components/visual-editor/index.js.map +1 -1
  80. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  81. package/build/components/zoom-out-toggle/index.js +1 -1
  82. package/build/components/zoom-out-toggle/index.js.map +1 -1
  83. package/build/dataviews/actions/duplicate-template-part.js +1 -1
  84. package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
  85. package/build/dataviews/store/private-actions.js +2 -7
  86. package/build/dataviews/store/private-actions.js.map +1 -1
  87. package/build/private-apis.js +0 -1
  88. package/build/private-apis.js.map +1 -1
  89. package/build/store/actions.js +46 -6
  90. package/build/store/actions.js.map +1 -1
  91. package/build/store/constants.js +1 -0
  92. package/build/store/constants.js.map +1 -1
  93. package/build/store/local-autosave.js.map +1 -1
  94. package/build/store/private-actions.js +7 -6
  95. package/build/store/private-actions.js.map +1 -1
  96. package/build/store/private-selectors.js +3 -3
  97. package/build/store/private-selectors.js.map +1 -1
  98. package/build/store/selectors.js +21 -0
  99. package/build/store/selectors.js.map +1 -1
  100. package/build/utils/media-upload/index.js.map +1 -1
  101. package/build-module/bindings/api.js +1 -29
  102. package/build-module/bindings/api.js.map +1 -1
  103. package/build-module/components/autocompleters/user.js +1 -3
  104. package/build-module/components/autocompleters/user.js.map +1 -1
  105. package/build-module/components/block-manager/category.js +1 -2
  106. package/build-module/components/block-manager/category.js.map +1 -1
  107. package/build-module/components/block-manager/checklist.js +1 -2
  108. package/build-module/components/block-manager/checklist.js.map +1 -1
  109. package/build-module/components/block-manager/index.js +3 -4
  110. package/build-module/components/block-manager/index.js.map +1 -1
  111. package/build-module/components/block-settings-menu/content-only-settings-menu.js +15 -21
  112. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  113. package/build-module/components/blog-title/index.js +1 -3
  114. package/build-module/components/blog-title/index.js.map +1 -1
  115. package/build-module/components/collapsible-block-toolbar/index.js +1 -3
  116. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  117. package/build-module/components/commands/index.js.map +1 -1
  118. package/build-module/components/create-template-part-modal/index.js +1 -2
  119. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  120. package/build-module/components/create-template-part-modal/utils.js.map +1 -1
  121. package/build-module/components/document-bar/index.js +1 -2
  122. package/build-module/components/document-bar/index.js.map +1 -1
  123. package/build-module/components/document-outline/index.js +1 -2
  124. package/build-module/components/document-outline/index.js.map +1 -1
  125. package/build-module/components/document-outline/item.js +1 -2
  126. package/build-module/components/document-outline/item.js.map +1 -1
  127. package/build-module/components/document-tools/index.js +3 -10
  128. package/build-module/components/document-tools/index.js.map +1 -1
  129. package/build-module/components/editor/index.js +1 -3
  130. package/build-module/components/editor/index.js.map +1 -1
  131. package/build-module/components/editor-help/add-blocks.native.js +1 -3
  132. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  133. package/build-module/components/editor-help/customize-blocks.native.js +1 -3
  134. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  135. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +1 -2
  136. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  137. package/build-module/components/editor-help/index.native.js +1 -3
  138. package/build-module/components/editor-help/index.native.js.map +1 -1
  139. package/build-module/components/editor-help/intro-to-blocks.native.js +1 -3
  140. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  141. package/build-module/components/editor-help/move-blocks.native.js +1 -3
  142. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  143. package/build-module/components/editor-help/remove-blocks.native.js +1 -3
  144. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  145. package/build-module/components/editor-help/view-sections.native.js +1 -2
  146. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  147. package/build-module/components/editor-interface/index.js +1 -3
  148. package/build-module/components/editor-interface/index.js.map +1 -1
  149. package/build-module/components/editor-notices/index.js +1 -3
  150. package/build-module/components/editor-notices/index.js.map +1 -1
  151. package/build-module/components/entities-saved-states/entity-record-item.js +1 -3
  152. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  153. package/build-module/components/entities-saved-states/entity-type-list.js +1 -2
  154. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  155. package/build-module/components/entities-saved-states/index.js +2 -3
  156. package/build-module/components/entities-saved-states/index.js.map +1 -1
  157. package/build-module/components/error-boundary/index.native.js +1 -2
  158. package/build-module/components/error-boundary/index.native.js.map +1 -1
  159. package/build-module/components/header/index.js +20 -18
  160. package/build-module/components/header/index.js.map +1 -1
  161. package/build-module/components/inserter-sidebar/index.js +8 -9
  162. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  163. package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
  164. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  165. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -3
  166. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  167. package/build-module/components/list-view-sidebar/list-view-outline.js +1 -3
  168. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  169. package/build-module/components/media-categories/index.js.map +1 -1
  170. package/build-module/components/more-menu/index.js +1 -3
  171. package/build-module/components/more-menu/index.js.map +1 -1
  172. package/build-module/components/offline-status/index.native.js +1 -2
  173. package/build-module/components/offline-status/index.native.js.map +1 -1
  174. package/build-module/components/page-attributes/parent.js +2 -3
  175. package/build-module/components/page-attributes/parent.js.map +1 -1
  176. package/build-module/components/plugin-document-setting-panel/index.js +1 -3
  177. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  178. package/build-module/components/post-actions/index.js +1 -3
  179. package/build-module/components/post-actions/index.js.map +1 -1
  180. package/build-module/components/post-author/panel.js +1 -2
  181. package/build-module/components/post-author/panel.js.map +1 -1
  182. package/build-module/components/post-card-panel/index.js +1 -2
  183. package/build-module/components/post-card-panel/index.js.map +1 -1
  184. package/build-module/components/post-content-information/index.js +1 -1
  185. package/build-module/components/post-content-information/index.js.map +1 -1
  186. package/build-module/components/post-discussion/panel.js +1 -2
  187. package/build-module/components/post-discussion/panel.js.map +1 -1
  188. package/build-module/components/post-excerpt/panel.js +1 -3
  189. package/build-module/components/post-excerpt/panel.js.map +1 -1
  190. package/build-module/components/post-featured-image/index.js +1 -2
  191. package/build-module/components/post-featured-image/index.js.map +1 -1
  192. package/build-module/components/post-format/index.js +2 -3
  193. package/build-module/components/post-format/index.js.map +1 -1
  194. package/build-module/components/post-format/panel.js +1 -2
  195. package/build-module/components/post-format/panel.js.map +1 -1
  196. package/build-module/components/post-last-revision/index.js +1 -1
  197. package/build-module/components/post-last-revision/index.js.map +1 -1
  198. package/build-module/components/post-locked-modal/index.js +3 -5
  199. package/build-module/components/post-locked-modal/index.js.map +1 -1
  200. package/build-module/components/post-panel-row/index.js +1 -2
  201. package/build-module/components/post-panel-row/index.js.map +1 -1
  202. package/build-module/components/post-preview-button/index.js +2 -4
  203. package/build-module/components/post-preview-button/index.js.map +1 -1
  204. package/build-module/components/post-publish-button/index.js +1 -2
  205. package/build-module/components/post-publish-button/index.js.map +1 -1
  206. package/build-module/components/post-publish-panel/index.js +1 -3
  207. package/build-module/components/post-publish-panel/index.js.map +1 -1
  208. package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -2
  209. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  210. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -3
  211. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  212. package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -2
  213. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  214. package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -2
  215. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  216. package/build-module/components/post-publish-panel/media-util.js +1 -0
  217. package/build-module/components/post-publish-panel/media-util.js.map +1 -1
  218. package/build-module/components/post-publish-panel/postpublish.js +2 -4
  219. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  220. package/build-module/components/post-publish-panel/prepublish.js +1 -3
  221. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  222. package/build-module/components/post-saved-state/index.js +1 -2
  223. package/build-module/components/post-saved-state/index.js.map +1 -1
  224. package/build-module/components/post-schedule/label.js.map +1 -1
  225. package/build-module/components/post-status/index.js +1 -3
  226. package/build-module/components/post-status/index.js.map +1 -1
  227. package/build-module/components/post-switch-to-draft-button/index.js +1 -3
  228. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  229. package/build-module/components/post-taxonomies/flat-term-selector.js +5 -7
  230. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  231. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -4
  232. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  233. package/build-module/components/post-taxonomies/index.js +1 -1
  234. package/build-module/components/post-taxonomies/index.js.map +1 -1
  235. package/build-module/components/post-taxonomies/most-used-terms.js +1 -2
  236. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  237. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  238. package/build-module/components/post-template/block-theme.js +1 -3
  239. package/build-module/components/post-template/block-theme.js.map +1 -1
  240. package/build-module/components/post-template/classic-theme.js +3 -6
  241. package/build-module/components/post-template/classic-theme.js.map +1 -1
  242. package/build-module/components/post-template/create-new-template-modal.js +1 -2
  243. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  244. package/build-module/components/post-template/create-new-template.js +1 -3
  245. package/build-module/components/post-template/create-new-template.js.map +1 -1
  246. package/build-module/components/post-template/swap-template-button.js +1 -3
  247. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  248. package/build-module/components/post-text-editor/index.js +1 -3
  249. package/build-module/components/post-text-editor/index.js.map +1 -1
  250. package/build-module/components/post-title/index.js +15 -19
  251. package/build-module/components/post-title/index.js.map +1 -1
  252. package/build-module/components/post-title/index.native.js +2 -2
  253. package/build-module/components/post-title/index.native.js.map +1 -1
  254. package/build-module/components/post-trash/index.js +1 -2
  255. package/build-module/components/post-trash/index.js.map +1 -1
  256. package/build-module/components/post-url/index.js +78 -66
  257. package/build-module/components/post-url/index.js.map +1 -1
  258. package/build-module/components/post-url/panel.js +48 -28
  259. package/build-module/components/post-url/panel.js.map +1 -1
  260. package/build-module/components/post-visibility/index.js +1 -2
  261. package/build-module/components/post-visibility/index.js.map +1 -1
  262. package/build-module/components/posts-per-page/index.js +1 -3
  263. package/build-module/components/posts-per-page/index.js.map +1 -1
  264. package/build-module/components/preferences-modal/index.js +1 -3
  265. package/build-module/components/preferences-modal/index.js.map +1 -1
  266. package/build-module/components/preview-dropdown/index.js +1 -3
  267. package/build-module/components/preview-dropdown/index.js.map +1 -1
  268. package/build-module/components/provider/disable-non-page-content-blocks.js +17 -18
  269. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  270. package/build-module/components/provider/index.js +2 -4
  271. package/build-module/components/provider/index.js.map +1 -1
  272. package/build-module/components/provider/index.native.js +1 -3
  273. package/build-module/components/provider/index.native.js.map +1 -1
  274. package/build-module/components/provider/use-post-content-blocks.js +27 -0
  275. package/build-module/components/provider/use-post-content-blocks.js.map +1 -0
  276. package/build-module/components/resizable-editor/resize-handle.js +5 -3
  277. package/build-module/components/resizable-editor/resize-handle.js.map +1 -1
  278. package/build-module/components/save-publish-panels/index.js +1 -3
  279. package/build-module/components/save-publish-panels/index.js.map +1 -1
  280. package/build-module/components/sidebar/header.js +1 -2
  281. package/build-module/components/sidebar/header.js.map +1 -1
  282. package/build-module/components/sidebar/index.js +1 -2
  283. package/build-module/components/sidebar/index.js.map +1 -1
  284. package/build-module/components/sidebar/post-summary.js +1 -3
  285. package/build-module/components/sidebar/post-summary.js.map +1 -1
  286. package/build-module/components/site-discussion/index.js +1 -3
  287. package/build-module/components/site-discussion/index.js.map +1 -1
  288. package/build-module/components/start-template-options/index.js +1 -2
  289. package/build-module/components/start-template-options/index.js.map +1 -1
  290. package/build-module/components/table-of-contents/panel.js +1 -3
  291. package/build-module/components/table-of-contents/panel.js.map +1 -1
  292. package/build-module/components/template-part-menu-items/convert-to-template-part.js +1 -3
  293. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
  294. package/build-module/components/template-validation-notice/index.js +1 -3
  295. package/build-module/components/template-validation-notice/index.js.map +1 -1
  296. package/build-module/components/text-editor/index.js +1 -2
  297. package/build-module/components/text-editor/index.js.map +1 -1
  298. package/build-module/components/time-to-read/index.js +1 -1
  299. package/build-module/components/time-to-read/index.js.map +1 -1
  300. package/build-module/components/visual-editor/index.js +1 -3
  301. package/build-module/components/visual-editor/index.js.map +1 -1
  302. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  303. package/build-module/components/zoom-out-toggle/index.js +1 -1
  304. package/build-module/components/zoom-out-toggle/index.js.map +1 -1
  305. package/build-module/dataviews/actions/duplicate-template-part.js +1 -1
  306. package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
  307. package/build-module/dataviews/store/private-actions.js +4 -8
  308. package/build-module/dataviews/store/private-actions.js.map +1 -1
  309. package/build-module/hooks/pattern-overrides.js +1 -3
  310. package/build-module/hooks/pattern-overrides.js.map +1 -1
  311. package/build-module/private-apis.js +1 -2
  312. package/build-module/private-apis.js.map +1 -1
  313. package/build-module/store/actions.js +44 -6
  314. package/build-module/store/actions.js.map +1 -1
  315. package/build-module/store/constants.js +1 -0
  316. package/build-module/store/constants.js.map +1 -1
  317. package/build-module/store/local-autosave.js.map +1 -1
  318. package/build-module/store/private-actions.js +7 -6
  319. package/build-module/store/private-actions.js.map +1 -1
  320. package/build-module/store/private-selectors.js +2 -2
  321. package/build-module/store/private-selectors.js.map +1 -1
  322. package/build-module/store/selectors.js +21 -0
  323. package/build-module/store/selectors.js.map +1 -1
  324. package/build-module/utils/media-upload/index.js.map +1 -1
  325. package/build-style/style-rtl.css +29 -6
  326. package/build-style/style.css +29 -6
  327. package/build-types/bindings/api.d.ts +0 -13
  328. package/build-types/bindings/api.d.ts.map +1 -1
  329. package/build-types/components/document-tools/index.d.ts.map +1 -1
  330. package/build-types/components/header/index.d.ts.map +1 -1
  331. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  332. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  333. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  334. package/build-types/components/post-url/index.d.ts.map +1 -1
  335. package/build-types/components/post-url/panel.d.ts.map +1 -1
  336. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
  337. package/build-types/components/provider/index.d.ts.map +1 -1
  338. package/build-types/components/provider/use-post-content-blocks.d.ts +2 -0
  339. package/build-types/components/provider/use-post-content-blocks.d.ts.map +1 -0
  340. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
  341. package/build-types/private-apis.d.ts.map +1 -1
  342. package/build-types/store/actions.d.ts +2 -17
  343. package/build-types/store/actions.d.ts.map +1 -1
  344. package/build-types/store/private-selectors.d.ts +2 -2
  345. package/build-types/store/private-selectors.d.ts.map +1 -1
  346. package/build-types/store/selectors.d.ts +21 -0
  347. package/build-types/store/selectors.d.ts.map +1 -1
  348. package/package.json +38 -38
  349. package/src/bindings/api.js +1 -32
  350. package/src/components/block-settings-menu/content-only-settings-menu.js +19 -19
  351. package/src/components/document-tools/index.js +2 -5
  352. package/src/components/header/index.js +24 -13
  353. package/src/components/inserter-sidebar/index.js +8 -11
  354. package/src/components/post-saved-state/test/__snapshots__/index.js.snap +1 -1
  355. package/src/components/post-taxonomies/hierarchical-term-selector.js +1 -0
  356. package/src/components/post-template/classic-theme.js +1 -2
  357. package/src/components/post-url/index.js +67 -55
  358. package/src/components/post-url/panel.js +57 -33
  359. package/src/components/post-url/style.scss +21 -3
  360. package/src/components/provider/disable-non-page-content-blocks.js +20 -34
  361. package/src/components/provider/index.js +1 -0
  362. package/src/components/provider/use-post-content-blocks.js +42 -0
  363. package/src/components/resizable-editor/resize-handle.js +5 -0
  364. package/src/components/zoom-out-toggle/index.js +1 -1
  365. package/src/dataviews/store/private-actions.ts +7 -7
  366. package/src/private-apis.js +1 -5
  367. package/src/store/actions.js +51 -7
  368. package/src/store/private-selectors.js +2 -2
  369. package/src/store/selectors.js +21 -0
  370. package/src/store/test/actions.js +76 -0
  371. package/src/store/test/reducer.js +0 -22
  372. package/tsconfig.tsbuildinfo +1 -1
  373. package/build/dataviews/actions/delete-post.js +0 -98
  374. package/build/dataviews/actions/delete-post.js.map +0 -1
  375. package/build/dataviews/actions/rename-post.js +0 -125
  376. package/build/dataviews/actions/rename-post.js.map +0 -1
  377. package/build/dataviews/actions/reset-post.js +0 -113
  378. package/build/dataviews/actions/reset-post.js.map +0 -1
  379. package/build/dataviews/actions/restore-post.js +0 -112
  380. package/build/dataviews/actions/restore-post.js.map +0 -1
  381. package/build/dataviews/actions/trash-post.js +0 -144
  382. package/build/dataviews/actions/trash-post.js.map +0 -1
  383. package/build/dataviews/fields/index.js +0 -32
  384. package/build/dataviews/fields/index.js.map +0 -1
  385. package/build-module/dataviews/actions/delete-post.js +0 -89
  386. package/build-module/dataviews/actions/delete-post.js.map +0 -1
  387. package/build-module/dataviews/actions/rename-post.js +0 -118
  388. package/build-module/dataviews/actions/rename-post.js.map +0 -1
  389. package/build-module/dataviews/actions/reset-post.js +0 -106
  390. package/build-module/dataviews/actions/reset-post.js.map +0 -1
  391. package/build-module/dataviews/actions/restore-post.js +0 -104
  392. package/build-module/dataviews/actions/restore-post.js.map +0 -1
  393. package/build-module/dataviews/actions/trash-post.js +0 -137
  394. package/build-module/dataviews/actions/trash-post.js.map +0 -1
  395. package/build-module/dataviews/fields/index.js +0 -26
  396. package/build-module/dataviews/fields/index.js.map +0 -1
  397. package/build-types/dataviews/actions/delete-post.d.ts +0 -5
  398. package/build-types/dataviews/actions/delete-post.d.ts.map +0 -1
  399. package/build-types/dataviews/actions/rename-post.d.ts +0 -5
  400. package/build-types/dataviews/actions/rename-post.d.ts.map +0 -1
  401. package/build-types/dataviews/actions/reset-post.d.ts +0 -5
  402. package/build-types/dataviews/actions/reset-post.d.ts.map +0 -1
  403. package/build-types/dataviews/actions/restore-post.d.ts +0 -5
  404. package/build-types/dataviews/actions/restore-post.d.ts.map +0 -1
  405. package/build-types/dataviews/actions/trash-post.d.ts +0 -5
  406. package/build-types/dataviews/actions/trash-post.d.ts.map +0 -1
  407. package/build-types/dataviews/fields/index.d.ts +0 -8
  408. package/build-types/dataviews/fields/index.d.ts.map +0 -1
  409. package/src/dataviews/actions/delete-post.tsx +0 -109
  410. package/src/dataviews/actions/rename-post.tsx +0 -146
  411. package/src/dataviews/actions/reset-post.tsx +0 -147
  412. package/src/dataviews/actions/restore-post.tsx +0 -134
  413. package/src/dataviews/actions/trash-post.tsx +0 -198
  414. package/src/dataviews/fields/index.ts +0 -26
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_element","_notices","_components","_data","_compose","_coreData","_a11y","_htmlEntities","_terms","_store","_jsxRuntime","DEFAULT_QUERY","per_page","orderby","order","_fields","context","MIN_TERMS_COUNT_FOR_FILTER","EMPTY_ARRAY","sortBySelected","termsTree","terms","treeHasSelection","termTree","indexOf","id","undefined","children","map","filter","child","length","termOrChildIsSelected","termA","termB","termASelected","termBSelected","newTermTree","sort","findTerm","parent","name","find","term","parseInt","toLowerCase","getFilterMatcher","filterValue","matchTermsForFilter","originalTerm","HierarchicalTermSelector","slug","_taxonomy$labels$sear","_taxonomy$name","adding","setAdding","useState","formName","setFormName","formParent","setFormParent","showForm","setShowForm","setFilterValue","filteredTermsTree","setFilteredTermsTree","debouncedSpeak","useDebounce","speak","hasCreateAction","hasAssignAction","loading","availableTerms","taxonomy","useSelect","select","_post$_links","_post$_links2","getCurrentPost","getEditedPostAttribute","editorStore","getTaxonomy","getEntityRecords","isResolving","coreStore","_taxonomy","post","_links","rest_base","editPost","useDispatch","saveEntityRecord","availableTermsTree","useMemo","buildTermsTree","createErrorNotice","noticesStore","addTerm","throwOnError","onUpdateTerms","termIds","onChange","termId","hasTerm","includes","newTerms","onChangeFormName","value","onChangeFormParent","parentId","onToggleForm","onAddTerm","event","_taxonomy$labels$sing","preventDefault","existingTerm","some","newTerm","error","message","type","defaultName","__","termAddedMessage","sprintf","_x","labels","singular_name","setFilter","newFilteredTermsTree","getResultCount","count","i","resultCount","resultsFoundMessage","_n","renderTerms","renderedTerms","jsxs","className","jsx","CheckboxControl","__nextHasNoMarginBottom","checked","label","decodeEntities","labelWithFallback","labelProperty","fallbackIsCategory","fallbackIsNotCategory","_taxonomy$labels$labe","newTermButtonLabel","newTermLabel","parentSelectLabel","noParentOption","newTermSubmitLabel","filterLabel","search_items","groupLabel","showFilter","Flex","direction","gap","SearchControl","__next40pxDefaultSize","tabIndex","role","FlexItem","Button","onClick","variant","onSubmit","TextControl","required","TreeSelect","noOptionLabel","selectedId","tree","_default","exports","default","withFilters"],"sources":["@wordpress/editor/src/components/post-taxonomies/hierarchical-term-selector.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _n, _x, sprintf } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport {\n\tButton,\n\tCheckboxControl,\n\tTextControl,\n\tTreeSelect,\n\twithFilters,\n\tFlex,\n\tFlexItem,\n\tSearchControl,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useDebounce } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { buildTermsTree } from '../../utils/terms';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module Constants\n */\nconst DEFAULT_QUERY = {\n\tper_page: -1,\n\torderby: 'name',\n\torder: 'asc',\n\t_fields: 'id,name,parent',\n\tcontext: 'view',\n};\n\nconst MIN_TERMS_COUNT_FOR_FILTER = 8;\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Sort Terms by Selected.\n *\n * @param {Object[]} termsTree Array of terms in tree format.\n * @param {number[]} terms Selected terms.\n *\n * @return {Object[]} Sorted array of terms.\n */\nexport function sortBySelected( termsTree, terms ) {\n\tconst treeHasSelection = ( termTree ) => {\n\t\tif ( terms.indexOf( termTree.id ) !== -1 ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( undefined === termTree.children ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (\n\t\t\ttermTree.children\n\t\t\t\t.map( treeHasSelection )\n\t\t\t\t.filter( ( child ) => child ).length > 0\n\t\t);\n\t};\n\tconst termOrChildIsSelected = ( termA, termB ) => {\n\t\tconst termASelected = treeHasSelection( termA );\n\t\tconst termBSelected = treeHasSelection( termB );\n\n\t\tif ( termASelected === termBSelected ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif ( termASelected && ! termBSelected ) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif ( ! termASelected && termBSelected ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn 0;\n\t};\n\tconst newTermTree = [ ...termsTree ];\n\tnewTermTree.sort( termOrChildIsSelected );\n\treturn newTermTree;\n}\n\n/**\n * Find term by parent id or name.\n *\n * @param {Object[]} terms Array of Terms.\n * @param {number|string} parent id.\n * @param {string} name Term name.\n * @return {Object} Term object.\n */\nexport function findTerm( terms, parent, name ) {\n\treturn terms.find( ( term ) => {\n\t\treturn (\n\t\t\t( ( ! term.parent && ! parent ) ||\n\t\t\t\tparseInt( term.parent ) === parseInt( parent ) ) &&\n\t\t\tterm.name.toLowerCase() === name.toLowerCase()\n\t\t);\n\t} );\n}\n\n/**\n * Get filter matcher function.\n *\n * @param {string} filterValue Filter value.\n * @return {(function(Object): (Object|boolean))} Matcher function.\n */\nexport function getFilterMatcher( filterValue ) {\n\tconst matchTermsForFilter = ( originalTerm ) => {\n\t\tif ( '' === filterValue ) {\n\t\t\treturn originalTerm;\n\t\t}\n\n\t\t// Shallow clone, because we'll be filtering the term's children and\n\t\t// don't want to modify the original term.\n\t\tconst term = { ...originalTerm };\n\n\t\t// Map and filter the children, recursive so we deal with grandchildren\n\t\t// and any deeper levels.\n\t\tif ( term.children.length > 0 ) {\n\t\t\tterm.children = term.children\n\t\t\t\t.map( matchTermsForFilter )\n\t\t\t\t.filter( ( child ) => child );\n\t\t}\n\n\t\t// If the term's name contains the filterValue, or it has children\n\t\t// (i.e. some child matched at some point in the tree) then return it.\n\t\tif (\n\t\t\t-1 !==\n\t\t\t\tterm.name.toLowerCase().indexOf( filterValue.toLowerCase() ) ||\n\t\t\tterm.children.length > 0\n\t\t) {\n\t\t\treturn term;\n\t\t}\n\n\t\t// Otherwise, return false. After mapping, the list of terms will need\n\t\t// to have false values filtered out.\n\t\treturn false;\n\t};\n\treturn matchTermsForFilter;\n}\n\n/**\n * Hierarchical term selector.\n *\n * @param {Object} props Component props.\n * @param {string} props.slug Taxonomy slug.\n * @return {Element} Hierarchical term selector component.\n */\nexport function HierarchicalTermSelector( { slug } ) {\n\tconst [ adding, setAdding ] = useState( false );\n\tconst [ formName, setFormName ] = useState( '' );\n\t/**\n\t * @type {[number|'', Function]}\n\t */\n\tconst [ formParent, setFormParent ] = useState( '' );\n\tconst [ showForm, setShowForm ] = useState( false );\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst [ filteredTermsTree, setFilteredTermsTree ] = useState( [] );\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\tconst {\n\t\thasCreateAction,\n\t\thasAssignAction,\n\t\tterms,\n\t\tloading,\n\t\tavailableTerms,\n\t\ttaxonomy,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPost, getEditedPostAttribute } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst { getTaxonomy, getEntityRecords, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _taxonomy = getTaxonomy( slug );\n\t\t\tconst post = getCurrentPost();\n\n\t\t\treturn {\n\t\t\t\thasCreateAction: _taxonomy\n\t\t\t\t\t? post._links?.[\n\t\t\t\t\t\t\t'wp:action-create-' + _taxonomy.rest_base\n\t\t\t\t\t ] ?? false\n\t\t\t\t\t: false,\n\t\t\t\thasAssignAction: _taxonomy\n\t\t\t\t\t? post._links?.[\n\t\t\t\t\t\t\t'wp:action-assign-' + _taxonomy.rest_base\n\t\t\t\t\t ] ?? false\n\t\t\t\t\t: false,\n\t\t\t\tterms: _taxonomy\n\t\t\t\t\t? getEditedPostAttribute( _taxonomy.rest_base )\n\t\t\t\t\t: EMPTY_ARRAY,\n\t\t\t\tloading: isResolving( 'getEntityRecords', [\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\tslug,\n\t\t\t\t\tDEFAULT_QUERY,\n\t\t\t\t] ),\n\t\t\t\tavailableTerms:\n\t\t\t\t\tgetEntityRecords( 'taxonomy', slug, DEFAULT_QUERY ) ||\n\t\t\t\t\tEMPTY_ARRAY,\n\t\t\t\ttaxonomy: _taxonomy,\n\t\t\t};\n\t\t},\n\t\t[ slug ]\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst availableTermsTree = useMemo(\n\t\t() => sortBySelected( buildTermsTree( availableTerms ), terms ),\n\t\t// Remove `terms` from the dependency list to avoid reordering every time\n\t\t// checking or unchecking a term.\n\t\t[ availableTerms ]\n\t);\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tif ( ! hasAssignAction ) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Append new term.\n\t *\n\t * @param {Object} term Term object.\n\t * @return {Promise} A promise that resolves to save term object.\n\t */\n\tconst addTerm = ( term ) => {\n\t\treturn saveEntityRecord( 'taxonomy', slug, term, {\n\t\t\tthrowOnError: true,\n\t\t} );\n\t};\n\n\t/**\n\t * Update terms for post.\n\t *\n\t * @param {number[]} termIds Term ids.\n\t */\n\tconst onUpdateTerms = ( termIds ) => {\n\t\teditPost( { [ taxonomy.rest_base ]: termIds } );\n\t};\n\n\t/**\n\t * Handler for checking term.\n\t *\n\t * @param {number} termId\n\t */\n\tconst onChange = ( termId ) => {\n\t\tconst hasTerm = terms.includes( termId );\n\t\tconst newTerms = hasTerm\n\t\t\t? terms.filter( ( id ) => id !== termId )\n\t\t\t: [ ...terms, termId ];\n\t\tonUpdateTerms( newTerms );\n\t};\n\n\tconst onChangeFormName = ( value ) => {\n\t\tsetFormName( value );\n\t};\n\n\t/**\n\t * Handler for changing form parent.\n\t *\n\t * @param {number|''} parentId Parent post id.\n\t */\n\tconst onChangeFormParent = ( parentId ) => {\n\t\tsetFormParent( parentId );\n\t};\n\n\tconst onToggleForm = () => {\n\t\tsetShowForm( ! showForm );\n\t};\n\n\tconst onAddTerm = async ( event ) => {\n\t\tevent.preventDefault();\n\t\tif ( formName === '' || adding ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if the term we are adding already exists.\n\t\tconst existingTerm = findTerm( availableTerms, formParent, formName );\n\t\tif ( existingTerm ) {\n\t\t\t// If the term we are adding exists but is not selected select it.\n\t\t\tif ( ! terms.some( ( term ) => term === existingTerm.id ) ) {\n\t\t\t\tonUpdateTerms( [ ...terms, existingTerm.id ] );\n\t\t\t}\n\n\t\t\tsetFormName( '' );\n\t\t\tsetFormParent( '' );\n\n\t\t\treturn;\n\t\t}\n\t\tsetAdding( true );\n\t\tlet newTerm;\n\t\ttry {\n\t\t\tnewTerm = await addTerm( {\n\t\t\t\tname: formName,\n\t\t\t\tparent: formParent ? formParent : undefined,\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice( error.message, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\t\tconst defaultName =\n\t\t\tslug === 'category' ? __( 'Category' ) : __( 'Term' );\n\t\tconst termAddedMessage = sprintf(\n\t\t\t/* translators: %s: taxonomy name */\n\t\t\t_x( '%s added', 'term' ),\n\t\t\ttaxonomy?.labels?.singular_name ?? defaultName\n\t\t);\n\t\tspeak( termAddedMessage, 'assertive' );\n\t\tsetAdding( false );\n\t\tsetFormName( '' );\n\t\tsetFormParent( '' );\n\t\tonUpdateTerms( [ ...terms, newTerm.id ] );\n\t};\n\n\tconst setFilter = ( value ) => {\n\t\tconst newFilteredTermsTree = availableTermsTree\n\t\t\t.map( getFilterMatcher( value ) )\n\t\t\t.filter( ( term ) => term );\n\t\tconst getResultCount = ( termsTree ) => {\n\t\t\tlet count = 0;\n\t\t\tfor ( let i = 0; i < termsTree.length; i++ ) {\n\t\t\t\tcount++;\n\t\t\t\tif ( undefined !== termsTree[ i ].children ) {\n\t\t\t\t\tcount += getResultCount( termsTree[ i ].children );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn count;\n\t\t};\n\n\t\tsetFilterValue( value );\n\t\tsetFilteredTermsTree( newFilteredTermsTree );\n\n\t\tconst resultCount = getResultCount( newFilteredTermsTree );\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results */\n\t\t\t_n( '%d result found.', '%d results found.', resultCount ),\n\t\t\tresultCount\n\t\t);\n\n\t\tdebouncedSpeak( resultsFoundMessage, 'assertive' );\n\t};\n\n\tconst renderTerms = ( renderedTerms ) => {\n\t\treturn renderedTerms.map( ( term ) => {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tkey={ term.id }\n\t\t\t\t\tclassName=\"editor-post-taxonomies__hierarchical-terms-choice\"\n\t\t\t\t>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tchecked={ terms.indexOf( term.id ) !== -1 }\n\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\tconst termId = parseInt( term.id, 10 );\n\t\t\t\t\t\t\tonChange( termId );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ decodeEntities( term.name ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ !! term.children.length && (\n\t\t\t\t\t\t<div className=\"editor-post-taxonomies__hierarchical-terms-subchoices\">\n\t\t\t\t\t\t\t{ renderTerms( term.children ) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t);\n\t\t} );\n\t};\n\n\tconst labelWithFallback = (\n\t\tlabelProperty,\n\t\tfallbackIsCategory,\n\t\tfallbackIsNotCategory\n\t) =>\n\t\ttaxonomy?.labels?.[ labelProperty ] ??\n\t\t( slug === 'category' ? fallbackIsCategory : fallbackIsNotCategory );\n\n\tconst newTermButtonLabel = labelWithFallback(\n\t\t'add_new_item',\n\t\t__( 'Add new category' ),\n\t\t__( 'Add new term' )\n\t);\n\tconst newTermLabel = labelWithFallback(\n\t\t'new_item_name',\n\t\t__( 'Add new category' ),\n\t\t__( 'Add new term' )\n\t);\n\tconst parentSelectLabel = labelWithFallback(\n\t\t'parent_item',\n\t\t__( 'Parent Category' ),\n\t\t__( 'Parent Term' )\n\t);\n\tconst noParentOption = `— ${ parentSelectLabel } —`;\n\tconst newTermSubmitLabel = newTermButtonLabel;\n\tconst filterLabel = taxonomy?.labels?.search_items ?? __( 'Search Terms' );\n\tconst groupLabel = taxonomy?.name ?? __( 'Terms' );\n\tconst showFilter = availableTerms.length >= MIN_TERMS_COUNT_FOR_FILTER;\n\n\treturn (\n\t\t<Flex direction=\"column\" gap=\"4\">\n\t\t\t{ showFilter && (\n\t\t\t\t<SearchControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ filterLabel }\n\t\t\t\t\tvalue={ filterValue }\n\t\t\t\t\tonChange={ setFilter }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<div\n\t\t\t\tclassName=\"editor-post-taxonomies__hierarchical-terms-list\"\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"group\"\n\t\t\t\taria-label={ groupLabel }\n\t\t\t>\n\t\t\t\t{ renderTerms(\n\t\t\t\t\t'' !== filterValue ? filteredTermsTree : availableTermsTree\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t{ ! loading && hasCreateAction && (\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tonClick={ onToggleForm }\n\t\t\t\t\t\tclassName=\"editor-post-taxonomies__hierarchical-terms-add\"\n\t\t\t\t\t\taria-expanded={ showForm }\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ newTermButtonLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t) }\n\t\t\t{ showForm && (\n\t\t\t\t<form onSubmit={ onAddTerm }>\n\t\t\t\t\t<Flex direction=\"column\" gap=\"4\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"editor-post-taxonomies__hierarchical-terms-input\"\n\t\t\t\t\t\t\tlabel={ newTermLabel }\n\t\t\t\t\t\t\tvalue={ formName }\n\t\t\t\t\t\t\tonChange={ onChangeFormName }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ !! availableTerms.length && (\n\t\t\t\t\t\t\t<TreeSelect\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ parentSelectLabel }\n\t\t\t\t\t\t\t\tnoOptionLabel={ noParentOption }\n\t\t\t\t\t\t\t\tonChange={ onChangeFormParent }\n\t\t\t\t\t\t\t\tselectedId={ formParent }\n\t\t\t\t\t\t\t\ttree={ availableTermsTree }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\tclassName=\"editor-post-taxonomies__hierarchical-terms-submit\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ newTermSubmitLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t</Flex>\n\t\t\t\t</form>\n\t\t\t) }\n\t\t</Flex>\n\t);\n}\n\nexport default withFilters( 'editor.PostTaxonomyType' )(\n\tHierarchicalTermSelector\n);\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAUA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAAmD,IAAAW,WAAA,GAAAX,OAAA;AA1BnD;AACA;AACA;;AAoBA;AACA;AACA;;AAIA;AACA;AACA,GACA,MAAMY,aAAa,GAAG;EACrBC,QAAQ,EAAE,CAAC,CAAC;EACZC,OAAO,EAAE,MAAM;EACfC,KAAK,EAAE,KAAK;EACZC,OAAO,EAAE,gBAAgB;EACzBC,OAAO,EAAE;AACV,CAAC;AAED,MAAMC,0BAA0B,GAAG,CAAC;AAEpC,MAAMC,WAAW,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAEC,SAAS,EAAEC,KAAK,EAAG;EA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1I,WAAA,CAAA4K,UAAU;UACVV,qBAAqB;UACrBtB,uBAAuB;UACvBE,KAAK,EAAGS,iBAAmB;UAC3BsB,aAAa,EAAGrB,cAAgB;UAChCrD,QAAQ,EAAGO,kBAAoB;UAC/BoE,UAAU,EAAGrH,UAAY;UACzBsH,IAAI,EAAGrF;QAAoB,CAC3B,CACD,eACD,IAAAlF,WAAA,CAAAkI,GAAA,EAAC1I,WAAA,CAAAqK,QAAQ;UAAA5I,QAAA,eACR,IAAAjB,WAAA,CAAAkI,GAAA,EAAC1I,WAAA,CAAAsK,MAAM;YACNJ,qBAAqB;YACrBM,OAAO,EAAC,WAAW;YACnBlD,IAAI,EAAC,QAAQ;YACbmB,SAAS,EAAC,mDAAmD;YAAAhH,QAAA,EAE3DgI;UAAkB,CACb;QAAC,CACA,CAAC;MAAA,CACN;IAAC,CACF,CACN;EAAA,CACI,CAAC;AAET;AAAC,IAAAuB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,uBAAW,EAAE,yBAA0B,CAAC,CACtDnI,wBACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_element","_notices","_components","_data","_compose","_coreData","_a11y","_htmlEntities","_terms","_store","_jsxRuntime","DEFAULT_QUERY","per_page","orderby","order","_fields","context","MIN_TERMS_COUNT_FOR_FILTER","EMPTY_ARRAY","sortBySelected","termsTree","terms","treeHasSelection","termTree","indexOf","id","undefined","children","map","filter","child","length","termOrChildIsSelected","termA","termB","termASelected","termBSelected","newTermTree","sort","findTerm","parent","name","find","term","parseInt","toLowerCase","getFilterMatcher","filterValue","matchTermsForFilter","originalTerm","HierarchicalTermSelector","slug","_taxonomy$labels$sear","_taxonomy$name","adding","setAdding","useState","formName","setFormName","formParent","setFormParent","showForm","setShowForm","setFilterValue","filteredTermsTree","setFilteredTermsTree","debouncedSpeak","useDebounce","speak","hasCreateAction","hasAssignAction","loading","availableTerms","taxonomy","useSelect","select","_post$_links","_post$_links2","getCurrentPost","getEditedPostAttribute","editorStore","getTaxonomy","getEntityRecords","isResolving","coreStore","_taxonomy","post","_links","rest_base","editPost","useDispatch","saveEntityRecord","availableTermsTree","useMemo","buildTermsTree","createErrorNotice","noticesStore","addTerm","throwOnError","onUpdateTerms","termIds","onChange","termId","hasTerm","includes","newTerms","onChangeFormName","value","onChangeFormParent","parentId","onToggleForm","onAddTerm","event","_taxonomy$labels$sing","preventDefault","existingTerm","some","newTerm","error","message","type","defaultName","__","termAddedMessage","sprintf","_x","labels","singular_name","setFilter","newFilteredTermsTree","getResultCount","count","i","resultCount","resultsFoundMessage","_n","renderTerms","renderedTerms","jsxs","className","jsx","CheckboxControl","__nextHasNoMarginBottom","checked","label","decodeEntities","labelWithFallback","labelProperty","fallbackIsCategory","fallbackIsNotCategory","_taxonomy$labels$labe","newTermButtonLabel","newTermLabel","parentSelectLabel","noParentOption","newTermSubmitLabel","filterLabel","search_items","groupLabel","showFilter","Flex","direction","gap","SearchControl","__next40pxDefaultSize","placeholder","tabIndex","role","FlexItem","Button","onClick","variant","onSubmit","TextControl","required","TreeSelect","noOptionLabel","selectedId","tree","_default","exports","default","withFilters"],"sources":["@wordpress/editor/src/components/post-taxonomies/hierarchical-term-selector.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _n, _x, sprintf } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport {\n\tButton,\n\tCheckboxControl,\n\tTextControl,\n\tTreeSelect,\n\twithFilters,\n\tFlex,\n\tFlexItem,\n\tSearchControl,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useDebounce } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { buildTermsTree } from '../../utils/terms';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module Constants\n */\nconst DEFAULT_QUERY = {\n\tper_page: -1,\n\torderby: 'name',\n\torder: 'asc',\n\t_fields: 'id,name,parent',\n\tcontext: 'view',\n};\n\nconst MIN_TERMS_COUNT_FOR_FILTER = 8;\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Sort Terms by Selected.\n *\n * @param {Object[]} termsTree Array of terms in tree format.\n * @param {number[]} terms Selected terms.\n *\n * @return {Object[]} Sorted array of terms.\n */\nexport function sortBySelected( termsTree, terms ) {\n\tconst treeHasSelection = ( termTree ) => {\n\t\tif ( terms.indexOf( termTree.id ) !== -1 ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( undefined === termTree.children ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (\n\t\t\ttermTree.children\n\t\t\t\t.map( treeHasSelection )\n\t\t\t\t.filter( ( child ) => child ).length > 0\n\t\t);\n\t};\n\tconst termOrChildIsSelected = ( termA, termB ) => {\n\t\tconst termASelected = treeHasSelection( termA );\n\t\tconst termBSelected = treeHasSelection( termB );\n\n\t\tif ( termASelected === termBSelected ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif ( termASelected && ! termBSelected ) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif ( ! termASelected && termBSelected ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn 0;\n\t};\n\tconst newTermTree = [ ...termsTree ];\n\tnewTermTree.sort( termOrChildIsSelected );\n\treturn newTermTree;\n}\n\n/**\n * Find term by parent id or name.\n *\n * @param {Object[]} terms Array of Terms.\n * @param {number|string} parent id.\n * @param {string} name Term name.\n * @return {Object} Term object.\n */\nexport function findTerm( terms, parent, name ) {\n\treturn terms.find( ( term ) => {\n\t\treturn (\n\t\t\t( ( ! term.parent && ! parent ) ||\n\t\t\t\tparseInt( term.parent ) === parseInt( parent ) ) &&\n\t\t\tterm.name.toLowerCase() === name.toLowerCase()\n\t\t);\n\t} );\n}\n\n/**\n * Get filter matcher function.\n *\n * @param {string} filterValue Filter value.\n * @return {(function(Object): (Object|boolean))} Matcher function.\n */\nexport function getFilterMatcher( filterValue ) {\n\tconst matchTermsForFilter = ( originalTerm ) => {\n\t\tif ( '' === filterValue ) {\n\t\t\treturn originalTerm;\n\t\t}\n\n\t\t// Shallow clone, because we'll be filtering the term's children and\n\t\t// don't want to modify the original term.\n\t\tconst term = { ...originalTerm };\n\n\t\t// Map and filter the children, recursive so we deal with grandchildren\n\t\t// and any deeper levels.\n\t\tif ( term.children.length > 0 ) {\n\t\t\tterm.children = term.children\n\t\t\t\t.map( matchTermsForFilter )\n\t\t\t\t.filter( ( child ) => child );\n\t\t}\n\n\t\t// If the term's name contains the filterValue, or it has children\n\t\t// (i.e. some child matched at some point in the tree) then return it.\n\t\tif (\n\t\t\t-1 !==\n\t\t\t\tterm.name.toLowerCase().indexOf( filterValue.toLowerCase() ) ||\n\t\t\tterm.children.length > 0\n\t\t) {\n\t\t\treturn term;\n\t\t}\n\n\t\t// Otherwise, return false. After mapping, the list of terms will need\n\t\t// to have false values filtered out.\n\t\treturn false;\n\t};\n\treturn matchTermsForFilter;\n}\n\n/**\n * Hierarchical term selector.\n *\n * @param {Object} props Component props.\n * @param {string} props.slug Taxonomy slug.\n * @return {Element} Hierarchical term selector component.\n */\nexport function HierarchicalTermSelector( { slug } ) {\n\tconst [ adding, setAdding ] = useState( false );\n\tconst [ formName, setFormName ] = useState( '' );\n\t/**\n\t * @type {[number|'', Function]}\n\t */\n\tconst [ formParent, setFormParent ] = useState( '' );\n\tconst [ showForm, setShowForm ] = useState( false );\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst [ filteredTermsTree, setFilteredTermsTree ] = useState( [] );\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\tconst {\n\t\thasCreateAction,\n\t\thasAssignAction,\n\t\tterms,\n\t\tloading,\n\t\tavailableTerms,\n\t\ttaxonomy,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPost, getEditedPostAttribute } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst { getTaxonomy, getEntityRecords, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _taxonomy = getTaxonomy( slug );\n\t\t\tconst post = getCurrentPost();\n\n\t\t\treturn {\n\t\t\t\thasCreateAction: _taxonomy\n\t\t\t\t\t? post._links?.[\n\t\t\t\t\t\t\t'wp:action-create-' + _taxonomy.rest_base\n\t\t\t\t\t ] ?? false\n\t\t\t\t\t: false,\n\t\t\t\thasAssignAction: _taxonomy\n\t\t\t\t\t? post._links?.[\n\t\t\t\t\t\t\t'wp:action-assign-' + _taxonomy.rest_base\n\t\t\t\t\t ] ?? false\n\t\t\t\t\t: false,\n\t\t\t\tterms: _taxonomy\n\t\t\t\t\t? getEditedPostAttribute( _taxonomy.rest_base )\n\t\t\t\t\t: EMPTY_ARRAY,\n\t\t\t\tloading: isResolving( 'getEntityRecords', [\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\tslug,\n\t\t\t\t\tDEFAULT_QUERY,\n\t\t\t\t] ),\n\t\t\t\tavailableTerms:\n\t\t\t\t\tgetEntityRecords( 'taxonomy', slug, DEFAULT_QUERY ) ||\n\t\t\t\t\tEMPTY_ARRAY,\n\t\t\t\ttaxonomy: _taxonomy,\n\t\t\t};\n\t\t},\n\t\t[ slug ]\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst availableTermsTree = useMemo(\n\t\t() => sortBySelected( buildTermsTree( availableTerms ), terms ),\n\t\t// Remove `terms` from the dependency list to avoid reordering every time\n\t\t// checking or unchecking a term.\n\t\t[ availableTerms ]\n\t);\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tif ( ! hasAssignAction ) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Append new term.\n\t *\n\t * @param {Object} term Term object.\n\t * @return {Promise} A promise that resolves to save term object.\n\t */\n\tconst addTerm = ( term ) => {\n\t\treturn saveEntityRecord( 'taxonomy', slug, term, {\n\t\t\tthrowOnError: true,\n\t\t} );\n\t};\n\n\t/**\n\t * Update terms for post.\n\t *\n\t * @param {number[]} termIds Term ids.\n\t */\n\tconst onUpdateTerms = ( termIds ) => {\n\t\teditPost( { [ taxonomy.rest_base ]: termIds } );\n\t};\n\n\t/**\n\t * Handler for checking term.\n\t *\n\t * @param {number} termId\n\t */\n\tconst onChange = ( termId ) => {\n\t\tconst hasTerm = terms.includes( termId );\n\t\tconst newTerms = hasTerm\n\t\t\t? terms.filter( ( id ) => id !== termId )\n\t\t\t: [ ...terms, termId ];\n\t\tonUpdateTerms( newTerms );\n\t};\n\n\tconst onChangeFormName = ( value ) => {\n\t\tsetFormName( value );\n\t};\n\n\t/**\n\t * Handler for changing form parent.\n\t *\n\t * @param {number|''} parentId Parent post id.\n\t */\n\tconst onChangeFormParent = ( parentId ) => {\n\t\tsetFormParent( parentId );\n\t};\n\n\tconst onToggleForm = () => {\n\t\tsetShowForm( ! showForm );\n\t};\n\n\tconst onAddTerm = async ( event ) => {\n\t\tevent.preventDefault();\n\t\tif ( formName === '' || adding ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if the term we are adding already exists.\n\t\tconst existingTerm = findTerm( availableTerms, formParent, formName );\n\t\tif ( existingTerm ) {\n\t\t\t// If the term we are adding exists but is not selected select it.\n\t\t\tif ( ! terms.some( ( term ) => term === existingTerm.id ) ) {\n\t\t\t\tonUpdateTerms( [ ...terms, existingTerm.id ] );\n\t\t\t}\n\n\t\t\tsetFormName( '' );\n\t\t\tsetFormParent( '' );\n\n\t\t\treturn;\n\t\t}\n\t\tsetAdding( true );\n\t\tlet newTerm;\n\t\ttry {\n\t\t\tnewTerm = await addTerm( {\n\t\t\t\tname: formName,\n\t\t\t\tparent: formParent ? formParent : undefined,\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice( error.message, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\t\tconst defaultName =\n\t\t\tslug === 'category' ? __( 'Category' ) : __( 'Term' );\n\t\tconst termAddedMessage = sprintf(\n\t\t\t/* translators: %s: taxonomy name */\n\t\t\t_x( '%s added', 'term' ),\n\t\t\ttaxonomy?.labels?.singular_name ?? defaultName\n\t\t);\n\t\tspeak( termAddedMessage, 'assertive' );\n\t\tsetAdding( false );\n\t\tsetFormName( '' );\n\t\tsetFormParent( '' );\n\t\tonUpdateTerms( [ ...terms, newTerm.id ] );\n\t};\n\n\tconst setFilter = ( value ) => {\n\t\tconst newFilteredTermsTree = availableTermsTree\n\t\t\t.map( getFilterMatcher( value ) )\n\t\t\t.filter( ( term ) => term );\n\t\tconst getResultCount = ( termsTree ) => {\n\t\t\tlet count = 0;\n\t\t\tfor ( let i = 0; i < termsTree.length; i++ ) {\n\t\t\t\tcount++;\n\t\t\t\tif ( undefined !== termsTree[ i ].children ) {\n\t\t\t\t\tcount += getResultCount( termsTree[ i ].children );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn count;\n\t\t};\n\n\t\tsetFilterValue( value );\n\t\tsetFilteredTermsTree( newFilteredTermsTree );\n\n\t\tconst resultCount = getResultCount( newFilteredTermsTree );\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results */\n\t\t\t_n( '%d result found.', '%d results found.', resultCount ),\n\t\t\tresultCount\n\t\t);\n\n\t\tdebouncedSpeak( resultsFoundMessage, 'assertive' );\n\t};\n\n\tconst renderTerms = ( renderedTerms ) => {\n\t\treturn renderedTerms.map( ( term ) => {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tkey={ term.id }\n\t\t\t\t\tclassName=\"editor-post-taxonomies__hierarchical-terms-choice\"\n\t\t\t\t>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tchecked={ terms.indexOf( term.id ) !== -1 }\n\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\tconst termId = parseInt( term.id, 10 );\n\t\t\t\t\t\t\tonChange( termId );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ decodeEntities( term.name ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ !! term.children.length && (\n\t\t\t\t\t\t<div className=\"editor-post-taxonomies__hierarchical-terms-subchoices\">\n\t\t\t\t\t\t\t{ renderTerms( term.children ) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t);\n\t\t} );\n\t};\n\n\tconst labelWithFallback = (\n\t\tlabelProperty,\n\t\tfallbackIsCategory,\n\t\tfallbackIsNotCategory\n\t) =>\n\t\ttaxonomy?.labels?.[ labelProperty ] ??\n\t\t( slug === 'category' ? fallbackIsCategory : fallbackIsNotCategory );\n\n\tconst newTermButtonLabel = labelWithFallback(\n\t\t'add_new_item',\n\t\t__( 'Add new category' ),\n\t\t__( 'Add new term' )\n\t);\n\tconst newTermLabel = labelWithFallback(\n\t\t'new_item_name',\n\t\t__( 'Add new category' ),\n\t\t__( 'Add new term' )\n\t);\n\tconst parentSelectLabel = labelWithFallback(\n\t\t'parent_item',\n\t\t__( 'Parent Category' ),\n\t\t__( 'Parent Term' )\n\t);\n\tconst noParentOption = `— ${ parentSelectLabel } —`;\n\tconst newTermSubmitLabel = newTermButtonLabel;\n\tconst filterLabel = taxonomy?.labels?.search_items ?? __( 'Search Terms' );\n\tconst groupLabel = taxonomy?.name ?? __( 'Terms' );\n\tconst showFilter = availableTerms.length >= MIN_TERMS_COUNT_FOR_FILTER;\n\n\treturn (\n\t\t<Flex direction=\"column\" gap=\"4\">\n\t\t\t{ showFilter && (\n\t\t\t\t<SearchControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ filterLabel }\n\t\t\t\t\tplaceholder={ filterLabel }\n\t\t\t\t\tvalue={ filterValue }\n\t\t\t\t\tonChange={ setFilter }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<div\n\t\t\t\tclassName=\"editor-post-taxonomies__hierarchical-terms-list\"\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"group\"\n\t\t\t\taria-label={ groupLabel }\n\t\t\t>\n\t\t\t\t{ renderTerms(\n\t\t\t\t\t'' !== filterValue ? filteredTermsTree : availableTermsTree\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t{ ! loading && hasCreateAction && (\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tonClick={ onToggleForm }\n\t\t\t\t\t\tclassName=\"editor-post-taxonomies__hierarchical-terms-add\"\n\t\t\t\t\t\taria-expanded={ showForm }\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ newTermButtonLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t) }\n\t\t\t{ showForm && (\n\t\t\t\t<form onSubmit={ onAddTerm }>\n\t\t\t\t\t<Flex direction=\"column\" gap=\"4\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"editor-post-taxonomies__hierarchical-terms-input\"\n\t\t\t\t\t\t\tlabel={ newTermLabel }\n\t\t\t\t\t\t\tvalue={ formName }\n\t\t\t\t\t\t\tonChange={ onChangeFormName }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ !! availableTerms.length && (\n\t\t\t\t\t\t\t<TreeSelect\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ parentSelectLabel }\n\t\t\t\t\t\t\t\tnoOptionLabel={ noParentOption }\n\t\t\t\t\t\t\t\tonChange={ onChangeFormParent }\n\t\t\t\t\t\t\t\tselectedId={ formParent }\n\t\t\t\t\t\t\t\ttree={ availableTermsTree }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\tclassName=\"editor-post-taxonomies__hierarchical-terms-submit\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ newTermSubmitLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t</Flex>\n\t\t\t\t</form>\n\t\t\t) }\n\t\t</Flex>\n\t);\n}\n\nexport default withFilters( 'editor.PostTaxonomyType' )(\n\tHierarchicalTermSelector\n);\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAUA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAAmD,IAAAW,WAAA,GAAAX,OAAA;AA1BnD;AACA;AACA;;AAoBA;AACA;AACA;;AAIA;AACA;AACA,GACA,MAAMY,aAAa,GAAG;EACrBC,QAAQ,EAAE,CAAC,CAAC;EACZC,OAAO,EAAE,MAAM;EACfC,KAAK,EAAE,KAAK;EACZC,OAAO,EAAE,gBAAgB;EACzBC,OAAO,EAAE;AACV,CAAC;AAED,MAAMC,0BAA0B,GAAG,CAAC;AAEpC,MAAMC,WAAW,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAEC,SAAS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AACzC,MAAM,iBACzB,IAAArB,WAAA,CAAAkI,GAAA,EAAC1I,WAAA,CAAA6K,UAAU;UACVX,qBAAqB;UACrBtB,uBAAuB;UACvBE,KAAK,EAAGS,iBAAmB;UAC3BuB,aAAa,EAAGtB,cAAgB;UAChCrD,QAAQ,EAAGO,kBAAoB;UAC/BqE,UAAU,EAAGtH,UAAY;UACzBuH,IAAI,EAAGtF;QAAoB,CAC3B,CACD,eACD,IAAAlF,WAAA,CAAAkI,GAAA,EAAC1I,WAAA,CAAAsK,QAAQ;UAAA7I,QAAA,eACR,IAAAjB,WAAA,CAAAkI,GAAA,EAAC1I,WAAA,CAAAuK,MAAM;YACNL,qBAAqB;YACrBO,OAAO,EAAC,WAAW;YACnBnD,IAAI,EAAC,QAAQ;YACbmB,SAAS,EAAC,mDAAmD;YAAAhH,QAAA,EAE3DgI;UAAkB,CACb;QAAC,CACA,CAAC;MAAA,CACN;IAAC,CACF,CACN;EAAA,CACI,CAAC;AAET;AAAC,IAAAwB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,uBAAW,EAAE,yBAA0B,CAAC,CACtDpI,wBACD,CAAC","ignoreList":[]}
@@ -49,7 +49,7 @@ function PostTaxonomies({
49
49
  })
50
50
  };
51
51
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_element.Fragment, {
52
- children: taxonomyWrapper( /*#__PURE__*/(0, _jsxRuntime.jsx)(TaxonomyComponent, {
52
+ children: taxonomyWrapper(/*#__PURE__*/(0, _jsxRuntime.jsx)(TaxonomyComponent, {
53
53
  ...taxonomyComponentProps
54
54
  }), taxonomy)
55
55
  }, `taxonomy-${taxonomy.slug}`);
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_coreData","_hierarchicalTermSelector","_interopRequireDefault","_flatTermSelector","_store","_jsxRuntime","identity","x","PostTaxonomies","taxonomyWrapper","postType","taxonomies","useSelect","select","editorStore","getCurrentPostType","coreStore","getTaxonomies","per_page","visibleTaxonomies","filter","taxonomy","types","includes","visibility","show_ui","map","TaxonomyComponent","hierarchical","HierarchicalTermSelector","FlatTermSelector","taxonomyComponentProps","slug","__nextHasNoMarginBottom","jsx","Fragment","children","_default","exports","default"],"sources":["@wordpress/editor/src/components/post-taxonomies/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport HierarchicalTermSelector from './hierarchical-term-selector';\nimport FlatTermSelector from './flat-term-selector';\nimport { store as editorStore } from '../../store';\n\nconst identity = ( x ) => x;\n\nexport function PostTaxonomies( { taxonomyWrapper = identity } ) {\n\tconst { postType, taxonomies } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t\ttaxonomies: select( coreStore ).getTaxonomies( { per_page: -1 } ),\n\t\t};\n\t}, [] );\n\tconst visibleTaxonomies = ( taxonomies ?? [] ).filter(\n\t\t( taxonomy ) =>\n\t\t\t// In some circumstances .visibility can end up as undefined so optional chaining operator required.\n\t\t\t// https://github.com/WordPress/gutenberg/issues/40326\n\t\t\ttaxonomy.types.includes( postType ) && taxonomy.visibility?.show_ui\n\t);\n\n\treturn visibleTaxonomies.map( ( taxonomy ) => {\n\t\tconst TaxonomyComponent = taxonomy.hierarchical\n\t\t\t? HierarchicalTermSelector\n\t\t\t: FlatTermSelector;\n\t\tconst taxonomyComponentProps = {\n\t\t\tslug: taxonomy.slug,\n\t\t\t...( taxonomy.hierarchical\n\t\t\t\t? {}\n\t\t\t\t: { __nextHasNoMarginBottom: true } ),\n\t\t};\n\n\t\treturn (\n\t\t\t<Fragment key={ `taxonomy-${ taxonomy.slug }` }>\n\t\t\t\t{ taxonomyWrapper(\n\t\t\t\t\t<TaxonomyComponent { ...taxonomyComponentProps } />,\n\t\t\t\t\ttaxonomy\n\t\t\t\t) }\n\t\t\t</Fragment>\n\t\t);\n\t} );\n}\n\n/**\n * Renders the taxonomies associated with a post.\n *\n * @param {Object} props The component props.\n * @param {Function} props.taxonomyWrapper The wrapper function for each taxonomy component.\n *\n * @return {Array} An array of JSX elements representing the visible taxonomies.\n */\nexport default PostTaxonomies;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,yBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAAmD,IAAAO,WAAA,GAAAP,OAAA;AAZnD;AACA;AACA;;AAKA;AACA;AACA;;AAKA,MAAMQ,QAAQ,GAAKC,CAAC,IAAMA,CAAC;AAEpB,SAASC,cAAcA,CAAE;EAAEC,eAAe,GAAGH;AAAS,CAAC,EAAG;EAChE,MAAM;IAAEI,QAAQ;IAAEC;EAAW,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzD,OAAO;MACNH,QAAQ,EAAEG,MAAM,CAAEC,YAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC;MACpDJ,UAAU,EAAEE,MAAM,CAAEG,eAAU,CAAC,CAACC,aAAa,CAAE;QAAEC,QAAQ,EAAE,CAAC;MAAE,CAAE;IACjE,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAMC,iBAAiB,GAAG,CAAER,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,EAAE,EAAGS,MAAM,CAClDC,QAAQ;EACT;EACA;EACAA,QAAQ,CAACC,KAAK,CAACC,QAAQ,CAAEb,QAAS,CAAC,IAAIW,QAAQ,CAACG,UAAU,EAAEC,OAC9D,CAAC;EAED,OAAON,iBAAiB,CAACO,GAAG,CAAIL,QAAQ,IAAM;IAC7C,MAAMM,iBAAiB,GAAGN,QAAQ,CAACO,YAAY,GAC5CC,iCAAwB,GACxBC,yBAAgB;IACnB,MAAMC,sBAAsB,GAAG;MAC9BC,IAAI,EAAEX,QAAQ,CAACW,IAAI;MACnB,IAAKX,QAAQ,CAACO,YAAY,GACvB,CAAC,CAAC,GACF;QAAEK,uBAAuB,EAAE;MAAK,CAAC;IACrC,CAAC;IAED,oBACC,IAAA5B,WAAA,CAAA6B,GAAA,EAACrC,QAAA,CAAAsC,QAAQ;MAAAC,QAAA,EACN3B,eAAe,eAChB,IAAAJ,WAAA,CAAA6B,GAAA,EAACP,iBAAiB;QAAA,GAAMI;MAAsB,CAAI,CAAC,EACnDV,QACD;IAAC,GAJe,YAAYA,QAAQ,CAACW,IAAM,EAKlC,CAAC;EAEb,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAQe/B,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_coreData","_hierarchicalTermSelector","_interopRequireDefault","_flatTermSelector","_store","_jsxRuntime","identity","x","PostTaxonomies","taxonomyWrapper","postType","taxonomies","useSelect","select","editorStore","getCurrentPostType","coreStore","getTaxonomies","per_page","visibleTaxonomies","filter","taxonomy","types","includes","visibility","show_ui","map","TaxonomyComponent","hierarchical","HierarchicalTermSelector","FlatTermSelector","taxonomyComponentProps","slug","__nextHasNoMarginBottom","jsx","Fragment","children","_default","exports","default"],"sources":["@wordpress/editor/src/components/post-taxonomies/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport HierarchicalTermSelector from './hierarchical-term-selector';\nimport FlatTermSelector from './flat-term-selector';\nimport { store as editorStore } from '../../store';\n\nconst identity = ( x ) => x;\n\nexport function PostTaxonomies( { taxonomyWrapper = identity } ) {\n\tconst { postType, taxonomies } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t\ttaxonomies: select( coreStore ).getTaxonomies( { per_page: -1 } ),\n\t\t};\n\t}, [] );\n\tconst visibleTaxonomies = ( taxonomies ?? [] ).filter(\n\t\t( taxonomy ) =>\n\t\t\t// In some circumstances .visibility can end up as undefined so optional chaining operator required.\n\t\t\t// https://github.com/WordPress/gutenberg/issues/40326\n\t\t\ttaxonomy.types.includes( postType ) && taxonomy.visibility?.show_ui\n\t);\n\n\treturn visibleTaxonomies.map( ( taxonomy ) => {\n\t\tconst TaxonomyComponent = taxonomy.hierarchical\n\t\t\t? HierarchicalTermSelector\n\t\t\t: FlatTermSelector;\n\t\tconst taxonomyComponentProps = {\n\t\t\tslug: taxonomy.slug,\n\t\t\t...( taxonomy.hierarchical\n\t\t\t\t? {}\n\t\t\t\t: { __nextHasNoMarginBottom: true } ),\n\t\t};\n\n\t\treturn (\n\t\t\t<Fragment key={ `taxonomy-${ taxonomy.slug }` }>\n\t\t\t\t{ taxonomyWrapper(\n\t\t\t\t\t<TaxonomyComponent { ...taxonomyComponentProps } />,\n\t\t\t\t\ttaxonomy\n\t\t\t\t) }\n\t\t\t</Fragment>\n\t\t);\n\t} );\n}\n\n/**\n * Renders the taxonomies associated with a post.\n *\n * @param {Object} props The component props.\n * @param {Function} props.taxonomyWrapper The wrapper function for each taxonomy component.\n *\n * @return {Array} An array of JSX elements representing the visible taxonomies.\n */\nexport default PostTaxonomies;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,yBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAAmD,IAAAO,WAAA,GAAAP,OAAA;AAZnD;AACA;AACA;;AAKA;AACA;AACA;;AAKA,MAAMQ,QAAQ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A;AAPA,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAQe/B,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_data","_store","_index","_interopRequireDefault","_check","_jsxRuntime","TaxonomyPanel","taxonomy","children","slug","panelName","isEnabled","isOpened","useSelect","select","isEditorPanelEnabled","isEditorPanelOpened","editorStore","toggleEditorPanelOpened","useDispatch","taxonomyMenuName","labels","menu_name","jsx","PanelBody","title","opened","onToggle","PostTaxonomies","default","taxonomyWrapper","content","_default","exports"],"sources":["@wordpress/editor/src/components/post-taxonomies/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostTaxonomiesForm from './index';\nimport PostTaxonomiesCheck from './check';\n\nfunction TaxonomyPanel( { taxonomy, children } ) {\n\tconst slug = taxonomy?.slug;\n\tconst panelName = slug ? `taxonomy-panel-${ slug }` : '';\n\tconst { isEnabled, isOpened } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tisEnabled: slug ? isEditorPanelEnabled( panelName ) : false,\n\t\t\t\tisOpened: slug ? isEditorPanelOpened( panelName ) : false,\n\t\t\t};\n\t\t},\n\t\t[ panelName, slug ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst taxonomyMenuName = taxonomy?.labels?.menu_name;\n\tif ( ! taxonomyMenuName ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ taxonomyMenuName }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t>\n\t\t\t{ children }\n\t\t</PanelBody>\n\t);\n}\n\nfunction PostTaxonomies() {\n\treturn (\n\t\t<PostTaxonomiesCheck>\n\t\t\t<PostTaxonomiesForm\n\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<TaxonomyPanel taxonomy={ taxonomy }>\n\t\t\t\t\t\t\t{ content }\n\t\t\t\t\t\t</TaxonomyPanel>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t</PostTaxonomiesCheck>\n\t);\n}\n\n/**\n * Renders a panel for a specific taxonomy.\n *\n * @param {Object} props The component props.\n * @param {Object} props.taxonomy The taxonomy object.\n * @param {Element} props.children The child components.\n *\n * @return {Component} The rendered taxonomy panel.\n */\nexport default PostTaxonomies;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAA0C,IAAAM,WAAA,GAAAN,OAAA;AAX1C;AACA;AACA;;AAIA;AACA;AACA;;AAKA,SAASO,aAAaA,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EAAG;EAChD,MAAMC,IAAI,GAAGF,QAAQ,EAAEE,IAAI;EAC3B,MAAMC,SAAS,GAAGD,IAAI,GAAI,kBAAkBA,IAAM,EAAC,GAAG,EAAE;EACxD,MAAM;IAAEE,SAAS;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EACtCC,MAAM,IAAM;IACb,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDF,MAAM,CAAEG,YAAY,CAAC;IACtB,OAAO;MACNN,SAAS,EAAEF,IAAI,GAAGM,oBAAoB,CAAEL,SAAU,CAAC,GAAG,KAAK;MAC3DE,QAAQ,EAAEH,IAAI,GAAGO,mBAAmB,CAAEN,SAAU,CAAC,GAAG;IACrD,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,EAAED,IAAI,CAClB,CAAC;EACD,MAAM;IAAES;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEF,YAAY,CAAC;EAE9D,IAAK,CAAEN,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMS,gBAAgB,GAAGb,QAAQ,EAAEc,MAAM,EAAEC,SAAS;EACpD,IAAK,CAAEF,gBAAgB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAf,WAAA,CAAAkB,GAAA,EAACzB,WAAA,CAAA0B,SAAS;IACTC,KAAK,EAAGL,gBAAkB;IAC1BM,MAAM,EAAGd,QAAU;IACnBe,QAAQ,EAAGA,CAAA,KAAMT,uBAAuB,CAAER,SAAU,CAAG;IAAAF,QAAA,EAErDA;EAAQ,CACA,CAAC;AAEd;AAEA,SAASoB,cAAcA,CAAA,EAAG;EACzB,oBACC,IAAAvB,WAAA,CAAAkB,GAAA,EAACnB,MAAA,CAAAyB,OAAmB;IAAArB,QAAA,eACnB,IAAAH,WAAA,CAAAkB,GAAA,EAACrB,MAAA,CAAA2B,OAAkB;MAClBC,eAAe,EAAGA,CAAEC,OAAO,EAAExB,QAAQ,KAAM;QAC1C,oBACC,IAAAF,WAAA,CAAAkB,GAAA,EAACjB,aAAa;UAACC,QAAQ,EAAGA,QAAU;UAAAC,QAAA,EACjCuB;QAAO,CACK,CAAC;MAElB;IAAG,CACH;EAAC,CACkB,CAAC;AAExB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IAAAC,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GASeD,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_data","_store","_index","_interopRequireDefault","_check","_jsxRuntime","TaxonomyPanel","taxonomy","children","slug","panelName","isEnabled","isOpened","useSelect","select","isEditorPanelEnabled","isEditorPanelOpened","editorStore","toggleEditorPanelOpened","useDispatch","taxonomyMenuName","labels","menu_name","jsx","PanelBody","title","opened","onToggle","PostTaxonomies","default","taxonomyWrapper","content","_default","exports"],"sources":["@wordpress/editor/src/components/post-taxonomies/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostTaxonomiesForm from './index';\nimport PostTaxonomiesCheck from './check';\n\nfunction TaxonomyPanel( { taxonomy, children } ) {\n\tconst slug = taxonomy?.slug;\n\tconst panelName = slug ? `taxonomy-panel-${ slug }` : '';\n\tconst { isEnabled, isOpened } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tisEnabled: slug ? isEditorPanelEnabled( panelName ) : false,\n\t\t\t\tisOpened: slug ? isEditorPanelOpened( panelName ) : false,\n\t\t\t};\n\t\t},\n\t\t[ panelName, slug ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst taxonomyMenuName = taxonomy?.labels?.menu_name;\n\tif ( ! taxonomyMenuName ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ taxonomyMenuName }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t>\n\t\t\t{ children }\n\t\t</PanelBody>\n\t);\n}\n\nfunction PostTaxonomies() {\n\treturn (\n\t\t<PostTaxonomiesCheck>\n\t\t\t<PostTaxonomiesForm\n\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<TaxonomyPanel taxonomy={ taxonomy }>\n\t\t\t\t\t\t\t{ content }\n\t\t\t\t\t\t</TaxonomyPanel>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t</PostTaxonomiesCheck>\n\t);\n}\n\n/**\n * Renders a panel for a specific taxonomy.\n *\n * @param {Object} props The component props.\n * @param {Object} props.taxonomy The taxonomy object.\n * @param {Element} props.children The child components.\n *\n * @return {Component} The rendered taxonomy panel.\n */\nexport default PostTaxonomies;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAA0C,IAAAM,WAAA,GAAAN,OAAA;AAX1C;AACA;AACA;;AAIA;AACA;AACA;;AAKA,SAASO,aAAaA,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EAAG;EAChD,MAAMC,IAAI,GAAGF,QAAQ,EAAEE,IAAI;EAC3B,MAAMC,SAAS,GAAGD,IAAI,GAAG,kBAAmBA,IAAI,EAAG,GAAG,EAAE;EACxD,MAAM;IAAEE,SAAS;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EACtCC,MAAM,IAAM;IACb,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDF,MAAM,CAAEG,YAAY,CAAC;IACtB,OAAO;MACNN,SAAS,EAAEF,IAAI,GAAGM,oBAAoB,CAAEL,SAAU,CAAC,GAAG,KAAK;MAC3DE,QAAQ,EAAEH,IAAI,GAAGO,mBAAmB,CAAEN,SAAU,CAAC,GAAG;IACrD,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,EAAED,IAAI,CAClB,CAAC;EACD,MAAM;IAAES;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEF,YAAY,CAAC;EAE9D,IAAK,CAAEN,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMS,gBAAgB,GAAGb,QAAQ,EAAEc,MAAM,EAAEC,SAAS;EACpD,IAAK,CAAEF,gBAAgB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAf,WAAA,CAAAkB,GAAA,EAACzB,WAAA,CAAA0B,SAAS;IACTC,KAAK,EAAGL,gBAAkB;IAC1BM,MAAM,EAAGd,QAAU;IACnBe,QAAQ,EAAGA,CAAA,KAAMT,uBAAuB,CAAER,SAAU,CAAG;IAAAF,QAAA,EAErDA;EAAQ,CACA,CAAC;AAEd;AAEA,SAASoB,cAAcA,CAAA,EAAG;EACzB,oBACC,IAAAvB,WAAA,CAAAkB,GAAA,EAACnB,MAAA,CAAAyB,OAAmB;IAAArB,QAAA,eACnB,IAAAH,WAAA,CAAAkB,GAAA,EAACrB,MAAA,CAAA2B,OAAkB;MAClBC,eAAe,EAAGA,CAAEC,OAAO,EAAExB,QAAQ,KAAM;QAC1C,oBACC,IAAAF,WAAA,CAAAkB,GAAA,EAACjB,aAAa;UAACC,QAAQ,EAAGA,QAAU;UAAAC,QAAA,EACjCuB;QAAO,CACK,CAAC;MAElB;IAAG,CACH;EAAC,CACkB,CAAC;AAExB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IAAAC,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GASeD,cAAc","ignoreList":[]}
@@ -150,10 +150,8 @@ function PostTemplateDropdownContent({
150
150
  template: slug || ''
151
151
  })
152
152
  }), canEdit && onNavigateToEntityRecord && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
153
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
154
- // TODO: Switch to `true` (40px size) if possible
155
- , {
156
- __next40pxDefaultSize: false,
153
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
154
+ __next40pxDefaultSize: true,
157
155
  variant: "link",
158
156
  onClick: () => {
159
157
  onNavigateToEntityRecord({
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_coreData","_blockEditor","_element","_icons","_notices","_store","_createNewTemplateModal","_interopRequireDefault","_hooks","_jsxRuntime","POPOVER_PROPS","className","placement","PostTemplateToggle","isOpen","onClick","templateTitle","useSelect","select","templateSlug","editorStore","getEditedPostAttribute","supportsTemplateMode","availableTemplates","getEditorSettings","template","coreStore","canUser","kind","name","getCurrentTemplateId","title","slug","jsx","Button","__next40pxDefaultSize","variant","__","children","PostTemplateDropdownContent","onClose","_options$find","_selectedOption$value","allowSwitchingTemplate","useAllowSwitchingTemplates","fetchedTemplates","selectedTemplateSlug","canCreate","canEdit","currentTemplateId","onNavigateToEntityRecord","getEntityRecords","editorSettings","canCreateTemplates","_currentTemplateId","post_type","getCurrentPostType","per_page","undefined","options","useMemo","Object","entries","fromEntries","map","rendered","value","label","selectedOption","find","option","editPost","useDispatch","createSuccessNotice","noticesStore","isCreateModalOpen","setIsCreateModalOpen","useState","jsxs","__experimentalInspectorPopoverHeader","help","actions","icon","addTemplate","Notice","status","isDismissible","SelectControl","__nextHasNoMarginBottom","hideLabelFromVision","onChange","postId","postType","type","onNavigateToPreviousEntityRecord","default","ClassicThemeControl","Dropdown","popoverProps","focusOnMount","renderToggle","onToggle","renderContent","_default","exports"],"sources":["@wordpress/editor/src/components/post-template/classic-theme.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl, Dropdown, Button, Notice } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { useState, useMemo } from '@wordpress/element';\nimport { addTemplate } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport CreateNewTemplateModal from './create-new-template-modal';\nimport { useAllowSwitchingTemplates } from './hooks';\n\nconst POPOVER_PROPS = {\n\tclassName: 'editor-post-template__dropdown',\n\tplacement: 'bottom-start',\n};\n\nfunction PostTemplateToggle( { isOpen, onClick } ) {\n\tconst templateTitle = useSelect( ( select ) => {\n\t\tconst templateSlug =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\n\t\tconst { supportsTemplateMode, availableTemplates } =\n\t\t\tselect( editorStore ).getEditorSettings();\n\t\tif ( ! supportsTemplateMode && availableTemplates[ templateSlug ] ) {\n\t\t\treturn availableTemplates[ templateSlug ];\n\t\t}\n\t\tconst template =\n\t\t\tselect( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ) && select( editorStore ).getCurrentTemplateId();\n\t\treturn (\n\t\t\ttemplate?.title ||\n\t\t\ttemplate?.slug ||\n\t\t\tavailableTemplates?.[ templateSlug ]\n\t\t);\n\t}, [] );\n\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\taria-label={ __( 'Template options' ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ templateTitle ?? __( 'Default template' ) }\n\t\t</Button>\n\t);\n}\n\n/**\n * Renders the dropdown content for selecting a post template.\n *\n * @param {Object} props The component props.\n * @param {Function} props.onClose The function to close the dropdown.\n *\n * @return {JSX.Element} The rendered dropdown content.\n */\nfunction PostTemplateDropdownContent( { onClose } ) {\n\tconst allowSwitchingTemplate = useAllowSwitchingTemplates();\n\tconst {\n\t\tavailableTemplates,\n\t\tfetchedTemplates,\n\t\tselectedTemplateSlug,\n\t\tcanCreate,\n\t\tcanEdit,\n\t\tcurrentTemplateId,\n\t\tonNavigateToEntityRecord,\n\t\tgetEditorSettings,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canUser, getEntityRecords } = select( coreStore );\n\t\t\tconst editorSettings = select( editorStore ).getEditorSettings();\n\t\t\tconst canCreateTemplates = canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst _currentTemplateId =\n\t\t\t\tselect( editorStore ).getCurrentTemplateId();\n\t\t\treturn {\n\t\t\t\tavailableTemplates: editorSettings.availableTemplates,\n\t\t\t\tfetchedTemplates: canCreateTemplates\n\t\t\t\t\t? getEntityRecords( 'postType', 'wp_template', {\n\t\t\t\t\t\t\tpost_type:\n\t\t\t\t\t\t\t\tselect( editorStore ).getCurrentPostType(),\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t } )\n\t\t\t\t\t: undefined,\n\t\t\t\tselectedTemplateSlug:\n\t\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' ),\n\t\t\t\tcanCreate:\n\t\t\t\t\tallowSwitchingTemplate &&\n\t\t\t\t\tcanCreateTemplates &&\n\t\t\t\t\teditorSettings.supportsTemplateMode,\n\t\t\t\tcanEdit:\n\t\t\t\t\tallowSwitchingTemplate &&\n\t\t\t\t\tcanCreateTemplates &&\n\t\t\t\t\teditorSettings.supportsTemplateMode &&\n\t\t\t\t\t!! _currentTemplateId,\n\t\t\t\tcurrentTemplateId: _currentTemplateId,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\teditorSettings.onNavigateToEntityRecord,\n\t\t\t\tgetEditorSettings: select( editorStore ).getEditorSettings,\n\t\t\t};\n\t\t},\n\t\t[ allowSwitchingTemplate ]\n\t);\n\n\tconst options = useMemo(\n\t\t() =>\n\t\t\tObject.entries( {\n\t\t\t\t...availableTemplates,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\t( fetchedTemplates ?? [] ).map( ( { slug, title } ) => [\n\t\t\t\t\t\tslug,\n\t\t\t\t\t\ttitle.rendered,\n\t\t\t\t\t] )\n\t\t\t\t),\n\t\t\t} ).map( ( [ slug, title ] ) => ( { value: slug, label: title } ) ),\n\t\t[ availableTemplates, fetchedTemplates ]\n\t);\n\n\tconst selectedOption =\n\t\toptions.find( ( option ) => option.value === selectedTemplateSlug ) ??\n\t\toptions.find( ( option ) => ! option.value ); // The default option has '' value.\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst [ isCreateModalOpen, setIsCreateModalOpen ] = useState( false );\n\n\treturn (\n\t\t<div className=\"editor-post-template__classic-theme-dropdown\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Template' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Templates define the way content is displayed when viewing your site.'\n\t\t\t\t) }\n\t\t\t\tactions={\n\t\t\t\t\tcanCreate\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ticon: addTemplate,\n\t\t\t\t\t\t\t\t\tlabel: __( 'Add template' ),\n\t\t\t\t\t\t\t\t\tonClick: () => setIsCreateModalOpen( true ),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: []\n\t\t\t\t}\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t{ ! allowSwitchingTemplate ? (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __( 'The posts page template cannot be changed.' ) }\n\t\t\t\t</Notice>\n\t\t\t) : (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tlabel={ __( 'Template' ) }\n\t\t\t\t\tvalue={ selectedOption?.value ?? '' }\n\t\t\t\t\toptions={ options }\n\t\t\t\t\tonChange={ ( slug ) =>\n\t\t\t\t\t\teditPost( { template: slug || '' } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ canEdit && onNavigateToEntityRecord && (\n\t\t\t\t<p>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\t\tpostId: currentTemplateId,\n\t\t\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\t\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord(),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</p>\n\t\t\t) }\n\t\t\t{ isCreateModalOpen && (\n\t\t\t\t<CreateNewTemplateModal\n\t\t\t\t\tonClose={ () => setIsCreateModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nfunction ClassicThemeControl() {\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\tfocusOnMount\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<PostTemplateToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<PostTemplateDropdownContent onClose={ onClose } />\n\t\t\t) }\n\t\t/>\n\t);\n}\n\n/**\n * Provides a dropdown menu for selecting and managing post templates.\n *\n * The dropdown menu includes a button for toggling the menu, a list of available templates, and options for creating and editing templates.\n *\n * @return {JSX.Element} The rendered ClassicThemeControl component.\n */\nexport default ClassicThemeControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,uBAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAAqD,IAAAY,WAAA,GAAAZ,OAAA;AAjBrD;AACA;AACA;;AAUA;AACA;AACA;;AAKA,MAAMa,aAAa,GAAG;EACrBC,SAAS,EAAE,gCAAgC;EAC3CC,SAAS,EAAE;AACZ,CAAC;AAED,SAASC,kBAAkBA,CAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,EAAG;EAClD,MAAMC,aAAa,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC9C,MAAMC,YAAY,GACjBD,MAAM,CAAEE,YAAY,CAAC,CAACC,sBAAsB,CAAE,UAAW,CAAC;IAE3D,MAAM;MAAEC,oBAAoB;MAAEC;IAAmB,CAAC,GACjDL,MAAM,CAAEE,YAAY,CAAC,CAACI,iBAAiB,CAAC,CAAC;IAC1C,IAAK,CAAEF,oBAAoB,IAAIC,kBAAkB,CAAEJ,YAAY,CAAE,EAAG;MACnE,OAAOI,kBAAkB,CAAEJ,YAAY,CAAE;IAC1C;IACA,MAAMM,QAAQ,GACbP,MAAM,CAAEQ,eAAU,CAAC,CAACC,OAAO,CAAE,QAAQ,EAAE;MACtCC,IAAI,EAAE,UAAU;MAChBC,IAAI,E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;AAER;AAEA,SAASoB,mBAAmBA,CAAA,EAAG;EAC9B,oBACC,IAAAvF,WAAA,CAAAwB,GAAA,EAACnC,WAAA,CAAAmG,QAAQ;IACRC,YAAY,EAAGxF,aAAe;IAC9ByF,YAAY;IACZC,YAAY,EAAGA,CAAE;MAAEtF,MAAM;MAAEuF;IAAS,CAAC,kBACpC,IAAA5F,WAAA,CAAAwB,GAAA,EAACpB,kBAAkB;MAACC,MAAM,EAAGA,MAAQ;MAACC,OAAO,EAAGsF;IAAU,CAAE,CAC1D;IACHC,aAAa,EAAGA,CAAE;MAAE9D;IAAQ,CAAC,kBAC5B,IAAA/B,WAAA,CAAAwB,GAAA,EAACM,2BAA2B;MAACC,OAAO,EAAGA;IAAS,CAAE;EAChD,CACH,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAAA+D,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAOeC,mBAAmB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_coreData","_blockEditor","_element","_icons","_notices","_store","_createNewTemplateModal","_interopRequireDefault","_hooks","_jsxRuntime","POPOVER_PROPS","className","placement","PostTemplateToggle","isOpen","onClick","templateTitle","useSelect","select","templateSlug","editorStore","getEditedPostAttribute","supportsTemplateMode","availableTemplates","getEditorSettings","template","coreStore","canUser","kind","name","getCurrentTemplateId","title","slug","jsx","Button","__next40pxDefaultSize","variant","__","children","PostTemplateDropdownContent","onClose","_options$find","_selectedOption$value","allowSwitchingTemplate","useAllowSwitchingTemplates","fetchedTemplates","selectedTemplateSlug","canCreate","canEdit","currentTemplateId","onNavigateToEntityRecord","getEntityRecords","editorSettings","canCreateTemplates","_currentTemplateId","post_type","getCurrentPostType","per_page","undefined","options","useMemo","Object","entries","fromEntries","map","rendered","value","label","selectedOption","find","option","editPost","useDispatch","createSuccessNotice","noticesStore","isCreateModalOpen","setIsCreateModalOpen","useState","jsxs","__experimentalInspectorPopoverHeader","help","actions","icon","addTemplate","Notice","status","isDismissible","SelectControl","__nextHasNoMarginBottom","hideLabelFromVision","onChange","postId","postType","type","onNavigateToPreviousEntityRecord","default","ClassicThemeControl","Dropdown","popoverProps","focusOnMount","renderToggle","onToggle","renderContent","_default","exports"],"sources":["@wordpress/editor/src/components/post-template/classic-theme.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl, Dropdown, Button, Notice } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { useState, useMemo } from '@wordpress/element';\nimport { addTemplate } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport CreateNewTemplateModal from './create-new-template-modal';\nimport { useAllowSwitchingTemplates } from './hooks';\n\nconst POPOVER_PROPS = {\n\tclassName: 'editor-post-template__dropdown',\n\tplacement: 'bottom-start',\n};\n\nfunction PostTemplateToggle( { isOpen, onClick } ) {\n\tconst templateTitle = useSelect( ( select ) => {\n\t\tconst templateSlug =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\n\t\tconst { supportsTemplateMode, availableTemplates } =\n\t\t\tselect( editorStore ).getEditorSettings();\n\t\tif ( ! supportsTemplateMode && availableTemplates[ templateSlug ] ) {\n\t\t\treturn availableTemplates[ templateSlug ];\n\t\t}\n\t\tconst template =\n\t\t\tselect( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ) && select( editorStore ).getCurrentTemplateId();\n\t\treturn (\n\t\t\ttemplate?.title ||\n\t\t\ttemplate?.slug ||\n\t\t\tavailableTemplates?.[ templateSlug ]\n\t\t);\n\t}, [] );\n\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\taria-label={ __( 'Template options' ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ templateTitle ?? __( 'Default template' ) }\n\t\t</Button>\n\t);\n}\n\n/**\n * Renders the dropdown content for selecting a post template.\n *\n * @param {Object} props The component props.\n * @param {Function} props.onClose The function to close the dropdown.\n *\n * @return {JSX.Element} The rendered dropdown content.\n */\nfunction PostTemplateDropdownContent( { onClose } ) {\n\tconst allowSwitchingTemplate = useAllowSwitchingTemplates();\n\tconst {\n\t\tavailableTemplates,\n\t\tfetchedTemplates,\n\t\tselectedTemplateSlug,\n\t\tcanCreate,\n\t\tcanEdit,\n\t\tcurrentTemplateId,\n\t\tonNavigateToEntityRecord,\n\t\tgetEditorSettings,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canUser, getEntityRecords } = select( coreStore );\n\t\t\tconst editorSettings = select( editorStore ).getEditorSettings();\n\t\t\tconst canCreateTemplates = canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst _currentTemplateId =\n\t\t\t\tselect( editorStore ).getCurrentTemplateId();\n\t\t\treturn {\n\t\t\t\tavailableTemplates: editorSettings.availableTemplates,\n\t\t\t\tfetchedTemplates: canCreateTemplates\n\t\t\t\t\t? getEntityRecords( 'postType', 'wp_template', {\n\t\t\t\t\t\t\tpost_type:\n\t\t\t\t\t\t\t\tselect( editorStore ).getCurrentPostType(),\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t } )\n\t\t\t\t\t: undefined,\n\t\t\t\tselectedTemplateSlug:\n\t\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' ),\n\t\t\t\tcanCreate:\n\t\t\t\t\tallowSwitchingTemplate &&\n\t\t\t\t\tcanCreateTemplates &&\n\t\t\t\t\teditorSettings.supportsTemplateMode,\n\t\t\t\tcanEdit:\n\t\t\t\t\tallowSwitchingTemplate &&\n\t\t\t\t\tcanCreateTemplates &&\n\t\t\t\t\teditorSettings.supportsTemplateMode &&\n\t\t\t\t\t!! _currentTemplateId,\n\t\t\t\tcurrentTemplateId: _currentTemplateId,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\teditorSettings.onNavigateToEntityRecord,\n\t\t\t\tgetEditorSettings: select( editorStore ).getEditorSettings,\n\t\t\t};\n\t\t},\n\t\t[ allowSwitchingTemplate ]\n\t);\n\n\tconst options = useMemo(\n\t\t() =>\n\t\t\tObject.entries( {\n\t\t\t\t...availableTemplates,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\t( fetchedTemplates ?? [] ).map( ( { slug, title } ) => [\n\t\t\t\t\t\tslug,\n\t\t\t\t\t\ttitle.rendered,\n\t\t\t\t\t] )\n\t\t\t\t),\n\t\t\t} ).map( ( [ slug, title ] ) => ( { value: slug, label: title } ) ),\n\t\t[ availableTemplates, fetchedTemplates ]\n\t);\n\n\tconst selectedOption =\n\t\toptions.find( ( option ) => option.value === selectedTemplateSlug ) ??\n\t\toptions.find( ( option ) => ! option.value ); // The default option has '' value.\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst [ isCreateModalOpen, setIsCreateModalOpen ] = useState( false );\n\n\treturn (\n\t\t<div className=\"editor-post-template__classic-theme-dropdown\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Template' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Templates define the way content is displayed when viewing your site.'\n\t\t\t\t) }\n\t\t\t\tactions={\n\t\t\t\t\tcanCreate\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ticon: addTemplate,\n\t\t\t\t\t\t\t\t\tlabel: __( 'Add template' ),\n\t\t\t\t\t\t\t\t\tonClick: () => setIsCreateModalOpen( true ),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: []\n\t\t\t\t}\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t{ ! allowSwitchingTemplate ? (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __( 'The posts page template cannot be changed.' ) }\n\t\t\t\t</Notice>\n\t\t\t) : (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tlabel={ __( 'Template' ) }\n\t\t\t\t\tvalue={ selectedOption?.value ?? '' }\n\t\t\t\t\toptions={ options }\n\t\t\t\t\tonChange={ ( slug ) =>\n\t\t\t\t\t\teditPost( { template: slug || '' } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ canEdit && onNavigateToEntityRecord && (\n\t\t\t\t<p>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\t\tpostId: currentTemplateId,\n\t\t\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\t\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord(),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</p>\n\t\t\t) }\n\t\t\t{ isCreateModalOpen && (\n\t\t\t\t<CreateNewTemplateModal\n\t\t\t\t\tonClose={ () => setIsCreateModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nfunction ClassicThemeControl() {\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\tfocusOnMount\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<PostTemplateToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<PostTemplateDropdownContent onClose={ onClose } />\n\t\t\t) }\n\t\t/>\n\t);\n}\n\n/**\n * Provides a dropdown menu for selecting and managing post templates.\n *\n * The dropdown menu includes a button for toggling the menu, a list of available templates, and options for creating and editing templates.\n *\n * @return {JSX.Element} The rendered ClassicThemeControl component.\n */\nexport default ClassicThemeControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,uBAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAAqD,IAAAY,WAAA,GAAAZ,OAAA;AAjBrD;AACA;AACA;;AAUA;AACA;AACA;;AAKA,MAAMa,aAAa,GAAG;EACrBC,SAAS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_interopRequireDefault","require","_i18n","_coreData","_element","_blocks","_data","_compose","_components","_store","_jsxRuntime","PostTextEditor","instanceId","useInstanceId","content","blocks","type","id","useSelect","select","getEditedEntityRecord","coreStore","getCurrentPostType","getCurrentPostId","editorStore","_type","_id","editedRecord","editEntityRecord","useDispatch","value","useMemo","Function","__unstableSerializeAndClean","jsxs","Fragment","children","jsx","VisuallyHidden","as","htmlFor","__","default","autoComplete","dir","onChange","event","target","undefined","selection","className","placeholder"],"sources":["@wordpress/editor/src/components/post-text-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport Textarea from 'react-autosize-textarea';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Displays the Post Text Editor along with content in Visual and Text mode.\n *\n * @return {JSX.Element|null} The rendered PostTextEditor component.\n */\nexport default function PostTextEditor() {\n\tconst instanceId = useInstanceId( PostTextEditor );\n\tconst { content, blocks, type, id } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\tconst _type = getCurrentPostType();\n\t\tconst _id = getCurrentPostId();\n\t\tconst editedRecord = getEditedEntityRecord( 'postType', _type, _id );\n\n\t\treturn {\n\t\t\tcontent: editedRecord?.content,\n\t\t\tblocks: editedRecord?.blocks,\n\t\t\ttype: _type,\n\t\t\tid: _id,\n\t\t};\n\t}, [] );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\t// Replicates the logic found in getEditedPostContent().\n\tconst value = useMemo( () => {\n\t\tif ( content instanceof Function ) {\n\t\t\treturn content( { blocks } );\n\t\t} else if ( blocks ) {\n\t\t\t// If we have parsed blocks already, they should be our source of truth.\n\t\t\t// Parsing applies block deprecations and legacy block conversions that\n\t\t\t// unparsed content will not have.\n\t\t\treturn __unstableSerializeAndClean( blocks );\n\t\t}\n\t\treturn content;\n\t}, [ content, blocks ] );\n\n\treturn (\n\t\t<>\n\t\t\t<VisuallyHidden\n\t\t\t\tas=\"label\"\n\t\t\t\thtmlFor={ `post-content-${ instanceId }` }\n\t\t\t>\n\t\t\t\t{ __( 'Type text or HTML' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t<Textarea\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tdir=\"auto\"\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ ( event ) => {\n\t\t\t\t\teditEntityRecord( 'postType', type, id, {\n\t\t\t\t\t\tcontent: event.target.value,\n\t\t\t\t\t\tblocks: undefined,\n\t\t\t\t\t\tselection: undefined,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tclassName=\"editor-post-text-editor\"\n\t\t\t\tid={ `post-content-${ instanceId }` }\n\t\t\t\tplaceholder={ __( 'Start writing with text or HTML' ) }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AAAmD,IAAAS,WAAA,GAAAT,OAAA;AAnBnD;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,GACe,SAASU,cAAcA,CAAA,EAAG;EACxC,MAAMC,UAAU,GAAG,IA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,gBAAgB5B,UAAY,EAAG;MAAAwB,QAAA,EAExC,IAAAK,QAAE,EAAE,mBAAoB;IAAC,CACZ,CAAC,eACjB,IAAA/B,WAAA,CAAA2B,GAAA,EAACtC,sBAAA,CAAA2C,OAAQ;MACRC,YAAY,EAAC,KAAK;MAClBC,GAAG,EAAC,MAAM;MACVd,KAAK,EAAGA,KAAO;MACfe,QAAQ,EAAKC,KAAK,IAAM;QACvBlB,gBAAgB,CAAE,UAAU,EAAEZ,IAAI,EAAEC,EAAE,EAAE;UACvCH,OAAO,EAAEgC,KAAK,CAACC,MAAM,CAACjB,KAAK;UAC3Bf,MAAM,EAAEiC,SAAS;UACjBC,SAAS,EAAED;QACZ,CAAE,CAAC;MACJ,CAAG;MACHE,SAAS,EAAC,yBAAyB;MACnCjC,EAAE,EAAI,gBAAgBL,UAAY,EAAG;MACrCuC,WAAW,EAAG,IAAAV,QAAE,EAAE,iCAAkC;IAAG,CACvD,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_reactAutosizeTextarea","_interopRequireDefault","require","_i18n","_coreData","_element","_blocks","_data","_compose","_components","_store","_jsxRuntime","PostTextEditor","instanceId","useInstanceId","content","blocks","type","id","useSelect","select","getEditedEntityRecord","coreStore","getCurrentPostType","getCurrentPostId","editorStore","_type","_id","editedRecord","editEntityRecord","useDispatch","value","useMemo","Function","__unstableSerializeAndClean","jsxs","Fragment","children","jsx","VisuallyHidden","as","htmlFor","__","default","autoComplete","dir","onChange","event","target","undefined","selection","className","placeholder"],"sources":["@wordpress/editor/src/components/post-text-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport Textarea from 'react-autosize-textarea';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Displays the Post Text Editor along with content in Visual and Text mode.\n *\n * @return {JSX.Element|null} The rendered PostTextEditor component.\n */\nexport default function PostTextEditor() {\n\tconst instanceId = useInstanceId( PostTextEditor );\n\tconst { content, blocks, type, id } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\tconst _type = getCurrentPostType();\n\t\tconst _id = getCurrentPostId();\n\t\tconst editedRecord = getEditedEntityRecord( 'postType', _type, _id );\n\n\t\treturn {\n\t\t\tcontent: editedRecord?.content,\n\t\t\tblocks: editedRecord?.blocks,\n\t\t\ttype: _type,\n\t\t\tid: _id,\n\t\t};\n\t}, [] );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\t// Replicates the logic found in getEditedPostContent().\n\tconst value = useMemo( () => {\n\t\tif ( content instanceof Function ) {\n\t\t\treturn content( { blocks } );\n\t\t} else if ( blocks ) {\n\t\t\t// If we have parsed blocks already, they should be our source of truth.\n\t\t\t// Parsing applies block deprecations and legacy block conversions that\n\t\t\t// unparsed content will not have.\n\t\t\treturn __unstableSerializeAndClean( blocks );\n\t\t}\n\t\treturn content;\n\t}, [ content, blocks ] );\n\n\treturn (\n\t\t<>\n\t\t\t<VisuallyHidden\n\t\t\t\tas=\"label\"\n\t\t\t\thtmlFor={ `post-content-${ instanceId }` }\n\t\t\t>\n\t\t\t\t{ __( 'Type text or HTML' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t<Textarea\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tdir=\"auto\"\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ ( event ) => {\n\t\t\t\t\teditEntityRecord( 'postType', type, id, {\n\t\t\t\t\t\tcontent: event.target.value,\n\t\t\t\t\t\tblocks: undefined,\n\t\t\t\t\t\tselection: undefined,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tclassName=\"editor-post-text-editor\"\n\t\t\t\tid={ `post-content-${ instanceId }` }\n\t\t\t\tplaceholder={ __( 'Start writing with text or HTML' ) }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AAAmD,IAAAS,WAAA,GAAAT,OAAA;AAnBnD;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,GACe,SAASU,cAAcA,CAAA,EAAG;EACxC,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEF,cAAe,CAAC;EAClD,MAAM;IAAEG,OAAO;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EAAG,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC9D,MAAM;MAAEC;IAAsB,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IACrD,MAAM;MAAEC,kBAAkB;MAAEC;IAAiB,CAAC,GAAGJ,MAAM,CAAEK,YAAY,CAAC;IACtE,MAAMC,KAAK,GAAGH,kBAAkB,CAAC,CAAC;IAClC,MAAMI,GAAG,GAAGH,gBAAgB,CAAC,CAAC;IAC9B,MAAMI,YAAY,GAAGP,qBAAqB,CAAE,UAAU,EAAEK,KAAK,EAAEC,GAAI,CAAC;IAEpE,OAAO;MACNZ,OAAO,EAAEa,YAAY,EAAEb,OAAO;MAC9BC,MAAM,EAAEY,YAAY,EAAEZ,MAAM;MAC5BC,IAAI,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;IAAG,CACvD,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
@@ -164,26 +164,22 @@ function PostTitle(_, forwardedRef) {
164
164
  const className = (0, _clsx.default)(_constants.DEFAULT_CLASSNAMES, {
165
165
  'is-selected': isSelected
166
166
  });
167
- return (
168
- /*#__PURE__*/
169
- /* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */
170
- (0, _jsxRuntime.jsx)(_postTypeSupportCheck.default, {
171
- supportKeys: "title",
172
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
173
- ref: (0, _compose.useMergeRefs)([richTextRef, focusRef]),
174
- contentEditable: true,
175
- className: className,
176
- "aria-label": decodedPlaceholder,
177
- role: "textbox",
178
- "aria-multiline": "true",
179
- onFocus: onSelect,
180
- onBlur: onUnselect,
181
- onKeyDown: onKeyDown,
182
- onPaste: onPaste
183
- })
167
+ return /*#__PURE__*/ /* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */(0, _jsxRuntime.jsx)(_postTypeSupportCheck.default, {
168
+ supportKeys: "title",
169
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
170
+ ref: (0, _compose.useMergeRefs)([richTextRef, focusRef]),
171
+ contentEditable: true,
172
+ className: className,
173
+ "aria-label": decodedPlaceholder,
174
+ role: "textbox",
175
+ "aria-multiline": "true",
176
+ onFocus: onSelect,
177
+ onBlur: onUnselect,
178
+ onKeyDown: onKeyDown,
179
+ onPaste: onPaste
184
180
  })
185
- /* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */
186
- );
181
+ })
182
+ /* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */;
187
183
  }
188
184
 
189
185
  /**
@@ -1 +1 @@
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","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","isSelected","setIsSelected","useState","ref","focusRef","usePostTitleFocus","title","setTitle","onUpdate","usePostTitle","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","useDispatch","decodedPlaceholder","decodeEntities","__","value","onChange","richTextRef","useRichText","newValue","replace","REGEXP_NEWLINES","selectionStart","start","selectionEnd","end","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","ENTER","preventDefault","onPaste","clipboardData","plainText","html","getData","error","window","console","log","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","insert","create","className","clsx","DEFAULT_CLASSNAMES","jsx","default","supportKeys","children","useMergeRefs","contentEditable","role","onFocus","onBlur","_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\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 } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder } = getSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\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\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst {\n\t\tvalue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: title,\n\t\tonChange( newValue ) {\n\t\t\tonUpdate( newValue.replace( REGEXP_NEWLINES, ' ' ) );\n\t\t},\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\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\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error ) {\n\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t// behaviour.\n\t\t\treturn;\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\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\t\t\tonChange( insert( value, create( { html: contentNoHTML } ) ) );\n\t\t}\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} );\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\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;AAKA,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,O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EACD;;EAEA;EACA;EACA,MAAMM,SAAS,GAAG,IAAAC,aAAI,EAAEC,6BAAkB,EAAE;IAC3C,aAAa,EAAErE;EAChB,CAAE,CAAC;EAEH;IAAA;IACC;IACA,IAAAV,WAAA,CAAAgF,GAAA,EAACjF,qBAAA,CAAAkF,OAAoB;MAACC,WAAW,EAAC,OAAO;MAAAC,QAAA,eACxC,IAAAnF,WAAA,CAAAgF,GAAA;QACCnE,GAAG,EAAG,IAAAuE,qBAAY,EAAE,CAAErD,WAAW,EAAEjB,QAAQ,CAAG,CAAG;QACjDuE,eAAe;QACfR,SAAS,EAAGA,SAAW;QACvB,cAAanD,kBAAoB;QACjC4D,IAAI,EAAC,SAAS;QACd,kBAAe,MAAM;QACrBC,OAAO,EAAGxC,QAAU;QACpByC,MAAM,EAAGxC,UAAY;QACrBG,SAAS,EAAGA,SAAW;QACvBK,OAAO,EAAGA;MAAS,CACnB;IAAC,CACmB;IACtB;EAAA;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAiC,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAQe,IAAAU,mBAAU,EAAE1F,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","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","isSelected","setIsSelected","useState","ref","focusRef","usePostTitleFocus","title","setTitle","onUpdate","usePostTitle","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","useDispatch","decodedPlaceholder","decodeEntities","__","value","onChange","richTextRef","useRichText","newValue","replace","REGEXP_NEWLINES","selectionStart","start","selectionEnd","end","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","ENTER","preventDefault","onPaste","clipboardData","plainText","html","getData","error","window","console","log","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","insert","create","className","clsx","DEFAULT_CLASSNAMES","jsx","default","supportKeys","children","useMergeRefs","contentEditable","role","onFocus","onBlur","_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\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 } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder } = getSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\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\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst {\n\t\tvalue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: title,\n\t\tonChange( newValue ) {\n\t\t\tonUpdate( newValue.replace( REGEXP_NEWLINES, ' ' ) );\n\t\t},\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\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\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error ) {\n\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t// behaviour.\n\t\t\treturn;\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\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\t\t\tonChange( insert( value, create( { html: contentNoHTML } ) ) );\n\t\t}\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} );\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\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;AAKA,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;AA5B9D;AACA;AACA;;AAEA;AACA;AACA;;AAgBA;AACA;AACA;;AAMA,SAASgB,SAASA,CAAEC,CAAC,EAAEC,YAAY,EAAG;EACrC,MAAM;IAAEC;EAAY,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAChD,MAAM;MAAEC;IAAY,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IAClD,MAAM;MAAEC;IAAiB,CAAC,GAAGF,WAAW,CAAC,CAAC;IAE1C,OAAO;MAC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AoB;MACjC4D,IAAI,EAAC,SAAS;MACd,kBAAe,MAAM;MACrBC,OAAO,EAAGxC,QAAU;MACpByC,MAAM,EAAGxC,UAAY;MACrBG,SAAS,EAAGA,SAAW;MACvBK,OAAO,EAAGA;IAAS,CACnB;EAAC,CACmB;EACtB;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAiC,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAQe,IAAAU,mBAAU,EAAE1F,SAAU,CAAC","ignoreList":[]}
@@ -128,11 +128,11 @@ class PostTitle extends _element.Component {
128
128
  getTitle(title, postType) {
129
129
  if ('page' === postType) {
130
130
  return !title ? /* translators: accessibility text. empty page title. */
131
- (0, _i18n.__)('Page title. Empty') : (0, _i18n.sprintf)( /* translators: accessibility text. %s: text content of the page title. */
131
+ (0, _i18n.__)('Page title. Empty') : (0, _i18n.sprintf)(/* translators: accessibility text. %s: text content of the page title. */
132
132
  (0, _i18n.__)('Page title. %s'), title);
133
133
  }
134
134
  return !title ? /* translators: accessibility text. empty post title. */
135
- (0, _i18n.__)('Post title. Empty') : (0, _i18n.sprintf)( /* translators: accessibility text. %s: text content of the post title. */
135
+ (0, _i18n.__)('Post title. Empty') : (0, _i18n.sprintf)(/* translators: accessibility text. %s: text content of the post title. */
136
136
  (0, _i18n.__)('Post title. %s'), title);
137
137
  }
138
138
  render() {
@@ -1 +1 @@
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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G;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":[]}
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,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