@wordpress/block-library 8.13.0 → 8.15.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 (549) hide show
  1. package/CHANGELOG.md +4 -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/edit.js +1 -0
  7. package/build/avatar/edit.js.map +1 -1
  8. package/build/avatar/index.js +1 -1
  9. package/build/block/edit.js +1 -1
  10. package/build/block/edit.js.map +1 -1
  11. package/build/block/edit.native.js +6 -9
  12. package/build/block/edit.native.js.map +1 -1
  13. package/build/block/index.js +2 -1
  14. package/build/block/index.js.map +1 -1
  15. package/build/buttons/edit.js +7 -3
  16. package/build/buttons/edit.js.map +1 -1
  17. package/build/categories/index.js +5 -1
  18. package/build/categories/index.js.map +1 -1
  19. package/build/code/index.js +5 -1
  20. package/build/code/index.js.map +1 -1
  21. package/build/column/edit.native.js +1 -4
  22. package/build/column/edit.native.js.map +1 -1
  23. package/build/column/index.js +1 -0
  24. package/build/column/index.js.map +1 -1
  25. package/build/columns/edit.js +1 -0
  26. package/build/columns/edit.js.map +1 -1
  27. package/build/comment-author-avatar/edit.js +1 -0
  28. package/build/comment-author-avatar/edit.js.map +1 -1
  29. package/build/comments/index.js +1 -0
  30. package/build/comments/index.js.map +1 -1
  31. package/build/cover/deprecated.js +4 -2
  32. package/build/cover/deprecated.js.map +1 -1
  33. package/build/cover/edit/inspector-controls.js +2 -1
  34. package/build/cover/edit/inspector-controls.js.map +1 -1
  35. package/build/cover/index.js +1 -0
  36. package/build/cover/index.js.map +1 -1
  37. package/build/details/index.js +5 -1
  38. package/build/details/index.js.map +1 -1
  39. package/build/embed/embed-placeholder.native.js +37 -13
  40. package/build/embed/embed-placeholder.native.js.map +1 -1
  41. package/build/embed/util.js +9 -8
  42. package/build/embed/util.js.map +1 -1
  43. package/build/file/inspector.js +1 -0
  44. package/build/file/inspector.js.map +1 -1
  45. package/build/file/{interactivity.js → view-interactivity.js} +6 -2
  46. package/build/file/view-interactivity.js.map +1 -0
  47. package/build/footnotes/edit.js +20 -1
  48. package/build/footnotes/edit.js.map +1 -1
  49. package/build/footnotes/format.js +19 -16
  50. package/build/footnotes/format.js.map +1 -1
  51. package/build/footnotes/index.js +0 -1
  52. package/build/footnotes/index.js.map +1 -1
  53. package/build/gallery/edit.js +1 -1
  54. package/build/gallery/edit.js.map +1 -1
  55. package/build/gallery/index.js +3 -1
  56. package/build/gallery/index.js.map +1 -1
  57. package/build/group/index.js +1 -0
  58. package/build/group/index.js.map +1 -1
  59. package/build/heading/index.js +5 -1
  60. package/build/heading/index.js.map +1 -1
  61. package/build/heading/transforms.js +5 -1
  62. package/build/heading/transforms.js.map +1 -1
  63. package/build/image/deprecated.js +453 -175
  64. package/build/image/deprecated.js.map +1 -1
  65. package/build/image/edit.js +0 -4
  66. package/build/image/edit.js.map +1 -1
  67. package/build/image/image.js +96 -43
  68. package/build/image/image.js.map +1 -1
  69. package/build/image/index.js +6 -0
  70. package/build/image/index.js.map +1 -1
  71. package/build/image/save.js +8 -1
  72. package/build/image/save.js.map +1 -1
  73. package/build/image/utils.js +18 -0
  74. package/build/image/utils.js.map +1 -1
  75. package/build/image/{interactivity.js → view-interactivity.js} +86 -44
  76. package/build/image/view-interactivity.js.map +1 -0
  77. package/build/index.js +12 -3
  78. package/build/index.js.map +1 -1
  79. package/build/latest-comments/edit.js +1 -0
  80. package/build/latest-comments/edit.js.map +1 -1
  81. package/build/latest-posts/edit.js +2 -0
  82. package/build/latest-posts/edit.js.map +1 -1
  83. package/build/list/edit.js +4 -4
  84. package/build/list/edit.js.map +1 -1
  85. package/build/list/index.js +5 -1
  86. package/build/list/index.js.map +1 -1
  87. package/build/list-item/utils.js +6 -1
  88. package/build/list-item/utils.js.map +1 -1
  89. package/build/media-text/index.js +1 -0
  90. package/build/media-text/index.js.map +1 -1
  91. package/build/media-text/media-container.native.js +2 -1
  92. package/build/media-text/media-container.native.js.map +1 -1
  93. package/build/missing/edit.js +22 -8
  94. package/build/missing/edit.js.map +1 -1
  95. package/build/missing/edit.native.js +7 -5
  96. package/build/missing/edit.native.js.map +1 -1
  97. package/build/navigation/constants.js +10 -4
  98. package/build/navigation/constants.js.map +1 -1
  99. package/build/navigation/edit/index.js +17 -3
  100. package/build/navigation/edit/index.js.map +1 -1
  101. package/build/navigation/edit/inner-blocks.js +2 -2
  102. package/build/navigation/edit/inner-blocks.js.map +1 -1
  103. package/build/navigation/edit/menu-inspector-controls.js +0 -1
  104. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  105. package/build/navigation/edit/unsaved-inner-blocks.js +2 -2
  106. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  107. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +10 -15
  108. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  109. package/build/navigation/use-navigation-menu.js +33 -45
  110. package/build/navigation/use-navigation-menu.js.map +1 -1
  111. package/build/navigation/view-interactivity.js +185 -0
  112. package/build/navigation/view-interactivity.js.map +1 -0
  113. package/build/navigation-link/edit.js +12 -18
  114. package/build/navigation-link/edit.js.map +1 -1
  115. package/build/navigation-link/link-ui.js +12 -2
  116. package/build/navigation-link/link-ui.js.map +1 -1
  117. package/build/navigation-submenu/edit.js +2 -2
  118. package/build/navigation-submenu/edit.js.map +1 -1
  119. package/build/page-list/convert-to-links-modal.js +3 -3
  120. package/build/page-list/convert-to-links-modal.js.map +1 -1
  121. package/build/page-list/edit.js +34 -39
  122. package/build/page-list/edit.js.map +1 -1
  123. package/build/page-list/use-convert-to-navigation-links.js +2 -15
  124. package/build/page-list/use-convert-to-navigation-links.js.map +1 -1
  125. package/build/paragraph/index.js +1 -0
  126. package/build/paragraph/index.js.map +1 -1
  127. package/build/paragraph/transforms.js +1 -0
  128. package/build/paragraph/transforms.js.map +1 -1
  129. package/build/post-comments-form/index.js +1 -0
  130. package/build/post-comments-form/index.js.map +1 -1
  131. package/build/post-navigation-link/index.js +1 -0
  132. package/build/post-navigation-link/index.js.map +1 -1
  133. package/build/post-time-to-read/index.js +5 -1
  134. package/build/post-time-to-read/index.js.map +1 -1
  135. package/build/query-pagination/edit.js +1 -1
  136. package/build/query-pagination/edit.js.map +1 -1
  137. package/build/query-pagination-numbers/index.js +1 -1
  138. package/build/query-title/edit.js +43 -1
  139. package/build/query-title/edit.js.map +1 -1
  140. package/build/quote/index.js +1 -0
  141. package/build/quote/index.js.map +1 -1
  142. package/build/quote/transforms.js +8 -0
  143. package/build/quote/transforms.js.map +1 -1
  144. package/build/rss/edit.js +3 -0
  145. package/build/rss/edit.js.map +1 -1
  146. package/build/search/edit.js +4 -3
  147. package/build/search/edit.js.map +1 -1
  148. package/build/search/index.js +1 -0
  149. package/build/search/index.js.map +1 -1
  150. package/build/site-logo/edit.js +1 -0
  151. package/build/site-logo/edit.js.map +1 -1
  152. package/build/site-logo/index.js +5 -1
  153. package/build/site-logo/index.js.map +1 -1
  154. package/build/site-tagline/icon.js +1 -1
  155. package/build/site-tagline/icon.js.map +1 -1
  156. package/build/site-tagline/index.js +5 -1
  157. package/build/site-tagline/index.js.map +1 -1
  158. package/build/site-title/index.js +5 -1
  159. package/build/site-title/index.js.map +1 -1
  160. package/build/social-links/index.js +3 -1
  161. package/build/social-links/index.js.map +1 -1
  162. package/build/table/index.js +5 -1
  163. package/build/table/index.js.map +1 -1
  164. package/build/tag-cloud/edit.js +1 -0
  165. package/build/tag-cloud/edit.js.map +1 -1
  166. package/build/template-part/edit/index.js +1 -1
  167. package/build/template-part/edit/index.js.map +1 -1
  168. package/build/term-description/index.js +1 -0
  169. package/build/term-description/index.js.map +1 -1
  170. package/build/text-columns/edit.js +1 -0
  171. package/build/text-columns/edit.js.map +1 -1
  172. package/build/verse/index.js +5 -1
  173. package/build/verse/index.js.map +1 -1
  174. package/build/video/deprecated.js +5 -1
  175. package/build/video/deprecated.js.map +1 -1
  176. package/build/video/index.js +5 -1
  177. package/build/video/index.js.map +1 -1
  178. package/build-module/archives/index.js +5 -1
  179. package/build-module/archives/index.js.map +1 -1
  180. package/build-module/audio/index.js +5 -1
  181. package/build-module/audio/index.js.map +1 -1
  182. package/build-module/avatar/edit.js +1 -0
  183. package/build-module/avatar/edit.js.map +1 -1
  184. package/build-module/avatar/index.js +1 -1
  185. package/build-module/block/edit.js +1 -1
  186. package/build-module/block/edit.js.map +1 -1
  187. package/build-module/block/edit.native.js +7 -9
  188. package/build-module/block/edit.native.js.map +1 -1
  189. package/build-module/block/index.js +2 -1
  190. package/build-module/block/index.js.map +1 -1
  191. package/build-module/buttons/edit.js +7 -3
  192. package/build-module/buttons/edit.js.map +1 -1
  193. package/build-module/categories/index.js +5 -1
  194. package/build-module/categories/index.js.map +1 -1
  195. package/build-module/code/index.js +5 -1
  196. package/build-module/code/index.js.map +1 -1
  197. package/build-module/column/edit.native.js +1 -4
  198. package/build-module/column/edit.native.js.map +1 -1
  199. package/build-module/column/index.js +1 -0
  200. package/build-module/column/index.js.map +1 -1
  201. package/build-module/columns/edit.js +1 -0
  202. package/build-module/columns/edit.js.map +1 -1
  203. package/build-module/comment-author-avatar/edit.js +1 -0
  204. package/build-module/comment-author-avatar/edit.js.map +1 -1
  205. package/build-module/comments/index.js +1 -0
  206. package/build-module/comments/index.js.map +1 -1
  207. package/build-module/cover/deprecated.js +4 -2
  208. package/build-module/cover/deprecated.js.map +1 -1
  209. package/build-module/cover/edit/inspector-controls.js +2 -1
  210. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  211. package/build-module/cover/index.js +1 -0
  212. package/build-module/cover/index.js.map +1 -1
  213. package/build-module/details/index.js +5 -1
  214. package/build-module/details/index.js.map +1 -1
  215. package/build-module/embed/embed-placeholder.native.js +37 -14
  216. package/build-module/embed/embed-placeholder.native.js.map +1 -1
  217. package/build-module/embed/util.js +6 -6
  218. package/build-module/embed/util.js.map +1 -1
  219. package/build-module/file/inspector.js +1 -0
  220. package/build-module/file/inspector.js.map +1 -1
  221. package/build-module/file/{interactivity.js → view-interactivity.js} +6 -2
  222. package/build-module/file/view-interactivity.js.map +1 -0
  223. package/build-module/footnotes/edit.js +18 -2
  224. package/build-module/footnotes/edit.js.map +1 -1
  225. package/build-module/footnotes/format.js +19 -16
  226. package/build-module/footnotes/format.js.map +1 -1
  227. package/build-module/footnotes/index.js +0 -1
  228. package/build-module/footnotes/index.js.map +1 -1
  229. package/build-module/gallery/edit.js +1 -1
  230. package/build-module/gallery/edit.js.map +1 -1
  231. package/build-module/gallery/index.js +3 -1
  232. package/build-module/gallery/index.js.map +1 -1
  233. package/build-module/group/index.js +1 -0
  234. package/build-module/group/index.js.map +1 -1
  235. package/build-module/heading/index.js +5 -1
  236. package/build-module/heading/index.js.map +1 -1
  237. package/build-module/heading/transforms.js +5 -1
  238. package/build-module/heading/transforms.js.map +1 -1
  239. package/build-module/image/deprecated.js +454 -176
  240. package/build-module/image/deprecated.js.map +1 -1
  241. package/build-module/image/edit.js +0 -4
  242. package/build-module/image/edit.js.map +1 -1
  243. package/build-module/image/image.js +96 -46
  244. package/build-module/image/image.js.map +1 -1
  245. package/build-module/image/index.js +6 -0
  246. package/build-module/image/index.js.map +1 -1
  247. package/build-module/image/save.js +8 -1
  248. package/build-module/image/save.js.map +1 -1
  249. package/build-module/image/utils.js +16 -0
  250. package/build-module/image/utils.js.map +1 -1
  251. package/build-module/image/{interactivity.js → view-interactivity.js} +86 -44
  252. package/build-module/image/view-interactivity.js.map +1 -0
  253. package/build-module/index.js +12 -3
  254. package/build-module/index.js.map +1 -1
  255. package/build-module/latest-comments/edit.js +1 -0
  256. package/build-module/latest-comments/edit.js.map +1 -1
  257. package/build-module/latest-posts/edit.js +2 -0
  258. package/build-module/latest-posts/edit.js.map +1 -1
  259. package/build-module/list/edit.js +4 -4
  260. package/build-module/list/edit.js.map +1 -1
  261. package/build-module/list/index.js +5 -1
  262. package/build-module/list/index.js.map +1 -1
  263. package/build-module/list-item/utils.js +6 -1
  264. package/build-module/list-item/utils.js.map +1 -1
  265. package/build-module/media-text/index.js +1 -0
  266. package/build-module/media-text/index.js.map +1 -1
  267. package/build-module/media-text/media-container.native.js +2 -1
  268. package/build-module/media-text/media-container.native.js.map +1 -1
  269. package/build-module/missing/edit.js +22 -8
  270. package/build-module/missing/edit.js.map +1 -1
  271. package/build-module/missing/edit.native.js +8 -6
  272. package/build-module/missing/edit.native.js.map +1 -1
  273. package/build-module/navigation/constants.js +8 -3
  274. package/build-module/navigation/constants.js.map +1 -1
  275. package/build-module/navigation/edit/index.js +18 -4
  276. package/build-module/navigation/edit/index.js.map +1 -1
  277. package/build-module/navigation/edit/inner-blocks.js +2 -2
  278. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  279. package/build-module/navigation/edit/menu-inspector-controls.js +0 -1
  280. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  281. package/build-module/navigation/edit/unsaved-inner-blocks.js +2 -2
  282. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  283. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +10 -14
  284. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  285. package/build-module/navigation/use-navigation-menu.js +35 -47
  286. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  287. package/build-module/navigation/view-interactivity.js +182 -0
  288. package/build-module/navigation/view-interactivity.js.map +1 -0
  289. package/build-module/navigation-link/edit.js +13 -19
  290. package/build-module/navigation-link/edit.js.map +1 -1
  291. package/build-module/navigation-link/link-ui.js +13 -3
  292. package/build-module/navigation-link/link-ui.js.map +1 -1
  293. package/build-module/navigation-submenu/edit.js +2 -2
  294. package/build-module/navigation-submenu/edit.js.map +1 -1
  295. package/build-module/page-list/convert-to-links-modal.js +3 -3
  296. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  297. package/build-module/page-list/edit.js +34 -39
  298. package/build-module/page-list/edit.js.map +1 -1
  299. package/build-module/page-list/use-convert-to-navigation-links.js +3 -16
  300. package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -1
  301. package/build-module/paragraph/index.js +1 -0
  302. package/build-module/paragraph/index.js.map +1 -1
  303. package/build-module/paragraph/transforms.js +1 -0
  304. package/build-module/paragraph/transforms.js.map +1 -1
  305. package/build-module/post-comments-form/index.js +1 -0
  306. package/build-module/post-comments-form/index.js.map +1 -1
  307. package/build-module/post-navigation-link/index.js +1 -0
  308. package/build-module/post-navigation-link/index.js.map +1 -1
  309. package/build-module/post-time-to-read/index.js +5 -1
  310. package/build-module/post-time-to-read/index.js.map +1 -1
  311. package/build-module/query-pagination/edit.js +1 -1
  312. package/build-module/query-pagination/edit.js.map +1 -1
  313. package/build-module/query-pagination-numbers/index.js +1 -1
  314. package/build-module/query-title/edit.js +44 -3
  315. package/build-module/query-title/edit.js.map +1 -1
  316. package/build-module/quote/index.js +1 -0
  317. package/build-module/quote/index.js.map +1 -1
  318. package/build-module/quote/transforms.js +8 -0
  319. package/build-module/quote/transforms.js.map +1 -1
  320. package/build-module/rss/edit.js +3 -0
  321. package/build-module/rss/edit.js.map +1 -1
  322. package/build-module/search/edit.js +4 -3
  323. package/build-module/search/edit.js.map +1 -1
  324. package/build-module/search/index.js +1 -0
  325. package/build-module/search/index.js.map +1 -1
  326. package/build-module/site-logo/edit.js +1 -0
  327. package/build-module/site-logo/edit.js.map +1 -1
  328. package/build-module/site-logo/index.js +5 -1
  329. package/build-module/site-logo/index.js.map +1 -1
  330. package/build-module/site-tagline/icon.js +1 -1
  331. package/build-module/site-tagline/icon.js.map +1 -1
  332. package/build-module/site-tagline/index.js +5 -1
  333. package/build-module/site-tagline/index.js.map +1 -1
  334. package/build-module/site-title/index.js +5 -1
  335. package/build-module/site-title/index.js.map +1 -1
  336. package/build-module/social-links/index.js +3 -1
  337. package/build-module/social-links/index.js.map +1 -1
  338. package/build-module/table/index.js +5 -1
  339. package/build-module/table/index.js.map +1 -1
  340. package/build-module/tag-cloud/edit.js +1 -0
  341. package/build-module/tag-cloud/edit.js.map +1 -1
  342. package/build-module/template-part/edit/index.js +1 -1
  343. package/build-module/template-part/edit/index.js.map +1 -1
  344. package/build-module/term-description/index.js +1 -0
  345. package/build-module/term-description/index.js.map +1 -1
  346. package/build-module/text-columns/edit.js +1 -0
  347. package/build-module/text-columns/edit.js.map +1 -1
  348. package/build-module/verse/index.js +5 -1
  349. package/build-module/verse/index.js.map +1 -1
  350. package/build-module/video/deprecated.js +5 -1
  351. package/build-module/video/deprecated.js.map +1 -1
  352. package/build-module/video/index.js +5 -1
  353. package/build-module/video/index.js.map +1 -1
  354. package/build-style/details/style-rtl.css +4 -2
  355. package/build-style/details/style.css +4 -2
  356. package/build-style/footnotes/style-rtl.css +4 -3
  357. package/build-style/footnotes/style.css +4 -3
  358. package/build-style/image/style-rtl.css +16 -2
  359. package/build-style/image/style.css +16 -2
  360. package/build-style/navigation/style-rtl.css +14 -2
  361. package/build-style/navigation/style.css +14 -2
  362. package/build-style/query-pagination/style-rtl.css +4 -2
  363. package/build-style/query-pagination/style.css +4 -2
  364. package/build-style/style-rtl.css +42 -11
  365. package/build-style/style.css +42 -11
  366. package/package.json +33 -37
  367. package/src/archives/block.json +5 -1
  368. package/src/audio/block.json +5 -1
  369. package/src/audio/test/__snapshots__/edit.native.js.snap +58 -33
  370. package/src/avatar/block.json +1 -1
  371. package/src/avatar/edit.js +1 -0
  372. package/src/block/block.json +2 -1
  373. package/src/block/edit.js +2 -2
  374. package/src/block/edit.native.js +8 -12
  375. package/src/block/editor.native.scss +2 -2
  376. package/src/block/test/edit.native.js +4 -4
  377. package/src/buttons/edit.js +4 -4
  378. package/src/categories/block.json +5 -1
  379. package/src/code/block.json +5 -1
  380. package/src/column/block.json +1 -0
  381. package/src/column/edit.native.js +4 -10
  382. package/src/column/editor.native.scss +0 -4
  383. package/src/columns/edit.js +1 -0
  384. package/src/comment-author-avatar/edit.js +1 -0
  385. package/src/comment-template/index.php +5 -2
  386. package/src/comments/block.json +1 -0
  387. package/src/cover/block.json +1 -0
  388. package/src/cover/deprecated.js +2 -0
  389. package/src/cover/edit/inspector-controls.js +1 -0
  390. package/src/details/block.json +5 -1
  391. package/src/embed/embed-placeholder.native.js +80 -47
  392. package/src/embed/styles.native.scss +54 -18
  393. package/src/embed/test/index.native.js +5 -5
  394. package/src/embed/util.js +4 -6
  395. package/src/file/index.php +4 -3
  396. package/src/file/inspector.js +1 -0
  397. package/src/file/test/__snapshots__/edit.native.js.snap +58 -33
  398. package/src/file/{interactivity.js → view-interactivity.js} +4 -1
  399. package/src/footnotes/block.json +0 -1
  400. package/src/footnotes/edit.js +21 -2
  401. package/src/footnotes/format.js +22 -20
  402. package/src/footnotes/index.php +11 -9
  403. package/src/footnotes/style.scss +6 -3
  404. package/src/gallery/block.json +3 -1
  405. package/src/gallery/edit.js +1 -1
  406. package/src/gallery/test/index.native.js +17 -16
  407. package/src/group/block.json +1 -0
  408. package/src/heading/block.json +5 -1
  409. package/src/heading/test/index.native.js +18 -0
  410. package/src/home-link/index.php +15 -2
  411. package/src/image/block.json +6 -0
  412. package/src/image/deprecated.js +597 -320
  413. package/src/image/edit.js +0 -4
  414. package/src/image/image.js +131 -62
  415. package/src/image/index.php +47 -8
  416. package/src/image/save.js +9 -1
  417. package/src/image/style.scss +15 -2
  418. package/src/image/test/edit.native.js +1 -1
  419. package/src/image/utils.js +16 -0
  420. package/src/image/{interactivity.js → view-interactivity.js} +99 -50
  421. package/src/index.js +18 -1
  422. package/src/latest-comments/edit.js +1 -0
  423. package/src/latest-posts/edit.js +2 -0
  424. package/src/latest-posts/index.php +1 -1
  425. package/src/list/block.json +5 -1
  426. package/src/list/edit.js +6 -4
  427. package/src/list/test/edit.native.js +129 -33
  428. package/src/media-text/block.json +1 -0
  429. package/src/media-text/media-container.native.js +1 -0
  430. package/src/missing/edit.js +31 -11
  431. package/src/missing/edit.native.js +12 -10
  432. package/src/missing/style.native.scss +19 -12
  433. package/src/missing/test/__snapshots__/edit.native.js.snap +21 -13
  434. package/src/navigation/constants.js +12 -6
  435. package/src/navigation/edit/index.js +30 -3
  436. package/src/navigation/edit/inner-blocks.js +2 -2
  437. package/src/navigation/edit/menu-inspector-controls.js +0 -1
  438. package/src/navigation/edit/unsaved-inner-blocks.js +2 -2
  439. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +17 -21
  440. package/src/navigation/index.php +43 -16
  441. package/src/navigation/style.scss +27 -8
  442. package/src/navigation/use-navigation-menu.js +39 -63
  443. package/src/navigation/view-interactivity.js +196 -0
  444. package/src/navigation-link/edit.js +61 -61
  445. package/src/navigation-link/link-ui.js +14 -2
  446. package/src/navigation-submenu/edit.js +2 -2
  447. package/src/navigation-submenu/index.php +2 -12
  448. package/src/page-list/convert-to-links-modal.js +3 -3
  449. package/src/page-list/edit.js +65 -62
  450. package/src/page-list/use-convert-to-navigation-links.js +3 -20
  451. package/src/paragraph/block.json +1 -0
  452. package/src/paragraph/test/__snapshots__/edit.native.js.snap +1 -0
  453. package/src/paragraph/test/edit.native.js +26 -0
  454. package/src/post-comments-form/block.json +1 -0
  455. package/src/post-navigation-link/block.json +1 -0
  456. package/src/post-template/index.php +4 -2
  457. package/src/post-time-to-read/block.json +5 -1
  458. package/src/post-title/index.php +6 -3
  459. package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -0
  460. package/src/query-pagination/edit.js +17 -14
  461. package/src/query-pagination-numbers/block.json +1 -1
  462. package/src/query-title/edit.js +48 -6
  463. package/src/quote/block.json +1 -0
  464. package/src/quote/test/__snapshots__/transforms.native.js.snap +10 -0
  465. package/src/quote/test/transforms.native.js +5 -1
  466. package/src/quote/transforms.js +13 -0
  467. package/src/rss/edit.js +3 -0
  468. package/src/search/block.json +1 -0
  469. package/src/search/edit.js +4 -3
  470. package/src/search/index.php +22 -4
  471. package/src/search/test/__snapshots__/edit.native.js.snap +7 -0
  472. package/src/site-logo/block.json +5 -1
  473. package/src/site-logo/edit.js +1 -0
  474. package/src/site-tagline/block.json +5 -1
  475. package/src/site-tagline/icon.js +1 -1
  476. package/src/site-title/block.json +5 -1
  477. package/src/social-links/block.json +3 -1
  478. package/src/table/block.json +5 -1
  479. package/src/tag-cloud/edit.js +1 -0
  480. package/src/template-part/edit/index.js +1 -1
  481. package/src/template-part/index.php +9 -15
  482. package/src/term-description/block.json +1 -0
  483. package/src/text-columns/edit.js +1 -0
  484. package/src/verse/block.json +5 -1
  485. package/src/video/block.json +5 -1
  486. package/build/file/interactivity.js.map +0 -1
  487. package/build/gallery/shared-icon.native.js +0 -38
  488. package/build/gallery/shared-icon.native.js.map +0 -1
  489. package/build/heading/heading-level-icon.js +0 -61
  490. package/build/heading/heading-level-icon.js.map +0 -1
  491. package/build/image/interactivity.js.map +0 -1
  492. package/build/navigation/interactivity.js +0 -167
  493. package/build/navigation/interactivity.js.map +0 -1
  494. package/build/utils/interactivity/constants.js +0 -9
  495. package/build/utils/interactivity/constants.js.map +0 -1
  496. package/build/utils/interactivity/directives.js +0 -222
  497. package/build/utils/interactivity/directives.js.map +0 -1
  498. package/build/utils/interactivity/hooks.js +0 -159
  499. package/build/utils/interactivity/hooks.js.map +0 -1
  500. package/build/utils/interactivity/hydration.js +0 -34
  501. package/build/utils/interactivity/hydration.js.map +0 -1
  502. package/build/utils/interactivity/index.js +0 -32
  503. package/build/utils/interactivity/index.js.map +0 -1
  504. package/build/utils/interactivity/portals.js +0 -108
  505. package/build/utils/interactivity/portals.js.map +0 -1
  506. package/build/utils/interactivity/store.js +0 -66
  507. package/build/utils/interactivity/store.js.map +0 -1
  508. package/build/utils/interactivity/utils.js +0 -87
  509. package/build/utils/interactivity/utils.js.map +0 -1
  510. package/build/utils/interactivity/vdom.js +0 -119
  511. package/build/utils/interactivity/vdom.js.map +0 -1
  512. package/build-module/file/interactivity.js.map +0 -1
  513. package/build-module/gallery/shared-icon.native.js +0 -24
  514. package/build-module/gallery/shared-icon.native.js.map +0 -1
  515. package/build-module/heading/heading-level-icon.js +0 -53
  516. package/build-module/heading/heading-level-icon.js.map +0 -1
  517. package/build-module/image/interactivity.js.map +0 -1
  518. package/build-module/navigation/interactivity.js +0 -164
  519. package/build-module/navigation/interactivity.js.map +0 -1
  520. package/build-module/utils/interactivity/constants.js +0 -2
  521. package/build-module/utils/interactivity/constants.js.map +0 -1
  522. package/build-module/utils/interactivity/directives.js +0 -209
  523. package/build-module/utils/interactivity/directives.js.map +0 -1
  524. package/build-module/utils/interactivity/hooks.js +0 -145
  525. package/build-module/utils/interactivity/hooks.js.map +0 -1
  526. package/build-module/utils/interactivity/hydration.js +0 -21
  527. package/build-module/utils/interactivity/hydration.js.map +0 -1
  528. package/build-module/utils/interactivity/index.js +0 -15
  529. package/build-module/utils/interactivity/index.js.map +0 -1
  530. package/build-module/utils/interactivity/portals.js +0 -100
  531. package/build-module/utils/interactivity/portals.js.map +0 -1
  532. package/build-module/utils/interactivity/store.js +0 -55
  533. package/build-module/utils/interactivity/store.js.map +0 -1
  534. package/build-module/utils/interactivity/utils.js +0 -75
  535. package/build-module/utils/interactivity/utils.js.map +0 -1
  536. package/build-module/utils/interactivity/vdom.js +0 -107
  537. package/build-module/utils/interactivity/vdom.js.map +0 -1
  538. package/src/gallery/shared-icon.native.js +0 -23
  539. package/src/heading/heading-level-icon.js +0 -48
  540. package/src/navigation/interactivity.js +0 -169
  541. package/src/utils/interactivity/constants.js +0 -1
  542. package/src/utils/interactivity/directives.js +0 -200
  543. package/src/utils/interactivity/hooks.js +0 -145
  544. package/src/utils/interactivity/hydration.js +0 -22
  545. package/src/utils/interactivity/index.js +0 -15
  546. package/src/utils/interactivity/portals.js +0 -98
  547. package/src/utils/interactivity/store.js +0 -45
  548. package/src/utils/interactivity/utils.js +0 -66
  549. package/src/utils/interactivity/vdom.js +0 -111
