@wordpress/editor 13.16.0 → 13.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (550) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/autocompleters/index.js +0 -2
  3. package/build/components/autocompleters/index.js.map +1 -1
  4. package/build/components/autocompleters/user.js +2 -9
  5. package/build/components/autocompleters/user.js.map +1 -1
  6. package/build/components/autosave-monitor/index.js +0 -24
  7. package/build/components/autosave-monitor/index.js.map +1 -1
  8. package/build/components/character-count/index.js +1 -4
  9. package/build/components/character-count/index.js.map +1 -1
  10. package/build/components/deprecated.js +1 -11
  11. package/build/components/deprecated.js.map +1 -1
  12. package/build/components/deprecated.native.js +0 -1
  13. package/build/components/deprecated.native.js.map +1 -1
  14. package/build/components/document-outline/check.js +1 -7
  15. package/build/components/document-outline/check.js.map +1 -1
  16. package/build/components/document-outline/index.js +7 -24
  17. package/build/components/document-outline/index.js.map +1 -1
  18. package/build/components/document-outline/item.js +1 -5
  19. package/build/components/document-outline/item.js.map +1 -1
  20. package/build/components/editor-help/add-blocks.native.js +1 -8
  21. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  22. package/build/components/editor-help/customize-blocks.native.js +1 -8
  23. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  24. package/build/components/editor-help/help-detail-navigation-screen.native.js +5 -13
  25. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  26. package/build/components/editor-help/help-get-support-button.native.js +1 -7
  27. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  28. package/build/components/editor-help/help-section-title.native.js +1 -7
  29. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  30. package/build/components/editor-help/help-topic-row.native.js +1 -8
  31. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  32. package/build/components/editor-help/icon-move-blocks.native.js +0 -4
  33. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  34. package/build/components/editor-help/index.native.js +8 -29
  35. package/build/components/editor-help/index.native.js.map +1 -1
  36. package/build/components/editor-help/intro-to-blocks.native.js +1 -9
  37. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  38. package/build/components/editor-help/move-blocks.native.js +1 -8
  39. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  40. package/build/components/editor-help/remove-blocks.native.js +1 -8
  41. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/view-sections.native.js +1 -12
  43. package/build/components/editor-help/view-sections.native.js.map +1 -1
  44. package/build/components/editor-history/redo.js +6 -14
  45. package/build/components/editor-history/redo.js.map +1 -1
  46. package/build/components/editor-history/undo.js +6 -14
  47. package/build/components/editor-history/undo.js.map +1 -1
  48. package/build/components/editor-notices/index.js +1 -10
  49. package/build/components/editor-notices/index.js.map +1 -1
  50. package/build/components/editor-snackbars/index.js +1 -5
  51. package/build/components/editor-snackbars/index.js.map +1 -1
  52. package/build/components/entities-saved-states/entity-record-item.js +3 -10
  53. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  54. package/build/components/entities-saved-states/entity-type-list.js +3 -15
  55. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  56. package/build/components/entities-saved-states/hooks/use-is-dirty.js +20 -24
  57. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  58. package/build/components/entities-saved-states/index.js +8 -27
  59. package/build/components/entities-saved-states/index.js.map +1 -1
  60. package/build/components/error-boundary/index.js +1 -18
  61. package/build/components/error-boundary/index.js.map +1 -1
  62. package/build/components/global-keyboard-shortcuts/index.js +5 -9
  63. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  64. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +1 -8
  65. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  66. package/build/components/index.js +4 -76
  67. package/build/components/index.js.map +1 -1
  68. package/build/components/index.native.js +0 -9
  69. package/build/components/index.native.js.map +1 -1
  70. package/build/components/local-autosave-monitor/index.js +6 -31
  71. package/build/components/local-autosave-monitor/index.js.map +1 -1
  72. package/build/components/media-categories/index.js +30 -45
  73. package/build/components/media-categories/index.js.map +1 -1
  74. package/build/components/page-attributes/check.js +3 -7
  75. package/build/components/page-attributes/check.js.map +1 -1
  76. package/build/components/page-attributes/order.js +17 -42
  77. package/build/components/page-attributes/order.js.map +1 -1
  78. package/build/components/page-attributes/parent.js +8 -34
  79. package/build/components/page-attributes/parent.js.map +1 -1
  80. package/build/components/post-author/check.js +1 -11
  81. package/build/components/post-author/check.js.map +1 -1
  82. package/build/components/post-author/combobox.js +7 -23
  83. package/build/components/post-author/combobox.js.map +1 -1
  84. package/build/components/post-author/constants.js +0 -1
  85. package/build/components/post-author/constants.js.map +1 -1
  86. package/build/components/post-author/index.js +1 -12
  87. package/build/components/post-author/index.js.map +1 -1
  88. package/build/components/post-author/select.js +1 -12
  89. package/build/components/post-author/select.js.map +1 -1
  90. package/build/components/post-comments/index.js +1 -10
  91. package/build/components/post-comments/index.js.map +1 -1
  92. package/build/components/post-excerpt/check.js +6 -8
  93. package/build/components/post-excerpt/check.js.map +1 -1
  94. package/build/components/post-excerpt/index.js +1 -7
  95. package/build/components/post-excerpt/index.js.map +1 -1
  96. package/build/components/post-featured-image/check.js +6 -9
  97. package/build/components/post-featured-image/check.js.map +1 -1
  98. package/build/components/post-featured-image/index.js +13 -42
  99. package/build/components/post-featured-image/index.js.map +1 -1
  100. package/build/components/post-format/check.js +9 -18
  101. package/build/components/post-format/check.js.map +1 -1
  102. package/build/components/post-format/index.js +2 -20
  103. package/build/components/post-format/index.js.map +1 -1
  104. package/build/components/post-last-revision/check.js +15 -22
  105. package/build/components/post-last-revision/check.js.map +1 -1
  106. package/build/components/post-last-revision/index.js +17 -28
  107. package/build/components/post-last-revision/index.js.map +1 -1
  108. package/build/components/post-locked-modal/index.js +8 -28
  109. package/build/components/post-locked-modal/index.js.map +1 -1
  110. package/build/components/post-pending-status/check.js +16 -24
  111. package/build/components/post-pending-status/check.js.map +1 -1
  112. package/build/components/post-pending-status/index.js +10 -28
  113. package/build/components/post-pending-status/index.js.map +1 -1
  114. package/build/components/post-pingbacks/index.js +1 -10
  115. package/build/components/post-pingbacks/index.js.map +1 -1
  116. package/build/components/post-preview-button/index.js +11 -22
  117. package/build/components/post-preview-button/index.js.map +1 -1
  118. package/build/components/post-publish-button/index.js +6 -32
  119. package/build/components/post-publish-button/index.js.map +1 -1
  120. package/build/components/post-publish-button/label.js +1 -10
  121. package/build/components/post-publish-button/label.js.map +1 -1
  122. package/build/components/post-publish-panel/index.js +1 -22
  123. package/build/components/post-publish-panel/index.js.map +1 -1
  124. package/build/components/post-publish-panel/maybe-category-panel.js +4 -14
  125. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  126. package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -18
  127. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  128. package/build/components/post-publish-panel/maybe-tags-panel.js +2 -17
  129. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  130. package/build/components/post-publish-panel/maybe-upload-media.js +1 -18
  131. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  132. package/build/components/post-publish-panel/postpublish.js +3 -27
  133. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  134. package/build/components/post-publish-panel/prepublish.js +1 -26
  135. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  136. package/build/components/post-saved-state/index.js +12 -29
  137. package/build/components/post-saved-state/index.js.map +1 -1
  138. package/build/components/post-schedule/check.js +1 -8
  139. package/build/components/post-schedule/check.js.map +1 -1
  140. package/build/components/post-schedule/index.js +7 -13
  141. package/build/components/post-schedule/index.js.map +1 -1
  142. package/build/components/post-schedule/label.js +18 -29
  143. package/build/components/post-schedule/label.js.map +1 -1
  144. package/build/components/post-slug/check.js +1 -4
  145. package/build/components/post-slug/check.js.map +1 -1
  146. package/build/components/post-slug/index.js +1 -19
  147. package/build/components/post-slug/index.js.map +1 -1
  148. package/build/components/post-sticky/check.js +1 -8
  149. package/build/components/post-sticky/check.js.map +1 -1
  150. package/build/components/post-sticky/index.js +1 -12
  151. package/build/components/post-sticky/index.js.map +1 -1
  152. package/build/components/post-switch-to-draft-button/index.js +1 -14
  153. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  154. package/build/components/post-sync-status/index.js +5 -18
  155. package/build/components/post-sync-status/index.js.map +1 -1
  156. package/build/components/post-taxonomies/check.js +1 -9
  157. package/build/components/post-taxonomies/check.js.map +1 -1
  158. package/build/components/post-taxonomies/flat-term-selector.js +15 -50
  159. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  160. package/build/components/post-taxonomies/hierarchical-term-selector.js +27 -79
  161. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  162. package/build/components/post-taxonomies/index.js +3 -13
  163. package/build/components/post-taxonomies/index.js.map +1 -1
  164. package/build/components/post-taxonomies/most-used-terms.js +1 -9
  165. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  166. package/build/components/post-template/index.js +1 -11
  167. package/build/components/post-template/index.js.map +1 -1
  168. package/build/components/post-text-editor/index.js +3 -17
  169. package/build/components/post-text-editor/index.js.map +1 -1
  170. package/build/components/post-title/index.js +14 -46
  171. package/build/components/post-title/index.js.map +1 -1
  172. package/build/components/post-title/index.native.js +7 -44
  173. package/build/components/post-title/index.native.js.map +1 -1
  174. package/build/components/post-trash/check.js +1 -7
  175. package/build/components/post-trash/check.js.map +1 -1
  176. package/build/components/post-trash/index.js +1 -8
  177. package/build/components/post-trash/index.js.map +1 -1
  178. package/build/components/post-type-support-check/index.js +0 -9
  179. package/build/components/post-type-support-check/index.js.map +1 -1
  180. package/build/components/post-url/check.js +1 -12
  181. package/build/components/post-url/check.js.map +1 -1
  182. package/build/components/post-url/index.js +3 -15
  183. package/build/components/post-url/index.js.map +1 -1
  184. package/build/components/post-url/label.js +1 -5
  185. package/build/components/post-url/label.js.map +1 -1
  186. package/build/components/post-visibility/check.js +1 -7
  187. package/build/components/post-visibility/check.js.map +1 -1
  188. package/build/components/post-visibility/index.js +1 -17
  189. package/build/components/post-visibility/index.js.map +1 -1
  190. package/build/components/post-visibility/label.js +1 -5
  191. package/build/components/post-visibility/label.js.map +1 -1
  192. package/build/components/post-visibility/utils.js +1 -2
  193. package/build/components/post-visibility/utils.js.map +1 -1
  194. package/build/components/provider/index.js +13 -27
  195. package/build/components/provider/index.js.map +1 -1
  196. package/build/components/provider/index.native.js +18 -70
  197. package/build/components/provider/index.native.js.map +1 -1
  198. package/build/components/provider/use-block-editor-settings.js +9 -20
  199. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  200. package/build/components/provider/use-block-editor-settings.native.js +5 -11
  201. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  202. package/build/components/provider/with-registry-provider.js +5 -12
  203. package/build/components/provider/with-registry-provider.js.map +1 -1
  204. package/build/components/table-of-contents/index.js +4 -14
  205. package/build/components/table-of-contents/index.js.map +1 -1
  206. package/build/components/table-of-contents/panel.js +1 -13
  207. package/build/components/table-of-contents/panel.js.map +1 -1
  208. package/build/components/template-validation-notice/index.js +3 -12
  209. package/build/components/template-validation-notice/index.js.map +1 -1
  210. package/build/components/theme-support-check/index.js +3 -12
  211. package/build/components/theme-support-check/index.js.map +1 -1
  212. package/build/components/time-to-read/index.js +2 -10
  213. package/build/components/time-to-read/index.js.map +1 -1
  214. package/build/components/unsaved-changes-warning/index.js +21 -35
  215. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  216. package/build/components/word-count/index.js +2 -7
  217. package/build/components/word-count/index.js.map +1 -1
  218. package/build/hooks/custom-sources-backwards-compatibility.js +7 -18
  219. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  220. package/build/hooks/default-autocompleters.js +3 -4
  221. package/build/hooks/default-autocompleters.js.map +1 -1
  222. package/build/hooks/index.js +0 -1
  223. package/build/hooks/index.js.map +1 -1
  224. package/build/hooks/index.native.js.map +1 -1
  225. package/build/index.js +0 -9
  226. package/build/index.js.map +1 -1
  227. package/build/index.native.js +0 -11
  228. package/build/index.native.js.map +1 -1
  229. package/build/lock-unlock.js +1 -2
  230. package/build/lock-unlock.js.map +1 -1
  231. package/build/private-apis.js +1 -4
  232. package/build/private-apis.js.map +1 -1
  233. package/build/store/actions.js +60 -129
  234. package/build/store/actions.js.map +1 -1
  235. package/build/store/actions.native.js +1 -8
  236. package/build/store/actions.native.js.map +1 -1
  237. package/build/store/constants.js +1 -2
  238. package/build/store/constants.js.map +1 -1
  239. package/build/store/defaults.js +2 -3
  240. package/build/store/defaults.js.map +1 -1
  241. package/build/store/index.js +3 -11
  242. package/build/store/index.js.map +1 -1
  243. package/build/store/local-autosave.js +0 -4
  244. package/build/store/local-autosave.js.map +1 -1
  245. package/build/store/reducer.js +19 -49
  246. package/build/store/reducer.js.map +1 -1
  247. package/build/store/reducer.native.js +3 -17
  248. package/build/store/reducer.native.js.map +1 -1
  249. package/build/store/selectors.js +169 -295
  250. package/build/store/selectors.js.map +1 -1
  251. package/build/store/selectors.native.js +4 -11
  252. package/build/store/selectors.native.js.map +1 -1
  253. package/build/store/utils/notice-builder.js +13 -24
  254. package/build/store/utils/notice-builder.js.map +1 -1
  255. package/build/utils/get-template-part-icon.js +0 -3
  256. package/build/utils/get-template-part-icon.js.map +1 -1
  257. package/build/utils/index.js +0 -4
  258. package/build/utils/index.js.map +1 -1
  259. package/build/utils/index.native.js +0 -2
  260. package/build/utils/index.native.js.map +1 -1
  261. package/build/utils/media-upload/index.js +2 -6
  262. package/build/utils/media-upload/index.js.map +1 -1
  263. package/build/utils/media-upload/index.native.js +0 -1
  264. package/build/utils/media-upload/index.native.js.map +1 -1
  265. package/build/utils/terms.js +8 -18
  266. package/build/utils/terms.js.map +1 -1
  267. package/build/utils/url.js +0 -4
  268. package/build/utils/url.js.map +1 -1
  269. package/build-module/components/autocompleters/index.js.map +1 -1
  270. package/build-module/components/autocompleters/user.js +2 -5
  271. package/build-module/components/autocompleters/user.js.map +1 -1
  272. package/build-module/components/autosave-monitor/index.js +2 -17
  273. package/build-module/components/autosave-monitor/index.js.map +1 -1
  274. package/build-module/components/character-count/index.js +1 -1
  275. package/build-module/components/character-count/index.js.map +1 -1
  276. package/build-module/components/deprecated.js +0 -4
  277. package/build-module/components/deprecated.js.map +1 -1
  278. package/build-module/components/deprecated.native.js +0 -1
  279. package/build-module/components/deprecated.native.js.map +1 -1
  280. package/build-module/components/document-outline/check.js +0 -4
  281. package/build-module/components/document-outline/check.js.map +1 -1
  282. package/build-module/components/document-outline/index.js +9 -13
  283. package/build-module/components/document-outline/index.js.map +1 -1
  284. package/build-module/components/document-outline/item.js +0 -3
  285. package/build-module/components/document-outline/item.js.map +1 -1
  286. package/build-module/components/editor-help/add-blocks.native.js +2 -5
  287. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  288. package/build-module/components/editor-help/customize-blocks.native.js +2 -5
  289. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  290. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +6 -8
  291. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  292. package/build-module/components/editor-help/help-get-support-button.native.js +2 -5
  293. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  294. package/build-module/components/editor-help/help-section-title.native.js +2 -5
  295. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  296. package/build-module/components/editor-help/help-topic-row.native.js +1 -6
  297. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  298. package/build-module/components/editor-help/icon-move-blocks.native.js +0 -1
  299. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  300. package/build-module/components/editor-help/index.native.js +9 -9
  301. package/build-module/components/editor-help/index.native.js.map +1 -1
  302. package/build-module/components/editor-help/intro-to-blocks.native.js +2 -5
  303. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  304. package/build-module/components/editor-help/move-blocks.native.js +2 -5
  305. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  306. package/build-module/components/editor-help/remove-blocks.native.js +2 -5
  307. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  308. package/build-module/components/editor-help/view-sections.native.js +2 -4
  309. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  310. package/build-module/components/editor-history/redo.js +6 -8
  311. package/build-module/components/editor-history/redo.js.map +1 -1
  312. package/build-module/components/editor-history/undo.js +6 -8
  313. package/build-module/components/editor-history/undo.js.map +1 -1
  314. package/build-module/components/editor-notices/index.js +1 -2
  315. package/build-module/components/editor-notices/index.js.map +1 -1
  316. package/build-module/components/editor-snackbars/index.js +0 -1
  317. package/build-module/components/editor-snackbars/index.js.map +1 -1
  318. package/build-module/components/entities-saved-states/entity-record-item.js +3 -4
  319. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  320. package/build-module/components/entities-saved-states/entity-type-list.js +3 -10
  321. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  322. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +20 -18
  323. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  324. package/build-module/components/entities-saved-states/index.js +8 -16
  325. package/build-module/components/entities-saved-states/index.js.map +1 -1
  326. package/build-module/components/error-boundary/index.js +1 -12
  327. package/build-module/components/error-boundary/index.js.map +1 -1
  328. package/build-module/components/global-keyboard-shortcuts/index.js +5 -6
  329. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  330. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +0 -3
  331. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  332. package/build-module/components/index.js +6 -3
  333. package/build-module/components/index.js.map +1 -1
  334. package/build-module/components/index.native.js +4 -2
  335. package/build-module/components/index.native.js.map +1 -1
  336. package/build-module/components/local-autosave-monitor/index.js +6 -21
  337. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  338. package/build-module/components/media-categories/index.js +31 -41
  339. package/build-module/components/media-categories/index.js.map +1 -1
  340. package/build-module/components/page-attributes/check.js +3 -3
  341. package/build-module/components/page-attributes/check.js.map +1 -1
  342. package/build-module/components/page-attributes/order.js +17 -31
  343. package/build-module/components/page-attributes/order.js.map +1 -1
  344. package/build-module/components/page-attributes/parent.js +9 -23
  345. package/build-module/components/page-attributes/parent.js.map +1 -1
  346. package/build-module/components/post-author/check.js +1 -5
  347. package/build-module/components/post-author/check.js.map +1 -1
  348. package/build-module/components/post-author/combobox.js +7 -16
  349. package/build-module/components/post-author/combobox.js.map +1 -1
  350. package/build-module/components/post-author/constants.js +0 -1
  351. package/build-module/components/post-author/constants.js.map +1 -1
  352. package/build-module/components/post-author/index.js +1 -6
  353. package/build-module/components/post-author/index.js.map +1 -1
  354. package/build-module/components/post-author/select.js +1 -6
  355. package/build-module/components/post-author/select.js.map +1 -1
  356. package/build-module/components/post-comments/index.js +1 -7
  357. package/build-module/components/post-comments/index.js.map +1 -1
  358. package/build-module/components/post-excerpt/check.js +5 -6
  359. package/build-module/components/post-excerpt/check.js.map +1 -1
  360. package/build-module/components/post-excerpt/index.js +1 -4
  361. package/build-module/components/post-excerpt/index.js.map +1 -1
  362. package/build-module/components/post-featured-image/check.js +5 -6
  363. package/build-module/components/post-featured-image/check.js.map +1 -1
  364. package/build-module/components/post-featured-image/index.js +13 -31
  365. package/build-module/components/post-featured-image/index.js.map +1 -1
  366. package/build-module/components/post-format/check.js +10 -15
  367. package/build-module/components/post-format/check.js.map +1 -1
  368. package/build-module/components/post-format/index.js +4 -12
  369. package/build-module/components/post-format/index.js.map +1 -1
  370. package/build-module/components/post-last-revision/check.js +17 -17
  371. package/build-module/components/post-last-revision/check.js.map +1 -1
  372. package/build-module/components/post-last-revision/index.js +18 -21
  373. package/build-module/components/post-last-revision/index.js.map +1 -1
  374. package/build-module/components/post-locked-modal/index.js +8 -22
  375. package/build-module/components/post-locked-modal/index.js.map +1 -1
  376. package/build-module/components/post-pending-status/check.js +17 -20
  377. package/build-module/components/post-pending-status/check.js.map +1 -1
  378. package/build-module/components/post-pending-status/index.js +11 -20
  379. package/build-module/components/post-pending-status/index.js.map +1 -1
  380. package/build-module/components/post-pingbacks/index.js +1 -7
  381. package/build-module/components/post-pingbacks/index.js.map +1 -1
  382. package/build-module/components/post-preview-button/index.js +11 -17
  383. package/build-module/components/post-preview-button/index.js.map +1 -1
  384. package/build-module/components/post-publish-button/index.js +7 -23
  385. package/build-module/components/post-publish-button/index.js.map +1 -1
  386. package/build-module/components/post-publish-button/label.js +1 -4
  387. package/build-module/components/post-publish-button/label.js.map +1 -1
  388. package/build-module/components/post-publish-panel/index.js +1 -8
  389. package/build-module/components/post-publish-panel/index.js.map +1 -1
  390. package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -8
  391. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  392. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -12
  393. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  394. package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -9
  395. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  396. package/build-module/components/post-publish-panel/maybe-upload-media.js +1 -12
  397. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  398. package/build-module/components/post-publish-panel/postpublish.js +3 -16
  399. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  400. package/build-module/components/post-publish-panel/prepublish.js +1 -10
  401. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  402. package/build-module/components/post-saved-state/index.js +15 -23
  403. package/build-module/components/post-saved-state/index.js.map +1 -1
  404. package/build-module/components/post-schedule/check.js +1 -3
  405. package/build-module/components/post-schedule/check.js.map +1 -1
  406. package/build-module/components/post-schedule/index.js +8 -8
  407. package/build-module/components/post-schedule/index.js.map +1 -1
  408. package/build-module/components/post-schedule/label.js +18 -22
  409. package/build-module/components/post-schedule/label.js.map +1 -1
  410. package/build-module/components/post-slug/check.js +0 -1
  411. package/build-module/components/post-slug/check.js.map +1 -1
  412. package/build-module/components/post-slug/index.js +1 -8
  413. package/build-module/components/post-slug/index.js.map +1 -1
  414. package/build-module/components/post-sticky/check.js +1 -3
  415. package/build-module/components/post-sticky/check.js.map +1 -1
  416. package/build-module/components/post-sticky/index.js +1 -3
  417. package/build-module/components/post-sticky/index.js.map +1 -1
  418. package/build-module/components/post-switch-to-draft-button/index.js +1 -9
  419. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  420. package/build-module/components/post-sync-status/index.js +5 -11
  421. package/build-module/components/post-sync-status/index.js.map +1 -1
  422. package/build-module/components/post-taxonomies/check.js +1 -3
  423. package/build-module/components/post-taxonomies/check.js.map +1 -1
  424. package/build-module/components/post-taxonomies/flat-term-selector.js +17 -39
  425. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  426. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +29 -66
  427. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  428. package/build-module/components/post-taxonomies/index.js +3 -5
  429. package/build-module/components/post-taxonomies/index.js.map +1 -1
  430. package/build-module/components/post-taxonomies/most-used-terms.js +1 -4
  431. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  432. package/build-module/components/post-template/index.js +1 -5
  433. package/build-module/components/post-template/index.js.map +1 -1
  434. package/build-module/components/post-text-editor/index.js +4 -9
  435. package/build-module/components/post-text-editor/index.js.map +1 -1
  436. package/build-module/components/post-title/index.js +17 -35
  437. package/build-module/components/post-title/index.js.map +1 -1
  438. package/build-module/components/post-title/index.native.js +8 -33
  439. package/build-module/components/post-title/index.native.js.map +1 -1
  440. package/build-module/components/post-trash/check.js +1 -4
  441. package/build-module/components/post-trash/check.js.map +1 -1
  442. package/build-module/components/post-trash/index.js +1 -4
  443. package/build-module/components/post-trash/index.js.map +1 -1
  444. package/build-module/components/post-type-support-check/index.js +3 -6
  445. package/build-module/components/post-type-support-check/index.js.map +1 -1
  446. package/build-module/components/post-url/check.js +1 -9
  447. package/build-module/components/post-url/check.js.map +1 -1
  448. package/build-module/components/post-url/index.js +3 -8
  449. package/build-module/components/post-url/index.js.map +1 -1
  450. package/build-module/components/post-url/label.js +1 -1
  451. package/build-module/components/post-url/label.js.map +1 -1
  452. package/build-module/components/post-visibility/check.js +1 -2
  453. package/build-module/components/post-visibility/check.js.map +1 -1
  454. package/build-module/components/post-visibility/index.js +1 -10
  455. package/build-module/components/post-visibility/index.js.map +1 -1
  456. package/build-module/components/post-visibility/label.js +1 -1
  457. package/build-module/components/post-visibility/label.js.map +1 -1
  458. package/build-module/components/post-visibility/utils.js.map +1 -1
  459. package/build-module/components/provider/index.js +13 -14
  460. package/build-module/components/provider/index.js.map +1 -1
  461. package/build-module/components/provider/index.native.js +21 -52
  462. package/build-module/components/provider/index.native.js.map +1 -1
  463. package/build-module/components/provider/use-block-editor-settings.js +9 -12
  464. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  465. package/build-module/components/provider/use-block-editor-settings.native.js +5 -5
  466. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  467. package/build-module/components/provider/with-registry-provider.js +5 -8
  468. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  469. package/build-module/components/table-of-contents/index.js +4 -7
  470. package/build-module/components/table-of-contents/index.js.map +1 -1
  471. package/build-module/components/table-of-contents/panel.js +1 -5
  472. package/build-module/components/table-of-contents/panel.js.map +1 -1
  473. package/build-module/components/template-validation-notice/index.js +2 -6
  474. package/build-module/components/template-validation-notice/index.js.map +1 -1
  475. package/build-module/components/theme-support-check/index.js +3 -7
  476. package/build-module/components/theme-support-check/index.js.map +1 -1
  477. package/build-module/components/time-to-read/index.js +4 -7
  478. package/build-module/components/time-to-read/index.js.map +1 -1
  479. package/build-module/components/unsaved-changes-warning/index.js +22 -31
  480. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  481. package/build-module/components/word-count/index.js +2 -4
  482. package/build-module/components/word-count/index.js.map +1 -1
  483. package/build-module/hooks/custom-sources-backwards-compatibility.js +9 -15
  484. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  485. package/build-module/hooks/default-autocompleters.js +3 -4
  486. package/build-module/hooks/default-autocompleters.js.map +1 -1
  487. package/build-module/hooks/index.js.map +1 -1
  488. package/build-module/hooks/index.native.js.map +1 -1
  489. package/build-module/index.js +1 -1
  490. package/build-module/index.js.map +1 -1
  491. package/build-module/index.native.js +1 -1
  492. package/build-module/index.native.js.map +1 -1
  493. package/build-module/lock-unlock.js.map +1 -1
  494. package/build-module/private-apis.js.map +1 -1
  495. package/build-module/store/actions.js +62 -84
  496. package/build-module/store/actions.js.map +1 -1
  497. package/build-module/store/actions.native.js +2 -2
  498. package/build-module/store/actions.native.js.map +1 -1
  499. package/build-module/store/constants.js +1 -1
  500. package/build-module/store/constants.js.map +1 -1
  501. package/build-module/store/defaults.js +3 -2
  502. package/build-module/store/defaults.js.map +1 -1
  503. package/build-module/store/index.js +5 -4
  504. package/build-module/store/index.js.map +1 -1
  505. package/build-module/store/local-autosave.js +0 -1
  506. package/build-module/store/local-autosave.js.map +1 -1
  507. package/build-module/store/reducer.js +21 -33
  508. package/build-module/store/reducer.js.map +1 -1
  509. package/build-module/store/reducer.native.js +4 -10
  510. package/build-module/store/reducer.native.js.map +1 -1
  511. package/build-module/store/selectors.js +172 -222
  512. package/build-module/store/selectors.js.map +1 -1
  513. package/build-module/store/selectors.native.js +6 -8
  514. package/build-module/store/selectors.native.js.map +1 -1
  515. package/build-module/store/utils/notice-builder.js +15 -21
  516. package/build-module/store/utils/notice-builder.js.map +1 -1
  517. package/build-module/utils/get-template-part-icon.js +0 -2
  518. package/build-module/utils/get-template-part-icon.js.map +1 -1
  519. package/build-module/utils/index.js.map +1 -1
  520. package/build-module/utils/index.native.js.map +1 -1
  521. package/build-module/utils/media-upload/index.js +2 -4
  522. package/build-module/utils/media-upload/index.js.map +1 -1
  523. package/build-module/utils/media-upload/index.native.js.map +1 -1
  524. package/build-module/utils/terms.js +9 -11
  525. package/build-module/utils/terms.js.map +1 -1
  526. package/build-module/utils/url.js +1 -1
  527. package/build-module/utils/url.js.map +1 -1
  528. package/build-style/style-rtl.css +10 -17
  529. package/build-style/style.css +10 -17
  530. package/package.json +32 -31
  531. package/src/components/editor-help/index.native.js +1 -1
  532. package/src/components/editor-help/style.scss +5 -0
  533. package/src/components/entities-saved-states/hooks/use-is-dirty.js +16 -20
  534. package/src/components/page-attributes/order.js +15 -23
  535. package/src/components/page-attributes/test/order.js +46 -15
  536. package/src/components/post-excerpt/check.js +6 -2
  537. package/src/components/post-featured-image/check.js +4 -2
  538. package/src/components/post-format/check.js +16 -11
  539. package/src/components/post-last-revision/check.js +12 -14
  540. package/src/components/post-last-revision/index.js +12 -10
  541. package/src/components/post-last-revision/test/check.js +28 -16
  542. package/src/components/post-pending-status/check.js +13 -19
  543. package/src/components/post-pending-status/index.js +9 -14
  544. package/src/components/post-pending-status/test/check.js +32 -10
  545. package/src/components/post-publish-panel/style.scss +12 -25
  546. package/src/components/post-sync-status/style.scss +4 -1
  547. package/src/components/post-type-support-check/index.js +1 -1
  548. package/src/components/post-type-support-check/test/index.js +1 -1
  549. package/src/components/provider/index.js +3 -2
  550. package/src/components/unsaved-changes-warning/index.js +22 -27
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -57,7 +56,6 @@ exports.isEditedPostNew = isEditedPostNew;
57
56
  exports.isEditedPostPublishable = isEditedPostPublishable;
