@wordpress/block-library 8.9.0 → 8.11.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 (502) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/block/edit.native.js +17 -10
  3. package/build/block/edit.native.js.map +1 -1
  4. package/build/code/index.js +1 -0
  5. package/build/code/index.js.map +1 -1
  6. package/build/column/index.js +1 -1
  7. package/build/columns/transforms.js +1 -5
  8. package/build/columns/transforms.js.map +1 -1
  9. package/build/comment-author-name/edit.js +1 -1
  10. package/build/comment-author-name/edit.js.map +1 -1
  11. package/build/comment-edit-link/edit.js +1 -1
  12. package/build/comment-edit-link/edit.js.map +1 -1
  13. package/build/cover/edit/inspector-controls.js +1 -1
  14. package/build/cover/edit/inspector-controls.js.map +1 -1
  15. package/build/cover/edit/resizable-cover-popover.js +3 -3
  16. package/build/cover/edit/resizable-cover-popover.js.map +1 -1
  17. package/build/cover/index.js +1 -1
  18. package/build/cover/variations.js +1 -1
  19. package/build/cover/variations.js.map +1 -1
  20. package/build/details/edit.js +19 -5
  21. package/build/details/edit.js.map +1 -1
  22. package/build/details/index.js +14 -10
  23. package/build/details/index.js.map +1 -1
  24. package/build/details/save.js +4 -1
  25. package/build/details/save.js.map +1 -1
  26. package/build/embed/variations.js +2 -2
  27. package/build/embed/variations.js.map +1 -1
  28. package/build/file/interactivity.js +19 -0
  29. package/build/file/interactivity.js.map +1 -0
  30. package/build/file/{utils.js → utils/index.js} +1 -1
  31. package/build/file/utils/index.js.map +1 -0
  32. package/build/file/view.js +1 -1
  33. package/build/file/view.js.map +1 -1
  34. package/build/freeform/modal.js +20 -17
  35. package/build/freeform/modal.js.map +1 -1
  36. package/build/gallery/edit.js +2 -8
  37. package/build/gallery/edit.js.map +1 -1
  38. package/build/gallery/v1/edit.js +1 -7
  39. package/build/gallery/v1/edit.js.map +1 -1
  40. package/build/gallery/v1/gallery-image.native.js +1 -3
  41. package/build/gallery/v1/gallery-image.native.js.map +1 -1
  42. package/build/group/transforms.js +0 -5
  43. package/build/group/transforms.js.map +1 -1
  44. package/build/image/deprecated.js +2 -4
  45. package/build/image/deprecated.js.map +1 -1
  46. package/build/image/edit.js +13 -11
  47. package/build/image/edit.js.map +1 -1
  48. package/build/image/image.js +7 -12
  49. package/build/image/image.js.map +1 -1
  50. package/build/image/index.js +3 -0
  51. package/build/image/index.js.map +1 -1
  52. package/build/image/interactivity.js +102 -0
  53. package/build/image/interactivity.js.map +1 -0
  54. package/build/image/save.js +2 -4
  55. package/build/image/save.js.map +1 -1
  56. package/build/image/utils.js +10 -18
  57. package/build/image/utils.js.map +1 -1
  58. package/build/index.js +0 -6
  59. package/build/index.js.map +1 -1
  60. package/build/index.native.js +1 -1
  61. package/build/index.native.js.map +1 -1
  62. package/build/latest-posts/edit.native.js +1 -3
  63. package/build/latest-posts/edit.native.js.map +1 -1
  64. package/build/list/edit.js +1 -1
  65. package/build/list/edit.js.map +1 -1
  66. package/build/list-item/edit.native.js +1 -1
  67. package/build/list-item/edit.native.js.map +1 -1
  68. package/build/list-item/transforms.js +4 -1
  69. package/build/list-item/transforms.js.map +1 -1
  70. package/build/list-item/utils.js +5 -1
  71. package/build/list-item/utils.js.map +1 -1
  72. package/build/loginout/index.js +11 -1
  73. package/build/loginout/index.js.map +1 -1
  74. package/build/media-text/deprecated.js +4 -6
  75. package/build/media-text/deprecated.js.map +1 -1
  76. package/build/media-text/edit.js +13 -11
  77. package/build/media-text/edit.js.map +1 -1
  78. package/build/media-text/media-container.js +3 -3
  79. package/build/media-text/media-container.js.map +1 -1
  80. package/build/media-text/save.js +1 -3
  81. package/build/media-text/save.js.map +1 -1
  82. package/build/navigation/constants.js +15 -0
  83. package/build/navigation/constants.js.map +1 -0
  84. package/build/navigation/edit/index.js +16 -26
  85. package/build/navigation/edit/index.js.map +1 -1
  86. package/build/navigation/edit/inner-blocks.js +5 -7
  87. package/build/navigation/edit/inner-blocks.js.map +1 -1
  88. package/build/navigation/edit/leaf-more-menu.js +148 -0
  89. package/build/navigation/edit/leaf-more-menu.js.map +1 -0
  90. package/build/navigation/edit/menu-inspector-controls.js +53 -8
  91. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  92. package/build/navigation/edit/navigation-menu-delete-control.js +6 -6
  93. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  94. package/build/navigation/edit/unsaved-inner-blocks.js +12 -25
  95. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  96. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  97. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  98. package/build/navigation/interactivity.js +157 -0
  99. package/build/navigation/interactivity.js.map +1 -0
  100. package/build/navigation-link/edit.js +7 -5
  101. package/build/navigation-link/edit.js.map +1 -1
  102. package/build/navigation-link/update-attributes.js +5 -5
  103. package/build/navigation-link/update-attributes.js.map +1 -1
  104. package/build/navigation-submenu/edit.js +7 -5
  105. package/build/navigation-submenu/edit.js.map +1 -1
  106. package/build/paragraph/index.js +5 -1
  107. package/build/paragraph/index.js.map +1 -1
  108. package/build/paragraph/transforms.js +5 -1
  109. package/build/paragraph/transforms.js.map +1 -1
  110. package/build/pattern/edit.js +42 -8
  111. package/build/pattern/edit.js.map +1 -1
  112. package/build/pattern/index.js +12 -5
  113. package/build/pattern/index.js.map +1 -1
  114. package/build/pattern/v1/edit.js +57 -0
  115. package/build/pattern/v1/edit.js.map +1 -0
  116. package/build/post-author-name/edit.js +1 -1
  117. package/build/post-author-name/edit.js.map +1 -1
  118. package/build/post-featured-image/edit.js +1 -2
  119. package/build/post-featured-image/edit.js.map +1 -1
  120. package/build/post-featured-image/overlay.js +5 -0
  121. package/build/post-featured-image/overlay.js.map +1 -1
  122. package/build/post-title/edit.js +24 -7
  123. package/build/post-title/edit.js.map +1 -1
  124. package/build/preformatted/edit.native.js +3 -2
  125. package/build/preformatted/edit.native.js.map +1 -1
  126. package/build/quote/transforms.js +23 -37
  127. package/build/quote/transforms.js.map +1 -1
  128. package/build/read-more/edit.js +1 -1
  129. package/build/read-more/edit.js.map +1 -1
  130. package/build/search/edit.js +9 -1
  131. package/build/search/edit.js.map +1 -1
  132. package/build/site-title/edit/index.js +1 -1
  133. package/build/site-title/edit/index.js.map +1 -1
  134. package/build/social-link/edit.js +21 -4
  135. package/build/social-link/edit.js.map +1 -1
  136. package/build/social-links/edit.js +2 -2
  137. package/build/social-links/edit.js.map +1 -1
  138. package/build/template-part/edit/index.js +1 -7
  139. package/build/template-part/edit/index.js.map +1 -1
  140. package/build/template-part/edit/utils/hooks.js +2 -2
  141. package/build/template-part/edit/utils/hooks.js.map +1 -1
  142. package/build/utils/interactivity/constants.js +9 -0
  143. package/build/utils/interactivity/constants.js.map +1 -0
  144. package/build/utils/interactivity/directives.js +236 -0
  145. package/build/utils/interactivity/directives.js.map +1 -0
  146. package/build/utils/interactivity/hooks.js +176 -0
  147. package/build/utils/interactivity/hooks.js.map +1 -0
  148. package/build/utils/interactivity/hydration.js +34 -0
  149. package/build/utils/interactivity/hydration.js.map +1 -0
  150. package/build/utils/interactivity/index.js +34 -0
  151. package/build/utils/interactivity/index.js.map +1 -0
  152. package/build/utils/interactivity/portals.js +108 -0
  153. package/build/utils/interactivity/portals.js.map +1 -0
  154. package/build/utils/interactivity/store.js +67 -0
  155. package/build/utils/interactivity/store.js.map +1 -0
  156. package/build/utils/interactivity/utils.js +87 -0
  157. package/build/utils/interactivity/utils.js.map +1 -0
  158. package/build/utils/interactivity/vdom.js +109 -0
  159. package/build/utils/interactivity/vdom.js.map +1 -0
  160. package/build-module/block/edit.native.js +7 -1
  161. package/build-module/block/edit.native.js.map +1 -1
  162. package/build-module/code/index.js +1 -0
  163. package/build-module/code/index.js.map +1 -1
  164. package/build-module/column/index.js +1 -1
  165. package/build-module/columns/transforms.js +1 -5
  166. package/build-module/columns/transforms.js.map +1 -1
  167. package/build-module/comment-author-name/edit.js +1 -1
  168. package/build-module/comment-author-name/edit.js.map +1 -1
  169. package/build-module/comment-edit-link/edit.js +1 -1
  170. package/build-module/comment-edit-link/edit.js.map +1 -1
  171. package/build-module/cover/edit/inspector-controls.js +1 -1
  172. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  173. package/build-module/cover/edit/resizable-cover-popover.js +3 -3
  174. package/build-module/cover/edit/resizable-cover-popover.js.map +1 -1
  175. package/build-module/cover/index.js +1 -1
  176. package/build-module/cover/variations.js +1 -1
  177. package/build-module/cover/variations.js.map +1 -1
  178. package/build-module/details/edit.js +20 -6
  179. package/build-module/details/edit.js.map +1 -1
  180. package/build-module/details/index.js +14 -10
  181. package/build-module/details/index.js.map +1 -1
  182. package/build-module/details/save.js +5 -2
  183. package/build-module/details/save.js.map +1 -1
  184. package/build-module/embed/variations.js +2 -2
  185. package/build-module/embed/variations.js.map +1 -1
  186. package/build-module/file/interactivity.js +15 -0
  187. package/build-module/file/interactivity.js.map +1 -0
  188. package/build-module/file/{utils.js → utils/index.js} +1 -1
  189. package/build-module/file/utils/index.js.map +1 -0
  190. package/build-module/file/view.js +1 -1
  191. package/build-module/file/view.js.map +1 -1
  192. package/build-module/freeform/modal.js +19 -18
  193. package/build-module/freeform/modal.js.map +1 -1
  194. package/build-module/gallery/edit.js +2 -8
  195. package/build-module/gallery/edit.js.map +1 -1
  196. package/build-module/gallery/v1/edit.js +1 -6
  197. package/build-module/gallery/v1/edit.js.map +1 -1
  198. package/build-module/gallery/v1/gallery-image.native.js +1 -2
  199. package/build-module/gallery/v1/gallery-image.native.js.map +1 -1
  200. package/build-module/group/transforms.js +0 -5
  201. package/build-module/group/transforms.js.map +1 -1
  202. package/build-module/image/deprecated.js +2 -3
  203. package/build-module/image/deprecated.js.map +1 -1
  204. package/build-module/image/edit.js +12 -11
  205. package/build-module/image/edit.js.map +1 -1
  206. package/build-module/image/image.js +7 -11
  207. package/build-module/image/image.js.map +1 -1
  208. package/build-module/image/index.js +3 -0
  209. package/build-module/image/index.js.map +1 -1
  210. package/build-module/image/interactivity.js +99 -0
  211. package/build-module/image/interactivity.js.map +1 -0
  212. package/build-module/image/save.js +2 -3
  213. package/build-module/image/save.js.map +1 -1
  214. package/build-module/image/utils.js +10 -17
  215. package/build-module/image/utils.js.map +1 -1
  216. package/build-module/index.js +0 -4
  217. package/build-module/index.js.map +1 -1
  218. package/build-module/index.native.js +1 -1
  219. package/build-module/index.native.js.map +1 -1
  220. package/build-module/latest-posts/edit.native.js +1 -2
  221. package/build-module/latest-posts/edit.native.js.map +1 -1
  222. package/build-module/list/edit.js +1 -1
  223. package/build-module/list/edit.js.map +1 -1
  224. package/build-module/list-item/edit.native.js +1 -1
  225. package/build-module/list-item/edit.native.js.map +1 -1
  226. package/build-module/list-item/transforms.js +5 -2
  227. package/build-module/list-item/transforms.js.map +1 -1
  228. package/build-module/list-item/utils.js +5 -1
  229. package/build-module/list-item/utils.js.map +1 -1
  230. package/build-module/loginout/index.js +11 -1
  231. package/build-module/loginout/index.js.map +1 -1
  232. package/build-module/media-text/deprecated.js +4 -5
  233. package/build-module/media-text/deprecated.js.map +1 -1
  234. package/build-module/media-text/edit.js +13 -12
  235. package/build-module/media-text/edit.js.map +1 -1
  236. package/build-module/media-text/media-container.js +3 -3
  237. package/build-module/media-text/media-container.js.map +1 -1
  238. package/build-module/media-text/save.js +1 -2
  239. package/build-module/media-text/save.js.map +1 -1
  240. package/build-module/navigation/constants.js +6 -0
  241. package/build-module/navigation/constants.js.map +1 -0
  242. package/build-module/navigation/edit/index.js +18 -27
  243. package/build-module/navigation/edit/index.js.map +1 -1
  244. package/build-module/navigation/edit/inner-blocks.js +2 -4
  245. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  246. package/build-module/navigation/edit/leaf-more-menu.js +132 -0
  247. package/build-module/navigation/edit/leaf-more-menu.js.map +1 -0
  248. package/build-module/navigation/edit/menu-inspector-controls.js +52 -9
  249. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  250. package/build-module/navigation/edit/navigation-menu-delete-control.js +7 -7
  251. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  252. package/build-module/navigation/edit/unsaved-inner-blocks.js +9 -20
  253. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  254. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  255. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  256. package/build-module/navigation/interactivity.js +154 -0
  257. package/build-module/navigation/interactivity.js.map +1 -0
  258. package/build-module/navigation-link/edit.js +7 -5
  259. package/build-module/navigation-link/edit.js.map +1 -1
  260. package/build-module/navigation-link/update-attributes.js +4 -4
  261. package/build-module/navigation-link/update-attributes.js.map +1 -1
  262. package/build-module/navigation-submenu/edit.js +7 -5
  263. package/build-module/navigation-submenu/edit.js.map +1 -1
  264. package/build-module/paragraph/index.js +5 -1
  265. package/build-module/paragraph/index.js.map +1 -1
  266. package/build-module/paragraph/transforms.js +5 -1
  267. package/build-module/paragraph/transforms.js.map +1 -1
  268. package/build-module/pattern/edit.js +42 -9
  269. package/build-module/pattern/edit.js.map +1 -1
  270. package/build-module/pattern/index.js +12 -3
  271. package/build-module/pattern/index.js.map +1 -1
  272. package/build-module/pattern/v1/edit.js +48 -0
  273. package/build-module/pattern/v1/edit.js.map +1 -0
  274. package/build-module/post-author-name/edit.js +1 -1
  275. package/build-module/post-author-name/edit.js.map +1 -1
  276. package/build-module/post-featured-image/edit.js +1 -2
  277. package/build-module/post-featured-image/edit.js.map +1 -1
  278. package/build-module/post-featured-image/overlay.js +5 -0
  279. package/build-module/post-featured-image/overlay.js.map +1 -1
  280. package/build-module/post-title/edit.js +23 -7
  281. package/build-module/post-title/edit.js.map +1 -1
  282. package/build-module/preformatted/edit.native.js +3 -2
  283. package/build-module/preformatted/edit.native.js.map +1 -1
  284. package/build-module/quote/transforms.js +23 -37
  285. package/build-module/quote/transforms.js.map +1 -1
  286. package/build-module/read-more/edit.js +1 -1
  287. package/build-module/read-more/edit.js.map +1 -1
  288. package/build-module/search/edit.js +9 -1
  289. package/build-module/search/edit.js.map +1 -1
  290. package/build-module/site-title/edit/index.js +1 -1
  291. package/build-module/site-title/edit/index.js.map +1 -1
  292. package/build-module/social-link/edit.js +20 -5
  293. package/build-module/social-link/edit.js.map +1 -1
  294. package/build-module/social-links/edit.js +2 -2
  295. package/build-module/social-links/edit.js.map +1 -1
  296. package/build-module/template-part/edit/index.js +1 -6
  297. package/build-module/template-part/edit/index.js.map +1 -1
  298. package/build-module/template-part/edit/utils/hooks.js +1 -1
  299. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  300. package/build-module/utils/interactivity/constants.js +2 -0
  301. package/build-module/utils/interactivity/constants.js.map +1 -0
  302. package/build-module/utils/interactivity/directives.js +220 -0
  303. package/build-module/utils/interactivity/directives.js.map +1 -0
  304. package/build-module/utils/interactivity/hooks.js +162 -0
  305. package/build-module/utils/interactivity/hooks.js.map +1 -0
  306. package/build-module/utils/interactivity/hydration.js +21 -0
  307. package/build-module/utils/interactivity/hydration.js.map +1 -0
  308. package/build-module/utils/interactivity/index.js +17 -0
  309. package/build-module/utils/interactivity/index.js.map +1 -0
  310. package/build-module/utils/interactivity/portals.js +100 -0
  311. package/build-module/utils/interactivity/portals.js.map +1 -0
  312. package/build-module/utils/interactivity/store.js +56 -0
  313. package/build-module/utils/interactivity/store.js.map +1 -0
  314. package/build-module/utils/interactivity/utils.js +75 -0
  315. package/build-module/utils/interactivity/utils.js.map +1 -0
  316. package/build-module/utils/interactivity/vdom.js +97 -0
  317. package/build-module/utils/interactivity/vdom.js.map +1 -0
  318. package/build-style/common-rtl.css +1 -1
  319. package/build-style/common.css +1 -1
  320. package/build-style/cover/style-rtl.css +3 -2
  321. package/build-style/cover/style.css +3 -2
  322. package/build-style/{details-summary → details}/editor-rtl.css +1 -1
  323. package/build-style/{details-summary → details}/editor.css +1 -1
  324. package/build-style/details/style-rtl.css +14 -0
  325. package/build-style/details/style.css +14 -0
  326. package/build-style/editor-rtl.css +71 -5
  327. package/build-style/editor.css +71 -5
  328. package/build-style/file/editor-rtl.css +3 -0
  329. package/build-style/file/editor.css +3 -0
  330. package/build-style/freeform/editor-rtl.css +29 -0
  331. package/build-style/freeform/editor.css +29 -0
  332. package/build-style/gallery/editor-rtl.css +0 -4
  333. package/build-style/gallery/editor.css +0 -4
  334. package/build-style/gallery/style-rtl.css +2 -4
  335. package/build-style/gallery/style.css +2 -4
  336. package/build-style/image/style-rtl.css +98 -0
  337. package/build-style/image/style.css +98 -0
  338. package/build-style/navigation/editor-rtl.css +36 -0
  339. package/build-style/navigation/editor.css +36 -0
  340. package/build-style/post-comments-form/style-rtl.css +1 -1
  341. package/build-style/post-comments-form/style.css +1 -1
  342. package/build-style/search/editor-rtl.css +1 -0
  343. package/build-style/search/editor.css +1 -0
  344. package/build-style/site-logo/editor-rtl.css +1 -0
  345. package/build-style/site-logo/editor.css +1 -0
  346. package/build-style/style-rtl.css +116 -10
  347. package/build-style/style.css +116 -10
  348. package/build-style/video/style-rtl.css +1 -2
  349. package/build-style/video/style.css +1 -2
  350. package/package.json +37 -33
  351. package/src/block/edit.native.js +18 -4
  352. package/src/buttons/test/edit.native.js +0 -9
  353. package/src/code/block.json +1 -0
  354. package/src/column/block.json +1 -1
  355. package/src/columns/test/__snapshots__/transforms.native.js.snap +1 -1
  356. package/src/columns/test/transforms.native.js +3 -5
  357. package/src/columns/transforms.js +2 -8
  358. package/src/comment-author-name/edit.js +1 -1
  359. package/src/comment-edit-link/edit.js +1 -1
  360. package/src/comment-template/index.php +8 -7
  361. package/src/comments/index.php +1 -6
  362. package/src/cover/block.json +1 -1
  363. package/src/cover/edit/inspector-controls.js +56 -54
  364. package/src/cover/edit/resizable-cover-popover.js +2 -1
  365. package/src/cover/style.scss +5 -0
  366. package/src/cover/test/edit.js +56 -2
  367. package/src/cover/variations.js +1 -3
  368. package/src/details/block.json +8 -6
  369. package/src/details/edit.js +27 -5
  370. package/src/details/editor.scss +3 -0
  371. package/src/details/index.js +10 -5
  372. package/src/details/save.js +5 -1
  373. package/src/details/style.scss +16 -0
  374. package/src/editor.scss +1 -1
  375. package/src/embed/variations.js +2 -2
  376. package/src/file/editor.scss +4 -0
  377. package/src/file/interactivity.js +15 -0
  378. package/src/file/view.js +4 -1
  379. package/src/freeform/editor.scss +45 -0
  380. package/src/freeform/modal.js +22 -19
  381. package/src/gallery/edit.js +5 -8
  382. package/src/gallery/editor.scss +0 -6
  383. package/src/gallery/test/index.native.js +48 -3
  384. package/src/gallery/v1/edit.js +1 -6
  385. package/src/gallery/v1/gallery-image.native.js +1 -2
  386. package/src/group/test/__snapshots__/transforms.native.js.snap +1 -1
  387. package/src/group/test/transforms.native.js +3 -5
  388. package/src/group/transforms.js +0 -7
  389. package/src/image/block.json +3 -0
  390. package/src/image/deprecated.js +2 -3
  391. package/src/image/edit.js +18 -18
  392. package/src/image/image.js +8 -11
  393. package/src/image/index.php +75 -2
  394. package/src/image/interactivity.js +113 -0
  395. package/src/image/save.js +4 -3
  396. package/src/image/style.scss +113 -0
  397. package/src/image/test/edit.native.js +38 -16
  398. package/src/image/utils.js +11 -18
  399. package/src/index.js +0 -4
  400. package/src/index.native.js +1 -0
  401. package/src/latest-posts/edit.native.js +1 -4
  402. package/src/list/edit.js +1 -1
  403. package/src/list/test/edit.native.js +80 -1
  404. package/src/list-item/edit.native.js +1 -1
  405. package/src/list-item/transforms.js +4 -2
  406. package/src/loginout/block.json +11 -1
  407. package/src/media-text/deprecated.js +4 -5
  408. package/src/media-text/edit.js +12 -10
  409. package/src/media-text/media-container.js +3 -3
  410. package/src/media-text/save.js +1 -2
  411. package/src/navigation/constants.js +21 -0
  412. package/src/navigation/edit/index.js +71 -83
  413. package/src/navigation/edit/inner-blocks.js +6 -16
  414. package/src/navigation/edit/leaf-more-menu.js +170 -0
  415. package/src/navigation/edit/menu-inspector-controls.js +78 -10
  416. package/src/navigation/edit/navigation-menu-delete-control.js +29 -29
  417. package/src/navigation/edit/unsaved-inner-blocks.js +12 -40
  418. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  419. package/src/navigation/editor.scss +10 -0
  420. package/src/navigation/index.php +213 -204
  421. package/src/navigation/interactivity.js +151 -0
  422. package/src/navigation-link/edit.js +9 -3
  423. package/src/navigation-link/update-attributes.js +2 -2
  424. package/src/navigation-submenu/edit.js +9 -3
  425. package/src/paragraph/block.json +5 -1
  426. package/src/pattern/block.json +4 -0
  427. package/src/pattern/edit.js +53 -16
  428. package/src/pattern/index.js +5 -4
  429. package/src/pattern/index.php +14 -1
  430. package/src/pattern/v1/edit.js +57 -0
  431. package/src/post-author-name/edit.js +1 -1
  432. package/src/post-comments-form/style.scss +3 -1
  433. package/src/post-featured-image/edit.js +1 -1
  434. package/src/post-featured-image/index.php +1 -1
  435. package/src/post-featured-image/overlay.js +4 -0
  436. package/src/post-terms/index.php +2 -2
  437. package/src/post-title/edit.js +57 -44
  438. package/src/preformatted/edit.native.js +1 -3
  439. package/src/quote/test/__snapshots__/transforms.native.js.snap +1 -1
  440. package/src/quote/test/transforms.native.js +3 -5
  441. package/src/quote/transforms.js +9 -19
  442. package/src/read-more/edit.js +1 -1
  443. package/src/search/edit.js +9 -4
  444. package/src/search/editor.scss +1 -0
  445. package/src/site-logo/editor.scss +2 -1
  446. package/src/site-title/edit/index.js +1 -1
  447. package/src/social-link/edit.js +51 -26
  448. package/src/social-links/edit.js +33 -31
  449. package/src/style.scss +0 -1
  450. package/src/template-part/edit/index.js +4 -6
  451. package/src/template-part/edit/utils/hooks.js +1 -1
  452. package/src/template-part/index.php +22 -7
  453. package/src/utils/interactivity/constants.js +1 -0
  454. package/src/utils/interactivity/directives.js +200 -0
  455. package/src/utils/interactivity/hooks.js +145 -0
  456. package/src/utils/interactivity/hydration.js +22 -0
  457. package/src/utils/interactivity/index.js +17 -0
  458. package/src/utils/interactivity/portals.js +98 -0
  459. package/src/utils/interactivity/store.js +45 -0
  460. package/src/utils/interactivity/utils.js +66 -0
  461. package/src/utils/interactivity/vdom.js +94 -0
  462. package/tsconfig.json +1 -0
  463. package/tsconfig.tsbuildinfo +1 -1
  464. package/build/details-content/edit.js +0 -34
  465. package/build/details-content/edit.js.map +0 -1
  466. package/build/details-content/index.js +0 -94
  467. package/build/details-content/index.js.map +0 -1
  468. package/build/details-content/save.js +0 -20
  469. package/build/details-content/save.js.map +0 -1
  470. package/build/details-summary/edit.js +0 -42
  471. package/build/details-summary/edit.js.map +0 -1
  472. package/build/details-summary/index.js +0 -97
  473. package/build/details-summary/index.js.map +0 -1
  474. package/build/details-summary/save.js +0 -24
  475. package/build/details-summary/save.js.map +0 -1
  476. package/build/file/utils.js.map +0 -1
  477. package/build-module/details-content/edit.js +0 -23
  478. package/build-module/details-content/edit.js.map +0 -1
  479. package/build-module/details-content/index.js +0 -76
  480. package/build-module/details-content/index.js.map +0 -1
  481. package/build-module/details-content/save.js +0 -11
  482. package/build-module/details-content/save.js.map +0 -1
  483. package/build-module/details-summary/edit.js +0 -30
  484. package/build-module/details-summary/edit.js.map +0 -1
  485. package/build-module/details-summary/index.js +0 -79
  486. package/build-module/details-summary/index.js.map +0 -1
  487. package/build-module/details-summary/save.js +0 -16
  488. package/build-module/details-summary/save.js.map +0 -1
  489. package/build-module/file/utils.js.map +0 -1
  490. package/build-style/details-summary/style-rtl.css +0 -91
  491. package/build-style/details-summary/style.css +0 -91
  492. package/src/details-content/block.json +0 -50
  493. package/src/details-content/edit.js +0 -29
  494. package/src/details-content/index.js +0 -23
  495. package/src/details-content/save.js +0 -12
  496. package/src/details-summary/block.json +0 -53
  497. package/src/details-summary/edit.js +0 -27
  498. package/src/details-summary/editor.scss +0 -3
  499. package/src/details-summary/index.js +0 -23
  500. package/src/details-summary/save.js +0 -13
  501. package/src/details-summary/style.scss +0 -3
  502. /package/src/file/{utils.js → utils/index.js} +0 -0
