@wordpress/block-library 7.5.0 → 7.8.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 (946) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +3 -2
  3. package/babel-plugin.js +154 -0
  4. package/build/audio/edit.js +1 -1
  5. package/build/audio/edit.js.map +1 -1
  6. package/build/audio/index.js +6 -1
  7. package/build/audio/index.js.map +1 -1
  8. package/build/avatar/hooks.js +2 -2
  9. package/build/avatar/hooks.js.map +1 -1
  10. package/build/block/edit.js +10 -9
  11. package/build/block/edit.js.map +1 -1
  12. package/build/block/edit.native.js.map +1 -1
  13. package/build/button/deprecated.js +175 -35
  14. package/build/button/deprecated.js.map +1 -1
  15. package/build/button/edit.js +1 -1
  16. package/build/button/edit.js.map +1 -1
  17. package/build/button/edit.native.js.map +1 -1
  18. package/build/button/index.js +25 -1
  19. package/build/button/index.js.map +1 -1
  20. package/build/button/save.js +1 -1
  21. package/build/button/save.js.map +1 -1
  22. package/build/buttons/deprecated.js.map +1 -1
  23. package/build/buttons/edit.js.map +1 -1
  24. package/build/buttons/edit.native.js.map +1 -1
  25. package/build/categories/edit.js +1 -1
  26. package/build/categories/edit.js.map +1 -1
  27. package/build/categories/index.js +1 -1
  28. package/build/column/deprecated.js.map +1 -1
  29. package/build/column/edit.js.map +1 -1
  30. package/build/column/edit.native.js.map +1 -1
  31. package/build/columns/deprecated.js.map +1 -1
  32. package/build/columns/edit.js +1 -1
  33. package/build/columns/edit.js.map +1 -1
  34. package/build/columns/edit.native.js +1 -1
  35. package/build/columns/edit.native.js.map +1 -1
  36. package/build/columns/index.js +3 -1
  37. package/build/columns/index.js.map +1 -1
  38. package/build/columns/utils.js +1 -1
  39. package/build/columns/utils.js.map +1 -1
  40. package/build/comment-author-avatar/index.js +1 -0
  41. package/build/comment-author-avatar/index.js.map +1 -1
  42. package/build/comment-author-name/edit.js +4 -2
  43. package/build/comment-author-name/edit.js.map +1 -1
  44. package/build/comment-date/edit.js +1 -1
  45. package/build/comment-date/edit.js.map +1 -1
  46. package/build/comments-title/deprecated.js +110 -0
  47. package/build/comments-title/deprecated.js.map +1 -0
  48. package/build/comments-title/edit.js +35 -37
  49. package/build/comments-title/edit.js.map +1 -1
  50. package/build/comments-title/index.js +5 -8
  51. package/build/comments-title/index.js.map +1 -1
  52. package/build/cover/controls.native.js +2 -3
  53. package/build/cover/controls.native.js.map +1 -1
  54. package/build/cover/deprecated.js +212 -207
  55. package/build/cover/deprecated.js.map +1 -1
  56. package/build/cover/edit/block-controls.js +108 -0
  57. package/build/cover/edit/block-controls.js.map +1 -0
  58. package/build/cover/edit/cover-placeholder.js +49 -0
  59. package/build/cover/edit/cover-placeholder.js.map +1 -0
  60. package/build/cover/edit/index.js +336 -0
  61. package/build/cover/edit/index.js.map +1 -0
  62. package/build/cover/edit/inspector-controls.js +252 -0
  63. package/build/cover/edit/inspector-controls.js.map +1 -0
  64. package/build/cover/edit/resizable-cover.js +67 -0
  65. package/build/cover/edit/resizable-cover.js.map +1 -0
  66. package/build/cover/{use-cover-is-dark.js → edit/use-cover-is-dark.js} +0 -0
  67. package/build/cover/edit/use-cover-is-dark.js.map +1 -0
  68. package/build/cover/edit.native.js +0 -1
  69. package/build/cover/edit.native.js.map +1 -1
  70. package/build/cover/focal-point-settings-button.native.js.map +1 -1
  71. package/build/cover/save.js +18 -5
  72. package/build/cover/save.js.map +1 -1
  73. package/build/cover/shared.js +15 -9
  74. package/build/cover/shared.js.map +1 -1
  75. package/build/cover/transforms.js.map +1 -1
  76. package/build/embed/deprecated.js +6 -1
  77. package/build/embed/deprecated.js.map +1 -1
  78. package/build/embed/edit.js.map +1 -1
  79. package/build/embed/edit.native.js.map +1 -1
  80. package/build/embed/embed-controls.native.js.map +1 -1
  81. package/build/embed/embed-preview.js +1 -1
  82. package/build/embed/embed-preview.js.map +1 -1
  83. package/build/embed/index.js +6 -1
  84. package/build/embed/index.js.map +1 -1
  85. package/build/embed/transforms.js +6 -1
  86. package/build/embed/transforms.js.map +1 -1
  87. package/build/embed/util.js +6 -1
  88. package/build/embed/util.js.map +1 -1
  89. package/build/file/edit.js +1 -1
  90. package/build/file/edit.js.map +1 -1
  91. package/build/file/edit.native.js +0 -1
  92. package/build/file/edit.native.js.map +1 -1
  93. package/build/file/index.js.map +1 -1
  94. package/build/file/save.js +9 -1
  95. package/build/file/save.js.map +1 -1
  96. package/build/gallery/edit.js +3 -2
  97. package/build/gallery/edit.js.map +1 -1
  98. package/build/gallery/gallery.js +1 -1
  99. package/build/gallery/gallery.js.map +1 -1
  100. package/build/gallery/gallery.native.js.map +1 -1
  101. package/build/gallery/gap-styles.js +14 -4
  102. package/build/gallery/gap-styles.js.map +1 -1
  103. package/build/gallery/index.js +1 -1
  104. package/build/gallery/index.js.map +1 -1
  105. package/build/gallery/shared.js +29 -12
  106. package/build/gallery/shared.js.map +1 -1
  107. package/build/gallery/use-get-media.js +2 -1
  108. package/build/gallery/use-get-media.js.map +1 -1
  109. package/build/gallery/use-short-code-transform.js +19 -18
  110. package/build/gallery/use-short-code-transform.js.map +1 -1
  111. package/build/gallery/v1/edit.js.map +1 -1
  112. package/build/gallery/v1/gallery-image.js.map +1 -1
  113. package/build/gallery/v1/gallery-image.native.js.map +1 -1
  114. package/build/gallery/v1/gallery.js +1 -1
  115. package/build/gallery/v1/gallery.js.map +1 -1
  116. package/build/heading/autogenerate-anchors.js +7 -2
  117. package/build/heading/autogenerate-anchors.js.map +1 -1
  118. package/build/heading/deprecated.js.map +1 -1
  119. package/build/heading/edit.js +6 -2
  120. package/build/heading/edit.js.map +1 -1
  121. package/build/heading/index.js +1 -0
  122. package/build/heading/index.js.map +1 -1
  123. package/build/heading/transforms.js +1 -0
  124. package/build/heading/transforms.js.map +1 -1
  125. package/build/image/deprecated.js.map +1 -1
  126. package/build/image/edit.js +5 -56
  127. package/build/image/edit.js.map +1 -1
  128. package/build/image/edit.native.js +56 -4
  129. package/build/image/edit.native.js.map +1 -1
  130. package/build/image/image.js +4 -14
  131. package/build/image/image.js.map +1 -1
  132. package/build/image/index.js +5 -0
  133. package/build/image/index.js.map +1 -1
  134. package/build/image/transforms.js.map +1 -1
  135. package/build/image/utils.js +2 -1
  136. package/build/image/utils.js.map +1 -1
  137. package/build/index.js +46 -10
  138. package/build/index.js.map +1 -1
  139. package/build/is-block-metadata-experimental.js +18 -0
  140. package/build/is-block-metadata-experimental.js.map +1 -0
  141. package/build/latest-comments/edit.js.map +1 -1
  142. package/build/latest-posts/edit.js +31 -5
  143. package/build/latest-posts/edit.js.map +1 -1
  144. package/build/latest-posts/edit.native.js.map +1 -1
  145. package/build/list/index.js.map +1 -1
  146. package/build/list/transforms.js +6 -0
  147. package/build/list/transforms.js.map +1 -1
  148. package/build/list/v2/edit.js +2 -1
  149. package/build/list/v2/edit.js.map +1 -1
  150. package/build/list/v2/migrate.js +1 -0
  151. package/build/list/v2/migrate.js.map +1 -1
  152. package/build/list/v2/transforms.js +46 -9
  153. package/build/list/v2/transforms.js.map +1 -1
  154. package/build/list-item/edit.js +7 -9
  155. package/build/list-item/edit.js.map +1 -1
  156. package/build/list-item/hooks/index.js +24 -0
  157. package/build/list-item/hooks/index.js.map +1 -1
  158. package/build/list-item/hooks/use-backspace.js +59 -0
  159. package/build/list-item/hooks/use-backspace.js.map +1 -0
  160. package/build/list-item/hooks/use-enter.js +6 -9
  161. package/build/list-item/hooks/use-enter.js.map +1 -1
  162. package/build/list-item/hooks/use-indent-list-item.js +33 -39
  163. package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
  164. package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
  165. package/build/list-item/hooks/use-space.js +54 -0
  166. package/build/list-item/hooks/use-space.js.map +1 -0
  167. package/build/list-item/hooks/use-split.js +44 -0
  168. package/build/list-item/hooks/use-split.js.map +1 -0
  169. package/build/list-item/index.js +1 -0
  170. package/build/list-item/index.js.map +1 -1
  171. package/build/list-item/utils.js +1 -1
  172. package/build/list-item/utils.js.map +1 -1
  173. package/build/media-text/deprecated.js +5 -3
  174. package/build/media-text/deprecated.js.map +1 -1
  175. package/build/media-text/edit.native.js +2 -1
  176. package/build/media-text/edit.native.js.map +1 -1
  177. package/build/media-text/media-container.js +3 -3
  178. package/build/media-text/media-container.js.map +1 -1
  179. package/build/media-text/media-container.native.js +2 -4
  180. package/build/media-text/media-container.native.js.map +1 -1
  181. package/build/media-text/save.js +3 -1
  182. package/build/media-text/save.js.map +1 -1
  183. package/build/media-text/transforms.js +137 -8
  184. package/build/media-text/transforms.js.map +1 -1
  185. package/build/missing/edit.native.js.map +1 -1
  186. package/build/navigation/deprecated.js.map +1 -1
  187. package/build/navigation/edit/index.js +86 -81
  188. package/build/navigation/edit/index.js.map +1 -1
  189. package/build/navigation/edit/inner-blocks.js +1 -5
  190. package/build/navigation/edit/inner-blocks.js.map +1 -1
  191. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  192. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  193. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  194. package/build/navigation/use-navigation-entities.js +3 -3
  195. package/build/navigation/use-navigation-entities.js.map +1 -1
  196. package/build/navigation/use-navigation-menu.js +130 -38
  197. package/build/navigation/use-navigation-menu.js.map +1 -1
  198. package/build/navigation/use-template-part-area-label.js +4 -1
  199. package/build/navigation/use-template-part-area-label.js.map +1 -1
  200. package/build/navigation-link/edit.js +44 -12
  201. package/build/navigation-link/edit.js.map +1 -1
  202. package/build/navigation-link/fallback-variations.js +1 -1
  203. package/build/navigation-link/fallback-variations.js.map +1 -1
  204. package/build/navigation-link/hooks.js +1 -1
  205. package/build/navigation-link/hooks.js.map +1 -1
  206. package/build/navigation-submenu/edit.js.map +1 -1
  207. package/build/page-list/convert-to-links-modal.js +1 -1
  208. package/build/page-list/convert-to-links-modal.js.map +1 -1
  209. package/build/page-list/edit.js +1 -1
  210. package/build/page-list/edit.js.map +1 -1
  211. package/build/paragraph/deprecated.js +1 -1
  212. package/build/paragraph/deprecated.js.map +1 -1
  213. package/build/pattern/edit.js.map +1 -1
  214. package/build/post-author/edit.js +1 -1
  215. package/build/post-author/edit.js.map +1 -1
  216. package/build/post-author-name/index.js +4 -0
  217. package/build/post-author-name/index.js.map +1 -1
  218. package/build/post-author-name/transforms.js +41 -0
  219. package/build/post-author-name/transforms.js.map +1 -0
  220. package/build/post-comment/index.js +1 -0
  221. package/build/post-comment/index.js.map +1 -1
  222. package/build/post-comments/edit.js +34 -16
  223. package/build/post-comments/edit.js.map +1 -1
  224. package/build/post-comments-count/index.js +1 -0
  225. package/build/post-comments-count/index.js.map +1 -1
  226. package/build/post-comments-form/form.js +12 -2
  227. package/build/post-comments-form/form.js.map +1 -1
  228. package/build/post-comments-link/index.js +1 -0
  229. package/build/post-comments-link/index.js.map +1 -1
  230. package/build/post-content/edit.js.map +1 -1
  231. package/build/post-date/edit.js +13 -7
  232. package/build/post-date/edit.js.map +1 -1
  233. package/build/post-featured-image/edit.js +11 -25
  234. package/build/post-featured-image/edit.js.map +1 -1
  235. package/build/post-navigation-link/index.js +4 -0
  236. package/build/post-navigation-link/index.js.map +1 -1
  237. package/build/post-template/edit.js +7 -2
  238. package/build/post-template/edit.js.map +1 -1
  239. package/build/post-terms/edit.js +11 -2
  240. package/build/post-terms/edit.js.map +1 -1
  241. package/build/post-terms/hooks.js +33 -0
  242. package/build/post-terms/hooks.js.map +1 -0
  243. package/build/post-terms/index.js +12 -5
  244. package/build/post-terms/index.js.map +1 -1
  245. package/build/post-title/index.js +1 -1
  246. package/build/post-title/index.js.map +1 -1
  247. package/build/pullquote/deprecated.js.map +1 -1
  248. package/build/pullquote/edit.js +1 -1
  249. package/build/pullquote/edit.js.map +1 -1
  250. package/build/pullquote/edit.native.js +1 -1
  251. package/build/pullquote/edit.native.js.map +1 -1
  252. package/build/query/edit/index.js +5 -1
  253. package/build/query/edit/index.js.map +1 -1
  254. package/build/query/edit/inspector-controls/index.js +26 -17
  255. package/build/query/edit/inspector-controls/index.js.map +1 -1
  256. package/build/query/edit/inspector-controls/parent-control.js +148 -0
  257. package/build/query/edit/inspector-controls/parent-control.js.map +1 -0
  258. package/build/query/edit/inspector-controls/sticky-control.js +41 -0
  259. package/build/query/edit/inspector-controls/sticky-control.js.map +1 -0
  260. package/build/query/edit/query-toolbar.js +16 -2
  261. package/build/query/edit/query-toolbar.js.map +1 -1
  262. package/build/query/index.js +2 -1
  263. package/build/query/index.js.map +1 -1
  264. package/build/query/utils.js +28 -2
  265. package/build/query/utils.js.map +1 -1
  266. package/build/query-title/index.js +1 -1
  267. package/build/query-title/index.js.map +1 -1
  268. package/build/query-title/variations.js +1 -1
  269. package/build/query-title/variations.js.map +1 -1
  270. package/build/quote/edit.js +3 -2
  271. package/build/quote/edit.js.map +1 -1
  272. package/build/quote/v2/edit.js +1 -1
  273. package/build/quote/v2/edit.js.map +1 -1
  274. package/build/search/edit.js +2 -1
  275. package/build/search/edit.js.map +1 -1
  276. package/build/search/edit.native.js.map +1 -1
  277. package/build/search/index.js +4 -0
  278. package/build/search/index.js.map +1 -1
  279. package/build/separator/use-deprecated-opacity.js.map +1 -1
  280. package/build/shortcode/edit.native.js +16 -13
  281. package/build/shortcode/edit.native.js.map +1 -1
  282. package/build/site-logo/edit.js +4 -13
  283. package/build/site-logo/edit.js.map +1 -1
  284. package/build/social-links/deprecated.js.map +1 -1
  285. package/build/social-links/edit.js +2 -2
  286. package/build/social-links/edit.js.map +1 -1
  287. package/build/social-links/edit.native.js.map +1 -1
  288. package/build/spacer/controls.js.map +1 -1
  289. package/build/table/deprecated.js.map +1 -1
  290. package/build/table/edit.js +15 -2
  291. package/build/table/edit.js.map +1 -1
  292. package/build/table/index.js +6 -1
  293. package/build/table/index.js.map +1 -1
  294. package/build/table/state.js.map +1 -1
  295. package/build/table-of-contents/edit.js +145 -65
  296. package/build/table-of-contents/edit.js.map +1 -1
  297. package/build/table-of-contents/index.js +13 -3
  298. package/build/table-of-contents/index.js.map +1 -1
  299. package/build/table-of-contents/list.js +16 -9
  300. package/build/table-of-contents/list.js.map +1 -1
  301. package/build/table-of-contents/save.js +40 -0
  302. package/build/table-of-contents/save.js.map +1 -0
  303. package/build/table-of-contents/utils.js +11 -77
  304. package/build/table-of-contents/utils.js.map +1 -1
  305. package/build/tag-cloud/edit.js.map +1 -1
  306. package/build/template-part/edit/advanced-controls.js +4 -1
  307. package/build/template-part/edit/advanced-controls.js.map +1 -1
  308. package/build/template-part/edit/index.js +7 -3
  309. package/build/template-part/edit/index.js.map +1 -1
  310. package/build/template-part/edit/inner-blocks.js +3 -8
  311. package/build/template-part/edit/inner-blocks.js.map +1 -1
  312. package/build/template-part/edit/utils/hooks.js +4 -1
  313. package/build/template-part/edit/utils/hooks.js.map +1 -1
  314. package/build/transformationCategories.native.js.map +1 -1
  315. package/build/video/edit-common-settings.js.map +1 -1
  316. package/build/video/edit.js +1 -1
  317. package/build/video/edit.js.map +1 -1
  318. package/build/video/edit.native.js +43 -0
  319. package/build/video/edit.native.js.map +1 -1
  320. package/build/video/index.js +6 -1
  321. package/build/video/index.js.map +1 -1
  322. package/build-module/audio/edit.js +2 -2
  323. package/build-module/audio/edit.js.map +1 -1
  324. package/build-module/audio/index.js +6 -1
  325. package/build-module/audio/index.js.map +1 -1
  326. package/build-module/avatar/hooks.js +2 -2
  327. package/build-module/avatar/hooks.js.map +1 -1
  328. package/build-module/block/edit.js +11 -10
  329. package/build-module/block/edit.js.map +1 -1
  330. package/build-module/block/edit.native.js.map +1 -1
  331. package/build-module/button/deprecated.js +175 -35
  332. package/build-module/button/deprecated.js.map +1 -1
  333. package/build-module/button/edit.js +2 -2
  334. package/build-module/button/edit.js.map +1 -1
  335. package/build-module/button/edit.native.js.map +1 -1
  336. package/build-module/button/index.js +25 -1
  337. package/build-module/button/index.js.map +1 -1
  338. package/build-module/button/save.js +2 -2
  339. package/build-module/button/save.js.map +1 -1
  340. package/build-module/buttons/deprecated.js.map +1 -1
  341. package/build-module/buttons/edit.js.map +1 -1
  342. package/build-module/buttons/edit.native.js.map +1 -1
  343. package/build-module/categories/edit.js +1 -1
  344. package/build-module/categories/edit.js.map +1 -1
  345. package/build-module/categories/index.js +1 -1
  346. package/build-module/column/deprecated.js.map +1 -1
  347. package/build-module/column/edit.js.map +1 -1
  348. package/build-module/column/edit.native.js.map +1 -1
  349. package/build-module/columns/deprecated.js.map +1 -1
  350. package/build-module/columns/edit.js +2 -2
  351. package/build-module/columns/edit.js.map +1 -1
  352. package/build-module/columns/edit.native.js +2 -2
  353. package/build-module/columns/edit.native.js.map +1 -1
  354. package/build-module/columns/index.js +3 -1
  355. package/build-module/columns/index.js.map +1 -1
  356. package/build-module/columns/utils.js +2 -2
  357. package/build-module/columns/utils.js.map +1 -1
  358. package/build-module/comment-author-avatar/index.js +1 -0
  359. package/build-module/comment-author-avatar/index.js.map +1 -1
  360. package/build-module/comment-author-name/edit.js +4 -2
  361. package/build-module/comment-author-name/edit.js.map +1 -1
  362. package/build-module/comment-date/edit.js +1 -1
  363. package/build-module/comment-date/edit.js.map +1 -1
  364. package/build-module/comments-title/deprecated.js +102 -0
  365. package/build-module/comments-title/deprecated.js.map +1 -0
  366. package/build-module/comments-title/edit.js +38 -40
  367. package/build-module/comments-title/edit.js.map +1 -1
  368. package/build-module/comments-title/index.js +4 -8
  369. package/build-module/comments-title/index.js.map +1 -1
  370. package/build-module/cover/controls.native.js +2 -3
  371. package/build-module/cover/controls.native.js.map +1 -1
  372. package/build-module/cover/deprecated.js +206 -198
  373. package/build-module/cover/deprecated.js.map +1 -1
  374. package/build-module/cover/edit/block-controls.js +99 -0
  375. package/build-module/cover/edit/block-controls.js.map +1 -0
  376. package/build-module/cover/edit/cover-placeholder.js +38 -0
  377. package/build-module/cover/edit/cover-placeholder.js.map +1 -0
  378. package/build-module/cover/edit/index.js +310 -0
  379. package/build-module/cover/edit/index.js.map +1 -0
  380. package/build-module/cover/edit/inspector-controls.js +240 -0
  381. package/build-module/cover/edit/inspector-controls.js.map +1 -0
  382. package/build-module/cover/edit/resizable-cover.js +55 -0
  383. package/build-module/cover/edit/resizable-cover.js.map +1 -0
  384. package/build-module/cover/{use-cover-is-dark.js → edit/use-cover-is-dark.js} +0 -0
  385. package/build-module/cover/edit/use-cover-is-dark.js.map +1 -0
  386. package/build-module/cover/edit.native.js +0 -1
  387. package/build-module/cover/edit.native.js.map +1 -1
  388. package/build-module/cover/focal-point-settings-button.native.js.map +1 -1
  389. package/build-module/cover/save.js +19 -6
  390. package/build-module/cover/save.js.map +1 -1
  391. package/build-module/cover/shared.js +11 -5
  392. package/build-module/cover/shared.js.map +1 -1
  393. package/build-module/cover/transforms.js.map +1 -1
  394. package/build-module/embed/deprecated.js +6 -1
  395. package/build-module/embed/deprecated.js.map +1 -1
  396. package/build-module/embed/edit.js.map +1 -1
  397. package/build-module/embed/edit.native.js.map +1 -1
  398. package/build-module/embed/embed-controls.native.js.map +1 -1
  399. package/build-module/embed/embed-preview.js +2 -2
  400. package/build-module/embed/embed-preview.js.map +1 -1
  401. package/build-module/embed/index.js +6 -1
  402. package/build-module/embed/index.js.map +1 -1
  403. package/build-module/embed/transforms.js +6 -1
  404. package/build-module/embed/transforms.js.map +1 -1
  405. package/build-module/embed/util.js +6 -1
  406. package/build-module/embed/util.js.map +1 -1
  407. package/build-module/file/edit.js +2 -2
  408. package/build-module/file/edit.js.map +1 -1
  409. package/build-module/file/edit.native.js +0 -1
  410. package/build-module/file/edit.native.js.map +1 -1
  411. package/build-module/file/index.js.map +1 -1
  412. package/build-module/file/save.js +7 -2
  413. package/build-module/file/save.js.map +1 -1
  414. package/build-module/gallery/edit.js +4 -3
  415. package/build-module/gallery/edit.js.map +1 -1
  416. package/build-module/gallery/gallery.js +2 -2
  417. package/build-module/gallery/gallery.js.map +1 -1
  418. package/build-module/gallery/gallery.native.js.map +1 -1
  419. package/build-module/gallery/gap-styles.js +14 -4
  420. package/build-module/gallery/gap-styles.js.map +1 -1
  421. package/build-module/gallery/index.js +1 -1
  422. package/build-module/gallery/index.js.map +1 -1
  423. package/build-module/gallery/shared.js +27 -10
  424. package/build-module/gallery/shared.js.map +1 -1
  425. package/build-module/gallery/use-get-media.js +2 -1
  426. package/build-module/gallery/use-get-media.js.map +1 -1
  427. package/build-module/gallery/use-short-code-transform.js +19 -18
  428. package/build-module/gallery/use-short-code-transform.js.map +1 -1
  429. package/build-module/gallery/v1/edit.js.map +1 -1
  430. package/build-module/gallery/v1/gallery-image.js.map +1 -1
  431. package/build-module/gallery/v1/gallery-image.native.js.map +1 -1
  432. package/build-module/gallery/v1/gallery.js +2 -2
  433. package/build-module/gallery/v1/gallery.js.map +1 -1
  434. package/build-module/heading/autogenerate-anchors.js +5 -2
  435. package/build-module/heading/autogenerate-anchors.js.map +1 -1
  436. package/build-module/heading/deprecated.js.map +1 -1
  437. package/build-module/heading/edit.js +6 -2
  438. package/build-module/heading/edit.js.map +1 -1
  439. package/build-module/heading/index.js +1 -0
  440. package/build-module/heading/index.js.map +1 -1
  441. package/build-module/heading/transforms.js +1 -0
  442. package/build-module/heading/transforms.js.map +1 -1
  443. package/build-module/image/deprecated.js.map +1 -1
  444. package/build-module/image/edit.js +4 -52
  445. package/build-module/image/edit.js.map +1 -1
  446. package/build-module/image/edit.native.js +57 -6
  447. package/build-module/image/edit.native.js.map +1 -1
  448. package/build-module/image/image.js +6 -16
  449. package/build-module/image/image.js.map +1 -1
  450. package/build-module/image/index.js +5 -0
  451. package/build-module/image/index.js.map +1 -1
  452. package/build-module/image/transforms.js.map +1 -1
  453. package/build-module/image/utils.js +2 -2
  454. package/build-module/image/utils.js.map +1 -1
  455. package/build-module/index.js +42 -10
  456. package/build-module/index.js.map +1 -1
  457. package/build-module/is-block-metadata-experimental.js +16 -0
  458. package/build-module/is-block-metadata-experimental.js.map +1 -0
  459. package/build-module/latest-comments/edit.js.map +1 -1
  460. package/build-module/latest-posts/edit.js +31 -7
  461. package/build-module/latest-posts/edit.js.map +1 -1
  462. package/build-module/latest-posts/edit.native.js.map +1 -1
  463. package/build-module/list/index.js.map +1 -1
  464. package/build-module/list/transforms.js +6 -0
  465. package/build-module/list/transforms.js.map +1 -1
  466. package/build-module/list/v2/edit.js +2 -1
  467. package/build-module/list/v2/edit.js.map +1 -1
  468. package/build-module/list/v2/migrate.js +1 -3
  469. package/build-module/list/v2/migrate.js.map +1 -1
  470. package/build-module/list/v2/transforms.js +46 -9
  471. package/build-module/list/v2/transforms.js.map +1 -1
  472. package/build-module/list-item/edit.js +8 -9
  473. package/build-module/list-item/edit.js.map +1 -1
  474. package/build-module/list-item/hooks/index.js +3 -0
  475. package/build-module/list-item/hooks/index.js.map +1 -1
  476. package/build-module/list-item/hooks/use-backspace.js +44 -0
  477. package/build-module/list-item/hooks/use-backspace.js.map +1 -0
  478. package/build-module/list-item/hooks/use-enter.js +6 -9
  479. package/build-module/list-item/hooks/use-enter.js.map +1 -1
  480. package/build-module/list-item/hooks/use-indent-list-item.js +33 -38
  481. package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
  482. package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
  483. package/build-module/list-item/hooks/use-space.js +40 -0
  484. package/build-module/list-item/hooks/use-space.js.map +1 -0
  485. package/build-module/list-item/hooks/use-split.js +33 -0
  486. package/build-module/list-item/hooks/use-split.js.map +1 -0
  487. package/build-module/list-item/index.js +1 -0
  488. package/build-module/list-item/index.js.map +1 -1
  489. package/build-module/list-item/utils.js +1 -1
  490. package/build-module/list-item/utils.js.map +1 -1
  491. package/build-module/media-text/deprecated.js +3 -1
  492. package/build-module/media-text/deprecated.js.map +1 -1
  493. package/build-module/media-text/edit.native.js +2 -1
  494. package/build-module/media-text/edit.native.js.map +1 -1
  495. package/build-module/media-text/media-container.js +3 -1
  496. package/build-module/media-text/media-container.js.map +1 -1
  497. package/build-module/media-text/media-container.native.js +2 -4
  498. package/build-module/media-text/media-container.native.js.map +1 -1
  499. package/build-module/media-text/save.js +4 -1
  500. package/build-module/media-text/save.js.map +1 -1
  501. package/build-module/media-text/transforms.js +137 -8
  502. package/build-module/media-text/transforms.js.map +1 -1
  503. package/build-module/missing/edit.native.js.map +1 -1
  504. package/build-module/navigation/deprecated.js.map +1 -1
  505. package/build-module/navigation/edit/index.js +87 -82
  506. package/build-module/navigation/edit/index.js.map +1 -1
  507. package/build-module/navigation/edit/inner-blocks.js +2 -6
  508. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  509. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  510. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  511. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  512. package/build-module/navigation/use-navigation-entities.js +1 -1
  513. package/build-module/navigation/use-navigation-entities.js.map +1 -1
  514. package/build-module/navigation/use-navigation-menu.js +130 -38
  515. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  516. package/build-module/navigation/use-template-part-area-label.js +4 -1
  517. package/build-module/navigation/use-template-part-area-label.js.map +1 -1
  518. package/build-module/navigation-link/edit.js +44 -13
  519. package/build-module/navigation-link/edit.js.map +1 -1
  520. package/build-module/navigation-link/fallback-variations.js +1 -1
  521. package/build-module/navigation-link/fallback-variations.js.map +1 -1
  522. package/build-module/navigation-link/hooks.js +2 -2
  523. package/build-module/navigation-link/hooks.js.map +1 -1
  524. package/build-module/navigation-submenu/edit.js.map +1 -1
  525. package/build-module/page-list/convert-to-links-modal.js +1 -1
  526. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  527. package/build-module/page-list/edit.js +1 -1
  528. package/build-module/page-list/edit.js.map +1 -1
  529. package/build-module/paragraph/deprecated.js +2 -2
  530. package/build-module/paragraph/deprecated.js.map +1 -1
  531. package/build-module/pattern/edit.js.map +1 -1
  532. package/build-module/post-author/edit.js +1 -1
  533. package/build-module/post-author/edit.js.map +1 -1
  534. package/build-module/post-author-name/index.js +3 -0
  535. package/build-module/post-author-name/index.js.map +1 -1
  536. package/build-module/post-author-name/transforms.js +32 -0
  537. package/build-module/post-author-name/transforms.js.map +1 -0
  538. package/build-module/post-comment/index.js +1 -0
  539. package/build-module/post-comment/index.js.map +1 -1
  540. package/build-module/post-comments/edit.js +35 -16
  541. package/build-module/post-comments/edit.js.map +1 -1
  542. package/build-module/post-comments-count/index.js +1 -0
  543. package/build-module/post-comments-count/index.js.map +1 -1
  544. package/build-module/post-comments-form/form.js +8 -2
  545. package/build-module/post-comments-form/form.js.map +1 -1
  546. package/build-module/post-comments-link/index.js +1 -0
  547. package/build-module/post-comments-link/index.js.map +1 -1
  548. package/build-module/post-content/edit.js.map +1 -1
  549. package/build-module/post-date/edit.js +15 -9
  550. package/build-module/post-date/edit.js.map +1 -1
  551. package/build-module/post-featured-image/edit.js +11 -24
  552. package/build-module/post-featured-image/edit.js.map +1 -1
  553. package/build-module/post-navigation-link/index.js +4 -0
  554. package/build-module/post-navigation-link/index.js.map +1 -1
  555. package/build-module/post-template/edit.js +7 -2
  556. package/build-module/post-template/edit.js.map +1 -1
  557. package/build-module/post-terms/edit.js +10 -3
  558. package/build-module/post-terms/edit.js.map +1 -1
  559. package/build-module/post-terms/hooks.js +25 -0
  560. package/build-module/post-terms/hooks.js.map +1 -0
  561. package/build-module/post-terms/index.js +10 -8
  562. package/build-module/post-terms/index.js.map +1 -1
  563. package/build-module/post-title/index.js +1 -1
  564. package/build-module/post-title/index.js.map +1 -1
  565. package/build-module/pullquote/deprecated.js.map +1 -1
  566. package/build-module/pullquote/edit.js +2 -2
  567. package/build-module/pullquote/edit.js.map +1 -1
  568. package/build-module/pullquote/edit.native.js +2 -2
  569. package/build-module/pullquote/edit.native.js.map +1 -1
  570. package/build-module/query/edit/index.js +5 -1
  571. package/build-module/query/edit/index.js.map +1 -1
  572. package/build-module/query/edit/inspector-controls/index.js +24 -17
  573. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  574. package/build-module/query/edit/inspector-controls/parent-control.js +135 -0
  575. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -0
  576. package/build-module/query/edit/inspector-controls/sticky-control.js +31 -0
  577. package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -0
  578. package/build-module/query/edit/query-toolbar.js +14 -2
  579. package/build-module/query/edit/query-toolbar.js.map +1 -1
  580. package/build-module/query/index.js +2 -1
  581. package/build-module/query/index.js.map +1 -1
  582. package/build-module/query/utils.js +21 -0
  583. package/build-module/query/utils.js.map +1 -1
  584. package/build-module/query-title/index.js +1 -1
  585. package/build-module/query-title/index.js.map +1 -1
  586. package/build-module/query-title/variations.js +2 -2
  587. package/build-module/query-title/variations.js.map +1 -1
  588. package/build-module/quote/edit.js +4 -3
  589. package/build-module/quote/edit.js.map +1 -1
  590. package/build-module/quote/v2/edit.js +2 -2
  591. package/build-module/quote/v2/edit.js.map +1 -1
  592. package/build-module/search/edit.js +3 -2
  593. package/build-module/search/edit.js.map +1 -1
  594. package/build-module/search/edit.native.js.map +1 -1
  595. package/build-module/search/index.js +4 -0
  596. package/build-module/search/index.js.map +1 -1
  597. package/build-module/separator/use-deprecated-opacity.js.map +1 -1
  598. package/build-module/shortcode/edit.native.js +17 -13
  599. package/build-module/shortcode/edit.native.js.map +1 -1
  600. package/build-module/site-logo/edit.js +4 -12
  601. package/build-module/site-logo/edit.js.map +1 -1
  602. package/build-module/social-links/deprecated.js.map +1 -1
  603. package/build-module/social-links/edit.js +2 -2
  604. package/build-module/social-links/edit.js.map +1 -1
  605. package/build-module/social-links/edit.native.js.map +1 -1
  606. package/build-module/spacer/controls.js.map +1 -1
  607. package/build-module/table/deprecated.js.map +1 -1
  608. package/build-module/table/edit.js +17 -4
  609. package/build-module/table/edit.js.map +1 -1
  610. package/build-module/table/index.js +6 -1
  611. package/build-module/table/index.js.map +1 -1
  612. package/build-module/table/state.js.map +1 -1
  613. package/build-module/table-of-contents/edit.js +144 -68
  614. package/build-module/table-of-contents/edit.js.map +1 -1
  615. package/build-module/table-of-contents/index.js +12 -3
  616. package/build-module/table-of-contents/index.js.map +1 -1
  617. package/build-module/table-of-contents/list.js +18 -10
  618. package/build-module/table-of-contents/list.js.map +1 -1
  619. package/build-module/table-of-contents/save.js +28 -0
  620. package/build-module/table-of-contents/save.js.map +1 -0
  621. package/build-module/table-of-contents/utils.js +11 -73
  622. package/build-module/table-of-contents/utils.js.map +1 -1
  623. package/build-module/tag-cloud/edit.js.map +1 -1
  624. package/build-module/template-part/edit/advanced-controls.js +4 -1
  625. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  626. package/build-module/template-part/edit/index.js +8 -4
  627. package/build-module/template-part/edit/index.js.map +1 -1
  628. package/build-module/template-part/edit/inner-blocks.js +4 -9
  629. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  630. package/build-module/template-part/edit/utils/hooks.js +4 -1
  631. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  632. package/build-module/transformationCategories.native.js.map +1 -1
  633. package/build-module/video/edit-common-settings.js.map +1 -1
  634. package/build-module/video/edit.js +2 -2
  635. package/build-module/video/edit.js.map +1 -1
  636. package/build-module/video/edit.native.js +42 -1
  637. package/build-module/video/edit.native.js.map +1 -1
  638. package/build-module/video/index.js +6 -1
  639. package/build-module/video/index.js.map +1 -1
  640. package/build-style/audio/style-rtl.css +0 -3
  641. package/build-style/audio/style.css +0 -3
  642. package/build-style/button/style-rtl.css +0 -5
  643. package/build-style/button/style.css +0 -5
  644. package/build-style/common-rtl.css +1 -3
  645. package/build-style/common.css +1 -3
  646. package/build-style/cover/editor-rtl.css +11 -0
  647. package/build-style/cover/editor.css +11 -0
  648. package/build-style/cover/style-rtl.css +33 -25
  649. package/build-style/cover/style.css +33 -25
  650. package/build-style/editor-rtl.css +15 -45
  651. package/build-style/editor.css +15 -45
  652. package/build-style/embed/style-rtl.css +0 -1
  653. package/build-style/embed/style.css +0 -1
  654. package/build-style/file/style-rtl.css +9 -7
  655. package/build-style/file/style.css +9 -7
  656. package/build-style/gallery/style-rtl.css +2 -4
  657. package/build-style/gallery/style.css +2 -4
  658. package/build-style/image/editor-rtl.css +1 -1
  659. package/build-style/image/editor.css +1 -1
  660. package/build-style/image/style-rtl.css +0 -3
  661. package/build-style/image/style.css +0 -3
  662. package/build-style/post-comments/style-rtl.css +22 -0
  663. package/build-style/post-comments/style.css +22 -0
  664. package/build-style/post-comments-form/style-rtl.css +1 -3
  665. package/build-style/post-comments-form/style.css +1 -3
  666. package/build-style/post-featured-image/editor-rtl.css +0 -27
  667. package/build-style/post-featured-image/editor.css +0 -27
  668. package/build-style/search/style-rtl.css +4 -4
  669. package/build-style/search/style.css +4 -4
  670. package/build-style/separator/editor-rtl.css +1 -0
  671. package/build-style/separator/editor.css +1 -0
  672. package/build-style/site-logo/editor-rtl.css +0 -12
  673. package/build-style/site-logo/editor.css +0 -12
  674. package/build-style/site-logo/style-rtl.css +4 -0
  675. package/build-style/site-logo/style.css +4 -0
  676. package/build-style/style-rtl.css +77 -64
  677. package/build-style/style.css +77 -64
  678. package/build-style/table/style-rtl.css +0 -1
  679. package/build-style/table/style.css +0 -1
  680. package/build-style/video/editor-rtl.css +2 -5
  681. package/build-style/video/editor.css +2 -5
  682. package/build-style/video/style-rtl.css +1 -5
  683. package/build-style/video/style.css +1 -5
  684. package/build-types/table-of-contents/list.d.ts +12 -0
  685. package/build-types/table-of-contents/list.d.ts.map +1 -0
  686. package/build-types/table-of-contents/utils.d.ts +24 -0
  687. package/build-types/table-of-contents/utils.d.ts.map +1 -0
  688. package/package.json +32 -30
  689. package/src/audio/block.json +6 -1
  690. package/src/audio/edit.js +4 -2
  691. package/src/audio/index.js +1 -2
  692. package/src/audio/style.scss +0 -2
  693. package/src/avatar/block.json +0 -1
  694. package/src/avatar/hooks.js +9 -6
  695. package/src/avatar/index.php +2 -2
  696. package/src/block/edit.js +43 -48
  697. package/src/block/edit.native.js +12 -16
  698. package/src/block/test/edit.native.js +6 -9
  699. package/src/button/block.json +25 -1
  700. package/src/button/deprecated.js +145 -36
  701. package/src/button/edit.js +7 -11
  702. package/src/button/edit.native.js +2 -3
  703. package/src/button/save.js +5 -11
  704. package/src/button/style.scss +0 -5
  705. package/src/buttons/deprecated.js +4 -6
  706. package/src/buttons/edit.js +3 -3
  707. package/src/buttons/edit.native.js +7 -11
  708. package/src/buttons/test/__snapshots__/edit.native.js.snap +1 -1
  709. package/src/buttons/test/edit.native.js +1 -1
  710. package/src/categories/block.json +1 -1
  711. package/src/categories/edit.js +1 -1
  712. package/src/column/deprecated.js +2 -1
  713. package/src/column/edit.js +2 -3
  714. package/src/column/edit.native.js +2 -2
  715. package/src/columns/block.json +3 -1
  716. package/src/columns/deprecated.js +4 -2
  717. package/src/columns/edit.js +6 -7
  718. package/src/columns/edit.native.js +12 -16
  719. package/src/columns/index.js +1 -2
  720. package/src/columns/utils.js +5 -3
  721. package/src/comment-author-avatar/block.json +1 -0
  722. package/src/comment-author-name/edit.js +2 -2
  723. package/src/comment-date/edit.js +1 -1
  724. package/src/comments-title/block.json +0 -6
  725. package/src/comments-title/deprecated.js +34 -0
  726. package/src/comments-title/edit.js +44 -100
  727. package/src/comments-title/index.js +3 -1
  728. package/src/comments-title/index.php +41 -23
  729. package/src/cover/controls.native.js +3 -6
  730. package/src/cover/deprecated.js +237 -195
  731. package/src/cover/edit/block-controls.js +110 -0
  732. package/src/cover/edit/cover-placeholder.js +39 -0
  733. package/src/cover/edit/index.js +396 -0
  734. package/src/cover/edit/inspector-controls.js +317 -0
  735. package/src/cover/edit/resizable-cover.js +55 -0
  736. package/src/cover/{use-cover-is-dark.js → edit/use-cover-is-dark.js} +0 -0
  737. package/src/cover/edit.native.js +8 -14
  738. package/src/cover/editor.scss +14 -1
  739. package/src/cover/focal-point-settings-button.native.js +1 -1
  740. package/src/cover/index.php +20 -37
  741. package/src/cover/save.js +28 -16
  742. package/src/cover/shared.js +5 -3
  743. package/src/cover/style.scss +27 -22
  744. package/src/cover/test/block-controls.js +62 -0
  745. package/src/cover/test/edit.native.js +4 -7
  746. package/src/cover/transforms.js +2 -7
  747. package/src/embed/block.json +6 -1
  748. package/src/embed/edit.js +38 -40
  749. package/src/embed/edit.native.js +46 -49
  750. package/src/embed/embed-controls.native.js +2 -3
  751. package/src/embed/embed-preview.js +4 -2
  752. package/src/embed/style.scss +0 -1
  753. package/src/embed/test/index.native.js +24 -50
  754. package/src/file/edit.js +7 -5
  755. package/src/file/edit.native.js +14 -26
  756. package/src/file/index.js +1 -2
  757. package/src/file/save.js +14 -2
  758. package/src/file/style.scss +15 -14
  759. package/src/gallery/block.json +1 -1
  760. package/src/gallery/edit.js +10 -7
  761. package/src/gallery/gallery.js +2 -2
  762. package/src/gallery/gallery.native.js +2 -4
  763. package/src/gallery/gap-styles.js +21 -6
  764. package/src/gallery/index.js +2 -4
  765. package/src/gallery/index.php +23 -12
  766. package/src/gallery/shared.js +25 -11
  767. package/src/gallery/test/index.native.js +18 -34
  768. package/src/gallery/use-get-media.js +2 -1
  769. package/src/gallery/use-short-code-transform.js +19 -16
  770. package/src/gallery/v1/edit.js +15 -20
  771. package/src/gallery/v1/gallery-image.js +6 -11
  772. package/src/gallery/v1/gallery-image.native.js +8 -17
  773. package/src/gallery/v1/gallery.js +2 -2
  774. package/src/heading/autogenerate-anchors.js +8 -5
  775. package/src/heading/block.json +1 -0
  776. package/src/heading/deprecated.js +6 -21
  777. package/src/heading/edit.js +7 -5
  778. package/src/image/block.json +5 -0
  779. package/src/image/deprecated.js +6 -29
  780. package/src/image/edit.js +0 -44
  781. package/src/image/edit.native.js +74 -25
  782. package/src/image/editor.scss +1 -1
  783. package/src/image/image.js +41 -51
  784. package/src/image/style.scss +0 -2
  785. package/src/image/styles.native.scss +11 -0
  786. package/src/image/test/edit.native.js +7 -7
  787. package/src/image/transforms.js +4 -3
  788. package/src/image/utils.js +2 -2
  789. package/src/index.js +51 -28
  790. package/src/is-block-metadata-experimental.js +19 -0
  791. package/src/latest-comments/edit.js +2 -6
  792. package/src/latest-posts/edit.js +33 -9
  793. package/src/latest-posts/edit.native.js +10 -15
  794. package/src/latest-posts/index.php +12 -6
  795. package/src/list/index.js +1 -2
  796. package/src/list/test/migrate.js +1 -2
  797. package/src/list/transforms.js +7 -0
  798. package/src/list/v2/edit.js +7 -9
  799. package/src/list/v2/migrate.js +1 -1
  800. package/src/list/v2/transforms.js +35 -0
  801. package/src/list-item/block.json +2 -1
  802. package/src/list-item/edit.js +17 -10
  803. package/src/list-item/hooks/index.js +3 -0
  804. package/src/list-item/hooks/use-backspace.js +51 -0
  805. package/src/list-item/hooks/use-enter.js +8 -16
  806. package/src/list-item/hooks/use-indent-list-item.js +49 -63
  807. package/src/list-item/hooks/use-outdent-list-item.js +2 -3
  808. package/src/list-item/hooks/use-space.js +47 -0
  809. package/src/list-item/hooks/use-split.js +33 -0
  810. package/src/list-item/utils.js +1 -1
  811. package/src/media-text/deprecated.js +6 -3
  812. package/src/media-text/edit.native.js +5 -6
  813. package/src/media-text/media-container.js +1 -1
  814. package/src/media-text/media-container.native.js +8 -13
  815. package/src/media-text/save.js +2 -1
  816. package/src/media-text/transforms.js +154 -0
  817. package/src/missing/edit.native.js +2 -3
  818. package/src/missing/test/edit-integration.native.js +2 -3
  819. package/src/missing/test/edit.native.js +6 -9
  820. package/src/navigation/deprecated.js +2 -5
  821. package/src/navigation/edit/index.js +195 -201
  822. package/src/navigation/edit/inner-blocks.js +1 -8
  823. package/src/navigation/edit/navigation-menu-delete-control.js +2 -3
  824. package/src/navigation/edit/unsaved-inner-blocks.js +31 -30
  825. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +2 -3
  826. package/src/navigation/index.php +40 -0
  827. package/src/navigation/test/use-navigation-menu.js +236 -0
  828. package/src/navigation/use-navigation-entities.js +12 -14
  829. package/src/navigation/use-navigation-menu.js +152 -82
  830. package/src/navigation/use-template-part-area-label.js +8 -7
  831. package/src/navigation-link/edit.js +59 -25
  832. package/src/navigation-link/fallback-variations.js +1 -1
  833. package/src/navigation-link/hooks.js +2 -2
  834. package/src/navigation-link/test/__snapshots__/hooks.js.snap +4 -4
  835. package/src/navigation-link/test/edit.js +2 -24
  836. package/src/navigation-submenu/edit.js +10 -20
  837. package/src/page-list/convert-to-links-modal.js +52 -55
  838. package/src/page-list/edit.js +7 -10
  839. package/src/page-list/test/convert-to-links-modal.js +6 -12
  840. package/src/paragraph/deprecated.js +2 -2
  841. package/src/pattern/edit.js +2 -4
  842. package/src/post-author/edit.js +26 -25
  843. package/src/post-author/index.php +3 -2
  844. package/src/post-author-name/block.json +1 -0
  845. package/src/post-author-name/index.js +2 -0
  846. package/src/post-author-name/index.php +1 -1
  847. package/src/post-author-name/transforms.js +25 -0
  848. package/src/post-comment/block.json +1 -0
  849. package/src/post-comments/edit.js +54 -22
  850. package/src/post-comments/index.php +1 -1
  851. package/src/post-comments/style.scss +26 -0
  852. package/src/post-comments-count/block.json +1 -0
  853. package/src/post-comments-form/form.js +12 -5
  854. package/src/post-comments-form/index.php +1 -1
  855. package/src/post-comments-form/style.scss +1 -4
  856. package/src/post-comments-link/block.json +1 -0
  857. package/src/post-content/edit.js +2 -3
  858. package/src/post-date/edit.js +4 -3
  859. package/src/post-featured-image/edit.js +15 -31
  860. package/src/post-featured-image/editor.scss +0 -29
  861. package/src/post-navigation-link/block.json +4 -0
  862. package/src/post-template/edit.js +5 -0
  863. package/src/post-template/index.php +30 -0
  864. package/src/post-terms/edit.js +19 -0
  865. package/src/post-terms/hooks.js +27 -0
  866. package/src/post-terms/index.js +14 -7
  867. package/src/post-terms/index.php +40 -2
  868. package/src/post-title/index.js +1 -1
  869. package/src/pullquote/deprecated.js +2 -1
  870. package/src/pullquote/edit.js +2 -2
  871. package/src/pullquote/edit.native.js +2 -2
  872. package/src/query/block.json +2 -1
  873. package/src/query/edit/index.js +10 -10
  874. package/src/query/edit/inspector-controls/index.js +25 -11
  875. package/src/query/edit/inspector-controls/parent-control.js +132 -0
  876. package/src/query/edit/inspector-controls/sticky-control.js +25 -0
  877. package/src/query/edit/query-toolbar.js +25 -5
  878. package/src/query/utils.js +22 -0
  879. package/src/query-pagination/index.php +0 -1
  880. package/src/query-title/index.js +1 -1
  881. package/src/query-title/variations.js +2 -2
  882. package/src/quote/edit.js +5 -2
  883. package/src/quote/v2/edit.js +8 -8
  884. package/src/quote/v2/test/migrate.js +1 -2
  885. package/src/search/block.json +4 -0
  886. package/src/search/edit.js +10 -13
  887. package/src/search/edit.native.js +4 -6
  888. package/src/search/index.php +29 -16
  889. package/src/search/style.scss +2 -1
  890. package/src/separator/editor.scss +1 -0
  891. package/src/separator/use-deprecated-opacity.js +2 -4
  892. package/src/shortcode/edit.native.js +30 -15
  893. package/src/shortcode/style.native.scss +11 -4
  894. package/src/shortcode/test/__snapshots__/edit.native.js.snap +9 -0
  895. package/src/shortcode/test/edit.native.js +55 -40
  896. package/src/site-logo/edit.js +4 -18
  897. package/src/site-logo/editor.scss +0 -14
  898. package/src/site-logo/style.scss +6 -0
  899. package/src/social-links/deprecated.js +4 -2
  900. package/src/social-links/edit.js +11 -10
  901. package/src/social-links/edit.native.js +3 -5
  902. package/src/spacer/controls.js +2 -3
  903. package/src/spacer/test/index.native.js +10 -21
  904. package/src/table/block.json +6 -1
  905. package/src/table/deprecated.js +4 -8
  906. package/src/table/edit.js +19 -4
  907. package/src/table/state.js +2 -4
  908. package/src/table/style.scss +0 -1
  909. package/src/table-of-contents/block.json +9 -2
  910. package/src/table-of-contents/edit.js +166 -77
  911. package/src/table-of-contents/index.js +2 -0
  912. package/src/table-of-contents/list.tsx +46 -0
  913. package/src/table-of-contents/save.js +25 -0
  914. package/src/table-of-contents/utils.ts +71 -0
  915. package/src/tag-cloud/block.json +1 -1
  916. package/src/tag-cloud/edit.js +4 -7
  917. package/src/template-part/edit/advanced-controls.js +4 -4
  918. package/src/template-part/edit/index.js +31 -25
  919. package/src/template-part/edit/inner-blocks.js +2 -10
  920. package/src/template-part/edit/utils/hooks.js +8 -7
  921. package/src/transformationCategories.native.js +3 -3
  922. package/src/video/block.json +6 -1
  923. package/src/video/edit-common-settings.js +2 -8
  924. package/src/video/edit.js +4 -2
  925. package/src/video/edit.native.js +38 -16
  926. package/src/video/editor.scss +3 -6
  927. package/src/video/index.js +1 -2
  928. package/src/video/style.scss +0 -2
  929. package/test/babel-plugin.js +67 -0
  930. package/tsconfig.json +11 -0
  931. package/tsconfig.tsbuildinfo +1 -0
  932. package/build/cover/edit.js +0 -598
  933. package/build/cover/edit.js.map +0 -1
  934. package/build/cover/use-cover-is-dark.js.map +0 -1
  935. package/build/post-terms/variations.js +0 -37
  936. package/build/post-terms/variations.js.map +0 -1
  937. package/build-module/cover/edit.js +0 -575
  938. package/build-module/cover/edit.js.map +0 -1
  939. package/build-module/cover/use-cover-is-dark.js.map +0 -1
  940. package/build-module/post-terms/variations.js +0 -27
  941. package/build-module/post-terms/variations.js.map +0 -1
  942. package/src/cover/edit.js +0 -757
  943. package/src/post-terms/variations.js +0 -28
  944. package/src/table-of-contents/index.php +0 -346
  945. package/src/table-of-contents/list.js +0 -28
  946. package/src/table-of-contents/utils.js +0 -126
