@wordpress/block-library 8.24.1 → 8.25.1-next.79a6196f.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 (509) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +1 -1
  3. package/build/audio/edit.js +15 -62
  4. package/build/audio/edit.js.map +1 -1
  5. package/build/audio/edit.native.js +1 -1
  6. package/build/audio/edit.native.js.map +1 -1
  7. package/build/audio/index.js +2 -2
  8. package/build/block/edit.js +157 -19
  9. package/build/block/edit.js.map +1 -1
  10. package/build/block/index.js +3 -2
  11. package/build/block/index.js.map +1 -1
  12. package/build/block/v1/edit.js +116 -0
  13. package/build/block/v1/edit.js.map +1 -0
  14. package/build/block/{edit.native.js → v1/edit.native.js} +2 -2
  15. package/build/block/v1/edit.native.js.map +1 -0
  16. package/build/button/index.js +2 -2
  17. package/build/button/save.js +1 -1
  18. package/build/button/save.js.map +1 -1
  19. package/build/code/edit.native.js +13 -14
  20. package/build/code/edit.native.js.map +1 -1
  21. package/build/code/index.js +2 -2
  22. package/build/code/save.js +6 -2
  23. package/build/code/save.js.map +1 -1
  24. package/build/comments-title/deprecated.js +1 -1
  25. package/build/comments-title/index.js +1 -1
  26. package/build/cover/edit/inspector-controls.js +1 -1
  27. package/build/cover/edit/inspector-controls.js.map +1 -1
  28. package/build/cover/edit.native.js +1 -0
  29. package/build/cover/edit.native.js.map +1 -1
  30. package/build/details/index.js +2 -2
  31. package/build/embed/deprecated.js +2 -2
  32. package/build/embed/embed-preview.native.js +1 -1
  33. package/build/embed/embed-preview.native.js.map +1 -1
  34. package/build/embed/icons.js +1 -1
  35. package/build/embed/icons.js.map +1 -1
  36. package/build/embed/index.js +2 -2
  37. package/build/embed/transforms.js +2 -2
  38. package/build/embed/util.js +6 -6
  39. package/build/embed/util.js.map +1 -1
  40. package/build/file/edit.js +20 -28
  41. package/build/file/edit.js.map +1 -1
  42. package/build/file/edit.native.js +1 -1
  43. package/build/file/edit.native.js.map +1 -1
  44. package/build/file/index.js +4 -4
  45. package/build/file/save.js +4 -1
  46. package/build/file/save.js.map +1 -1
  47. package/build/form-input/deprecated.js +147 -0
  48. package/build/form-input/deprecated.js.map +1 -0
  49. package/build/form-input/edit.js +1 -1
  50. package/build/form-input/edit.js.map +1 -1
  51. package/build/form-input/index.js +4 -2
  52. package/build/form-input/index.js.map +1 -1
  53. package/build/form-input/save.js +7 -9
  54. package/build/form-input/save.js.map +1 -1
  55. package/build/gallery/edit.js +38 -58
  56. package/build/gallery/edit.js.map +1 -1
  57. package/build/gallery/gallery.js +19 -24
  58. package/build/gallery/gallery.js.map +1 -1
  59. package/build/gallery/gallery.native.js +1 -1
  60. package/build/gallery/gallery.native.js.map +1 -1
  61. package/build/gallery/index.js +8 -4
  62. package/build/gallery/index.js.map +1 -1
  63. package/build/gallery/transforms.js +4 -68
  64. package/build/gallery/transforms.js.map +1 -1
  65. package/build/gallery/v1/gallery.native.js +1 -1
  66. package/build/gallery/v1/gallery.native.js.map +1 -1
  67. package/build/group/edit.js +6 -1
  68. package/build/group/edit.js.map +1 -1
  69. package/build/group/index.js +5 -1
  70. package/build/group/index.js.map +1 -1
  71. package/build/heading/index.js +3 -6
  72. package/build/heading/index.js.map +1 -1
  73. package/build/image/deprecated.js +11 -0
  74. package/build/image/deprecated.js.map +1 -1
  75. package/build/image/edit.native.js +4 -1
  76. package/build/image/edit.native.js.map +1 -1
  77. package/build/image/image.js +35 -71
  78. package/build/image/image.js.map +1 -1
  79. package/build/image/index.js +2 -2
  80. package/build/image/save.js +3 -1
  81. package/build/image/save.js.map +1 -1
  82. package/build/image/view.js +7 -1
  83. package/build/image/view.js.map +1 -1
  84. package/build/list/edit.js +10 -15
  85. package/build/list/edit.js.map +1 -1
  86. package/build/list-item/edit.js +17 -2
  87. package/build/list-item/edit.js.map +1 -1
  88. package/build/list-item/hooks/use-enter.js +5 -3
  89. package/build/list-item/hooks/use-enter.js.map +1 -1
  90. package/build/list-item/hooks/use-enter.native.js +4 -3
  91. package/build/list-item/hooks/use-enter.native.js.map +1 -1
  92. package/build/list-item/hooks/use-indent-list-item.js +2 -3
  93. package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
  94. package/build/list-item/hooks/use-merge.js +1 -1
  95. package/build/list-item/hooks/use-merge.js.map +1 -1
  96. package/build/list-item/hooks/use-outdent-list-item.js +3 -17
  97. package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
  98. package/build/list-item/hooks/use-space.js +8 -4
  99. package/build/list-item/hooks/use-space.js.map +1 -1
  100. package/build/list-item/index.js +10 -3
  101. package/build/list-item/index.js.map +1 -1
  102. package/build/media-text/media-container.native.js +3 -0
  103. package/build/media-text/media-container.native.js.map +1 -1
  104. package/build/navigation/constants.js +3 -1
  105. package/build/navigation/constants.js.map +1 -1
  106. package/build/navigation/edit/index.js +5 -1
  107. package/build/navigation/edit/index.js.map +1 -1
  108. package/build/navigation/view.js +25 -1
  109. package/build/navigation/view.js.map +1 -1
  110. package/build/page-list/convert-to-links-modal.js +2 -2
  111. package/build/page-list/convert-to-links-modal.js.map +1 -1
  112. package/build/paragraph/edit.js +54 -32
  113. package/build/paragraph/edit.js.map +1 -1
  114. package/build/paragraph/index.js +2 -4
  115. package/build/paragraph/index.js.map +1 -1
  116. package/build/paragraph/transforms.js +2 -4
  117. package/build/paragraph/transforms.js.map +1 -1
  118. package/build/pattern/edit.js +24 -2
  119. package/build/pattern/edit.js.map +1 -1
  120. package/build/pattern/recursion-detector.js +147 -0
  121. package/build/pattern/recursion-detector.js.map +1 -0
  122. package/build/post-featured-image/edit.js +19 -2
  123. package/build/post-featured-image/edit.js.map +1 -1
  124. package/build/post-featured-image/index.js +4 -0
  125. package/build/post-featured-image/index.js.map +1 -1
  126. package/build/post-title/index.js +1 -3
  127. package/build/post-title/index.js.map +1 -1
  128. package/build/preformatted/index.js +2 -3
  129. package/build/preformatted/index.js.map +1 -1
  130. package/build/pullquote/index.js +5 -7
  131. package/build/pullquote/index.js.map +1 -1
  132. package/build/query/edit/inspector-controls/index.js +3 -1
  133. package/build/query/edit/inspector-controls/index.js.map +1 -1
  134. package/build/query/edit/inspector-controls/taxonomy-controls.js +2 -0
  135. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  136. package/build/query-pagination-numbers/index.js +1 -1
  137. package/build/query-title/index.js +1 -3
  138. package/build/query-title/index.js.map +1 -1
  139. package/build/quote/index.js +3 -5
  140. package/build/quote/index.js.map +1 -1
  141. package/build/quote/transforms.js +7 -6
  142. package/build/quote/transforms.js.map +1 -1
  143. package/build/search/edit.js +3 -5
  144. package/build/search/edit.js.map +1 -1
  145. package/build/search/index.js +0 -4
  146. package/build/search/index.js.map +1 -1
  147. package/build/site-logo/edit.js +7 -6
  148. package/build/site-logo/edit.js.map +1 -1
  149. package/build/site-title/index.js +1 -5
  150. package/build/site-title/index.js.map +1 -1
  151. package/build/social-link/icons/gravatar.js +22 -0
  152. package/build/social-link/icons/gravatar.js.map +1 -0
  153. package/build/social-link/icons/index.js +11 -0
  154. package/build/social-link/icons/index.js.map +1 -1
  155. package/build/social-link/variations.js +7 -0
  156. package/build/social-link/variations.js.map +1 -1
  157. package/build/spacer/edit.native.js +2 -2
  158. package/build/spacer/edit.native.js.map +1 -1
  159. package/build/table/edit.js +3 -1
  160. package/build/table/edit.js.map +1 -1
  161. package/build/table/index.js +9 -10
  162. package/build/table/index.js.map +1 -1
  163. package/build/table-of-contents/edit.js +2 -2
  164. package/build/table-of-contents/edit.js.map +1 -1
  165. package/build/table-of-contents/index.js +5 -2
  166. package/build/table-of-contents/index.js.map +1 -1
  167. package/build/tag-cloud/edit.js +5 -9
  168. package/build/tag-cloud/edit.js.map +1 -1
  169. package/build/utils/caption.js +90 -0
  170. package/build/utils/caption.js.map +1 -0
  171. package/build/utils/constants.js +16 -0
  172. package/build/utils/constants.js.map +1 -0
  173. package/build/utils/remove-anchor-tag.js +2 -1
  174. package/build/utils/remove-anchor-tag.js.map +1 -1
  175. package/build/verse/index.js +3 -5
  176. package/build/verse/index.js.map +1 -1
  177. package/build/video/deprecated.js +2 -2
  178. package/build/video/edit.js +16 -57
  179. package/build/video/edit.js.map +1 -1
  180. package/build/video/edit.native.js +1 -1
  181. package/build/video/edit.native.js.map +1 -1
  182. package/build/video/index.js +2 -2
  183. package/build-module/audio/edit.js +19 -66
  184. package/build-module/audio/edit.js.map +1 -1
  185. package/build-module/audio/edit.native.js +2 -2
  186. package/build-module/audio/edit.native.js.map +1 -1
  187. package/build-module/audio/index.js +2 -2
  188. package/build-module/block/edit.js +160 -22
  189. package/build-module/block/edit.js.map +1 -1
  190. package/build-module/block/index.js +3 -2
  191. package/build-module/block/index.js.map +1 -1
  192. package/build-module/block/v1/edit.js +108 -0
  193. package/build-module/block/v1/edit.js.map +1 -0
  194. package/build-module/block/{edit.native.js → v1/edit.native.js} +2 -2
  195. package/build-module/block/v1/edit.native.js.map +1 -0
  196. package/build-module/button/index.js +2 -2
  197. package/build-module/button/save.js +1 -1
  198. package/build-module/button/save.js.map +1 -1
  199. package/build-module/code/edit.native.js +14 -16
  200. package/build-module/code/edit.native.js.map +1 -1
  201. package/build-module/code/index.js +2 -2
  202. package/build-module/code/save.js +6 -2
  203. package/build-module/code/save.js.map +1 -1
  204. package/build-module/comments-title/deprecated.js +1 -1
  205. package/build-module/comments-title/index.js +1 -1
  206. package/build-module/cover/edit/inspector-controls.js +1 -1
  207. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  208. package/build-module/cover/edit.native.js +1 -0
  209. package/build-module/cover/edit.native.js.map +1 -1
  210. package/build-module/details/index.js +2 -2
  211. package/build-module/embed/deprecated.js +2 -2
  212. package/build-module/embed/embed-preview.native.js +2 -2
  213. package/build-module/embed/embed-preview.native.js.map +1 -1
  214. package/build-module/embed/icons.js +1 -1
  215. package/build-module/embed/icons.js.map +1 -1
  216. package/build-module/embed/index.js +2 -2
  217. package/build-module/embed/transforms.js +2 -2
  218. package/build-module/embed/util.js +6 -6
  219. package/build-module/embed/util.js.map +1 -1
  220. package/build-module/file/edit.js +20 -28
  221. package/build-module/file/edit.js.map +1 -1
  222. package/build-module/file/edit.native.js +1 -1
  223. package/build-module/file/edit.native.js.map +1 -1
  224. package/build-module/file/index.js +4 -4
  225. package/build-module/file/save.js +4 -1
  226. package/build-module/file/save.js.map +1 -1
  227. package/build-module/form-input/deprecated.js +138 -0
  228. package/build-module/form-input/deprecated.js.map +1 -0
  229. package/build-module/form-input/edit.js +1 -1
  230. package/build-module/form-input/edit.js.map +1 -1
  231. package/build-module/form-input/index.js +4 -2
  232. package/build-module/form-input/index.js.map +1 -1
  233. package/build-module/form-input/save.js +8 -10
  234. package/build-module/form-input/save.js.map +1 -1
  235. package/build-module/gallery/edit.js +41 -61
  236. package/build-module/gallery/edit.js.map +1 -1
  237. package/build-module/gallery/gallery.js +18 -21
  238. package/build-module/gallery/gallery.js.map +1 -1
  239. package/build-module/gallery/gallery.native.js +2 -2
  240. package/build-module/gallery/gallery.native.js.map +1 -1
  241. package/build-module/gallery/index.js +8 -4
  242. package/build-module/gallery/index.js.map +1 -1
  243. package/build-module/gallery/transforms.js +4 -68
  244. package/build-module/gallery/transforms.js.map +1 -1
  245. package/build-module/gallery/v1/gallery.native.js +2 -2
  246. package/build-module/gallery/v1/gallery.native.js.map +1 -1
  247. package/build-module/group/edit.js +6 -1
  248. package/build-module/group/edit.js.map +1 -1
  249. package/build-module/group/index.js +5 -1
  250. package/build-module/group/index.js.map +1 -1
  251. package/build-module/heading/index.js +3 -6
  252. package/build-module/heading/index.js.map +1 -1
  253. package/build-module/image/deprecated.js +11 -0
  254. package/build-module/image/deprecated.js.map +1 -1
  255. package/build-module/image/edit.native.js +5 -2
  256. package/build-module/image/edit.native.js.map +1 -1
  257. package/build-module/image/image.js +35 -71
  258. package/build-module/image/image.js.map +1 -1
  259. package/build-module/image/index.js +2 -2
  260. package/build-module/image/save.js +3 -1
  261. package/build-module/image/save.js.map +1 -1
  262. package/build-module/image/view.js +7 -1
  263. package/build-module/image/view.js.map +1 -1
  264. package/build-module/list/edit.js +10 -15
  265. package/build-module/list/edit.js.map +1 -1
  266. package/build-module/list-item/edit.js +18 -3
  267. package/build-module/list-item/edit.js.map +1 -1
  268. package/build-module/list-item/hooks/use-enter.js +5 -3
  269. package/build-module/list-item/hooks/use-enter.js.map +1 -1
  270. package/build-module/list-item/hooks/use-enter.native.js +4 -3
  271. package/build-module/list-item/hooks/use-enter.native.js.map +1 -1
  272. package/build-module/list-item/hooks/use-indent-list-item.js +2 -3
  273. package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
  274. package/build-module/list-item/hooks/use-merge.js +1 -1
  275. package/build-module/list-item/hooks/use-merge.js.map +1 -1
  276. package/build-module/list-item/hooks/use-outdent-list-item.js +3 -17
  277. package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
  278. package/build-module/list-item/hooks/use-space.js +8 -4
  279. package/build-module/list-item/hooks/use-space.js.map +1 -1
  280. package/build-module/list-item/index.js +10 -3
  281. package/build-module/list-item/index.js.map +1 -1
  282. package/build-module/media-text/media-container.native.js +3 -0
  283. package/build-module/media-text/media-container.native.js.map +1 -1
  284. package/build-module/navigation/constants.js +1 -0
  285. package/build-module/navigation/constants.js.map +1 -1
  286. package/build-module/navigation/edit/index.js +7 -3
  287. package/build-module/navigation/edit/index.js.map +1 -1
  288. package/build-module/navigation/view.js +25 -1
  289. package/build-module/navigation/view.js.map +1 -1
  290. package/build-module/page-list/convert-to-links-modal.js +2 -2
  291. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  292. package/build-module/paragraph/edit.js +54 -32
  293. package/build-module/paragraph/edit.js.map +1 -1
  294. package/build-module/paragraph/index.js +2 -4
  295. package/build-module/paragraph/index.js.map +1 -1
  296. package/build-module/paragraph/transforms.js +2 -4
  297. package/build-module/paragraph/transforms.js.map +1 -1
  298. package/build-module/pattern/edit.js +26 -4
  299. package/build-module/pattern/edit.js.map +1 -1
  300. package/build-module/pattern/recursion-detector.js +139 -0
  301. package/build-module/pattern/recursion-detector.js.map +1 -0
  302. package/build-module/post-featured-image/edit.js +19 -2
  303. package/build-module/post-featured-image/edit.js.map +1 -1
  304. package/build-module/post-featured-image/index.js +4 -0
  305. package/build-module/post-featured-image/index.js.map +1 -1
  306. package/build-module/post-title/index.js +1 -3
  307. package/build-module/post-title/index.js.map +1 -1
  308. package/build-module/preformatted/index.js +2 -3
  309. package/build-module/preformatted/index.js.map +1 -1
  310. package/build-module/pullquote/index.js +5 -7
  311. package/build-module/pullquote/index.js.map +1 -1
  312. package/build-module/query/edit/inspector-controls/index.js +3 -1
  313. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  314. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +2 -0
  315. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  316. package/build-module/query-pagination-numbers/index.js +1 -1
  317. package/build-module/query-title/index.js +1 -3
  318. package/build-module/query-title/index.js.map +1 -1
  319. package/build-module/quote/index.js +3 -5
  320. package/build-module/quote/index.js.map +1 -1
  321. package/build-module/quote/transforms.js +7 -6
  322. package/build-module/quote/transforms.js.map +1 -1
  323. package/build-module/search/edit.js +3 -5
  324. package/build-module/search/edit.js.map +1 -1
  325. package/build-module/search/index.js +0 -4
  326. package/build-module/search/index.js.map +1 -1
  327. package/build-module/site-logo/edit.js +7 -6
  328. package/build-module/site-logo/edit.js.map +1 -1
  329. package/build-module/site-title/index.js +1 -5
  330. package/build-module/site-title/index.js.map +1 -1
  331. package/build-module/social-link/icons/gravatar.js +14 -0
  332. package/build-module/social-link/icons/gravatar.js.map +1 -0
  333. package/build-module/social-link/icons/index.js +1 -0
  334. package/build-module/social-link/icons/index.js.map +1 -1
  335. package/build-module/social-link/variations.js +8 -1
  336. package/build-module/social-link/variations.js.map +1 -1
  337. package/build-module/spacer/edit.native.js +2 -2
  338. package/build-module/spacer/edit.native.js.map +1 -1
  339. package/build-module/table/edit.js +3 -1
  340. package/build-module/table/edit.js.map +1 -1
  341. package/build-module/table/index.js +9 -10
  342. package/build-module/table/index.js.map +1 -1
  343. package/build-module/table-of-contents/edit.js +1 -1
  344. package/build-module/table-of-contents/edit.js.map +1 -1
  345. package/build-module/table-of-contents/index.js +5 -1
  346. package/build-module/table-of-contents/index.js.map +1 -1
  347. package/build-module/tag-cloud/edit.js +6 -10
  348. package/build-module/tag-cloud/edit.js.map +1 -1
  349. package/build-module/utils/caption.js +82 -0
  350. package/build-module/utils/caption.js.map +1 -0
  351. package/build-module/utils/constants.js +9 -0
  352. package/build-module/utils/constants.js.map +1 -0
  353. package/build-module/utils/remove-anchor-tag.js +2 -1
  354. package/build-module/utils/remove-anchor-tag.js.map +1 -1
  355. package/build-module/verse/index.js +3 -5
  356. package/build-module/verse/index.js.map +1 -1
  357. package/build-module/video/deprecated.js +2 -2
  358. package/build-module/video/edit.js +21 -62
  359. package/build-module/video/edit.js.map +1 -1
  360. package/build-module/video/edit.native.js +2 -2
  361. package/build-module/video/edit.native.js.map +1 -1
  362. package/build-module/video/index.js +2 -2
  363. package/build-style/button/editor-rtl.css +0 -37
  364. package/build-style/button/editor.css +0 -37
  365. package/build-style/button/style-rtl.css +6 -6
  366. package/build-style/button/style.css +6 -6
  367. package/build-style/editor-rtl.css +3 -55
  368. package/build-style/editor.css +3 -55
  369. package/build-style/navigation/editor-rtl.css +2 -4
  370. package/build-style/navigation/editor.css +2 -4
  371. package/build-style/navigation/style-rtl.css +14 -18
  372. package/build-style/navigation/style.css +14 -18
  373. package/build-style/search/style-rtl.css +26 -27
  374. package/build-style/search/style.css +26 -27
  375. package/build-style/social-links/style-rtl.css +14 -2
  376. package/build-style/social-links/style.css +14 -2
  377. package/build-style/style-rtl.css +60 -53
  378. package/build-style/style.css +60 -53
  379. package/build-style/table/editor-rtl.css +1 -14
  380. package/build-style/table/editor.css +1 -14
  381. package/package.json +32 -32
  382. package/src/audio/block.json +2 -2
  383. package/src/audio/edit.js +29 -92
  384. package/src/audio/edit.native.js +2 -1
  385. package/src/audio/test/__snapshots__/edit.native.js.snap +12 -0
  386. package/src/audio/test/edit.native.js +29 -0
  387. package/src/block/edit.js +218 -37
  388. package/src/block/index.js +3 -2
  389. package/src/block/index.php +48 -0
  390. package/src/block/v1/edit.js +163 -0
  391. package/src/block/{edit.native.js → v1/edit.native.js} +2 -2
  392. package/src/button/block.json +2 -2
  393. package/src/button/editor.scss +0 -43
  394. package/src/button/save.js +1 -1
  395. package/src/button/style.scss +6 -6
  396. package/src/buttons/test/__snapshots__/edit.native.js.snap +6 -0
  397. package/src/buttons/test/edit.native.js +49 -0
  398. package/src/code/block.json +2 -2
  399. package/src/code/edit.native.js +11 -13
  400. package/src/code/save.js +4 -1
  401. package/src/code/test/edit.native.js +2 -2
  402. package/src/comments-title/block.json +1 -1
  403. package/src/cover/edit/inspector-controls.js +1 -1
  404. package/src/cover/edit.native.js +1 -0
  405. package/src/cover/test/edit.native.js +7 -1
  406. package/src/details/block.json +2 -2
  407. package/src/embed/block.json +2 -2
  408. package/src/embed/embed-preview.native.js +2 -1
  409. package/src/embed/icons.js +1 -1
  410. package/src/embed/util.js +2 -2
  411. package/src/file/block.json +4 -4
  412. package/src/file/edit.js +18 -25
  413. package/src/file/edit.native.js +1 -1
  414. package/src/file/save.js +5 -1
  415. package/src/form-input/block.json +2 -2
  416. package/src/form-input/deprecated.js +142 -0
  417. package/src/form-input/edit.js +1 -1
  418. package/src/form-input/index.js +2 -0
  419. package/src/form-input/save.js +27 -24
  420. package/src/gallery/block.json +8 -4
  421. package/src/gallery/edit.js +70 -98
  422. package/src/gallery/gallery.js +22 -36
  423. package/src/gallery/gallery.native.js +6 -2
  424. package/src/gallery/index.php +15 -0
  425. package/src/gallery/transforms.js +2 -55
  426. package/src/gallery/v1/gallery.native.js +2 -1
  427. package/src/group/block.json +5 -1
  428. package/src/group/edit.js +4 -1
  429. package/src/heading/block.json +3 -6
  430. package/src/image/block.json +2 -2
  431. package/src/image/deprecated.js +8 -0
  432. package/src/image/edit.native.js +5 -3
  433. package/src/image/image.js +77 -127
  434. package/src/image/index.php +1 -6
  435. package/src/image/save.js +3 -1
  436. package/src/image/view.js +5 -2
  437. package/src/list/edit.js +27 -35
  438. package/src/list-item/block.json +10 -3
  439. package/src/list-item/edit.js +18 -2
  440. package/src/list-item/hooks/use-enter.js +63 -62
  441. package/src/list-item/hooks/use-enter.native.js +9 -5
  442. package/src/list-item/hooks/use-indent-list-item.js +43 -53
  443. package/src/list-item/hooks/use-merge.js +1 -1
  444. package/src/list-item/hooks/use-outdent-list-item.js +50 -69
  445. package/src/list-item/hooks/use-space.js +7 -4
  446. package/src/media-text/media-container.native.js +3 -1
  447. package/src/navigation/constants.js +2 -0
  448. package/src/navigation/edit/index.js +18 -3
  449. package/src/navigation/editor.scss +1 -1
  450. package/src/navigation/index.php +1 -1
  451. package/src/navigation/style.scss +18 -16
  452. package/src/navigation/view.js +29 -3
  453. package/src/navigation-link/test/__snapshots__/hooks.js.snap +6 -3
  454. package/src/page-list/convert-to-links-modal.js +2 -2
  455. package/src/paragraph/block.json +2 -4
  456. package/src/paragraph/edit.js +53 -40
  457. package/src/paragraph/test/__snapshots__/edit.native.js.snap +12 -0
  458. package/src/paragraph/test/edit.native.js +114 -0
  459. package/src/pattern/edit.js +35 -3
  460. package/src/pattern/index.php +16 -0
  461. package/src/pattern/recursion-detector.js +145 -0
  462. package/src/pattern/test/index.js +74 -0
  463. package/src/post-featured-image/block.json +4 -0
  464. package/src/post-featured-image/edit.js +32 -1
  465. package/src/post-featured-image/index.php +31 -0
  466. package/src/post-title/block.json +1 -3
  467. package/src/preformatted/block.json +2 -3
  468. package/src/pullquote/block.json +5 -7
  469. package/src/query/edit/inspector-controls/index.js +2 -0
  470. package/src/query/edit/inspector-controls/taxonomy-controls.js +2 -0
  471. package/src/query-pagination-numbers/block.json +1 -1
  472. package/src/query-title/block.json +1 -3
  473. package/src/quote/block.json +3 -5
  474. package/src/quote/transforms.js +12 -11
  475. package/src/search/block.json +0 -4
  476. package/src/search/edit.js +2 -8
  477. package/src/search/index.php +3 -7
  478. package/src/search/style.scss +27 -29
  479. package/src/site-logo/edit.js +3 -4
  480. package/src/site-title/block.json +1 -5
  481. package/src/social-link/icons/gravatar.js +10 -0
  482. package/src/social-link/icons/index.js +1 -0
  483. package/src/social-link/index.php +5 -1
  484. package/src/social-link/socials-with-bg.scss +5 -0
  485. package/src/social-link/socials-without-bg.scss +4 -0
  486. package/src/social-link/variations.js +7 -0
  487. package/src/social-links/style.scss +14 -8
  488. package/src/spacer/edit.native.js +4 -2
  489. package/src/table/block.json +9 -10
  490. package/src/table/edit.js +3 -1
  491. package/src/table/editor.scss +1 -17
  492. package/src/table-of-contents/edit.js +1 -1
  493. package/src/table-of-contents/index.js +5 -1
  494. package/src/tag-cloud/edit.js +7 -7
  495. package/src/template-part/index.php +6 -0
  496. package/src/utils/caption.js +108 -0
  497. package/src/utils/constants.js +8 -0
  498. package/src/utils/remove-anchor-tag.js +2 -1
  499. package/src/verse/block.json +3 -5
  500. package/src/video/block.json +2 -2
  501. package/src/video/edit.js +40 -100
  502. package/src/video/edit.native.js +2 -1
  503. package/build/block/edit.native.js.map +0 -1
  504. package/build/table-of-contents/icon.js +0 -22
  505. package/build/table-of-contents/icon.js.map +0 -1
  506. package/build-module/block/edit.native.js.map +0 -1
  507. package/build-module/table-of-contents/icon.js +0 -15
  508. package/build-module/table-of-contents/icon.js.map +0 -1
  509. package/src/table-of-contents/icon.js +0 -18