@@ -14,6 +14,7 @@
14
14
  * @return string Returns the block content with the data-id attribute added.
15
15
  */
16
16
  function render_block_core_image( $attributes, $content ) {
17
+
17
18
  $processor = new WP_HTML_Tag_Processor( $content );
18
19
  $processor->next_tag( 'img' );
19
20
 
@@ -27,16 +28,88 @@ function render_block_core_image( $attributes, $content ) {
27
28
  // which now wraps Image Blocks within innerBlocks.
28
29
  // The data-id attribute is added in a core/gallery `render_block_data` hook.
29
30
  $processor->set_attribute( 'data-id', $attributes['data-id'] );
31
+ }
32
+
33
+ $link_destination = isset( $attributes['linkDestination'] ) ? $attributes['linkDestination'] : 'none';
34
+
35
+ // Get the lightbox setting from the block attributes.
36
+ if ( isset( $attributes['behaviors']['lightbox'] ) ) {
37
+ $lightbox = $attributes['behaviors']['lightbox'];
38
+ // If the lightbox setting is not set in the block attributes, get it from the theme.json file.
39
+ } else {
40
+ $theme_data = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data()->get_data();
41
+ if ( isset( $theme_data['behaviors']['blocks']['core/image']['lightbox'] ) ) {
42
+ $lightbox = $theme_data['behaviors']['blocks']['core/image']['lightbox'];
43
+ } else {
44
+ $lightbox = false;
45
+ }
46
+ }
47
+
48
+ $experiments = get_option( 'gutenberg-experiments' );
49
+
50
+ if ( ! empty( $experiments['gutenberg-interactivity-api-core-blocks'] ) && 'none' === $link_destination && $lightbox ) {
51
+
52
+ $aria_label = 'Open image lightbox';
53
+ if ( $processor->get_attribute( 'alt' ) ) {
54
+ $aria_label .= ' : ' . $processor->get_attribute( 'alt' );
55
+ }
30
56
  $content = $processor->get_updated_html();
57
+
58
+ // Wrap the image in the body content with a button.
59
+ $img = null;
60
+ preg_match( '/<img[^>]+>/', $content, $img );
61
+ $button = '<div class="img-container">
62
+ <button aria-haspopup="dialog" aria-label="' . $aria_label . '" data-wp-on.click="actions.core.image.showLightbox"></button>'
63
+ . $img[0] .
64
+ '</div>';
65
+ $body_content = preg_replace( '/<img[^>]+>/', $button, $content );
66
+
67
+ // For the modal, set an ID on the image to be used for an aria-labelledby attribute.
68
+ $modal_content = new WP_HTML_Tag_Processor( $content );
69
+ $modal_content->next_tag( 'img' );
70
+ $image_lightbox_id = $modal_content->get_attribute( 'class' ) . '-lightbox';
71
+ $modal_content->set_attribute( 'id', $image_lightbox_id );
72
+ $modal_content = $modal_content->get_updated_html();
73
+
74
+ $background_color = wp_get_global_styles( array( 'color', 'background' ) );
75
+ $close_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="30" height="30" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg>';
76
+
77
+ return
78
+ <<<HTML
79
+ <div class="wp-lightbox-container"
80
+ data-wp-island
81
+ data-wp-context='{ "core": { "image": { "initialized": false, "lightboxEnabled": false } } }'>
82
+ $body_content
83
+ <div data-wp-body="" class="wp-lightbox-overlay"
84
+ data-wp-bind.role="selectors.core.image.roleAttribute"
85
+ aria-labelledby="$image_lightbox_id"
86
+ data-wp-class.initialized="context.core.image.initialized"
87
+ data-wp-class.active="context.core.image.lightboxEnabled"
88
+ data-wp-bind.aria-hidden="!context.core.image.lightboxEnabled"
89
+ data-wp-bind.aria-modal="context.core.image.lightboxEnabled"
90
+ data-wp-effect="effects.core.image.initLightbox"
91
+ data-wp-on.keydown="actions.core.image.handleKeydown"
92
+ data-wp-on.mousewheel="actions.core.image.hideLightbox"
93
+ data-wp-on.click="actions.core.image.hideLightbox"
94
+ >
95
+ <button aria-label="Close lightbox" class="close-button" data-wp-on.click="actions.core.image.hideLightbox">
96
+ $close_button_icon
97
+ </button>
98
+ $modal_content
99
+ <div class="scrim" style="background-color: $background_color"></div>
100
+ </div>
101
+ </div>
102
+ HTML;
31
103
  }
32
- return $content;
33
- }
34
104
 
