@wordpress/block-library 7.0.2 → 7.1.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 (447) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/audio/edit.js +4 -4
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/audio/edit.native.js +4 -4
  5. package/build/audio/edit.native.js.map +1 -1
  6. package/build/audio/transforms.js +1 -1
  7. package/build/audio/transforms.js.map +1 -1
  8. package/build/block/edit.js +3 -9
  9. package/build/block/edit.js.map +1 -1
  10. package/build/button/edit.js +3 -2
  11. package/build/button/edit.js.map +1 -1
  12. package/build/button/edit.native.js +2 -2
  13. package/build/button/edit.native.js.map +1 -1
  14. package/build/buttons/transforms.js +8 -8
  15. package/build/buttons/transforms.js.map +1 -1
  16. package/build/categories/edit.js +15 -26
  17. package/build/categories/edit.js.map +1 -1
  18. package/build/code/index.js +0 -1
  19. package/build/code/index.js.map +1 -1
  20. package/build/columns/columnCalculations.native.js +1 -1
  21. package/build/columns/columnCalculations.native.js.map +1 -1
  22. package/build/columns/edit.js +1 -1
  23. package/build/columns/edit.js.map +1 -1
  24. package/build/columns/edit.native.js +3 -3
  25. package/build/columns/edit.native.js.map +1 -1
  26. package/build/cover/controls.native.js +5 -5
  27. package/build/cover/controls.native.js.map +1 -1
  28. package/build/cover/deprecated.js +188 -17
  29. package/build/cover/deprecated.js.map +1 -1
  30. package/build/cover/edit.js +8 -11
  31. package/build/cover/edit.js.map +1 -1
  32. package/build/cover/edit.native.js +8 -8
  33. package/build/cover/edit.native.js.map +1 -1
  34. package/build/cover/overlay-color-settings.native.js +3 -3
  35. package/build/cover/overlay-color-settings.native.js.map +1 -1
  36. package/build/cover/save.js +1 -1
  37. package/build/cover/save.js.map +1 -1
  38. package/build/cover/shared.js +2 -2
  39. package/build/cover/shared.js.map +1 -1
  40. package/build/embed/edit.js +1 -1
  41. package/build/embed/edit.js.map +1 -1
  42. package/build/embed/edit.native.js +1 -1
  43. package/build/embed/edit.native.js.map +1 -1
  44. package/build/embed/util.js +2 -2
  45. package/build/embed/util.js.map +1 -1
  46. package/build/embed/variations.js +1 -1
  47. package/build/embed/variations.js.map +1 -1
  48. package/build/file/edit.js +20 -17
  49. package/build/file/edit.js.map +1 -1
  50. package/build/file/edit.native.js +1 -1
  51. package/build/file/edit.native.js.map +1 -1
  52. package/build/file/save.js +7 -3
  53. package/build/file/save.js.map +1 -1
  54. package/build/freeform/edit.js +2 -2
  55. package/build/freeform/edit.js.map +1 -1
  56. package/build/gallery/edit.js +1 -1
  57. package/build/gallery/edit.js.map +1 -1
  58. package/build/gallery/gallery.native.js +1 -1
  59. package/build/gallery/gallery.native.js.map +1 -1
  60. package/build/gallery/v1/edit.js +3 -3
  61. package/build/gallery/v1/edit.js.map +1 -1
  62. package/build/gallery/v1/gallery-image.native.js +3 -3
  63. package/build/gallery/v1/gallery-image.native.js.map +1 -1
  64. package/build/gallery/v1/gallery.native.js +2 -2
  65. package/build/gallery/v1/gallery.native.js.map +1 -1
  66. package/build/group/index.js +3 -37
  67. package/build/group/index.js.map +1 -1
  68. package/build/group/transforms.js +45 -0
  69. package/build/group/transforms.js.map +1 -0
  70. package/build/home-link/edit.js +1 -1
  71. package/build/home-link/edit.js.map +1 -1
  72. package/build/image/edit.js +7 -6
  73. package/build/image/edit.js.map +1 -1
  74. package/build/image/edit.native.js +25 -10
  75. package/build/image/edit.native.js.map +1 -1
  76. package/build/image/transforms.js +1 -1
  77. package/build/image/transforms.js.map +1 -1
  78. package/build/index.js +3 -4
  79. package/build/index.js.map +1 -1
  80. package/build/index.native.js +2 -2
  81. package/build/index.native.js.map +1 -1
  82. package/build/media-text/edit.js +21 -2
  83. package/build/media-text/edit.js.map +1 -1
  84. package/build/media-text/edit.native.js +2 -2
  85. package/build/media-text/edit.native.js.map +1 -1
  86. package/build/media-text/media-container.native.js +1 -1
  87. package/build/media-text/media-container.native.js.map +1 -1
  88. package/build/missing/edit.native.js +1 -1
  89. package/build/missing/edit.native.js.map +1 -1
  90. package/build/more/transforms.js +2 -2
  91. package/build/more/transforms.js.map +1 -1
  92. package/build/navigation/edit/index.js +134 -60
  93. package/build/navigation/edit/index.js.map +1 -1
  94. package/build/navigation/edit/inner-blocks.js +8 -3
  95. package/build/navigation/edit/inner-blocks.js.map +1 -1
  96. package/build/navigation/edit/navigation-menu-selector.js +66 -53
  97. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  98. package/build/navigation/edit/placeholder/index.js +31 -46
  99. package/build/navigation/edit/placeholder/index.js.map +1 -1
  100. package/build/navigation/edit/placeholder/placeholder-preview.js +3 -12
  101. package/build/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
  102. package/build/navigation/edit/unsaved-inner-blocks.js +3 -1
  103. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  104. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +120 -0
  105. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -0
  106. package/build/navigation/edit/use-create-navigation-menu.js +53 -4
  107. package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
  108. package/build/navigation/edit/use-navigation-notice.js +3 -3
  109. package/build/navigation/edit/use-navigation-notice.js.map +1 -1
  110. package/build/navigation/menu-items-to-blocks.js +1 -1
  111. package/build/navigation/menu-items-to-blocks.js.map +1 -1
  112. package/build/navigation/use-navigation-entities.js +25 -49
  113. package/build/navigation/use-navigation-entities.js.map +1 -1
  114. package/build/navigation/use-navigation-menu.js +2 -0
  115. package/build/navigation/use-navigation-menu.js.map +1 -1
  116. package/build/navigation-link/fallback-variations.js +1 -1
  117. package/build/navigation-link/fallback-variations.js.map +1 -1
  118. package/build/navigation-link/hooks.js +2 -2
  119. package/build/navigation-link/hooks.js.map +1 -1
  120. package/build/navigation-submenu/edit.js +2 -2
  121. package/build/navigation-submenu/edit.js.map +1 -1
  122. package/build/page-list/convert-to-links-modal.js +13 -23
  123. package/build/page-list/convert-to-links-modal.js.map +1 -1
  124. package/build/page-list/edit.js +8 -22
  125. package/build/page-list/edit.js.map +1 -1
  126. package/build/post-author-name/edit.js +2 -1
  127. package/build/post-author-name/edit.js.map +1 -1
  128. package/build/post-comments-form/edit.js +3 -1
  129. package/build/post-comments-form/edit.js.map +1 -1
  130. package/build/post-excerpt/edit.js +7 -4
  131. package/build/post-excerpt/edit.js.map +1 -1
  132. package/build/post-terms/edit.js +3 -1
  133. package/build/post-terms/edit.js.map +1 -1
  134. package/build/query-title/edit.js +0 -1
  135. package/build/query-title/edit.js.map +1 -1
  136. package/build/search/edit.js +4 -1
  137. package/build/search/edit.js.map +1 -1
  138. package/build/search/edit.native.js +1 -1
  139. package/build/search/edit.native.js.map +1 -1
  140. package/build/separator/save.js +4 -4
  141. package/build/separator/save.js.map +1 -1
  142. package/build/separator/separator-settings.native.js +1 -1
  143. package/build/separator/separator-settings.native.js.map +1 -1
  144. package/build/site-logo/edit.js +1 -1
  145. package/build/site-logo/edit.js.map +1 -1
  146. package/build/social-link/edit.native.js +11 -3
  147. package/build/social-link/edit.native.js.map +1 -1
  148. package/build/spacer/controls.js +5 -5
  149. package/build/spacer/controls.js.map +1 -1
  150. package/build/spacer/controls.native.js +5 -5
  151. package/build/spacer/controls.native.js.map +1 -1
  152. package/build/table/edit.js +2 -2
  153. package/build/table/edit.js.map +1 -1
  154. package/build/video/edit.js +4 -4
  155. package/build/video/edit.js.map +1 -1
  156. package/build/video/edit.native.js +3 -3
  157. package/build/video/edit.native.js.map +1 -1
  158. package/build-module/audio/edit.js +4 -4
  159. package/build-module/audio/edit.js.map +1 -1
  160. package/build-module/audio/edit.native.js +4 -4
  161. package/build-module/audio/edit.native.js.map +1 -1
  162. package/build-module/audio/transforms.js +1 -1
  163. package/build-module/audio/transforms.js.map +1 -1
  164. package/build-module/block/edit.js +5 -11
  165. package/build-module/block/edit.js.map +1 -1
  166. package/build-module/button/edit.js +3 -2
  167. package/build-module/button/edit.js.map +1 -1
  168. package/build-module/button/edit.native.js +2 -2
  169. package/build-module/button/edit.native.js.map +1 -1
  170. package/build-module/buttons/transforms.js +8 -8
  171. package/build-module/buttons/transforms.js.map +1 -1
  172. package/build-module/categories/edit.js +15 -25
  173. package/build-module/categories/edit.js.map +1 -1
  174. package/build-module/code/index.js +0 -1
  175. package/build-module/code/index.js.map +1 -1
  176. package/build-module/columns/columnCalculations.native.js +1 -1
  177. package/build-module/columns/columnCalculations.native.js.map +1 -1
  178. package/build-module/columns/edit.js +1 -1
  179. package/build-module/columns/edit.js.map +1 -1
  180. package/build-module/columns/edit.native.js +3 -3
  181. package/build-module/columns/edit.native.js.map +1 -1
  182. package/build-module/cover/controls.native.js +5 -5
  183. package/build-module/cover/controls.native.js.map +1 -1
  184. package/build-module/cover/deprecated.js +190 -17
  185. package/build-module/cover/deprecated.js.map +1 -1
  186. package/build-module/cover/edit.js +8 -11
  187. package/build-module/cover/edit.js.map +1 -1
  188. package/build-module/cover/edit.native.js +8 -8
  189. package/build-module/cover/edit.native.js.map +1 -1
  190. package/build-module/cover/overlay-color-settings.native.js +3 -3
  191. package/build-module/cover/overlay-color-settings.native.js.map +1 -1
  192. package/build-module/cover/save.js +1 -1
  193. package/build-module/cover/save.js.map +1 -1
  194. package/build-module/cover/shared.js +2 -2
  195. package/build-module/cover/shared.js.map +1 -1
  196. package/build-module/embed/edit.js +1 -1
  197. package/build-module/embed/edit.js.map +1 -1
  198. package/build-module/embed/edit.native.js +1 -1
  199. package/build-module/embed/edit.native.js.map +1 -1
  200. package/build-module/embed/util.js +2 -2
  201. package/build-module/embed/util.js.map +1 -1
  202. package/build-module/embed/variations.js +1 -1
  203. package/build-module/embed/variations.js.map +1 -1
  204. package/build-module/file/edit.js +21 -18
  205. package/build-module/file/edit.js.map +1 -1
  206. package/build-module/file/edit.native.js +1 -1
  207. package/build-module/file/edit.native.js.map +1 -1
  208. package/build-module/file/save.js +7 -3
  209. package/build-module/file/save.js.map +1 -1
  210. package/build-module/freeform/edit.js +2 -2
  211. package/build-module/freeform/edit.js.map +1 -1
  212. package/build-module/gallery/edit.js +1 -1
  213. package/build-module/gallery/edit.js.map +1 -1
  214. package/build-module/gallery/gallery.native.js +1 -1
  215. package/build-module/gallery/gallery.native.js.map +1 -1
  216. package/build-module/gallery/v1/edit.js +3 -3
  217. package/build-module/gallery/v1/edit.js.map +1 -1
  218. package/build-module/gallery/v1/gallery-image.native.js +3 -3
  219. package/build-module/gallery/v1/gallery-image.native.js.map +1 -1
  220. package/build-module/gallery/v1/gallery.native.js +2 -2
  221. package/build-module/gallery/v1/gallery.native.js.map +1 -1
  222. package/build-module/group/index.js +2 -36
  223. package/build-module/group/index.js.map +1 -1
  224. package/build-module/group/transforms.js +36 -0
  225. package/build-module/group/transforms.js.map +1 -0
  226. package/build-module/home-link/edit.js +1 -1
  227. package/build-module/home-link/edit.js.map +1 -1
  228. package/build-module/image/edit.js +7 -6
  229. package/build-module/image/edit.js.map +1 -1
  230. package/build-module/image/edit.native.js +25 -10
  231. package/build-module/image/edit.native.js.map +1 -1
  232. package/build-module/image/transforms.js +1 -1
  233. package/build-module/image/transforms.js.map +1 -1
  234. package/build-module/index.js +4 -5
  235. package/build-module/index.js.map +1 -1
  236. package/build-module/index.native.js +2 -2
  237. package/build-module/index.native.js.map +1 -1
  238. package/build-module/media-text/edit.js +20 -2
  239. package/build-module/media-text/edit.js.map +1 -1
  240. package/build-module/media-text/edit.native.js +2 -2
  241. package/build-module/media-text/edit.native.js.map +1 -1
  242. package/build-module/media-text/media-container.native.js +1 -1
  243. package/build-module/media-text/media-container.native.js.map +1 -1
  244. package/build-module/missing/edit.native.js +1 -1
  245. package/build-module/missing/edit.native.js.map +1 -1
  246. package/build-module/more/transforms.js +2 -2
  247. package/build-module/more/transforms.js.map +1 -1
  248. package/build-module/navigation/edit/index.js +128 -60
  249. package/build-module/navigation/edit/index.js.map +1 -1
  250. package/build-module/navigation/edit/inner-blocks.js +8 -3
  251. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  252. package/build-module/navigation/edit/navigation-menu-selector.js +66 -50
  253. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  254. package/build-module/navigation/edit/placeholder/index.js +32 -45
  255. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  256. package/build-module/navigation/edit/placeholder/placeholder-preview.js +3 -9
  257. package/build-module/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
  258. package/build-module/navigation/edit/unsaved-inner-blocks.js +3 -1
  259. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  260. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +100 -0
  261. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -0
  262. package/build-module/navigation/edit/use-create-navigation-menu.js +48 -5
  263. package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
  264. package/build-module/navigation/edit/use-navigation-notice.js +3 -3
  265. package/build-module/navigation/edit/use-navigation-notice.js.map +1 -1
  266. package/build-module/navigation/menu-items-to-blocks.js +1 -1
  267. package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
  268. package/build-module/navigation/use-navigation-entities.js +26 -50
  269. package/build-module/navigation/use-navigation-entities.js.map +1 -1
  270. package/build-module/navigation/use-navigation-menu.js +2 -0
  271. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  272. package/build-module/navigation-link/fallback-variations.js +1 -1
  273. package/build-module/navigation-link/fallback-variations.js.map +1 -1
  274. package/build-module/navigation-link/hooks.js +2 -2
  275. package/build-module/navigation-link/hooks.js.map +1 -1
  276. package/build-module/navigation-submenu/edit.js +2 -2
  277. package/build-module/navigation-submenu/edit.js.map +1 -1
  278. package/build-module/page-list/convert-to-links-modal.js +15 -25
  279. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  280. package/build-module/page-list/edit.js +9 -23
  281. package/build-module/page-list/edit.js.map +1 -1
  282. package/build-module/post-author-name/edit.js +2 -1
  283. package/build-module/post-author-name/edit.js.map +1 -1
  284. package/build-module/post-comments-form/edit.js +4 -2
  285. package/build-module/post-comments-form/edit.js.map +1 -1
  286. package/build-module/post-excerpt/edit.js +9 -6
  287. package/build-module/post-excerpt/edit.js.map +1 -1
  288. package/build-module/post-terms/edit.js +2 -1
  289. package/build-module/post-terms/edit.js.map +1 -1
  290. package/build-module/query-title/edit.js +0 -1
  291. package/build-module/query-title/edit.js.map +1 -1
  292. package/build-module/search/edit.js +3 -1
  293. package/build-module/search/edit.js.map +1 -1
  294. package/build-module/search/edit.native.js +1 -1
  295. package/build-module/search/edit.native.js.map +1 -1
  296. package/build-module/separator/save.js +4 -4
  297. package/build-module/separator/save.js.map +1 -1
  298. package/build-module/separator/separator-settings.native.js +1 -1
  299. package/build-module/separator/separator-settings.native.js.map +1 -1
  300. package/build-module/site-logo/edit.js +1 -1
  301. package/build-module/site-logo/edit.js.map +1 -1
  302. package/build-module/social-link/edit.native.js +11 -3
  303. package/build-module/social-link/edit.native.js.map +1 -1
  304. package/build-module/spacer/controls.js +5 -5
  305. package/build-module/spacer/controls.js.map +1 -1
  306. package/build-module/spacer/controls.native.js +5 -5
  307. package/build-module/spacer/controls.native.js.map +1 -1
  308. package/build-module/table/edit.js +2 -2
  309. package/build-module/table/edit.js.map +1 -1
  310. package/build-module/video/edit.js +4 -4
  311. package/build-module/video/edit.js.map +1 -1
  312. package/build-module/video/edit.native.js +3 -3
  313. package/build-module/video/edit.native.js.map +1 -1
  314. package/build-style/button/editor-rtl.css +0 -3
  315. package/build-style/button/editor.css +0 -3
  316. package/build-style/code/style-rtl.css +2 -1
  317. package/build-style/code/style.css +2 -1
  318. package/build-style/code/theme-rtl.css +0 -3
  319. package/build-style/code/theme.css +0 -3
  320. package/build-style/common-rtl.css +1 -1
  321. package/build-style/common.css +1 -1
  322. package/build-style/cover/style-rtl.css +1 -5
  323. package/build-style/cover/style.css +1 -5
  324. package/build-style/editor-rtl.css +16 -3
  325. package/build-style/editor.css +16 -3
  326. package/build-style/image/style-rtl.css +2 -1
  327. package/build-style/image/style.css +2 -1
  328. package/build-style/navigation/editor-rtl.css +16 -0
  329. package/build-style/navigation/editor.css +16 -0
  330. package/build-style/style-rtl.css +12 -10
  331. package/build-style/style.css +12 -10
  332. package/build-style/tag-cloud/style-rtl.css +6 -2
  333. package/build-style/tag-cloud/style.css +6 -2
  334. package/build-style/theme-rtl.css +0 -3
  335. package/build-style/theme.css +0 -3
  336. package/package.json +32 -28
  337. package/src/audio/edit.js +4 -4
  338. package/src/audio/edit.native.js +4 -4
  339. package/src/audio/transforms.js +1 -1
  340. package/src/block/edit.js +7 -22
  341. package/src/block/test/edit.native.js +9 -9
  342. package/src/button/edit.js +2 -1
  343. package/src/button/edit.native.js +2 -2
  344. package/src/button/editor.scss +0 -5
  345. package/src/buttons/test/edit.native.js +3 -3
  346. package/src/buttons/transforms.js +8 -8
  347. package/src/categories/edit.js +12 -22
  348. package/src/code/block.json +0 -1
  349. package/src/code/style.scss +4 -2
  350. package/src/code/theme.scss +0 -3
  351. package/src/columns/columnCalculations.native.js +1 -1
  352. package/src/columns/edit.js +1 -1
  353. package/src/columns/edit.native.js +3 -3
  354. package/src/comments-pagination-numbers/index.php +1 -1
  355. package/src/common.scss +1 -1
  356. package/src/cover/controls.native.js +1 -1
  357. package/src/cover/deprecated.js +214 -1
  358. package/src/cover/edit.js +6 -8
  359. package/src/cover/edit.native.js +8 -8
  360. package/src/cover/overlay-color-settings.native.js +3 -3
  361. package/src/cover/save.js +4 -3
  362. package/src/cover/shared.js +2 -2
  363. package/src/cover/style.scss +1 -3
  364. package/src/cover/test/edit.native.js +39 -39
  365. package/src/embed/edit.js +1 -1
  366. package/src/embed/edit.native.js +1 -1
  367. package/src/embed/test/index.native.js +105 -105
  368. package/src/embed/util.js +2 -2
  369. package/src/embed/variations.js +1 -1
  370. package/src/file/edit.js +19 -17
  371. package/src/file/edit.native.js +1 -1
  372. package/src/file/save.js +9 -3
  373. package/src/file/style.native.scss +1 -0
  374. package/src/freeform/edit.js +2 -2
  375. package/src/gallery/edit.js +1 -1
  376. package/src/gallery/gallery.native.js +1 -1
  377. package/src/gallery/test/__snapshots__/index.native.js.snap +164 -0
  378. package/src/gallery/test/helpers.native.js +293 -0
  379. package/src/gallery/test/index.native.js +583 -65
  380. package/src/gallery/v1/edit.js +3 -4
  381. package/src/gallery/v1/gallery-image.native.js +3 -3
  382. package/src/gallery/v1/gallery.native.js +2 -2
  383. package/src/group/index.js +2 -54
  384. package/src/group/transforms.js +52 -0
  385. package/src/home-link/edit.js +1 -1
  386. package/src/image/edit.js +7 -6
  387. package/src/image/edit.native.js +25 -8
  388. package/src/image/style.scss +2 -1
  389. package/src/image/test/edit.native.js +1 -1
  390. package/src/image/transforms.js +1 -1
  391. package/src/index.js +2 -3
  392. package/src/index.native.js +2 -2
  393. package/src/media-text/edit.js +20 -2
  394. package/src/media-text/edit.native.js +2 -2
  395. package/src/media-text/media-container.native.js +1 -1
  396. package/src/media-text/style.native.scss +1 -0
  397. package/src/missing/edit.native.js +1 -1
  398. package/src/missing/test/edit-integration.native.js +4 -4
  399. package/src/missing/test/edit.native.js +2 -2
  400. package/src/more/transforms.js +2 -2
  401. package/src/navigation/edit/index.js +194 -69
  402. package/src/navigation/edit/inner-blocks.js +11 -4
  403. package/src/navigation/edit/navigation-menu-selector.js +97 -79
  404. package/src/navigation/edit/placeholder/index.js +61 -84
  405. package/src/navigation/edit/placeholder/placeholder-preview.js +3 -10
  406. package/src/navigation/edit/unsaved-inner-blocks.js +3 -1
  407. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +137 -0
  408. package/src/navigation/edit/use-create-navigation-menu.js +59 -8
  409. package/src/navigation/edit/use-navigation-notice.js +3 -3
  410. package/src/navigation/editor.scss +23 -1
  411. package/src/navigation/menu-items-to-blocks.js +1 -1
  412. package/src/navigation/test/menu-items-to-blocks.js +1 -1
  413. package/src/navigation/use-navigation-entities.js +26 -60
  414. package/src/navigation/use-navigation-menu.js +5 -0
  415. package/src/navigation-link/fallback-variations.js +1 -1
  416. package/src/navigation-link/hooks.js +2 -2
  417. package/src/navigation-link/test/edit.js +5 -5
  418. package/src/navigation-submenu/edit.js +2 -2
  419. package/src/page-list/convert-to-links-modal.js +17 -31
  420. package/src/page-list/edit.js +14 -23
  421. package/src/post-author-name/edit.js +1 -0
  422. package/src/post-author-name/index.php +1 -1
  423. package/src/post-comments-form/edit.js +7 -3
  424. package/src/post-excerpt/edit.js +9 -12
  425. package/src/post-terms/edit.js +2 -1
  426. package/src/query-title/edit.js +0 -1
  427. package/src/search/edit.js +6 -0
  428. package/src/search/edit.native.js +1 -1
  429. package/src/search/index.php +3 -2
  430. package/src/search/test/edit.native.js +0 -1
  431. package/src/separator/save.js +4 -4
  432. package/src/separator/separator-settings.native.js +1 -1
  433. package/src/site-logo/edit.js +1 -1
  434. package/src/social-link/edit.native.js +17 -8
  435. package/src/social-link/test/index.native.js +138 -0
  436. package/src/spacer/controls.js +1 -1
  437. package/src/spacer/controls.native.js +1 -1
  438. package/src/table/edit.js +2 -2
  439. package/src/tag-cloud/style.scss +12 -7
  440. package/src/video/edit.js +4 -4
  441. package/src/video/edit.native.js +3 -3
  442. package/src/video/style.native.scss +1 -0
  443. package/build/navigation/use-convert-classic-menu.js +0 -59
  444. package/build/navigation/use-convert-classic-menu.js.map +0 -1
  445. package/build-module/navigation/use-convert-classic-menu.js +0 -47
  446. package/build-module/navigation/use-convert-classic-menu.js.map +0 -1
  447. package/src/navigation/use-convert-classic-menu.js +0 -58