@@ -15,19 +15,15 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
15
15
  /**
16
16
  * Internal dependencies
17
17
  */
18
- import useIndentListItem from './use-indent-list-item';
18
+ import useOutdentListItem from './use-outdent-list-item';
19
19
 
20
20
  export default function useEnter( props ) {
21
21
  const { replaceBlocks } = useDispatch( blockEditorStore );
22
- const {
23
- getBlock,
24
- getBlockRootClientId,
25
- getBlockParents,
26
- getBlockIndex,
27
- } = useSelect( blockEditorStore );
22
+ const { getBlock, getBlockRootClientId, getBlockIndex } =
23
+ useSelect( blockEditorStore );
28
24
  const propsRef = useRef( props );
29
25
  propsRef.current = props;
30
- const [ canIndent, indentListItem ] = useIndentListItem(
26
+ const [ canOutdent, outdentListItem ] = useOutdentListItem(
31
27
  propsRef.current.clientId
32
28
  );
33
29
  return useRefEffect(
@@ -41,17 +37,13 @@ export default function useEnter( props ) {
41
37
  return;
42
38
  }
43
39
  event.preventDefault();
44
- if ( canIndent ) {
45
- indentListItem();
40
+ if ( canOutdent ) {
41
+ outdentListItem();
46
42
  return;
47
43
  }
48
44
  // Here we are in top level list so we need to split.
49
45
  const blockRootClientId = getBlockRootClientId( clientId );
50
- const blockParents = getBlockParents( clientId );
51
- const topParentListBlockClientId = blockParents[ 0 ];
52
- const topParentListBlock = getBlock(
53
- topParentListBlockClientId
54
- );
46
+ const topParentListBlock = getBlock( blockRootClientId );
55
47
  const blockIndex = getBlockIndex( clientId );
56
48
  const head = cloneBlock( {
57
49
  ...topParentListBlock,
@@ -89,6 +81,6 @@ export default function useEnter( props ) {
89
81
  element.removeEventListener( 'keydown', onKeyDown );
90
82
  };
91
83
  },
92
- [ canIndent ]
84
+ [ canOutdent ]
93
85
  );
94
86
  }
@@ -1,89 +1,75 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { first } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
9
4
  import { useCallback } from '@wordpress/element';
10
5
  import { useSelect, useDispatch } from '@wordpress/data';
11
6
  import { store as blockEditorStore } from '@wordpress/block-editor';
12
-
13
- /**
14
- * Internal dependencies
15
- */
16
- import { createListItem } from '../utils';
7
+ import { createBlock, cloneBlock } from '@wordpress/blocks';
17
8
 
18
9
  export default function useIndentListItem( clientId ) {
19
- const { canIndent } = useSelect(
20
- ( innerSelect ) => {
21
- const { getBlockIndex } = innerSelect( blockEditorStore );
22
- return {
23
- canIndent: getBlockIndex( clientId ) > 0,
24
- };
25
- },
10
+ const canIndent = useSelect(
11
+ ( select ) => select( blockEditorStore ).getBlockIndex( clientId ) > 0,
26
12
  [ clientId ]
27
13
  );
28
- const { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );
14
+ const { replaceBlocks, selectionChange, multiSelect } =
15
+ useDispatch( blockEditorStore );
29
16
  const {
30
- getBlockRootClientId,
31
17
  getBlock,
32
- getBlockOrder,
18
+ getPreviousBlockClientId,
33
19
  getSelectionStart,
34
20
  getSelectionEnd,
35
- getBlockIndex,
21
+ hasMultiSelection,
22
+ getMultiSelectedBlockClientIds,
36
23
  } = useSelect( blockEditorStore );
37
-
38
24
  return [
39
25
  canIndent,
40
26
  useCallback( () => {
27
+ const _hasMultiSelection = hasMultiSelection();
28
+ const clientIds = _hasMultiSelection
29
+ ? getMultiSelectedBlockClientIds()
30
+ : [ clientId ];
31
+ const clonedBlocks = clientIds.map( ( _clientId ) =>
32
+ cloneBlock( getBlock( _clientId ) )
33
+ );
34
+ const previousSiblingId = getPreviousBlockClientId( clientId );
35
+ const newListItem = cloneBlock( getBlock( previousSiblingId ) );
36
+ // If the sibling has no innerBlocks, create a new `list` block.
37
+ if ( ! newListItem.innerBlocks?.length ) {
38
+ newListItem.innerBlocks = [ createBlock( 'core/list' ) ];
39
+ }
40
+ // A list item usually has one `list`, but it's possible to have
41
+ // more. So we need to preserve the previous `list` blocks and
42
+ // merge the new blocks to the last `list`.
43
+ newListItem.innerBlocks[
44
+ newListItem.innerBlocks.length - 1
45
+ ].innerBlocks.push( ...clonedBlocks );
46
+
47
+ // We get the selection start/end here, because when
48
+ // we replace blocks, the selection is updated too.
41
49
  const selectionStart = getSelectionStart();
42
50
  const selectionEnd = getSelectionEnd();
43
-
44
- const parentId = getBlockRootClientId( clientId );
45
- const previousSiblingId = getBlockOrder( parentId )[
46
- getBlockIndex( clientId ) - 1
47
- ];
48
- const previousSibling = getBlock( previousSiblingId );
49
- const previousSiblingChildren =
50
- first( previousSibling.innerBlocks )?.innerBlocks || [];
51
- const previousSiblingListAttributes =
52
- first( previousSibling.innerBlocks )?.attributes || {};
53
- const block = getBlock( clientId );
54
-
55
- const childListAttributes = first( block.innerBlocks )?.attributes;
56
- const childItemBlocks =
57
- first( block.innerBlocks )?.innerBlocks || [];
58
-
59
- const newBlock = createListItem(
60
- block.attributes,
61
- childListAttributes,
62
- childItemBlocks
63
- );
64
- // Replace the previous sibling of the block being indented and the indented block,
51
+ // Replace the previous sibling of the block being indented and the indented blocks,
65
52
  // with a new block whose attributes are equal to the ones of the previous sibling and
66
- // whose descendants are the children of the previous sibling, followed by the indented block.
53
+ // whose descendants are the children of the previous sibling, followed by the indented blocks.
67
54
  replaceBlocks(
68
- [ previousSiblingId, clientId ],
69
- [
70
- createListItem(
71
- previousSibling.attributes,
72
- previousSiblingListAttributes,
73
- [ ...previousSiblingChildren, newBlock ]
74
- ),
75
- ]
76
- );
77
-
78
- // Restore the selection state.
79
- selectionChange(
80
- newBlock.clientId,
81
- selectionEnd.attributeKey,
82
- selectionEnd.clientId === selectionStart.clientId
83
- ? selectionStart.offset
84
- : selectionEnd.offset,
85
- selectionEnd.offset
55
+ [ previousSiblingId, ...clientIds ],
56
+ [ newListItem ]
86
57
  );
58
+ if ( ! _hasMultiSelection ) {
59
+ selectionChange(
60
+ clonedBlocks[ 0 ].clientId,
61
+ selectionEnd.attributeKey,
62
+ selectionEnd.clientId === selectionStart.clientId
63
+ ? selectionStart.offset
64
+ : selectionEnd.offset,
65
+ selectionEnd.offset
66
+ );
67
+ } else {
68
+ multiSelect(
69
+ clonedBlocks[ 0 ].clientId,
70
+ clonedBlocks[ clonedBlocks.length - 1 ].clientId
71
+ );
72
+ }
87
73
  }, [ clientId ] ),
88
74
  ];
89
75
  }
@@ -42,9 +42,8 @@ export default function useOutdentListItem( clientId ) {
42
42
  const listParentId = getBlockRootClientId( clientId );
43
43
  const listAttributes = getBlockAttributes( listParentId );
44
44
  const listItemParentId = getBlockRootClientId( listParentId );
45
- const listItemParentAttributes = getBlockAttributes(
46
- listItemParentId
47
- );
45
+ const listItemParentAttributes =
46
+ getBlockAttributes( listItemParentId );
48
47
 
49
48
  const index = getBlockIndex( clientId );
50
49
  const siblingBlocks = getBlock( listParentId ).innerBlocks;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useRefEffect } from '@wordpress/compose';
5
+ import { SPACE } from '@wordpress/keycodes';
6
+ import { store as blockEditorStore } from '@wordpress/block-editor';
7
+ import { useSelect } from '@wordpress/data';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import useIndentListItem from './use-indent-list-item';
13
+
14
+ export default function useSpace( clientId ) {
15
+ const { getSelectionStart, getSelectionEnd } =
16
+ useSelect( blockEditorStore );
17
+ const [ canIndent, indentListItem ] = useIndentListItem( clientId );
18
+
19
+ return useRefEffect(
20
+ ( element ) => {
21
+ function onKeyDown( event ) {
22
+ if (
23
+ event.defaultPrevented ||
24
+ event.keyCode !== SPACE ||
25
+ ! canIndent
26
+ ) {
27
+ return;
28
+ }
29
+ const selectionStart = getSelectionStart();
30
+ const selectionEnd = getSelectionEnd();
31
+ if (
32
+ selectionStart.offset === 0 &&
33
+ selectionEnd.offset === 0
34
+ ) {
35
+ event.preventDefault();
36
+ indentListItem();
37
+ }
38
+ }
39
+
40
+ element.addEventListener( 'keydown', onKeyDown );
41
+ return () => {
42
+ element.removeEventListener( 'keydown', onKeyDown );
43
+ };
44
+ },
45
+ [ canIndent, indentListItem ]
46
+ );
47
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useCallback, useRef } from '@wordpress/element';
5
+ import { useSelect } from '@wordpress/data';
6
+ import { store as blockEditorStore } from '@wordpress/block-editor';
7
+ import { cloneBlock, createBlock } from '@wordpress/blocks';
8
+
9
+ export default function useSplit( clientId ) {
10
+ // We can not rely on the isAfterOriginal parameter of the callback,
11
+ // because if the value after the split is empty isAfterOriginal is false
12
+ // while the value is in fact after the original. So to avoid that issue we use
13
+ // a flag where the first execution of the callback is false (it is the before value)
14
+ // and the second execution is true, it is the after value.
15
+ const isAfter = useRef( false );
16
+ const { getBlock } = useSelect( blockEditorStore );
17
+ return useCallback(
18
+ ( value ) => {
19
+ const block = getBlock( clientId );
20
+ if ( isAfter.current ) {
21
+ return cloneBlock( block, {
22
+ content: value,
23
+ } );
24
+ }
25
+ isAfter.current = true;
26
+ return createBlock( block.name, {
27
+ ...block.attributes,
28
+ content: value,
29
+ } );
30
+ },
31
+ [ clientId, getBlock ]
32
+ );
33
+ }
@@ -7,7 +7,7 @@ export function createListItem( listItemAttributes, listAttributes, children ) {
7
7
  return createBlock(
8
8
  'core/list-item',
9
9
  listItemAttributes,
10
- ! children || ! children.length
10
+ ! children?.length
11
11
  ? []
12
12
  : [ createBlock( 'core/list', listAttributes, children ) ]
13
13
  );
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { noop, isEmpty, omit } from 'lodash';
5
+ import { isEmpty, omit } from 'lodash';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -15,6 +15,7 @@ import { InnerBlocks, getColorClassName } from '@wordpress/block-editor';
15
15
  import { imageFillStyles } from './media-container';
16
16
 
17
17
  const DEFAULT_MEDIA_WIDTH = 50;
18
+ const noop = () => {};
18
19
 
19
20
  const migrateCustomColors = ( attributes ) => {
20
21
  if ( ! attributes.customBackgroundColor ) {
@@ -173,7 +174,8 @@ export default [
173
174
  'has-background': backgroundClass || customBackgroundColor,
174
175
  [ backgroundClass ]: backgroundClass,
175
176
  'is-stacked-on-mobile': isStackedOnMobile,
176
- [ `is-vertically-aligned-${ verticalAlignment }` ]: verticalAlignment,
177
+ [ `is-vertically-aligned-${ verticalAlignment }` ]:
178
+ verticalAlignment,
177
179
  'is-image-fill': imageFill,
178
180
  } );
179
181
  const backgroundStyles = imageFill
@@ -268,7 +270,8 @@ export default [
268
270
  'has-media-on-the-right': 'right' === mediaPosition,
269
271
  [ backgroundClass ]: backgroundClass,
270
272
  'is-stacked-on-mobile': isStackedOnMobile,
271
- [ `is-vertically-aligned-${ verticalAlignment }` ]: verticalAlignment,
273
+ [ `is-vertically-aligned-${ verticalAlignment }` ]:
274
+ verticalAlignment,
272
275
  'is-image-fill': imageFill,
273
276
  } );
274
277
  const backgroundStyles = imageFill
@@ -275,6 +275,8 @@ class MediaTextEdit extends Component {
275
275
  const widthString = `${ temporaryMediaWidth }%`;
276
276
  const innerBlockWidth = shouldStack ? 100 : 100 - temporaryMediaWidth;
277
277
  const innerBlockWidthString = `${ innerBlockWidth }%`;
278
+ const hasMedia =
279
+ mediaType === MEDIA_TYPE_IMAGE || mediaType === MEDIA_TYPE_VIDEO;
278
280
 
279
281
  const innerBlockContainerStyle = [
280
282
  { width: innerBlockWidthString },
@@ -344,7 +346,7 @@ class MediaTextEdit extends Component {
344
346
  <>
345
347
  { mediaType === MEDIA_TYPE_IMAGE && this.getControls() }
346
348
  <BlockControls>
347
- { ( isMediaSelected || mediaType === MEDIA_TYPE_VIDEO ) && (
349
+ { hasMedia && (
348
350
  <ToolbarGroup>
349
351
  <Button
350
352
  label={ __( 'Edit media' ) }
@@ -393,11 +395,8 @@ class MediaTextEdit extends Component {
393
395
  export default compose(
394
396
  withColors( 'backgroundColor' ),
395
397
  withSelect( ( select, { clientId } ) => {
396
- const {
397
- getSelectedBlockClientId,
398
- getBlockParents,
399
- getSettings,
400
- } = select( blockEditorStore );
398
+ const { getSelectedBlockClientId, getBlockParents, getSettings } =
399
+ select( blockEditorStore );
401
400
 
402
401
  const parents = getBlockParents( clientId, true );
403
402
 
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { noop } from 'lodash';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -30,6 +29,7 @@ import icon from './media-container-icon';
30
29
  * Constants
31
30
  */
32
31
  const ALLOWED_MEDIA_TYPES = [ 'image', 'video' ];
32
+ const noop = () => {};
33
33
 
34
34
  export function imageFillStyles( url, focalPoint ) {
35
35
  return url
@@ -50,16 +50,13 @@ class MediaContainer extends Component {
50
50
  constructor() {
51
51
  super( ...arguments );
52
52
  this.updateMediaProgress = this.updateMediaProgress.bind( this );
53
- this.finishMediaUploadWithSuccess = this.finishMediaUploadWithSuccess.bind(
54
- this
55
- );
56
- this.finishMediaUploadWithFailure = this.finishMediaUploadWithFailure.bind(
57
- this
58
- );
53
+ this.finishMediaUploadWithSuccess =
54
+ this.finishMediaUploadWithSuccess.bind( this );
55
+ this.finishMediaUploadWithFailure =
56
+ this.finishMediaUploadWithFailure.bind( this );
59
57
  this.mediaUploadStateReset = this.mediaUploadStateReset.bind( this );
60
- this.onSelectMediaUploadOption = this.onSelectMediaUploadOption.bind(
61
- this
62
- );
58
+ this.onSelectMediaUploadOption =
59
+ this.onSelectMediaUploadOption.bind( this );
63
60
  this.onMediaPressed = this.onMediaPressed.bind( this );
64
61
 
65
62
  this.state = {
@@ -191,7 +188,6 @@ class MediaContainer extends Component {
191
188
  <TouchableWithoutFeedback
192
189
  accessible={ ! isSelected }
193
190
  onPress={ this.onMediaPressed }
194
- onLongPress={ openMediaOptions }
195
191
  disabled={ ! isSelected }
196
192
  >
197
193
  <View
@@ -222,7 +218,7 @@ class MediaContainer extends Component {
222
218
  );
223
219
  }
224
220
 
225
- renderVideo( params, openMediaOptions ) {
221
+ renderVideo( params ) {
226
222
  const {
227
223
  aligmentStyles,
228
224
  mediaUrl,
@@ -251,7 +247,6 @@ class MediaContainer extends Component {
251
247
  <TouchableWithoutFeedback
252
248
  accessible={ ! isSelected }
253
249
  onPress={ this.onMediaPressed }
254
- onLongPress={ openMediaOptions }
255
250
  disabled={ ! isSelected }
256
251
  >
257
252
  <View style={ [ styles.videoContainer, aligmentStyles ] }>
@@ -305,7 +300,7 @@ class MediaContainer extends Component {
305
300
  mediaElement = this.renderImage( params, openMediaOptions );
306
301
  break;
307
302
  case MEDIA_TYPE_VIDEO:
308
- mediaElement = this.renderVideo( params, openMediaOptions );
303
+ mediaElement = this.renderVideo( params );
309
304
  break;
310
305
  }
311
306
  return mediaElement;
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { noop, isEmpty } from 'lodash';
5
+ import { isEmpty } from 'lodash';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -16,6 +16,7 @@ import { imageFillStyles } from './media-container';
16
16
  import { DEFAULT_MEDIA_SIZE_SLUG } from './constants';
17
17
 
18
18
  const DEFAULT_MEDIA_WIDTH = 50;
19
+ const noop = () => {};
19
20
 
20
21
  export default function save( { attributes } ) {
21
22
  const {
@@ -28,6 +28,61 @@ const transforms = {
28
28
  anchor,
29
29
  } ),
30
30
  },
31
+ {
32
+ type: 'block',
33
+ blocks: [ 'core/cover' ],
34
+ transform: (
35
+ {
36
+ align,
37
+ alt,
38
+ anchor,
39
+ backgroundType,
40
+ customGradient,
41
+ customOverlayColor,
42
+ gradient,
43
+ id,
44
+ overlayColor,
45
+ url,
46
+ },
47
+ innerBlocks
48
+ ) => {
49
+ let additionalAttributes = {};
50
+
51
+ if ( customGradient ) {
52
+ additionalAttributes = {
53
+ style: {
54
+ color: {
55
+ gradient: customGradient,
56
+ },
57
+ },
58
+ };
59
+ } else if ( customOverlayColor ) {
60
+ additionalAttributes = {
61
+ style: {
62
+ color: {
63
+ background: customOverlayColor,
64
+ },
65
+ },
66
+ };
67
+ }
68
+
69
+ return createBlock(
70
+ 'core/media-text',
71
+ {
72
+ align,
73
+ anchor,
74
+ backgroundColor: overlayColor,
75
+ gradient,
76
+ mediaAlt: alt,
77
+ mediaId: id,
78
+ mediaType: backgroundType,
79
+ mediaUrl: url,
80
+ ...additionalAttributes,
81
+ },
82
+ innerBlocks
83
+ );
84
+ },
85
+ },
31
86
  ],
32
87
  to: [
33
88
  {
@@ -59,6 +114,105 @@ const transforms = {
59
114
  } );
60
115
  },
61
116
  },
117
+ {
118
+ type: 'block',
119
+ blocks: [ 'core/cover' ],
120
+ transform: (
121
+ {
122
+ align,
123
+ anchor,
124
+ backgroundColor,
125
+ focalPoint,
126
+ gradient,
127
+ mediaAlt,
128
+ mediaId,
129
+ mediaType,
130
+ mediaUrl,
131
+ style,
132
+ textColor,
133
+ },
134
+ innerBlocks
135
+ ) => {
136
+ const additionalAttributes = {};
137
+
138
+ if ( style?.color?.gradient ) {
139
+ additionalAttributes.customGradient = style.color.gradient;
140
+ } else if ( style?.color?.background ) {
141
+ additionalAttributes.customOverlayColor =
142
+ style.color.background;
143
+ }
144
+
145
+ const coverAttributes = {
146
+ align,
147
+ alt: mediaAlt,
148
+ anchor,
149
+ backgroundType: mediaType,
150
+ dimRatio: !! mediaUrl ? 50 : 100,
151
+ focalPoint,
152
+ gradient,
153
+ id: mediaId,
154
+ overlayColor: backgroundColor,
155
+ url: mediaUrl,
156
+ ...additionalAttributes,
157
+ };
158
+ const customTextColor = style?.color?.text;
159
+
160
+ // Attempt to maintain any text color selection.
161
+ // Cover block's do not opt into color block support so we
162
+ // cannot directly copy the color attributes across.
163
+ if ( ! textColor && ! customTextColor ) {
164
+ return createBlock(
165
+ 'core/cover',
166
+ coverAttributes,
167
+ innerBlocks
168
+ );
169
+ }
170
+
171
+ const coloredInnerBlocks = innerBlocks.map( ( innerBlock ) => {
172
+ const {
173
+ attributes: { style: innerStyle },
174
+ } = innerBlock;
175
+
176
+ // Only apply the media and text color if the inner block
177
+ // doesn't set its own color block support selection.
178
+ if (
179
+ innerBlock.attributes.textColor ||
180
+ innerStyle?.color?.text
181
+ ) {
182
+ return innerBlock;
183
+ }
184
+
185
+ const newAttributes = { textColor };
186
+
187
+ // Only add or extend inner block's style object if we have
188
+ // a custom text color from the media & text block.
189
+ if ( customTextColor ) {
190
+ newAttributes.style = {
191
+ ...innerStyle,
192
+ color: {
193
+ ...innerStyle?.color,
194
+ text: customTextColor,
195
+ },
196
+ };
197
+ }
198
+
199
+ return createBlock(
200
+ innerBlock.name,
201
+ {
202
+ ...innerBlock.attributes,
203
+ ...newAttributes,
204
+ },
205
+ innerBlock.innerBlocks
206
+ );
207
+ } );
208
+
209
+ return createBlock(
210
+ 'core/cover',
211
+ coverAttributes,
212
+ coloredInnerBlocks
213
+ );
214
+ },
215
+ },
62
216
  ],
63
217
  };
64
218
 
@@ -298,9 +298,8 @@ export default compose( [
298
298
  canEnableUnsupportedBlockEditor:
299
299
  getSettings( 'capabilities' )
300
300
  .canEnableUnsupportedBlockEditor === true,
301
- isEditableInUnsupportedBlockEditor: ! UBE_INCOMPATIBLE_BLOCKS.includes(
302
- attributes.originalName
303
- ),
301
+ isEditableInUnsupportedBlockEditor:
302
+ ! UBE_INCOMPATIBLE_BLOCKS.includes( attributes.originalName ),
304
303
  };
305
304
  } ),
306
305
  withDispatch( ( dispatch, ownProps ) => {
@@ -48,9 +48,8 @@ describe( 'Unsupported block', () => {
48
48
  getByA11yLabel( /Unsupported Block\. Row 1/ )
49
49
  );
50
50
 
51
- const translatedTableTitle = within( missingBlock ).getByText(
52
- 'Tabla'
53
- );
51
+ const translatedTableTitle =
52
+ within( missingBlock ).getByText( 'Tabla' );
54
53
 
55
54
  expect( translatedTableTitle ).toBeDefined();
56
55
  } );
@@ -74,9 +74,8 @@ describe( 'Missing block', () => {
74
74
 
75
75
  it( 'renders edit action if UBE is available', () => {
76
76
  const testInstance = getTestComponentWithContent();
77
- const bottomSheet = testInstance.UNSAFE_getByType(
78
- BottomSheet
79
- );
77
+ const bottomSheet =
78
+ testInstance.UNSAFE_getByType( BottomSheet );
80
79
  const bottomSheetCells = bottomSheet.props.children[ 1 ];
81
80
  expect( bottomSheetCells ).toBeTruthy();
82
81
  expect( bottomSheetCells.props.children.length ).toBe( 2 );
@@ -91,9 +90,8 @@ describe( 'Missing block', () => {
91
90
  } );
92
91
 
93
92
  const testInstance = getTestComponentWithContent();
94
- const bottomSheet = testInstance.UNSAFE_getByType(
95
- BottomSheet
96
- );
93
+ const bottomSheet =
94
+ testInstance.UNSAFE_getByType( BottomSheet );
97
95
  expect( bottomSheet.props.children[ 1 ] ).toBeFalsy();
98
96
  } );
99
97
 
@@ -101,9 +99,8 @@ describe( 'Missing block', () => {
101
99
  const testInstance = getTestComponentWithContent( {
102
100
  originalName: 'core/block',
103
101
  } );
104
- const bottomSheet = testInstance.UNSAFE_getByType(
105
- BottomSheet
106
- );
102
+ const bottomSheet =
103
+ testInstance.UNSAFE_getByType( BottomSheet );
107
104
  expect( bottomSheet.props.children[ 1 ] ).toBeFalsy();
108
105
  } );
109
106
  } );