105
+ return $processor->get_updated_html();
106
+ }
35
107
 
36
108
  /**
37
109
  * Registers the `core/image` block on server.
38
110
  */
39
111
  function register_block_core_image() {
112
+
40
113
  register_block_type_from_metadata(
41
114
  __DIR__ . '/image',
42
115
  array(
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { store } from '../utils/interactivity';
5
+
6
+ const focusableSelectors = [
7
+ 'a[href]',
8
+ 'area[href]',
9
+ 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',
10
+ 'select:not([disabled]):not([aria-hidden])',
11
+ 'textarea:not([disabled]):not([aria-hidden])',
12
+ 'button:not([disabled]):not([aria-hidden])',
13
+ 'iframe',
14
+ 'object',
15
+ 'embed',
16
+ '[contenteditable]',
17
+ '[tabindex]:not([tabindex^="-"])',
18
+ ];
19
+
20
+ store( {
21
+ actions: {
22
+ core: {
23
+ image: {
24
+ showLightbox: ( { context } ) => {
25
+ context.core.image.initialized = true;
26
+ context.core.image.lightboxEnabled = true;
27
+ context.core.image.lastFocusedElement =
28
+ window.document.activeElement;
29
+ context.core.image.scrollPosition = window.scrollY;
30
+ document.documentElement.classList.add(
31
+ 'has-lightbox-open'
32
+ );
33
+ },
34
+ hideLightbox: async ( { context, event } ) => {
35
+ if ( context.core.image.lightboxEnabled ) {
36
+ // If scrolling, wait a moment before closing the lightbox.
37
+ if (
38
+ event.type === 'mousewheel' &&
39
+ Math.abs(
40
+ window.scrollY -
41
+ context.core.image.scrollPosition
42
+ ) < 5
43
+ ) {
44
+ return;
45
+ }
46
+ document.documentElement.classList.remove(
47
+ 'has-lightbox-open'
48
+ );
49
+
50
+ context.core.image.lightboxEnabled = false;
51
+ context.core.image.lastFocusedElement.focus();
52
+ }
53
+ },
54
+ handleKeydown: ( { context, actions, event } ) => {
55
+ if ( context.core.image.lightboxEnabled ) {
56
+ if ( event.key === 'Tab' || event.keyCode === 9 ) {
57
+ // If shift + tab it change the direction
58
+ if (
59
+ event.shiftKey &&
60
+ window.document.activeElement ===
61
+ context.core.image.firstFocusableElement
62
+ ) {
63
+ event.preventDefault();
64
+ context.core.image.lastFocusableElement.focus();
65
+ } else if (
66
+ ! event.shiftKey &&
67
+ window.document.activeElement ===
68
+ context.core.image.lastFocusableElement
69
+ ) {
70
+ event.preventDefault();
71
+ context.core.image.firstFocusableElement.focus();
72
+ }
73
+ }
74
+
75
+ if ( event.key === 'Escape' || event.keyCode === 27 ) {
76
+ actions.core.image.hideLightbox( {
77
+ context,
78
+ event,
79
+ } );
80
+ }
81
+ }
82
+ },
83
+ },
84
+ },
85
+ },
86
+ selectors: {
87
+ core: {
88
+ image: {
89
+ roleAttribute: ( { context } ) => {
90
+ return context.core.image.lightboxEnabled ? 'dialog' : '';
91
+ },
92
+ },
93
+ },
94
+ },
95
+ effects: {
96
+ core: {
97
+ image: {
98
+ initLightbox: async ( { context, ref } ) => {
99
+ if ( context.core.image.lightboxEnabled ) {
100
+ const focusableElements =
101
+ ref.querySelectorAll( focusableSelectors );
102
+ context.core.image.firstFocusableElement =
103
+ focusableElements[ 0 ];
104
+ context.core.image.lastFocusableElement =
105
+ focusableElements[ focusableElements.length - 1 ];
106
+
107
+ ref.querySelector( '.close-button' ).focus();
108
+ }
109
+ },
110
+ },
111
+ },
112
+ },
113
+ } );
package/src/image/save.js CHANGED
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { isEmpty } from 'lodash';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -31,7 +30,7 @@ export default function save( { attributes } ) {
31
30
  title,
32
31
  } = attributes;
33
32
 
34
- const newRel = isEmpty( rel ) ? undefined : rel;
33
+ const newRel = ! rel ? undefined : rel;
35
34
  const borderProps = getBorderClassesAndStyles( attributes );
36
35
 
37
36
  const classes = classnames( {
@@ -39,7 +38,9 @@ export default function save( { attributes } ) {
39
38
  [ `size-${ sizeSlug }` ]: sizeSlug,
40
39
  'is-resized': width || height,
41
40
  'has-custom-border':
42
- !! borderProps.className || ! isEmpty( borderProps.style ),
41
+ !! borderProps.className ||
42
+ ( borderProps.style &&
43
+ Object.keys( borderProps.style ).length > 0 ),
43
44
  } );
44
45
 
45
46
  const imageClasses = classnames( borderProps.className, {
@@ -151,3 +151,116 @@
151
151
  .wp-block-image figure {
152
152
  margin: 0;
153
153
  }
154
+
155
+ .wp-lightbox-container {
156
+
157
+ .img-container {
158
+ position: relative;
159
+ }
160
+
161
+ button {
162
+ border: none;
163
+ background: none;
164
+ cursor: zoom-in;
165
+ width: 100%;
166
+ height: 100%;
167
+ position: absolute;
168
+ z-index: 100;
169
+
170
+ &:focus-visible {
171
+ outline: 5px auto #212121;
172
+ outline: 5px auto -webkit-focus-ring-color;
173
+ outline-offset: 5px;
174
+ }
175
+ }
176
+ }
177
+
178
+ .wp-lightbox-overlay {
179
+ position: fixed;
180
+ top: 0;
181
+ left: 0;
182
+ z-index: 100000;
183
+ overflow: hidden;
184
+ width: 100vw;
185
+ height: 100vh;
186
+ visibility: hidden;
187
+
188
+ .close-button {
189
+ font-size: 40px;
190
+ position: absolute;
191
+ top: 20px;
192
+ right: 20px;
193
+ cursor: pointer;
194
+ z-index: 5000000;
195
+ }
196
+
197
+ .wp-block-image {
198
+ display: flex;
199
+ justify-content: center;
200
+ align-items: center;
201
+ width: 100%;
202
+ height: 100%;
203
+ z-index: 3000000;
204
+ position: absolute;
205
+ flex-direction: column;
206
+ }
207
+
208
+ button {
209
+ border: none;
210
+ background: none;
211
+ }
212
+
213
+ .scrim {
214
+ width: 100%;
215
+ height: 100%;
216
+ position: absolute;
217
+ z-index: 2000000;
218
+ background-color: rgb(255, 255, 255);
219
+ opacity: 0.9;
220
+ }
221
+
222
+ &.initialized {
223
+ animation: both turn-off-visibility 300ms;
224
+
225
+ img {
226
+ animation: both turn-off-visibility 250ms;
227
+ }
228
+
229
+ &.active {
230
+ visibility: visible;
231
+ animation: both turn-on-visibility 250ms;
232
+
233
+ img {
234
+ animation: both turn-on-visibility 300ms;
235
+ }
236
+ }
237
+ }
238
+ }
239
+
240
+ @keyframes turn-on-visibility {
241
+ 0% {
242
+ opacity: 0;
243
+ }
244
+ 100% {
245
+ opacity: 1;
246
+ }
247
+ }
248
+
249
+ @keyframes turn-off-visibility {
250
+ 0% {
251
+ opacity: 1;
252
+ visibility: visible;
253
+ }
254
+ 99% {
255
+ opacity: 0;
256
+ visibility: visible;
257
+ }
258
+ 100% {
259
+ opacity: 0;
260
+ visibility: hidden;
261
+ }
262
+ }
263
+
264
+ html.has-lightbox-open {
265
+ overflow: hidden;
266
+ }
@@ -8,6 +8,7 @@ import {
8
8
  getEditorHtml,
9
9
  render,
10
10
  waitFor,
11
+ setupApiFetch,
11
12
  } from 'test/helpers';
12
13
  import { Image } from 'react-native';
13
14
  import Clipboard from '@react-native-clipboard/clipboard';
@@ -22,9 +23,10 @@ import {
22
23
  sendMediaUpload,
23
24
  subscribeMediaUpload,
24
25
  } from '@wordpress/react-native-bridge';
25
- import { select } from '@wordpress/data';
26
+ import { select, dispatch } from '@wordpress/data';
26
27
  import { store as editorStore } from '@wordpress/editor';
27
28
  import { store as coreStore } from '@wordpress/core-data';
29
+ import apiFetch from '@wordpress/api-fetch';
28
30
  import '@wordpress/jest-console';
29
31
 
30
32
  /**
@@ -45,7 +47,15 @@ function mockGetMedia( media ) {
45
47
  jest.spyOn( select( coreStore ), 'getMedia' ).mockReturnValue( media );
46
48
  }
47
49
 
48
- const apiFetchPromise = Promise.resolve( {} );
50
+ const FETCH_MEDIA = {
51
+ request: {
52
+ path: `/wp/v2/media/1?context=edit`,
53
+ },
54
+ response: {
55
+ source_url: 'https://cldup.com/cXyG__fTLN.jpg',
56
+ id: 1,
57
+ },
58
+ };
49
59
 
50
60
  const clipboardPromise = Promise.resolve( '' );
51
61
  Clipboard.getString.mockImplementation( () => clipboardPromise );
@@ -58,6 +68,18 @@ beforeAll( () => {
58
68
  getSizeSpy.mockImplementation( ( _url, callback ) => callback( 300, 200 ) );
59
69
  } );
60
70
 
71
+ beforeEach( () => {
72
+ // Mock media fetch requests
73
+ setupApiFetch( [ FETCH_MEDIA ] );
74
+
75
+ // Invalidate `getMedia` resolutions to allow requesting to the API the same media id
76
+ dispatch( coreStore ).invalidateResolutionForStoreSelector( 'getMedia' );
77
+ } );
78
+
79
+ afterEach( () => {
80
+ apiFetch.mockReset();
81
+ } );
82
+
61
83
  afterAll( () => {
62
84
  getBlockTypes().forEach( ( { name } ) => {
63
85
  unregisterBlockType( name );
@@ -78,8 +100,8 @@ describe( 'Image Block', () => {
78
100
  <figcaption class="wp-element-caption">Mountain</figcaption></figure>
79
101
  <!-- /wp:image -->`;
80
102
  const screen = await initializeEditor( { initialHtml } );
81
- // We must await the image fetch via `getMedia`
82
- await act( () => apiFetchPromise );
103
+ // Check that image is fetched via `getMedia`
104
+ expect( apiFetch ).toHaveBeenCalledWith( FETCH_MEDIA.request );
83
105
 
84
106
  const [ imageBlock ] = screen.getAllByLabelText( /Image Block/ );
85
107
  fireEvent.press( imageBlock );
@@ -105,8 +127,8 @@ describe( 'Image Block', () => {
105
127
  <figcaption class="wp-element-caption">Mountain</figcaption></figure>
106
128
  <!-- /wp:image -->`;
107
129
  const screen = await initializeEditor( { initialHtml } );
108
- // We must await the image fetch via `getMedia`
109
- await act( () => apiFetchPromise );
130
+ // Check that image is fetched via `getMedia`
131
+ expect( apiFetch ).toHaveBeenCalledWith( FETCH_MEDIA.request );
110
132
 
111
133
  const [ imageBlock ] = screen.getAllByLabelText( /Image Block/ );
112
134
  fireEvent.press( imageBlock );
@@ -132,8 +154,8 @@ describe( 'Image Block', () => {
132
154
  <figcaption class="wp-element-caption">Mountain</figcaption></figure>
133
155
  <!-- /wp:image -->`;
134
156
  const screen = await initializeEditor( { initialHtml } );
135
- // We must await the image fetch via `getMedia`
136
- await act( () => apiFetchPromise );
157
+ // Check that image is fetched via `getMedia`
158
+ expect( apiFetch ).toHaveBeenCalledWith( FETCH_MEDIA.request );
137
159
 
138
160
  const [ imageBlock ] = screen.getAllByLabelText( /Image Block/ );
139
161
  fireEvent.press( imageBlock );
@@ -169,8 +191,8 @@ describe( 'Image Block', () => {
169
191
  <figcaption class="wp-element-caption">Mountain</figcaption></figure>
170
192
  <!-- /wp:image -->`;
171
193
  const screen = await initializeEditor( { initialHtml } );
172
- // We must await the image fetch via `getMedia`
173
- await act( () => apiFetchPromise );
194
+ // Check that image is fetched via `getMedia`
195
+ expect( apiFetch ).toHaveBeenCalledWith( FETCH_MEDIA.request );
174
196
 
175
197
  const [ imageBlock ] = screen.getAllByLabelText( /Image Block/ );
176
198
  fireEvent.press( imageBlock );
@@ -211,8 +233,8 @@ describe( 'Image Block', () => {
211
233
  <figcaption class="wp-element-caption">Mountain</figcaption></figure>
212
234
  <!-- /wp:image -->`;
213
235
  const screen = await initializeEditor( { initialHtml } );
214
- // We must await the image fetch via `getMedia`
215
- await act( () => apiFetchPromise );
236
+ // Check that image is not fetched via `getMedia` due to the presence of query parameters in the URL.
237
+ expect( apiFetch ).not.toHaveBeenCalledWith( FETCH_MEDIA.request );
216
238
 
217
239
  const [ imageBlock ] = screen.getAllByLabelText( /Image Block/ );
218
240
  fireEvent.press( imageBlock );
@@ -236,8 +258,8 @@ describe( 'Image Block', () => {
236
258
  <figcaption class="wp-element-caption">Mountain</figcaption></figure>
237
259
  <!-- /wp:image -->`;
238
260
  const screen = await initializeEditor( { initialHtml } );
239
- // We must await the image fetch via `getMedia`
240
- await act( () => apiFetchPromise );
261
+ // Check that image is fetched via `getMedia`
262
+ expect( apiFetch ).toHaveBeenCalledWith( FETCH_MEDIA.request );
241
263
 
242
264
  const [ imageBlock ] = screen.getAllByLabelText( /Image Block/ );
243
265
  fireEvent.press( imageBlock );
@@ -267,8 +289,8 @@ describe( 'Image Block', () => {
267
289
  </figure>
268
290
  <!-- /wp:image -->`;
269
291
  const screen = await initializeEditor( { initialHtml } );
270
- // We must await the image fetch via `getMedia`
271
- await act( () => apiFetchPromise );
292
+ // Check that image is fetched via `getMedia`
293
+ expect( apiFetch ).toHaveBeenCalledWith( FETCH_MEDIA.request );
272
294
 
273
295
  const [ imageBlock ] = screen.getAllByLabelText( /Image Block/ );
274
296
  fireEvent.press( imageBlock );
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { isEmpty } from 'lodash';
5
-
6
1
  /**
7
2
  * Internal dependencies
8
3
  */
@@ -11,21 +6,19 @@ import { NEW_TAB_REL } from './constants';
11
6
  export function removeNewTabRel( currentRel ) {
12
7
  let newRel = currentRel;
13
8
 
14
- if ( currentRel !== undefined && ! isEmpty( newRel ) ) {
15
- if ( ! isEmpty( newRel ) ) {
16
- NEW_TAB_REL.forEach( ( relVal ) => {
17
- const regExp = new RegExp( '\\b' + relVal + '\\b', 'gi' );
18
- newRel = newRel.replace( regExp, '' );
19
- } );
9
+ if ( currentRel !== undefined && newRel ) {
10
+ NEW_TAB_REL.forEach( ( relVal ) => {
11
+ const regExp = new RegExp( '\\b' + relVal + '\\b', 'gi' );
12
+ newRel = newRel.replace( regExp, '' );
13
+ } );
20
14
 
21
- // Only trim if NEW_TAB_REL values was replaced.
22
- if ( newRel !== currentRel ) {
23
- newRel = newRel.trim();
24
- }
15
+ // Only trim if NEW_TAB_REL values was replaced.
16
+ if ( newRel !== currentRel ) {
17
+ newRel = newRel.trim();
18
+ }
25
19
 
26
- if ( isEmpty( newRel ) ) {
27
- newRel = undefined;
28
- }
20
+ if ( ! newRel ) {
21
+ newRel = undefined;
29
22
  }
30
23
  }
31
24
 
package/src/index.js CHANGED
@@ -46,8 +46,6 @@ import * as commentsPaginationNumbers from './comments-pagination-numbers';
46
46
  import * as commentsTitle from './comments-title';
47
47
  import * as cover from './cover';
48
48
  import * as details from './details';
49
- import * as detailsContent from './details-content';
50
- import * as detailsSummary from './details-summary';
51
49
  import * as embed from './embed';
52
50
  import * as file from './file';
53
51
  import * as gallery from './gallery';
@@ -230,8 +228,6 @@ const getAllBlocks = () => {
230
228
  ];
231
229
  if ( window?.__experimentalEnableDetailsBlocks ) {
232
230
  blocks.push( details );
233
- blocks.push( detailsContent );
234
- blocks.push( detailsSummary );
235
231
  }
236
232
  return blocks.filter( Boolean );
237
233
  };
@@ -88,6 +88,7 @@ export const coreBlocks = [
88
88
  column,
89
89
  cover,
90
90
  embed,
91
+ group,
91
92
  file,
92
93
  html,
93
94
  mediaText,
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { TouchableWithoutFeedback, View, Text } from 'react-native';
5
- import { isEmpty } from 'lodash';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -63,9 +62,7 @@ class LatestPostsEdit extends Component {
63
62
  .then( ( categoriesList ) => {
64
63
  if ( this.isStillMounted ) {
65
64
  this.setState( {
66
- categoriesList: isEmpty( categoriesList )
67
- ? []
68
- : categoriesList,
65
+ categoriesList,
69
66
  } );
70
67
  }
71
68
  } )
package/src/list/edit.js CHANGED
@@ -135,7 +135,7 @@ export default function Edit( { attributes, setAttributes, clientId, style } ) {
135
135
  ...( Platform.isNative && {
136
136
  marginVertical: NATIVE_MARGIN_SPACING,
137
137
  marginHorizontal: NATIVE_MARGIN_SPACING,
138
- useCompactList: true,
138
+ renderAppender: false,
139
139
  } ),
140
140
  } );
141
141
  useMigrateOnLoad( attributes, clientId );