@wordpress/block-library 8.13.0 → 8.14.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 (366) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/archives/index.js +5 -1
  3. package/build/archives/index.js.map +1 -1
  4. package/build/audio/index.js +5 -1
  5. package/build/audio/index.js.map +1 -1
  6. package/build/avatar/index.js +1 -1
  7. package/build/block/edit.js +1 -1
  8. package/build/block/edit.js.map +1 -1
  9. package/build/block/edit.native.js +6 -9
  10. package/build/block/edit.native.js.map +1 -1
  11. package/build/buttons/edit.js +5 -1
  12. package/build/buttons/edit.js.map +1 -1
  13. package/build/categories/index.js +5 -1
  14. package/build/categories/index.js.map +1 -1
  15. package/build/code/index.js +5 -1
  16. package/build/code/index.js.map +1 -1
  17. package/build/column/index.js +1 -0
  18. package/build/column/index.js.map +1 -1
  19. package/build/comments/index.js +1 -0
  20. package/build/comments/index.js.map +1 -1
  21. package/build/cover/edit/inspector-controls.js +2 -1
  22. package/build/cover/edit/inspector-controls.js.map +1 -1
  23. package/build/cover/index.js +1 -0
  24. package/build/cover/index.js.map +1 -1
  25. package/build/details/index.js +5 -1
  26. package/build/details/index.js.map +1 -1
  27. package/build/embed/util.js +9 -8
  28. package/build/embed/util.js.map +1 -1
  29. package/build/file/index.js +2 -1
  30. package/build/file/index.js.map +1 -1
  31. package/build/file/view.js +15 -1
  32. package/build/file/view.js.map +1 -1
  33. package/build/gallery/index.js +3 -1
  34. package/build/gallery/index.js.map +1 -1
  35. package/build/group/index.js +1 -0
  36. package/build/group/index.js.map +1 -1
  37. package/build/heading/index.js +5 -1
  38. package/build/heading/index.js.map +1 -1
  39. package/build/heading/transforms.js +5 -1
  40. package/build/heading/transforms.js.map +1 -1
  41. package/build/image/deprecated.js +453 -175
  42. package/build/image/deprecated.js.map +1 -1
  43. package/build/image/edit.js +0 -4
  44. package/build/image/edit.js.map +1 -1
  45. package/build/image/image.js +96 -43
  46. package/build/image/image.js.map +1 -1
  47. package/build/image/index.js +6 -0
  48. package/build/image/index.js.map +1 -1
  49. package/build/image/save.js +8 -1
  50. package/build/image/save.js.map +1 -1
  51. package/build/image/utils.js +18 -0
  52. package/build/image/utils.js.map +1 -1
  53. package/build/image/{interactivity.js → view-interactivity.js} +86 -44
  54. package/build/image/view-interactivity.js.map +1 -0
  55. package/build/index.js +12 -3
  56. package/build/index.js.map +1 -1
  57. package/build/list/index.js +5 -1
  58. package/build/list/index.js.map +1 -1
  59. package/build/list-item/utils.js +6 -1
  60. package/build/list-item/utils.js.map +1 -1
  61. package/build/media-text/index.js +1 -0
  62. package/build/media-text/index.js.map +1 -1
  63. package/build/missing/edit.js +22 -8
  64. package/build/missing/edit.js.map +1 -1
  65. package/build/navigation/edit/index.js +1 -1
  66. package/build/navigation/edit/index.js.map +1 -1
  67. package/build/navigation/edit/menu-inspector-controls.js +0 -1
  68. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  69. package/build/navigation/index.js +3 -2
  70. package/build/navigation/index.js.map +1 -1
  71. package/build/navigation/view.js +174 -50
  72. package/build/navigation/view.js.map +1 -1
  73. package/build/navigation-link/edit.js +0 -11
  74. package/build/navigation-link/edit.js.map +1 -1
  75. package/build/navigation-link/link-ui.js +12 -2
  76. package/build/navigation-link/link-ui.js.map +1 -1
  77. package/build/page-list/convert-to-links-modal.js +3 -3
  78. package/build/page-list/convert-to-links-modal.js.map +1 -1
  79. package/build/page-list/edit.js +34 -39
  80. package/build/page-list/edit.js.map +1 -1
  81. package/build/page-list/use-convert-to-navigation-links.js +2 -15
  82. package/build/page-list/use-convert-to-navigation-links.js.map +1 -1
  83. package/build/paragraph/index.js +1 -0
  84. package/build/paragraph/index.js.map +1 -1
  85. package/build/paragraph/transforms.js +1 -0
  86. package/build/paragraph/transforms.js.map +1 -1
  87. package/build/post-comments-form/index.js +1 -0
  88. package/build/post-comments-form/index.js.map +1 -1
  89. package/build/post-navigation-link/index.js +1 -0
  90. package/build/post-navigation-link/index.js.map +1 -1
  91. package/build/post-time-to-read/index.js +5 -1
  92. package/build/post-time-to-read/index.js.map +1 -1
  93. package/build/query-pagination-numbers/index.js +1 -1
  94. package/build/quote/index.js +1 -0
  95. package/build/quote/index.js.map +1 -1
  96. package/build/site-logo/index.js +5 -1
  97. package/build/site-logo/index.js.map +1 -1
  98. package/build/site-tagline/icon.js +1 -1
  99. package/build/site-tagline/icon.js.map +1 -1
  100. package/build/site-tagline/index.js +5 -1
  101. package/build/site-tagline/index.js.map +1 -1
  102. package/build/site-title/index.js +5 -1
  103. package/build/site-title/index.js.map +1 -1
  104. package/build/social-links/index.js +3 -1
  105. package/build/social-links/index.js.map +1 -1
  106. package/build/table/index.js +5 -1
  107. package/build/table/index.js.map +1 -1
  108. package/build/term-description/index.js +1 -0
  109. package/build/term-description/index.js.map +1 -1
  110. package/build/verse/index.js +5 -1
  111. package/build/verse/index.js.map +1 -1
  112. package/build/video/deprecated.js +5 -1
  113. package/build/video/deprecated.js.map +1 -1
  114. package/build/video/index.js +5 -1
  115. package/build/video/index.js.map +1 -1
  116. package/build-module/archives/index.js +5 -1
  117. package/build-module/archives/index.js.map +1 -1
  118. package/build-module/audio/index.js +5 -1
  119. package/build-module/audio/index.js.map +1 -1
  120. package/build-module/avatar/index.js +1 -1
  121. package/build-module/block/edit.js +1 -1
  122. package/build-module/block/edit.js.map +1 -1
  123. package/build-module/block/edit.native.js +7 -9
  124. package/build-module/block/edit.native.js.map +1 -1
  125. package/build-module/buttons/edit.js +5 -1
  126. package/build-module/buttons/edit.js.map +1 -1
  127. package/build-module/categories/index.js +5 -1
  128. package/build-module/categories/index.js.map +1 -1
  129. package/build-module/code/index.js +5 -1
  130. package/build-module/code/index.js.map +1 -1
  131. package/build-module/column/index.js +1 -0
  132. package/build-module/column/index.js.map +1 -1
  133. package/build-module/comments/index.js +1 -0
  134. package/build-module/comments/index.js.map +1 -1
  135. package/build-module/cover/edit/inspector-controls.js +2 -1
  136. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  137. package/build-module/cover/index.js +1 -0
  138. package/build-module/cover/index.js.map +1 -1
  139. package/build-module/details/index.js +5 -1
  140. package/build-module/details/index.js.map +1 -1
  141. package/build-module/embed/util.js +6 -6
  142. package/build-module/embed/util.js.map +1 -1
  143. package/build-module/file/index.js +2 -1
  144. package/build-module/file/index.js.map +1 -1
  145. package/build-module/file/view.js +15 -2
  146. package/build-module/file/view.js.map +1 -1
  147. package/build-module/gallery/index.js +3 -1
  148. package/build-module/gallery/index.js.map +1 -1
  149. package/build-module/group/index.js +1 -0
  150. package/build-module/group/index.js.map +1 -1
  151. package/build-module/heading/index.js +5 -1
  152. package/build-module/heading/index.js.map +1 -1
  153. package/build-module/heading/transforms.js +5 -1
  154. package/build-module/heading/transforms.js.map +1 -1
  155. package/build-module/image/deprecated.js +454 -176
  156. package/build-module/image/deprecated.js.map +1 -1
  157. package/build-module/image/edit.js +0 -4
  158. package/build-module/image/edit.js.map +1 -1
  159. package/build-module/image/image.js +96 -46
  160. package/build-module/image/image.js.map +1 -1
  161. package/build-module/image/index.js +6 -0
  162. package/build-module/image/index.js.map +1 -1
  163. package/build-module/image/save.js +8 -1
  164. package/build-module/image/save.js.map +1 -1
  165. package/build-module/image/utils.js +16 -0
  166. package/build-module/image/utils.js.map +1 -1
  167. package/build-module/image/{interactivity.js → view-interactivity.js} +86 -44
  168. package/build-module/image/view-interactivity.js.map +1 -0
  169. package/build-module/index.js +12 -3
  170. package/build-module/index.js.map +1 -1
  171. package/build-module/list/index.js +5 -1
  172. package/build-module/list/index.js.map +1 -1
  173. package/build-module/list-item/utils.js +6 -1
  174. package/build-module/list-item/utils.js.map +1 -1
  175. package/build-module/media-text/index.js +1 -0
  176. package/build-module/media-text/index.js.map +1 -1
  177. package/build-module/missing/edit.js +22 -8
  178. package/build-module/missing/edit.js.map +1 -1
  179. package/build-module/navigation/edit/index.js +1 -1
  180. package/build-module/navigation/edit/index.js.map +1 -1
  181. package/build-module/navigation/edit/menu-inspector-controls.js +0 -1
  182. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  183. package/build-module/navigation/index.js +3 -2
  184. package/build-module/navigation/index.js.map +1 -1
  185. package/build-module/navigation/view.js +173 -50
  186. package/build-module/navigation/view.js.map +1 -1
  187. package/build-module/navigation-link/edit.js +1 -12
  188. package/build-module/navigation-link/edit.js.map +1 -1
  189. package/build-module/navigation-link/link-ui.js +13 -3
  190. package/build-module/navigation-link/link-ui.js.map +1 -1
  191. package/build-module/page-list/convert-to-links-modal.js +3 -3
  192. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  193. package/build-module/page-list/edit.js +34 -39
  194. package/build-module/page-list/edit.js.map +1 -1
  195. package/build-module/page-list/use-convert-to-navigation-links.js +3 -16
  196. package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -1
  197. package/build-module/paragraph/index.js +1 -0
  198. package/build-module/paragraph/index.js.map +1 -1
  199. package/build-module/paragraph/transforms.js +1 -0
  200. package/build-module/paragraph/transforms.js.map +1 -1
  201. package/build-module/post-comments-form/index.js +1 -0
  202. package/build-module/post-comments-form/index.js.map +1 -1
  203. package/build-module/post-navigation-link/index.js +1 -0
  204. package/build-module/post-navigation-link/index.js.map +1 -1
  205. package/build-module/post-time-to-read/index.js +5 -1
  206. package/build-module/post-time-to-read/index.js.map +1 -1
  207. package/build-module/query-pagination-numbers/index.js +1 -1
  208. package/build-module/quote/index.js +1 -0
  209. package/build-module/quote/index.js.map +1 -1
  210. package/build-module/site-logo/index.js +5 -1
  211. package/build-module/site-logo/index.js.map +1 -1
  212. package/build-module/site-tagline/icon.js +1 -1
  213. package/build-module/site-tagline/icon.js.map +1 -1
  214. package/build-module/site-tagline/index.js +5 -1
  215. package/build-module/site-tagline/index.js.map +1 -1
  216. package/build-module/site-title/index.js +5 -1
  217. package/build-module/site-title/index.js.map +1 -1
  218. package/build-module/social-links/index.js +3 -1
  219. package/build-module/social-links/index.js.map +1 -1
  220. package/build-module/table/index.js +5 -1
  221. package/build-module/table/index.js.map +1 -1
  222. package/build-module/term-description/index.js +1 -0
  223. package/build-module/term-description/index.js.map +1 -1
  224. package/build-module/verse/index.js +5 -1
  225. package/build-module/verse/index.js.map +1 -1
  226. package/build-module/video/deprecated.js +5 -1
  227. package/build-module/video/deprecated.js.map +1 -1
  228. package/build-module/video/index.js +5 -1
  229. package/build-module/video/index.js.map +1 -1
  230. package/build-style/footnotes/style-rtl.css +2 -2
  231. package/build-style/footnotes/style.css +2 -2
  232. package/build-style/image/style-rtl.css +16 -2
  233. package/build-style/image/style.css +16 -2
  234. package/build-style/style-rtl.css +18 -4
  235. package/build-style/style.css +18 -4
  236. package/package.json +33 -38
  237. package/src/archives/block.json +5 -1
  238. package/src/audio/block.json +5 -1
  239. package/src/avatar/block.json +1 -1
  240. package/src/block/edit.js +2 -2
  241. package/src/block/edit.native.js +8 -12
  242. package/src/block/test/edit.native.js +4 -4
  243. package/src/buttons/edit.js +2 -2
  244. package/src/categories/block.json +5 -1
  245. package/src/code/block.json +5 -1
  246. package/src/column/block.json +1 -0
  247. package/src/comments/block.json +1 -0
  248. package/src/cover/block.json +1 -0
  249. package/src/cover/edit/inspector-controls.js +1 -0
  250. package/src/details/block.json +5 -1
  251. package/src/embed/util.js +4 -6
  252. package/src/file/block.json +2 -1
  253. package/src/file/index.php +0 -17
  254. package/src/file/view.js +14 -5
  255. package/src/footnotes/index.php +11 -9
  256. package/src/footnotes/style.scss +2 -2
  257. package/src/gallery/block.json +3 -1
  258. package/src/group/block.json +1 -0
  259. package/src/heading/block.json +5 -1
  260. package/src/heading/test/index.native.js +18 -0
  261. package/src/image/block.json +6 -0
  262. package/src/image/deprecated.js +597 -320
  263. package/src/image/edit.js +0 -4
  264. package/src/image/image.js +131 -62
  265. package/src/image/save.js +9 -1
  266. package/src/image/style.scss +15 -2
  267. package/src/image/utils.js +16 -0
  268. package/src/image/{interactivity.js → view-interactivity.js} +99 -50
  269. package/src/index.js +18 -1
  270. package/src/latest-posts/index.php +1 -1
  271. package/src/list/block.json +5 -1
  272. package/src/media-text/block.json +1 -0
  273. package/src/missing/edit.js +31 -11
  274. package/src/navigation/block.json +3 -2
  275. package/src/navigation/edit/index.js +1 -2
  276. package/src/navigation/edit/menu-inspector-controls.js +0 -1
  277. package/src/navigation/index.php +39 -30
  278. package/src/navigation/view.js +189 -67
  279. package/src/navigation-link/edit.js +1 -15
  280. package/src/navigation-link/link-ui.js +14 -2
  281. package/src/navigation-submenu/index.php +2 -12
  282. package/src/page-list/convert-to-links-modal.js +3 -3
  283. package/src/page-list/edit.js +65 -62
  284. package/src/page-list/use-convert-to-navigation-links.js +3 -20
  285. package/src/paragraph/block.json +1 -0
  286. package/src/post-comments-form/block.json +1 -0
  287. package/src/post-navigation-link/block.json +1 -0
  288. package/src/post-time-to-read/block.json +5 -1
  289. package/src/query-pagination-numbers/block.json +1 -1
  290. package/src/quote/block.json +1 -0
  291. package/src/site-logo/block.json +5 -1
  292. package/src/site-tagline/block.json +5 -1
  293. package/src/site-tagline/icon.js +1 -1
  294. package/src/site-title/block.json +5 -1
  295. package/src/social-links/block.json +3 -1
  296. package/src/table/block.json +5 -1
  297. package/src/term-description/block.json +1 -0
  298. package/src/verse/block.json +5 -1
  299. package/src/video/block.json +5 -1
  300. package/build/file/interactivity.js +0 -19
  301. package/build/file/interactivity.js.map +0 -1
  302. package/build/heading/heading-level-icon.js +0 -61
  303. package/build/heading/heading-level-icon.js.map +0 -1
  304. package/build/image/interactivity.js.map +0 -1
  305. package/build/navigation/interactivity.js +0 -167
  306. package/build/navigation/interactivity.js.map +0 -1
  307. package/build/navigation/view-modal.js +0 -64
  308. package/build/navigation/view-modal.js.map +0 -1
  309. package/build/utils/interactivity/constants.js +0 -9
  310. package/build/utils/interactivity/constants.js.map +0 -1
  311. package/build/utils/interactivity/directives.js +0 -222
  312. package/build/utils/interactivity/directives.js.map +0 -1
  313. package/build/utils/interactivity/hooks.js +0 -159
  314. package/build/utils/interactivity/hooks.js.map +0 -1
  315. package/build/utils/interactivity/hydration.js +0 -34
  316. package/build/utils/interactivity/hydration.js.map +0 -1
  317. package/build/utils/interactivity/index.js +0 -32
  318. package/build/utils/interactivity/index.js.map +0 -1
  319. package/build/utils/interactivity/portals.js +0 -108
  320. package/build/utils/interactivity/portals.js.map +0 -1
  321. package/build/utils/interactivity/store.js +0 -66
  322. package/build/utils/interactivity/store.js.map +0 -1
  323. package/build/utils/interactivity/utils.js +0 -87
  324. package/build/utils/interactivity/utils.js.map +0 -1
  325. package/build/utils/interactivity/vdom.js +0 -119
  326. package/build/utils/interactivity/vdom.js.map +0 -1
  327. package/build-module/file/interactivity.js +0 -15
  328. package/build-module/file/interactivity.js.map +0 -1
  329. package/build-module/heading/heading-level-icon.js +0 -53
  330. package/build-module/heading/heading-level-icon.js.map +0 -1
  331. package/build-module/image/interactivity.js.map +0 -1
  332. package/build-module/navigation/interactivity.js +0 -164
  333. package/build-module/navigation/interactivity.js.map +0 -1
  334. package/build-module/navigation/view-modal.js +0 -58
  335. package/build-module/navigation/view-modal.js.map +0 -1
  336. package/build-module/utils/interactivity/constants.js +0 -2
  337. package/build-module/utils/interactivity/constants.js.map +0 -1
  338. package/build-module/utils/interactivity/directives.js +0 -209
  339. package/build-module/utils/interactivity/directives.js.map +0 -1
  340. package/build-module/utils/interactivity/hooks.js +0 -145
  341. package/build-module/utils/interactivity/hooks.js.map +0 -1
  342. package/build-module/utils/interactivity/hydration.js +0 -21
  343. package/build-module/utils/interactivity/hydration.js.map +0 -1
  344. package/build-module/utils/interactivity/index.js +0 -15
  345. package/build-module/utils/interactivity/index.js.map +0 -1
  346. package/build-module/utils/interactivity/portals.js +0 -100
  347. package/build-module/utils/interactivity/portals.js.map +0 -1
  348. package/build-module/utils/interactivity/store.js +0 -55
  349. package/build-module/utils/interactivity/store.js.map +0 -1
  350. package/build-module/utils/interactivity/utils.js +0 -75
  351. package/build-module/utils/interactivity/utils.js.map +0 -1
  352. package/build-module/utils/interactivity/vdom.js +0 -107
  353. package/build-module/utils/interactivity/vdom.js.map +0 -1
  354. package/src/file/interactivity.js +0 -15
  355. package/src/heading/heading-level-icon.js +0 -48
  356. package/src/navigation/interactivity.js +0 -169
  357. package/src/navigation/view-modal.js +0 -78
  358. package/src/utils/interactivity/constants.js +0 -1
  359. package/src/utils/interactivity/directives.js +0 -200
  360. package/src/utils/interactivity/hooks.js +0 -145
  361. package/src/utils/interactivity/hydration.js +0 -22
  362. package/src/utils/interactivity/index.js +0 -15
  363. package/src/utils/interactivity/portals.js +0 -98
  364. package/src/utils/interactivity/store.js +0 -45
  365. package/src/utils/interactivity/utils.js +0 -66
  366. package/src/utils/interactivity/vdom.js +0 -111
