@wordpress/block-library 7.19.0 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (862) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/build/audio/edit.native.js +1 -3
  3. package/build/audio/edit.native.js.map +1 -1
  4. package/build/audio/index.js +2 -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/user-control.js +1 -0
  9. package/build/avatar/user-control.js.map +1 -1
  10. package/build/block/edit.js +14 -2
  11. package/build/block/edit.js.map +1 -1
  12. package/build/block/edit.native.js +14 -6
  13. package/build/block/edit.native.js.map +1 -1
  14. package/build/block/index.js +1 -2
  15. package/build/block/index.js.map +1 -1
  16. package/build/button/edit.native.js.map +1 -1
  17. package/build/categories/edit.js +1 -1
  18. package/build/categories/edit.js.map +1 -1
  19. package/build/code/transforms.js +1 -1
  20. package/build/code/transforms.js.map +1 -1
  21. package/build/columns/edit.js +1 -0
  22. package/build/columns/edit.js.map +1 -1
  23. package/build/columns/edit.native.js +13 -30
  24. package/build/columns/edit.native.js.map +1 -1
  25. package/build/comment-author-avatar/edit.js +1 -0
  26. package/build/comment-author-avatar/edit.js.map +1 -1
  27. package/build/cover/edit/inspector-controls.js +3 -1
  28. package/build/cover/edit/inspector-controls.js.map +1 -1
  29. package/build/cover/edit.native.js +24 -16
  30. package/build/cover/edit.native.js.map +1 -1
  31. package/build/embed/embed-controls.native.js +1 -0
  32. package/build/embed/embed-controls.native.js.map +1 -1
  33. package/build/embed/embed-preview.native.js +1 -3
  34. package/build/embed/embed-preview.native.js.map +1 -1
  35. package/build/file/inspector.js +1 -0
  36. package/build/file/inspector.js.map +1 -1
  37. package/build/freeform/edit.js +21 -6
  38. package/build/freeform/edit.js.map +1 -1
  39. package/build/freeform/modal.js +97 -0
  40. package/build/freeform/modal.js.map +1 -0
  41. package/build/gallery/edit.js +38 -15
  42. package/build/gallery/edit.js.map +1 -1
  43. package/build/gallery/gallery.js +2 -16
  44. package/build/gallery/gallery.js.map +1 -1
  45. package/build/gallery/gallery.native.js +1 -3
  46. package/build/gallery/gallery.native.js.map +1 -1
  47. package/build/gallery/shared.js +4 -10
  48. package/build/gallery/shared.js.map +1 -1
  49. package/build/gallery/transforms.js +1 -7
  50. package/build/gallery/transforms.js.map +1 -1
  51. package/build/gallery/use-get-media.js +1 -1
  52. package/build/gallery/use-get-media.js.map +1 -1
  53. package/build/gallery/use-get-media.native.js +3 -1
  54. package/build/gallery/use-get-media.native.js.map +1 -1
  55. package/build/gallery/v1/edit.js +22 -15
  56. package/build/gallery/v1/edit.js.map +1 -1
  57. package/build/gallery/v1/gallery.native.js +1 -3
  58. package/build/gallery/v1/gallery.native.js.map +1 -1
  59. package/build/gallery/v1/shared.js +4 -1
  60. package/build/gallery/v1/shared.js.map +1 -1
  61. package/build/group/edit.js +1 -2
  62. package/build/group/edit.js.map +1 -1
  63. package/build/group/index.js +3 -1
  64. package/build/group/index.js.map +1 -1
  65. package/build/group/placeholder.js +5 -26
  66. package/build/group/placeholder.js.map +1 -1
  67. package/build/heading/deprecated.js +152 -69
  68. package/build/heading/deprecated.js.map +1 -1
  69. package/build/heading/index.js +1 -2
  70. package/build/heading/index.js.map +1 -1
  71. package/build/heading/transforms.js +1 -2
  72. package/build/heading/transforms.js.map +1 -1
  73. package/build/html/index.js +1 -1
  74. package/build/image/edit.js +8 -5
  75. package/build/image/edit.js.map +1 -1
  76. package/build/image/edit.native.js +3 -2
  77. package/build/image/edit.native.js.map +1 -1
  78. package/build/image/image.js +13 -8
  79. package/build/image/image.js.map +1 -1
  80. package/build/index.js +3 -1
  81. package/build/index.js.map +1 -1
  82. package/build/latest-comments/edit.js +1 -0
  83. package/build/latest-comments/edit.js.map +1 -1
  84. package/build/latest-posts/edit.js +2 -0
  85. package/build/latest-posts/edit.js.map +1 -1
  86. package/build/list/transforms.js +1 -9
  87. package/build/list/transforms.js.map +1 -1
  88. package/build/list/utils.js +5 -2
  89. package/build/list/utils.js.map +1 -1
  90. package/build/list-item/index.js +4 -1
  91. package/build/list-item/index.js.map +1 -1
  92. package/build/list-item/transforms.js +22 -0
  93. package/build/list-item/transforms.js.map +1 -0
  94. package/build/list-item/utils.js +77 -1
  95. package/build/list-item/utils.js.map +1 -1
  96. package/build/media-text/edit.js +5 -2
  97. package/build/media-text/edit.js.map +1 -1
  98. package/build/missing/edit.native.js +2 -2
  99. package/build/missing/edit.native.js.map +1 -1
  100. package/build/navigation/edit/are-blocks-dirty.js +52 -0
  101. package/build/navigation/edit/are-blocks-dirty.js.map +1 -0
  102. package/build/navigation/edit/index.js +95 -117
  103. package/build/navigation/edit/index.js.map +1 -1
  104. package/build/navigation/edit/menu-inspector-controls.js +94 -0
  105. package/build/navigation/edit/menu-inspector-controls.js.map +1 -0
  106. package/build/navigation/edit/navigation-menu-selector.js +2 -4
  107. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  108. package/build/navigation/edit/unsaved-inner-blocks.js +11 -7
  109. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  110. package/build/navigation/edit/utils.js +81 -0
  111. package/build/navigation/edit/utils.js.map +1 -1
  112. package/build/navigation/view-modal.js +6 -2
  113. package/build/navigation/view-modal.js.map +1 -1
  114. package/build/navigation-link/edit.js +46 -356
  115. package/build/navigation-link/edit.js.map +1 -1
  116. package/build/navigation-link/link-ui.js +222 -0
  117. package/build/navigation-link/link-ui.js.map +1 -0
  118. package/build/navigation-link/transforms.js +12 -0
  119. package/build/navigation-link/transforms.js.map +1 -1
  120. package/build/navigation-link/update-attributes.js +108 -0
  121. package/build/navigation-link/update-attributes.js.map +1 -0
  122. package/build/navigation-submenu/edit.js +49 -245
  123. package/build/navigation-submenu/edit.js.map +1 -1
  124. package/build/page-list/constants.js +15 -0
  125. package/build/page-list/constants.js.map +1 -0
  126. package/build/page-list/convert-to-links-modal.js +22 -86
  127. package/build/page-list/convert-to-links-modal.js.map +1 -1
  128. package/build/page-list/convert-to-navigation-links.js +76 -0
  129. package/build/page-list/convert-to-navigation-links.js.map +1 -0
  130. package/build/page-list/edit.js +143 -78
  131. package/build/page-list/edit.js.map +1 -1
  132. package/build/page-list/index.js +35 -3
  133. package/build/page-list/index.js.map +1 -1
  134. package/build/page-list-item/edit.js +91 -0
  135. package/build/page-list-item/edit.js.map +1 -0
  136. package/build/page-list-item/index.js +85 -0
  137. package/build/page-list-item/index.js.map +1 -0
  138. package/build/page-list-item/init.js +16 -0
  139. package/build/page-list-item/init.js.map +1 -0
  140. package/build/paragraph/index.js +1 -7
  141. package/build/paragraph/index.js.map +1 -1
  142. package/build/post-author/edit.js +3 -2
  143. package/build/post-author/edit.js.map +1 -1
  144. package/build/post-featured-image/overlay.js +1 -1
  145. package/build/post-featured-image/overlay.js.map +1 -1
  146. package/build/post-template/index.js +8 -0
  147. package/build/post-template/index.js.map +1 -1
  148. package/build/preformatted/transforms.js +3 -1
  149. package/build/preformatted/transforms.js.map +1 -1
  150. package/build/query/deprecated.js +192 -21
  151. package/build/query/deprecated.js.map +1 -1
  152. package/build/query/edit/index.js +2 -1
  153. package/build/query/edit/index.js.map +1 -1
  154. package/build/query/edit/inspector-controls/index.js +11 -5
  155. package/build/query/edit/inspector-controls/index.js.map +1 -1
  156. package/build/query/edit/inspector-controls/taxonomy-controls.js +101 -37
  157. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  158. package/build/query/edit/query-content.js +2 -3
  159. package/build/query/edit/query-content.js.map +1 -1
  160. package/build/query/edit/query-placeholder.js +16 -27
  161. package/build/query/edit/query-placeholder.js.map +1 -1
  162. package/build/query/index.js +0 -8
  163. package/build/query/index.js.map +1 -1
  164. package/build/query/utils.js +73 -9
  165. package/build/query/utils.js.map +1 -1
  166. package/build/rss/edit.js +3 -0
  167. package/build/rss/edit.js.map +1 -1
  168. package/build/search/edit.js +2 -2
  169. package/build/search/edit.js.map +1 -1
  170. package/build/search/edit.native.js +22 -22
  171. package/build/search/edit.native.js.map +1 -1
  172. package/build/search/index.js +9 -1
  173. package/build/search/index.js.map +1 -1
  174. package/build/site-logo/edit.js +17 -9
  175. package/build/site-logo/edit.js.map +1 -1
  176. package/build/site-logo/index.js +1 -0
  177. package/build/site-logo/index.js.map +1 -1
  178. package/build/site-title/index.js +1 -0
  179. package/build/site-title/index.js.map +1 -1
  180. package/build/social-link/edit.js.map +1 -1
  181. package/build/social-link/social-list.js +4 -12
  182. package/build/social-link/social-list.js.map +1 -1
  183. package/build/social-links/edit.js +0 -1
  184. package/build/social-links/edit.js.map +1 -1
  185. package/build/table/edit.js +3 -1
  186. package/build/table/edit.js.map +1 -1
  187. package/build/table/index.js +17 -1
  188. package/build/table/index.js.map +1 -1
  189. package/build/table/save.js +4 -2
  190. package/build/table/save.js.map +1 -1
  191. package/build/table/state.js +24 -12
  192. package/build/table/state.js.map +1 -1
  193. package/build/table/transforms.js +3 -2
  194. package/build/table/transforms.js.map +1 -1
  195. package/build/table-of-contents/edit.js +3 -3
  196. package/build/table-of-contents/edit.js.map +1 -1
  197. package/build/tag-cloud/edit.js +2 -1
  198. package/build/tag-cloud/edit.js.map +1 -1
  199. package/build/template-part/edit/advanced-controls.js +11 -1
  200. package/build/template-part/edit/advanced-controls.js.map +1 -1
  201. package/build/template-part/edit/import-controls.js +160 -0
  202. package/build/template-part/edit/import-controls.js.map +1 -0
  203. package/build/template-part/edit/index.js +2 -1
  204. package/build/template-part/edit/index.js.map +1 -1
  205. package/build/template-part/edit/selection-modal.js +5 -2
  206. package/build/template-part/edit/selection-modal.js.map +1 -1
  207. package/build/template-part/edit/utils/hooks.js +2 -6
  208. package/build/template-part/edit/utils/hooks.js.map +1 -1
  209. package/build/template-part/edit/utils/transformers.js +48 -0
  210. package/build/template-part/edit/utils/transformers.js.map +1 -0
  211. package/build/text-columns/edit.js +1 -0
  212. package/build/text-columns/edit.js.map +1 -1
  213. package/build/utils/transformation-categories.native.js +1 -1
  214. package/build/utils/transformation-categories.native.js.map +1 -1
  215. package/build/video/edit.js +1 -1
  216. package/build/video/edit.js.map +1 -1
  217. package/build/video/edit.native.js +1 -3
  218. package/build/video/edit.native.js.map +1 -1
  219. package/build-module/audio/edit.native.js +1 -2
  220. package/build-module/audio/edit.native.js.map +1 -1
  221. package/build-module/audio/index.js +2 -1
  222. package/build-module/audio/index.js.map +1 -1
  223. package/build-module/avatar/edit.js +1 -0
  224. package/build-module/avatar/edit.js.map +1 -1
  225. package/build-module/avatar/user-control.js +1 -0
  226. package/build-module/avatar/user-control.js.map +1 -1
  227. package/build-module/block/edit.js +14 -2
  228. package/build-module/block/edit.js.map +1 -1
  229. package/build-module/block/edit.native.js +14 -6
  230. package/build-module/block/edit.native.js.map +1 -1
  231. package/build-module/block/index.js +1 -2
  232. package/build-module/block/index.js.map +1 -1
  233. package/build-module/button/edit.native.js +2 -1
  234. package/build-module/button/edit.native.js.map +1 -1
  235. package/build-module/categories/edit.js +1 -1
  236. package/build-module/categories/edit.js.map +1 -1
  237. package/build-module/code/transforms.js +1 -1
  238. package/build-module/code/transforms.js.map +1 -1
  239. package/build-module/columns/edit.js +1 -0
  240. package/build-module/columns/edit.js.map +1 -1
  241. package/build-module/columns/edit.native.js +13 -29
  242. package/build-module/columns/edit.native.js.map +1 -1
  243. package/build-module/comment-author-avatar/edit.js +1 -0
  244. package/build-module/comment-author-avatar/edit.js.map +1 -1
  245. package/build-module/cover/edit/inspector-controls.js +5 -3
  246. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  247. package/build-module/cover/edit.native.js +22 -14
  248. package/build-module/cover/edit.native.js.map +1 -1
  249. package/build-module/embed/embed-controls.native.js +2 -1
  250. package/build-module/embed/embed-controls.native.js.map +1 -1
  251. package/build-module/embed/embed-preview.native.js +1 -2
  252. package/build-module/embed/embed-preview.native.js.map +1 -1
  253. package/build-module/file/inspector.js +1 -0
  254. package/build-module/file/inspector.js.map +1 -1
  255. package/build-module/freeform/edit.js +22 -8
  256. package/build-module/freeform/edit.js.map +1 -1
  257. package/build-module/freeform/modal.js +90 -0
  258. package/build-module/freeform/modal.js.map +1 -0
  259. package/build-module/gallery/edit.js +39 -15
  260. package/build-module/gallery/edit.js.map +1 -1
  261. package/build-module/gallery/gallery.js +3 -16
  262. package/build-module/gallery/gallery.js.map +1 -1
  263. package/build-module/gallery/gallery.native.js +1 -2
  264. package/build-module/gallery/gallery.native.js.map +1 -1
  265. package/build-module/gallery/shared.js +5 -11
  266. package/build-module/gallery/shared.js.map +1 -1
  267. package/build-module/gallery/transforms.js +1 -6
  268. package/build-module/gallery/transforms.js.map +1 -1
  269. package/build-module/gallery/use-get-media.js +1 -1
  270. package/build-module/gallery/use-get-media.js.map +1 -1
  271. package/build-module/gallery/use-get-media.native.js +3 -1
  272. package/build-module/gallery/use-get-media.native.js.map +1 -1
  273. package/build-module/gallery/v1/edit.js +23 -16
  274. package/build-module/gallery/v1/edit.js.map +1 -1
  275. package/build-module/gallery/v1/gallery.native.js +1 -2
  276. package/build-module/gallery/v1/gallery.native.js.map +1 -1
  277. package/build-module/gallery/v1/shared.js +5 -2
  278. package/build-module/gallery/v1/shared.js.map +1 -1
  279. package/build-module/group/edit.js +1 -3
  280. package/build-module/group/edit.js.map +1 -1
  281. package/build-module/group/index.js +3 -1
  282. package/build-module/group/index.js.map +1 -1
  283. package/build-module/group/placeholder.js +5 -26
  284. package/build-module/group/placeholder.js.map +1 -1
  285. package/build-module/heading/deprecated.js +152 -69
  286. package/build-module/heading/deprecated.js.map +1 -1
  287. package/build-module/heading/index.js +1 -2
  288. package/build-module/heading/index.js.map +1 -1
  289. package/build-module/heading/transforms.js +1 -2
  290. package/build-module/heading/transforms.js.map +1 -1
  291. package/build-module/html/index.js +1 -1
  292. package/build-module/image/edit.js +9 -6
  293. package/build-module/image/edit.js.map +1 -1
  294. package/build-module/image/edit.native.js +2 -1
  295. package/build-module/image/edit.native.js.map +1 -1
  296. package/build-module/image/image.js +14 -9
  297. package/build-module/image/image.js.map +1 -1
  298. package/build-module/index.js +2 -1
  299. package/build-module/index.js.map +1 -1
  300. package/build-module/latest-comments/edit.js +1 -0
  301. package/build-module/latest-comments/edit.js.map +1 -1
  302. package/build-module/latest-posts/edit.js +2 -0
  303. package/build-module/latest-posts/edit.js.map +1 -1
  304. package/build-module/list/transforms.js +1 -9
  305. package/build-module/list/transforms.js.map +1 -1
  306. package/build-module/list/utils.js +5 -2
  307. package/build-module/list/utils.js.map +1 -1
  308. package/build-module/list-item/index.js +3 -1
  309. package/build-module/list-item/index.js.map +1 -1
  310. package/build-module/list-item/transforms.js +13 -0
  311. package/build-module/list-item/transforms.js.map +1 -0
  312. package/build-module/list-item/utils.js +78 -1
  313. package/build-module/list-item/utils.js.map +1 -1
  314. package/build-module/media-text/edit.js +6 -3
  315. package/build-module/media-text/edit.js.map +1 -1
  316. package/build-module/missing/edit.native.js +2 -2
  317. package/build-module/missing/edit.native.js.map +1 -1
  318. package/build-module/navigation/edit/are-blocks-dirty.js +44 -0
  319. package/build-module/navigation/edit/are-blocks-dirty.js.map +1 -0
  320. package/build-module/navigation/edit/index.js +95 -118
  321. package/build-module/navigation/edit/index.js.map +1 -1
  322. package/build-module/navigation/edit/menu-inspector-controls.js +80 -0
  323. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -0
  324. package/build-module/navigation/edit/navigation-menu-selector.js +2 -4
  325. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  326. package/build-module/navigation/edit/unsaved-inner-blocks.js +9 -6
  327. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  328. package/build-module/navigation/edit/utils.js +75 -0
  329. package/build-module/navigation/edit/utils.js.map +1 -1
  330. package/build-module/navigation/view-modal.js +6 -2
  331. package/build-module/navigation/view-modal.js.map +1 -1
  332. package/build-module/navigation-link/edit.js +49 -357
  333. package/build-module/navigation-link/edit.js.map +1 -1
  334. package/build-module/navigation-link/link-ui.js +206 -0
  335. package/build-module/navigation-link/link-ui.js.map +1 -0
  336. package/build-module/navigation-link/transforms.js +12 -0
  337. package/build-module/navigation-link/transforms.js.map +1 -1
  338. package/build-module/navigation-link/update-attributes.js +97 -0
  339. package/build-module/navigation-link/update-attributes.js.map +1 -0
  340. package/build-module/navigation-submenu/edit.js +52 -246
  341. package/build-module/navigation-submenu/edit.js.map +1 -1
  342. package/build-module/page-list/constants.js +6 -0
  343. package/build-module/page-list/constants.js.map +1 -0
  344. package/build-module/page-list/convert-to-links-modal.js +20 -81
  345. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  346. package/build-module/page-list/convert-to-navigation-links.js +66 -0
  347. package/build-module/page-list/convert-to-navigation-links.js.map +1 -0
  348. package/build-module/page-list/edit.js +146 -82
  349. package/build-module/page-list/edit.js.map +1 -1
  350. package/build-module/page-list/index.js +36 -4
  351. package/build-module/page-list/index.js.map +1 -1
  352. package/build-module/page-list-item/edit.js +77 -0
  353. package/build-module/page-list-item/edit.js.map +1 -0
  354. package/build-module/page-list-item/index.js +68 -0
  355. package/build-module/page-list-item/index.js.map +1 -0
  356. package/build-module/page-list-item/init.js +6 -0
  357. package/build-module/page-list-item/init.js.map +1 -0
  358. package/build-module/paragraph/index.js +1 -7
  359. package/build-module/paragraph/index.js.map +1 -1
  360. package/build-module/post-author/edit.js +3 -2
  361. package/build-module/post-author/edit.js.map +1 -1
  362. package/build-module/post-featured-image/overlay.js +1 -1
  363. package/build-module/post-featured-image/overlay.js.map +1 -1
  364. package/build-module/post-template/index.js +8 -0
  365. package/build-module/post-template/index.js.map +1 -1
  366. package/build-module/preformatted/transforms.js +3 -1
  367. package/build-module/preformatted/transforms.js.map +1 -1
  368. package/build-module/query/deprecated.js +185 -21
  369. package/build-module/query/deprecated.js.map +1 -1
  370. package/build-module/query/edit/index.js +2 -1
  371. package/build-module/query/edit/index.js.map +1 -1
  372. package/build-module/query/edit/inspector-controls/index.js +11 -5
  373. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  374. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +99 -35
  375. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  376. package/build-module/query/edit/query-content.js +1 -1
  377. package/build-module/query/edit/query-content.js.map +1 -1
  378. package/build-module/query/edit/query-placeholder.js +15 -27
  379. package/build-module/query/edit/query-placeholder.js.map +1 -1
  380. package/build-module/query/index.js +0 -8
  381. package/build-module/query/index.js.map +1 -1
  382. package/build-module/query/utils.js +69 -8
  383. package/build-module/query/utils.js.map +1 -1
  384. package/build-module/rss/edit.js +3 -0
  385. package/build-module/rss/edit.js.map +1 -1
  386. package/build-module/search/edit.js +2 -2
  387. package/build-module/search/edit.js.map +1 -1
  388. package/build-module/search/edit.native.js +20 -20
  389. package/build-module/search/edit.native.js.map +1 -1
  390. package/build-module/search/index.js +8 -1
  391. package/build-module/search/index.js.map +1 -1
  392. package/build-module/site-logo/edit.js +17 -8
  393. package/build-module/site-logo/edit.js.map +1 -1
  394. package/build-module/site-logo/index.js +1 -0
  395. package/build-module/site-logo/index.js.map +1 -1
  396. package/build-module/site-title/index.js +1 -0
  397. package/build-module/site-title/index.js.map +1 -1
  398. package/build-module/social-link/edit.js +2 -2
  399. package/build-module/social-link/edit.js.map +1 -1
  400. package/build-module/social-link/social-list.js +2 -11
  401. package/build-module/social-link/social-list.js.map +1 -1
  402. package/build-module/social-links/edit.js +0 -1
  403. package/build-module/social-links/edit.js.map +1 -1
  404. package/build-module/table/edit.js +3 -1
  405. package/build-module/table/edit.js.map +1 -1
  406. package/build-module/table/index.js +17 -1
  407. package/build-module/table/index.js.map +1 -1
  408. package/build-module/table/save.js +4 -2
  409. package/build-module/table/save.js.map +1 -1
  410. package/build-module/table/state.js +25 -13
  411. package/build-module/table/state.js.map +1 -1
  412. package/build-module/table/transforms.js +3 -2
  413. package/build-module/table/transforms.js.map +1 -1
  414. package/build-module/table-of-contents/edit.js +3 -3
  415. package/build-module/table-of-contents/edit.js.map +1 -1
  416. package/build-module/tag-cloud/edit.js +3 -2
  417. package/build-module/tag-cloud/edit.js.map +1 -1
  418. package/build-module/template-part/edit/advanced-controls.js +10 -1
  419. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  420. package/build-module/template-part/edit/import-controls.js +146 -0
  421. package/build-module/template-part/edit/import-controls.js.map +1 -0
  422. package/build-module/template-part/edit/index.js +2 -1
  423. package/build-module/template-part/edit/index.js.map +1 -1
  424. package/build-module/template-part/edit/selection-modal.js +6 -3
  425. package/build-module/template-part/edit/selection-modal.js.map +1 -1
  426. package/build-module/template-part/edit/utils/hooks.js +3 -7
  427. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  428. package/build-module/template-part/edit/utils/transformers.js +40 -0
  429. package/build-module/template-part/edit/utils/transformers.js.map +1 -0
  430. package/build-module/text-columns/edit.js +1 -0
  431. package/build-module/text-columns/edit.js.map +1 -1
  432. package/build-module/utils/transformation-categories.native.js +1 -1
  433. package/build-module/utils/transformation-categories.native.js.map +1 -1
  434. package/build-module/video/edit.js +1 -1
  435. package/build-module/video/edit.js.map +1 -1
  436. package/build-module/video/edit.native.js +1 -2
  437. package/build-module/video/edit.native.js.map +1 -1
  438. package/build-style/archives/editor-rtl.css +15 -3
  439. package/build-style/archives/editor.css +15 -3
  440. package/build-style/archives/style-rtl.css +15 -3
  441. package/build-style/archives/style.css +15 -3
  442. package/build-style/audio/editor-rtl.css +15 -3
  443. package/build-style/audio/editor.css +15 -3
  444. package/build-style/audio/style-rtl.css +15 -3
  445. package/build-style/audio/style.css +15 -3
  446. package/build-style/audio/theme-rtl.css +15 -3
  447. package/build-style/audio/theme.css +15 -3
  448. package/build-style/avatar/editor-rtl.css +15 -3
  449. package/build-style/avatar/editor.css +15 -3
  450. package/build-style/avatar/style-rtl.css +15 -3
  451. package/build-style/avatar/style.css +15 -3
  452. package/build-style/block/editor-rtl.css +25 -3
  453. package/build-style/block/editor.css +25 -3
  454. package/build-style/button/editor-rtl.css +15 -3
  455. package/build-style/button/editor.css +15 -3
  456. package/build-style/button/style-rtl.css +15 -3
  457. package/build-style/button/style.css +15 -3
  458. package/build-style/buttons/editor-rtl.css +15 -3
  459. package/build-style/buttons/editor.css +15 -3
  460. package/build-style/buttons/style-rtl.css +15 -3
  461. package/build-style/buttons/style.css +15 -3
  462. package/build-style/calendar/style-rtl.css +15 -3
  463. package/build-style/calendar/style.css +15 -3
  464. package/build-style/categories/editor-rtl.css +15 -3
  465. package/build-style/categories/editor.css +15 -3
  466. package/build-style/categories/style-rtl.css +15 -3
  467. package/build-style/categories/style.css +15 -3
  468. package/build-style/classic-rtl.css +15 -3
  469. package/build-style/classic.css +15 -3
  470. package/build-style/code/editor-rtl.css +15 -3
  471. package/build-style/code/editor.css +15 -3
  472. package/build-style/code/style-rtl.css +15 -3
  473. package/build-style/code/style.css +15 -3
  474. package/build-style/code/theme-rtl.css +15 -3
  475. package/build-style/code/theme.css +15 -3
  476. package/build-style/columns/editor-rtl.css +15 -3
  477. package/build-style/columns/editor.css +15 -3
  478. package/build-style/columns/style-rtl.css +15 -3
  479. package/build-style/columns/style.css +15 -3
  480. package/build-style/comment-author-avatar/editor-rtl.css +15 -3
  481. package/build-style/comment-author-avatar/editor.css +15 -3
  482. package/build-style/comment-content/style-rtl.css +15 -3
  483. package/build-style/comment-content/style.css +15 -3
  484. package/build-style/comment-template/style-rtl.css +15 -3
  485. package/build-style/comment-template/style.css +15 -3
  486. package/build-style/comments/editor-rtl.css +15 -3
  487. package/build-style/comments/editor.css +15 -3
  488. package/build-style/comments/style-rtl.css +15 -3
  489. package/build-style/comments/style.css +15 -3
  490. package/build-style/comments-pagination/editor-rtl.css +15 -3
  491. package/build-style/comments-pagination/editor.css +15 -3
  492. package/build-style/comments-pagination/style-rtl.css +15 -3
  493. package/build-style/comments-pagination/style.css +15 -3
  494. package/build-style/comments-pagination-numbers/editor-rtl.css +15 -3
  495. package/build-style/comments-pagination-numbers/editor.css +15 -3
  496. package/build-style/comments-title/editor-rtl.css +15 -3
  497. package/build-style/comments-title/editor.css +15 -3
  498. package/build-style/common-rtl.css +20 -4
  499. package/build-style/common.css +20 -4
  500. package/build-style/cover/editor-rtl.css +15 -3
  501. package/build-style/cover/editor.css +15 -3
  502. package/build-style/cover/style-rtl.css +17 -4
  503. package/build-style/cover/style.css +17 -4
  504. package/build-style/editor-elements-rtl.css +15 -3
  505. package/build-style/editor-elements.css +15 -3
  506. package/build-style/editor-rtl.css +46 -29
  507. package/build-style/editor.css +46 -29
  508. package/build-style/elements-rtl.css +15 -3
  509. package/build-style/elements.css +15 -3
  510. package/build-style/embed/editor-rtl.css +15 -3
  511. package/build-style/embed/editor.css +15 -3
  512. package/build-style/embed/style-rtl.css +15 -3
  513. package/build-style/embed/style.css +15 -3
  514. package/build-style/embed/theme-rtl.css +15 -3
  515. package/build-style/embed/theme.css +15 -3
  516. package/build-style/file/editor-rtl.css +15 -3
  517. package/build-style/file/editor.css +15 -3
  518. package/build-style/file/style-rtl.css +15 -3
  519. package/build-style/file/style.css +15 -3
  520. package/build-style/freeform/editor-rtl.css +15 -3
  521. package/build-style/freeform/editor.css +15 -3
  522. package/build-style/gallery/editor-rtl.css +16 -4
  523. package/build-style/gallery/editor.css +16 -4
  524. package/build-style/gallery/style-rtl.css +19 -5
  525. package/build-style/gallery/style.css +19 -5
  526. package/build-style/gallery/theme-rtl.css +15 -3
  527. package/build-style/gallery/theme.css +15 -3
  528. package/build-style/group/editor-rtl.css +15 -3
  529. package/build-style/group/editor.css +15 -3
  530. package/build-style/group/style-rtl.css +15 -3
  531. package/build-style/group/style.css +15 -3
  532. package/build-style/group/theme-rtl.css +15 -3
  533. package/build-style/group/theme.css +15 -3
  534. package/build-style/heading/style-rtl.css +15 -3
  535. package/build-style/heading/style.css +15 -3
  536. package/build-style/html/editor-rtl.css +15 -3
  537. package/build-style/html/editor.css +15 -3
  538. package/build-style/image/editor-rtl.css +15 -12
  539. package/build-style/image/editor.css +15 -12
  540. package/build-style/image/style-rtl.css +15 -3
  541. package/build-style/image/style.css +15 -3
  542. package/build-style/image/theme-rtl.css +15 -3
  543. package/build-style/image/theme.css +15 -3
  544. package/build-style/latest-comments/style-rtl.css +15 -3
  545. package/build-style/latest-comments/style.css +15 -3
  546. package/build-style/latest-posts/editor-rtl.css +15 -3
  547. package/build-style/latest-posts/editor.css +15 -3
  548. package/build-style/latest-posts/style-rtl.css +15 -3
  549. package/build-style/latest-posts/style.css +15 -3
  550. package/build-style/list/style-rtl.css +15 -3
  551. package/build-style/list/style.css +15 -3
  552. package/build-style/media-text/editor-rtl.css +15 -3
  553. package/build-style/media-text/editor.css +15 -3
  554. package/build-style/media-text/style-rtl.css +15 -3
  555. package/build-style/media-text/style.css +15 -3
  556. package/build-style/more/editor-rtl.css +15 -3
  557. package/build-style/more/editor.css +15 -3
  558. package/build-style/navigation/editor-rtl.css +15 -9
  559. package/build-style/navigation/editor.css +15 -9
  560. package/build-style/navigation/style-rtl.css +15 -4
  561. package/build-style/navigation/style.css +15 -4
  562. package/build-style/navigation-link/editor-rtl.css +15 -3
  563. package/build-style/navigation-link/editor.css +15 -3
  564. package/build-style/navigation-link/style-rtl.css +15 -3
  565. package/build-style/navigation-link/style.css +15 -3
  566. package/build-style/navigation-submenu/editor-rtl.css +15 -3
  567. package/build-style/navigation-submenu/editor.css +15 -3
  568. package/build-style/nextpage/editor-rtl.css +15 -3
  569. package/build-style/nextpage/editor.css +15 -3
  570. package/build-style/page-list/editor-rtl.css +19 -3
  571. package/build-style/page-list/editor.css +19 -3
  572. package/build-style/page-list/style-rtl.css +15 -3
  573. package/build-style/page-list/style.css +15 -3
  574. package/build-style/paragraph/editor-rtl.css +15 -3
  575. package/build-style/paragraph/editor.css +15 -3
  576. package/build-style/paragraph/style-rtl.css +15 -3
  577. package/build-style/paragraph/style.css +15 -3
  578. package/build-style/post-author/style-rtl.css +15 -3
  579. package/build-style/post-author/style.css +15 -3
  580. package/build-style/post-comments-form/editor-rtl.css +15 -3
  581. package/build-style/post-comments-form/editor.css +15 -3
  582. package/build-style/post-comments-form/style-rtl.css +15 -3
  583. package/build-style/post-comments-form/style.css +15 -3
  584. package/build-style/post-date/style-rtl.css +15 -3
  585. package/build-style/post-date/style.css +15 -3
  586. package/build-style/post-excerpt/editor-rtl.css +15 -3
  587. package/build-style/post-excerpt/editor.css +15 -3
  588. package/build-style/post-excerpt/style-rtl.css +15 -3
  589. package/build-style/post-excerpt/style.css +15 -3
  590. package/build-style/post-featured-image/editor-rtl.css +15 -3
  591. package/build-style/post-featured-image/editor.css +15 -3
  592. package/build-style/post-featured-image/style-rtl.css +15 -3
  593. package/build-style/post-featured-image/style.css +15 -3
  594. package/build-style/post-navigation-link/style-rtl.css +15 -3
  595. package/build-style/post-navigation-link/style.css +15 -3
  596. package/build-style/post-template/editor-rtl.css +15 -3
  597. package/build-style/post-template/editor.css +15 -3
  598. package/build-style/post-template/style-rtl.css +15 -3
  599. package/build-style/post-template/style.css +15 -3
  600. package/build-style/post-terms/style-rtl.css +15 -3
  601. package/build-style/post-terms/style.css +15 -3
  602. package/build-style/post-title/style-rtl.css +15 -3
  603. package/build-style/post-title/style.css +15 -3
  604. package/build-style/preformatted/style-rtl.css +15 -3
  605. package/build-style/preformatted/style.css +15 -3
  606. package/build-style/pullquote/editor-rtl.css +15 -3
  607. package/build-style/pullquote/editor.css +15 -3
  608. package/build-style/pullquote/style-rtl.css +15 -3
  609. package/build-style/pullquote/style.css +15 -3
  610. package/build-style/pullquote/theme-rtl.css +15 -3
  611. package/build-style/pullquote/theme.css +15 -3
  612. package/build-style/query/editor-rtl.css +15 -3
  613. package/build-style/query/editor.css +15 -3
  614. package/build-style/query-pagination/editor-rtl.css +15 -3
  615. package/build-style/query-pagination/editor.css +15 -3
  616. package/build-style/query-pagination/style-rtl.css +15 -3
  617. package/build-style/query-pagination/style.css +15 -3
  618. package/build-style/query-pagination-numbers/editor-rtl.css +15 -3
  619. package/build-style/query-pagination-numbers/editor.css +15 -3
  620. package/build-style/query-title/style-rtl.css +15 -3
  621. package/build-style/query-title/style.css +15 -3
  622. package/build-style/quote/style-rtl.css +15 -3
  623. package/build-style/quote/style.css +15 -3
  624. package/build-style/quote/theme-rtl.css +15 -3
  625. package/build-style/quote/theme.css +15 -3
  626. package/build-style/read-more/style-rtl.css +15 -3
  627. package/build-style/read-more/style.css +15 -3
  628. package/build-style/reset-rtl.css +15 -3
  629. package/build-style/reset.css +15 -3
  630. package/build-style/rss/editor-rtl.css +15 -3
  631. package/build-style/rss/editor.css +15 -3
  632. package/build-style/rss/style-rtl.css +15 -3
  633. package/build-style/rss/style.css +15 -3
  634. package/build-style/search/editor-rtl.css +15 -3
  635. package/build-style/search/editor.css +15 -3
  636. package/build-style/search/style-rtl.css +15 -3
  637. package/build-style/search/style.css +15 -3
  638. package/build-style/search/theme-rtl.css +15 -3
  639. package/build-style/search/theme.css +15 -3
  640. package/build-style/separator/editor-rtl.css +15 -3
  641. package/build-style/separator/editor.css +15 -3
  642. package/build-style/separator/style-rtl.css +15 -3
  643. package/build-style/separator/style.css +15 -3
  644. package/build-style/separator/theme-rtl.css +15 -3
  645. package/build-style/separator/theme.css +15 -3
  646. package/build-style/shortcode/editor-rtl.css +16 -4
  647. package/build-style/shortcode/editor.css +16 -4
  648. package/build-style/site-logo/editor-rtl.css +15 -3
  649. package/build-style/site-logo/editor.css +15 -3
  650. package/build-style/site-logo/style-rtl.css +15 -3
  651. package/build-style/site-logo/style.css +15 -3
  652. package/build-style/site-tagline/editor-rtl.css +15 -3
  653. package/build-style/site-tagline/editor.css +15 -3
  654. package/build-style/site-title/editor-rtl.css +15 -3
  655. package/build-style/site-title/editor.css +15 -3
  656. package/build-style/site-title/style-rtl.css +15 -3
  657. package/build-style/site-title/style.css +15 -3
  658. package/build-style/social-link/editor-rtl.css +15 -3
  659. package/build-style/social-link/editor.css +15 -3
  660. package/build-style/social-links/editor-rtl.css +15 -3
  661. package/build-style/social-links/editor.css +15 -3
  662. package/build-style/social-links/style-rtl.css +15 -3
  663. package/build-style/social-links/style.css +15 -3
  664. package/build-style/spacer/editor-rtl.css +15 -3
  665. package/build-style/spacer/editor.css +15 -3
  666. package/build-style/spacer/style-rtl.css +15 -3
  667. package/build-style/spacer/style.css +15 -3
  668. package/build-style/style-rtl.css +36 -10
  669. package/build-style/style.css +36 -10
  670. package/build-style/table/editor-rtl.css +15 -11
  671. package/build-style/table/editor.css +15 -11
  672. package/build-style/table/style-rtl.css +21 -3
  673. package/build-style/table/style.css +21 -3
  674. package/build-style/table/theme-rtl.css +15 -9
  675. package/build-style/table/theme.css +15 -9
  676. package/build-style/tag-cloud/style-rtl.css +15 -3
  677. package/build-style/tag-cloud/style.css +15 -3
  678. package/build-style/template-part/editor-rtl.css +30 -4
  679. package/build-style/template-part/editor.css +30 -4
  680. package/build-style/template-part/theme-rtl.css +15 -3
  681. package/build-style/template-part/theme.css +15 -3
  682. package/build-style/text-columns/editor-rtl.css +15 -3
  683. package/build-style/text-columns/editor.css +15 -3
  684. package/build-style/text-columns/style-rtl.css +15 -3
  685. package/build-style/text-columns/style.css +15 -3
  686. package/build-style/theme-rtl.css +15 -9
  687. package/build-style/theme.css +15 -9
  688. package/build-style/verse/style-rtl.css +19 -4
  689. package/build-style/verse/style.css +19 -4
  690. package/build-style/video/editor-rtl.css +15 -3
  691. package/build-style/video/editor.css +15 -3
  692. package/build-style/video/style-rtl.css +17 -4
  693. package/build-style/video/style.css +17 -4
  694. package/build-style/video/theme-rtl.css +15 -3
  695. package/build-style/video/theme.css +15 -3
  696. package/package.json +32 -30
  697. package/src/audio/edit.native.js +1 -2
  698. package/src/audio/index.js +1 -0
  699. package/src/avatar/edit.js +1 -0
  700. package/src/avatar/user-control.js +1 -0
  701. package/src/block/block.json +1 -2
  702. package/src/block/edit.js +14 -3
  703. package/src/block/edit.native.js +24 -12
  704. package/src/block/editor.scss +17 -0
  705. package/src/block/index.php +1 -2
  706. package/src/block/test/edit.native.js +28 -32
  707. package/src/button/edit.native.js +1 -0
  708. package/src/buttons/test/edit.native.js +40 -51
  709. package/src/categories/edit.js +1 -1
  710. package/src/code/transforms.js +3 -1
  711. package/src/columns/edit.js +1 -0
  712. package/src/columns/edit.native.js +18 -26
  713. package/src/comment-author-avatar/edit.js +1 -0
  714. package/src/comments/index.php +0 -1
  715. package/src/cover/edit/inspector-controls.js +6 -4
  716. package/src/cover/edit.native.js +32 -19
  717. package/src/cover/test/edit.native.js +73 -126
  718. package/src/embed/embed-controls.native.js +1 -0
  719. package/src/embed/embed-preview.native.js +1 -2
  720. package/src/embed/test/index.native.js +237 -231
  721. package/src/file/inspector.js +1 -0
  722. package/src/file/test/__snapshots__/edit.native.js.snap +2 -6
  723. package/src/freeform/edit.js +48 -29
  724. package/src/freeform/modal.js +111 -0
  725. package/src/gallery/edit.js +32 -7
  726. package/src/gallery/gallery.js +3 -13
  727. package/src/gallery/gallery.native.js +1 -2
  728. package/src/gallery/shared.js +7 -11
  729. package/src/gallery/transforms.js +1 -6
  730. package/src/gallery/use-get-media.js +1 -1
  731. package/src/gallery/use-get-media.native.js +2 -1
  732. package/src/gallery/v1/edit.js +8 -7
  733. package/src/gallery/v1/gallery.native.js +1 -2
  734. package/src/gallery/v1/shared.js +7 -2
  735. package/src/group/block.json +3 -1
  736. package/src/group/edit.js +2 -6
  737. package/src/group/placeholder.js +6 -25
  738. package/src/group/test/__snapshots__/edit.native.js.snap +1 -1
  739. package/src/heading/block.json +1 -2
  740. package/src/heading/deprecated.js +209 -136
  741. package/src/heading/index.php +52 -0
  742. package/src/heading/test/__snapshots__/index.native.js.snap +7 -0
  743. package/src/heading/test/index.native.js +44 -0
  744. package/src/home-link/index.php +1 -1
  745. package/src/html/block.json +1 -1
  746. package/src/image/edit.js +7 -2
  747. package/src/image/edit.native.js +2 -1
  748. package/src/image/editor.scss +0 -11
  749. package/src/image/image.js +14 -8
  750. package/src/image/test/edit.native.js +14 -10
  751. package/src/index.js +2 -0
  752. package/src/latest-comments/edit.js +1 -0
  753. package/src/latest-posts/edit.js +2 -0
  754. package/src/latest-posts/test/__snapshots__/edit.native.js.snap +3 -0
  755. package/src/latest-posts/test/edit.native.js +49 -0
  756. package/src/list/test/edit.native.js +53 -45
  757. package/src/list/transforms.js +0 -11
  758. package/src/list/utils.js +6 -2
  759. package/src/list-item/index.js +2 -0
  760. package/src/list-item/transforms.js +17 -0
  761. package/src/list-item/utils.js +10 -1
  762. package/src/media-text/edit.js +6 -3
  763. package/src/missing/edit.native.js +13 -6
  764. package/src/missing/test/edit-integration.native.js +10 -12
  765. package/src/more/test/__snapshots__/edit.native.js.snap +7 -0
  766. package/src/more/test/edit.native.js +41 -0
  767. package/src/navigation/edit/are-blocks-dirty.js +51 -0
  768. package/src/navigation/edit/index.js +229 -298
  769. package/src/navigation/edit/menu-inspector-controls.js +119 -0
  770. package/src/navigation/edit/navigation-menu-selector.js +6 -7
  771. package/src/navigation/edit/test/are-blocks-dirty.js +121 -0
  772. package/src/navigation/edit/unsaved-inner-blocks.js +12 -7
  773. package/src/navigation/edit/utils.js +82 -0
  774. package/src/navigation/editor.scss +0 -7
  775. package/src/navigation/index.php +89 -10
  776. package/src/navigation/style.scss +0 -1
  777. package/src/navigation/view-modal.js +11 -1
  778. package/src/navigation-link/edit.js +62 -386
  779. package/src/navigation-link/index.php +64 -0
  780. package/src/navigation-link/link-ui.js +213 -0
  781. package/src/navigation-link/test/edit.js +23 -82
  782. package/src/navigation-link/transforms.js +14 -0
  783. package/src/navigation-link/update-attributes.js +99 -0
  784. package/src/navigation-submenu/edit.js +85 -276
  785. package/src/navigation-submenu/index.php +72 -0
  786. package/src/page-list/block.json +24 -2
  787. package/src/page-list/constants.js +8 -0
  788. package/src/page-list/convert-to-links-modal.js +19 -76
  789. package/src/page-list/convert-to-navigation-links.js +60 -0
  790. package/src/page-list/edit.js +187 -118
  791. package/src/page-list/editor.scss +4 -0
  792. package/src/page-list/index.js +8 -2
  793. package/src/page-list/index.php +18 -10
  794. package/src/page-list/test/convert-to-links-modal.js +28 -34
  795. package/src/page-list-item/block.json +51 -0
  796. package/src/page-list-item/edit.js +102 -0
  797. package/src/page-list-item/index.js +24 -0
  798. package/src/page-list-item/init.js +6 -0
  799. package/src/paragraph/index.js +0 -6
  800. package/src/post-author/edit.js +3 -2
  801. package/src/post-content/index.php +1 -2
  802. package/src/post-featured-image/index.php +7 -2
  803. package/src/post-featured-image/overlay.js +1 -1
  804. package/src/post-template/block.json +8 -0
  805. package/src/preformatted/transforms.js +4 -1
  806. package/src/query/block.json +0 -8
  807. package/src/query/deprecated.js +257 -86
  808. package/src/query/edit/index.js +1 -0
  809. package/src/query/edit/inspector-controls/index.js +50 -38
  810. package/src/query/edit/inspector-controls/taxonomy-controls.js +102 -38
  811. package/src/query/edit/query-content.js +2 -1
  812. package/src/query/edit/query-placeholder.js +14 -25
  813. package/src/query/utils.js +59 -1
  814. package/src/rss/edit.js +3 -0
  815. package/src/search/edit.js +2 -2
  816. package/src/search/edit.native.js +31 -27
  817. package/src/search/index.js +5 -1
  818. package/src/separator/test/__snapshots__/edit.native.js.snap +7 -0
  819. package/src/separator/test/edit.native.js +41 -0
  820. package/src/shortcode/test/edit.native.js +15 -18
  821. package/src/site-logo/edit.js +13 -5
  822. package/src/site-logo/index.js +1 -0
  823. package/src/site-title/index.js +1 -0
  824. package/src/social-link/edit.js +3 -3
  825. package/src/social-link/social-list.js +2 -7
  826. package/src/social-link/test/index.native.js +10 -16
  827. package/src/social-links/edit.js +0 -1
  828. package/src/social-links/test/edit.native.js +4 -3
  829. package/src/spacer/test/index.native.js +39 -36
  830. package/src/table/block.json +15 -0
  831. package/src/table/edit.js +2 -1
  832. package/src/table/editor.scss +0 -4
  833. package/src/table/index.js +1 -0
  834. package/src/table/save.js +5 -1
  835. package/src/table/state.js +22 -7
  836. package/src/table/style.scss +8 -0
  837. package/src/table/theme.scss +0 -8
  838. package/src/table/transforms.js +2 -1
  839. package/src/table-of-contents/edit.js +3 -3
  840. package/src/tag-cloud/edit.js +3 -2
  841. package/src/template-part/edit/advanced-controls.js +12 -0
  842. package/src/template-part/edit/import-controls.js +180 -0
  843. package/src/template-part/edit/index.js +1 -0
  844. package/src/template-part/edit/selection-modal.js +4 -3
  845. package/src/template-part/edit/utils/hooks.js +7 -3
  846. package/src/template-part/edit/utils/transformers.js +37 -0
  847. package/src/template-part/editor.scss +20 -2
  848. package/src/template-part/index.php +1 -2
  849. package/src/text-columns/edit.js +1 -0
  850. package/src/utils/transformation-categories.native.js +1 -0
  851. package/src/verse/style.scss +4 -1
  852. package/src/verse/test/__snapshots__/edit.native.js.snap +13 -0
  853. package/src/verse/test/edit.native.js +40 -33
  854. package/src/video/edit.js +1 -1
  855. package/src/video/edit.native.js +1 -2
  856. package/test/babel-plugin.js +35 -35
  857. package/tsconfig.tsbuildinfo +1 -1
  858. package/build/query/constants.js +0 -16
  859. package/build/query/constants.js.map +0 -1
  860. package/build-module/query/constants.js +0 -7
  861. package/build-module/query/constants.js.map +0 -1
  862. package/src/query/constants.js +0 -7
