@wordpress/block-library 8.18.0 → 8.19.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 (393) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +1 -1
  3. package/build/block/edit.js +53 -2
  4. package/build/block/edit.js.map +1 -1
  5. package/build/button/edit.js +7 -4
  6. package/build/button/edit.js.map +1 -1
  7. package/build/button/index.js +11 -2
  8. package/build/button/index.js.map +1 -1
  9. package/build/button/save.js +10 -4
  10. package/build/button/save.js.map +1 -1
  11. package/build/buttons/edit.js +12 -3
  12. package/build/buttons/edit.js.map +1 -1
  13. package/build/code/edit.js +8 -2
  14. package/build/code/edit.js.map +1 -1
  15. package/build/code/index.js +7 -1
  16. package/build/code/index.js.map +1 -1
  17. package/build/column/edit.native.js +5 -5
  18. package/build/column/edit.native.js.map +1 -1
  19. package/build/column/index.js +1 -0
  20. package/build/column/index.js.map +1 -1
  21. package/build/columns/index.js +2 -0
  22. package/build/columns/index.js.map +1 -1
  23. package/build/file/edit.native.js +1 -1
  24. package/build/file/edit.native.js.map +1 -1
  25. package/build/file/index.js +2 -1
  26. package/build/file/index.js.map +1 -1
  27. package/build/file/utils/index.js +1 -15
  28. package/build/file/utils/index.js.map +1 -1
  29. package/build/file/view.js +14 -1
  30. package/build/file/view.js.map +1 -1
  31. package/build/footnotes/edit.js +14 -5
  32. package/build/footnotes/edit.js.map +1 -1
  33. package/build/gallery/edit.js +1 -1
  34. package/build/gallery/edit.js.map +1 -1
  35. package/build/group/edit.js +0 -1
  36. package/build/group/edit.js.map +1 -1
  37. package/build/group/index.js +5 -0
  38. package/build/group/index.js.map +1 -1
  39. package/build/heading/edit.js +0 -1
  40. package/build/heading/edit.js.map +1 -1
  41. package/build/heading/index.js +2 -0
  42. package/build/heading/index.js.map +1 -1
  43. package/build/heading/transforms.js +3 -6
  44. package/build/heading/transforms.js.map +1 -1
  45. package/build/image/deprecated.js +191 -7
  46. package/build/image/deprecated.js.map +1 -1
  47. package/build/image/edit.js +27 -12
  48. package/build/image/edit.js.map +1 -1
  49. package/build/image/image.js +75 -40
  50. package/build/image/image.js.map +1 -1
  51. package/build/image/index.js +7 -4
  52. package/build/image/index.js.map +1 -1
  53. package/build/image/{view-interactivity.js → view.js} +1 -1
  54. package/build/image/view.js.map +1 -0
  55. package/build/list/deprecated.js +93 -1
  56. package/build/list/deprecated.js.map +1 -1
  57. package/build/list/edit.js +10 -10
  58. package/build/list/edit.js.map +1 -1
  59. package/build/list/ordered-list-settings.js +10 -10
  60. package/build/list/ordered-list-settings.js.map +1 -1
  61. package/build/list/save.js +4 -2
  62. package/build/list/save.js.map +1 -1
  63. package/build/list/utils.js +21 -2
  64. package/build/list/utils.js.map +1 -1
  65. package/build/navigation/constants.js +1 -1
  66. package/build/navigation/constants.js.map +1 -1
  67. package/build/navigation/index.js +4 -2
  68. package/build/navigation/index.js.map +1 -1
  69. package/build/navigation/view.js +168 -82
  70. package/build/navigation/view.js.map +1 -1
  71. package/build/navigation-link/edit.js +3 -9
  72. package/build/navigation-link/edit.js.map +1 -1
  73. package/build/navigation-link/transforms.js +24 -0
  74. package/build/navigation-link/transforms.js.map +1 -1
  75. package/build/page-list/edit.js +2 -1
  76. package/build/page-list/edit.js.map +1 -1
  77. package/build/post-comments-form/edit.js +10 -2
  78. package/build/post-comments-form/edit.js.map +1 -1
  79. package/build/post-comments-form/form.js +5 -3
  80. package/build/post-comments-form/form.js.map +1 -1
  81. package/build/post-content/edit.js +8 -7
  82. package/build/post-content/edit.js.map +1 -1
  83. package/build/post-content/index.js +3 -0
  84. package/build/post-content/index.js.map +1 -1
  85. package/build/post-featured-image/overlay.js +2 -1
  86. package/build/post-featured-image/overlay.js.map +1 -1
  87. package/build/post-terms/use-post-terms.js +3 -2
  88. package/build/post-terms/use-post-terms.js.map +1 -1
  89. package/build/preformatted/edit.js +4 -1
  90. package/build/preformatted/edit.js.map +1 -1
  91. package/build/preformatted/index.js +1 -1
  92. package/build/preformatted/index.js.map +1 -1
  93. package/build/pullquote/deprecated.js +6 -7
  94. package/build/pullquote/deprecated.js.map +1 -1
  95. package/build/query/edit/enhanced-pagination-modal.js +56 -0
  96. package/build/query/edit/enhanced-pagination-modal.js.map +1 -0
  97. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +42 -0
  98. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -0
  99. package/build/query/edit/inspector-controls/index.js +8 -25
  100. package/build/query/edit/inspector-controls/index.js.map +1 -1
  101. package/build/query/edit/query-content.js +8 -2
  102. package/build/query/edit/query-content.js.map +1 -1
  103. package/build/query/utils.js +19 -0
  104. package/build/query/utils.js.map +1 -1
  105. package/build/query/view.js +4 -5
  106. package/build/query/view.js.map +1 -1
  107. package/build/search/index.js +1 -0
  108. package/build/search/index.js.map +1 -1
  109. package/build/search/view.js +81 -150
  110. package/build/search/view.js.map +1 -1
  111. package/build/social-link/edit.native.js +3 -1
  112. package/build/social-link/edit.native.js.map +1 -1
  113. package/build/table/edit.js +7 -7
  114. package/build/table/edit.js.map +1 -1
  115. package/build/table-of-contents/edit.js +2 -130
  116. package/build/table-of-contents/edit.js.map +1 -1
  117. package/build/table-of-contents/hooks.js +145 -0
  118. package/build/table-of-contents/hooks.js.map +1 -0
  119. package/build/table-of-contents/index.js +2 -1
  120. package/build/table-of-contents/index.js.map +1 -1
  121. package/build/verse/edit.js +4 -1
  122. package/build/verse/edit.js.map +1 -1
  123. package/build/verse/index.js +1 -1
  124. package/build/verse/index.js.map +1 -1
  125. package/build-module/block/edit.js +54 -3
  126. package/build-module/block/edit.js.map +1 -1
  127. package/build-module/button/edit.js +7 -4
  128. package/build-module/button/edit.js.map +1 -1
  129. package/build-module/button/index.js +11 -2
  130. package/build-module/button/index.js.map +1 -1
  131. package/build-module/button/save.js +10 -4
  132. package/build-module/button/save.js.map +1 -1
  133. package/build-module/buttons/edit.js +12 -3
  134. package/build-module/buttons/edit.js.map +1 -1
  135. package/build-module/code/edit.js +8 -2
  136. package/build-module/code/edit.js.map +1 -1
  137. package/build-module/code/index.js +7 -1
  138. package/build-module/code/index.js.map +1 -1
  139. package/build-module/column/edit.native.js +5 -5
  140. package/build-module/column/edit.native.js.map +1 -1
  141. package/build-module/column/index.js +1 -0
  142. package/build-module/column/index.js.map +1 -1
  143. package/build-module/columns/index.js +2 -0
  144. package/build-module/columns/index.js.map +1 -1
  145. package/build-module/file/edit.native.js +1 -1
  146. package/build-module/file/edit.native.js.map +1 -1
  147. package/build-module/file/index.js +2 -1
  148. package/build-module/file/index.js.map +1 -1
  149. package/build-module/file/utils/index.js +0 -13
  150. package/build-module/file/utils/index.js.map +1 -1
  151. package/build-module/file/view.js +14 -2
  152. package/build-module/file/view.js.map +1 -1
  153. package/build-module/footnotes/edit.js +14 -5
  154. package/build-module/footnotes/edit.js.map +1 -1
  155. package/build-module/gallery/edit.js +1 -1
  156. package/build-module/gallery/edit.js.map +1 -1
  157. package/build-module/group/edit.js +0 -1
  158. package/build-module/group/edit.js.map +1 -1
  159. package/build-module/group/index.js +5 -0
  160. package/build-module/group/index.js.map +1 -1
  161. package/build-module/heading/edit.js +0 -1
  162. package/build-module/heading/edit.js.map +1 -1
  163. package/build-module/heading/index.js +2 -0
  164. package/build-module/heading/index.js.map +1 -1
  165. package/build-module/heading/transforms.js +3 -6
  166. package/build-module/heading/transforms.js.map +1 -1
  167. package/build-module/image/deprecated.js +191 -7
  168. package/build-module/image/deprecated.js.map +1 -1
  169. package/build-module/image/edit.js +27 -12
  170. package/build-module/image/edit.js.map +1 -1
  171. package/build-module/image/image.js +77 -42
  172. package/build-module/image/image.js.map +1 -1
  173. package/build-module/image/index.js +7 -4
  174. package/build-module/image/index.js.map +1 -1
  175. package/build-module/image/{view-interactivity.js → view.js} +1 -1
  176. package/build-module/image/view.js.map +1 -0
  177. package/build-module/list/deprecated.js +95 -3
  178. package/build-module/list/deprecated.js.map +1 -1
  179. package/build-module/list/edit.js +10 -10
  180. package/build-module/list/edit.js.map +1 -1
  181. package/build-module/list/ordered-list-settings.js +10 -10
  182. package/build-module/list/ordered-list-settings.js.map +1 -1
  183. package/build-module/list/save.js +4 -2
  184. package/build-module/list/save.js.map +1 -1
  185. package/build-module/list/utils.js +20 -2
  186. package/build-module/list/utils.js.map +1 -1
  187. package/build-module/navigation/constants.js +1 -1
  188. package/build-module/navigation/constants.js.map +1 -1
  189. package/build-module/navigation/index.js +4 -2
  190. package/build-module/navigation/index.js.map +1 -1
  191. package/build-module/navigation/view.js +168 -83
  192. package/build-module/navigation/view.js.map +1 -1
  193. package/build-module/navigation-link/edit.js +3 -9
  194. package/build-module/navigation-link/edit.js.map +1 -1
  195. package/build-module/navigation-link/transforms.js +24 -0
  196. package/build-module/navigation-link/transforms.js.map +1 -1
  197. package/build-module/page-list/edit.js +2 -1
  198. package/build-module/page-list/edit.js.map +1 -1
  199. package/build-module/post-comments-form/edit.js +10 -2
  200. package/build-module/post-comments-form/edit.js.map +1 -1
  201. package/build-module/post-comments-form/form.js +5 -3
  202. package/build-module/post-comments-form/form.js.map +1 -1
  203. package/build-module/post-content/edit.js +8 -7
  204. package/build-module/post-content/edit.js.map +1 -1
  205. package/build-module/post-content/index.js +3 -0
  206. package/build-module/post-content/index.js.map +1 -1
  207. package/build-module/post-featured-image/overlay.js +2 -1
  208. package/build-module/post-featured-image/overlay.js.map +1 -1
  209. package/build-module/post-terms/use-post-terms.js +3 -2
  210. package/build-module/post-terms/use-post-terms.js.map +1 -1
  211. package/build-module/preformatted/edit.js +4 -1
  212. package/build-module/preformatted/edit.js.map +1 -1
  213. package/build-module/preformatted/index.js +1 -1
  214. package/build-module/preformatted/index.js.map +1 -1
  215. package/build-module/pullquote/deprecated.js +6 -7
  216. package/build-module/pullquote/deprecated.js.map +1 -1
  217. package/build-module/query/edit/enhanced-pagination-modal.js +50 -0
  218. package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -0
  219. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +35 -0
  220. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -0
  221. package/build-module/query/edit/inspector-controls/index.js +9 -26
  222. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  223. package/build-module/query/edit/query-content.js +8 -2
  224. package/build-module/query/edit/query-content.js.map +1 -1
  225. package/build-module/query/utils.js +17 -0
  226. package/build-module/query/utils.js.map +1 -1
  227. package/build-module/query/view.js +4 -5
  228. package/build-module/query/view.js.map +1 -1
  229. package/build-module/search/index.js +1 -0
  230. package/build-module/search/index.js.map +1 -1
  231. package/build-module/search/view.js +81 -151
  232. package/build-module/search/view.js.map +1 -1
  233. package/build-module/social-link/edit.native.js +3 -1
  234. package/build-module/social-link/edit.native.js.map +1 -1
  235. package/build-module/table/edit.js +7 -7
  236. package/build-module/table/edit.js.map +1 -1
  237. package/build-module/table-of-contents/edit.js +3 -131
  238. package/build-module/table-of-contents/edit.js.map +1 -1
  239. package/build-module/table-of-contents/hooks.js +137 -0
  240. package/build-module/table-of-contents/hooks.js.map +1 -0
  241. package/build-module/table-of-contents/index.js +2 -1
  242. package/build-module/table-of-contents/index.js.map +1 -1
  243. package/build-module/verse/edit.js +4 -1
  244. package/build-module/verse/edit.js.map +1 -1
  245. package/build-module/verse/index.js +1 -1
  246. package/build-module/verse/index.js.map +1 -1
  247. package/build-style/cover/style-rtl.css +9 -0
  248. package/build-style/cover/style.css +9 -0
  249. package/build-style/editor-rtl.css +15 -9
  250. package/build-style/editor.css +15 -9
  251. package/build-style/file/style-rtl.css +5 -0
  252. package/build-style/file/style.css +5 -0
  253. package/build-style/heading/style-rtl.css +13 -0
  254. package/build-style/heading/style.css +13 -0
  255. package/build-style/navigation-link/editor-rtl.css +0 -9
  256. package/build-style/navigation-link/editor.css +0 -9
  257. package/build-style/paragraph/editor-rtl.css +5 -0
  258. package/build-style/paragraph/editor.css +5 -0
  259. package/build-style/paragraph/style-rtl.css +5 -0
  260. package/build-style/paragraph/style.css +5 -0
  261. package/build-style/post-navigation-link/style-rtl.css +3 -0
  262. package/build-style/post-navigation-link/style.css +3 -0
  263. package/build-style/query/editor-rtl.css +10 -0
  264. package/build-style/query/editor.css +10 -0
  265. package/build-style/query/style-rtl.css +1 -1
  266. package/build-style/query/style.css +1 -1
  267. package/build-style/reset-rtl.css +27 -27
  268. package/build-style/reset.css +27 -27
  269. package/build-style/style-rtl.css +35 -0
  270. package/build-style/style.css +35 -0
  271. package/package.json +32 -33
  272. package/src/audio/test/__snapshots__/edit.native.js.snap +78 -106
  273. package/src/avatar/index.php +2 -2
  274. package/src/block/edit.js +58 -2
  275. package/src/block/test/edit.native.js +2 -3
  276. package/src/button/block.json +11 -2
  277. package/src/button/edit.js +27 -11
  278. package/src/button/save.js +10 -4
  279. package/src/buttons/edit.js +13 -3
  280. package/src/buttons/test/edit.native.js +28 -24
  281. package/src/calendar/index.php +2 -2
  282. package/src/code/block.json +2 -1
  283. package/src/code/edit.js +13 -1
  284. package/src/code/index.js +5 -0
  285. package/src/column/block.json +1 -0
  286. package/src/column/edit.native.js +4 -4
  287. package/src/columns/block.json +2 -0
  288. package/src/columns/test/__snapshots__/edit.native.js.snap +14 -0
  289. package/src/columns/test/edit.native.js +47 -17
  290. package/src/comment-template/index.php +1 -1
  291. package/src/comments-pagination-next/index.php +1 -1
  292. package/src/comments-pagination-previous/index.php +1 -1
  293. package/src/cover/style.scss +12 -1
  294. package/src/cover/test/edit.js +7 -7
  295. package/src/cover/test/edit.native.js +18 -27
  296. package/src/embed/test/index.native.js +30 -45
  297. package/src/file/block.json +2 -1
  298. package/src/file/edit.native.js +1 -1
  299. package/src/file/index.php +19 -21
  300. package/src/file/style.scss +6 -1
  301. package/src/file/test/__snapshots__/edit.native.js.snap +162 -218
  302. package/src/file/utils/index.js +0 -15
  303. package/src/file/view.js +14 -5
  304. package/src/footnotes/edit.js +16 -2
  305. package/src/gallery/edit.js +1 -1
  306. package/src/gallery/index.php +1 -1
  307. package/src/group/block.json +5 -0
  308. package/src/group/edit.js +0 -1
  309. package/src/heading/block.json +2 -0
  310. package/src/heading/edit.js +0 -1
  311. package/src/heading/style.scss +4 -0
  312. package/src/heading/transforms.js +1 -6
  313. package/src/image/block.json +7 -4
  314. package/src/image/deprecated.js +210 -7
  315. package/src/image/edit.js +43 -29
  316. package/src/image/image.js +86 -43
  317. package/src/image/index.php +251 -28
  318. package/src/latest-posts/index.php +1 -1
  319. package/src/list/deprecated.js +84 -3
  320. package/src/list/edit.js +6 -3
  321. package/src/list/ordered-list-settings.js +20 -5
  322. package/src/list/save.js +10 -1
  323. package/src/list/test/edit.native.js +2 -4
  324. package/src/list/utils.js +22 -1
  325. package/src/navigation/block.json +4 -2
  326. package/src/navigation/constants.js +1 -0
  327. package/src/navigation/index.php +85 -123
  328. package/src/navigation/view.js +192 -96
  329. package/src/navigation-link/edit.js +21 -36
  330. package/src/navigation-link/editor.scss +0 -8
  331. package/src/navigation-link/transforms.js +22 -0
  332. package/src/page-list/edit.js +2 -1
  333. package/src/paragraph/editor.scss +5 -0
  334. package/src/paragraph/style.scss +5 -0
  335. package/src/pattern/index.php +2 -2
  336. package/src/post-comments-form/edit.js +10 -0
  337. package/src/post-comments-form/form.js +7 -1
  338. package/src/post-content/block.json +3 -0
  339. package/src/post-content/edit.js +14 -6
  340. package/src/post-excerpt/index.php +2 -2
  341. package/src/post-featured-image/index.php +2 -2
  342. package/src/post-featured-image/overlay.js +1 -0
  343. package/src/post-navigation-link/index.php +5 -1
  344. package/src/post-navigation-link/style.scss +4 -0
  345. package/src/post-template/index.php +1 -1
  346. package/src/post-terms/index.php +5 -2
  347. package/src/post-terms/use-post-terms.js +4 -2
  348. package/src/preformatted/edit.js +5 -0
  349. package/src/preformatted/index.js +1 -1
  350. package/src/pullquote/deprecated.js +8 -13
  351. package/src/query/edit/enhanced-pagination-modal.js +65 -0
  352. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +49 -0
  353. package/src/query/edit/inspector-controls/index.js +9 -45
  354. package/src/query/edit/query-content.js +8 -0
  355. package/src/query/editor.scss +10 -0
  356. package/src/query/index.php +29 -16
  357. package/src/query/style.scss +2 -2
  358. package/src/query/utils.js +22 -0
  359. package/src/query/view.js +5 -5
  360. package/src/query-pagination-next/index.php +1 -1
  361. package/src/query-pagination-previous/index.php +1 -1
  362. package/src/reset.scss +1 -1
  363. package/src/search/block.json +1 -0
  364. package/src/search/index.php +45 -4
  365. package/src/search/test/__snapshots__/edit.native.js.snap +265 -363
  366. package/src/search/view.js +70 -169
  367. package/src/social-link/edit.native.js +1 -1
  368. package/src/social-link/editor.native.scss +4 -0
  369. package/src/table/edit.js +21 -19
  370. package/src/table-of-contents/block.json +2 -1
  371. package/src/table-of-contents/edit.js +5 -162
  372. package/src/table-of-contents/hooks.js +156 -0
  373. package/src/verse/edit.js +5 -0
  374. package/src/verse/index.js +1 -1
  375. package/src/verse/test/edit.native.js +2 -3
  376. package/build/file/view-interactivity.js +0 -22
  377. package/build/file/view-interactivity.js.map +0 -1
  378. package/build/image/view-interactivity.js.map +0 -1
  379. package/build/navigation/view-interactivity.js +0 -172
  380. package/build/navigation/view-interactivity.js.map +0 -1
  381. package/build/navigation/view-modal.js +0 -115
  382. package/build/navigation/view-modal.js.map +0 -1
  383. package/build-module/file/view-interactivity.js +0 -18
  384. package/build-module/file/view-interactivity.js.map +0 -1
  385. package/build-module/image/view-interactivity.js.map +0 -1
  386. package/build-module/navigation/view-interactivity.js +0 -169
  387. package/build-module/navigation/view-interactivity.js.map +0 -1
  388. package/build-module/navigation/view-modal.js +0 -112
  389. package/build-module/navigation/view-modal.js.map +0 -1
  390. package/src/file/view-interactivity.js +0 -18
  391. package/src/navigation/view-interactivity.js +0 -196
  392. package/src/navigation/view-modal.js +0 -127
  393. /package/src/image/{view-interactivity.js → view.js} +0 -0
