@wordpress/block-library 9.1.0 → 9.3.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 (387) hide show
  1. package/CHANGELOG.md +21 -17
  2. package/build/audio/edit.js +20 -8
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/audio/index.js +4 -0
  5. package/build/audio/index.js.map +1 -1
  6. package/build/audio/transforms.js +1 -1
  7. package/build/audio/transforms.js.map +1 -1
  8. package/build/block/edit.js +0 -1
  9. package/build/block/edit.js.map +1 -1
  10. package/build/block/index.js +5 -1
  11. package/build/block/index.js.map +1 -1
  12. package/build/button/index.js +1 -0
  13. package/build/button/index.js.map +1 -1
  14. package/build/embed/embed-preview.js +4 -4
  15. package/build/embed/embed-preview.js.map +1 -1
  16. package/build/file/edit.js +14 -6
  17. package/build/file/edit.js.map +1 -1
  18. package/build/file/index.js +4 -0
  19. package/build/file/index.js.map +1 -1
  20. package/build/file/transforms.js +2 -3
  21. package/build/file/transforms.js.map +1 -1
  22. package/build/gallery/deprecated.js +6 -54
  23. package/build/gallery/deprecated.js.map +1 -1
  24. package/build/gallery/edit.js +9 -8
  25. package/build/gallery/edit.js.map +1 -1
  26. package/build/gallery/index.js +2 -2
  27. package/build/gallery/index.js.map +1 -1
  28. package/build/gallery/save.js +0 -11
  29. package/build/gallery/save.js.map +1 -1
  30. package/build/gallery/shared.js +0 -27
  31. package/build/gallery/shared.js.map +1 -1
  32. package/build/gallery/transforms.js +29 -80
  33. package/build/gallery/transforms.js.map +1 -1
  34. package/build/group/index.js +1 -0
  35. package/build/group/index.js.map +1 -1
  36. package/build/group/placeholder.js +5 -0
  37. package/build/group/placeholder.js.map +1 -1
  38. package/build/image/edit.js +13 -21
  39. package/build/image/edit.js.map +1 -1
  40. package/build/image/image.js +33 -19
  41. package/build/image/image.js.map +1 -1
  42. package/build/image/index.js +4 -0
  43. package/build/image/index.js.map +1 -1
  44. package/build/image/transforms.js +1 -1
  45. package/build/image/transforms.js.map +1 -1
  46. package/build/list-item/edit.js +1 -1
  47. package/build/list-item/edit.js.map +1 -1
  48. package/build/list-item/hooks/use-merge.js +8 -1
  49. package/build/list-item/hooks/use-merge.js.map +1 -1
  50. package/build/list-item/index.js +11 -1
  51. package/build/list-item/index.js.map +1 -1
  52. package/build/lock-unlock.js +1 -1
  53. package/build/lock-unlock.js.map +1 -1
  54. package/build/loginout/index.js +3 -0
  55. package/build/loginout/index.js.map +1 -1
  56. package/build/media-text/edit.js +3 -2
  57. package/build/media-text/edit.js.map +1 -1
  58. package/build/navigation-submenu/edit.js +1 -1
  59. package/build/navigation-submenu/edit.js.map +1 -1
  60. package/build/page-list/convert-to-links-modal.js +1 -1
  61. package/build/page-list/convert-to-links-modal.js.map +1 -1
  62. package/build/page-list/edit.js +1 -1
  63. package/build/page-list/edit.js.map +1 -1
  64. package/build/post-content/index.js +3 -0
  65. package/build/post-content/index.js.map +1 -1
  66. package/build/post-date/edit.js +3 -1
  67. package/build/post-date/edit.js.map +1 -1
  68. package/build/post-excerpt/index.js +3 -0
  69. package/build/post-excerpt/index.js.map +1 -1
  70. package/build/post-title/index.js +3 -0
  71. package/build/post-title/index.js.map +1 -1
  72. package/build/query/edit/inspector-controls/index.js +3 -2
  73. package/build/query/edit/inspector-controls/index.js.map +1 -1
  74. package/build/query/edit/query-toolbar.js +54 -61
  75. package/build/query/edit/query-toolbar.js.map +1 -1
  76. package/build/query/index.js +34 -0
  77. package/build/query/index.js.map +1 -1
  78. package/build/quote/edit.js +1 -0
  79. package/build/quote/edit.js.map +1 -1
  80. package/build/site-tagline/index.js +1 -0
  81. package/build/site-tagline/index.js.map +1 -1
  82. package/build/site-title/index.js +1 -0
  83. package/build/site-title/index.js.map +1 -1
  84. package/build/social-link/edit.js +9 -3
  85. package/build/social-link/edit.js.map +1 -1
  86. package/build/table/edit.js +8 -17
  87. package/build/table/edit.js.map +1 -1
  88. package/build/table-of-contents/index.js +1 -1
  89. package/build/template-part/edit/title-modal.js +1 -1
  90. package/build/template-part/edit/title-modal.js.map +1 -1
  91. package/build/utils/caption.js +2 -1
  92. package/build/utils/caption.js.map +1 -1
  93. package/build/utils/hooks.js +12 -0
  94. package/build/utils/hooks.js.map +1 -1
  95. package/build/verse/index.js +1 -0
  96. package/build/verse/index.js.map +1 -1
  97. package/build/video/deprecated.js +4 -0
  98. package/build/video/deprecated.js.map +1 -1
  99. package/build/video/edit.js +17 -7
  100. package/build/video/edit.js.map +1 -1
  101. package/build/video/index.js +4 -0
  102. package/build/video/index.js.map +1 -1
  103. package/build/video/transforms.js +1 -1
  104. package/build/video/transforms.js.map +1 -1
  105. package/build-module/audio/edit.js +20 -8
  106. package/build-module/audio/edit.js.map +1 -1
  107. package/build-module/audio/index.js +4 -0
  108. package/build-module/audio/index.js.map +1 -1
  109. package/build-module/audio/transforms.js +1 -1
  110. package/build-module/audio/transforms.js.map +1 -1
  111. package/build-module/block/edit.js +0 -1
  112. package/build-module/block/edit.js.map +1 -1
  113. package/build-module/block/index.js +5 -1
  114. package/build-module/block/index.js.map +1 -1
  115. package/build-module/button/index.js +1 -0
  116. package/build-module/button/index.js.map +1 -1
  117. package/build-module/embed/embed-preview.js +4 -4
  118. package/build-module/embed/embed-preview.js.map +1 -1
  119. package/build-module/file/edit.js +15 -7
  120. package/build-module/file/edit.js.map +1 -1
  121. package/build-module/file/index.js +4 -0
  122. package/build-module/file/index.js.map +1 -1
  123. package/build-module/file/transforms.js +2 -3
  124. package/build-module/file/transforms.js.map +1 -1
  125. package/build-module/gallery/deprecated.js +6 -54
  126. package/build-module/gallery/deprecated.js.map +1 -1
  127. package/build-module/gallery/edit.js +10 -9
  128. package/build-module/gallery/edit.js.map +1 -1
  129. package/build-module/gallery/index.js +1 -1
  130. package/build-module/gallery/index.js.map +1 -1
  131. package/build-module/gallery/save.js +0 -11
  132. package/build-module/gallery/save.js.map +1 -1
  133. package/build-module/gallery/shared.js +0 -25
  134. package/build-module/gallery/shared.js.map +1 -1
  135. package/build-module/gallery/transforms.js +29 -80
  136. package/build-module/gallery/transforms.js.map +1 -1
  137. package/build-module/group/index.js +1 -0
  138. package/build-module/group/index.js.map +1 -1
  139. package/build-module/group/placeholder.js +5 -0
  140. package/build-module/group/placeholder.js.map +1 -1
  141. package/build-module/image/edit.js +12 -20
  142. package/build-module/image/edit.js.map +1 -1
  143. package/build-module/image/image.js +28 -14
  144. package/build-module/image/image.js.map +1 -1
  145. package/build-module/image/index.js +4 -0
  146. package/build-module/image/index.js.map +1 -1
  147. package/build-module/image/transforms.js +1 -1
  148. package/build-module/image/transforms.js.map +1 -1
  149. package/build-module/list-item/edit.js +1 -1
  150. package/build-module/list-item/edit.js.map +1 -1
  151. package/build-module/list-item/hooks/use-merge.js +8 -1
  152. package/build-module/list-item/hooks/use-merge.js.map +1 -1
  153. package/build-module/list-item/index.js +11 -1
  154. package/build-module/list-item/index.js.map +1 -1
  155. package/build-module/lock-unlock.js +1 -1
  156. package/build-module/lock-unlock.js.map +1 -1
  157. package/build-module/loginout/index.js +3 -0
  158. package/build-module/loginout/index.js.map +1 -1
  159. package/build-module/media-text/edit.js +3 -2
  160. package/build-module/media-text/edit.js.map +1 -1
  161. package/build-module/navigation-submenu/edit.js +1 -1
  162. package/build-module/navigation-submenu/edit.js.map +1 -1
  163. package/build-module/page-list/convert-to-links-modal.js +1 -1
  164. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  165. package/build-module/page-list/edit.js +1 -1
  166. package/build-module/page-list/edit.js.map +1 -1
  167. package/build-module/post-content/index.js +3 -0
  168. package/build-module/post-content/index.js.map +1 -1
  169. package/build-module/post-date/edit.js +4 -2
  170. package/build-module/post-date/edit.js.map +1 -1
  171. package/build-module/post-excerpt/index.js +3 -0
  172. package/build-module/post-excerpt/index.js.map +1 -1
  173. package/build-module/post-title/index.js +3 -0
  174. package/build-module/post-title/index.js.map +1 -1
  175. package/build-module/query/edit/inspector-controls/index.js +3 -2
  176. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  177. package/build-module/query/edit/query-toolbar.js +55 -62
  178. package/build-module/query/edit/query-toolbar.js.map +1 -1
  179. package/build-module/query/index.js +34 -0
  180. package/build-module/query/index.js.map +1 -1
  181. package/build-module/quote/edit.js +1 -0
  182. package/build-module/quote/edit.js.map +1 -1
  183. package/build-module/site-tagline/index.js +1 -0
  184. package/build-module/site-tagline/index.js.map +1 -1
  185. package/build-module/site-title/index.js +1 -0
  186. package/build-module/site-title/index.js.map +1 -1
  187. package/build-module/social-link/edit.js +9 -3
  188. package/build-module/social-link/edit.js.map +1 -1
  189. package/build-module/table/edit.js +9 -18
  190. package/build-module/table/edit.js.map +1 -1
  191. package/build-module/table-of-contents/index.js +1 -1
  192. package/build-module/template-part/edit/title-modal.js +1 -1
  193. package/build-module/template-part/edit/title-modal.js.map +1 -1
  194. package/build-module/utils/caption.js +2 -1
  195. package/build-module/utils/caption.js.map +1 -1
  196. package/build-module/utils/hooks.js +11 -0
  197. package/build-module/utils/hooks.js.map +1 -1
  198. package/build-module/verse/index.js +1 -0
  199. package/build-module/verse/index.js.map +1 -1
  200. package/build-module/video/deprecated.js +4 -0
  201. package/build-module/video/deprecated.js.map +1 -1
  202. package/build-module/video/edit.js +18 -8
  203. package/build-module/video/edit.js.map +1 -1
  204. package/build-module/video/index.js +4 -0
  205. package/build-module/video/index.js.map +1 -1
  206. package/build-module/video/transforms.js +1 -1
  207. package/build-module/video/transforms.js.map +1 -1
  208. package/build-style/audio/style-rtl.css +1 -1
  209. package/build-style/audio/style.css +1 -1
  210. package/build-style/audio/theme-rtl.css +2 -2
  211. package/build-style/audio/theme.css +2 -2
  212. package/build-style/common-rtl.css +1 -3
  213. package/build-style/common.css +1 -3
  214. package/build-style/editor-rtl.css +3 -12
  215. package/build-style/editor.css +3 -12
  216. package/build-style/embed/style-rtl.css +1 -1
  217. package/build-style/embed/style.css +1 -1
  218. package/build-style/embed/theme-rtl.css +2 -2
  219. package/build-style/embed/theme.css +2 -2
  220. package/build-style/image/editor-rtl.css +0 -12
  221. package/build-style/image/editor.css +0 -12
  222. package/build-style/image/style-rtl.css +7 -1
  223. package/build-style/image/style.css +7 -1
  224. package/build-style/media-text/style-rtl.css +4 -0
  225. package/build-style/media-text/style.css +4 -0
  226. package/build-style/navigation/style-rtl.css +1 -0
  227. package/build-style/navigation/style.css +1 -0
  228. package/build-style/post-comments-form/style-rtl.css +11 -10
  229. package/build-style/post-comments-form/style.css +11 -10
  230. package/build-style/query/editor-rtl.css +3 -0
  231. package/build-style/query/editor.css +3 -0
  232. package/build-style/reset-rtl.css +1 -5
  233. package/build-style/reset.css +1 -5
  234. package/build-style/search/style-rtl.css +1 -2
  235. package/build-style/search/style.css +1 -2
  236. package/build-style/social-links/style-rtl.css +91 -91
  237. package/build-style/social-links/style.css +91 -91
  238. package/build-style/style-rtl.css +119 -110
  239. package/build-style/style.css +119 -110
  240. package/build-style/table/theme-rtl.css +2 -2
  241. package/build-style/table/theme.css +2 -2
  242. package/build-style/theme-rtl.css +8 -8
  243. package/build-style/theme.css +8 -8
  244. package/build-style/video/style-rtl.css +1 -1
  245. package/build-style/video/style.css +1 -1
  246. package/build-style/video/theme-rtl.css +2 -2
  247. package/build-style/video/theme.css +2 -2
  248. package/package.json +35 -35
  249. package/src/audio/block.json +4 -0
  250. package/src/audio/edit.js +19 -7
  251. package/src/audio/style.scss +1 -1
  252. package/src/audio/theme.scss +1 -1
  253. package/src/audio/transforms.js +1 -1
  254. package/src/block/block.json +5 -1
  255. package/src/block/edit.js +0 -1
  256. package/src/button/block.json +1 -0
  257. package/src/button/index.php +14 -1
  258. package/src/embed/embed-preview.js +4 -6
  259. package/src/embed/style.scss +1 -1
  260. package/src/embed/theme.scss +1 -1
  261. package/src/file/block.json +4 -0
  262. package/src/file/edit.js +19 -6
  263. package/src/file/transforms.js +1 -2
  264. package/src/gallery/deprecated.js +6 -55
  265. package/src/gallery/edit.js +13 -10
  266. package/src/gallery/gallery-styles.native.scss +0 -2
  267. package/src/gallery/index.js +1 -1
  268. package/src/gallery/save.js +0 -10
  269. package/src/gallery/shared.js +0 -28
  270. package/src/gallery/transforms.js +56 -99
  271. package/src/group/block.json +1 -0
  272. package/src/group/placeholder.js +7 -0
  273. package/src/image/block.json +4 -0
  274. package/src/image/edit.js +10 -19
  275. package/src/image/editor.scss +0 -13
  276. package/src/image/image.js +45 -16
  277. package/src/image/index.php +26 -5
  278. package/src/image/style.scss +11 -1
  279. package/src/image/transforms.js +1 -1
  280. package/src/list-item/block.json +11 -1
  281. package/src/list-item/edit.js +1 -1
  282. package/src/list-item/hooks/use-merge.js +19 -5
  283. package/src/lock-unlock.js +1 -1
  284. package/src/loginout/block.json +3 -0
  285. package/src/media-text/edit.js +3 -2
  286. package/src/media-text/index.php +68 -18
  287. package/src/media-text/style.scss +4 -0
  288. package/src/navigation/index.php +5 -3
  289. package/src/navigation/style.scss +1 -0
  290. package/src/navigation-submenu/edit.js +1 -1
  291. package/src/page-list/convert-to-links-modal.js +1 -1
  292. package/src/page-list/edit.js +1 -1
  293. package/src/paragraph/test/__snapshots__/edit.native.js.snap +30 -0
  294. package/src/paragraph/test/edit.native.js +99 -0
  295. package/src/post-comments-form/style.scss +15 -12
  296. package/src/post-content/block.json +3 -0
  297. package/src/post-date/edit.js +5 -1
  298. package/src/post-date/index.php +9 -3
  299. package/src/post-excerpt/block.json +3 -0
  300. package/src/post-title/block.json +3 -0
  301. package/src/query/edit/inspector-controls/index.js +3 -2
  302. package/src/query/edit/query-toolbar.js +60 -72
  303. package/src/query/editor.scss +4 -0
  304. package/src/query/index.js +40 -0
  305. package/src/quote/edit.js +1 -0
  306. package/src/reset.scss +11 -12
  307. package/src/site-tagline/block.json +1 -0
  308. package/src/site-title/block.json +1 -0
  309. package/src/social-link/edit.js +9 -3
  310. package/src/social-links/style.scss +2 -2
  311. package/src/table/edit.js +11 -24
  312. package/src/table/theme.scss +1 -1
  313. package/src/table-of-contents/block.json +1 -1
  314. package/src/template-part/edit/title-modal.js +1 -1
  315. package/src/template-part/index.php +1 -1
  316. package/src/utils/caption.js +5 -1
  317. package/src/utils/hooks.js +14 -1
  318. package/src/verse/block.json +1 -0
  319. package/src/video/block.json +4 -0
  320. package/src/video/edit.js +23 -8
  321. package/src/video/style.scss +1 -1
  322. package/src/video/theme.scss +1 -1
  323. package/src/video/transforms.js +1 -1
  324. package/tsconfig.tsbuildinfo +1 -1
  325. package/build/gallery/edit-wrapper.js +0 -37
  326. package/build/gallery/edit-wrapper.js.map +0 -1
  327. package/build/gallery/v1/constants.js +0 -10
  328. package/build/gallery/v1/constants.js.map +0 -1
  329. package/build/gallery/v1/edit.js +0 -399
  330. package/build/gallery/v1/edit.js.map +0 -1
  331. package/build/gallery/v1/gallery-button.native.js +0 -55
  332. package/build/gallery/v1/gallery-button.native.js.map +0 -1
  333. package/build/gallery/v1/gallery-image.js +0 -285
  334. package/build/gallery/v1/gallery-image.js.map +0 -1
  335. package/build/gallery/v1/gallery-image.native.js +0 -297
  336. package/build/gallery/v1/gallery-image.native.js.map +0 -1
  337. package/build/gallery/v1/gallery.js +0 -112
  338. package/build/gallery/v1/gallery.js.map +0 -1
  339. package/build/gallery/v1/gallery.native.js +0 -139
  340. package/build/gallery/v1/gallery.native.js.map +0 -1
  341. package/build/gallery/v1/save.js +0 -81
  342. package/build/gallery/v1/save.js.map +0 -1
  343. package/build/gallery/v1/shared.js +0 -17
  344. package/build/gallery/v1/shared.js.map +0 -1
  345. package/build/gallery/v1/tiles.native.js +0 -83
  346. package/build/gallery/v1/tiles.native.js.map +0 -1
  347. package/build/utils/constants.js +0 -15
  348. package/build/utils/constants.js.map +0 -1
  349. package/build-module/gallery/edit-wrapper.js +0 -31
  350. package/build-module/gallery/edit-wrapper.js.map +0 -1
  351. package/build-module/gallery/v1/constants.js +0 -4
  352. package/build-module/gallery/v1/constants.js.map +0 -1
  353. package/build-module/gallery/v1/edit.js +0 -393
  354. package/build-module/gallery/v1/edit.js.map +0 -1
  355. package/build-module/gallery/v1/gallery-button.native.js +0 -46
  356. package/build-module/gallery/v1/gallery-button.native.js.map +0 -1
  357. package/build-module/gallery/v1/gallery-image.js +0 -279
  358. package/build-module/gallery/v1/gallery-image.js.map +0 -1
  359. package/build-module/gallery/v1/gallery-image.native.js +0 -291
  360. package/build-module/gallery/v1/gallery-image.native.js.map +0 -1
  361. package/build-module/gallery/v1/gallery.js +0 -104
  362. package/build-module/gallery/v1/gallery.js.map +0 -1
  363. package/build-module/gallery/v1/gallery.native.js +0 -131
  364. package/build-module/gallery/v1/gallery.native.js.map +0 -1
  365. package/build-module/gallery/v1/save.js +0 -74
  366. package/build-module/gallery/v1/save.js.map +0 -1
  367. package/build-module/gallery/v1/shared.js +0 -10
  368. package/build-module/gallery/v1/shared.js.map +0 -1
  369. package/build-module/gallery/v1/tiles.native.js +0 -75
  370. package/build-module/gallery/v1/tiles.native.js.map +0 -1
  371. package/build-module/utils/constants.js +0 -9
  372. package/build-module/utils/constants.js.map +0 -1
  373. package/src/gallery/edit-wrapper.js +0 -27
  374. package/src/gallery/v1/constants.js +0 -3
  375. package/src/gallery/v1/edit.js +0 -450
  376. package/src/gallery/v1/gallery-button.native.js +0 -47
  377. package/src/gallery/v1/gallery-image-style.native.scss +0 -109
  378. package/src/gallery/v1/gallery-image.js +0 -293
  379. package/src/gallery/v1/gallery-image.native.js +0 -348
  380. package/src/gallery/v1/gallery-styles.native.scss +0 -8
  381. package/src/gallery/v1/gallery.js +0 -125
  382. package/src/gallery/v1/gallery.native.js +0 -162
  383. package/src/gallery/v1/save.js +0 -98
  384. package/src/gallery/v1/shared.js +0 -19
  385. package/src/gallery/v1/tiles-styles.native.scss +0 -11
  386. package/src/gallery/v1/tiles.native.js +0 -79
  387. package/src/utils/constants.js +0 -8