58
57
  exports.isEditedPostSaveable = isEditedPostSaveable;
59
58
  exports.isMultiSelecting = exports.isFirstMultiSelectedBlock = void 0;
60
- exports.isMultiSelecting = exports.isFirstMultiSelectedBlock = void 0;
61
59
  exports.isPermalinkEditable = isPermalinkEditable;
62
60
  exports.isPostAutosavingLocked = isPostAutosavingLocked;
63
61
  exports.isPostLockTakeover = isPostLockTakeover;
@@ -69,35 +67,20 @@ exports.isPublishingPost = isPublishingPost;
69
67
  exports.isSavingNonPostEntityChanges = void 0;
70
68
  exports.isSavingPost = isSavingPost;
71
69
  exports.isValidTemplate = exports.isTyping = exports.isSelectionEnabled = void 0;
72
-
73
70
  var _rememo = _interopRequireDefault(require("rememo"));
74
-
75
71
  var _blocks = require("@wordpress/blocks");
76
-
77
72
  var _date = require("@wordpress/date");
78
-
79
73
  var _url = require("@wordpress/url");
80
-
81
74
  var _data = require("@wordpress/data");
82
-
83
75
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
84
-
85
76
  var _element = require("@wordpress/element");
86
-
87
77
  var _icons = require("@wordpress/icons");