@@ -486,13 +486,8 @@ export default function NavigationLinkEdit( {
486
486
  { /* eslint-enable */ }
487
487
  { ! url ? (
488
488
  <div className="wp-block-navigation-link__placeholder-text">
489
- <Tooltip position="top center" text={ tooltipText }>
490
- <>
491
- <span>{ missingText }</span>
492
- <span className="wp-block-navigation-link__missing_text-tooltip">
493
- { tooltipText }
494
- </span>
495
- </>
489
+ <Tooltip text={ tooltipText }>
490
+ <span>{ missingText }</span>
496
491
  </Tooltip>
497
492
  </div>
498
493
  ) : (
@@ -548,35 +543,25 @@ export default function NavigationLinkEdit( {
548
543
  isDraft ||
549
544
  isLabelFieldFocused ) && (
550
545
  <div className="wp-block-navigation-link__placeholder-text wp-block-navigation-link__label">
551
- <Tooltip
552
- position="top center"
553
- text={ tooltipText }
554
- >
555
- <>
556
- <span
557
- aria-label={ __(
558
- 'Navigation link text'
559
- ) }
560
- >
561
- {
562
- // Some attributes are stored in an escaped form. It's a legacy issue.
563
- // Ideally they would be stored in a raw, unescaped form.
564
- // Unescape is used here to "recover" the escaped characters
565
- // so they display without encoding.
566
- // See `updateAttributes` for more details.
567
- `${ decodeEntities(
568
- label
569
- ) } ${
570
- isInvalid || isDraft
571
- ? placeholderText
572
- : ''
573
- }`.trim()
574
- }
575
- </span>
576
- <span className="wp-block-navigation-link__missing_text-tooltip">
577
- { tooltipText }
578
- </span>
579
- </>
546
+ <Tooltip text={ tooltipText }>
547
+ <span
548
+ aria-label={ __(
549
+ 'Navigation link text'
550
+ ) }
551
+ >
552
+ {
553
+ // Some attributes are stored in an escaped form. It's a legacy issue.
554
+ // Ideally they would be stored in a raw, unescaped form.
555
+ // Unescape is used here to "recover" the escaped characters
556
+ // so they display without encoding.
557
+ // See `updateAttributes` for more details.
558
+ `${ decodeEntities( label ) } ${
559
+ isInvalid || isDraft
560
+ ? placeholderText
561
+ : ''
562
+ }`.trim()
563
+ }
564
+ </span>
580
565
  </Tooltip>
581
566
  </div>
582
567
  ) }
@@ -67,14 +67,6 @@
67
67
  color: #000;
68
68
  }
69
69
 
70
- .wp-block-navigation-link__missing_text-tooltip {
71
- position: absolute;
72
- width: 1px;
73
- height: 1px;
74
- padding: 0;
75
- margin: -1px;
76
- overflow: hidden;
77
- }
78
70
  /**
79
71
  * Menu item setup state. Is shown when a menu item has no URL configured.
80
72
  */
@@ -47,6 +47,13 @@ const transforms = {
47
47
  return createBlock( 'core/navigation-link' );
48
48
  },
49
49
  },
50
+ {
51
+ type: 'block',
52
+ blocks: [ 'core/buttons' ],
53
+ transform: () => {
54
+ return createBlock( 'core/navigation-link' );
55
+ },
56
+ },
50
57
  ],
51
58
  to: [
52
59
  {
@@ -105,6 +112,21 @@ const transforms = {
105
112
  return createBlock( 'core/page-list' );
106
113
  },
107
114
  },
115
+ {
116
+ type: 'block',
117
+ blocks: [ 'core/buttons' ],
118
+ transform: ( { label, url, rel, title, opensInNewTab } ) => {
119
+ return createBlock( 'core/buttons', {}, [
120
+ createBlock( 'core/button', {
121
+ text: label,
122
+ url,
123
+ rel,
124
+ title,
125
+ linkTarget: opensInNewTab ? '_blank' : undefined,
126
+ } ),
127
+ ] );
128
+ },
129
+ },
108
130
  ],
109
131
  };
