@wordpress/editor 13.15.0 → 13.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (557) hide show
  1. package/CHANGELOG.md +4 -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 +5 -14
  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 +11 -23
  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 +10 -27
  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 +11 -23
  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 +10 -23
  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 +8 -42
  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 +61 -130
  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 +170 -296
  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 +4 -7
  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 +12 -19
  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 +11 -23
  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 +12 -19
  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 +14 -20
  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 +11 -39
  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 +63 -85
  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 +173 -223
  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/page-attributes/order.js +15 -23
  534. package/src/components/page-attributes/test/order.js +46 -15
  535. package/src/components/post-author/test/check.js +18 -12
  536. package/src/components/post-comments/index.js +11 -17
  537. package/src/components/post-excerpt/check.js +6 -2
  538. package/src/components/post-excerpt/index.js +10 -16
  539. package/src/components/post-featured-image/check.js +4 -2
  540. package/src/components/post-format/check.js +16 -11
  541. package/src/components/post-last-revision/check.js +12 -14
  542. package/src/components/post-last-revision/index.js +12 -10
  543. package/src/components/post-last-revision/test/check.js +28 -16
  544. package/src/components/post-pending-status/check.js +13 -19
  545. package/src/components/post-pending-status/index.js +9 -14
  546. package/src/components/post-pending-status/test/check.js +32 -10
  547. package/src/components/post-pingbacks/index.js +11 -15
  548. package/src/components/post-publish-panel/style.scss +12 -25
  549. package/src/components/post-sync-status/style.scss +4 -1
  550. package/src/components/post-type-support-check/index.js +8 -10
  551. package/src/components/post-type-support-check/test/index.js +36 -20
  552. package/src/components/provider/index.js +3 -2
  553. package/src/components/unsaved-changes-warning/index.js +22 -27
  554. package/src/hooks/custom-sources-backwards-compatibility.js +1 -25
  555. package/src/store/actions.js +1 -1
  556. package/src/store/selectors.js +2 -2
  557. package/src/store/test/selectors.js +13 -13
@@ -3,17 +3,23 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { CheckboxControl } from '@wordpress/components';
6
- import { withSelect, withDispatch } from '@wordpress/data';
7
- import { compose } from '@wordpress/compose';
6
+ import { useDispatch, useSelect } from '@wordpress/data';
8
7
 
9
8
  /**
10
9
  * Internal dependencies
11
10
  */
12
11
  import { store as editorStore } from '../../store';
13
12
 