88
-
89
78
  var _blockEditor = require("@wordpress/block-editor");
90
-
91
79
  var _coreData = require("@wordpress/core-data");
92
-
93
80
  var _preferences = require("@wordpress/preferences");
94
-
95
81
  var _constants = require("./constants");
96
-
97
82
  var _reducer = require("./reducer");
98
-
99
83
  var _getTemplatePartIcon = require("../utils/get-template-part-icon");
100
-
101
84
  /**
102
85
  * External dependencies
103
86
  */
@@ -118,6 +101,7 @@ var _getTemplatePartIcon = require("../utils/get-template-part-icon");
118
101
  * maintained by the reducer result in state.
119
102
  */
120
103
  const EMPTY_OBJECT = {};
104
+
121
105
  /**
122
106
  * Returns true if any past editor history snapshots exist, or false otherwise.
123
107
  *
@@ -125,10 +109,10 @@ const EMPTY_OBJECT = {};
125
109
  *
126
110
  * @return {boolean} Whether undo history exists.
127
111
  */
128
-
129
112
  const hasEditorUndo = (0, _data.createRegistrySelector)(select => () => {
130
113
  return select(_coreData.store).hasUndo();
131
114
  });
115
+
132
116
  /**
133
117
  * Returns true if any future editor history snapshots exist, or false
134
118
  * otherwise.
@@ -137,11 +121,11 @@ const hasEditorUndo = (0, _data.createRegistrySelector)(select => () => {
137
121
  *
138
122
  * @return {boolean} Whether redo history exists.
139
123
  */
140
-
141
124
  exports.hasEditorUndo = hasEditorUndo;
142
125
  const hasEditorRedo = (0, _data.createRegistrySelector)(select => () => {
143
126
  return select(_coreData.store).hasRedo();
144
127
  });
128
+
145
129
  /**
146
130
  * Returns true if the currently edited post is yet to be saved, or false if
147
131
  * the post has been saved.
@@ -150,12 +134,11 @@ const hasEditorRedo = (0, _data.createRegistrySelector)(select => () => {
150
134
  *
151
135
  * @return {boolean} Whether the post is new.
152
136
  */
153
-
154
137
  exports.hasEditorRedo = hasEditorRedo;
155
-
156
138
  function isEditedPostNew(state) {
157
139
  return getCurrentPost(state).status === 'auto-draft';
158
140
  }
141
+
159
142
  /**
160
143
  * Returns true if content includes unsaved changes, or false otherwise.
161
144
  *
@@ -163,12 +146,11 @@ function isEditedPostNew(state) {
163
146
  *
164
147
  * @return {boolean} Whether content includes unsaved changes.
165
148
  */
166
-
167
-
168
149
  function hasChangedContent(state) {
169
150
  const edits = getPostEdits(state);
170
151
  return 'content' in edits;
171
152
  }
153
+
172
154
  /**
173
155
  * Returns true if there are unsaved values for the current edit session, or
174
156
  * false if the editing state matches the saved or new post.
@@ -177,21 +159,18 @@ function hasChangedContent(state) {
177
159
  *
178
160
  * @return {boolean} Whether unsaved values exist.
179
161
  */
180
-
181
-
182
162
  const isEditedPostDirty = (0, _data.createRegistrySelector)(select => state => {
183
163
  // Edits should contain only fields which differ from the saved post (reset
184
164
  // at initial load and save complete). Thus, a non-empty edits state can be
185
165
  // inferred to contain unsaved values.
186
166
  const postType = getCurrentPostType(state);
187
167
  const postId = getCurrentPostId(state);
188
-
189
168
  if (select(_coreData.store).hasEditsForEntityRecord('postType', postType, postId)) {
190
169
  return true;
191
170
  }
192
-
193
171
  return false;
194
172
  });
173
+
195
174
  /**
196
175
  * Returns true if there are unsaved edits for entities other than
197
176
  * the editor's post, and false otherwise.
@@ -200,17 +179,16 @@ const isEditedPostDirty = (0, _data.createRegistrySelector)(select => state => {
200
179
  *
201
180
  * @return {boolean} Whether there are edits or not.
202
181
  */
203
-
204
182
  exports.isEditedPostDirty = isEditedPostDirty;
205
183
  const hasNonPostEntityChanges = (0, _data.createRegistrySelector)(select => state => {
206
184
  const dirtyEntityRecords = select(_coreData.store).__experimentalGetDirtyEntityRecords();
207
-
208
185
  const {
209
186
  type,
210
187
  id
211
188
  } = getCurrentPost(state);
212
189
  return dirtyEntityRecords.some(entityRecord => entityRecord.kind !== 'postType' || entityRecord.name !== type || entityRecord.key !== id);
213
190
  });
191
+
214
192
  /**
215
193
  * Returns true if there are no unsaved values for the current edit session and
216
194
  * if the currently edited post is new (has never been saved before).
@@ -219,12 +197,11 @@ const hasNonPostEntityChanges = (0, _data.createRegistrySelector)(select => stat
219
197
  *
220
198
  * @return {boolean} Whether new post and unsaved values exist.
221
199
  */
222
-
223
200
  exports.hasNonPostEntityChanges = hasNonPostEntityChanges;
224
-
225
201
  function isCleanNewPost(state) {
226
202
  return !isEditedPostDirty(state) && isEditedPostNew(state);
227
203
  }