@@ -169,12 +169,6 @@ export default function PageListEdit( {
169
169
  }, new Map() );
170
170
  }, [ pages ] );
171
171
 
172
- const convertToNavigationLinks = useConvertToNavigationLinks( {
173
- clientId,
174
- pages,
175
- parentPageID,
176
- } );
177
-
178
172
  const blockProps = useBlockProps( {
179
173
  className: classnames( 'wp-block-page-list', {
180
174
  'has-text-color': !! context.textColor,
@@ -189,68 +183,71 @@ export default function PageListEdit( {
189
183
  style: { ...context.style?.color },
190
184
  } );
191
185
 
192
- const getBlockList = ( parentId = parentPageID ) => {
193
- const childPages = pagesByParentId.get( parentId );
186
+ const pagesTree = useMemo(
187
+ function makePagesTree( parentId = 0, level = 0 ) {
188
+ const childPages = pagesByParentId.get( parentId );
194
189
 
195
- if ( ! childPages?.length ) {
196
- return [];
197
- }
198
-
199
- return childPages.reduce( ( template, page ) => {
200
- const hasChildren = pagesByParentId.has( page.id );
201
- const pageProps = {
202
- id: page.id,
203
- label:
204
- // translators: displayed when a page has an empty title.
205
- page.title?.rendered?.trim() !== ''
206
- ? page.title?.rendered
207
- : __( '(no title)' ),
208
- title: page.title?.rendered,
209
- link: page.url,
210
- hasChildren,
211
- };
212
- let item = null;
213
- const children = getBlockList( page.id );
214
- item = createBlock( 'core/page-list-item', pageProps, children );
215
- template.push( item );
216
-
217
- return template;
218
- }, [] );
219
- };
190
+ if ( ! childPages?.length ) {
191
+ return [];
192
+ }
220
193
 
221
- const makePagesTree = ( parentId = 0, level = 0 ) => {
222
- const childPages = pagesByParentId.get( parentId );
194
+ return childPages.reduce( ( tree, page ) => {
195
+ const hasChildren = pagesByParentId.has( page.id );
196
+ const item = {
197
+ value: page.id,
198
+ label: '— '.repeat( level ) + page.title.rendered,
199
+ rawName: page.title.rendered,
200
+ };
201
+ tree.push( item );
202
+ if ( hasChildren ) {
203
+ tree.push( ...makePagesTree( page.id, level + 1 ) );
204
+ }
205
+ return tree;
206
+ }, [] );
207
+ },
208
+ [ pagesByParentId ]
209
+ );
223
210
 
224
- if ( ! childPages?.length ) {
225
- return [];
226
- }
211
+ const blockList = useMemo(
212
+ function getBlockList( parentId = parentPageID ) {
213
+ const childPages = pagesByParentId.get( parentId );
227
214
 
228
- return childPages.reduce( ( tree, page ) => {
229
- const hasChildren = pagesByParentId.has( page.id );
230
- const item = {
231
- value: page.id,
232
- label: '— '.repeat( level ) + page.title.rendered,
233
- rawName: page.title.rendered,
234
- };
235
- tree.push( item );
236
- if ( hasChildren ) {
237
- tree.push( ...makePagesTree( page.id, level + 1 ) );
215
+ if ( ! childPages?.length ) {
216
+ return [];
238
217
  }
239
- return tree;
240
- }, [] );
241
- };
242
218
 
243
- const pagesTree = useMemo( makePagesTree, [ pagesByParentId ] );
244
-
245
- const blockList = useMemo( getBlockList, [
246
- pagesByParentId,
247
- parentPageID,
248
- ] );
219
+ return childPages.reduce( ( template, page ) => {
220
+ const hasChildren = pagesByParentId.has( page.id );
221
+ const pageProps = {
222
+ id: page.id,
223
+ label:
224
+ // translators: displayed when a page has an empty title.
225
+ page.title?.rendered?.trim() !== ''
226
+ ? page.title?.rendered
227
+ : __( '(no title)' ),
228
+ title: page.title?.rendered,
229
+ link: page.url,
230
+ hasChildren,
231
+ };
232
+ let item = null;
233
+ const children = getBlockList( page.id );
234
+ item = createBlock(
235
+ 'core/page-list-item',
236
+ pageProps,
237
+ children
238
+ );
239
+ template.push( item );
240
+
241
+ return template;
242
+ }, [] );
243
+ },
244
+ [ pagesByParentId, parentPageID ]
245
+ );
249
246
 
250
247
  const {
251
248
  isNested,
252
249
  hasSelectedChild,
253
- parentBlock,
250
+ parentClientId,
254
251
  hasDraggedChild,
255
252
  isChildOfNavigation,
256
253
  } = useSelect(
@@ -258,7 +255,6 @@ export default function PageListEdit( {
258
255
  const {
259
256
  getBlockParentsByBlockName,
260
257
  hasSelectedInnerBlock,
261
- getBlockRootClientId,
262
258
  hasDraggedInnerBlock,
263
259
  } = select( blockEditorStore );
264
260
  const blockParents = getBlockParentsByBlockName(
@@ -276,12 +272,19 @@ export default function PageListEdit( {
276
272
  isChildOfNavigation: navigationBlockParents.length > 0,
277
273
  hasSelectedChild: hasSelectedInnerBlock( clientId, true ),
278
274
  hasDraggedChild: hasDraggedInnerBlock( clientId, true ),
279
- parentBlock: getBlockRootClientId( clientId ),
275
+ parentClientId: navigationBlockParents[ 0 ],
280
276
  };
281
277
  },
282
278
  [ clientId ]
283
279
  );
284
280
 
281
+ const convertToNavigationLinks = useConvertToNavigationLinks( {
282
+ clientId,
283
+ pages,
284
+ parentClientId,
285
+ parentPageID,
286
+ } );
287
+
285
288
  const innerBlocksProps = useInnerBlocksProps( blockProps, {
286
289
  allowedBlocks: [ 'core/page-list-item' ],
287
290
  renderAppender: false,
@@ -297,12 +300,12 @@ export default function PageListEdit( {
297
300
  useEffect( () => {
298
301
  if ( hasSelectedChild || hasDraggedChild ) {
299
302
  openModal();
300
- selectBlock( parentBlock );
303
+ selectBlock( parentClientId );
301
304
  }
302
305
  }, [
303
306
  hasSelectedChild,
304
307
  hasDraggedChild,
305
- parentBlock,
308
+ parentClientId,
306
309
  selectBlock,
307
310
  openModal,
308
311
  ] );
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { createBlock } from '@wordpress/blocks';
5
- import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { useDispatch } from '@wordpress/data';
6
6
  import { store as blockEditorStore } from '@wordpress/block-editor';
7
7
 
8
8
  /**
@@ -116,28 +116,11 @@ export function convertToNavigationLinks( pages = [], parentPageID = null ) {
116
116
  export function useConvertToNavigationLinks( {
117
117
  clientId,
118
118
  pages,
119
+ parentClientId,
119
120
  parentPageID,
120
121
  } ) {
121
122
  const { replaceBlock, selectBlock } = useDispatch( blockEditorStore );
122
123
 
123
- const { parentNavBlockClientId } = useSelect(
124
- ( select ) => {
125
- const { getSelectedBlockClientId, getBlockParentsByBlockName } =
126
- select( blockEditorStore );
127
-
128
- const _selectedBlockClientId = getSelectedBlockClientId();
129
-
130
- return {
131
- parentNavBlockClientId: getBlockParentsByBlockName(
132
- _selectedBlockClientId,
133
- 'core/navigation',
134
- true
135
- )[ 0 ],
136
- };
137
- },
138
- [ clientId ]
139
- );
140
-
141
124
  return () => {
142
125
  const navigationLinks = convertToNavigationLinks( pages, parentPageID );
143
126
 
@@ -145,6 +128,6 @@ export function useConvertToNavigationLinks( {
145
128
  replaceBlock( clientId, navigationLinks );
146
129
 
147
130
  // Select the Navigation block to reveal the changes.
148
- selectBlock( parentNavBlockClientId );
131
+ selectBlock( parentClientId );
149
132
  };
150
133
  }
@@ -58,6 +58,7 @@
58
58
  "__experimentalFontWeight": true,
59
59
  "__experimentalLetterSpacing": true,
60
60
  "__experimentalTextTransform": true,
61
+ "__experimentalWritingMode": true,
61
62
  "__experimentalDefaultControls": {
62
63
  "fontSize": true
63
64
  }
@@ -32,6 +32,7 @@ exports[`Paragraph block should render without crashing and match snapshot 1`] =
32
32
  onSelectionChange={[Function]}
33
33
  placeholder="Start writing…"
34
34
  placeholderTextColor="gray"
35
+ selectionColor="black"
35
36
  triggerKeyCodes={[]}
36
37
  value=""
37
38
  />
@@ -639,4 +639,30 @@ describe( 'Paragraph block', () => {
639
639
  );
640
640
  expect( contrastCheckElement ).toBeDefined();
641
641
  } );
642
+
643
+ it( 'should highlight text with selection', async () => {
644
+ // Arrange
645
+ const screen = await initializeEditor( { withGlobalStyles: true } );
646
+ await addBlock( screen, 'Paragraph' );
647
+
648
+ // Act
649
+ const paragraphBlock = getBlock( screen, 'Paragraph' );
650
+ fireEvent.press( paragraphBlock );
651
+ const paragraphTextInput =
652
+ within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
653
+ typeInRichText(
654
+ paragraphTextInput,
655
+ 'A quick brown fox jumps over the lazy dog.',
656
+ { finalSelectionStart: 2, finalSelectionEnd: 7 }
657
+ );
658
+ fireEvent.press( screen.getByLabelText( 'Text color' ) );
659
+ fireEvent.press( await screen.findByLabelText( 'Tertiary' ) );
660
+
661
+ // Assert
662
+ expect( getEditorHtml() ).toMatchInlineSnapshot( `
663
+ "<!-- wp:paragraph -->
664
+ <p>A <mark style="background-color:rgba(0, 0, 0, 0);color:#2411a4" class="has-inline-color has-tertiary-color">quick</mark> brown fox jumps over the lazy dog.</p>
665
+ <!-- /wp:paragraph -->"
666
+ ` );
667
+ } );
642
668
  } );
@@ -16,6 +16,7 @@
16
16
  "html": false,
17
17
  "color": {
18
18
  "gradients": true,
19
+ "heading": true,
19
20
  "link": true,
20
21
  "__experimentalDefaultControls": {
21
22
  "background": true,
@@ -45,6 +45,7 @@
45
45
  "__experimentalTextTransform": true,
46
46
  "__experimentalTextDecoration": true,
47
47
  "__experimentalLetterSpacing": true,
48
+ "__experimentalWritingMode": true,
48
49
  "__experimentalDefaultControls": {
49
50
  "fontSize": true
50
51
  }
@@ -97,11 +97,13 @@ function render_block_core_post_template( $attributes, $content, $block ) {
97
97
  $context['postId'] = $post_id;
98
98
  return $context;
99
99
  };
100
- add_filter( 'render_block_context', $filter_block_context );
100
+
101
+ // Use an early priority to so that other 'render_block_context' filters have access to the values.
102
+ add_filter( 'render_block_context', $filter_block_context, 1 );
101
103
  // Render the inner blocks of the Post Template block with `dynamic` set to `false` to prevent calling
102
104
  // `render_callback` and ensure that no wrapper markup is included.
103
105
  $block_content = ( new WP_Block( $block_instance ) )->render( array( 'dynamic' => false ) );
104
- remove_filter( 'render_block_context', $filter_block_context );
106
+ remove_filter( 'render_block_context', $filter_block_context, 1 );
105
107
 
106
108
  // Wrap the render inner blocks in a `li` element with the appropriate post classes.
107
109
  $post_classes = implode( ' ', get_post_class( 'wp-block-post' ) );
@@ -24,7 +24,11 @@
24
24
  "html": false,
25
25
  "spacing": {
26
26
  "margin": true,
27
- "padding": true
27
+ "padding": true,
28
+ "__experimentalDefaultControls": {
29
+ "margin": false,
30
+ "padding": false
31
+ }
28
32
  },
29
33
  "typography": {
30
34
  "fontSize": true,
@@ -19,8 +19,11 @@ function render_block_core_post_title( $attributes, $content, $block ) {
19
19
  return '';
20
20
  }
21
21
 
22
- $post = get_post( $block->context['postId'] );
23
- $title = get_the_title( $post );
22
+ /**
23
+ * The `$post` argument is intentionally omitted so that changes are reflected when previewing a post.
24
+ * See: https://github.com/WordPress/gutenberg/pull/37622#issuecomment-1000932816.
25
+ */
26
+ $title = get_the_title();
24
27
 
25
28
  if ( ! $title ) {
26
29
  return '';
@@ -33,7 +36,7 @@ function render_block_core_post_title( $attributes, $content, $block ) {
33
36
 
34
37
  if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
35
38
  $rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : '';
36
- $title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $post ), esc_attr( $attributes['linkTarget'] ), $rel, $title );
39
+ $title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $block->context['postId'] ), esc_attr( $attributes['linkTarget'] ), $rel, $title );
37
40
  }
38
41
 
39
42
  $classes = array();
@@ -39,6 +39,7 @@ exports[`Preformatted should match snapshot when content is empty 1`] = `
39
39
  onSelectionChange={[Function]}
40
40
  placeholder="Write preformatted text…"
41
41
  placeholderTextColor="gray"
42
+ selectionColor="black"
42
43
  triggerKeyCodes={[]}
43
44
  value=""
44
45
  />
@@ -85,6 +86,7 @@ exports[`Preformatted should match snapshot when content is not empty 1`] = `
85
86
  onSelectionChange={[Function]}
86
87
  placeholder="Write preformatted text…"
87
88
  placeholderTextColor="gray"
89
+ selectionColor="black"
88
90
  triggerKeyCodes={[]}
89
91
  value="<pre>Hello World!</pre>"
90
92
  />
@@ -34,20 +34,23 @@ export default function QueryPaginationEdit( {
34
34
  setAttributes,
35
35
  clientId,
36
36
  } ) {
37
- const hasNextPreviousBlocks = useSelect( ( select ) => {
38
- const { getBlocks } = select( blockEditorStore );
39
- const innerBlocks = getBlocks( clientId );
40
- /**
41
- * Show the `paginationArrow` and `showLabel` controls only if a
42
- * `QueryPaginationNext/Previous` block exists.
43
- */
44
- return innerBlocks?.find( ( innerBlock ) => {
45
- return [
46
- 'core/query-pagination-next',
47
- 'core/query-pagination-previous',
48
- ].includes( innerBlock.name );
49
- } );
50
- }, [] );
37
+ const hasNextPreviousBlocks = useSelect(
38
+ ( select ) => {
39
+ const { getBlocks } = select( blockEditorStore );
40
+ const innerBlocks = getBlocks( clientId );
41
+ /**
42
+ * Show the `paginationArrow` and `showLabel` controls only if a
43
+ * `QueryPaginationNext/Previous` block exists.
44
+ */
45
+ return innerBlocks?.find( ( innerBlock ) => {
46
+ return [
47
+ 'core/query-pagination-next',
48
+ 'core/query-pagination-previous',
49
+ ].includes( innerBlock.name );
50
+ } );
51
+ },
52
+ [ clientId ]
53
+ );
51
54
  const blockProps = useBlockProps();
52
55
  const innerBlocksProps = useInnerBlocksProps( blockProps, {
53
56
  template: TEMPLATE,
@@ -32,5 +32,5 @@
32
32
  }
33
33
  }
34
34
  },
35
- "editorStyle": "query-pagination-numbers-editor"
35
+ "editorStyle": "wp-block-query-pagination-numbers-editor"
36
36
  }
@@ -13,9 +13,11 @@ import {
13
13
  useBlockProps,
14
14
  Warning,
15
15
  HeadingLevelDropdown,
16
+ store as blockEditorStore,
16
17
  } from '@wordpress/block-editor';
17
18
  import { ToggleControl, PanelBody } from '@wordpress/components';
18
- import { __ } from '@wordpress/i18n';
19
+ import { __, sprintf } from '@wordpress/i18n';
20
+ import { useSelect } from '@wordpress/data';
19
21
 
20
22
  const SUPPORTED_TYPES = [ 'archive', 'search' ];
21
23
 
@@ -23,6 +25,18 @@ export default function QueryTitleEdit( {
23
25
  attributes: { type, level, textAlign, showPrefix, showSearchTerm },
24
26
  setAttributes,
25
27
  } ) {
28
+ const { archiveTypeTitle, archiveNameLabel } = useSelect( ( select ) => {
29
+ const { getSettings } = select( blockEditorStore );
30
+ const {
31
+ __experimentalArchiveTitleNameLabel,
32
+ __experimentalArchiveTitleTypeLabel,
33
+ } = getSettings();
34
+ return {
35
+ archiveTypeTitle: __experimentalArchiveTitleTypeLabel,
36
+ archiveNameLabel: __experimentalArchiveTitleNameLabel,
37
+ };
38
+ } );
39
+
26
40
  const TagName = `h${ level }`;
27
41
  const blockProps = useBlockProps( {
28
42
  className: classnames( 'wp-block-query-title__placeholder', {
@@ -40,6 +54,38 @@ export default function QueryTitleEdit( {
40
54
 
41
55
  let titleElement;
42
56
  if ( type === 'archive' ) {
57
+ let title;
58
+ if ( archiveTypeTitle ) {
59
+ if ( showPrefix ) {
60
+ if ( archiveNameLabel ) {
61
+ title = sprintf(
62
+ /* translators: 1: Archive type title e.g: "Category", 2: Label of the archive e.g: "Shoes" */
63
+ __( '%1$s: %2$s' ),
64
+ archiveTypeTitle,
65
+ archiveNameLabel
66
+ );
67
+ } else {
68
+ title = sprintf(
69
+ /* translators: %s: Archive type title e.g: "Category", "Tag"... */
70
+ __( '%s: Name' ),
71
+ archiveTypeTitle
72
+ );
73
+ }
74
+ } else if ( archiveNameLabel ) {
75
+ title = archiveNameLabel;
76
+ } else {
77
+ title = sprintf(
78
+ /* translators: %s: Archive type title e.g: "Category", "Tag"... */
79
+ __( '%s name' ),
80
+ archiveTypeTitle
81
+ );
82
+ }
83
+ } else {
84
+ title = showPrefix
85
+ ? __( 'Archive type: Name' )
86
+ : __( 'Archive title' );
87
+ }
88
+
43
89
  titleElement = (
44
90
  <>
45
91
  <InspectorControls>
@@ -54,11 +100,7 @@ export default function QueryTitleEdit( {
54
100
  />
55
101
  </PanelBody>
56
102
  </InspectorControls>
57
- <TagName { ...blockProps }>
58
- { showPrefix
59
- ? __( 'Archive type: Name' )
60
- : __( 'Archive title' ) }
61
- </TagName>
103
+ <TagName { ...blockProps }>{ title }</TagName>
62
104
  </>
63
105
  );
64
106
  }
@@ -47,6 +47,7 @@
47
47
  },
48
48
  "color": {
49
49
  "gradients": true,
50
+ "heading": true,
50
51
  "link": true,
51
52
  "__experimentalDefaultControls": {
52
53
  "background": true,
@@ -22,6 +22,16 @@ exports[`Quote block transforms to Group block 1`] = `
22
22
  <!-- /wp:group -->"
23
23
  `;
24
24
 
25
+ exports[`Quote block transforms to Paragraph block 1`] = `
26
+ "<!-- wp:paragraph -->
27
+ <p>"This will make running your own blog a viable alternative again."</p>
28
+ <!-- /wp:paragraph -->
29
+
30
+ <!-- wp:paragraph -->
31
+ <p>— <a href="https://twitter.com/azumbrunnen_/status/1019347243084800005">Adrian Zumbrunnen</a></p>
32
+ <!-- /wp:paragraph -->"
33
+ `;
34
+
25
35
  exports[`Quote block transforms to Pullquote block 1`] = `
26
36
  "<!-- wp:pullquote -->
27
37
  <figure class="wp-block-pullquote"><blockquote><p>"This will make running your own blog a viable alternative again."</p><cite>— <a href="https://twitter.com/azumbrunnen_/status/1019347243084800005">Adrian Zumbrunnen</a></cite></blockquote></figure>
@@ -21,7 +21,11 @@ const initialHtml = `
21
21
  <!-- /wp:quote -->`;
22
22
 
23
23
  const transformsWithInnerBlocks = [ 'Columns', 'Group' ];
24
- const blockTransforms = [ 'Pullquote', ...transformsWithInnerBlocks ];
24
+ const blockTransforms = [
25
+ 'Pullquote',
26
+ 'Paragraph',
27
+ ...transformsWithInnerBlocks,
28
+ ];
25
29
 
26
30
  setupCoreBlocks();
27
31
 
@@ -109,6 +109,19 @@ const transforms = {
109
109
  } );
110
110
  },
111
111
  },
112
+ {
113
+ type: 'block',
114
+ blocks: [ 'core/paragraph' ],
115
+ transform: ( { citation }, innerBlocks ) =>
116
+ citation
117
+ ? [
118
+ ...innerBlocks,
119
+ createBlock( 'core/paragraph', {
120
+ content: citation,
121
+ } ),
122
+ ]
123
+ : innerBlocks,
124
+ },
112
125
  {
113
126
  type: 'block',
114
127
  blocks: [ 'core/group' ],
package/src/rss/edit.js CHANGED
@@ -116,6 +116,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
116
116
  <PanelBody title={ __( 'Settings' ) }>
117
117
  <RangeControl
118
118
  __nextHasNoMarginBottom
119
+ __next40pxDefaultSize
119
120
  label={ __( 'Number of items' ) }
120
121
  value={ itemsToShow }
121
122
  onChange={ ( value ) =>
@@ -146,6 +147,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
146
147
  { displayExcerpt && (
147
148
  <RangeControl
148
149
  __nextHasNoMarginBottom
150
+ __next40pxDefaultSize
149
151
  label={ __( 'Max number of words in excerpt' ) }
150
152
  value={ excerptLength }
151
153
  onChange={ ( value ) =>
@@ -159,6 +161,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
159
161
  { blockLayout === 'grid' && (
160
162
  <RangeControl
161
163
  __nextHasNoMarginBottom
164
+ __next40pxDefaultSize
162
165
  label={ __( 'Columns' ) }
163
166
  value={ columns }
164
167
  onChange={ ( value ) =>
@@ -90,6 +90,7 @@
90
90
  },
91
91
  "html": false
92
92
  },
93
+ "viewScript": "file:./view.min.js",
93
94
  "editorStyle": "wp-block-search-editor",
94
95
  "style": "wp-block-search"
95
96
  }
@@ -97,8 +97,8 @@ export default function SearchEdit( {
97
97
  );
98
98
  const { __unstableMarkNextChangeAsNotPersistent } =
99
99
  useDispatch( blockEditorStore );
100
- useEffect( () => {
101
- if ( ! insertedInNavigationBlock ) return;
100
+
101
+ if ( insertedInNavigationBlock ) {
102
102
  // This side-effect should not create an undo level.
103
103
  __unstableMarkNextChangeAsNotPersistent();
104
104
  setAttributes( {
@@ -106,7 +106,8 @@ export default function SearchEdit( {
106
106
  buttonUseIcon: true,
107
107
  buttonPosition: 'button-inside',
108
108
  } );
109
- }, [ insertedInNavigationBlock ] );
109
+ }
110
+
110
111
  const borderRadius = style?.border?.radius;
111
112
  const borderProps = useBorderProps( attributes );
112
113
 
@@ -8,11 +8,13 @@
8
8
  /**
9
9
  * Dynamically renders the `core/search` block.
10
10
  *
11
- * @param array $attributes The block attributes.
11
+ * @param array $attributes The block attributes.
12
+ * @param string $content The saved content.
13
+ * @param WP_Block $block The parsed block.
12
14
  *
13
15
  * @return string The search block markup.
14
16
  */
15
- function render_block_core_search( $attributes ) {
17
+ function render_block_core_search( $attributes, $content, $block ) {
16
18
  // Older versions of the Search block defaulted the label and buttonText
17
19
  // attributes to `__( 'Search' )` meaning that many posts contain `<!--
18
20
  // wp:search /-->`. Support these by defaulting an undefined label and
@@ -70,10 +72,26 @@ function render_block_core_search( $attributes ) {
70
72
  $input->set_attribute( 'id', $input_id );
71
73
  $input->set_attribute( 'value', get_search_query() );
72
74
  $input->set_attribute( 'placeholder', $attributes['placeholder'] );
73
- if ( 'button-only' === $button_position && 'expand-searchfield' === $button_behavior ) {
75
+
76
+ $is_expandable_searchfield = 'button-only' === $button_position && 'expand-searchfield' === $button_behavior;
77
+ if ( $is_expandable_searchfield ) {
74
78
  $input->set_attribute( 'aria-hidden', 'true' );
75
79
  $input->set_attribute( 'tabindex', '-1' );
76
- wp_enqueue_script( 'wp-block--search-view', plugins_url( 'search/view.min.js', __FILE__ ) );
80
+ }
81
+
82
+ // If the script already exists, there is no point in removing it from viewScript.
83
+ $view_js_file = 'wp-block-search-view';
84
+ if ( ! wp_script_is( $view_js_file ) ) {
85
+ $script_handles = $block->block_type->view_script_handles;
86
+
87
+ // If the script is not needed, and it is still in the `view_script_handles`, remove it.
88
+ if ( ! $is_expandable_searchfield && in_array( $view_js_file, $script_handles, true ) ) {
89
+ $block->block_type->view_script_handles = array_diff( $script_handles, array( $view_js_file ) );
90
+ }
91
+ // If the script is needed, but it was previously removed, add it again.
92
+ if ( $is_expandable_searchfield && ! in_array( $view_js_file, $script_handles, true ) ) {
93
+ $block->block_type->view_script_handles = array_merge( $script_handles, array( $view_js_file ) );
94
+ }
77
95
  }
78
96
  }
79
97