14
- function PostPingbacks( { pingStatus = 'open', ...props } ) {
13
+ function PostPingbacks() {
14
+ const pingStatus = useSelect(
15
+ ( select ) =>
16
+ select( editorStore ).getEditedPostAttribute( 'ping_status' ) ??
17
+ 'open',
18
+ []
19
+ );
20
+ const { editPost } = useDispatch( editorStore );
15
21
  const onTogglePingback = () =>
16
- props.editPost( {
22
+ editPost( {
17
23
  ping_status: pingStatus === 'open' ? 'closed' : 'open',
18
24
  } );
19
25
 
@@ -27,14 +33,4 @@ function PostPingbacks( { pingStatus = 'open', ...props } ) {
27
33
  );
28
34
  }
29
35
 
30
- export default compose( [
31
- withSelect( ( select ) => {
32
- return {
33
- pingStatus:
34
- select( editorStore ).getEditedPostAttribute( 'ping_status' ),
35
- };
36
- } ),
37
- withDispatch( ( dispatch ) => ( {
38
- editPost: dispatch( editorStore ).editPost,
39
- } ) ),
40
- ] )( PostPingbacks );
36
+ export default PostPingbacks;
@@ -82,7 +82,7 @@
82
82
  }
83
83
 
84
84
  .editor-post-publish-panel__footer {
85
- padding: 16px;
85
+ padding: $grid-unit-20;
86
86
  }
87
87
 
88
88
  .components-button.editor-post-publish-panel__toggle.is-primary {
@@ -94,17 +94,17 @@
94
94
  }
95
95
 
96
96
  .dashicon {
97
- margin-right: -4px;
97
+ margin-right: -$grid-unit-05;
98
98
  }
99
99
  }
100
100
 
101
101
  .editor-post-publish-panel__link {
102
102
  font-weight: 400;
103
- padding-left: 4px;
103
+ padding-left: $grid-unit-05;
104
104
  }
105
105
 
106
106
  .editor-post-publish-panel__prepublish {
107
- padding: 16px;
107
+ padding: $grid-unit-20;
108
108
 
109
109
  strong {
110
110
  color: $gray-900;
@@ -112,8 +112,8 @@
112
112
 
113
113
  .components-panel__body {
114
114
  background: $white;
115
- margin-left: -16px;
116
- margin-right: -16px;
115
+ margin-left: -$grid-unit-20;
116
+ margin-right: -$grid-unit-20;
117
117
  }
118
118
 
119
119
  .editor-post-visibility__dialog-legend {
@@ -130,21 +130,11 @@
130
130
  display: flex;
131
131
  align-content: space-between;
132
132
  flex-wrap: wrap;
133
- margin: -5px;
134
-
135
- > * {
136
- flex-grow: 1;
137
- margin: 5px;
138
- }
133
+ gap: $grid-unit-20;
139
134
 
140
135
  .components-button {
141
- height: auto;
142
136
  justify-content: center;
143
- padding: 3px 10px 4px;
144
137
  flex: 1;
145
- line-height: 1.6;
146
- text-align: center;
147
- white-space: normal;
148
138
  }
149
139
 
150
140
  .components-clipboard-button {
@@ -162,21 +152,18 @@
162
152
  }
163
153
 
164
154
  input[readonly] {
165
- padding: 10px;
166
- background: $gray-300;
155
+ padding: $grid-unit-20;
156
+ background: $gray-100;
157
+ border-color: $gray-400;
167
158
  overflow: hidden;
168
159
  text-overflow: ellipsis;
160
+ height: $button-size;
169
161
  }
170
162
  }
171
163
 
172
164
  .post-publish-panel__postpublish-post-address__copy-button-wrap {
173
165
  flex-shrink: 0;
174
- margin-left: 8px; // margin left for copy button
175
-
176
- // match copy button height to the address field height
177
- .components-button {
178
- height: 38px;
179
- }
166
+ margin-left: $grid-unit-20;
180
167
  }
181
168
 
182
169
  .post-publish-panel__postpublish-header {
@@ -2,15 +2,18 @@
2
2
  width: 100%;
3
3
  position: relative;
4
4
  justify-content: flex-start;
5
+ align-items: flex-start;
5
6
 
6
7
  > span {
7
8
  display: block;
8
9
  width: 45%;
9
10
  flex-shrink: 0;
11
+ padding: $grid-unit-15 * 0.5 0;
12
+ word-break: break-word;
10
13
  }
11
14
 
12
15
  > div {
13
16
  // Match padding on tertiary buttons for alignment.
14
- padding-left: $grid-unit-15;
17
+ padding: $grid-unit-15 * 0.5 0 $grid-unit-15 * 0.5 $grid-unit-15;
15
18
  }
16
19
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { withSelect } from '@wordpress/data';
4
+ import { useSelect } from '@wordpress/data';
5
5
  import { store as coreStore } from '@wordpress/core-data';
6
6
 
7
7
  /**
@@ -14,7 +14,6 @@ import { store as editorStore } from '../../store';
14
14
  * type supports one of the given `supportKeys` prop.
15
15
  *
16
16
  * @param {Object} props Props.
17
- * @param {string} [props.postType] Current post type.
18
17
  * @param {WPElement} props.children Children to be rendered if post
19
18
  * type supports.
20
19
  * @param {(string|string[])} props.supportKeys String or string array of keys
@@ -22,7 +21,12 @@ import { store as editorStore } from '../../store';
22
21
  *
23
22
  * @return {WPComponent} The component to be rendered.
24
23
  */
25
- export function PostTypeSupportCheck( { postType, children, supportKeys } ) {
24
+ function PostTypeSupportCheck( { children, supportKeys } ) {
25
+ const postType = useSelect( ( select ) => {
26
+ const { getEditedPostAttribute } = select( editorStore );
27
+ const { getPostType } = select( coreStore );
28
+ return getPostType( getEditedPostAttribute( 'type' ) );
29
+ }, [] );
26
30
  let isSupported = true;
27
31
  if ( postType ) {
28
32
  isSupported = (
@@ -37,10 +41,4 @@ export function PostTypeSupportCheck( { postType, children, supportKeys } ) {
37
41
  return children;
38
42
  }
39
43
 
40
- export default withSelect( ( select ) => {
41
- const { getEditedPostAttribute } = select( editorStore );
42
- const { getPostType } = select( coreStore );
43
- return {
44
- postType: getPostType( getEditedPostAttribute( 'type' ) ),
45
- };
46
- } )( PostTypeSupportCheck );
44
+ export default PostTypeSupportCheck;
@@ -3,15 +3,37 @@
3
3
  */
4
4
  import { render } from '@testing-library/react';
5
5
 
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { useSelect } from '@wordpress/data';
10
+
6
11
  /**
7
12
  * Internal dependencies
8
13
  */
9
- import { PostTypeSupportCheck } from '../';
14
+ import PostTypeSupportCheck from '../';
15
+
16
+ jest.mock( '@wordpress/data/src/components/use-select', () => {
17
+ // This allows us to tweak the returned value on each test.
18
+ const mock = jest.fn();
19
+ return mock;
20
+ } );
21
+
22
+ function setupUseSelectMock( postType ) {
23
+ useSelect.mockImplementation( ( cb ) => {
24
+ return cb( () => ( {
25
+ getPostType: () => postType,
26
+ getEditedPostAttribute: () => 'post',
27
+ } ) );
28
+ } );
29
+ }
10
30
 
11
31
  describe( 'PostTypeSupportCheck', () => {
12
32
  it( 'renders its children when post type is not known', () => {
33
+ setupUseSelectMock( undefined );
34
+
13
35
  const { container } = render(
14
- <PostTypeSupportCheck postType={ undefined } supportKeys="title">
36
+ <PostTypeSupportCheck supportKeys="title">
15
37
  Supported
16
38
  </PostTypeSupportCheck>
17
39
  );
@@ -20,11 +42,11 @@ describe( 'PostTypeSupportCheck', () => {
20
42
  } );
21
43
 
22
44
  it( 'does not render its children when post type is known and not supports', () => {
23
- const postType = {
45
+ setupUseSelectMock( {
24
46
  supports: {},
25
- };
47
+ } );
26
48
  const { container } = render(
27
- <PostTypeSupportCheck postType={ postType } supportKeys="title">
49
+ <PostTypeSupportCheck supportKeys="title">
28
50
  Supported
29
51
  </PostTypeSupportCheck>
30
52
  );
@@ -33,13 +55,13 @@ describe( 'PostTypeSupportCheck', () => {
33
55
  } );
34
56
 
35
57
  it( 'renders its children when post type is known and supports', () => {
36
- const postType = {
58
+ setupUseSelectMock( {
37
59
  supports: {
38
60
  title: true,
39
61
  },
40
- };
62
+ } );
41
63
  const { container } = render(
42
- <PostTypeSupportCheck postType={ postType } supportKeys="title">
64
+ <PostTypeSupportCheck supportKeys="title">
43
65
  Supported
44
66
  </PostTypeSupportCheck>
45
67
  );
@@ -48,16 +70,13 @@ describe( 'PostTypeSupportCheck', () => {
48
70
  } );
49
71
 
50
72
  it( 'renders its children if some of keys supported', () => {
51
- const postType = {
73
+ setupUseSelectMock( {
52
74
  supports: {
53
75
  title: true,
54
76
  },
55
- };
77
+ } );
56
78
  const { container } = render(
57
- <PostTypeSupportCheck
58
- postType={ postType }
59
- supportKeys={ [ 'title', 'thumbnail' ] }
60
- >
79
+ <PostTypeSupportCheck supportKeys={ [ 'title', 'thumbnail' ] }>
61
80
  Supported
62
81
  </PostTypeSupportCheck>
63
82
  );
@@ -66,14 +85,11 @@ describe( 'PostTypeSupportCheck', () => {
66
85
  } );
67
86
 
68
87
  it( 'does not render its children if none of keys supported', () => {
69
- const postType = {
88
+ setupUseSelectMock( {
70
89
  supports: {},
71
- };
90
+ } );
72
91
  const { container } = render(
73
- <PostTypeSupportCheck
74
- postType={ postType }
75
- supportKeys={ [ 'title', 'thumbnail' ] }
76
- >
92
+ <PostTypeSupportCheck supportKeys={ [ 'title', 'thumbnail' ] }>
77
93
  Supported
78
94
  </PostTypeSupportCheck>
79
95
  );
@@ -10,8 +10,8 @@ import {
10
10
  BlockContextProvider,
11
11
  privateApis as blockEditorPrivateApis,
12
12
  } from '@wordpress/block-editor';
13
- import { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';
14
13
  import { store as noticesStore } from '@wordpress/notices';
14
+ import { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';
15
15
 
16
16
  /**
17
17
  * Internal dependencies
@@ -22,6 +22,7 @@ import useBlockEditorSettings from './use-block-editor-settings';
22
22
  import { unlock } from '../../lock-unlock';
23
23
 
24
24
  const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
25
+ const { PatternsMenuItems } = unlock( editPatternsPrivateApis );
25
26
 
26
27
  export const ExperimentalEditorProvider = withRegistryProvider(
27
28
  ( {
@@ -130,7 +131,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
130
131
  useSubRegistry={ false }
131
132
  >
132
133
  { children }
133
- <ReusableBlocksMenuItems />
134
+ <PatternsMenuItems />
134
135
  </BlockEditorProviderComponent>
135
136
  </BlockContextProvider>
136
137
  </EntityProvider>
@@ -13,41 +13,36 @@ import { store as coreStore } from '@wordpress/core-data';
13
13
  * @return {WPComponent} The component.
14
14
  */
15
15
  export default function UnsavedChangesWarning() {
16
- const isDirty = useSelect( ( select ) => {
17
- return () => {
18
- const { __experimentalGetDirtyEntityRecords } = select( coreStore );
16
+ const { __experimentalGetDirtyEntityRecords } = useSelect( coreStore );
17
+
18
+ useEffect( () => {
19
+ /**
20
+ * Warns the user if there are unsaved changes before leaving the editor.
21
+ *
22
+ * @param {Event} event `beforeunload` event.
23
+ *
24
+ * @return {string | undefined} Warning prompt message, if unsaved changes exist.
25
+ */
26
+ const warnIfUnsavedChanges = ( event ) => {
27
+ // We need to call the selector directly in the listener to avoid race
28
+ // conditions with `BrowserURL` where `componentDidUpdate` gets the
29
+ // new value of `isEditedPostDirty` before this component does,
30
+ // causing this component to incorrectly think a trashed post is still dirty.
19
31
  const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
20
- return dirtyEntityRecords.length > 0;
32
+ if ( dirtyEntityRecords.length > 0 ) {
33
+ event.returnValue = __(
34
+ 'You have unsaved changes. If you proceed, they will be lost.'
35
+ );
36
+ return event.returnValue;
37
+ }
21
38
  };
22
- }, [] );
23
39
 
24
- /**
25
- * Warns the user if there are unsaved changes before leaving the editor.
26
- *
27
- * @param {Event} event `beforeunload` event.
28
- *
29
- * @return {string | undefined} Warning prompt message, if unsaved changes exist.
30
- */
31
- const warnIfUnsavedChanges = ( event ) => {
32
- // We need to call the selector directly in the listener to avoid race
33
- // conditions with `BrowserURL` where `componentDidUpdate` gets the
34
- // new value of `isEditedPostDirty` before this component does,
35
- // causing this component to incorrectly think a trashed post is still dirty.
36
- if ( isDirty() ) {
37
- event.returnValue = __(
38
- 'You have unsaved changes. If you proceed, they will be lost.'
39
- );
40
- return event.returnValue;
41
- }
42
- };
43
-
44
- useEffect( () => {
45
40
  window.addEventListener( 'beforeunload', warnIfUnsavedChanges );
46
41
 
47
42
  return () => {
48
43
  window.removeEventListener( 'beforeunload', warnIfUnsavedChanges );
49
44
  };
50
- }, [] );
45
+ }, [ __experimentalGetDirtyEntityRecords ] );
51
46
 
52
47
  return null;
53
48
  }
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { store as blocksStore } from '@wordpress/blocks';
5
- import { select as globalSelect, useSelect } from '@wordpress/data';
4
+ import { useSelect } from '@wordpress/data';
6
5
  import { useEntityProp } from '@wordpress/core-data';
7
6
  import { useMemo } from '@wordpress/element';
8
7
  import { createHigherOrderComponent } from '@wordpress/compose';
@@ -124,26 +123,3 @@ addFilter(
124
123
  'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',
125
124
  shimAttributeSource
126
125
  );
127
-
128
- // The above filter will only capture blocks registered after the filter was
129
- // added. There may already be blocks registered by this point, and those must
130
- // be updated to apply the shim.
131
- //
132
- // The following implementation achieves this, albeit with a couple caveats:
133
- // - Only blocks registered on the global store will be modified.
134
- // - The block settings are directly mutated, since there is currently no
135
- // mechanism to update an existing block registration. This is the reason for
136
- // `getBlockType` separate from `getBlockTypes`, since the latter returns a
137
- // _copy_ of the block registration (i.e. the mutation would not affect the
138
- // actual registered block settings).
139
- //
140
- // `getBlockTypes` or `getBlockType` implementation could change in the future
141
- // in regards to creating settings clones, but the corresponding end-to-end
142
- // tests for meta blocks should cover against any potential regressions.
143
- //
144
- // In the future, we could support updating block settings, at which point this
145
- // implementation could use that mechanism instead.
146
- globalSelect( blocksStore )
147
- .getBlockTypes()
148
- .map( ( { name } ) => globalSelect( blocksStore ).getBlockType( name ) )
149
- .forEach( shimAttributeSource );
@@ -302,7 +302,7 @@ export const autosave =
302
302
  };
303
303
 
304
304
  export const __unstableSaveForPreview =
305
- ( { forceIsAutosaveable } ) =>
305
+ ( { forceIsAutosaveable } = {} ) =>
306
306
  async ( { select, dispatch } ) => {
307
307
  if (
308
308
  ( forceIsAutosaveable || select.isEditedPostAutosaveable() ) &&
@@ -611,8 +611,8 @@ export const isEditedPostAutosaveable = createRegistrySelector(
611
611
  return true;
612
612
  }
613
613
 
614
- // If the title or excerpt has changed, the post is autosaveable.
615
- return [ 'title', 'excerpt' ].some(
614
+ // If title, excerpt, or meta have changed, the post is autosaveable.
615
+ return [ 'title', 'excerpt', 'meta' ].some(
616
616
  ( field ) =>
617
617
  getPostRawValue( autosave[ field ] ) !==
618
618
  getEditedPostAttribute( state, field )
@@ -260,7 +260,7 @@ describe( 'selectors', () => {
260
260
  parent: [ 'core/test-block-b' ],
261
261
  } );
262
262
 
263
- registerBlockType( 'core/test-freeform', {
263
+ registerBlockType( 'core/freeform', {
264
264
  save: ( props ) => <RawHTML>{ props.attributes.content }</RawHTML>,
265
265
  category: 'text',
266
266
  title: 'Test Freeform Content Handler',
@@ -287,7 +287,7 @@ describe( 'selectors', () => {
287
287
  save: () => null,
288
288
  } );
289
289
 
290
- setFreeformContentHandlerName( 'core/test-freeform' );
290
+ setFreeformContentHandlerName( 'core/freeform' );
291
291
  setDefaultBlockName( 'core/test-default' );
292
292
 
293
293
  cachedSelectors.forEach( ( { clear } ) => clear() );
@@ -298,7 +298,7 @@ describe( 'selectors', () => {
298
298
  unregisterBlockType( 'core/test-block-a' );
299
299
  unregisterBlockType( 'core/test-block-b' );
300
300
  unregisterBlockType( 'core/test-block-c' );
301
- unregisterBlockType( 'core/test-freeform' );
301
+ unregisterBlockType( 'core/freeform' );
302
302
  unregisterBlockType( 'core/test-default' );
303
303
 
304
304
  setFreeformContentHandlerName( undefined );
@@ -1337,7 +1337,7 @@ describe( 'selectors', () => {
1337
1337
  value: [
1338
1338
  {
1339
1339
  clientId: 123,
1340
- name: 'core/test-freeform',
1340
+ name: 'core/freeform',
1341
1341
  isValid: true,
1342
1342
  attributes: {
1343
1343
  content: '',
@@ -1364,7 +1364,7 @@ describe( 'selectors', () => {
1364
1364
  value: [
1365
1365
  {
1366
1366
  clientId: 123,
1367
- name: 'core/test-freeform',
1367
+ name: 'core/freeform',
1368
1368
  isValid: true,
1369
1369
  attributes: {
1370
1370
  content: '',
@@ -1741,7 +1741,7 @@ describe( 'selectors', () => {
1741
1741
  value: [
1742
1742
  {
1743
1743
  clientId: 123,
1744
- name: 'core/test-freeform',
1744
+ name: 'core/freeform',
1745
1745
  isValid: true,
1746
1746
  attributes: {
1747
1747
  content: '',
@@ -1769,7 +1769,7 @@ describe( 'selectors', () => {
1769
1769
  value: [
1770
1770
  {
1771
1771
  clientId: 123,
1772
- name: 'core/test-freeform',
1772
+ name: 'core/freeform',
1773
1773
  isValid: true,
1774
1774
  attributes: {
1775
1775
  content: '',
@@ -1797,7 +1797,7 @@ describe( 'selectors', () => {
1797
1797
  value: [
1798
1798
  {
1799
1799
  clientId: 123,
1800
- name: 'core/test-freeform',
1800
+ name: 'core/freeform',
1801
1801
  isValid: true,
1802
1802
  attributes: {
1803
1803
  content: 'Test Data',
@@ -1825,7 +1825,7 @@ describe( 'selectors', () => {
1825
1825
  value: [
1826
1826
  {
1827
1827
  clientId: 123,
1828
- name: 'core/test-freeform',
1828
+ name: 'core/freeform',
1829
1829
  isValid: true,
1830
1830
  attributes: {
1831
1831
  content: '',
@@ -1833,7 +1833,7 @@ describe( 'selectors', () => {
1833
1833
  },
1834
1834
  {
1835
1835
  clientId: 456,
1836
- name: 'core/test-freeform',
1836
+ name: 'core/freeform',
1837
1837
  isValid: true,
1838
1838
  attributes: {
1839
1839
  content: '',
@@ -2426,7 +2426,7 @@ describe( 'selectors', () => {
2426
2426
  } );
2427
2427
 
2428
2428
  it( "returns removep'd serialization of blocks for single unknown", () => {
2429
- const unknownBlock = createBlock( 'core/test-freeform', {
2429
+ const unknownBlock = createBlock( 'core/freeform', {
2430
2430
  content: '<p>foo</p>',
2431
2431
  } );
2432
2432
  const state = {
@@ -2448,10 +2448,10 @@ describe( 'selectors', () => {
2448
2448
  } );
2449
2449
 
2450
2450
  it( "returns non-removep'd serialization of blocks for multiple unknown", () => {
2451
- const firstUnknown = createBlock( 'core/test-freeform', {
2451
+ const firstUnknown = createBlock( 'core/freeform', {
2452
2452
  content: '<p>foo</p>',
2453
2453
  } );
2454
- const secondUnknown = createBlock( 'core/test-freeform', {
2454
+ const secondUnknown = createBlock( 'core/freeform', {
2455
2455
  content: '<p>bar</p>',
2456
2456
  } );
2457
2457
  const state = {