204
+
228
205
  /**
229
206
  * Returns the post currently being edited in its last known saved state, not
230
207
  * including unsaved edits. Returns an object containing relevant default post
@@ -234,22 +211,20 @@ function isCleanNewPost(state) {
234
211
  *
235
212
  * @return {Object} Post object.
236
213
  */
237
-
238
-
239
214
  const getCurrentPost = (0, _data.createRegistrySelector)(select => state => {
240
215
  const postId = getCurrentPostId(state);
241
216
  const postType = getCurrentPostType(state);
242
217
  const post = select(_coreData.store).getRawEntityRecord('postType', postType, postId);
243
-
244
218
  if (post) {
245
219
  return post;
246
- } // This exists for compatibility with the previous selector behavior
220
+ }
221
+
222
+ // This exists for compatibility with the previous selector behavior
247
223
  // which would guarantee an object return based on the editor reducer's
248
224
  // default empty object state.
249
-
250
-
251
225
  return EMPTY_OBJECT;
252
226
  });
227
+
253
228
  /**
254
229
  * Returns the post type of the post currently being edited.
255
230
  *
@@ -257,12 +232,11 @@ const getCurrentPost = (0, _data.createRegistrySelector)(select => state => {
257
232
  *
258
233
  * @return {string} Post type.
259
234
  */
260
-
261
235
  exports.getCurrentPost = getCurrentPost;
262
-
263
236
  function getCurrentPostType(state) {
264
237
  return state.postType;
265
238
  }
239
+
266
240
  /**
267
241
  * Returns the ID of the post currently being edited, or null if the post has
268
242
  * not yet been saved.
@@ -271,11 +245,10 @@ function getCurrentPostType(state) {
271
245
  *
272
246
  * @return {?number} ID of current post.
273
247
  */
274
-
275
-
276
248
  function getCurrentPostId(state) {
277
249
  return state.postId;
278
250
  }
251
+
279
252
  /**
280
253
  * Returns the number of revisions of the post currently being edited.
281
254
  *
@@ -283,13 +256,11 @@ function getCurrentPostId(state) {
283
256
  *
284
257
  * @return {number} Number of revisions.
285
258
  */
286
-
287
-
288
259
  function getCurrentPostRevisionsCount(state) {
289
260
  var _getCurrentPost$_link;
290
-
291
261
  return (_getCurrentPost$_link = getCurrentPost(state)._links?.['version-history']?.[0]?.count) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : 0;
292
262
  }
263
+
293
264
  /**
294
265
  * Returns the last revision ID of the post currently being edited,
295
266
  * or null if the post has no revisions.
@@ -298,13 +269,11 @@ function getCurrentPostRevisionsCount(state) {
298
269
  *
299
270
  * @return {?number} ID of the last revision.
300
271
  */
301
-
302
-
303
272
  function getCurrentPostLastRevisionId(state) {
304
273
  var _getCurrentPost$_link2;
305
-
306
274
  return (_getCurrentPost$_link2 = getCurrentPost(state)._links?.['predecessor-version']?.[0]?.id) !== null && _getCurrentPost$_link2 !== void 0 ? _getCurrentPost$_link2 : null;
307
275
  }
276
+
308
277
  /**
309
278
  * Returns any post values which have been changed in the editor but not yet
310
279
  * been saved.
@@ -313,13 +282,12 @@ function getCurrentPostLastRevisionId(state) {
313
282
  *
314
283
  * @return {Object} Object of key value pairs comprising unsaved edits.
315
284
  */
316
-
317
-
318
285
  const getPostEdits = (0, _data.createRegistrySelector)(select => state => {
319
286
  const postType = getCurrentPostType(state);
320
287
  const postId = getCurrentPostId(state);
321
288
  return select(_coreData.store).getEntityRecordEdits('postType', postType, postId) || EMPTY_OBJECT;
322
289
  });
290
+
323
291
  /**
324
292
  * Returns an attribute value of the saved post.
325
293
  *
@@ -328,27 +296,22 @@ const getPostEdits = (0, _data.createRegistrySelector)(select => state => {
328
296
  *
329
297
  * @return {*} Post attribute value.
330
298
  */
331
-
332
299
  exports.getPostEdits = getPostEdits;
333
-
334
300
  function getCurrentPostAttribute(state, attributeName) {
335
301
  switch (attributeName) {
336
302
  case 'type':
337
303
  return getCurrentPostType(state);
338
-
339
304
  case 'id':
340
305
  return getCurrentPostId(state);
341
-
342
306
  default:
343
307
  const post = getCurrentPost(state);
344
-
345
308
  if (!post.hasOwnProperty(attributeName)) {
346
309
  break;
347
310
  }
348
-
349
311
  return (0, _reducer.getPostRawValue)(post[attributeName]);
350
312
  }
351
313
  }
314
+
352
315
  /**
353
316
  * Returns a single attribute of the post being edited, preferring the unsaved
354
317
  * edit if one exists, but merging with the attribute value for the last known
@@ -359,19 +322,17 @@ function getCurrentPostAttribute(state, attributeName) {
359
322
  *
360
323
  * @return {*} Post attribute value.
361
324
  */
362
-
363
-
364
325
  const getNestedEditedPostProperty = (state, attributeName) => {
365
326
  const edits = getPostEdits(state);
366
-
367
327
  if (!edits.hasOwnProperty(attributeName)) {
368
328
  return getCurrentPostAttribute(state, attributeName);
369
329
  }
370
-
371
- return { ...getCurrentPostAttribute(state, attributeName),
330
+ return {
331
+ ...getCurrentPostAttribute(state, attributeName),
372
332
  ...edits[attributeName]
373
333
  };
374
334
  };
335
+
375
336
  /**
376
337
  * Returns a single attribute of the post being edited, preferring the unsaved
377
338
  * edit if one exists, but falling back to the attribute for the last known
@@ -382,30 +343,27 @@ const getNestedEditedPostProperty = (state, attributeName) => {
382
343
  *
383
344
  * @return {*} Post attribute value.
384
345
  */
385
-
386
-
387
346
  function getEditedPostAttribute(state, attributeName) {
388
347
  // Special cases.
389
348
  switch (attributeName) {
390
349
  case 'content':
391
350
  return getEditedPostContent(state);
392
- } // Fall back to saved post value if not edited.
393
-
351
+ }
394
352
 
353
+ // Fall back to saved post value if not edited.
395
354
  const edits = getPostEdits(state);
396
-
397
355
  if (!edits.hasOwnProperty(attributeName)) {
398
356
  return getCurrentPostAttribute(state, attributeName);
399
- } // Merge properties are objects which contain only the patch edit in state,
400
- // and thus must be merged with the current post attribute.
401
-
357
+ }
402
358
 
359
+ // Merge properties are objects which contain only the patch edit in state,
360
+ // and thus must be merged with the current post attribute.
403
361
  if (_constants.EDIT_MERGE_PROPERTIES.has(attributeName)) {
404
362
  return getNestedEditedPostProperty(state, attributeName);
405
363
  }
406
-
407
364
  return edits[attributeName];
408
365
  }
366
+
409
367
  /**
410
368
  * Returns an attribute value of the current autosave revision for a post, or
411
369
  * null if there is no autosave for the post.
@@ -419,22 +377,19 @@ function getEditedPostAttribute(state, attributeName) {
419
377
  *
420
378
  * @return {*} Autosave attribute value.
421
379
  */
422
-
423
-
424
380
  const getAutosaveAttribute = (0, _data.createRegistrySelector)(select => (state, attributeName) => {
425
381
  if (!_constants.AUTOSAVE_PROPERTIES.includes(attributeName) && attributeName !== 'preview_link') {
426
382
  return;
427
383
  }
428
-
429
384
  const postType = getCurrentPostType(state);
430
385
  const postId = getCurrentPostId(state);
431
386
  const currentUserId = select(_coreData.store).getCurrentUser()?.id;
432
387
  const autosave = select(_coreData.store).getAutosave(postType, postId, currentUserId);
433
-
434
388
  if (autosave) {
435
389
  return (0, _reducer.getPostRawValue)(autosave[attributeName]);
436
390
  }
437
391
  });
392
+
438
393
  /**
439
394
  * Returns the current visibility of the post being edited, preferring the
440
395
  * unsaved value if different than the saved post. The return value is one of
@@ -444,24 +399,19 @@ const getAutosaveAttribute = (0, _data.createRegistrySelector)(select => (state,
444
399
  *
445
400
  * @return {string} Post visibility.
446
401
  */
447
-
448
402
  exports.getAutosaveAttribute = getAutosaveAttribute;
449
-
450
403
  function getEditedPostVisibility(state) {
451
404
  const status = getEditedPostAttribute(state, 'status');
452
-
453
405
  if (status === 'private') {
454
406
  return 'private';
455
407
  }
456
-
457
408
  const password = getEditedPostAttribute(state, 'password');
458
-
459
409
  if (password) {
460
410
  return 'password';
461
411
  }
462
-
463
412
  return 'public';
464
413
  }
414
+
465
415
  /**
466
416
  * Returns true if post is pending review.
467
417
  *
@@ -469,11 +419,10 @@ function getEditedPostVisibility(state) {
469
419
  *
470
420
  * @return {boolean} Whether current post is pending review.
471
421
  */
472
-
473
-
474
422
  function isCurrentPostPending(state) {
475
423
  return getCurrentPost(state).status === 'pending';
476
424
  }
425
+
477
426
  /**
478
427
  * Return true if the current post has already been published.
479
428
  *
@@ -482,12 +431,11 @@ function isCurrentPostPending(state) {
482
431
  *
483
432
  * @return {boolean} Whether the post has been published.
484
433
  */
485
-
486
-
487
434
  function isCurrentPostPublished(state, currentPost) {
488
435
  const post = currentPost || getCurrentPost(state);
489
436
  return ['publish', 'private'].indexOf(post.status) !== -1 || post.status === 'future' && !(0, _date.isInTheFuture)(new Date(Number((0, _date.getDate)(post.date)) - _constants.ONE_MINUTE_IN_MS));
490
437
  }
438
+
491
439
  /**
492
440
  * Returns true if post is already scheduled.
493
441
  *
@@ -495,11 +443,10 @@ function isCurrentPostPublished(state, currentPost) {
495
443
  *
496
444
  * @return {boolean} Whether current post is scheduled to be posted.
497
445
  */
498
-
499
-
500
446
  function isCurrentPostScheduled(state) {
501
447
  return getCurrentPost(state).status === 'future' && !isCurrentPostPublished(state);
502
448
  }
449
+
503
450
  /**
504
451
  * Return true if the post being edited can be published.
505
452
  *
@@ -507,16 +454,17 @@ function isCurrentPostScheduled(state) {
507
454
  *
508
455
  * @return {boolean} Whether the post can been published.
509
456
  */
510
-
511
-
512
457
  function isEditedPostPublishable(state) {
513
- const post = getCurrentPost(state); // TODO: Post being publishable should be superset of condition of post
458
+ const post = getCurrentPost(state);
459
+
460
+ // TODO: Post being publishable should be superset of condition of post
514
461
  // being saveable. Currently this restriction is imposed at UI.
515
462
  //
516
463
  // See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`).
517
464
 
518
465
  return isEditedPostDirty(state) || ['publish', 'private', 'future'].indexOf(post.status) === -1;
519
466
  }
467
+
520
468
  /**
521
469
  * Returns true if the post can be saved, or false otherwise. A post must
522
470
  * contain a title, an excerpt, or non-empty content to be valid for save.
@@ -525,12 +473,12 @@ function isEditedPostPublishable(state) {
525
473
  *
526
474
  * @return {boolean} Whether the post can be saved.
527
475
  */
528
-
529
-
530
476
  function isEditedPostSaveable(state) {
531
477
  if (isSavingPost(state)) {
532
478
  return false;
533
- } // TODO: Post should not be saveable if not dirty. Cannot be added here at
479
+ }
480
+
481
+ // TODO: Post should not be saveable if not dirty. Cannot be added here at
534
482
  // this time since posts where meta boxes are present can be saved even if
535
483
  // the post is not dirty. Currently this restriction is imposed at UI, but
536
484
  // should be moved here.
@@ -540,9 +488,9 @@ function isEditedPostSaveable(state) {
540
488
  // See: <PostPublishButton /> (`forceIsDirty` prop)
541
489
  // See: https://github.com/WordPress/gutenberg/pull/4184.
542
490
 
543
-
544
491
  return !!getEditedPostAttribute(state, 'title') || !!getEditedPostAttribute(state, 'excerpt') || !isEditedPostEmpty(state) || _element.Platform.OS === 'native';
545
492
  }
493
+
546
494
  /**
547
495
  * Returns true if the edited post has content. A post has content if it has at
548
496
  * least one saveable block or otherwise has a non-empty content property
@@ -552,8 +500,6 @@ function isEditedPostSaveable(state) {
552
500
  *
553
501
  * @return {boolean} Whether post has content.
554
502
  */