@@ -5,10 +5,8 @@ import {
5
5
  ToolbarGroup,
6
6
  Dropdown,
7
7
  ToolbarButton,
8
- BaseControl,
9
8
  __experimentalNumberControl as NumberControl,
10
9
  } from '@wordpress/components';
11
- import { useInstanceId } from '@wordpress/compose';
12
10
  import { __ } from '@wordpress/i18n';
13
11
  import { settings } from '@wordpress/icons';
14
12
 
@@ -25,10 +23,6 @@ export default function QueryToolbar( {
25
23
  clientId,
26
24
  } ) {
27
25
  const hasPatterns = !! usePatterns( clientId, name ).length;
28
- const maxPageInputId = useInstanceId(
29
- QueryToolbar,
30
- 'blocks-query-pagination-max-page-input'
31
- );
32
26
 
33
27
  return (
34
28
  <>
@@ -45,75 +39,69 @@ export default function QueryToolbar( {
45
39
  ) }
46
40
  renderContent={ () => (
47
41
  <>
48
- <BaseControl>
49
- <NumberControl
50
- __unstableInputWidth="60px"
51
- label={ __( 'Items per Page' ) }
52
- labelPosition="edge"
53
- min={ 1 }
54
- max={ 100 }
55
- onChange={ ( value ) => {
56
- if (
57
- isNaN( value ) ||
58
- value < 1 ||
59
- value > 100
60
- ) {
61
- return;
62
- }
63
- setQuery( {
64
- perPage: value,
65
- } );
66
- } }
67
- step="1"
68
- value={ query.perPage }
69
- isDragEnabled={ false }
70
- />
71
- </BaseControl>
72
- <BaseControl>
73
- <NumberControl
74
- __unstableInputWidth="60px"
75
- label={ __( 'Offset' ) }
76
- labelPosition="edge"
77
- min={ 0 }
78
- max={ 100 }
79
- onChange={ ( value ) => {
80
- if (
81
- isNaN( value ) ||
82
- value < 0 ||
83
- value > 100
84
- ) {
85
- return;
86
- }
87
- setQuery( { offset: value } );
88
- } }
89
- step="1"
90
- value={ query.offset }
91
- isDragEnabled={ false }
92
- />
93
- </BaseControl>
94
- <BaseControl
95
- id={ maxPageInputId }
42
+ <NumberControl
43
+ __unstableInputWidth="60px"
44
+ className="block-library-query-toolbar__popover-number-control"
45
+ label={ __( 'Items per Page' ) }
46
+ labelPosition="edge"
47
+ min={ 1 }
48
+ max={ 100 }
49
+ onChange={ ( value ) => {
50
+ if (
51
+ isNaN( value ) ||
52
+ value < 1 ||
53
+ value > 100
54
+ ) {
55
+ return;
56
+ }
57
+ setQuery( {
58
+ perPage: value,
59
+ } );
60
+ } }
61
+ step="1"
62
+ value={ query.perPage }
63
+ isDragEnabled={ false }
64
+ />
65
+ <NumberControl
66
+ __unstableInputWidth="60px"
67
+ className="block-library-query-toolbar__popover-number-control"
68
+ label={ __( 'Offset' ) }
69
+ labelPosition="edge"
70
+ min={ 0 }
71
+ max={ 100 }
72
+ onChange={ ( value ) => {
73
+ if (
74
+ isNaN( value ) ||
75
+ value < 0 ||
76
+ value > 100
77
+ ) {
78
+ return;
79
+ }
80
+ setQuery( { offset: value } );
81
+ } }
82
+ step="1"
83
+ value={ query.offset }
84
+ isDragEnabled={ false }
85
+ />
86
+ <NumberControl
87
+ __unstableInputWidth="60px"
88
+ className="block-library-query-toolbar__popover-number-control"
89
+ label={ __( 'Max pages to show' ) }
90
+ labelPosition="edge"
91
+ min={ 0 }
92
+ onChange={ ( value ) => {
93
+ if ( isNaN( value ) || value < 0 ) {
94
+ return;
95
+ }
96
+ setQuery( { pages: value } );
97
+ } }
98
+ step="1"
99
+ value={ query.pages }
100
+ isDragEnabled={ false }
96
101
  help={ __(
97
102
  'Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).'
98
103
  ) }
99
- >
100
- <NumberControl
101
- id={ maxPageInputId }
102
- __unstableInputWidth="60px"
103
- label={ __( 'Max page to show' ) }
104
- labelPosition="edge"
105
- min={ 0 }
106
- onChange={ ( value ) => {
107
- if ( isNaN( value ) || value < 0 ) {
108
- return;
109
- }
110
- setQuery( { pages: value } );
111
- } }
112
- step="1"
113
- value={ query.pages }
114
- isDragEnabled={ false }
115
- />
116
- </BaseControl>
104
+ />
117
105
  </>
118
106
  ) }
119
107
  />
@@ -1,5 +1,9 @@
1
1
  .block-library-query-toolbar__popover .components-popover__content {
2
2
  min-width: 230px;
3
+
4
+ .block-library-query-toolbar__popover-number-control {
5
+ margin-bottom: $grid-unit-10;
6
+ }
3
7
  }
4
8
 
5
9
  .wp-block-query__create-new-link {
@@ -19,6 +19,46 @@ export { metadata, name };
19
19
  export const settings = {
20
20
  icon,
21
21
  edit,
22
+ example: {
23
+ viewportWidth: 650,
24
+ attributes: {
25
+ namespace: 'core/posts-list',
26
+ query: {
27
+ perPage: 4,
28
+ pages: 1,
29
+ offset: 0,
30
+ postType: 'post',
31
+ order: 'desc',
32
+ orderBy: 'date',
33
+ author: '',
34
+ search: '',
35
+ sticky: 'exclude',
36
+ inherit: false,
37
+ },
38
+ },
39
+ innerBlocks: [
40
+ {
41
+ name: 'core/post-template',
42
+ attributes: {
43
+ layout: {
44
+ type: 'grid',
45
+ columnCount: 2,
46
+ },
47
+ },
48
+ innerBlocks: [
49
+ {
50
+ name: 'core/post-title',
51
+ },
52
+ {
53
+ name: 'core/post-date',
54
+ },
55
+ {
56
+ name: 'core/post-excerpt',
57
+ },
58
+ ],
59
+ },
60
+ ],
61
+ },
22
62
  save,
23
63
  variations,
24
64
  deprecated,
package/src/quote/edit.js CHANGED
@@ -121,6 +121,7 @@ export default function QuoteEdit( {
121
121
  }
122
122
  addLabel={ __( 'Add citation' ) }
123
123
  removeLabel={ __( 'Remove citation' ) }
124
+ excludeElementClassName
124
125
  className="wp-block-quote__citation"
125
126
  insertBlocksAfter={ insertBlocksAfter }
126
127
  { ...( ! isWebPlatform ? { textAlign } : {} ) }
package/src/reset.scss CHANGED
@@ -8,19 +8,18 @@
8
8
  // We use :where to keep specificity minimal.
9
9
  // https://css-tricks.com/almanac/selectors/w/where/
10
10
  :where(.editor-styles-wrapper) {
11
- /**
12
- * The following styles revert to the browser defaults overriding the WPAdmin styles.
13
- * This is only needed while the block editor is not being loaded in an iframe.
14
- */
15
- font-family: serif; // unfortunately initial doesn't work for font-family.
16
- font-size: initial;
17
- line-height: initial;
18
- color: initial;
11
+ // The following styles revert to the browser defaults overriding the WPAdmin styles.
12
+ html & {
13
+ font-family: serif; // unfortunately initial doesn't work for font-family.
14
+ font-size: initial;
15
+ line-height: initial;
16
+ color: initial;
19
17
 
20
- // Many themes with white backgrounds load editor styles but fail to also provide
21
- // an explicit white background color, assuming a white editing canvas.
22
- // So to match browser defaults, we provide a white default here as well.
23
- background: #fff;
18
+ // Many themes with white backgrounds load editor styles but fail to also provide
19
+ // an explicit white background color, assuming a white editing canvas.
20
+ // So to match browser defaults, we provide a white default here as well.
21
+ background: #fff;
22
+ }
24
23
 
25
24
  .wp-align-wrapper {
26
25
  max-width: $content-width;
@@ -44,6 +44,7 @@
44
44
  "__experimentalFontStyle": true,
45
45
  "__experimentalFontWeight": true,
46
46
  "__experimentalLetterSpacing": true,
47
+ "__experimentalWritingMode": true,
47
48
  "__experimentalDefaultControls": {
48
49
  "fontSize": true
49
50
  }
@@ -55,6 +55,7 @@
55
55
  "__experimentalFontStyle": true,
56
56
  "__experimentalFontWeight": true,
57
57
  "__experimentalLetterSpacing": true,
58
+ "__experimentalWritingMode": true,
58
59
  "__experimentalDefaultControls": {
59
60
  "fontSize": true
60
61
  }
@@ -42,13 +42,18 @@ const SocialLinkURLPopover = ( {
42
42
  return (
43
43
  <URLPopover
44
44
  anchor={ popoverAnchor }
45
- onClose={ () => setPopover( false ) }
45
+ aria-label={ __( 'Edit social link' ) }
46
+ onClose={ () => {
47
+ setPopover( false );
48
+ popoverAnchor?.focus();
49
+ } }
46
50
  >
47
51
  <form
48
52
  className="block-editor-url-popover__link-editor"
49
53
  onSubmit={ ( event ) => {
50
54
  event.preventDefault();
51
55
  setPopover( false );
56
+ popoverAnchor?.focus();
52
57
  } }
53
58
  >
54
59
  <div className="block-editor-url-input">
@@ -136,9 +141,9 @@ const SocialLinkEdit = ( {
136
141
  <PanelRow>
137
142
  <TextControl
138
143
  __nextHasNoMarginBottom
139
- label={ __( 'Link text' ) }
144
+ label={ __( 'Text' ) }
140
145
  help={ __(
141
- 'The link text is visible when enabled from the parent Social Icons block.'
146
+ 'The text is visible when enabled from the parent Social Icons block.'
142
147
  ) }
143
148
  value={ label }
144
149
  onChange={ ( value ) =>
@@ -162,6 +167,7 @@ const SocialLinkEdit = ( {
162
167
  className="wp-block-social-link-anchor"
163
168
  ref={ setPopoverAnchor }
164
169
  onClick={ () => setPopover( true ) }
170
+ aria-haspopup="dialog"
165
171
  >
166
172
  <IconComponent />
167
173
  <span
@@ -107,7 +107,7 @@
107
107
  }
108
108
 
109
109
  // Provide colors for a range of icons.
110
- .wp-block-social-links:not(.is-style-logos-only) {
110
+ :where(.wp-block-social-links:not(.is-style-logos-only)) {
111
111
  // Generic items such as mail, feed, etc.
112
112
  @import "../social-link/socials-with-bg.scss";
113
113
  }
@@ -116,7 +116,7 @@
116
116
  // The specificity for this selector has not been reduced to 0-1-0 as per
117
117
  // global styles variation selectors as the lack of background should be
118
118
  // enforced for this block style.
119
- .wp-block-social-links.is-style-logos-only {
119
+ :where(.wp-block-social-links.is-style-logos-only) {
120
120
  .wp-social-link {
121
121
  background: none;
122
122
 
package/src/table/edit.js CHANGED
@@ -16,7 +16,6 @@ import {
16
16
  useBlockProps,
17
17
  __experimentalUseColorProps as useColorProps,
18
18
  __experimentalUseBorderProps as useBorderProps,
19
- __experimentalGetElementClassName,
20
19
  } from '@wordpress/block-editor';
21
20
  import { __ } from '@wordpress/i18n';
22
21
  import {
@@ -41,7 +40,6 @@ import {
41
40
  tableRowDelete,
42
41
  table,
43
42
  } from '@wordpress/icons';
44
- import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
45
43
 
46
44
  /**
47
45
  * Internal dependencies
@@ -57,6 +55,7 @@ import {
57
55
  toggleSection,
58
56
  isEmptyTableSection,
59
57
  } from './state';
58
+ import { Caption } from '../utils/caption';
60
59
 
61
60
  const ALIGNMENT_CONTROLS = [
62
61
  {
@@ -98,7 +97,7 @@ function TableEdit( {
98
97
  insertBlocksAfter,
99
98
  isSelected,
100
99
  } ) {
101
- const { hasFixedLayout, caption, head, foot } = attributes;
100
+ const { hasFixedLayout, head, foot } = attributes;
102
101
  const [ initialRowCount, setInitialRowCount ] = useState( 2 );
103
102
  const [ initialColumnCount, setInitialColumnCount ] = useState( 2 );
104
103
  const [ selectedCell, setSelectedCell ] = useState();
@@ -523,27 +522,7 @@ function TableEdit( {
523
522
  { renderedSections }
524
523
  </table>
525
524
  ) }
526
- { ! isEmpty && (
527
- <RichText
528
- identifier="caption"
529
- tagName="figcaption"
530
- className={ __experimentalGetElementClassName( 'caption' ) }
531
- aria-label={ __( 'Table caption text' ) }
532
- placeholder={ __( 'Add caption' ) }
533
- value={ caption }
534
- onChange={ ( value ) =>
535
- setAttributes( { caption: value } )
536
- }
537
- // Deselect the selected table cell when the caption is focused.
538
- onFocus={ () => setSelectedCell() }
539
- __unstableOnSplitAtEnd={ () =>
540
- insertBlocksAfter(
541
- createBlock( getDefaultBlockName() )
542
- )
543
- }
544
- />
545
- ) }
546
- { isEmpty && (
525
+ { isEmpty ? (
547
526
  <Placeholder
548
527
  label={ __( 'Table' ) }
549
528
  icon={ <BlockIcon icon={ icon } showColors /> }
@@ -582,6 +561,14 @@ function TableEdit( {
582
561
  </Button>
583
562
  </form>
584
563
  </Placeholder>
564
+ ) : (
565
+ <Caption
566
+ attributes={ attributes }
567
+ setAttributes={ setAttributes }
568
+ isSelected={ isSelected }
569
+ insertBlocksAfter={ insertBlocksAfter }
570
+ label={ __( 'Table caption text' ) }
571
+ />
585
572
  ) }
586
573
  </figure>
587
574
  );
@@ -6,7 +6,7 @@
6
6
  word-break: normal;
7
7
  }
8
8
 
9
- figcaption {
9
+ :where(figcaption) {
10
10
  @include caption-style-theme();
11
11
  }
12
12
  }
@@ -4,7 +4,7 @@
4
4
  "__experimental": true,
5
5
  "name": "core/table-of-contents",
6
6
  "title": "Table of Contents",
7
- "category": "layout",
7
+ "category": "design",
8
8
  "description": "Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.",
9
9
  "keywords": [ "document outline", "summary" ],
10
10
  "textdomain": "default",
@@ -43,7 +43,7 @@ export default function TitleModal( { areaLabel, onClose, onSubmit } ) {
43
43
  <Button
44
44
  variant="primary"
45
45
  type="submit"
46
- __experimentalIsFocusable
46
+ accessibleWhenDisabled
47
47
  disabled={ ! title.length }
48
48
  >
49
49
  { __( 'Create' ) }
@@ -161,7 +161,7 @@ function render_block_core_template_part( $attributes ) {
161
161
  global $wp_embed;
162
162
  $content = $wp_embed->autoembed( $content );
163
163
 
164
- if ( empty( $attributes['tagName'] ) ) {
164
+ if ( empty( $attributes['tagName'] ) || tag_escape( $attributes['tagName'] ) !== $attributes['tagName'] ) {
165
165
  $area_tag = 'div';
166
166
  if ( $area_definition && isset( $area_definition['area_tag'] ) ) {
167
167
  $area_tag = $area_definition['area_tag'];
@@ -32,6 +32,7 @@ export function Caption( {
32
32
  placeholder = __( 'Add caption' ),
33
33
  label = __( 'Caption text' ),
34
34
  showToolbarButton = true,
35
+ excludeElementClassName,
35
36
  className,
36
37
  readOnly,
37
38
  tagName = 'figcaption',
@@ -70,6 +71,7 @@ export function Caption( {
70
71
  },
71
72
  [ isCaptionEmpty ]
72
73
  );
74
+
73
75
  return (
74
76
  <>
75
77
  { showToolbarButton && (
@@ -96,7 +98,9 @@ export function Caption( {
96
98
  tagName={ tagName }
97
99
  className={ clsx(
98
100
  className,
99
- __experimentalGetElementClassName( 'caption' )
101
+ excludeElementClassName
102
+ ? ''
103
+ : __experimentalGetElementClassName( 'caption' )
100
104
  ) }
101
105
  ref={ ref }
102
106
  aria-label={ label }
@@ -6,6 +6,7 @@ import { useLayoutEffect, useEffect, useRef } from '@wordpress/element';
6
6
  import { getBlobByURL, isBlobURL, revokeBlobURL } from '@wordpress/blob';
7
7
  import { store as blockEditorStore } from '@wordpress/block-editor';
8
8
  import { store as coreStore } from '@wordpress/core-data';
9
+ import { useViewportMatch } from '@wordpress/compose';
9
10
 
10
11
  /**
11
12
  * Returns whether the current user can edit the given entity.
@@ -46,7 +47,6 @@ export function useUploadMediaFromBlobURL( args = {} ) {
46
47
  if ( hasUploadStarted.current ) {
47
48
  return;
48
49
  }
49
-
50
50
  if (
51
51
  ! latestArgs.current.url ||
52
52
  ! isBlobURL( latestArgs.current.url )
@@ -84,3 +84,16 @@ export function useUploadMediaFromBlobURL( args = {} ) {
84
84
  } );
85
85
  }, [ getSettings ] );
86
86
  }
87
+
88
+ export function useToolsPanelDropdownMenuProps() {
89
+ const isMobile = useViewportMatch( 'medium', '<' );
90
+ return ! isMobile
91
+ ? {
92
+ popoverProps: {
93
+ placement: 'left-start',
94
+ // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)
95
+ offset: 259,
96
+ },
97
+ }
98
+ : {};
99
+ }
@@ -51,6 +51,7 @@
51
51
  "__experimentalLetterSpacing": true,
52
52
  "__experimentalTextTransform": true,
53
53
  "__experimentalTextDecoration": true,
54
+ "__experimentalWritingMode": true,
54
55
  "__experimentalDefaultControls": {
55
56
  "fontSize": true
56
57
  }
@@ -56,6 +56,10 @@
56
56
  "attribute": "preload",
57
57
  "default": "metadata"
58
58
  },
59
+ "blob": {
60
+ "type": "string",
61
+ "__experimentalRole": "local"
62
+ },
59
63
  "src": {
60
64
  "type": "string",
61
65
  "source": "attribute",
package/src/video/edit.js CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  MediaReplaceFlow,
26
26
  useBlockProps,
27
27
  } from '@wordpress/block-editor';
28
- import { useRef, useEffect } from '@wordpress/element';
28
+ import { useRef, useEffect, useState } from '@wordpress/element';
29
29
  import { __, sprintf } from '@wordpress/i18n';
30
30
  import { useInstanceId } from '@wordpress/compose';
31
31
  import { useDispatch } from '@wordpress/data';
@@ -74,10 +74,10 @@ function VideoEdit( {
74
74
  const videoPlayer = useRef();
75
75
  const posterImageButton = useRef();
76
76
  const { id, controls, poster, src, tracks } = attributes;
77
- const isTemporaryVideo = ! id && isBlobURL( src );
77
+ const [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );
78
78
 
79
79
  useUploadMediaFromBlobURL( {
80
- url: src,
80
+ url: temporaryURL,
81
81
  allowedTypes: ALLOWED_MEDIA_TYPES,
82
82
  onChange: onSelectVideo,
83
83
  onError: onUploadError,
@@ -100,19 +100,28 @@ function VideoEdit( {
100
100
  id: undefined,
101
101
  poster: undefined,
102
102
  caption: undefined,
103
+ blob: undefined,
103
104
  } );
105
+ setTemporaryURL();
106
+ return;
107
+ }
108
+
109
+ if ( isBlobURL( media.url ) ) {
110
+ setTemporaryURL( media.url );
104
111
  return;
105
112
  }
106
113
 
107
114
  // Sets the block's attribute and updates the edit component from the
108
115
  // selected media.
109
116
  setAttributes( {
117
+ blob: undefined,
110
118
  src: media.url,
111
119
  id: media.id,
112
120
  poster:
113
121
  media.image?.src !== media.icon ? media.image?.src : undefined,
114
122
  caption: media.caption,
115
123
  } );
124
+ setTemporaryURL();
116
125
  }
117
126
 
118
127
  function onSelectURL( newSrc ) {
@@ -125,7 +134,13 @@ function VideoEdit( {
125
134
  onReplace( embedBlock );
126
135
  return;
127
136
  }
128
- setAttributes( { src: newSrc, id: undefined, poster: undefined } );
137
+ setAttributes( {
138
+ blob: undefined,
139
+ src: newSrc,
140
+ id: undefined,
141
+ poster: undefined,
142
+ } );
143
+ setTemporaryURL();
129
144
  }
130
145
  }
131
146
 
@@ -135,14 +150,14 @@ function VideoEdit( {
135
150
  }
136
151
 
137
152
  const classes = clsx( className, {
138
- 'is-transient': isTemporaryVideo,
153
+ 'is-transient': !! temporaryURL,
139
154
  } );
140
155
 
141
156
  const blockProps = useBlockProps( {
142
157
  className: classes,
143
158
  } );
144
159
 
145
- if ( ! src ) {
160
+ if ( ! src && ! temporaryURL ) {
146
161
  return (
147
162
  <div { ...blockProps }>
148
163
  <MediaPlaceholder
@@ -264,13 +279,13 @@ function VideoEdit( {
264
279
  <video
265
280
  controls={ controls }
266
281
  poster={ poster }
267
- src={ src }
282
+ src={ src || temporaryURL }
268
283
  ref={ videoPlayer }
269
284
  >
270
285
  <Tracks tracks={ tracks } />
271
286
  </video>
272
287
  </Disabled>
273
- { isTemporaryVideo && <Spinner /> }
288
+ { !! temporaryURL && <Spinner /> }
274
289
  <Caption
275
290
  attributes={ attributes }
276
291
  setAttributes={ setAttributes }
@@ -19,7 +19,7 @@
19
19
  // Supply caption styles to videos, even if the theme hasn't opted in.
20
20
  // Reason being: the new markup, <figcaptions>, are not likely to be styled in the majority of existing themes,
21
21
  // so we supply the styles so as to not appear broken or unstyled in those themes.
22
- figcaption {
22
+ :where(figcaption) {
23
23
  @include caption-style();
24
24
  }
25
25
  }
@@ -1,4 +1,4 @@
1
- .wp-block-video figcaption {
1
+ .wp-block-video :where(figcaption) {
2
2
  @include caption-style-theme();
3
3
  }
4
4
 
@@ -20,7 +20,7 @@ const transforms = {
20
20
  // It's already done as part of the `componentDidMount`
21
21
  // in the video block
22
22
  const block = createBlock( 'core/video', {
23
- src: createBlobURL( file ),
23
+ blob: createBlobURL( file ),
24
24
  } );
25
25
  return block;
26
26
  },