110
132
 
@@ -320,8 +320,9 @@ export default function PageListEdit( {
320
320
  { pagesTree.length > 0 && (
321
321
  <PanelBody>
322
322
  <ComboboxControl
323
+ __next40pxDefaultSize
323
324
  className="editor-page-attributes__parent"
324
- label={ __( 'Parent page' ) }
325
+ label={ __( 'Parent' ) }
325
326
  value={ parentPageID }
326
327
  options={ pagesTree }
327
328
  onChange={ ( value ) =>
@@ -17,3 +17,8 @@
17
17
  }
18
18
  }
19
19
  }
20
+
21
+ .block-editor-block-list__block[data-type="core/paragraph"].has-text-align-right[style*="writing-mode: vertical-rl"],
22
+ .block-editor-block-list__block[data-type="core/paragraph"].has-text-align-left[style*="writing-mode: vertical-lr"] {
23
+ rotate: 180deg;
24
+ }
@@ -49,3 +49,8 @@ p.has-background {
49
49
  :where(p.has-text-color:not(.has-link-color)) a {
50
50
  color: inherit;
51
51
  }
52
+
53
+ p.has-text-align-right[style*="writing-mode:vertical-rl"],
54
+ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
55
+ rotate: 180deg;
56
+ }
@@ -43,8 +43,8 @@ function render_block_core_pattern( $attributes ) {
43
43
  $pattern = $registry->get_registered( $slug );
44
44
  $content = _inject_theme_attribute_in_block_template_content( $pattern['content'] );
45
45
 
46
- $gutenberg_experiments = get_option( 'gutenberg-experiments' );
47
- if ( $gutenberg_experiments && ! empty( $gutenberg_experiments['gutenberg-auto-inserting-blocks'] ) ) {
46
+ // This can be removed when the minimum supported WordPress is >= 6.4.
47
+ if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
48
48
  // TODO: In the long run, we'd likely want to have a filter in the `WP_Block_Patterns_Registry` class
49
49
  // instead to allow us plugging in code like this.
50
50
  $blocks = parse_blocks( $content );
@@ -11,6 +11,9 @@ import {
11
11
  BlockControls,
12
12
  useBlockProps,
13
13
  } from '@wordpress/block-editor';
14
+ import { VisuallyHidden } from '@wordpress/components';
15
+ import { useInstanceId } from '@wordpress/compose';
16
+ import { __, sprintf } from '@wordpress/i18n';
14
17
 
15
18
  /**
16
19
  * Internal dependencies
@@ -25,10 +28,14 @@ export default function PostCommentsFormEdit( {
25
28
  const { textAlign } = attributes;
26
29
  const { postId, postType } = context;
27
30
 
31
+ const instanceId = useInstanceId( PostCommentsFormEdit );
32
+ const instanceIdDesc = sprintf( 'comments-form-edit-%d-desc', instanceId );
33
+
28
34
  const blockProps = useBlockProps( {
29
35
  className: classnames( {
30
36
  [ `has-text-align-${ textAlign }` ]: textAlign,
31
37
  } ),
38
+ 'aria-describedby': instanceIdDesc,
32
39
  } );
33
40
 
34
41
  return (
@@ -43,6 +50,9 @@ export default function PostCommentsFormEdit( {
43
50
  </BlockControls>
44
51
  <div { ...blockProps }>
45
52
  <CommentsForm postId={ postId } postType={ postType } />
53
+ <VisuallyHidden id={ instanceIdDesc }>
54
+ { __( 'Comments form disabled in editor.' ) }
55
+ </VisuallyHidden>
46
56
  </div>
47
57
  </>
48
58
  );
@@ -23,7 +23,11 @@ const CommentsFormPlaceholder = () => {
23
23
  return (
24
24
  <div className="comment-respond">
25
25
  <h3 className="comment-reply-title">{ __( 'Leave a Reply' ) }</h3>
26
- <form noValidate className="comment-form" inert="true">
26
+ <form
27
+ noValidate
28
+ className="comment-form"
29
+ onSubmit={ ( event ) => event.preventDefault() }
30
+ >
27
31
  <p>
28
32
  <label htmlFor={ `comment-${ instanceId }` }>
29
33
  { __( 'Comment' ) }
@@ -33,6 +37,7 @@ const CommentsFormPlaceholder = () => {
33
37
  name="comment"
34
38
  cols="45"
35
39
  rows="8"
40
+ readOnly
36
41
  />
37
42
  </p>
38
43
  <p className="form-submit wp-block-button">
@@ -45,6 +50,7 @@ const CommentsFormPlaceholder = () => {
45
50
  ) }
46
51
  label={ __( 'Post Comment' ) }
47
52
  value={ __( 'Post Comment' ) }
53
+ aria-disabled="true"
48
54
  />
49
55
  </p>
50
56
  </form>
@@ -14,6 +14,9 @@
14
14
  "dimensions": {
15
15
  "minHeight": true
16
16
  },
17
+ "spacing": {
18
+ "blockGap": true
19
+ },
17
20
  "color": {
18
21
  "gradients": true,
19
22
  "link": true,
@@ -20,14 +20,19 @@ import { useSelect } from '@wordpress/data';
20
20
  */
21
21
  import { useCanEditEntity } from '../utils/hooks';
22
22
 
23
- function ReadOnlyContent( { userCanEdit, postType, postId } ) {
23
+ function ReadOnlyContent( {
24
+ layoutClassNames,
25
+ userCanEdit,
26
+ postType,
27
+ postId,
28
+ } ) {
24
29
  const [ , , content ] = useEntityProp(
25
30
  'postType',
26
31
  postType,
27
32
  'content',
28
33
  postId
29
34
  );
30
- const blockProps = useBlockProps();
35
+ const blockProps = useBlockProps( { className: layoutClassNames } );
31
36
  return content?.protected && ! userCanEdit ? (
32
37
  <div { ...blockProps }>
33
38
  <Warning>{ __( 'This content is password protected.' ) }</Warning>
@@ -77,7 +82,8 @@ function EditableContent( { context = {} } ) {
77
82
  }
78
83
 
79
84
  function Content( props ) {
80
- const { context: { queryId, postType, postId } = {} } = props;
85
+ const { context: { queryId, postType, postId } = {}, layoutClassNames } =
86
+ props;
81
87
  const userCanEdit = useCanEditEntity( 'postType', postType, postId );
82
88
  if ( userCanEdit === undefined ) {
83
89
  return null;
@@ -90,6 +96,7 @@ function Content( props ) {
90
96
  <EditableContent { ...props } />
91
97
  ) : (
92
98
  <ReadOnlyContent
99
+ layoutClassNames={ layoutClassNames }
93
100
  userCanEdit={ userCanEdit }
94
101
  postType={ postType }
95
102
  postId={ postId }
@@ -133,11 +140,9 @@ function RecursionError() {
133
140
 
134
141
  export default function PostContentEdit( {
135
142
  context,
136
- attributes,
137
143
  __unstableLayoutClassNames: layoutClassNames,
138
144
  } ) {
139
145
  const { postId: contextPostId, postType: contextPostType } = context;
140
- const { layout = {} } = attributes;
141
146
  const hasAlreadyRendered = useHasRecursion( contextPostId );
142
147
 
143
148
  if ( contextPostId && contextPostType && hasAlreadyRendered ) {
@@ -147,7 +152,10 @@ export default function PostContentEdit( {
147
152
  return (
148
153
  <RecursionProvider uniqueId={ contextPostId }>
149
154
  { contextPostId && contextPostType ? (
150
- <Content context={ context } layout={ layout } />
155
+ <Content
156
+ context={ context }
157
+ layoutClassNames={ layoutClassNames }
158
+ />
151
159
  ) : (
152
160
  <Placeholder layoutClassNames={ layoutClassNames } />
153
161
  ) }
@@ -31,7 +31,7 @@ function render_block_core_post_excerpt( $attributes, $content, $block ) {
31
31
  }
32
32
 
33
33
  $more_text = ! empty( $attributes['moreText'] ) ? '<a class="wp-block-post-excerpt__more-link" href="' . esc_url( get_the_permalink( $block->context['postId'] ) ) . '">' . wp_kses_post( $attributes['moreText'] ) . '</a>' : '';
34
- $filter_excerpt_more = static function( $more ) use ( $more_text ) {
34
+ $filter_excerpt_more = static function ( $more ) use ( $more_text ) {
35
35
  return empty( $more_text ) ? $more : '';
36
36
  };
37
37
  /**
@@ -87,7 +87,7 @@ if ( is_admin() ||
87
87
  defined( 'REST_REQUEST' ) && REST_REQUEST ) {
88
88
  add_filter(
89
89
  'excerpt_length',
90
- static function() {
90
+ static function () {
91
91
  return 100;
92
92
  },
93
93
  PHP_INT_MAX
@@ -184,12 +184,12 @@ function get_block_core_post_featured_image_border_attributes( $attributes ) {
184
184
 
185
185
  // Border color.
186
186
  $preset_color = array_key_exists( 'borderColor', $attributes ) ? "var:preset|color|{$attributes['borderColor']}" : null;
187
- $custom_color = _wp_array_get( $attributes, array( 'style', 'border', 'color' ), null );
187
+ $custom_color = $attributes['style']['border']['color'] ?? null;
188
188
  $border_styles['color'] = $preset_color ? $preset_color : $custom_color;
189
189
 
190
190
  // Individual border styles e.g. top, left etc.
191
191
  foreach ( $sides as $side ) {
192
- $border = _wp_array_get( $attributes, array( 'style', 'border', $side ), null );
192
+ $border = $attributes['style']['border'][ $side ] ?? null;
193
193
  $border_styles[ $side ] = array(
194
194
  'color' => isset( $border['color'] ) ? $border['color'] : null,
195
195
  'style' => isset( $border['style'] ) ? $border['style'] : null,
@@ -113,6 +113,7 @@ const Overlay = ( {
113
113
  max={ 100 }
114
114
  step={ 10 }
115
115
  required
116
+ __next40pxDefaultSize
116
117
  />
117
118
  </ToolsPanelItem>
118
119
  </InspectorControls>
@@ -28,7 +28,11 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
28
28
  if ( isset( $attributes['textAlign'] ) ) {
29
29
  $classes .= " has-text-align-{$attributes['textAlign']}";
30
30
  }
31
- $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
31
+ $wrapper_attributes = get_block_wrapper_attributes(
32
+ array(
33
+ 'class' => $classes,
34
+ )
35
+ );
32
36
  // Set default values.
33
37
  $format = '%link';
34
38
  $link = 'next' === $navigation_type ? _x( 'Next', 'label for next post link' ) : _x( 'Previous', 'label for previous post link' );
@@ -20,4 +20,8 @@
20
20
  }
21
21
  }
22
22
 
23
+ &.has-text-align-right[style*="writing-mode: vertical-rl"],
24
+ &.has-text-align-left[style*="writing-mode: vertical-lr"] {
25
+ rotate: 180deg;
26
+ }
23
27
  }
@@ -106,7 +106,7 @@ function render_block_core_post_template( $attributes, $content, $block ) {
106
106
 
107
107
  $post_id = get_the_ID();
108
108
  $post_type = get_post_type();
109
- $filter_block_context = static function( $context ) use ( $post_id, $post_type ) {
109
+ $filter_block_context = static function ( $context ) use ( $post_id, $post_type ) {
110
110
  $context['postType'] = $post_type;
111
111
  $context['postId'] = $post_id;
112
112
  return $context;
@@ -81,8 +81,11 @@ function register_block_core_post_terms() {
81
81
  $variation = array(
82
82
  'name' => $taxonomy->name,
83
83
  'title' => $taxonomy->label,
84
- /* translators: %s: taxonomy's label */
85
- 'description' => sprintf( __( 'Display the assigned taxonomy: %s' ), $taxonomy->label ),
84
+ 'description' => sprintf(
85
+ /* translators: %s: taxonomy's label */
86
+ __( 'Display a list of assigned terms from the taxonomy: %s' ),
87
+ $taxonomy->label
88
+ ),
86
89
  'attributes' => array(
87
90
  'term' => $taxonomy->name,
88
91
  ),
@@ -4,6 +4,8 @@
4
4
  import { store as coreStore } from '@wordpress/core-data';
5
5
  import { useSelect } from '@wordpress/data';
6
6
 
7
+ const EMPTY_ARRAY = [];
8
+
7
9
  export default function usePostTerms( { postId, term } ) {
8
10
  const { slug } = term;
9
11
 
@@ -12,8 +14,8 @@ export default function usePostTerms( { postId, term } ) {
12
14
  const visible = term?.visibility?.publicly_queryable;
13
15
  if ( ! visible ) {
14
16
  return {
15
- postTerms: [],
16
- _isLoading: false,
17
+ postTerms: EMPTY_ARRAY,
18
+ isLoading: false,
17
19
  hasPostTerms: false,
18
20
  };
19
21
  }
@@ -3,12 +3,14 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { RichText, useBlockProps } from '@wordpress/block-editor';
6
+ import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
6
7
 
7
8
  export default function PreformattedEdit( {
8
9
  attributes,
9
10
  mergeBlocks,
10
11
  setAttributes,
11
12
  onRemove,
13
+ insertBlocksAfter,
12
14
  style,
13
15
  } ) {
14
16
  const { content } = attributes;
@@ -31,6 +33,9 @@ export default function PreformattedEdit( {
31
33
  onMerge={ mergeBlocks }
32
34
  { ...blockProps }
33
35
  __unstablePastePlainText
36
+ __unstableOnSplitAtDoubleLineEnd={ () =>
37
+ insertBlocksAfter( createBlock( getDefaultBlockName() ) )
38
+ }
34
39
  />
35
40
  );
36
41
  }
@@ -34,7 +34,7 @@ export const settings = {
34
34
  save,
35
35
  merge( attributes, attributesToMerge ) {
36
36
  return {
37
- content: attributes.content + attributesToMerge.content,
37
+ content: attributes.content + '\n\n' + attributesToMerge.content,
38
38
  };
39
39
  },
40
40
  };
@@ -14,12 +14,6 @@ import {
14
14
  useBlockProps,
15
15
  } from '@wordpress/block-editor';
16
16
  import { select } from '@wordpress/data';
17
- import {
18
- create,
19
- replace,
20
- toHTMLString,
21
- __UNSTABLE_LINE_SEPARATOR,
22
- } from '@wordpress/rich-text';
23
17
 
24
18
  /**
25
19
  * Internal dependencies
@@ -64,13 +58,14 @@ function parseBorderColor( styleString ) {
64
58
  }
65
59
 
66
60
  function multilineToInline( value ) {
67
- return toHTMLString( {
68
- value: replace(
69
- create( { html: value, multilineTag: 'p' } ),
70
- new RegExp( __UNSTABLE_LINE_SEPARATOR, 'g' ),
71
- '\n'
72
- ),
73
- } );
61
+ value = value || `<p></p>`;
62
+ const padded = `</p>${ value }<p>`;
63
+ const values = padded.split( `</p><p>` );
64
+
65
+ values.shift();
66
+ values.pop();
67
+
68
+ return values.join( '<br>' );
74
69
  }
75
70
 
76
71
  const v5 = {
@@ -0,0 +1,65 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ Button,
6
+ Modal,
7
+ __experimentalVStack as VStack,
8
+ } from '@wordpress/components';
9
+ import { __ } from '@wordpress/i18n';
10
+ import { useState, useEffect } from '@wordpress/element';
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import { useContainsThirdPartyBlocks } from '../utils';
16
+
17
+ const disableEnhancedPaginationDescription = __(
18
+ 'Plugin blocks are not supported yet. For the enhanced pagination to work, remove the plugin block, then re-enable "Enhanced pagination" in the Query Block settings.'
19
+ );
20
+
21
+ const modalDescriptionId =
22
+ 'wp-block-query-enhanced-pagination-modal__description';
23
+
24
+ export default function EnhancedPaginationModal( {
25
+ clientId,
26
+ attributes: { enhancedPagination },
27
+ setAttributes,
28
+ } ) {
29
+ const [ isOpen, setOpen ] = useState( false );
30
+
31
+ const containsThirdPartyBlocks = useContainsThirdPartyBlocks( clientId );
32
+
33
+ useEffect( () => {
34
+ setOpen( containsThirdPartyBlocks && enhancedPagination );
35
+ }, [ containsThirdPartyBlocks, enhancedPagination, setOpen ] );
36
+
37
+ return (
38
+ isOpen && (
39
+ <Modal
40
+ title={ __( 'Enhanced pagination will be disabled' ) }
41
+ className="wp-block-query__enhanced-pagination-modal"
42
+ aria={ {
43
+ describedby: modalDescriptionId,
44
+ } }
45
+ isDismissible={ false }
46
+ shouldCloseOnEsc={ false }
47
+ shouldCloseOnClickOutside={ false }
48
+ >
49
+ <VStack alignment="right" spacing={ 5 }>
50
+ <span id={ modalDescriptionId }>
51
+ { disableEnhancedPaginationDescription }
52
+ </span>
53
+ <Button
54
+ variant="primary"
55
+ onClick={ () => {
56
+ setAttributes( { enhancedPagination: false } );
57
+ } }
58
+ >
59
+ { __( 'OK' ) }
60
+ </Button>
61
+ </VStack>
62
+ </Modal>
63
+ )
64
+ );
65
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { ToggleControl, Notice } from '@wordpress/components';
5
+ import { __ } from '@wordpress/i18n';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { useContainsThirdPartyBlocks } from '../../utils';
11
+
12
+ export default function EnhancedPaginationControl( {
13
+ enhancedPagination,
14
+ setAttributes,
15
+ clientId,
16
+ } ) {
17
+ const enhancedPaginationNotice = __(
18
+ "Enhanced pagination doesn't support plugin blocks yet. If you want to enable it, you have to remove all plugin blocks from the Query Loop."
19
+ );
20
+
21
+ const containsThirdPartyBlocks = useContainsThirdPartyBlocks( clientId );
22
+
23
+ return (
24
+ <>
25
+ <ToggleControl
26
+ label={ __( 'Enhanced pagination' ) }
27
+ help={ __(
28
+ 'Browsing between pages won’t require a full page reload.'
29
+ ) }
30
+ checked={ !! enhancedPagination }
31
+ disabled={ containsThirdPartyBlocks }
32
+ onChange={ ( value ) => {
33
+ setAttributes( {
34
+ enhancedPagination: !! value,
35
+ } );
36
+ } }
37
+ />
38
+ { containsThirdPartyBlocks && (
39
+ <Notice
40
+ status="warning"
41
+ isDismissible={ false }
42
+ className="wp-block-query__enhanced-pagination-notice"
43
+ >
44
+ { enhancedPaginationNotice }
45
+ </Notice>
46
+ ) }
47
+ </>
48
+ );
49
+ }