@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
@@ -4,10 +4,43 @@
4
4
  import { render, screen } from '@testing-library/react';
5
5
  import userEvent from '@testing-library/user-event';
6
6
 
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+ import { useSelect, useDispatch } from '@wordpress/data';
11
+
7
12
  /**
8
13
  * Internal dependencies
9
14
  */
10
- import { PageAttributesOrder } from '../order';
15
+ import PageAttributesOrder from '../order';
16
+
17
+ jest.mock( '@wordpress/data/src/components/use-select', () => jest.fn() );
18
+ jest.mock( '@wordpress/data/src/components/use-dispatch', () => ( {
19
+ useDispatch: jest.fn(),
20
+ } ) );
21
+
22
+ function setupDataMock( order = 0 ) {
23
+ useSelect.mockImplementation( ( mapSelect ) =>
24
+ mapSelect( () => ( {
25
+ getPostType: () => null,
26
+ getEditedPostAttribute: ( attr ) => {
27
+ switch ( attr ) {
28
+ case 'menu_order':
29
+ return order;
30
+ default:
31
+ return null;
32
+ }
33
+ },
34
+ } ) )
35
+ );
36
+
37
+ const editPost = jest.fn();
38
+ useDispatch.mockImplementation( () => ( {
39
+ editPost,
40
+ } ) );
41
+
42
+ return editPost;
43
+ }
11
44
 