@@ -245,7 +245,7 @@ function GalleryEdit( props ) {
245
245
  id: newImageId,
246
246
  } );
247
247
 
248
- // if the attachment caption is updated
248
+ // If the attachment caption is updated.
249
249
  if ( attachment && attachment.caption !== newImage.caption ) {
250
250
  return newImage.caption;
251
251
  }
@@ -362,7 +362,7 @@ function GalleryEdit( props ) {
362
362
  }, [] );
363
363
 
364
364
  useEffect( () => {
365
- // Deselect images when deselecting the block
365
+ // Deselect images when deselecting the block.
366
366
  if ( ! isSelected ) {
367
367
  setSelectedImage();
368
368
  }
@@ -370,7 +370,7 @@ function GalleryEdit( props ) {
370
370
 
371
371
  useEffect( () => {
372
372
  // linkTo attribute must be saved so blocks don't break when changing
373
- // image_default_link_type in options.php
373
+ // image_default_link_type in options.php.
374
374
  if ( ! linkTo ) {
375
375
  __unstableMarkNextChangeAsNotPersistent();
376
376
  setAttributes( {
@@ -456,7 +456,6 @@ function GalleryEdit( props ) {
456
456
  ) }
457
457
  </PanelBody>
458
458
  </InspectorControls>
459
-
460
459
  { noticeUI }
461
460
  <Gallery
462
461
  { ...props }
@@ -134,8 +134,8 @@ class GalleryImage extends Component {
134
134
  } );
135
135
  }
136
136
 
137
- // unselect the caption so when the user selects other image and comeback
138
- // the caption is not immediately selected
137
+ // Unselect the caption so when the user selects other image and comeback
138
+ // the caption is not immediately selected.
139
139
  if (
140
140
  this.state.captionSelected &&
141
141
  ! isSelected &&
@@ -318,7 +318,7 @@ class GalleryImage extends Component {
318
318
  return (
319
319
  <TouchableWithoutFeedback
320
320
  onPress={ this.onMediaPressed }
321
- accessible={ ! isSelected } // We need only child views to be accessible after the selection
321
+ accessible={ ! isSelected } // We need only child views to be accessible after the selection.
322
322
  accessibilityLabel={ this.accessibilityLabelImageContainer() } // if we don't set this explicitly it reads system provided accessibilityLabels of all child components and those include pretty technical words which don't make sense
323
323
  accessibilityRole={ 'imagebutton' } // this makes VoiceOver to read a description of image provided by system on iOS and lets user know this is a button which conveys the message of tappablity
324
324
  >
@@ -77,7 +77,7 @@ export const Gallery = ( props ) => {
77
77
  if ( isCaptionSelected ) {
78
78
  setIsCaptionSelected( false );
79
79
  }
80
- // we need to fully invoke the curried function here
80
+ // We need to fully invoke the curried function here.
81
81
  onSelectImage( index )();
82
82
  };
83
83
  };
@@ -152,7 +152,7 @@ export const Gallery = ( props ) => {
152
152
  )
153
153
  }
154
154
  onFocus={ focusGalleryCaption }
155
- onBlur={ onBlur } // always assign onBlur as props
155
+ onBlur={ onBlur } // Always assign onBlur as props.
156
156
  insertBlocksAfter={ insertBlocksAfter }
157
157
  />
158
158
  </View>
@@ -2,7 +2,6 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { createBlock } from '@wordpress/blocks';
6
5
  import { group as icon } from '@wordpress/icons';
7
6
 
8
7
  /**
@@ -12,6 +11,7 @@ import deprecated from './deprecated';
12
11
  import edit from './edit';
13
12
  import metadata from './block.json';
14
13
  import save from './save';
14
+ import transforms from './transforms';
15
15
  import variations from './variations';
16
16
 
17
17
  const { name } = metadata;
@@ -80,59 +80,7 @@ export const settings = {
80
80
  },
81
81
  ],
82
82
  },
83
- transforms: {
84
- from: [
85
- {
86
- type: 'block',
87
- isMultiBlock: true,
88
- blocks: [ '*' ],
89
- __experimentalConvert( blocks ) {
90
- // Avoid transforming a single `core/group` Block
91
- if (
92
- blocks.length === 1 &&
93
- blocks[ 0 ].name === 'core/group'
94
- ) {
95
- return;
96
- }
97
-
98
- const alignments = [ 'wide', 'full' ];
99
-
100
- // Determine the widest setting of all the blocks to be grouped
101
- const widestAlignment = blocks.reduce(
102
- ( accumulator, block ) => {
103
- const { align } = block.attributes;
104
- return alignments.indexOf( align ) >
105
- alignments.indexOf( accumulator )
106
- ? align
107
- : accumulator;
108
- },
109
- undefined
110
- );
111
-
112
- // Clone the Blocks to be Grouped
113
- // Failing to create new block references causes the original blocks
114
- // to be replaced in the switchToBlockType call thereby meaning they
115
- // are removed both from their original location and within the
116
- // new group block.
117
- const groupInnerBlocks = blocks.map( ( block ) => {
118
- return createBlock(
119
- block.name,
120
- block.attributes,
121
- block.innerBlocks
122
- );
123
- } );
124
-
125
- return createBlock(
126
- 'core/group',
127
- {
128
- align: widestAlignment,
129
- },
130
- groupInnerBlocks
131
- );
132
- },
133
- },
134
- ],
135
- },
83
+ transforms,
136
84
  edit,
137
85
  save,
138
86
  deprecated,
@@ -0,0 +1,52 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { createBlock } from '@wordpress/blocks';
5
+
6
+ const transforms = {
7
+ from: [
8
+ {
9
+ type: 'block',
10
+ isMultiBlock: true,
11
+ blocks: [ '*' ],
12
+ __experimentalConvert( blocks ) {
13
+ const alignments = [ 'wide', 'full' ];
14
+
15
+ // Determine the widest setting of all the blocks to be grouped
16
+ const widestAlignment = blocks.reduce(
17
+ ( accumulator, block ) => {
18
+ const { align } = block.attributes;
19
+ return alignments.indexOf( align ) >
20
+ alignments.indexOf( accumulator )
21
+ ? align
22
+ : accumulator;
23
+ },
24
+ undefined
25
+ );
26
+
27
+ // Clone the Blocks to be Grouped
28
+ // Failing to create new block references causes the original blocks
29
+ // to be replaced in the switchToBlockType call thereby meaning they
30
+ // are removed both from their original location and within the
31
+ // new group block.
32
+ const groupInnerBlocks = blocks.map( ( block ) => {
33
+ return createBlock(
34
+ block.name,
35
+ block.attributes,
36
+ block.innerBlocks
37
+ );
38
+ } );
39
+
40
+ return createBlock(
41
+ 'core/group',
42
+ {
43
+ align: widestAlignment,
44
+ },
45
+ groupInnerBlocks
46
+ );
47
+ },
48
+ },
49
+ ],
50
+ };
51
+
52
+ export default transforms;
@@ -23,7 +23,7 @@ export default function HomeEdit( {
23
23
  const { homeUrl } = useSelect(
24
24
  ( select ) => {
25
25
  const {
26
- getUnstableBase, //site index
26
+ getUnstableBase, // Site index.
27
27
  } = select( coreStore );
28
28
  return {
29
29
  homeUrl: getUnstableBase()?.home,
package/src/image/edit.js CHANGED
@@ -171,6 +171,12 @@ export function ImageEdit( {
171
171
  function onUploadError( message ) {
172
172
  noticeOperations.removeAllNotices();
173
173
  noticeOperations.createErrorNotice( message );
174
+ setAttributes( {
175
+ src: undefined,
176
+ id: undefined,
177
+ url: undefined,
178
+ } );
179
+ setTemporaryURL( undefined );
174
180
  }
175
181
 
176
182
  function onSelectImage( media ) {
@@ -306,12 +312,7 @@ export function ImageEdit( {
306
312
  allowedTypes: ALLOWED_MEDIA_TYPES,
307
313
  onError: ( message ) => {
308
314
  isTemp = false;
309
- noticeOperations.createErrorNotice( message );
310
- setAttributes( {
311
- src: undefined,
312
- id: undefined,
313
- url: undefined,
314
- } );
315
+ onUploadError( message );
315
316
  },
316
317
  } );
317
318
  }
@@ -88,7 +88,7 @@ function LinkSettings( {
88
88
  const route = useRoute();
89
89
  const { href: url, label, linkDestination, linkTarget, rel } = attributes;
90
90
 
91
- // Persist attributes passed from child screen
91
+ // Persist attributes passed from child screen.
92
92
  useEffect( () => {
93
93
  const { inputValue: newUrl } = route.params || {};
94
94
 
@@ -186,6 +186,7 @@ export class ImageEdit extends Component {
186
186
  this.state = {
187
187
  isCaptionSelected: false,
188
188
  uploadStatus: UPLOAD_STATE_IDLE,
189
+ isAnimatedGif: false,
189
190
  };
190
191
 
191
192
  this.replacedFeaturedImage = false;
@@ -225,7 +226,7 @@ export class ImageEdit extends Component {
225
226
  console.warn( 'Attributes has id with no url.' );
226
227
  }
227
228
 
228
- // Detect any pasted image and start an upload
229
+ // Detect any pasted image and start an upload.
229
230
  if (
230
231
  ! attributes.id &&
231
232
  attributes.url &&
@@ -239,7 +240,7 @@ export class ImageEdit extends Component {
239
240
  }
240
241
 
241
242
  // Make sure we mark any temporary images as failed if they failed while
242
- // the editor wasn't open
243
+ // the editor wasn't open.
243
244
  if (
244
245
  attributes.id &&
245
246
  attributes.url &&
@@ -250,7 +251,7 @@ export class ImageEdit extends Component {
250
251
  }
251
252
 
252
253
  componentWillUnmount() {
253
- // this action will only exist if the user pressed the trash button on the block holder
254
+ // This action will only exist if the user pressed the trash button on the block holder.
254
255
  if (
255
256
  hasAction( 'blocks.onRemoveBlockCheckUpload' ) &&
256
257
  this.state.uploadStatus === UPLOAD_STATE_UPLOADING
@@ -305,7 +306,7 @@ export class ImageEdit extends Component {
305
306
 
306
307
  static getDerivedStateFromProps( props, state ) {
307
308
  // Avoid a UI flicker in the toolbar by insuring that isCaptionSelected
308
- // is updated immediately any time the isSelected prop becomes false
309
+ // is updated immediately any time the isSelected prop becomes false.
309
310
  return {
310
311
  isCaptionSelected: props.isSelected && state.isCaptionSelected,
311
312
  };
@@ -363,6 +364,10 @@ export class ImageEdit extends Component {
363
364
 
364
365
  setAttributes( { url: payload.mediaUrl, id: payload.mediaServerId } );
365
366
  this.setState( { uploadStatus: UPLOAD_STATE_SUCCEEDED } );
367
+
368
+ this.setState( {
369
+ isAnimatedGif: payload.mediaUrl.toLowerCase().includes( '.gif' ),
370
+ } );
366
371
  }
367
372
 
368
373
  finishMediaUploadWithFailure( payload ) {
@@ -459,6 +464,10 @@ export class ImageEdit extends Component {
459
464
  ...mediaAttributes,
460
465
  ...additionalAttributes,
461
466
  } );
467
+
468
+ this.setState( {
469
+ isAnimatedGif: media.url.toLowerCase().includes( '.gif' ),
470
+ } );
462
471
  }
463
472
 
464
473
  onFocusCaption() {
@@ -739,8 +748,16 @@ export class ImageEdit extends Component {
739
748
  context?.fixedHeight && styles.fixedHeight,
740
749
  ];
741
750
 
751
+ const badgeLabelShown = isFeaturedImage || this.state.isAnimatedGif;
752
+ let badgeLabelText = '';
753
+ if ( isFeaturedImage ) {
754
+ badgeLabelText = __( 'Featured' );
755
+ } else if ( this.state.isAnimatedGif ) {
756
+ badgeLabelText = __( 'GIF' );
757
+ }
758
+
742
759
  const getImageComponent = ( openMediaOptions, getMediaOptions ) => (
743
- <Badge label={ __( 'Featured' ) } show={ isFeaturedImage }>
760
+ <Badge label={ badgeLabelText } show={ badgeLabelShown }>
744
761
  <TouchableWithoutFeedback
745
762
  accessible={ ! isSelected }
746
763
  onPress={ this.onImagePressed }
@@ -813,7 +830,7 @@ export class ImageEdit extends Component {
813
830
  accessible
814
831
  accessibilityLabelCreator={ this.accessibilityLabelCreator }
815
832
  onFocus={ this.onFocusCaption }
816
- onBlur={ this.props.onBlur } // always assign onBlur as props
833
+ onBlur={ this.props.onBlur } // Always assign onBlur as props.
817
834
  insertBlocksAfter={ this.props.insertBlocksAfter }
818
835
  />
819
836
  </Badge>
@@ -851,7 +868,7 @@ export default compose( [
851
868
  const shouldGetMedia =
852
869
  ( isSelected && isNotFileUrl ) ||
853
870
  // Edge case to update the image after uploading if the block gets unselected
854
- // Check if it's the original image and not the resized one with queryparams
871
+ // Check if it's the original image and not the resized one with queryparams.
855
872
  ( ! isSelected &&
856
873
  isNotFileUrl &&
857
874
  url &&
@@ -69,7 +69,8 @@
69
69
  }
70
70
 
71
71
  // Variations
72
- &.is-style-rounded img {
72
+ &.is-style-rounded img,
73
+ .is-style-rounded img {
73
74
  // We use an absolute pixel to prevent the oval shape that a value of 50% would give
74
75
  // to rectangular images. A pill-shape is better than otherwise.
75
76
  border-radius: 9999px;
@@ -67,7 +67,7 @@ afterAll( () => {
67
67
  unregisterBlockType( name );
68
68
  } );
69
69
 
70
- // Restore mocks
70
+ // Restore mocks.
71
71
  Image.getSize.mockRestore();
72
72
  } );
73
73
 
@@ -19,7 +19,7 @@ export function stripFirstImage( attributes, { shortcode } ) {
19
19
 
20
20
  let nodeToRemove = body.querySelector( 'img' );
21
21
 
22
- // if an image has parents, find the topmost node to remove
22
+ // If an image has parents, find the topmost node to remove.
23
23
  while (
24
24
  nodeToRemove &&
25
25
  nodeToRemove.parentNode &&
package/src/index.js CHANGED
@@ -96,7 +96,6 @@ import * as socialLink from './social-link';
96
96
  import * as socialLinks from './social-links';
97
97
  import * as spacer from './spacer';
98
98
  import * as table from './table';
99
- // import * as tableOfContents from './table-of-contents';
100
99
  import * as tagCloud from './tag-cloud';
101
100
  import * as templatePart from './template-part';
102
101
  import * as termDescription from './term-description';
@@ -145,7 +144,7 @@ export const __experimentalGetCoreBlocks = () => [
145
144
  buttons,
146
145
  calendar,
147
146
  categories,
148
- window.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context
147
+ window.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context.
149
148
  code,
150
149
  column,
151
150
  columns,
@@ -205,7 +204,6 @@ export const __experimentalGetCoreBlocks = () => [
205
204
  logInOut,
206
205
  termDescription,
207
206
  queryTitle,
208
- postAuthorName,
209
207
  postAuthorBiography,
210
208
  ];
211
209
 
@@ -251,6 +249,7 @@ export const __experimentalRegisterExperimentalCoreBlocks = process.env
251
249
  [
252
250
  // Experimental blocks.
253
251
  homeLink,
252
+ postAuthorName,
254
253
 
255
254
  // Full Site Editing blocks.
256
255
  ...( enableFSEBlocks
@@ -135,7 +135,7 @@ export const registerBlock = ( block ) => {
135
135
  {
136
136
  name,
137
137
  ...metadata,
138
- // Gradients support only available for blocks listed in ALLOWED_BLOCKS_GRADIENT_SUPPORT
138
+ // Gradients support only available for blocks listed in ALLOWED_BLOCKS_GRADIENT_SUPPORT.
139
139
  ...( ! ALLOWED_BLOCKS_GRADIENT_SUPPORT.includes( name ) &&
140
140
  supports?.color?.gradients
141
141
  ? {
@@ -171,7 +171,7 @@ const registerBlockVariations = ( block ) => {
171
171
  } );
172
172
  };
173
173
 
174
- // only enable code block for development
174
+ // Only enable code block for development
175
175
  // eslint-disable-next-line no-undef
176
176
  const devOnly = ( block ) => ( !! __DEV__ ? block : null );
177
177
 
@@ -29,6 +29,7 @@ import {
29
29
  ExternalLink,
30
30
  FocalPointPicker,
31
31
  } from '@wordpress/components';
32
+ import { isBlobURL, getBlobTypeByURL } from '@wordpress/blob';
32
33
  import { pullLeft, pullRight } from '@wordpress/icons';
33
34
  import { store as coreStore } from '@wordpress/core-data';
34
35
 
@@ -72,9 +73,26 @@ function attributesFromMedia( {
72
73
  setAttributes,
73
74
  } ) {
74
75
  return ( media ) => {
76
+ if ( ! media || ! media.url ) {
77
+ setAttributes( {
78
+ mediaAlt: undefined,
79
+ mediaId: undefined,
80
+ mediaType: undefined,
81
+ mediaUrl: undefined,
82
+ mediaLink: undefined,
83
+ href: undefined,
84
+ focalPoint: undefined,
85
+ } );
86
+ return;
87
+ }
88
+
89
+ if ( isBlobURL( media.url ) ) {
90
+ media.type = getBlobTypeByURL( media.url );
91
+ }
92
+
75
93
  let mediaType;
76
94
  let src;
77
- // for media selections originated from a file upload.
95
+ // For media selections originated from a file upload.
78
96
  if ( media.media_type ) {
79
97
  if ( media.media_type === 'image' ) {
80
98
  mediaType = 'image';
@@ -84,7 +102,7 @@ function attributesFromMedia( {
84
102
  mediaType = 'video';
85
103
  }
86
104
  } else {
87
- // for media selections originated from existing files in the media library.
105
+ // For media selections originated from existing files in the media library.
88
106
  mediaType = media.type;
89
107
  }
90
108
 
@@ -82,7 +82,7 @@ class MediaTextEdit extends Component {
82
82
 
83
83
  let mediaType;
84
84
  let src;
85
- // for media selections originated from a file upload.
85
+ // For media selections originated from a file upload.
86
86
  if ( media.media_type ) {
87
87
  if ( media.media_type === 'image' ) {
88
88
  mediaType = 'image';
@@ -92,7 +92,7 @@ class MediaTextEdit extends Component {
92
92
  mediaType = 'video';
93
93
  }
94
94
  } else {
95
- // for media selections originated from existing files in the media library.
95
+ // For media selections originated from existing files in the media library.
96
96
  mediaType = media.type;
97
97
  }
98
98
 
@@ -73,7 +73,7 @@ class MediaContainer extends Component {
73
73
  const { mediaId, mediaUrl } = this.props;
74
74
 
75
75
  // Make sure we mark any temporary images as failed if they failed while
76
- // the editor wasn't open
76
+ // the editor wasn't open.
77
77
  if ( mediaId && mediaUrl && getProtocol( mediaUrl ) === 'file:' ) {
78
78
  mediaUploadSync();
79
79
  }
@@ -116,6 +116,7 @@ $media-to-text: 12px;
116
116
  color: #fff;
117
117
  font-size: 14;
118
118
  margin-top: 5;
119
+ text-align: center;
119
120
  }
120
121
 
121
122
  .uploadFailedTextVideo {
@@ -173,7 +173,7 @@ export class UnsupportedBlockEdit extends Component {
173
173
  // On iOS, onModalHide is called when the controller is still part of the hierarchy.
174
174
  // A small delay will ensure that the controller has already been removed.
175
175
  this.timeout = setTimeout( () => {
176
- // for the Classic block, the content is kept in the `content` attribute
176
+ // For the Classic block, the content is kept in the `content` attribute.
177
177
  const content =
178
178
  blockName === 'core/freeform'
179
179
  ? attributes.content
@@ -15,21 +15,21 @@ import { setLocaleData } from '@wordpress/i18n';
15
15
  import { registerCoreBlocks } from '../..';
16
16
 
17
17
  beforeAll( () => {
18
- // Mock translations
18
+ // Mock translations.
19
19
  setLocaleData( {
20
20
  'block title\u0004Table': [ 'Tabla' ],
21
21
  "'%s' is not fully-supported": [ '«%s» no es totalmente compatible' ],
22
22
  } );
23
23
 
24
- // Register all core blocks
24
+ // Register all core blocks.
25
25
  registerCoreBlocks();
26
26
  } );
27
27
 
28
28
  afterAll( () => {
29
- // Clean up translations
29
+ // Clean up translations.
30
30
  setLocaleData( {} );
31
31
 
32
- // Clean up registered blocks
32
+ // Clean up registered blocks.
33
33
  getBlockTypes().forEach( ( block ) => {
34
34
  unregisterBlockType( block.name );
35
35
  } );
@@ -49,7 +49,7 @@ describe( 'Missing block', () => {
49
49
  const testInstance = getTestComponentWithContent();
50
50
  const bottomSheet = testInstance.UNSAFE_getByType( BottomSheet );
51
51
  const children = bottomSheet.props.children[ 0 ].props.children;
52
- expect( children.length ).toBe( 3 ); // 4 children in the bottom sheet: the icon, the "isn't yet supported" title and the "We are working hard..." message
52
+ expect( children.length ).toBe( 3 ); // 4 children in the bottom sheet: the icon, the "isn't yet supported" title and the "We are working hard..." message.
53
53
  expect( children[ 0 ].props.icon ).toBe( help );
54
54
  } );
55
55
 
@@ -66,7 +66,7 @@ describe( 'Missing block', () => {
66
66
 
67
67
  describe( 'Unsupported block editor (UBE)', () => {
68
68
  beforeEach( () => {
69
- // By default we set the web editor as available
69
+ // By default we set the web editor as available.
70
70
  storeConfig.selectors.getSettings.mockReturnValue( {
71
71
  unsupportedBlockEditor: true,
72
72
  } );
@@ -15,11 +15,11 @@ const transforms = {
15
15
  transform( node ) {
16
16
  const { customText, noTeaser } = node.dataset;
17
17
  const attrs = {};
18
- // Don't copy unless defined and not an empty string
18
+ // Don't copy unless defined and not an empty string.
19
19
  if ( customText ) {
20
20
  attrs.customText = customText;
21
21
  }
22
- // Special handling for boolean
22
+ // Special handling for boolean.
23
23
  if ( noTeaser === '' ) {
24
24
  attrs.noTeaser = true;
25
25
  }