@@ -132,12 +132,8 @@ export default function ReusableBlockEdit( {
132
132
  }
133
133
 
134
134
  const onConvertToRegularBlocks = useCallback( () => {
135
- const successNotice =
136
- innerBlockCount > 1
137
- ? /* translators: %s: name of the reusable block */
138
- __( '%s converted to regular blocks' )
139
- : /* translators: %s: name of the reusable block */
140
- __( '%s converted to regular block' );
135
+ /* translators: %s: name of the synced block */
136
+ const successNotice = __( '%s detached' );
141
137
  createSuccessNotice( sprintf( successNotice, title ) );
142
138
 
143
139
  clearSelectedBlock();
@@ -152,14 +148,14 @@ export default function ReusableBlockEdit( {
152
148
  ? sprintf(
153
149
  /* translators: %s: name of the host app (e.g. WordPress) */
154
150
  __(
155
- 'Editing reusable blocks is not yet supported on %s for Android'
151
+ 'Editing synced patterns is not yet supported on %s for Android'
156
152
  ),
157
153
  hostAppNamespace
158
154
  )
159
155
  : sprintf(
160
156
  /* translators: %s: name of the host app (e.g. WordPress) */
161
157
  __(
162
- 'Editing reusable blocks is not yet supported on %s for iOS'
158
+ 'Editing synced patterns is not yet supported on %s for iOS'
163
159
  ),
164
160
  hostAppNamespace
165
161
  );
@@ -182,17 +178,17 @@ export default function ReusableBlockEdit( {
182
178
  <Text style={ [ infoTextStyle, infoDescriptionStyle ] }>
183
179
  { innerBlockCount > 1
184
180
  ? __(
185
- 'Alternatively, you can detach and edit these blocks separately by tapping “Convert to regular blocks”.'
181
+ 'Alternatively, you can detach and edit these blocks separately by tapping “Detach patterns”.'
186
182
  )
187
183
  : __(
188
- 'Alternatively, you can detach and edit this block separately by tapping “Convert to regular block”.'
184
+ 'Alternatively, you can detach and edit this block separately by tapping “Detach pattern”.'
189
185
  ) }
190
186
  </Text>
191
187
  <TextControl
192
188
  label={
193
189
  innerBlockCount > 1
194
- ? __( 'Convert to regular blocks' )
195
- : __( 'Convert to regular block' )
190
+ ? __( 'Detach patterns' )
191
+ : __( 'Detach pattern' )
196
192
  }
197
193
  separatorType="topFullWidth"
198
194
  onPress={ onConvertToRegularBlocks }
@@ -56,8 +56,8 @@ afterAll( () => {
56
56
  } );
57
57
  } );
58
58
 
59
- describe( 'Reusable block', () => {
60
- it( 'inserts a reusable block', async () => {
59
+ describe( 'Synced patterns', () => {
60
+ it( 'inserts a synced pattern', async () => {
61
61
  // We have to use different ids because entities are cached in memory.
62
62
  const reusableBlockMock1 = getMockedReusableBlock( 1 );
63
63
  const reusableBlockMock2 = getMockedReusableBlock( 2 );
@@ -86,7 +86,7 @@ describe( 'Reusable block', () => {
86
86
  fireEvent.press( await screen.findByLabelText( 'Add block' ) );
87
87
 
88
88
  // Navigate to reusable tab.
89
- const reusableSegment = await screen.findByText( 'Reusable' );
89
+ const reusableSegment = await screen.findByText( 'Synced patterns' );
90
90
  // onLayout event is required by Segment component.
91
91
  fireEvent( reusableSegment, 'layout', {
92
92
  nativeEvent: {
@@ -98,7 +98,7 @@ describe( 'Reusable block', () => {
98
98
  fireEvent.press( reusableSegment );
99
99
 
100
100
  const reusableBlockList = screen.getByTestId(
101
- 'InserterUI-ReusableBlocks'
101
+ 'InserterUI-SyncedPatterns'
102
102
  );
103
103
  // onScroll event used to force the FlatList to render all items.
104
104
  fireEvent.scroll( reusableBlockList, {
@@ -36,7 +36,7 @@ const DEFAULT_BLOCK = {
36
36
  };
37
37
 
38
38
  function ButtonsEdit( { attributes, className } ) {
39
- const { fontSize, style } = attributes;
39
+ const { fontSize, layout, style } = attributes;
40
40
  const blockProps = useBlockProps( {
41
41
  className: classnames( className, {
42
42
  'has-custom-font-size': fontSize || style?.typography?.fontSize,
@@ -59,8 +59,8 @@ function ButtonsEdit( { attributes, className } ) {
59
59
  { className: preferredStyle && `is-style-${ preferredStyle }` },
60
60
  ],
61
61
  ],
62
-
63
62
  templateInsertUpdatesSelection: true,
63
+ orientation: layout?.orientation ?? 'horizontal',
64
64
  } );
65
65
 
66
66
  return <div { ...innerBlocksProps } />;
@@ -33,7 +33,11 @@
33
33
  "html": false,
34
34
  "spacing": {
35
35
  "margin": true,
36
- "padding": true
36
+ "padding": true,
37
+ "__experimentalDefaultControls": {
38
+ "margin": false,
39
+ "padding": false
40
+ }
37
41
  },
38
42
  "typography": {
39
43
  "fontSize": true,
@@ -31,7 +31,11 @@
31
31
  },
32
32
  "spacing": {
33
33
  "margin": [ "top", "bottom" ],
34
- "padding": true
34
+ "padding": true,
35
+ "__experimentalDefaultControls": {
36
+ "margin": false,
37
+ "padding": false
38
+ }
35
39
  },
36
40
  "__experimentalBorder": {
37
41
  "radius": true,
@@ -28,6 +28,7 @@
28
28
  "html": false,
29
29
  "color": {
30
30
  "gradients": true,
31
+ "heading": true,
31
32
  "link": true,
32
33
  "__experimentalDefaultControls": {
33
34
  "background": true,
@@ -21,6 +21,7 @@
21
21
  "html": false,
22
22
  "color": {
23
23
  "gradients": true,
24
+ "heading": true,
24
25
  "link": true,
25
26
  "__experimentalDefaultControls": {
26
27
  "background": true,
@@ -108,6 +108,7 @@
108
108
  },
109
109
  "color": {
110
110
  "__experimentalDuotone": "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
111
+ "heading": true,
111
112
  "text": true,
112
113
  "background": false,
113
114
  "__experimentalSkipSerialization": [ "gradients" ]
@@ -303,6 +303,7 @@ export default function CoverInspectorControls( {
303
303
  max={ 100 }
304
304
  step={ 10 }
305
305
  required
306
+ __next40pxDefaultSize
306
307
  />
307
308
  </ToolsPanelItem>
308
309
  </InspectorControls>
@@ -34,7 +34,11 @@
34
34
  "html": false,
35
35
  "spacing": {
36
36
  "margin": true,
37
- "padding": true
37
+ "padding": true,
38
+ "__experimentalDefaultControls": {
39
+ "margin": false,
40
+ "padding": false
41
+ }
38
42
  },
39
43
  "typography": {
40
44
  "fontSize": true,
package/src/embed/util.js CHANGED
@@ -1,18 +1,13 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { ASPECT_RATIOS, WP_EMBED_TYPE } from './constants';
5
-
6
1
  /**
7
2
  * External dependencies
8
3
  */
9
- import { kebabCase } from 'lodash';
10
4
  import classnames from 'classnames/dedupe';
11
5
  import memoize from 'memize';
12
6
 
13
7
  /**
14
8
  * WordPress dependencies
15
9
  */
10
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
16
11
  import { renderToString } from '@wordpress/element';
17
12
  import {
18
13
  createBlock,
@@ -24,8 +19,11 @@ import {
24
19
  * Internal dependencies
25
20
  */
26
21
  import metadata from './block.json';
22
+ import { ASPECT_RATIOS, WP_EMBED_TYPE } from './constants';
23
+ import { unlock } from '../lock-unlock';
27
24
 
28
25
  const { name: DEFAULT_EMBED_BLOCK } = metadata;
26
+ const { kebabCase } = unlock( blockEditorPrivateApis );
29
27
 
30
28
  /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
31
29
 
@@ -65,7 +65,8 @@
65
65
  "background": true,
66
66
  "link": true
67
67
  }
68
- }
68
+ },
69
+ "interactivity": true
69
70
  },
70
71
  "viewScript": "file:./view.min.js",
71
72
  "editorStyle": "wp-block-file-editor",
@@ -5,23 +5,6 @@
5
5
  * @package WordPress
6
6
  */
7
7
 
8
- if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
9
- /**
10
- * Replaces view script for the File block with version using Interactivity API.
11
- *
12
- * @param array $metadata Block metadata as read in via block.json.
13
- *
14
- * @return array Filtered block type metadata.
15
- */
16
- function gutenberg_block_core_file_update_interactive_view_script( $metadata ) {
17
- if ( 'core/file' === $metadata['name'] ) {
18
- $metadata['viewScript'] = array( 'file:./interactivity.min.js' );
19
- }
20
- return $metadata;
21
- }
22
- add_filter( 'block_type_metadata', 'gutenberg_block_core_file_update_interactive_view_script', 10, 1 );
23
- }
24
-
25
8
  /**
26
9
  * When the `core/file` block is rendering, check if we need to enqueue the `'wp-block-file-view` script.
27
10
  *
package/src/file/view.js CHANGED
@@ -1,9 +1,18 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store } from '@wordpress/interactivity';
1
5
  /**
2
6
  * Internal dependencies
3
7
  */
4
- import { hidePdfEmbedsOnUnsupportedBrowsers } from './utils';
8
+ import { browserSupportsPdfs as hasPdfPreview } from './utils';
5
9
 
6
- document.addEventListener(
7
- 'DOMContentLoaded',
8
- hidePdfEmbedsOnUnsupportedBrowsers
9
- );
10
+ store( {
11
+ selectors: {
12
+ core: {
13
+ file: {
14
+ hasPdfPreview,
15
+ },
16
+ },
17
+ },
18
+ } );
@@ -59,15 +59,17 @@ function render_block_core_footnotes( $attributes, $content, $block ) {
59
59
  * Registers the `core/footnotes` block on the server.
60
60
  */
61
61
  function register_block_core_footnotes() {
62
- register_post_meta(
63
- 'post',
64
- 'footnotes',
65
- array(
66
- 'show_in_rest' => true,
67
- 'single' => true,
68
- 'type' => 'string',
69
- )
70
- );
62
+ foreach ( array( 'post', 'page' ) as $post_type ) {
63
+ register_post_meta(
64
+ $post_type,
65
+ 'footnotes',
66
+ array(
67
+ 'show_in_rest' => true,
68
+ 'single' => true,
69
+ 'type' => 'string',
70
+ )
71
+ );
72
+ }
71
73
  register_block_type_from_metadata(
72
74
  __DIR__ . '/footnotes',
73
75
  array(
@@ -3,7 +3,7 @@
3
3
  counter-reset: footnotes;
4
4
  }
5
5
 
6
- .fn {
6
+ [data-fn].fn {
7
7
  vertical-align: super;
8
8
  font-size: smaller;
9
9
  counter-increment: footnotes;
@@ -11,7 +11,7 @@
11
11
  text-indent: -9999999px;
12
12
  }
13
13
 
14
- .fn::after {
14
+ [data-fn].fn::after {
15
15
  content: "[" counter(footnotes) "]";
16
16
  text-indent: 0;
17
17
  float: left;
@@ -115,7 +115,9 @@
115
115
  "blockGap": [ "horizontal", "vertical" ],
116
116
  "__experimentalSkipSerialization": [ "blockGap" ],
117
117
  "__experimentalDefaultControls": {
118
- "blockGap": true
118
+ "blockGap": true,
119
+ "margin": false,
120
+ "padding": false
119
121
  }
120
122
  },
121
123
  "color": {
@@ -29,6 +29,7 @@
29
29
  "html": false,
30
30
  "color": {
31
31
  "gradients": true,
32
+ "heading": true,
32
33
  "link": true,
33
34
  "__experimentalDefaultControls": {
34
35
  "background": true,
@@ -40,7 +40,11 @@
40
40
  },
41
41
  "spacing": {
42
42
  "margin": true,
43
- "padding": true
43
+ "padding": true,
44
+ "__experimentalDefaultControls": {
45
+ "margin": false,
46
+ "padding": false
47
+ }
44
48
  },
45
49
  "typography": {
46
50
  "fontSize": true,
@@ -112,4 +112,22 @@ describe( 'Heading block', () => {
112
112
  // Assert
113
113
  expect( getEditorHtml() ).toMatchSnapshot();
114
114
  } );
115
+
116
+ it( 'change level dropdown displays active selection', async () => {
117
+ // Arrange
118
+ const screen = await initializeEditor();
119
+ await addBlock( screen, 'Heading' );
120
+ const headingBlock = await getBlock( screen, 'Heading' );
121
+
122
+ // Act
123
+ fireEvent.press( headingBlock );
124
+ fireEvent.press( screen.getByLabelText( 'Change level' ) );
125
+
126
+ // Assert
127
+ expect(
128
+ within( screen.getByLabelText( 'Heading 2' ) ).getByTestId(
129
+ 'bottom-sheet-cell-selected-icon'
130
+ )
131
+ ).toBeVisible();
132
+ } );
115
133
  } );
@@ -69,6 +69,12 @@
69
69
  "height": {
70
70
  "type": "number"
71
71
  },
72
+ "aspectRatio": {
73
+ "type": "string"
74
+ },
75
+ "scale": {
76
+ "type": "string"
77
+ },
72
78
  "sizeSlug": {
73
79
  "type": "string"
74
80
  },