555
-
556
-
557
503
  const isEditedPostEmpty = (0, _data.createRegistrySelector)(select => state => {
558
504
  // While the condition of truthy content string is sufficient to determine
559
505
  // emptiness, testing saveable blocks length is a trivial operation. Since
@@ -564,23 +510,22 @@ const isEditedPostEmpty = (0, _data.createRegistrySelector)(select => state => {
564
510
  const postId = getCurrentPostId(state);
565
511
  const postType = getCurrentPostType(state);
566
512
  const record = select(_coreData.store).getEditedEntityRecord('postType', postType, postId);
567
-
568
513
  if (typeof record.content !== 'function') {
569
514
  return !record.content;
570
515
  }
571
-
572
516
  const blocks = getEditedPostAttribute(state, 'blocks');
573
-
574
517
  if (blocks.length === 0) {
575
518
  return true;
576
- } // Pierce the abstraction of the serializer in knowing that blocks are
519
+ }
520
+
521
+ // Pierce the abstraction of the serializer in knowing that blocks are
577
522
  // joined with newlines such that even if every individual block
578
523
  // produces an empty save result, the serialized content is non-empty.
579
-
580
-
581
524
  if (blocks.length > 1) {
582
525
  return false;
583
- } // There are two conditions under which the optimization cannot be
526
+ }
527
+
528
+ // There are two conditions under which the optimization cannot be
584
529
  // assumed, and a fallthrough to getEditedPostContent must occur:
585
530
  //
586
531
  // 1. getBlocksForSerialization has special treatment in omitting a
@@ -591,16 +536,13 @@ const isEditedPostEmpty = (0, _data.createRegistrySelector)(select => state => {
591
536
  //
592
537
  // For all other content, the single block is assumed to make a post
593
538
  // non-empty, if only by virtue of its own comment delimiters.
594
-
595
-
596
539
  const blockName = blocks[0].name;
597
-
598
540
  if (blockName !== (0, _blocks.getDefaultBlockName)() && blockName !== (0, _blocks.getFreeformContentHandlerName)()) {
599
541
  return false;
600
542
  }
601
-
602
543
  return !getEditedPostContent(state);
603
544
  });
545
+
604
546
  /**
605
547
  * Returns true if the post can be autosaved, or false otherwise.
606
548
  *
@@ -609,50 +551,51 @@ const isEditedPostEmpty = (0, _data.createRegistrySelector)(select => state => {
609
551
  *
610
552
  * @return {boolean} Whether the post can be autosaved.
611
553
  */
612
-
613
554
  exports.isEditedPostEmpty = isEditedPostEmpty;
614
555
  const isEditedPostAutosaveable = (0, _data.createRegistrySelector)(select => state => {
615
556
  // A post must contain a title, an excerpt, or non-empty content to be valid for autosaving.
616
557
  if (!isEditedPostSaveable(state)) {
617
558
  return false;
618
- } // A post is not autosavable when there is a post autosave lock.
619
-
559
+ }
620
560
 
561
+ // A post is not autosavable when there is a post autosave lock.
621
562
  if (isPostAutosavingLocked(state)) {
622
563
  return false;
623
564
  }
624
-
625
565
  const postType = getCurrentPostType(state);
626
566
  const postId = getCurrentPostId(state);
627
567
  const hasFetchedAutosave = select(_coreData.store).hasFetchedAutosaves(postType, postId);
628
- const currentUserId = select(_coreData.store).getCurrentUser()?.id; // Disable reason - this line causes the side-effect of fetching the autosave
568
+ const currentUserId = select(_coreData.store).getCurrentUser()?.id;
569
+
570
+ // Disable reason - this line causes the side-effect of fetching the autosave
629
571
  // via a resolver, moving below the return would result in the autosave never
630
572
  // being fetched.
631
573
  // eslint-disable-next-line @wordpress/no-unused-vars-before-return
574
+ const autosave = select(_coreData.store).getAutosave(postType, postId, currentUserId);
632
575
 
633
- const autosave = select(_coreData.store).getAutosave(postType, postId, currentUserId); // If any existing autosaves have not yet been fetched, this function is
576
+ // If any existing autosaves have not yet been fetched, this function is
634
577
  // unable to determine if the post is autosaveable, so return false.
635
-
636
578
  if (!hasFetchedAutosave) {
637
579
  return false;
638
- } // If we don't already have an autosave, the post is autosaveable.
639
-
580
+ }
640
581
 
582
+ // If we don't already have an autosave, the post is autosaveable.
641
583
  if (!autosave) {
642
584
  return true;
643
- } // To avoid an expensive content serialization, use the content dirtiness
585
+ }
586
+
587
+ // To avoid an expensive content serialization, use the content dirtiness
644
588
  // flag in place of content field comparison against the known autosave.
645
589
  // This is not strictly accurate, and relies on a tolerance toward autosave
646
590
  // request failures for unnecessary saves.
647
-
648
-
649
591
  if (hasChangedContent(state)) {
650
592
  return true;
651
- } // If title, excerpt, or meta have changed, the post is autosaveable.
652
-
593
+ }
653
594
 
595
+ // If title, excerpt, or meta have changed, the post is autosaveable.
654
596
  return ['title', 'excerpt', 'meta'].some(field => (0, _reducer.getPostRawValue)(autosave[field]) !== getEditedPostAttribute(state, field));
655
597
  });
598
+
656
599
  /**
657
600
  * Return true if the post being edited is being scheduled. Preferring the
658
601
  * unsaved status values.
@@ -661,15 +604,14 @@ const isEditedPostAutosaveable = (0, _data.createRegistrySelector)(select => sta
661
604
  *
662
605
  * @return {boolean} Whether the post has been published.
663
606
  */
664
-
665
607
  exports.isEditedPostAutosaveable = isEditedPostAutosaveable;
666
-
667
608
  function isEditedPostBeingScheduled(state) {
668
- const date = getEditedPostAttribute(state, 'date'); // Offset the date by one minute (network latency).
669
-
609
+ const date = getEditedPostAttribute(state, 'date');
610
+ // Offset the date by one minute (network latency).
670
611
  const checkedDate = new Date(Number((0, _date.getDate)(date)) - _constants.ONE_MINUTE_IN_MS);
671
612
  return (0, _date.isInTheFuture)(checkedDate);
672
613
  }
614
+
673
615
  /**
674
616
  * Returns whether the current post should be considered to have a "floating"
675
617
  * date (i.e. that it would publish "Immediately" rather than at a set time).
@@ -683,23 +625,21 @@ function isEditedPostBeingScheduled(state) {
683
625
  *
684
626
  * @return {boolean} Whether the edited post has a floating date value.
685
627
  */
686
-
687
-
688
628
  function isEditedPostDateFloating(state) {
689
629
  const date = getEditedPostAttribute(state, 'date');
690
- const modified = getEditedPostAttribute(state, 'modified'); // This should be the status of the persisted post
630
+ const modified = getEditedPostAttribute(state, 'modified');
631
+
632
+ // This should be the status of the persisted post
691
633
  // It shouldn't use the "edited" status otherwise it breaks the
692
634
  // inferred post data floating status
693
635
  // See https://github.com/WordPress/gutenberg/issues/28083.
694
-
695
636
  const status = getCurrentPost(state).status;
696
-
697
637
  if (status === 'draft' || status === 'auto-draft' || status === 'pending') {
698
638
  return date === modified || date === null;
699
639
  }
700
-
701
640
  return false;
702
641
  }
642
+
703
643
  /**
704
644
  * Returns true if the post is currently being deleted, or false otherwise.
705
645
  *
@@ -707,11 +647,10 @@ function isEditedPostDateFloating(state) {
707
647
  *
708
648
  * @return {boolean} Whether post is being deleted.
709
649
  */
710
-
711
-
712
650
  function isDeletingPost(state) {
713
651
  return !!state.deleting.pending;
714
652
  }
653
+
715
654
  /**
716
655
  * Returns true if the post is currently being saved, or false otherwise.
717
656
  *
@@ -719,11 +658,10 @@ function isDeletingPost(state) {
719
658
  *
720
659
  * @return {boolean} Whether post is being saved.
721
660
  */
722
-
723
-
724
661
  function isSavingPost(state) {
725
662
  return !!state.saving.pending;
726
663
  }
664
+
727
665
  /**
728
666
  * Returns true if non-post entities are currently being saved, or false otherwise.
729
667
  *
@@ -731,17 +669,15 @@ function isSavingPost(state) {
731
669
  *
732
670
  * @return {boolean} Whether non-post entities are being saved.
733
671
  */
734
-
735
-
736
672
  const isSavingNonPostEntityChanges = (0, _data.createRegistrySelector)(select => state => {
737
673
  const entitiesBeingSaved = select(_coreData.store).__experimentalGetEntitiesBeingSaved();
738
-
739
674
  const {
740
675
  type,
741
676
  id
742
677
  } = getCurrentPost(state);
743
678
  return entitiesBeingSaved.some(entityRecord => entityRecord.kind !== 'postType' || entityRecord.name !== type || entityRecord.key !== id);
744
679
  });
680
+
745
681
  /**
746
682
  * Returns true if a previous post save was attempted successfully, or false
747
683
  * otherwise.
@@ -750,13 +686,13 @@ const isSavingNonPostEntityChanges = (0, _data.createRegistrySelector)(select =>
750
686
  *
751
687
  * @return {boolean} Whether the post was saved successfully.
752
688
  */
753
-
754
689
  exports.isSavingNonPostEntityChanges = isSavingNonPostEntityChanges;
755
690
  const didPostSaveRequestSucceed = (0, _data.createRegistrySelector)(select => state => {
756
691
  const postType = getCurrentPostType(state);
757
692
  const postId = getCurrentPostId(state);
758
693
  return !select(_coreData.store).getLastEntitySaveError('postType', postType, postId);
759
694
  });
695
+
760
696
  /**
761
697
  * Returns true if a previous post save was attempted but failed, or false
762
698
  * otherwise.
@@ -765,13 +701,13 @@ const didPostSaveRequestSucceed = (0, _data.createRegistrySelector)(select => st
765
701
  *
766
702
  * @return {boolean} Whether the post save failed.
767
703
  */
768
-
769
704
  exports.didPostSaveRequestSucceed = didPostSaveRequestSucceed;
770
705
  const didPostSaveRequestFail = (0, _data.createRegistrySelector)(select => state => {
771
706
  const postType = getCurrentPostType(state);
772
707
  const postId = getCurrentPostId(state);
773
708
  return !!select(_coreData.store).getLastEntitySaveError('postType', postType, postId);
774
709
  });
710
+
775
711
  /**
776
712
  * Returns true if the post is autosaving, or false otherwise.
777
713
  *
@@ -779,12 +715,11 @@ const didPostSaveRequestFail = (0, _data.createRegistrySelector)(select => state
779
715
  *
780
716
  * @return {boolean} Whether the post is autosaving.
781
717
  */
782
-
783
718
  exports.didPostSaveRequestFail = didPostSaveRequestFail;
784
-
785
719
  function isAutosavingPost(state) {
786
720
  return isSavingPost(state) && Boolean(state.saving.options?.isAutosave);
787
721
  }
722
+
788
723
  /**
789
724
  * Returns true if the post is being previewed, or false otherwise.
790
725
  *
@@ -792,11 +727,10 @@ function isAutosavingPost(state) {
792
727
  *
793
728
  * @return {boolean} Whether the post is being previewed.
794
729
  */
795
-
796
-
797
730
  function isPreviewingPost(state) {
798
731
  return isSavingPost(state) && Boolean(state.saving.options?.isPreview);
799
732
  }
733
+
800
734
  /**
801
735
  * Returns the post preview link
802
736
  *
@@ -804,39 +738,33 @@ function isPreviewingPost(state) {
804
738
  *
805
739
  * @return {string | undefined} Preview Link.
806
740
  */
807
-
808
-
809
741
  function getEditedPostPreviewLink(state) {
810
742
  if (state.saving.pending || isSavingPost(state)) {
811
743
  return;
812
744
  }
813
-
814
- let previewLink = getAutosaveAttribute(state, 'preview_link'); // Fix for issue: https://github.com/WordPress/gutenberg/issues/33616
745
+ let previewLink = getAutosaveAttribute(state, 'preview_link');
746
+ // Fix for issue: https://github.com/WordPress/gutenberg/issues/33616
815
747
  // If the post is draft, ignore the preview link from the autosave record,
816
748
  // because the preview could be a stale autosave if the post was switched from
817
749
  // published to draft.
818
750
  // See: https://github.com/WordPress/gutenberg/pull/37952.
819
-
820
751
  if (!previewLink || 'draft' === getCurrentPost(state).status) {
821
752
  previewLink = getEditedPostAttribute(state, 'link');
822
-
823
753
  if (previewLink) {
824
754
  previewLink = (0, _url.addQueryArgs)(previewLink, {
825
755
  preview: true
826
756
  });
827
757
  }
828
758
  }
829
-
830
759
  const featuredImageId = getEditedPostAttribute(state, 'featured_media');
831
-
832
760
  if (previewLink && featuredImageId) {
833
761
  return (0, _url.addQueryArgs)(previewLink, {
834
762
  _thumbnail_id: featuredImageId
835
763
  });
836
764
  }
837
-
838
765
  return previewLink;
839
766
  }