12
45
  describe( 'PageAttributesOrder', () => {
13
46
  /**
@@ -22,9 +55,9 @@ describe( 'PageAttributesOrder', () => {
22
55
  it( 'should reject invalid input', async () => {
23
56
  const user = userEvent.setup();
24
57
 
25
- const onUpdateOrder = jest.fn();
58
+ const editPost = setupDataMock();
26
59
 
27
- render( <PageAttributesOrder onUpdateOrder={ onUpdateOrder } /> );
60
+ render( <PageAttributesOrder /> );
28
61
 
29
62
  const input = screen.getByRole( 'spinbutton', { name: 'Order' } );
30
63
  await user.type( input, 'bad', typeOptions );
@@ -33,31 +66,29 @@ describe( 'PageAttributesOrder', () => {
33
66
  await user.type( input, '+', typeOptions );
34
67
  await user.type( input, ' ', typeOptions );
35
68
 
36
- expect( onUpdateOrder ).not.toHaveBeenCalled();
69
+ expect( editPost ).not.toHaveBeenCalled();
37
70
  } );
38
71
 
39
72
  it( 'should update with zero input', async () => {
40
73
  const user = userEvent.setup();
41
74
 
42
- const onUpdateOrder = jest.fn();
75
+ const editPost = setupDataMock( 4 );
43
76
 
44
- render(
45
- <PageAttributesOrder order={ 4 } onUpdateOrder={ onUpdateOrder } />
46
- );
77
+ render( <PageAttributesOrder /> );
47
78
 
48
79
  const input = screen.getByRole( 'spinbutton', { name: 'Order' } );
49
80
 
50
81
  await user.type( input, '0', typeOptions );
51
82
 
52
- expect( onUpdateOrder ).toHaveBeenCalledWith( 0 );
83
+ expect( editPost ).toHaveBeenCalledWith( { menu_order: 0 } );
53
84
  } );
54
85
 
55
86
  it( 'should update with valid positive input', async () => {
56
87
  const user = userEvent.setup();
57
88
 
58
- const onUpdateOrder = jest.fn();
89
+ const editPost = setupDataMock();
59
90
 
60
- render( <PageAttributesOrder onUpdateOrder={ onUpdateOrder } /> );
91
+ render( <PageAttributesOrder /> );
61
92
 
62
93
  await user.type(
63
94
  screen.getByRole( 'spinbutton', { name: 'Order' } ),
@@ -65,15 +96,15 @@ describe( 'PageAttributesOrder', () => {
65
96
  typeOptions
66
97
  );
67
98
 
68
- expect( onUpdateOrder ).toHaveBeenCalledWith( 4 );
99
+ expect( editPost ).toHaveBeenCalledWith( { menu_order: 4 } );
69
100
  } );
70
101
 
71
102
  it( 'should update with valid negative input', async () => {
72
103
  const user = userEvent.setup();
73
104
 
74
- const onUpdateOrder = jest.fn();
105
+ const editPost = setupDataMock();
75
106
 
76
- render( <PageAttributesOrder onUpdateOrder={ onUpdateOrder } /> );
107
+ render( <PageAttributesOrder /> );
77
108
 
78
109
  await user.type(
79
110
  screen.getByRole( 'spinbutton', { name: 'Order' } ),
@@ -81,6 +112,6 @@ describe( 'PageAttributesOrder', () => {
81
112
  typeOptions
82
113
  );
83
114
 
84
- expect( onUpdateOrder ).toHaveBeenCalledWith( -1 );
115
+ expect( editPost ).toHaveBeenCalledWith( { menu_order: -1 } );
85
116
  } );
86
117
  } );
@@ -3,8 +3,12 @@
3
3
  */
4
4
  import PostTypeSupportCheck from '../post-type-support-check';
5
5
 
6
- function PostExcerptCheck( props ) {
7
- return <PostTypeSupportCheck { ...props } supportKeys="excerpt" />;
6
+ function PostExcerptCheck( { children } ) {
7
+ return (
8
+ <PostTypeSupportCheck supportKeys="excerpt">
9
+ { children }
10
+ </PostTypeSupportCheck>
11
+ );
8
12
  }
9
13
 
10
14
  export default PostExcerptCheck;
@@ -4,10 +4,12 @@
4
4
  import PostTypeSupportCheck from '../post-type-support-check';
5
5
  import ThemeSupportCheck from '../theme-support-check';
6
6
 
7
- function PostFeaturedImageCheck( props ) {
7
+ function PostFeaturedImageCheck( { children } ) {
8
8
  return (
9
9
  <ThemeSupportCheck supportKeys="post-thumbnails">
10
- <PostTypeSupportCheck { ...props } supportKeys="thumbnail" />
10
+ <PostTypeSupportCheck supportKeys="thumbnail">
11
+ { children }
12
+ </PostTypeSupportCheck>
11
13
  </ThemeSupportCheck>
12
14
  );
13
15
  }
@@ -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
 
6
6
  /**
7
7
  * Internal dependencies
@@ -9,17 +9,22 @@ import { withSelect } from '@wordpress/data';
9
9
  import PostTypeSupportCheck from '../post-type-support-check';
10
10
  import { store as editorStore } from '../../store';
11
11
 
12
- function PostFormatCheck( { disablePostFormats, ...props } ) {
12
+ function PostFormatCheck( { children } ) {
13
+ const disablePostFormats = useSelect(
14
+ ( select ) =>
15
+ select( editorStore ).getEditorSettings().disablePostFormats,
16
+ []
17
+ );
18
+
19
+ if ( disablePostFormats ) {
20
+ return null;
21
+ }
22
+
13
23
  return (
14
- ! disablePostFormats && (
15
- <PostTypeSupportCheck { ...props } supportKeys="post-formats" />
16
- )
24
+ <PostTypeSupportCheck supportKeys="post-formats">
25
+ { children }
26
+ </PostTypeSupportCheck>
17
27
  );
18
28
  }
19
29
 
20
- export default withSelect( ( select ) => {
21
- const editorSettings = select( editorStore ).getEditorSettings();
22
- return {
23
- disablePostFormats: editorSettings.disablePostFormats,
24
- };
25
- } )( PostFormatCheck );
30
+ export default PostFormatCheck;
@@ -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
 
6
6
  /**
7
7
  * Internal dependencies
@@ -9,11 +9,16 @@ import { withSelect } from '@wordpress/data';
9
9
  import PostTypeSupportCheck from '../post-type-support-check';
10
10
  import { store as editorStore } from '../../store';
11
11
 
12
- export function PostLastRevisionCheck( {
13
- lastRevisionId,
14
- revisionsCount,
15
- children,
16
- } ) {
12
+ function PostLastRevisionCheck( { children } ) {
13
+ const { lastRevisionId, revisionsCount } = useSelect( ( select ) => {
14
+ const { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =
15
+ select( editorStore );
16
+ return {
17
+ lastRevisionId: getCurrentPostLastRevisionId(),
18
+ revisionsCount: getCurrentPostRevisionsCount(),
19
+ };
20
+ }, [] );
21
+
17
22
  if ( ! lastRevisionId || revisionsCount < 2 ) {
18
23
  return null;
19
24
  }
@@ -25,11 +30,4 @@ export function PostLastRevisionCheck( {
25
30
  );
26
31
  }
27
32
 
28
- export default withSelect( ( select ) => {
29
- const { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =
30
- select( editorStore );
31
- return {
32
- lastRevisionId: getCurrentPostLastRevisionId(),
33
- revisionsCount: getCurrentPostRevisionsCount(),
34
- };
35
- } )( PostLastRevisionCheck );
33
+ export default PostLastRevisionCheck;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { sprintf, _n } from '@wordpress/i18n';
5
5
  import { Button } from '@wordpress/components';
6
- import { withSelect } from '@wordpress/data';
6
+ import { useSelect } from '@wordpress/data';
7
7
  import { backup } from '@wordpress/icons';
8
8
  import { addQueryArgs } from '@wordpress/url';
9
9
 
@@ -13,7 +13,16 @@ import { addQueryArgs } from '@wordpress/url';
13
13
  import PostLastRevisionCheck from './check';
14
14
  import { store as editorStore } from '../../store';
15
15
 
16
- function LastRevision( { lastRevisionId, revisionsCount } ) {
16
+ function LastRevision() {
17
+ const { lastRevisionId, revisionsCount } = useSelect( ( select ) => {
18
+ const { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =
19
+ select( editorStore );
20
+ return {
21
+ lastRevisionId: getCurrentPostLastRevisionId(),
22
+ revisionsCount: getCurrentPostRevisionsCount(),
23
+ };
24
+ }, [] );
25
+
17
26
  return (
18
27
  <PostLastRevisionCheck>
19
28
  <Button
@@ -34,11 +43,4 @@ function LastRevision( { lastRevisionId, revisionsCount } ) {
34
43
  );
35
44
  }
36
45
 
37
- export default withSelect( ( select ) => {
38
- const { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =
39
- select( editorStore );
40
- return {
41
- lastRevisionId: getCurrentPostLastRevisionId(),
42
- revisionsCount: getCurrentPostRevisionsCount(),
43
- };
44
- } )( LastRevision );
46
+ export default LastRevision;
@@ -3,38 +3,50 @@
3
3
  */
4
4
  import { render, screen } 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 { PostLastRevisionCheck } from '../check';
14
+ import PostLastRevisionCheck from '../check';
15
+
16
+ jest.mock( '@wordpress/data/src/components/use-select', () => jest.fn() );
17
+
18
+ function setupDataMock( id, count ) {
19
+ useSelect.mockImplementation( ( mapSelect ) =>
20
+ mapSelect( () => ( {
21
+ getCurrentPostLastRevisionId: () => id,
22
+ getCurrentPostRevisionsCount: () => count,
23
+ getEditedPostAttribute: () => null,
24
+ getPostType: () => null,
25
+ } ) )
26
+ );
27
+ }
10
28
 
11
29
  describe( 'PostLastRevisionCheck', () => {
12
30
  it( 'should not render anything if the last revision ID is unknown', () => {
13
- render(
14
- <PostLastRevisionCheck revisionsCount={ 2 }>
15
- Children
16
- </PostLastRevisionCheck>
17
- );
31
+ setupDataMock( null, 2 );
32
+
33
+ render( <PostLastRevisionCheck>Children</PostLastRevisionCheck> );
18
34
 
19
35
  expect( screen.queryByText( 'Children' ) ).not.toBeInTheDocument();
20
36
  } );
21
37
 
22
38
  it( 'should not render anything if there is only one revision', () => {
23
- render(
24
- <PostLastRevisionCheck lastRevisionId={ 1 } revisionsCount={ 1 }>
25
- Children
26
- </PostLastRevisionCheck>
27
- );
39
+ setupDataMock( 1, 1 );
40
+
41
+ render( <PostLastRevisionCheck>Children</PostLastRevisionCheck> );
28
42
 
29
43
  expect( screen.queryByText( 'Children' ) ).not.toBeInTheDocument();
30
44
  } );
31
45
 
32
46
  it( 'should render if there are two revisions', () => {
33
- render(
34
- <PostLastRevisionCheck lastRevisionId={ 1 } revisionsCount={ 2 }>
35
- Children
36
- </PostLastRevisionCheck>
37
- );
47
+ setupDataMock( 1, 2 );
48
+
49
+ render( <PostLastRevisionCheck>Children</PostLastRevisionCheck> );
38
50
 
39
51
  expect( screen.getByText( 'Children' ) ).toBeVisible();
40
52
  } );
@@ -1,19 +1,24 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { compose } from '@wordpress/compose';
5
- import { withSelect } from '@wordpress/data';
4
+ import { useSelect } from '@wordpress/data';
6
5
 
7
6
  /**
8
7
  * Internal dependencies
9
8
  */
10
9
  import { store as editorStore } from '../../store';
11
10
 
12
- export function PostPendingStatusCheck( {
13
- hasPublishAction,
14
- isPublished,
15
- children,
16
- } ) {
11
+ export function PostPendingStatusCheck( { children } ) {
12
+ const { hasPublishAction, isPublished } = useSelect( ( select ) => {
13
+ const { isCurrentPostPublished, getCurrentPost } =
14
+ select( editorStore );
15
+ return {
16
+ hasPublishAction:
17
+ getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
18
+ isPublished: isCurrentPostPublished(),
19
+ };
20
+ }, [] );
21
+
17
22
  if ( isPublished || ! hasPublishAction ) {
18
23
  return null;
19
24
  }
@@ -21,15 +26,4 @@ export function PostPendingStatusCheck( {
21
26
  return children;
22
27
  }
23
28
 
24
- export default compose(
25
- withSelect( ( select ) => {
26
- const { isCurrentPostPublished, getCurrentPostType, getCurrentPost } =
27
- select( editorStore );
28
- return {
29
- hasPublishAction:
30
- getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
31
- isPublished: isCurrentPostPublished(),
32
- postType: getCurrentPostType(),
33
- };
34
- } )
35
- )( PostPendingStatusCheck );
29
+ export default PostPendingStatusCheck;
@@ -3,8 +3,7 @@
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
@@ -12,10 +11,15 @@ import { compose } from '@wordpress/compose';
12
11
  import PostPendingStatusCheck from './check';
13
12
  import { store as editorStore } from '../../store';
14
13
 
15
- export function PostPendingStatus( { status, onUpdateStatus } ) {
14
+ export function PostPendingStatus() {
15
+ const status = useSelect(
16
+ ( select ) => select( editorStore ).getEditedPostAttribute( 'status' ),
17
+ []
18
+ );
19
+ const { editPost } = useDispatch( editorStore );
16
20
  const togglePendingStatus = () => {
17
21
  const updatedStatus = status === 'pending' ? 'draft' : 'pending';
18
- onUpdateStatus( updatedStatus );
22
+ editPost( { status: updatedStatus } );
19
23
  };
20
24
 
21
25
  return (
@@ -30,13 +34,4 @@ export function PostPendingStatus( { status, onUpdateStatus } ) {
30
34
  );
31
35
  }
32
36
 
33
- export default compose(
34
- withSelect( ( select ) => ( {
35
- status: select( editorStore ).getEditedPostAttribute( 'status' ),
36
- } ) ),
37
- withDispatch( ( dispatch ) => ( {
38
- onUpdateStatus( status ) {
39
- dispatch( editorStore ).editPost( { status } );
40
- },
41
- } ) )
42
- )( PostPendingStatus );
37
+ export default PostPendingStatus;
@@ -3,27 +3,49 @@
3
3
  */
4
4
  import { render, screen } 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
14
  import { PostPendingStatusCheck } from '../check';
10
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( hasPublishAction ) {
23
+ useSelect.mockImplementation( ( cb ) => {
24
+ return cb( () => ( {
25
+ isCurrentPostPublished: () => false,
26
+ getCurrentPost: () => ( {
27
+ _links: {
28
+ 'wp:action-publish': hasPublishAction,
29
+ },
30
+ } ),
31
+ } ) );
32
+ } );
33
+ }
34
+
11
35
  describe( 'PostPendingStatusCheck', () => {
12
36
  it( "should not render anything if the user doesn't have the right capabilities", () => {
13
- render(
14
- <PostPendingStatusCheck hasPublishAction={ false }>
15
- status
16
- </PostPendingStatusCheck>
17
- );
37
+ setupUseSelectMock( false );
38
+
39
+ render( <PostPendingStatusCheck>status</PostPendingStatusCheck> );
40
+
18
41
  expect( screen.queryByText( 'status' ) ).not.toBeInTheDocument();
19
42
  } );
20
43
 
21
44
  it( 'should render if the user has the correct capability', () => {
22
- render(
23
- <PostPendingStatusCheck hasPublishAction={ true }>
24
- status
25
- </PostPendingStatusCheck>
26
- );
45
+ setupUseSelectMock( true );
46
+
47
+ render( <PostPendingStatusCheck>status</PostPendingStatusCheck> );
48
+
27
49
  expect( screen.getByText( 'status' ) ).toBeVisible();
28
50
  } );
29
51
  } );
@@ -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
  }
@@ -21,7 +21,7 @@ import { store as editorStore } from '../../store';
21
21
  *
22
22
  * @return {WPComponent} The component to be rendered.
23
23
  */
24
- export function PostTypeSupportCheck( { children, supportKeys } ) {
24
+ function PostTypeSupportCheck( { children, supportKeys } ) {
25
25
  const postType = useSelect( ( select ) => {
26
26
  const { getEditedPostAttribute } = select( editorStore );
27
27
  const { getPostType } = select( coreStore );
@@ -11,7 +11,7 @@ import { useSelect } from '@wordpress/data';
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
- import { PostTypeSupportCheck } from '../';
14
+ import PostTypeSupportCheck from '../';
15
15
 
16
16
  jest.mock( '@wordpress/data/src/components/use-select', () => {
17
17
  // This allows us to tweak the returned value on each test.
@@ -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>