@@ -17,13 +17,11 @@ import useOutdentListItem from './use-outdent-list-item';
17
17
 
18
18
  export default function useEnter( props, preventDefault ) {
19
19
  const { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );
20
- const { getBlock, getBlockRootClientId, getBlockIndex } =
20
+ const { getBlock, getBlockRootClientId, getBlockIndex, getBlockName } =
21
21
  useSelect( blockEditorStore );
22
22
  const propsRef = useRef( props );
23
23
  propsRef.current = props;
24
- const [ canOutdent, outdentListItem ] = useOutdentListItem(
25
- propsRef.current.clientId
26
- );
24
+ const outdentListItem = useOutdentListItem();
27
25
 
28
26
  return {
29
27
  onEnter() {
@@ -32,7 +30,13 @@ export default function useEnter( props, preventDefault ) {
32
30
  return;
33
31
  }
34
32
  preventDefault.current = true;
35
- if ( canOutdent ) {
33
+ if (
34
+ getBlockName(
35
+ getBlockRootClientId(
36
+ getBlockRootClientId( propsRef.current.clientId )
37
+ )
38
+ ) === 'core/list-item'
39
+ ) {
36
40
  outdentListItem();
37
41
  return;
38
42
  }
@@ -7,10 +7,6 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
7
7
  import { createBlock, cloneBlock } from '@wordpress/blocks';
8
8
 
9
9
  export default function useIndentListItem( clientId ) {
10
- const canIndent = useSelect(
11
- ( select ) => select( blockEditorStore ).getBlockIndex( clientId ) > 0,
12
- [ clientId ]
13
- );
14
10
  const { replaceBlocks, selectionChange, multiSelect } =
15
11
  useDispatch( blockEditorStore );
16
12
  const {
@@ -21,55 +17,49 @@ export default function useIndentListItem( clientId ) {
21
17
  hasMultiSelection,
22
18
  getMultiSelectedBlockClientIds,
23
19
  } = useSelect( blockEditorStore );
24
- return [
25
- canIndent,
26
- useCallback( () => {
27
- const _hasMultiSelection = hasMultiSelection();
28
- const clientIds = _hasMultiSelection
29
- ? getMultiSelectedBlockClientIds()
30
- : [ clientId ];
31
- const clonedBlocks = clientIds.map( ( _clientId ) =>
32
- cloneBlock( getBlock( _clientId ) )
33
- );
34
- const previousSiblingId = getPreviousBlockClientId( clientId );
35
- const newListItem = cloneBlock( getBlock( previousSiblingId ) );
36
- // If the sibling has no innerBlocks, create a new `list` block.
37
- if ( ! newListItem.innerBlocks?.length ) {
38
- newListItem.innerBlocks = [ createBlock( 'core/list' ) ];
39
- }
40
- // A list item usually has one `list`, but it's possible to have
41
- // more. So we need to preserve the previous `list` blocks and
42
- // merge the new blocks to the last `list`.
43
- newListItem.innerBlocks[
44
- newListItem.innerBlocks.length - 1
45
- ].innerBlocks.push( ...clonedBlocks );
20
+ return useCallback( () => {
21
+ const _hasMultiSelection = hasMultiSelection();
22
+ const clientIds = _hasMultiSelection
23
+ ? getMultiSelectedBlockClientIds()
24
+ : [ clientId ];
25
+ const clonedBlocks = clientIds.map( ( _clientId ) =>
26
+ cloneBlock( getBlock( _clientId ) )
27
+ );
28
+ const previousSiblingId = getPreviousBlockClientId( clientId );
29
+ const newListItem = cloneBlock( getBlock( previousSiblingId ) );
30
+ // If the sibling has no innerBlocks, create a new `list` block.
31
+ if ( ! newListItem.innerBlocks?.length ) {
32
+ newListItem.innerBlocks = [ createBlock( 'core/list' ) ];
33
+ }
34
+ // A list item usually has one `list`, but it's possible to have
35
+ // more. So we need to preserve the previous `list` blocks and
36
+ // merge the new blocks to the last `list`.
37
+ newListItem.innerBlocks[
38
+ newListItem.innerBlocks.length - 1
39
+ ].innerBlocks.push( ...clonedBlocks );
46
40
 
47
- // We get the selection start/end here, because when
48
- // we replace blocks, the selection is updated too.
49
- const selectionStart = getSelectionStart();
50
- const selectionEnd = getSelectionEnd();
51
- // Replace the previous sibling of the block being indented and the indented blocks,
52
- // with a new block whose attributes are equal to the ones of the previous sibling and
53
- // whose descendants are the children of the previous sibling, followed by the indented blocks.
54
- replaceBlocks(
55
- [ previousSiblingId, ...clientIds ],
56
- [ newListItem ]
41
+ // We get the selection start/end here, because when
42
+ // we replace blocks, the selection is updated too.
43
+ const selectionStart = getSelectionStart();
44
+ const selectionEnd = getSelectionEnd();
45
+ // Replace the previous sibling of the block being indented and the indented blocks,
46
+ // with a new block whose attributes are equal to the ones of the previous sibling and
47
+ // whose descendants are the children of the previous sibling, followed by the indented blocks.
48
+ replaceBlocks( [ previousSiblingId, ...clientIds ], [ newListItem ] );
49
+ if ( ! _hasMultiSelection ) {
50
+ selectionChange(
51
+ clonedBlocks[ 0 ].clientId,
52
+ selectionEnd.attributeKey,
53
+ selectionEnd.clientId === selectionStart.clientId
54
+ ? selectionStart.offset
55
+ : selectionEnd.offset,
56
+ selectionEnd.offset
57
+ );
58
+ } else {
59
+ multiSelect(
60
+ clonedBlocks[ 0 ].clientId,
61
+ clonedBlocks[ clonedBlocks.length - 1 ].clientId
57
62
  );
58
- if ( ! _hasMultiSelection ) {
59
- selectionChange(
60
- clonedBlocks[ 0 ].clientId,
61
- selectionEnd.attributeKey,
62
- selectionEnd.clientId === selectionStart.clientId
63
- ? selectionStart.offset
64
- : selectionEnd.offset,
65
- selectionEnd.offset
66
- );
67
- } else {
68
- multiSelect(
69
- clonedBlocks[ 0 ].clientId,
70
- clonedBlocks[ clonedBlocks.length - 1 ].clientId
71
- );
72
- }
73
- }, [ clientId ] ),
74
- ];
63
+ }
64
+ }, [ clientId ] );
75
65
  }
@@ -20,7 +20,7 @@ export default function useMerge( clientId, onMerge ) {
20
20
  } = useSelect( blockEditorStore );
21
21
  const { mergeBlocks, moveBlocksToPosition } =
22
22
  useDispatch( blockEditorStore );
23
- const [ , outdentListItem ] = useOutdentListItem( clientId );
23
+ const outdentListItem = useOutdentListItem();
24
24
 
25
25
  function getTrailingId( id ) {
26
26
  const order = getBlockOrder( id );
@@ -6,24 +6,8 @@ import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
6
6
  import { store as blockEditorStore } from '@wordpress/block-editor';
7
7
  import { cloneBlock } from '@wordpress/blocks';
8
8
 
9
- export default function useOutdentListItem( clientId ) {
9
+ export default function useOutdentListItem() {
10
10
  const registry = useRegistry();
11
- const { canOutdent } = useSelect(
12
- ( innerSelect ) => {
13
- const { getBlockRootClientId, getBlockName } =
14
- innerSelect( blockEditorStore );
15
- const grandParentId = getBlockRootClientId(
16
- getBlockRootClientId( clientId )
17
- );
18
- const grandParentName = getBlockName( grandParentId );
19
- const isListItem = grandParentName === 'core/list-item';
20
-
21
- return {
22
- canOutdent: isListItem,
23
- };
24
- },
25
- [ clientId ]
26
- );
27
11
  const {
28
12
  moveBlocksToPosition,
29
13
  removeBlock,
@@ -48,69 +32,66 @@ export default function useOutdentListItem( clientId ) {
48
32
  return parentListItemId;
49
33
  }
50
34
 
51
- return [
52
- canOutdent,
53
- useCallback( ( clientIds = getSelectedBlockClientIds() ) => {
54
- if ( ! Array.isArray( clientIds ) ) {
55
- clientIds = [ clientIds ];
56
- }
57
-
58
- if ( ! clientIds.length ) return;
35
+ return useCallback( ( clientIds = getSelectedBlockClientIds() ) => {
36
+ if ( ! Array.isArray( clientIds ) ) {
37
+ clientIds = [ clientIds ];
38
+ }
59
39
 
60
- const firstClientId = clientIds[ 0 ];
40
+ if ( ! clientIds.length ) return;
61
41
 
62
- // Can't outdent if it's not a list item.
63
- if ( getBlockName( firstClientId ) !== 'core/list-item' ) return;
42
+ const firstClientId = clientIds[ 0 ];
64
43
 
65
- const parentListItemId = getParentListItemId( firstClientId );
44
+ // Can't outdent if it's not a list item.
45
+ if ( getBlockName( firstClientId ) !== 'core/list-item' ) return;
66
46
 
67
- // Can't outdent if it's at the top level.
68
- if ( ! parentListItemId ) return;
47
+ const parentListItemId = getParentListItemId( firstClientId );
69
48
 
70
- const parentListId = getBlockRootClientId( firstClientId );
71
- const lastClientId = clientIds[ clientIds.length - 1 ];
72
- const order = getBlockOrder( parentListId );
73
- const followingListItems = order.slice(
74
- getBlockIndex( lastClientId ) + 1
75
- );
49
+ // Can't outdent if it's at the top level.
50
+ if ( ! parentListItemId ) return;
76
51
 
77
- registry.batch( () => {
78
- if ( followingListItems.length ) {
79
- let nestedListId = getBlockOrder( firstClientId )[ 0 ];
52
+ const parentListId = getBlockRootClientId( firstClientId );
53
+ const lastClientId = clientIds[ clientIds.length - 1 ];
54
+ const order = getBlockOrder( parentListId );
55
+ const followingListItems = order.slice(
56
+ getBlockIndex( lastClientId ) + 1
57
+ );
80
58
 
81
- if ( ! nestedListId ) {
82
- const nestedListBlock = cloneBlock(
83
- getBlock( parentListId ),
84
- {},
85
- []
86
- );
87
- nestedListId = nestedListBlock.clientId;
88
- insertBlock( nestedListBlock, 0, firstClientId, false );
89
- // Immediately update the block list settings, otherwise
90
- // blocks can't be moved here due to canInsert checks.
91
- updateBlockListSettings(
92
- nestedListId,
93
- getBlockListSettings( parentListId )
94
- );
95
- }
59
+ registry.batch( () => {
60
+ if ( followingListItems.length ) {
61
+ let nestedListId = getBlockOrder( firstClientId )[ 0 ];
96
62
 
97
- moveBlocksToPosition(
98
- followingListItems,
99
- parentListId,
100
- nestedListId
63
+ if ( ! nestedListId ) {
64
+ const nestedListBlock = cloneBlock(
65
+ getBlock( parentListId ),
66
+ {},
67
+ []
68
+ );
69
+ nestedListId = nestedListBlock.clientId;
70
+ insertBlock( nestedListBlock, 0, firstClientId, false );
71
+ // Immediately update the block list settings, otherwise
72
+ // blocks can't be moved here due to canInsert checks.
73
+ updateBlockListSettings(
74
+ nestedListId,
75
+ getBlockListSettings( parentListId )
101
76
  );
102
77
  }
78
+
103
79
  moveBlocksToPosition(
104
- clientIds,
80
+ followingListItems,
105
81
  parentListId,
106
- getBlockRootClientId( parentListItemId ),
107
- getBlockIndex( parentListItemId ) + 1
82
+ nestedListId
108
83
  );
109
- if ( ! getBlockOrder( parentListId ).length ) {
110
- const shouldSelectParent = false;
111
- removeBlock( parentListId, shouldSelectParent );
112
- }
113
- } );
114
- }, [] ),
115
- ];
84
+ }
85
+ moveBlocksToPosition(
86
+ clientIds,
87
+ parentListId,
88
+ getBlockRootClientId( parentListItemId ),
89
+ getBlockIndex( parentListItemId ) + 1
90
+ );
91
+ if ( ! getBlockOrder( parentListId ).length ) {
92
+ const shouldSelectParent = false;
93
+ removeBlock( parentListId, shouldSelectParent );
94
+ }
95
+ } );
96
+ }, [] );
116
97
  }
@@ -12,9 +12,9 @@ import { useSelect } from '@wordpress/data';
12
12
  import useIndentListItem from './use-indent-list-item';
13
13
 
14
14
  export default function useSpace( clientId ) {
15
- const { getSelectionStart, getSelectionEnd } =
15
+ const { getSelectionStart, getSelectionEnd, getBlockIndex } =
16
16
  useSelect( blockEditorStore );
17
- const [ canIndent, indentListItem ] = useIndentListItem( clientId );
17
+ const indentListItem = useIndentListItem( clientId );
18
18
 
19
19
  return useRefEffect(
20
20
  ( element ) => {
@@ -23,7 +23,6 @@ export default function useSpace( clientId ) {
23
23
 
24
24
  if (
25
25
  event.defaultPrevented ||
26
- ! canIndent ||
27
26
  keyCode !== SPACE ||
28
27
  // Only override when no modifiers are pressed.
29
28
  shiftKey ||
@@ -34,6 +33,10 @@ export default function useSpace( clientId ) {
34
33
  return;
35
34
  }
36
35
 
36
+ if ( getBlockIndex( clientId ) === 0 ) {
37
+ return;
38
+ }
39
+
37
40
  const selectionStart = getSelectionStart();
38
41
  const selectionEnd = getSelectionEnd();
39
42
  if (
@@ -50,6 +53,6 @@ export default function useSpace( clientId ) {
50
53
  element.removeEventListener( 'keydown', onKeyDown );
51
54
  };
52
55
  },
53
- [ canIndent, indentListItem ]
56
+ [ clientId, indentListItem ]
54
57
  );
55
58
  }
@@ -170,7 +170,7 @@ class MediaContainer extends Component {
170
170
  mediaWidth,
171
171
  shouldStack,
172
172
  } = this.props;
173
- const { isUploadFailed, retryMessage } = params;
173
+ const { isUploadFailed, isUploadPaused, retryMessage } = params;
174
174
  const focalPointValues = ! focalPoint
175
175
  ? IMAGE_DEFAULT_FOCAL_POINT
176
176
  : focalPoint;
@@ -203,6 +203,7 @@ class MediaContainer extends Component {
203
203
  focalPoint={ imageFill && focalPointValues }
204
204
  isSelected={ isMediaSelected }
205
205
  isUploadFailed={ isUploadFailed }
206
+ isUploadPaused={ isUploadPaused }
206
207
  isUploadInProgress={ isUploadInProgress }
207
208
  onSelectMediaUploadOption={
208
209
  this.onSelectMediaUploadOption
@@ -340,6 +341,7 @@ class MediaContainer extends Component {
340
341
  { getMediaOptions() }
341
342
 
342
343
  <MediaUploadProgress
344
+ enablePausedUploads
343
345
  coverUrl={ coverUrl }
344
346
  mediaId={ mediaId }
345
347
  onUpdateMediaProgress={
@@ -37,3 +37,5 @@ export const SELECT_NAVIGATION_MENUS_ARGS = [
37
37
  'wp_navigation',
38
38
  PRELOADED_NAVIGATION_MENUS_QUERY,
39
39
  ];
40
+
41
+ export const NAVIGATION_MOBILE_COLLAPSE = '600px';
@@ -24,7 +24,6 @@ import {
24
24
  getColorClassName,
25
25
  Warning,
26
26
  __experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,
27
- __experimentalUseBlockOverlayActive as useBlockOverlayActive,
28
27
  __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
29
28
  useBlockEditingMode,
30
29
  } from '@wordpress/block-editor';
@@ -43,7 +42,7 @@ import {
43
42
  import { __, sprintf } from '@wordpress/i18n';
44
43
  import { speak } from '@wordpress/a11y';
45
44
  import { close, Icon } from '@wordpress/icons';
46
- import { useInstanceId } from '@wordpress/compose';
45
+ import { useInstanceId, useMediaQuery } from '@wordpress/compose';
47
46
 
48
47
  /**
49
48
  * Internal dependencies
@@ -72,6 +71,7 @@ import MenuInspectorControls from './menu-inspector-controls';
72
71
  import DeletedNavigationWarning from './deleted-navigation-warning';
73
72
  import AccessibleDescription from './accessible-description';
74
73
  import AccessibleMenuDescription from './accessible-menu-description';
74
+ import { NAVIGATION_MOBILE_COLLAPSE } from '../constants';
75
75
  import { unlock } from '../../lock-unlock';
76
76
 
77
77
  function Navigation( {
@@ -290,8 +290,22 @@ function Navigation( {
290
290
 
291
291
  const textDecoration = attributes.style?.typography?.textDecoration;
292
292
 
293
- const hasBlockOverlay = useBlockOverlayActive( clientId );
293
+ const hasBlockOverlay = useSelect(
294
+ ( select ) =>
295
+ select( blockEditorStore ).__unstableHasActiveBlockOverlayActive(
296
+ clientId
297
+ ),
298
+ [ clientId ]
299
+ );
294
300
  const isResponsive = 'never' !== overlayMenu;
301
+ const isMobileBreakPoint = useMediaQuery(
302
+ `(max-width: ${ NAVIGATION_MOBILE_COLLAPSE })`
303
+ );
304
+
305
+ const isCollapsed =
306
+ ( 'mobile' === overlayMenu && isMobileBreakPoint ) ||
307
+ 'always' === overlayMenu;
308
+
295
309
  const blockProps = useBlockProps( {
296
310
  ref: navRef,
297
311
  className: classnames(
@@ -305,6 +319,7 @@ function Navigation( {
305
319
  'is-vertical': orientation === 'vertical',
306
320
  'no-wrap': flexWrap === 'nowrap',
307
321
  'is-responsive': isResponsive,
322
+ 'is-collapsed': isCollapsed,
308
323
  'has-text-color': !! textColor.color || !! textColor?.class,
309
324
  [ getColorClassName( 'color', textColor?.slug ) ]:
310
325
  !! textColor?.slug,
@@ -429,7 +429,7 @@ $color-control-label-height: 20px;
429
429
  // These needs extra specificity in the editor.
430
430
  .wp-block-navigation__responsive-container:not(.is-menu-open) {
431
431
  .components-button.wp-block-navigation__responsive-container-close {
432
- @include break-small {
432
+ .is-collapsed & {
433
433
  display: none;
434
434
  }
435
435
  }
@@ -75,7 +75,7 @@ if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
75
75
  function block_core_navigation_get_inner_blocks_from_unstable_location( $attributes ) {
76
76
  $menu_items = block_core_navigation_get_menu_items_at_location( $attributes['__unstableLocation'] );
77
77
  if ( empty( $menu_items ) ) {
78
- return '';
78
+ return new WP_Block_List( array(), $attributes );
79
79
  }
80
80
 
81
81
  $menu_items_by_parent_id = block_core_navigation_sort_menu_items_by_parent_id( $menu_items );
@@ -611,18 +611,19 @@ button.wp-block-navigation-item__content {
611
611
  }
612
612
  }
613
613
 
614
- @include break-small() {
615
- &:not(.hidden-by-default) {
616
- &:not(.is-menu-open) {
617
- display: block;
618
- width: 100%;
619
- position: relative;
620
- z-index: auto;
621
- background-color: inherit;
622
-
623
- .wp-block-navigation__responsive-container-close {
624
- display: none;
625
- }
614
+ // When the menu is collapsed, the menu button is visible.
615
+ // We are using the > selector combined with the :not(is-collapsed) selector
616
+ // as a way to target the class being added to the parent nav element.
617
+ :not(.is-collapsed) > & {
618
+ &:not(.is-menu-open) {
619
+ display: block;
620
+ width: 100%;
621
+ position: relative;
622
+ z-index: auto;
623
+ background-color: inherit;
624
+
625
+ .wp-block-navigation__responsive-container-close {
626
+ display: none;
626
627
  }
627
628
  }
628
629
 
@@ -686,10 +687,11 @@ button.wp-block-navigation-item__content {
686
687
  font-size: inherit;
687
688
  }
688
689
 
689
- &:not(.always-shown) {
690
- @include break-small {
691
- display: none;
692
- }
690
+ // When the menu is collapsed, the menu button is visible.
691
+ // We are using the > selector combined with the :not(is-collapsed) selector
692
+ // as a way to target the class being added to the parent nav element.
693
+ :not(.is-collapsed) > & {
694
+ display: none;
693
695
  }
694
696
  }
695
697
 
@@ -3,6 +3,11 @@
3
3
  */
4
4
  import { store, getContext, getElement } from '@wordpress/interactivity';
5
5
 
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { NAVIGATION_MOBILE_COLLAPSE } from './constants';
10
+
6
11
  const focusableSelectors = [
7
12
  'a[href]',
8
13
  'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',
@@ -180,10 +185,31 @@ const { state, actions } = store( 'core/navigation', {
180
185
  focusFirstElement() {
181
186
  const { ref } = getElement();
182
187
  if ( state.isMenuOpen ) {
183
- ref.querySelector(
184
- '.wp-block-navigation-item > *:first-child'
185
- ).focus();
188
+ const focusableElements =
189
+ ref.querySelectorAll( focusableSelectors );
190
+ focusableElements?.[ 0 ]?.focus();
191
+ }
192
+ },
193
+ initNav() {
194
+ const context = getContext();
195
+ const mediaQuery = window.matchMedia(
196
+ `(max-width: ${ NAVIGATION_MOBILE_COLLAPSE })`
197
+ );
198
+
199
+ // Run once to set the initial state.
200
+ context.isCollapsed = mediaQuery.matches;
201
+
202
+ function handleCollapse( event ) {
203
+ context.isCollapsed = event.matches;
186
204
  }
205
+
206
+ // Run on resize to update the state.
207
+ mediaQuery.addEventListener( 'change', handleCollapse );
208
+
209
+ // Remove the listener when the component is unmounted.
210
+ return () => {
211
+ mediaQuery.removeEventListener( 'change', handleCollapse );
212
+ };
187
213
  },
188
214
  },
189
215
  } );
@@ -30,7 +30,7 @@ exports[`hooks enhanceNavigationLinkVariations enhances variations with icon and
30
30
  xmlns="http://www.w3.org/2000/svg"
31
31
  >
32
32
  <Path
33
- d="M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"
33
+ d="M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z"
34
34
  />
35
35
  </SVG>,
36
36
  "isActive": [Function],
@@ -47,7 +47,10 @@ exports[`hooks enhanceNavigationLinkVariations enhances variations with icon and
47
47
  xmlns="http://www.w3.org/2000/svg"
48
48
  >
49
49
  <Path
50
- d="M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"
50
+ d="M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"
51
+ />
52
+ <Path
53
+ d="M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"
51
54
  />
52
55
  </SVG>,
53
56
  "isActive": [Function],
@@ -83,7 +86,7 @@ exports[`hooks enhanceNavigationLinkVariations enhances variations with icon and
83
86
  xmlns="http://www.w3.org/2000/svg"
84
87
  >
85
88
  <Path
86
- d="M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"
89
+ d="M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"
87
90
  />
88
91
  </SVG>,
89
92
  "isActive": [Function],
@@ -5,7 +5,7 @@ import { Button, Modal } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  export const convertDescription = __(
8
- 'This page list is synced with the published pages on your site. Detach the page list to add, delete, or reorder pages yourself.'
8
+ "This navigation menu displays your website's pages. Editing it will enable you to add, delete, or reorder pages. However, new pages will no longer be added automatically."
9
9
  );
10
10
 
11
11
  export function ConvertToLinksModal( { onClick, onClose, disabled } ) {
@@ -30,7 +30,7 @@ export function ConvertToLinksModal( { onClick, onClose, disabled } ) {
30
30
  disabled={ disabled }
31
31
  onClick={ onClick }
32
32
  >
33
- { __( 'Detach' ) }
33
+ { __( 'Edit' ) }
34
34
  </Button>
35
35
  </div>
36
36
  </Modal>
@@ -13,10 +13,9 @@
13
13
  "type": "string"
14
14
  },
15
15
  "content": {
16
- "type": "string",
17
- "source": "html",
16
+ "type": "rich-text",
17
+ "source": "rich-text",
18
18
  "selector": "p",
19
- "default": "",
20
19
  "__experimentalRole": "content"
21
20
  },
22
21
  "dropCap": {
@@ -42,7 +41,6 @@
42
41
  "text": true
43
42
  }
44
43
  },
45
- "__experimentalConnections": true,
46
44
  "spacing": {
47
45
  "margin": true,
48
46
  "padding": true,