767
+
840
768
  /**
841
769
  * Returns a suggested post format for the current post, inferred only if there
842
770
  * is a single block within the post and it is of a type known to match a
@@ -846,56 +774,49 @@ function getEditedPostPreviewLink(state) {
846
774
  *
847
775
  * @return {?string} Suggested post format.
848
776
  */
849
-
850
-
851
777
  function getSuggestedPostFormat(state) {
852
778
  const blocks = getEditorBlocks(state);
853
779
  if (blocks.length > 2) return null;
854
- let name; // If there is only one block in the content of the post grab its name
780
+ let name;
781
+ // If there is only one block in the content of the post grab its name
855
782
  // so we can derive a suitable post format from it.
856
-
857
783
  if (blocks.length === 1) {
858
- name = blocks[0].name; // Check for core/embed `video` and `audio` eligible suggestions.
859
-
784
+ name = blocks[0].name;
785
+ // Check for core/embed `video` and `audio` eligible suggestions.
860
786
  if (name === 'core/embed') {
861
787
  const provider = blocks[0].attributes?.providerNameSlug;
862
-
863
788
  if (['youtube', 'vimeo'].includes(provider)) {
864
789
  name = 'core/video';
865
790
  } else if (['spotify', 'soundcloud'].includes(provider)) {
866
791
  name = 'core/audio';
867
792
  }
868
793
  }
869
- } // If there are two blocks in the content and the last one is a text blocks
870
- // grab the name of the first one to also suggest a post format from it.
871
-
794
+ }
872
795
 
796
+ // If there are two blocks in the content and the last one is a text blocks
797
+ // grab the name of the first one to also suggest a post format from it.
873
798
  if (blocks.length === 2 && blocks[1].name === 'core/paragraph') {
874
799
  name = blocks[0].name;
875
- } // We only convert to default post formats in core.
876
-
800
+ }
877
801
 
802
+ // We only convert to default post formats in core.
878
803
  switch (name) {
879
804
  case 'core/image':
880
805
  return 'image';
881
-
882
806
  case 'core/quote':
883
807
  case 'core/pullquote':
884
808
  return 'quote';
885
-
886
809
  case 'core/gallery':
887
810
  return 'gallery';
888
-
889
811
  case 'core/video':
890
812
  return 'video';
891
-
892
813
  case 'core/audio':
893
814
  return 'audio';
894
-
895
815
  default:
896
816
  return null;
897
817
  }
898
818
  }
819
+
899
820
  /**
900
821
  * Returns the content of the post being edited.
901
822
  *
@@ -903,13 +824,10 @@ function getSuggestedPostFormat(state) {
903
824
  *
904
825
  * @return {string} Post content.
905
826
  */