@@ -5,71 +5,20 @@ import { Button, Modal } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { useDispatch } from '@wordpress/data';
7
7
  import { useEntityRecords } from '@wordpress/core-data';
8
- import { createBlock as create } from '@wordpress/blocks';
9
8
  import { store as blockEditorStore } from '@wordpress/block-editor';
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import { convertToNavigationLinks } from './convert-to-navigation-links';
13
+
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+ import { convertDescription } from './constants';
10
18
 
11
19
  const PAGE_FIELDS = [ 'id', 'title', 'link', 'type', 'parent' ];
12
20
  const MAX_PAGE_COUNT = 100;
13
21
 
14
- export const convertSelectedBlockToNavigationLinks =
15
- ( { pages, clientId, replaceBlock, createBlock } ) =>
16
- () => {
17
- if ( ! pages ) {
18
- return;
19
- }
20
-
21
- const linkMap = {};
22
- const navigationLinks = [];
23
- pages.forEach( ( { id, title, link: url, type, parent } ) => {
24
- // See if a placeholder exists. This is created if children appear before parents in list.
25
- const innerBlocks = linkMap[ id ]?.innerBlocks ?? [];
26
- linkMap[ id ] = createBlock(
27
- 'core/navigation-link',
28
- {
29
- id,
30
- label: title.rendered,
31
- url,
32
- type,
33
- kind: 'post-type',
34
- },
35
- innerBlocks
36
- );
37
-
38
- if ( ! parent ) {
39
- navigationLinks.push( linkMap[ id ] );
40
- } else {
41
- if ( ! linkMap[ parent ] ) {
42
- // Use a placeholder if the child appears before parent in list.
43
- linkMap[ parent ] = { innerBlocks: [] };
44
- }
45
- const parentLinkInnerBlocks = linkMap[ parent ].innerBlocks;
46
- parentLinkInnerBlocks.push( linkMap[ id ] );
47
- }
48
- } );
49
-
50
- // Transform all links with innerBlocks into Submenus. This can't be done
51
- // sooner because page objects have no information on their children.
52
-
53
- const transformSubmenus = ( listOfLinks ) => {
54
- listOfLinks.forEach( ( block, index, listOfLinksArray ) => {
55
- const { attributes, innerBlocks } = block;
56
- if ( innerBlocks.length !== 0 ) {
57
- transformSubmenus( innerBlocks );
58
- const transformedBlock = createBlock(
59
- 'core/navigation-submenu',
60
- attributes,
61
- innerBlocks
62
- );
63
- listOfLinksArray[ index ] = transformedBlock;
64
- }
65
- } );
66
- };
67
-
68
- transformSubmenus( navigationLinks );
69
-
70
- replaceBlock( clientId, navigationLinks );
71
- };
72
-
73
22
  export default function ConvertToLinksModal( { onClose, clientId } ) {
74
23
  const { records: pages, hasResolved: pagesFinished } = useEntityRecords(
75
24
  'postType',
@@ -91,19 +40,12 @@ export default function ConvertToLinksModal( { onClose, clientId } ) {
91
40
  <Modal
92
41
  closeLabel={ __( 'Close' ) }
93
42
  onRequestClose={ onClose }
94
- title={ __( 'Convert to links' ) }
43
+ title={ __( 'Customize this menu' ) }
95
44
  className={ 'wp-block-page-list-modal' }
96
45
  aria={ { describedby: 'wp-block-page-list-modal__description' } }
97
46
  >
98
47
  <p id={ 'wp-block-page-list-modal__description' }>
99
- { __(
100
- 'To edit this navigation menu, convert it to single page links. This allows you to add, re-order, remove items, or edit their labels.'
101
- ) }
102
- </p>
103
- <p>
104
- { __(
105
- "Note: if you add new pages to your site, you'll need to add them to your navigation menu."
106
- ) }
48
+ { convertDescription }
107
49
  </p>
108
50
  <div className="wp-block-page-list-modal-buttons">
109
51
  <Button variant="tertiary" onClick={ onClose }>
@@ -112,14 +54,15 @@ export default function ConvertToLinksModal( { onClose, clientId } ) {
112
54
  <Button
113
55
  variant="primary"
114
56
  disabled={ ! pagesFinished }
115
- onClick={ convertSelectedBlockToNavigationLinks( {
116
- pages,
117
- replaceBlock,
118
- clientId,
119
- createBlock: create,
120
- } ) }
57
+ onClick={ () => {
58
+ const navigationLinks =
59
+ convertToNavigationLinks( pages );
60
+
61
+ // Replace the Page List block with the Navigation Links.
62
+ replaceBlock( clientId, navigationLinks );
63
+ } }
121
64
  >
122
- { __( 'Convert' ) }
65
+ { __( 'Customize' ) }
123
66
  </Button>
124
67
  </div>
125
68
  </Modal>
@@ -0,0 +1,60 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { createBlock } from '@wordpress/blocks';
5
+
6
+ export const convertToNavigationLinks = ( pages ) => {
7
+ if ( ! pages ) {
8
+ return;
9
+ }
10
+
11
+ const linkMap = {};
12
+ const navigationLinks = [];
13
+ pages.forEach( ( { id, title, link: url, type, parent } ) => {
14
+ // See if a placeholder exists. This is created if children appear before parents in list.
15
+ const innerBlocks = linkMap[ id ]?.innerBlocks ?? [];
16
+ linkMap[ id ] = createBlock(
17
+ 'core/navigation-link',
18
+ {
19
+ id,
20
+ label: title.rendered,
21
+ url,
22
+ type,
23
+ kind: 'post-type',
24
+ },
25
+ innerBlocks
26
+ );
27
+
28
+ if ( ! parent ) {
29
+ navigationLinks.push( linkMap[ id ] );
30
+ } else {
31
+ if ( ! linkMap[ parent ] ) {
32
+ // Use a placeholder if the child appears before parent in list.
33
+ linkMap[ parent ] = { innerBlocks: [] };
34
+ }
35
+ const parentLinkInnerBlocks = linkMap[ parent ].innerBlocks;
36
+ parentLinkInnerBlocks.push( linkMap[ id ] );
37
+ }
38
+ } );
39
+
40
+ // Transform all links with innerBlocks into Submenus. This can't be done
41
+ // sooner because page objects have no information on their children.
42
+ const transformSubmenus = ( listOfLinks ) => {
43
+ listOfLinks.forEach( ( block, index, listOfLinksArray ) => {
44
+ const { attributes, innerBlocks } = block;
45
+ if ( innerBlocks.length !== 0 ) {
46
+ transformSubmenus( innerBlocks );
47
+ const transformedBlock = createBlock(
48
+ 'core/navigation-submenu',
49
+ attributes,
50
+ innerBlocks
51
+ );
52
+ listOfLinksArray[ index ] = transformedBlock;
53
+ }
54
+ } );
55
+ };
56
+
57
+ transformSubmenus( navigationLinks );
58
+
59
+ return navigationLinks;
60
+ };
@@ -6,28 +6,49 @@ import classnames from 'classnames';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
+ import { createBlock } from '@wordpress/blocks';
9
10
  import {
11
+ InspectorControls,
10
12
  BlockControls,
11
13
  useBlockProps,
14
+ useInnerBlocksProps,
12
15
  getColorClassName,
16
+ store as blockEditorStore,
17
+ Warning,
13
18
  } from '@wordpress/block-editor';
14
- import { ToolbarButton, Spinner, Notice } from '@wordpress/components';
15
- import { __ } from '@wordpress/i18n';
16
- import { useMemo, useState, memo } from '@wordpress/element';
17
- import { useSelect } from '@wordpress/data';
18
- import { store as coreStore, useEntityRecords } from '@wordpress/core-data';
19
+ import {
20
+ PanelBody,
21
+ ToolbarButton,
22
+ Spinner,
23
+ Notice,
24
+ ComboboxControl,
25
+ Button,
26
+ } from '@wordpress/components';
27
+ import { __, sprintf } from '@wordpress/i18n';
28
+ import { useMemo, useState, useEffect } from '@wordpress/element';
29
+ import { useEntityRecords } from '@wordpress/core-data';
30
+ import { useSelect, useDispatch } from '@wordpress/data';
19
31
 
20
32
  /**
21
33
  * Internal dependencies
22
34
  */
23
35
  import ConvertToLinksModal from './convert-to-links-modal';
24
- import { ItemSubmenuIcon } from '../navigation-link/icons';
36
+ import { convertToNavigationLinks } from './convert-to-navigation-links';
37
+ import { convertDescription } from './constants';
25
38
 
26
39
  // We only show the edit option when page count is <= MAX_PAGE_COUNT
27
40
  // Performance of Navigation Links is not good past this value.
28
41
  const MAX_PAGE_COUNT = 100;
42
+ const NOOP = () => {};
29
43
 
30
- export default function PageListEdit( { context, clientId } ) {
44
+ export default function PageListEdit( {
45
+ context,
46
+ clientId,
47
+ attributes,
48
+ setAttributes,
49
+ } ) {
50
+ const { parentPageID } = attributes;
51
+ const [ pages ] = useGetPages();
31
52
  const { pagesByParentId, totalPages, hasResolvedPages } = usePageData();
32
53
 
33
54
  const isNavigationChild = 'showSubmenuIcon' in context;
@@ -52,6 +73,70 @@ export default function PageListEdit( { context, clientId } ) {
52
73
  style: { ...context.style?.color },
53
74
  } );
54
75
 
76
+ const getBlockList = ( parentId = parentPageID ) => {
77
+ const childPages = pagesByParentId.get( parentId );
78
+
79
+ if ( ! childPages?.length ) {
80
+ return [];
81
+ }
82
+
83
+ return childPages.reduce( ( template, page ) => {
84
+ const hasChildren = pagesByParentId.has( page.id );
85
+ const pageProps = {
86
+ id: page.id,
87
+ label: page.title?.rendered,
88
+ title: page.title?.rendered,
89
+ link: page.url,
90
+ hasChildren,
91
+ };
92
+ let item = null;
93
+ const children = getBlockList( page.id );
94
+ item = createBlock( 'core/page-list-item', pageProps, children );
95
+ template.push( item );
96
+
97
+ return template;
98
+ }, [] );
99
+ };
100
+
101
+ const makePagesTree = ( parentId = 0, level = 0 ) => {
102
+ const childPages = pagesByParentId.get( parentId );
103
+
104
+ if ( ! childPages?.length ) {
105
+ return [];
106
+ }
107
+
108
+ return childPages.reduce( ( tree, page ) => {
109
+ const hasChildren = pagesByParentId.has( page.id );
110
+ const item = {
111
+ value: page.id,
112
+ label: '— '.repeat( level ) + page.title.rendered,
113
+ rawName: page.title.rendered,
114
+ };
115
+ tree.push( item );
116
+ if ( hasChildren ) {
117
+ tree.push( ...makePagesTree( page.id, level + 1 ) );
118
+ }
119
+ return tree;
120
+ }, [] );
121
+ };
122
+
123
+ const pagesTree = useMemo( makePagesTree, [ pagesByParentId ] );
124
+
125
+ const blockList = useMemo( getBlockList, [
126
+ pagesByParentId,
127
+ parentPageID,
128
+ ] );
129
+
130
+ const innerBlocksProps = useInnerBlocksProps( blockProps, {
131
+ allowedBlocks: [ 'core/page-list-item' ],
132
+ renderAppender: false,
133
+ __unstableDisableDropZone: true,
134
+ templateLock: 'all',
135
+ onInput: NOOP,
136
+ onChange: NOOP,
137
+ value: blockList,
138
+ } );
139
+
55
140
  const getBlockContent = () => {
56
141
  if ( ! hasResolvedPages ) {
57
142
  return (
@@ -81,21 +166,99 @@ export default function PageListEdit( { context, clientId } ) {
81
166
  );
82
167
  }
83
168
 
84
- if ( totalPages > 0 ) {
169
+ if ( blockList.length === 0 ) {
170
+ const parentPageDetails =
171
+ pages && pages.find( ( page ) => page.id === parentPageID );
85
172
  return (
86
- <ul { ...blockProps }>
87
- <PageItems
88
- context={ context }
89
- pagesByParentId={ pagesByParentId }
90
- />
91
- </ul>
173
+ <div { ...blockProps }>
174
+ <Warning>
175
+ { sprintf(
176
+ // translators: %s: Page title.
177
+ __( '"%s" page has no children.' ),
178
+ parentPageDetails.title.rendered
179
+ ) }
180
+ </Warning>
181
+ </div>
92
182
  );
93
183
  }
184
+
185
+ if ( totalPages > 0 ) {
186
+ return <ul { ...innerBlocksProps }></ul>;
187
+ }
94
188
  };
95
189
 
190
+ const { replaceBlock, selectBlock } = useDispatch( blockEditorStore );
191
+
192
+ const { parentNavBlockClientId, isNested } = useSelect(
193
+ ( select ) => {
194
+ const { getSelectedBlockClientId, getBlockParentsByBlockName } =
195
+ select( blockEditorStore );
196
+
197
+ const _selectedBlockClientId = getSelectedBlockClientId();
198
+
199
+ return {
200
+ parentNavBlockClientId: getBlockParentsByBlockName(
201
+ _selectedBlockClientId,
202
+ 'core/navigation',
203
+ true
204
+ )[ 0 ],
205
+ isNested:
206
+ getBlockParentsByBlockName(
207
+ clientId,
208
+ 'core/navigation-submenu',
209
+ true
210
+ ).length > 0,
211
+ };
212
+ },
213
+ [ clientId ]
214
+ );
215
+
216
+ useEffect( () => {
217
+ setAttributes( { isNested } );
218
+ }, [ isNested ] );
219
+
96
220
  return (
97
221
  <>
98
- { allowConvertToLinks && (
222
+ <InspectorControls>
223
+ { isNavigationChild && pages?.length > 0 && (
224
+ <PanelBody title={ __( 'Customize this menu' ) }>
225
+ <p>{ convertDescription }</p>
226
+ <Button
227
+ variant="primary"
228
+ disabled={ ! hasResolvedPages }
229
+ onClick={ () => {
230
+ const navigationLinks =
231
+ convertToNavigationLinks( pages );
232
+
233
+ // Replace the Page List block with the Navigation Links.
234
+ replaceBlock( clientId, navigationLinks );
235
+
236
+ // Select the Navigation block to reveal the changes.
237
+ selectBlock( parentNavBlockClientId );
238
+ } }
239
+ >
240
+ { __( 'Customize' ) }
241
+ </Button>
242
+ </PanelBody>
243
+ ) }
244
+ { pagesTree.length > 0 && (
245
+ <PanelBody>
246
+ <ComboboxControl
247
+ className="editor-page-attributes__parent"
248
+ label={ __( 'Parent page' ) }
249
+ value={ parentPageID }
250
+ options={ pagesTree }
251
+ onChange={ ( value ) =>
252
+ setAttributes( { parentPageID: value ?? 0 } )
253
+ }
254
+ help={ __(
255
+ 'Choose a page to show only its subpages.'
256
+ ) }
257
+ />
258
+ </PanelBody>
259
+ ) }
260
+ </InspectorControls>
261
+ { allowConvertToLinks && totalPages > 0 && (
99
262
  <BlockControls group="other">
100
263
  <ToolbarButton title={ __( 'Edit' ) } onClick={ openModal }>
101
264
  { __( 'Edit' ) }
@@ -114,22 +277,7 @@ export default function PageListEdit( { context, clientId } ) {
114
277
  );
115
278
  }
116
279
 
117
- function useFrontPageId() {
118
- return useSelect( ( select ) => {
119
- const canReadSettings = select( coreStore ).canUser(
120
- 'read',
121
- 'settings'
122
- );
123
- if ( ! canReadSettings ) {
124
- return undefined;
125
- }
126
-
127
- const site = select( coreStore ).getEntityRecord( 'root', 'site' );
128
- return site?.show_on_front === 'page' && site?.page_on_front;
129
- }, [] );
130
- }
131
-
132
- function usePageData() {
280
+ function useGetPages() {
133
281
  const { records: pages, hasResolved: hasResolvedPages } = useEntityRecords(
134
282
  'postType',
135
283
  'page',
@@ -142,10 +290,17 @@ function usePageData() {
142
290
  }
143
291
  );
144
292
 
293
+ return [ pages, hasResolvedPages ];
294
+ }
295
+
296
+ function usePageData( pageId = 0 ) {
297
+ const [ pages, hasResolvedPages ] = useGetPages();
298
+
145
299
  return useMemo( () => {
146
300
  // TODO: Once the REST API supports passing multiple values to
147
301
  // 'orderby', this can be removed.
148
302
  // https://core.trac.wordpress.org/ticket/39037
303
+
149
304
  const sortedPages = [ ...( pages ?? [] ) ].sort( ( a, b ) => {
150
305
  if ( a.menu_order === b.menu_order ) {
151
306
  return a.title.rendered.localeCompare( b.title.rendered );
@@ -167,91 +322,5 @@ function usePageData() {
167
322
  hasResolvedPages,
168
323
  totalPages: pages?.length ?? null,
169
324
  };
170
- }, [ pages, hasResolvedPages ] );
325
+ }, [ pageId, pages, hasResolvedPages ] );
171
326
  }
172
-
173
- const PageItems = memo( function PageItems( {
174
- context,
175
- pagesByParentId,
176
- parentId = 0,
177
- depth = 0,
178
- } ) {
179
- const pages = pagesByParentId.get( parentId );
180
- const frontPageId = useFrontPageId();
181
-
182
- if ( ! pages?.length ) {
183
- return [];
184
- }
185
-
186
- return pages.map( ( page ) => {
187
- const hasChildren = pagesByParentId.has( page.id );
188
- const isNavigationChild = 'showSubmenuIcon' in context;
189
- return (
190
- <li
191
- key={ page.id }
192
- className={ classnames( 'wp-block-pages-list__item', {
193
- 'has-child': hasChildren,
194
- 'wp-block-navigation-item': isNavigationChild,
195
- 'open-on-click': context.openSubmenusOnClick,
196
- 'open-on-hover-click':
197
- ! context.openSubmenusOnClick &&
198
- context.showSubmenuIcon,
199
- 'menu-item-home': page.id === frontPageId,
200
- } ) }
201
- >
202
- { hasChildren && context.openSubmenusOnClick ? (
203
- <>
204
- <button
205
- className="wp-block-navigation-item__content wp-block-navigation-submenu__toggle"
206
- aria-expanded="false"
207
- >
208
- { page.title?.rendered }
209
- </button>
210
- <span className="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon">
211
- <ItemSubmenuIcon />
212
- </span>
213
- </>
214
- ) : (
215
- <a
216
- className={ classnames(
217
- 'wp-block-pages-list__item__link',
218
- {
219
- 'wp-block-navigation-item__content':
220
- isNavigationChild,
221
- }
222
- ) }
223
- href={ page.link }
224
- >
225
- { page.title?.rendered }
226
- </a>
227
- ) }
228
- { hasChildren && (
229
- <>
230
- { ! context.openSubmenusOnClick &&
231
- context.showSubmenuIcon && (
232
- <button
233
- className="wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"
234
- aria-expanded="false"
235
- >
236
- <ItemSubmenuIcon />
237
- </button>
238
- ) }
239
- <ul
240
- className={ classnames( 'submenu-container', {
241
- 'wp-block-navigation__submenu-container':
242
- isNavigationChild,
243
- } ) }
244
- >
245
- <PageItems
246
- context={ context }
247
- pagesByParentId={ pagesByParentId }
248
- parentId={ page.id }
249
- depth={ depth + 1 }
250
- />
251
- </ul>
252
- </>
253
- ) }
254
- </li>
255
- );
256
- } );
257
- } );
@@ -22,6 +22,10 @@
22
22
  }
23
23
  }
24
24
 
25
+ .wp-block-navigation .wp-block-navigation__submenu-container > .wp-block-page-list {
26
+ display: block; // This is needed to make sure the page list container is 100% wide, so that the children are correctly positioned.
27
+ }
28
+
25
29
  // Make links unclickable in the editor.
26
30
  .wp-block-pages-list__item__link {
27
31
  pointer-events: none;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { pages as icon } from '@wordpress/icons';
4
+ import { pages, update } from '@wordpress/icons';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -15,7 +15,13 @@ const { name } = metadata;
15
15
  export { metadata, name };
16
16
 
17
17
  export const settings = {
18
- icon,
18
+ icon: ( { context } ) => {
19
+ if ( context === 'list-view' ) {
20
+ return update;
21
+ }
22
+
23
+ return pages;
24
+ },
19
25
  example: {},
20
26
  edit,
21
27
  };
@@ -139,13 +139,14 @@ function block_core_page_list_build_css_font_sizes( $context ) {
139
139
  * @param boolean $show_submenu_icons Whether to show submenu indicator icons.
140
140
  * @param boolean $is_navigation_child If block is a child of Navigation block.
141
141
  * @param array $nested_pages The array of nested pages.
142
+ * @param boolean $is_nested Whether the submenu is nested or not.
142
143
  * @param array $active_page_ancestor_ids An array of ancestor ids for active page.
143
144
  * @param array $colors Color information for overlay styles.
144
145
  * @param integer $depth The nesting depth.
145
146
  *
146
147
  * @return string List markup.
147
148
  */
148
- function block_core_page_list_render_nested_page_list( $open_submenus_on_click, $show_submenu_icons, $is_navigation_child, $nested_pages, $active_page_ancestor_ids = array(), $colors = array(), $depth = 0 ) {
149
+ function block_core_page_list_render_nested_page_list( $open_submenus_on_click, $show_submenu_icons, $is_navigation_child, $nested_pages, $is_nested, $active_page_ancestor_ids = array(), $colors = array(), $depth = 0 ) {
149
150
  if ( empty( $nested_pages ) ) {
150
151
  return;
151
152
  }
@@ -173,7 +174,7 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
173
174
  $navigation_child_content_class = $is_navigation_child ? ' wp-block-navigation-item__content' : '';
174
175
 
175
176
  // If this is the first level of submenus, include the overlay colors.
176
- if ( 1 === $depth && isset( $colors['overlay_css_classes'], $colors['overlay_inline_styles'] ) ) {
177
+ if ( ( ( 0 < $depth && ! $is_nested ) || $is_nested ) && isset( $colors['overlay_css_classes'], $colors['overlay_inline_styles'] ) ) {
177
178
  $css_class .= ' ' . trim( implode( ' ', $colors['overlay_css_classes'] ) );
178
179
  if ( '' !== $colors['overlay_inline_styles'] ) {
179
180
  $style_attribute = sprintf( ' style="%s"', esc_attr( $colors['overlay_inline_styles'] ) );
@@ -207,12 +208,9 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
207
208
  $markup .= '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg>';
208
209
  $markup .= '</button>';
209
210
  }
210
- $markup .= '<ul class="submenu-container';
211
- // Extra classname is added when the block is a child of Navigation.
212
- if ( $is_navigation_child ) {
213
- $markup .= ' wp-block-navigation__submenu-container';
214
- }
215
- $markup .= '">' . block_core_page_list_render_nested_page_list( $open_submenus_on_click, $show_submenu_icons, $is_navigation_child, $page['children'], $active_page_ancestor_ids, $colors, $depth + 1 ) . '</ul>';
211
+ $markup .= '<ul class="wp-block-navigation__submenu-container">';
212
+ $markup .= block_core_page_list_render_nested_page_list( $open_submenus_on_click, $show_submenu_icons, $is_navigation_child, $page['children'], $is_nested, $active_page_ancestor_ids, $colors, $depth + 1 );
213
+ $markup .= '</ul>';
216
214
  }
217
215
  $markup .= '</li>';
218
216
  }
@@ -252,6 +250,9 @@ function render_block_core_page_list( $attributes, $content, $block ) {
252
250
  static $block_id = 0;
253
251
  ++$block_id;
254
252
 
253
+ $parent_page_id = $attributes['parentPageID'];
254
+ $is_nested = $attributes['isNested'];
255
+
255
256
  $all_pages = get_pages(
256
257
  array(
257
258
  'sort_column' => 'menu_order,post_title',
@@ -306,15 +307,22 @@ function render_block_core_page_list( $attributes, $content, $block ) {
306
307
 
307
308
  $nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children );
308
309
 
310
+ if ( 0 !== $parent_page_id ) {
311
+ $nested_pages = block_core_page_list_nest_pages(
312
+ $pages_with_children[ $parent_page_id ],
313
+ $pages_with_children
314
+ );
315
+ }
316
+
309
317
  $is_navigation_child = array_key_exists( 'showSubmenuIcon', $block->context );
310
318
 
311
319
  $open_submenus_on_click = array_key_exists( 'openSubmenusOnClick', $block->context ) ? $block->context['openSubmenusOnClick'] : false;
312
320
 
313
321
  $show_submenu_icons = array_key_exists( 'showSubmenuIcon', $block->context ) ? $block->context['showSubmenuIcon'] : false;
314
322
 
315
- $wrapper_markup = '<ul %1$s>%2$s</ul>';
323
+ $wrapper_markup = $is_nested ? '%2$s' : '<ul %1$s>%2$s</ul>';
316
324
 
317
- $items_markup = block_core_page_list_render_nested_page_list( $open_submenus_on_click, $show_submenu_icons, $is_navigation_child, $nested_pages, $active_page_ancestor_ids, $colors );
325
+ $items_markup = block_core_page_list_render_nested_page_list( $open_submenus_on_click, $show_submenu_icons, $is_navigation_child, $nested_pages, $is_nested, $active_page_ancestor_ids, $colors );
318
326
 
319
327
  $wrapper_attributes = get_block_wrapper_attributes(
320
328
  array(