906
-
907
-
908
827
  const getEditedPostContent = (0, _data.createRegistrySelector)(select => state => {
909
828
  const postId = getCurrentPostId(state);
910
829
  const postType = getCurrentPostType(state);
911
830
  const record = select(_coreData.store).getEditedEntityRecord('postType', postType, postId);
912
-
913
831
  if (record) {
914
832
  if (typeof record.content === 'function') {
915
833
  return record.content(record);
@@ -919,9 +837,9 @@ const getEditedPostContent = (0, _data.createRegistrySelector)(select => state =
919
837
  return record.content;
920
838
  }
921
839
  }
922
-
923
840
  return '';
924
841
  });
842
+
925
843
  /**
926
844
  * Returns true if the post is being published, or false otherwise.
927
845
  *
@@ -929,12 +847,11 @@ const getEditedPostContent = (0, _data.createRegistrySelector)(select => state =
929
847
  *
930
848
  * @return {boolean} Whether post is being published.
931
849
  */
932
-
933
850
  exports.getEditedPostContent = getEditedPostContent;
934
-
935
851
  function isPublishingPost(state) {
936
852
  return isSavingPost(state) && !isCurrentPostPublished(state) && getEditedPostAttribute(state, 'status') === 'publish';
937
853
  }
854
+
938
855
  /**
939
856
  * Returns whether the permalink is editable or not.
940
857
  *
@@ -942,12 +859,11 @@ function isPublishingPost(state) {
942
859
  *
943
860
  * @return {boolean} Whether or not the permalink is editable.
944
861
  */
945
-
946
-
947
862
  function isPermalinkEditable(state) {
948
863
  const permalinkTemplate = getEditedPostAttribute(state, 'permalink_template');
949
864
  return _constants.PERMALINK_POSTNAME_REGEX.test(permalinkTemplate);
950
865
  }
866
+
951
867
  /**
952
868
  * Returns the permalink for the post.
953
869
  *
@@ -955,27 +871,22 @@ function isPermalinkEditable(state) {
955
871
  *
956
872
  * @return {?string} The permalink, or null if the post is not viewable.
957
873
  */
958
-
959
-
960
874
  function getPermalink(state) {
961
875
  const permalinkParts = getPermalinkParts(state);
962
-
963
876
  if (!permalinkParts) {
964
877
  return null;
965
878
  }
966
-
967
879
  const {
968
880
  prefix,
969
881
  postName,
970
882
  suffix
971
883
  } = permalinkParts;
972
-
973
884
  if (isPermalinkEditable(state)) {
974
885
  return prefix + postName + suffix;
975
886
  }
976
-
977
887
  return prefix;
978
888
  }
889
+
979
890
  /**
980
891
  * Returns the slug for the post being edited, preferring a manually edited
981
892
  * value if one exists, then a sanitized version of the current post title, and
@@ -985,11 +896,10 @@ function getPermalink(state) {
985
896
  *
986
897
  * @return {string} The current slug to be displayed in the editor
987
898
  */
988
-
989
-
990
899
  function getEditedPostSlug(state) {
991
900
  return getEditedPostAttribute(state, 'slug') || (0, _url.cleanForSlug)(getEditedPostAttribute(state, 'title')) || getCurrentPostId(state);
992
901
  }
902
+
993
903
  /**
994
904
  * Returns the permalink for a post, split into it's three parts: the prefix,
995
905
  * the postName, and the suffix.
@@ -999,15 +909,11 @@ function getEditedPostSlug(state) {
999
909
  * @return {Object} An object containing the prefix, postName, and suffix for
1000
910
  * the permalink, or null if the post is not viewable.
1001
911
  */
1002
-
1003
-
1004
912
  function getPermalinkParts(state) {
1005
913
  const permalinkTemplate = getEditedPostAttribute(state, 'permalink_template');
1006
-
1007
914
  if (!permalinkTemplate) {
1008
915
  return null;
1009
916
  }
1010
-
1011
917
  const postName = getEditedPostAttribute(state, 'slug') || getEditedPostAttribute(state, 'generated_slug');
1012
918
  const [prefix, suffix] = permalinkTemplate.split(_constants.PERMALINK_POSTNAME_REGEX);
1013
919
  return {
@@ -1016,6 +922,7 @@ function getPermalinkParts(state) {
1016
922
  suffix
1017
923
  };
1018
924
  }
925
+
1019
926
  /**
1020
927
  * Returns whether the post is locked.
1021
928
  *
@@ -1023,11 +930,10 @@ function getPermalinkParts(state) {
1023
930
  *
1024
931
  * @return {boolean} Is locked.
1025
932
  */
1026
-
1027
-
1028
933
  function isPostLocked(state) {
1029
934
  return state.postLock.isLocked;
1030
935
  }
936
+
1031
937
  /**
1032
938
  * Returns whether post saving is locked.
1033
939
  *
@@ -1035,11 +941,10 @@ function isPostLocked(state) {
1035
941
  *
1036
942
  * @return {boolean} Is locked.
1037
943
  */
1038
-
1039
-
1040
944
  function isPostSavingLocked(state) {
1041
945
  return Object.keys(state.postSavingLock).length > 0;
1042
946
  }
947
+
1043
948
  /**
1044
949
  * Returns whether post autosaving is locked.
1045
950
  *
@@ -1047,11 +952,10 @@ function isPostSavingLocked(state) {
1047
952
  *
1048
953
  * @return {boolean} Is locked.
1049
954
  */
1050
-
1051
-
1052
955
  function isPostAutosavingLocked(state) {
1053
956
  return Object.keys(state.postAutosavingLock).length > 0;
1054
957
  }
958
+
1055
959
  /**
1056
960
  * Returns whether the edition of the post has been taken over.
1057
961
  *
@@ -1059,11 +963,10 @@ function isPostAutosavingLocked(state) {
1059
963
  *
1060
964
  * @return {boolean} Is post lock takeover.
1061
965
  */
1062
-
1063
-
1064
966
  function isPostLockTakeover(state) {
1065
967
  return state.postLock.isTakeover;
1066
968
  }
969
+
1067
970
  /**
1068
971
  * Returns details about the post lock user.
1069
972
  *
@@ -1071,11 +974,10 @@ function isPostLockTakeover(state) {
1071
974
  *
1072
975
  * @return {Object} A user object.
1073
976
  */
1074
-
1075
-
1076
977
  function getPostLockUser(state) {
1077
978
  return state.postLock.user;
1078
979
  }
980
+
1079
981
  /**
1080
982
  * Returns the active post lock.
1081
983
  *
@@ -1083,11 +985,10 @@ function getPostLockUser(state) {
1083
985
  *
1084
986
  * @return {Object} The lock object.
1085
987
  */
1086
-
1087
-
1088
988
  function getActivePostLock(state) {
1089
989
  return state.postLock.activePostLock;
1090
990
  }
991
+
1091
992
  /**
1092
993
  * Returns whether or not the user has the unfiltered_html capability.
1093
994
  *
@@ -1095,31 +996,29 @@ function getActivePostLock(state) {
1095
996
  *
1096
997
  * @return {boolean} Whether the user can or can't post unfiltered HTML.
1097
998
  */
1098
-
1099
-
1100
999
  function canUserUseUnfilteredHTML(state) {
1101
1000
  return Boolean(getCurrentPost(state)._links?.hasOwnProperty('wp:action-unfiltered-html'));
1102
1001
  }
1002
+
1103
1003
  /**
1104
1004
  * Returns whether the pre-publish panel should be shown
1105
1005
  * or skipped when the user clicks the "publish" button.
1106
1006
  *
1107
1007
  * @return {boolean} Whether the pre-publish panel should be shown or not.
1108
1008
  */
1109
-
1110
-
1111
1009
  const isPublishSidebarEnabled = (0, _data.createRegistrySelector)(select => () => !!select(_preferences.store).get('core/edit-post', 'isPublishSidebarEnabled'));
1010
+
1112
1011
  /**
1113
1012
  * Return the current block list.
1114
1013
  *
1115
1014
  * @param {Object} state
1116
1015
  * @return {Array} Block list.
1117
1016
  */
1118
-
1119
1017
  exports.isPublishSidebarEnabled = isPublishSidebarEnabled;
1120
1018
  const getEditorBlocks = (0, _rememo.default)(state => {
1121
1019
  return getEditedPostAttribute(state, 'blocks') || (0, _blocks.parse)(getEditedPostContent(state));
1122
1020
  }, state => [getEditedPostAttribute(state, 'blocks'), getEditedPostContent(state)]);
1021
+
1123
1022
  /**
1124
1023
  * A block selection object.
1125
1024
  *
@@ -1139,9 +1038,7 @@ const getEditorBlocks = (0, _rememo.default)(state => {
1139
1038
  *
1140
1039
  * @deprecated since Gutenberg 10.0.0.
1141
1040
  */
1142
-
1143
1041
  exports.getEditorBlocks = getEditorBlocks;
1144
-
1145
1042
  function getEditorSelectionStart(state) {
1146
1043
  (0, _deprecated.default)("select('core/editor').getEditorSelectionStart", {
1147
1044
  since: '5.8',
@@ -1149,6 +1046,7 @@ function getEditorSelectionStart(state) {
1149
1046
  });
1150
1047
  return getEditedPostAttribute(state, 'selection')?.selectionStart;
1151
1048
  }
1049
+
1152
1050
  /**
1153
1051
  * Returns the current selection end.
1154
1052
  *
@@ -1157,8 +1055,6 @@ function getEditorSelectionStart(state) {
1157
1055
  *
1158
1056
  * @deprecated since Gutenberg 10.0.0.
1159
1057
  */
1160
-
1161
-
1162
1058
  function getEditorSelectionEnd(state) {
1163
1059
  (0, _deprecated.default)("select('core/editor').getEditorSelectionStart", {
1164
1060
  since: '5.8',
@@ -1166,28 +1062,27 @@ function getEditorSelectionEnd(state) {
1166
1062
  });
1167
1063
  return getEditedPostAttribute(state, 'selection')?.selectionEnd;
1168
1064
  }
1065
+
1169
1066
  /**
1170
1067
  * Returns the current selection.
1171
1068
  *
1172
1069
  * @param {Object} state
1173
1070
  * @return {WPBlockSelection} The selection end.
1174
1071
  */
1175
-
1176
-
1177
1072
  function getEditorSelection(state) {
1178
1073
  return getEditedPostAttribute(state, 'selection');
1179
1074
  }
1075
+
1180
1076
  /**
1181
1077
  * Is the editor ready
1182
1078
  *
1183
1079
  * @param {Object} state
1184
1080
  * @return {boolean} is Ready.
1185
1081
  */
1186
-
1187
-
1188
1082
  function __unstableIsEditorReady(state) {
1189
1083
  return state.isReady;
1190
1084
  }
1085
+
1191
1086
  /**
1192
1087
  * Returns the post editor settings.
1193
1088
  *
@@ -1195,11 +1090,10 @@ function __unstableIsEditorReady(state) {
1195
1090
  *
1196
1091
  * @return {Object} The editor settings object.
1197
1092
  */
1198
-
1199
-
1200
1093
  function getEditorSettings(state) {
1201
1094
  return state.editorSettings;
1202
1095
  }
1096
+
1203
1097
  /*
1204
1098
  * Backward compatibility
1205
1099
  */
@@ -1210,8 +1104,6 @@ function getEditorSettings(state) {
1210
1104
  *
1211
1105
  * @deprecated since Gutenberg 9.7.0.
1212
1106
  */
1213
-
1214
-
1215
1107
  function getStateBeforeOptimisticTransaction() {
1216
1108
  (0, _deprecated.default)("select('core/editor').getStateBeforeOptimisticTransaction", {
1217
1109
  since: '5.7',
@@ -1225,8 +1117,6 @@ function getStateBeforeOptimisticTransaction() {
1225
1117
  *
1226
1118
  * @deprecated since Gutenberg 9.7.0.
1227
1119
  */
1228
-
1229
-
1230
1120
  function inSomeHistory() {
1231
1121
  (0, _deprecated.default)("select('core/editor').inSomeHistory", {
1232
1122
  since: '5.7',
@@ -1234,7 +1124,6 @@ function inSomeHistory() {
1234
1124
  });
1235
1125
  return false;
1236
1126
  }
1237
-
1238
1127
  function getBlockEditorSelector(name) {
1239
1128
  return (0, _data.createRegistrySelector)(select => (state, ...args) => {
1240
1129
  (0, _deprecated.default)("`wp.data.select( 'core/editor' )." + name + '`', {
@@ -1245,312 +1134,312 @@ function getBlockEditorSelector(name) {
1245
1134
  return select(_blockEditor.store)[name](...args);
1246
1135
  });
1247
1136
  }
1137
+
1248
1138
  /**
1249
1139
  * @see getBlockName in core/block-editor store.
1250
1140
  */
1251
-
1252
-
1253
1141
  const getBlockName = getBlockEditorSelector('getBlockName');
1142
+
1254
1143
  /**
1255
1144
  * @see isBlockValid in core/block-editor store.
1256
1145
  */
1257
-
1258
1146
  exports.getBlockName = getBlockName;
1259
1147
  const isBlockValid = getBlockEditorSelector('isBlockValid');
1148
+
1260
1149
  /**
1261
1150
  * @see getBlockAttributes in core/block-editor store.
1262
1151
  */
1263
-
1264
1152
  exports.isBlockValid = isBlockValid;
1265
1153
  const getBlockAttributes = getBlockEditorSelector('getBlockAttributes');
1154
+
1266
1155
  /**
1267
1156
  * @see getBlock in core/block-editor store.
1268
1157
  */
1269
-
1270
1158
  exports.getBlockAttributes = getBlockAttributes;
1271
1159
  const getBlock = getBlockEditorSelector('getBlock');
1160
+
1272
1161
  /**
1273
1162
  * @see getBlocks in core/block-editor store.
1274
1163
  */
1275
-
1276
1164
  exports.getBlock = getBlock;
1277
1165
  const getBlocks = getBlockEditorSelector('getBlocks');
1166
+
1278
1167
  /**
1279
1168
  * @see getClientIdsOfDescendants in core/block-editor store.
1280
1169
  */
1281
-
1282
1170
  exports.getBlocks = getBlocks;
1283
1171
  const getClientIdsOfDescendants = getBlockEditorSelector('getClientIdsOfDescendants');
1172
+
1284
1173
  /**
1285
1174
  * @see getClientIdsWithDescendants in core/block-editor store.
1286
1175
  */
1287
-
1288
1176
  exports.getClientIdsOfDescendants = getClientIdsOfDescendants;
1289
1177
  const getClientIdsWithDescendants = getBlockEditorSelector('getClientIdsWithDescendants');
1178
+
1290
1179
  /**
1291
1180
  * @see getGlobalBlockCount in core/block-editor store.
1292
1181
  */
1293
-
1294
1182
  exports.getClientIdsWithDescendants = getClientIdsWithDescendants;
1295
1183
  const getGlobalBlockCount = getBlockEditorSelector('getGlobalBlockCount');
1184
+
1296
1185
  /**
1297
1186
  * @see getBlocksByClientId in core/block-editor store.
1298
1187
  */
1299
-
1300
1188
  exports.getGlobalBlockCount = getGlobalBlockCount;
1301
1189
  const getBlocksByClientId = getBlockEditorSelector('getBlocksByClientId');
1190
+
1302
1191
  /**
1303
1192
  * @see getBlockCount in core/block-editor store.
1304
1193
  */
1305
-
1306
1194
  exports.getBlocksByClientId = getBlocksByClientId;
1307
1195
  const getBlockCount = getBlockEditorSelector('getBlockCount');
1196
+
1308
1197
  /**
1309
1198
  * @see getBlockSelectionStart in core/block-editor store.
1310
1199
  */
1311
-
1312
1200
  exports.getBlockCount = getBlockCount;
1313
1201
  const getBlockSelectionStart = getBlockEditorSelector('getBlockSelectionStart');
1202
+
1314
1203
  /**
1315
1204
  * @see getBlockSelectionEnd in core/block-editor store.
1316
1205
  */
1317
-
1318
1206
  exports.getBlockSelectionStart = getBlockSelectionStart;
1319
1207
  const getBlockSelectionEnd = getBlockEditorSelector('getBlockSelectionEnd');
1208
+
1320
1209
  /**
1321
1210
  * @see getSelectedBlockCount in core/block-editor store.
1322
1211
  */
1323
-
1324
1212
  exports.getBlockSelectionEnd = getBlockSelectionEnd;
1325
1213
  const getSelectedBlockCount = getBlockEditorSelector('getSelectedBlockCount');
1214
+
1326
1215
  /**
1327
1216
  * @see hasSelectedBlock in core/block-editor store.
1328
1217
  */
1329
-
1330
1218
  exports.getSelectedBlockCount = getSelectedBlockCount;
1331
1219
  const hasSelectedBlock = getBlockEditorSelector('hasSelectedBlock');
1220
+
1332
1221
  /**
1333
1222
  * @see getSelectedBlockClientId in core/block-editor store.
1334
1223
  */
1335
-
1336
1224
  exports.hasSelectedBlock = hasSelectedBlock;
1337
1225
  const getSelectedBlockClientId = getBlockEditorSelector('getSelectedBlockClientId');
1226
+
1338
1227
  /**
1339
1228
  * @see getSelectedBlock in core/block-editor store.
1340
1229
  */
1341
-
1342
1230
  exports.getSelectedBlockClientId = getSelectedBlockClientId;
1343
1231
  const getSelectedBlock = getBlockEditorSelector('getSelectedBlock');
1232
+
1344
1233
  /**
1345
1234
  * @see getBlockRootClientId in core/block-editor store.
1346
1235
  */
1347
-
1348
1236
  exports.getSelectedBlock = getSelectedBlock;
1349
1237
  const getBlockRootClientId = getBlockEditorSelector('getBlockRootClientId');
1238
+
1350
1239
  /**
1351
1240
  * @see getBlockHierarchyRootClientId in core/block-editor store.
1352
1241
  */
1353
-
1354
1242
  exports.getBlockRootClientId = getBlockRootClientId;
1355
1243
  const getBlockHierarchyRootClientId = getBlockEditorSelector('getBlockHierarchyRootClientId');
1244
+
1356
1245
  /**
1357
1246
  * @see getAdjacentBlockClientId in core/block-editor store.
1358
1247
  */
1359
-
1360
1248
  exports.getBlockHierarchyRootClientId = getBlockHierarchyRootClientId;
1361
1249
  const getAdjacentBlockClientId = getBlockEditorSelector('getAdjacentBlockClientId');
1250
+
1362
1251
  /**
1363
1252
  * @see getPreviousBlockClientId in core/block-editor store.
1364
1253
  */
1365
-
1366
1254
  exports.getAdjacentBlockClientId = getAdjacentBlockClientId;
1367
1255
  const getPreviousBlockClientId = getBlockEditorSelector('getPreviousBlockClientId');
1256
+
1368
1257
  /**
1369
1258
  * @see getNextBlockClientId in core/block-editor store.
1370
1259
  */
1371
-
1372
1260
  exports.getPreviousBlockClientId = getPreviousBlockClientId;
1373
1261
  const getNextBlockClientId = getBlockEditorSelector('getNextBlockClientId');
1262
+
1374
1263
  /**
1375
1264
  * @see getSelectedBlocksInitialCaretPosition in core/block-editor store.
1376
1265
  */
1377
-
1378
1266
  exports.getNextBlockClientId = getNextBlockClientId;
1379
1267
  const getSelectedBlocksInitialCaretPosition = getBlockEditorSelector('getSelectedBlocksInitialCaretPosition');
1268
+
1380
1269
  /**
1381
1270
  * @see getMultiSelectedBlockClientIds in core/block-editor store.
1382
1271
  */
1383
-
1384
1272
  exports.getSelectedBlocksInitialCaretPosition = getSelectedBlocksInitialCaretPosition;
1385
1273
  const getMultiSelectedBlockClientIds = getBlockEditorSelector('getMultiSelectedBlockClientIds');
1274
+
1386
1275
  /**
1387
1276
  * @see getMultiSelectedBlocks in core/block-editor store.
1388
1277
  */
1389
-
1390
1278
  exports.getMultiSelectedBlockClientIds = getMultiSelectedBlockClientIds;
1391
1279
  const getMultiSelectedBlocks = getBlockEditorSelector('getMultiSelectedBlocks');
1280
+
1392
1281
  /**
1393
1282
  * @see getFirstMultiSelectedBlockClientId in core/block-editor store.
1394
1283
  */
1395
-
1396
1284
  exports.getMultiSelectedBlocks = getMultiSelectedBlocks;
1397
1285
  const getFirstMultiSelectedBlockClientId = getBlockEditorSelector('getFirstMultiSelectedBlockClientId');
1286
+
1398
1287
  /**
1399
1288
  * @see getLastMultiSelectedBlockClientId in core/block-editor store.
1400
1289
  */
1401
-
1402
1290
  exports.getFirstMultiSelectedBlockClientId = getFirstMultiSelectedBlockClientId;
1403
1291
  const getLastMultiSelectedBlockClientId = getBlockEditorSelector('getLastMultiSelectedBlockClientId');
1292
+
1404
1293
  /**
1405
1294
  * @see isFirstMultiSelectedBlock in core/block-editor store.
1406
1295
  */
1407
-
1408
1296
  exports.getLastMultiSelectedBlockClientId = getLastMultiSelectedBlockClientId;
1409
1297
  const isFirstMultiSelectedBlock = getBlockEditorSelector('isFirstMultiSelectedBlock');
1298
+
1410
1299
  /**
1411
1300
  * @see isBlockMultiSelected in core/block-editor store.
1412
1301
  */
1413
-
1414
1302
  exports.isFirstMultiSelectedBlock = isFirstMultiSelectedBlock;
1415
1303
  const isBlockMultiSelected = getBlockEditorSelector('isBlockMultiSelected');
1304
+
1416
1305
  /**
1417
1306
  * @see isAncestorMultiSelected in core/block-editor store.
1418
1307
  */
1419
-
1420
1308
  exports.isBlockMultiSelected = isBlockMultiSelected;
1421
1309
  const isAncestorMultiSelected = getBlockEditorSelector('isAncestorMultiSelected');
1310
+
1422
1311
  /**
1423
1312
  * @see getMultiSelectedBlocksStartClientId in core/block-editor store.
1424
1313
  */
1425
-
1426
1314
  exports.isAncestorMultiSelected = isAncestorMultiSelected;
1427
1315
  const getMultiSelectedBlocksStartClientId = getBlockEditorSelector('getMultiSelectedBlocksStartClientId');
1316
+
1428
1317
  /**
1429
1318
  * @see getMultiSelectedBlocksEndClientId in core/block-editor store.
1430
1319
  */
1431
-
1432
1320
  exports.getMultiSelectedBlocksStartClientId = getMultiSelectedBlocksStartClientId;
1433
1321
  const getMultiSelectedBlocksEndClientId = getBlockEditorSelector('getMultiSelectedBlocksEndClientId');
1322
+
1434
1323
  /**
1435
1324
  * @see getBlockOrder in core/block-editor store.
1436
1325
  */
1437
-
1438
1326
  exports.getMultiSelectedBlocksEndClientId = getMultiSelectedBlocksEndClientId;
1439
1327
  const getBlockOrder = getBlockEditorSelector('getBlockOrder');
1328
+
1440
1329
  /**
1441
1330
  * @see getBlockIndex in core/block-editor store.
1442
1331
  */
1443
-
1444
1332
  exports.getBlockOrder = getBlockOrder;
1445
1333
  const getBlockIndex = getBlockEditorSelector('getBlockIndex');
1334
+
1446
1335
  /**
1447
1336
  * @see isBlockSelected in core/block-editor store.
1448
1337
  */
1449
-
1450
1338
  exports.getBlockIndex = getBlockIndex;
1451
1339
  const isBlockSelected = getBlockEditorSelector('isBlockSelected');
1340
+
1452
1341
  /**
1453
1342
  * @see hasSelectedInnerBlock in core/block-editor store.
1454
1343
  */
1455
-
1456
1344
  exports.isBlockSelected = isBlockSelected;
1457
1345
  const hasSelectedInnerBlock = getBlockEditorSelector('hasSelectedInnerBlock');
1346
+
1458
1347
  /**
1459
1348
  * @see isBlockWithinSelection in core/block-editor store.
1460
1349
  */
1461
-
1462
1350
  exports.hasSelectedInnerBlock = hasSelectedInnerBlock;
1463
1351
  const isBlockWithinSelection = getBlockEditorSelector('isBlockWithinSelection');
1352
+
1464
1353
  /**
1465
1354
  * @see hasMultiSelection in core/block-editor store.
1466
1355
  */
1467
-
1468
1356
  exports.isBlockWithinSelection = isBlockWithinSelection;
1469
1357
  const hasMultiSelection = getBlockEditorSelector('hasMultiSelection');
1358
+
1470
1359
  /**
1471
1360
  * @see isMultiSelecting in core/block-editor store.
1472
1361
  */
1473
-
1474
1362
  exports.hasMultiSelection = hasMultiSelection;
1475
1363
  const isMultiSelecting = getBlockEditorSelector('isMultiSelecting');
1364
+
1476
1365
  /**
1477
1366
  * @see isSelectionEnabled in core/block-editor store.
1478
1367
  */
1479
-
1480
1368
  exports.isMultiSelecting = isMultiSelecting;
1481
1369
  const isSelectionEnabled = getBlockEditorSelector('isSelectionEnabled');
1370
+
1482
1371
  /**
1483
1372
  * @see getBlockMode in core/block-editor store.
1484
1373
  */
1485
-
1486
1374
  exports.isSelectionEnabled = isSelectionEnabled;
1487
1375
  const getBlockMode = getBlockEditorSelector('getBlockMode');
1376
+
1488
1377
  /**
1489
1378
  * @see isTyping in core/block-editor store.
1490
1379
  */
1491
-
1492
1380
  exports.getBlockMode = getBlockMode;
1493
1381
  const isTyping = getBlockEditorSelector('isTyping');
1382
+
1494
1383
  /**
1495
1384
  * @see isCaretWithinFormattedText in core/block-editor store.
1496
1385
  */
1497
-
1498
1386
  exports.isTyping = isTyping;
1499
1387
  const isCaretWithinFormattedText = getBlockEditorSelector('isCaretWithinFormattedText');
1388
+
1500
1389
  /**
1501
1390
  * @see getBlockInsertionPoint in core/block-editor store.
1502
1391
  */
1503
-
1504
1392
  exports.isCaretWithinFormattedText = isCaretWithinFormattedText;
1505
1393
  const getBlockInsertionPoint = getBlockEditorSelector('getBlockInsertionPoint');
1394
+
1506
1395
  /**
1507
1396
  * @see isBlockInsertionPointVisible in core/block-editor store.
1508
1397
  */
1509
-
1510
1398
  exports.getBlockInsertionPoint = getBlockInsertionPoint;
1511
1399
  const isBlockInsertionPointVisible = getBlockEditorSelector('isBlockInsertionPointVisible');
1400
+
1512
1401
  /**
1513
1402
  * @see isValidTemplate in core/block-editor store.
1514
1403
  */
1515
-
1516
1404
  exports.isBlockInsertionPointVisible = isBlockInsertionPointVisible;
1517
1405
  const isValidTemplate = getBlockEditorSelector('isValidTemplate');
1406
+
1518
1407
  /**
1519
1408
  * @see getTemplate in core/block-editor store.
1520
1409
  */
1521
-
1522
1410
  exports.isValidTemplate = isValidTemplate;
1523
1411
  const getTemplate = getBlockEditorSelector('getTemplate');
1412
+
1524
1413
  /**
1525
1414
  * @see getTemplateLock in core/block-editor store.
1526
1415
  */
1527
-
1528
1416
  exports.getTemplate = getTemplate;
1529
1417
  const getTemplateLock = getBlockEditorSelector('getTemplateLock');
1418
+
1530
1419
  /**
1531
1420
  * @see canInsertBlockType in core/block-editor store.
1532
1421
  */
1533
-
1534
1422
  exports.getTemplateLock = getTemplateLock;
1535
1423
  const canInsertBlockType = getBlockEditorSelector('canInsertBlockType');
1424
+
1536
1425
  /**
1537
1426
  * @see getInserterItems in core/block-editor store.
1538
1427
  */
1539
-
1540
1428
  exports.canInsertBlockType = canInsertBlockType;
1541
1429
  const getInserterItems = getBlockEditorSelector('getInserterItems');
1430
+
1542
1431
  /**
1543
1432
  * @see hasInserterItems in core/block-editor store.
1544
1433
  */
1545
-
1546
1434
  exports.getInserterItems = getInserterItems;
1547
1435
  const hasInserterItems = getBlockEditorSelector('hasInserterItems');
1436
+
1548
1437
  /**
1549
1438
  * @see getBlockListSettings in core/block-editor store.
1550
1439
  */
1551
-
1552
1440
  exports.hasInserterItems = hasInserterItems;
1553
1441
  const getBlockListSettings = getBlockEditorSelector('getBlockListSettings');
1442
+
1554
1443
  /**
1555
1444
  * Returns the default template types.
1556
1445
  *
@@ -1558,12 +1447,11 @@ const getBlockListSettings = getBlockEditorSelector('getBlockListSettings');
1558
1447
  *
1559
1448
  * @return {Object} The template types.
1560
1449
  */
1561
-
1562
1450
  exports.getBlockListSettings = getBlockListSettings;
1563
-
1564
1451
  function __experimentalGetDefaultTemplateTypes(state) {
1565
1452
  return getEditorSettings(state)?.defaultTemplateTypes;
1566
1453
  }
1454
+
1567
1455
  /**
1568
1456
  * Returns the default template part areas.
1569
1457
  *
@@ -1571,16 +1459,16 @@ function __experimentalGetDefaultTemplateTypes(state) {
1571
1459
  *
1572
1460
  * @return {Array} The template part areas.
1573
1461
  */
1574
-
1575
-
1576
1462
  const __experimentalGetDefaultTemplatePartAreas = (0, _rememo.default)(state => {
1577
1463
  const areas = getEditorSettings(state)?.defaultTemplatePartAreas || [];
1578
1464
  return areas?.map(item => {
1579
- return { ...item,
1465
+ return {
1466
+ ...item,
1580
1467
  icon: (0, _getTemplatePartIcon.getTemplatePartIcon)(item.icon)
1581
1468
  };
1582
1469
  });
1583
1470
  }, state => [getEditorSettings(state)?.defaultTemplatePartAreas]);
1471
+
1584
1472
  /**
1585
1473
  * Returns a default template type searched by slug.
1586
1474
  *
@@ -1589,21 +1477,16 @@ const __experimentalGetDefaultTemplatePartAreas = (0, _rememo.default)(state =>
1589
1477
  *
1590
1478
  * @return {Object} The template type.
1591
1479
  */
1592
-
1593
-
1594
1480
  exports.__experimentalGetDefaultTemplatePartAreas = __experimentalGetDefaultTemplatePartAreas;
1595
-
1596
1481
  const __experimentalGetDefaultTemplateType = (0, _rememo.default)((state, slug) => {
1597
1482
  var _Object$values$find;
1598
-
1599
1483
  const templateTypes = __experimentalGetDefaultTemplateTypes(state);
1600
-
1601
1484
  if (!templateTypes) {
1602
1485
  return EMPTY_OBJECT;
1603
1486
  }
1604
-
1605
1487
  return (_Object$values$find = Object.values(templateTypes).find(type => type.slug === slug)) !== null && _Object$values$find !== void 0 ? _Object$values$find : EMPTY_OBJECT;
1606
1488
  }, (state, slug) => [__experimentalGetDefaultTemplateTypes(state), slug]);
1489
+
1607
1490
  /**
1608
1491
  * Given a template entity, return information about it which is ready to be
1609
1492
  * rendered, such as the title, description, and icon.
@@ -1612,38 +1495,31 @@ const __experimentalGetDefaultTemplateType = (0, _rememo.default)((state, slug)
1612
1495
  * @param {Object} template The template for which we need information.
1613
1496
  * @return {Object} Information about the template, including title, description, and icon.
1614
1497
  */
1615
-
1616
-
1617
1498
  exports.__experimentalGetDefaultTemplateType = __experimentalGetDefaultTemplateType;
1618
-
1619
1499
  function __experimentalGetTemplateInfo(state, template) {
1620
1500
  if (!template) {
1621
1501
  return EMPTY_OBJECT;
1622
1502
  }
1623
-
1624
1503
  const {
1625
1504
  description,
1626
1505
  slug,
1627
1506
  title,
1628
1507
  area
1629
1508
  } = template;
1630
-
1631
1509
  const {
1632
1510
  title: defaultTitle,
1633
1511
  description: defaultDescription
1634
1512
  } = __experimentalGetDefaultTemplateType(state, slug);
1635
-
1636
1513
  const templateTitle = typeof title === 'string' ? title : title?.rendered;
1637
1514
  const templateDescription = typeof description === 'string' ? description : description?.raw;
1638
-
1639
1515
  const templateIcon = __experimentalGetDefaultTemplatePartAreas(state).find(item => area === item.area)?.icon || _icons.layout;
1640
-
1641
1516
  return {
1642
1517
  title: templateTitle && templateTitle !== slug ? templateTitle : defaultTitle || slug,
1643
1518
  description: templateDescription || defaultDescription,
1644
1519
  icon: templateIcon
1645
1520
  };
1646
1521
  }
1522
+
1647
1523
  /**
1648
1524
  * Returns a post type label depending on the current post.
1649
1525
  *
@@ -1651,13 +1527,11 @@ function __experimentalGetTemplateInfo(state, template) {
1651
1527
  *
1652
1528
  * @return {string|undefined} The post type label if available, otherwise undefined.
1653
1529
  */
1654
-
1655
-
1656
1530
  const getPostTypeLabel = (0, _data.createRegistrySelector)(select => state => {
1657
1531
  const currentPostType = getCurrentPostType(state);
1658
- const postType = select(_coreData.store).getPostType(currentPostType); // Disable reason: Post type labels object is shaped like this.
1532
+ const postType = select(_coreData.store).getPostType(currentPostType);
1533
+ // Disable reason: Post type labels object is shaped like this.
1659
1534
  // eslint-disable-next-line camelcase
1660
-
1661
1535
  return postType?.labels?.singular_name;
1662
1536
  });
1663
1537
  exports.getPostTypeLabel = getPostTypeLabel;