@wordpress/block-library 8.6.0 → 8.8.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 (425) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/buttons/index.js +1 -0
  3. package/build/buttons/index.js.map +1 -1
  4. package/build/buttons/transforms.js +1 -0
  5. package/build/buttons/transforms.js.map +1 -1
  6. package/build/column/index.js +2 -1
  7. package/build/column/index.js.map +1 -1
  8. package/build/columns/edit.js +28 -8
  9. package/build/columns/edit.js.map +1 -1
  10. package/build/columns/index.js +6 -1
  11. package/build/columns/index.js.map +1 -1
  12. package/build/columns/utils.js +4 -9
  13. package/build/columns/utils.js.map +1 -1
  14. package/build/cover/edit/index.js +46 -50
  15. package/build/cover/edit/index.js.map +1 -1
  16. package/build/cover/edit/inspector-controls.js +2 -2
  17. package/build/cover/edit/inspector-controls.js.map +1 -1
  18. package/build/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +32 -6
  19. package/build/cover/edit/resizable-cover-popover.js.map +1 -0
  20. package/build/cover/index.js +12 -0
  21. package/build/cover/index.js.map +1 -1
  22. package/build/details/edit.js +67 -0
  23. package/build/details/edit.js.map +1 -0
  24. package/build/details/index.js +110 -0
  25. package/build/details/index.js.map +1 -0
  26. package/build/details/save.js +33 -0
  27. package/build/details/save.js.map +1 -0
  28. package/build/details-content/edit.js +34 -0
  29. package/build/details-content/edit.js.map +1 -0
  30. package/build/details-content/index.js +94 -0
  31. package/build/details-content/index.js.map +1 -0
  32. package/build/details-content/save.js +20 -0
  33. package/build/details-content/save.js.map +1 -0
  34. package/build/details-summary/edit.js +42 -0
  35. package/build/details-summary/edit.js.map +1 -0
  36. package/build/details-summary/index.js +97 -0
  37. package/build/details-summary/index.js.map +1 -0
  38. package/build/details-summary/save.js +24 -0
  39. package/build/details-summary/save.js.map +1 -0
  40. package/build/embed/deprecated.js +4 -1
  41. package/build/embed/deprecated.js.map +1 -1
  42. package/build/embed/embed-link-settings.native.js +1 -1
  43. package/build/embed/embed-link-settings.native.js.map +1 -1
  44. package/build/embed/embed-placeholder.js +1 -1
  45. package/build/embed/embed-placeholder.js.map +1 -1
  46. package/build/embed/index.js +4 -1
  47. package/build/embed/index.js.map +1 -1
  48. package/build/embed/transforms.js +4 -1
  49. package/build/embed/transforms.js.map +1 -1
  50. package/build/embed/util.js +4 -1
  51. package/build/embed/util.js.map +1 -1
  52. package/build/file/edit.native.js +0 -2
  53. package/build/file/edit.native.js.map +1 -1
  54. package/build/gallery/edit.js +8 -5
  55. package/build/gallery/edit.js.map +1 -1
  56. package/build/gallery/use-get-media.native.js +2 -1
  57. package/build/gallery/use-get-media.native.js.map +1 -1
  58. package/build/gallery/use-image-sizes.js +1 -1
  59. package/build/gallery/use-image-sizes.js.map +1 -1
  60. package/build/group/deprecated.js +4 -2
  61. package/build/group/deprecated.js.map +1 -1
  62. package/build/group/edit.js +22 -5
  63. package/build/group/edit.js.map +1 -1
  64. package/build/group/placeholder.js +11 -1
  65. package/build/group/placeholder.js.map +1 -1
  66. package/build/group/variations.js +23 -3
  67. package/build/group/variations.js.map +1 -1
  68. package/build/image/edit.js +1 -1
  69. package/build/image/edit.js.map +1 -1
  70. package/build/image/edit.native.js +1 -1
  71. package/build/image/edit.native.js.map +1 -1
  72. package/build/image/image.js +8 -6
  73. package/build/image/image.js.map +1 -1
  74. package/build/image/index.js +9 -2
  75. package/build/image/index.js.map +1 -1
  76. package/build/index.js +24 -6
  77. package/build/index.js.map +1 -1
  78. package/build/latest-posts/edit.js +1 -0
  79. package/build/latest-posts/edit.js.map +1 -1
  80. package/build/media-text/deprecated.js +228 -18
  81. package/build/media-text/deprecated.js.map +1 -1
  82. package/build/media-text/edit.js +3 -3
  83. package/build/media-text/edit.js.map +1 -1
  84. package/build/media-text/index.js +1 -1
  85. package/build/media-text/media-container.js +2 -6
  86. package/build/media-text/media-container.js.map +1 -1
  87. package/build/media-text/media-container.native.js +3 -3
  88. package/build/media-text/media-container.native.js.map +1 -1
  89. package/build/navigation/deprecated.js +8 -11
  90. package/build/navigation/deprecated.js.map +1 -1
  91. package/build/navigation/edit/index.js +1 -12
  92. package/build/navigation/edit/index.js.map +1 -1
  93. package/build/navigation/edit/inner-blocks.js +1 -4
  94. package/build/navigation/edit/inner-blocks.js.map +1 -1
  95. package/build/navigation/edit/unsaved-inner-blocks.js +1 -14
  96. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  97. package/build/navigation/index.js +0 -1
  98. package/build/navigation/index.js.map +1 -1
  99. package/build/post-author/index.js +0 -1
  100. package/build/post-author/index.js.map +1 -1
  101. package/build/post-date/edit.js +2 -1
  102. package/build/post-date/edit.js.map +1 -1
  103. package/build/post-date/index.js +4 -1
  104. package/build/post-date/index.js.map +1 -1
  105. package/build/post-date/variations.js +28 -0
  106. package/build/post-date/variations.js.map +1 -0
  107. package/build/post-excerpt/edit.js +39 -10
  108. package/build/post-excerpt/edit.js.map +1 -1
  109. package/build/post-featured-image/dimension-controls.js +4 -3
  110. package/build/post-featured-image/dimension-controls.js.map +1 -1
  111. package/build/post-featured-image/edit.js +8 -22
  112. package/build/post-featured-image/edit.js.map +1 -1
  113. package/build/post-template/index.js +1 -1
  114. package/build/post-time-to-read/edit.js +1 -1
  115. package/build/post-time-to-read/edit.js.map +1 -1
  116. package/build/post-time-to-read/index.js +24 -1
  117. package/build/post-time-to-read/index.js.map +1 -1
  118. package/build/quote/index.js +1 -0
  119. package/build/quote/index.js.map +1 -1
  120. package/build/spacer/controls.js +25 -6
  121. package/build/spacer/controls.js.map +1 -1
  122. package/build/spacer/edit.js +27 -7
  123. package/build/spacer/edit.js.map +1 -1
  124. package/build/spacer/save.js +2 -2
  125. package/build/spacer/save.js.map +1 -1
  126. package/build/table/state.js +35 -35
  127. package/build/table/state.js.map +1 -1
  128. package/build/term-description/index.js +1 -2
  129. package/build/term-description/index.js.map +1 -1
  130. package/build/utils/clean-empty-object.js +5 -2
  131. package/build/utils/clean-empty-object.js.map +1 -1
  132. package/build-module/buttons/index.js +1 -0
  133. package/build-module/buttons/index.js.map +1 -1
  134. package/build-module/buttons/transforms.js +1 -0
  135. package/build-module/buttons/transforms.js.map +1 -1
  136. package/build-module/column/index.js +2 -1
  137. package/build-module/column/index.js.map +1 -1
  138. package/build-module/columns/edit.js +28 -8
  139. package/build-module/columns/edit.js.map +1 -1
  140. package/build-module/columns/index.js +6 -1
  141. package/build-module/columns/index.js.map +1 -1
  142. package/build-module/columns/utils.js +4 -8
  143. package/build-module/columns/utils.js.map +1 -1
  144. package/build-module/cover/edit/index.js +48 -52
  145. package/build-module/cover/edit/index.js.map +1 -1
  146. package/build-module/cover/edit/inspector-controls.js +2 -2
  147. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  148. package/build-module/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +31 -6
  149. package/build-module/cover/edit/resizable-cover-popover.js.map +1 -0
  150. package/build-module/cover/index.js +12 -0
  151. package/build-module/cover/index.js.map +1 -1
  152. package/build-module/details/edit.js +52 -0
  153. package/build-module/details/edit.js.map +1 -0
  154. package/build-module/details/index.js +91 -0
  155. package/build-module/details/index.js.map +1 -0
  156. package/build-module/details/save.js +20 -0
  157. package/build-module/details/save.js.map +1 -0
  158. package/build-module/details-content/edit.js +23 -0
  159. package/build-module/details-content/edit.js.map +1 -0
  160. package/build-module/details-content/index.js +76 -0
  161. package/build-module/details-content/index.js.map +1 -0
  162. package/build-module/details-content/save.js +11 -0
  163. package/build-module/details-content/save.js.map +1 -0
  164. package/build-module/details-summary/edit.js +30 -0
  165. package/build-module/details-summary/edit.js.map +1 -0
  166. package/build-module/details-summary/index.js +79 -0
  167. package/build-module/details-summary/index.js.map +1 -0
  168. package/build-module/details-summary/save.js +16 -0
  169. package/build-module/details-summary/save.js.map +1 -0
  170. package/build-module/embed/deprecated.js +4 -1
  171. package/build-module/embed/deprecated.js.map +1 -1
  172. package/build-module/embed/embed-link-settings.native.js +1 -1
  173. package/build-module/embed/embed-link-settings.native.js.map +1 -1
  174. package/build-module/embed/embed-placeholder.js +1 -1
  175. package/build-module/embed/embed-placeholder.js.map +1 -1
  176. package/build-module/embed/index.js +4 -1
  177. package/build-module/embed/index.js.map +1 -1
  178. package/build-module/embed/transforms.js +4 -1
  179. package/build-module/embed/transforms.js.map +1 -1
  180. package/build-module/embed/util.js +4 -1
  181. package/build-module/embed/util.js.map +1 -1
  182. package/build-module/file/edit.native.js +0 -2
  183. package/build-module/file/edit.native.js.map +1 -1
  184. package/build-module/gallery/edit.js +8 -5
  185. package/build-module/gallery/edit.js.map +1 -1
  186. package/build-module/gallery/use-get-media.native.js +2 -1
  187. package/build-module/gallery/use-get-media.native.js.map +1 -1
  188. package/build-module/gallery/use-image-sizes.js +1 -1
  189. package/build-module/gallery/use-image-sizes.js.map +1 -1
  190. package/build-module/group/deprecated.js +4 -2
  191. package/build-module/group/deprecated.js.map +1 -1
  192. package/build-module/group/edit.js +21 -5
  193. package/build-module/group/edit.js.map +1 -1
  194. package/build-module/group/placeholder.js +11 -1
  195. package/build-module/group/placeholder.js.map +1 -1
  196. package/build-module/group/variations.js +24 -1
  197. package/build-module/group/variations.js.map +1 -1
  198. package/build-module/image/edit.js +1 -1
  199. package/build-module/image/edit.js.map +1 -1
  200. package/build-module/image/edit.native.js +1 -1
  201. package/build-module/image/edit.native.js.map +1 -1
  202. package/build-module/image/image.js +8 -6
  203. package/build-module/image/image.js.map +1 -1
  204. package/build-module/image/index.js +9 -2
  205. package/build-module/image/index.js.map +1 -1
  206. package/build-module/index.js +21 -6
  207. package/build-module/index.js.map +1 -1
  208. package/build-module/latest-posts/edit.js +1 -0
  209. package/build-module/latest-posts/edit.js.map +1 -1
  210. package/build-module/media-text/deprecated.js +227 -18
  211. package/build-module/media-text/deprecated.js.map +1 -1
  212. package/build-module/media-text/edit.js +3 -3
  213. package/build-module/media-text/edit.js.map +1 -1
  214. package/build-module/media-text/index.js +1 -1
  215. package/build-module/media-text/media-container.js +1 -5
  216. package/build-module/media-text/media-container.js.map +1 -1
  217. package/build-module/media-text/media-container.native.js +1 -1
  218. package/build-module/media-text/media-container.native.js.map +1 -1
  219. package/build-module/navigation/deprecated.js +8 -10
  220. package/build-module/navigation/deprecated.js.map +1 -1
  221. package/build-module/navigation/edit/index.js +1 -12
  222. package/build-module/navigation/edit/index.js.map +1 -1
  223. package/build-module/navigation/edit/inner-blocks.js +1 -4
  224. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  225. package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -14
  226. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  227. package/build-module/navigation/index.js +0 -1
  228. package/build-module/navigation/index.js.map +1 -1
  229. package/build-module/post-author/index.js +0 -1
  230. package/build-module/post-author/index.js.map +1 -1
  231. package/build-module/post-date/edit.js +2 -1
  232. package/build-module/post-date/edit.js.map +1 -1
  233. package/build-module/post-date/index.js +3 -1
  234. package/build-module/post-date/index.js.map +1 -1
  235. package/build-module/post-date/variations.js +18 -0
  236. package/build-module/post-date/variations.js.map +1 -0
  237. package/build-module/post-excerpt/edit.js +38 -11
  238. package/build-module/post-excerpt/edit.js.map +1 -1
  239. package/build-module/post-featured-image/dimension-controls.js +4 -3
  240. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  241. package/build-module/post-featured-image/edit.js +8 -22
  242. package/build-module/post-featured-image/edit.js.map +1 -1
  243. package/build-module/post-template/index.js +1 -1
  244. package/build-module/post-time-to-read/edit.js +1 -1
  245. package/build-module/post-time-to-read/edit.js.map +1 -1
  246. package/build-module/post-time-to-read/index.js +24 -1
  247. package/build-module/post-time-to-read/index.js.map +1 -1
  248. package/build-module/quote/index.js +1 -0
  249. package/build-module/quote/index.js.map +1 -1
  250. package/build-module/spacer/controls.js +27 -9
  251. package/build-module/spacer/controls.js.map +1 -1
  252. package/build-module/spacer/edit.js +27 -8
  253. package/build-module/spacer/edit.js.map +1 -1
  254. package/build-module/spacer/save.js +3 -3
  255. package/build-module/spacer/save.js.map +1 -1
  256. package/build-module/table/state.js +35 -33
  257. package/build-module/table/state.js.map +1 -1
  258. package/build-module/term-description/index.js +1 -2
  259. package/build-module/term-description/index.js.map +1 -1
  260. package/build-module/utils/clean-empty-object.js +6 -3
  261. package/build-module/utils/clean-empty-object.js.map +1 -1
  262. package/build-style/categories/editor-rtl.css +5 -0
  263. package/build-style/categories/editor.css +5 -0
  264. package/build-style/categories/style-rtl.css +4 -0
  265. package/build-style/categories/style.css +4 -0
  266. package/build-style/columns/style-rtl.css +4 -1
  267. package/build-style/columns/style.css +4 -1
  268. package/build-style/common-rtl.css +1 -1
  269. package/build-style/common.css +1 -1
  270. package/build-style/cover/editor-rtl.css +11 -12
  271. package/build-style/cover/editor.css +11 -12
  272. package/build-style/cover/style-rtl.css +3 -2
  273. package/build-style/cover/style.css +3 -2
  274. package/build-style/details/style-rtl.css +91 -0
  275. package/build-style/details/style.css +91 -0
  276. package/build-style/details-summary/editor-rtl.css +91 -0
  277. package/build-style/details-summary/editor.css +91 -0
  278. package/build-style/details-summary/style-rtl.css +91 -0
  279. package/build-style/details-summary/style.css +91 -0
  280. package/build-style/editor-rtl.css +40 -48
  281. package/build-style/editor.css +40 -48
  282. package/build-style/file/style-rtl.css +4 -3
  283. package/build-style/file/style.css +4 -3
  284. package/build-style/navigation/style-rtl.css +2 -0
  285. package/build-style/navigation/style.css +2 -0
  286. package/build-style/post-excerpt/style-rtl.css +1 -1
  287. package/build-style/post-excerpt/style.css +1 -1
  288. package/build-style/post-featured-image/editor-rtl.css +1 -0
  289. package/build-style/post-featured-image/editor.css +1 -0
  290. package/build-style/post-template/style-rtl.css +1 -1
  291. package/build-style/post-template/style.css +1 -1
  292. package/build-style/post-time-to-read/style-rtl.css +91 -0
  293. package/build-style/post-time-to-read/style.css +91 -0
  294. package/build-style/pullquote/style-rtl.css +4 -1
  295. package/build-style/pullquote/style.css +4 -1
  296. package/build-style/search/style-rtl.css +8 -7
  297. package/build-style/search/style.css +8 -7
  298. package/build-style/shortcode/editor-rtl.css +15 -34
  299. package/build-style/shortcode/editor.css +15 -34
  300. package/build-style/spacer/editor-rtl.css +4 -2
  301. package/build-style/spacer/editor.css +4 -2
  302. package/build-style/style-rtl.css +44 -17
  303. package/build-style/style.css +44 -17
  304. package/package.json +31 -31
  305. package/src/buttons/block.json +1 -0
  306. package/src/categories/editor.scss +5 -0
  307. package/src/categories/style.scss +4 -0
  308. package/src/column/block.json +2 -1
  309. package/src/columns/block.json +6 -1
  310. package/src/columns/edit.js +35 -10
  311. package/src/columns/style.scss +5 -1
  312. package/src/columns/utils.js +8 -9
  313. package/src/comments/index.php +1 -0
  314. package/src/common.scss +1 -1
  315. package/src/cover/block.json +12 -0
  316. package/src/cover/edit/index.js +44 -37
  317. package/src/cover/edit/inspector-controls.js +4 -5
  318. package/src/cover/edit/resizable-cover-popover.js +82 -0
  319. package/src/cover/editor.scss +20 -13
  320. package/src/cover/index.php +9 -10
  321. package/src/cover/style.scss +2 -1
  322. package/src/cover/test/__snapshots__/transforms.native.js.snap +2 -2
  323. package/src/cover/test/edit.js +324 -0
  324. package/src/details/block.json +54 -0
  325. package/src/details/edit.js +59 -0
  326. package/src/details/index.js +35 -0
  327. package/src/details/save.js +15 -0
  328. package/src/details/style.scss +3 -0
  329. package/src/details-content/block.json +50 -0
  330. package/src/details-content/edit.js +29 -0
  331. package/src/details-content/index.js +23 -0
  332. package/src/details-content/save.js +12 -0
  333. package/src/details-summary/block.json +53 -0
  334. package/src/details-summary/edit.js +27 -0
  335. package/src/details-summary/editor.scss +3 -0
  336. package/src/details-summary/index.js +23 -0
  337. package/src/details-summary/save.js +13 -0
  338. package/src/details-summary/style.scss +3 -0
  339. package/src/editor.scss +1 -0
  340. package/src/embed/block.json +4 -1
  341. package/src/embed/embed-link-settings.native.js +1 -1
  342. package/src/embed/embed-placeholder.js +1 -1
  343. package/src/file/edit.native.js +0 -2
  344. package/src/file/style.scss +5 -2
  345. package/src/gallery/edit.js +5 -2
  346. package/src/gallery/test/use-get-media.native.js +24 -0
  347. package/src/gallery/use-get-media.native.js +1 -1
  348. package/src/gallery/use-image-sizes.js +1 -1
  349. package/src/group/deprecated.js +4 -2
  350. package/src/group/edit.js +27 -9
  351. package/src/group/placeholder.js +13 -1
  352. package/src/group/variations.js +14 -1
  353. package/src/home-link/index.php +2 -2
  354. package/src/image/block.json +9 -2
  355. package/src/image/edit.js +1 -1
  356. package/src/image/edit.native.js +1 -1
  357. package/src/image/image.js +15 -7
  358. package/src/image/index.php +7 -2
  359. package/src/image/test/__snapshots__/transforms.native.js.snap +1 -1
  360. package/src/index.js +13 -3
  361. package/src/latest-comments/style.scss +1 -1
  362. package/src/latest-posts/edit.js +3 -0
  363. package/src/media-text/block.json +1 -1
  364. package/src/media-text/deprecated.js +235 -3
  365. package/src/media-text/edit.js +7 -6
  366. package/src/media-text/media-container.js +1 -5
  367. package/src/media-text/media-container.native.js +1 -1
  368. package/src/media-text/test/__snapshots__/transforms.native.js.snap +4 -4
  369. package/src/navigation/block.json +0 -1
  370. package/src/navigation/deprecated.js +15 -19
  371. package/src/navigation/edit/index.js +0 -13
  372. package/src/navigation/edit/inner-blocks.js +0 -3
  373. package/src/navigation/edit/unsaved-inner-blocks.js +34 -46
  374. package/src/navigation/index.php +0 -4
  375. package/src/navigation/style.scss +6 -4
  376. package/src/navigation-link/index.php +2 -1
  377. package/src/navigation-submenu/index.php +30 -76
  378. package/src/paragraph/test/edit.native.js +356 -1
  379. package/src/post-author/block.json +0 -1
  380. package/src/post-author/index.php +1 -1
  381. package/src/post-date/edit.js +4 -1
  382. package/src/post-date/index.js +2 -0
  383. package/src/post-date/variations.js +20 -0
  384. package/src/post-excerpt/edit.js +48 -16
  385. package/src/post-excerpt/index.php +3 -3
  386. package/src/post-excerpt/style.scss +2 -1
  387. package/src/post-featured-image/dimension-controls.js +7 -3
  388. package/src/post-featured-image/edit.js +8 -29
  389. package/src/post-featured-image/editor.scss +1 -0
  390. package/src/post-template/block.json +1 -1
  391. package/src/post-template/style.scss +1 -1
  392. package/src/post-time-to-read/block.json +24 -1
  393. package/src/post-time-to-read/edit.js +1 -1
  394. package/src/post-time-to-read/index.php +3 -3
  395. package/src/post-time-to-read/style.scss +4 -0
  396. package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -2
  397. package/src/preformatted/test/edit.native.js +45 -2
  398. package/src/pullquote/style.scss +5 -1
  399. package/src/pullquote/test/edit.native.js +70 -0
  400. package/src/query-title/index.php +2 -5
  401. package/src/quote/block.json +1 -0
  402. package/src/quote/test/edit.native.js +92 -0
  403. package/src/search/index.php +1 -1
  404. package/src/search/style.scss +16 -12
  405. package/src/shortcode/editor.scss +26 -5
  406. package/src/spacer/controls.js +42 -17
  407. package/src/spacer/edit.js +41 -9
  408. package/src/spacer/editor.scss +2 -1
  409. package/src/spacer/save.js +3 -3
  410. package/src/style.scss +3 -0
  411. package/src/table/state.js +83 -66
  412. package/src/term-description/block.json +1 -2
  413. package/src/utils/clean-empty-object.js +4 -4
  414. package/src/verse/test/edit.native.js +33 -0
  415. package/src/video/test/__snapshots__/transforms.native.js.snap +1 -1
  416. package/tsconfig.tsbuildinfo +1 -1
  417. package/build/cover/edit/resizable-cover.js.map +0 -1
  418. package/build/media-text/media-container-icon.js +0 -27
  419. package/build/media-text/media-container-icon.js.map +0 -1
  420. package/build-module/cover/edit/resizable-cover.js.map +0 -1
  421. package/build-module/media-text/media-container-icon.js +0 -17
  422. package/build-module/media-text/media-container-icon.js.map +0 -1
  423. package/src/cover/edit/resizable-cover.js +0 -61
  424. package/src/cover/test/block-controls.js +0 -62
  425. package/src/media-text/media-container-icon.js +0 -12
@@ -76,12 +76,15 @@ export default function PostDateEdit( {
76
76
  [ postTypeSlug ]
77
77
  );
78
78
 
79
+ const dateLabel =
80
+ displayType === 'date' ? __( 'Post Date' ) : __( 'Post Modified Date' );
81
+
79
82
  let postDate = date ? (
80
83
  <time dateTime={ dateI18n( 'c', date ) } ref={ setPopoverAnchor }>
81
84
  { dateI18n( format || siteFormat, date ) }
82
85
  </time>
83
86
  ) : (
84
- __( 'Post Date' )
87
+ dateLabel
85
88
  );
86
89
 
87
90
  if ( isLink && date ) {
@@ -10,6 +10,7 @@ import initBlock from '../utils/init-block';
10
10
  import metadata from './block.json';
11
11
  import edit from './edit';
12
12
  import deprecated from './deprecated';
13
+ import variations from './variations';
13
14
 
14
15
  const { name } = metadata;
15
16
  export { metadata, name };
@@ -18,6 +19,7 @@ export const settings = {
18
19
  icon,
19
20
  edit,
20
21
  deprecated,
22
+ variations,
21
23
  };
22
24
 
23
25
  export const init = () => initBlock( { name, metadata, settings } );
@@ -0,0 +1,20 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { postDate } from '@wordpress/icons';
6
+
7
+ const variations = [
8
+ {
9
+ name: 'post-date-modified',
10
+ title: __( 'Post Modified Date' ),
11
+ description: __( "Display a post's last updated date." ),
12
+ attributes: { displayType: 'modified' },
13
+ scope: [ 'block', 'inserter' ],
14
+ isActive: ( blockAttributes ) =>
15
+ blockAttributes.displayType === 'modified',
16
+ icon: postDate,
17
+ },
18
+ ];
19
+
20
+ export default variations;
@@ -6,7 +6,7 @@ import classnames from 'classnames';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { useEntityProp } from '@wordpress/core-data';
9
+ import { useEntityProp, store as coreStore } from '@wordpress/core-data';
10
10
  import { useMemo } from '@wordpress/element';
11
11
  import {
12
12
  AlignmentToolbar,
@@ -18,12 +18,15 @@ import {
18
18
  } from '@wordpress/block-editor';
19
19
  import { PanelBody, ToggleControl, RangeControl } from '@wordpress/components';
20
20
  import { __, _x } from '@wordpress/i18n';
21
+ import { useSelect } from '@wordpress/data';
21
22
 
22
23
  /**
23
24
  * Internal dependencies
24
25
  */
25
26
  import { useCanEditEntity } from '../utils/hooks';
26
27
 
28
+ const ELLIPSIS = '…';
29
+
27
30
  export default function PostExcerptEditor( {
28
31
  attributes: { textAlign, moreText, showMoreOnNewLine, excerptLength },
29
32
  setAttributes,
@@ -32,13 +35,41 @@ export default function PostExcerptEditor( {
32
35
  } ) {
33
36
  const isDescendentOfQueryLoop = Number.isFinite( queryId );
34
37
  const userCanEdit = useCanEditEntity( 'postType', postType, postId );
35
- const isEditable = userCanEdit && ! isDescendentOfQueryLoop;
36
-
37
38
  const [
38
39
  rawExcerpt,
39
40
  setExcerpt,
40
41
  { rendered: renderedExcerpt, protected: isProtected } = {},
41
42
  ] = useEntityProp( 'postType', postType, 'excerpt', postId );
43
+
44
+ /**
45
+ * Check if the post type supports excerpts.
46
+ * Add an exception and return early for the "page" post type,
47
+ * which is registered without support for the excerpt UI,
48
+ * but supports saving the excerpt to the database.
49
+ * See: https://core.trac.wordpress.org/browser/branches/6.1/src/wp-includes/post.php#L65
50
+ * Without this exception, users that have excerpts saved to the database will
51
+ * not be able to edit the excerpts.
52
+ */
53
+ const postTypeSupportsExcerpts = useSelect(
54
+ ( select ) => {
55
+ if ( postType === 'page' ) {
56
+ return true;
57
+ }
58
+ return !! select( coreStore ).getPostType( postType )?.supports
59
+ .excerpt;
60
+ },
61
+ [ postType ]
62
+ );
63
+
64
+ /**
65
+ * The excerpt is editable if:
66
+ * - The user can edit the post
67
+ * - It is not a descendent of a Query Loop block
68
+ * - The post type supports excerpts
69
+ */
70
+ const isEditable =
71
+ userCanEdit && ! isDescendentOfQueryLoop && postTypeSupportsExcerpts;
72
+
42
73
  const blockProps = useBlockProps( {
43
74
  className: classnames( {
44
75
  [ `has-text-align-${ textAlign }` ]: textAlign,
@@ -65,6 +96,7 @@ export default function PostExcerptEditor( {
65
96
  );
66
97
  return document.body.textContent || document.body.innerText || '';
67
98
  }, [ renderedExcerpt ] );
99
+
68
100
  if ( ! postType || ! postId ) {
69
101
  return (
70
102
  <>
@@ -123,14 +155,13 @@ export default function PostExcerptEditor( {
123
155
  * The excerpt length setting needs to be applied to both
124
156
  * the raw and the rendered excerpt depending on which is being used.
125
157
  */
126
- const rawOrRenderedExcerpt = !! renderedExcerpt
127
- ? strippedRenderedExcerpt
128
- : rawExcerpt;
158
+ const rawOrRenderedExcerpt = (
159
+ rawExcerpt || strippedRenderedExcerpt
160
+ ).trim();
129
161
 
130
162
  let trimmedExcerpt = '';
131
163
  if ( wordCountType === 'words' ) {
132
164
  trimmedExcerpt = rawOrRenderedExcerpt
133
- .trim()
134
165
  .split( ' ', excerptLength )
135
166
  .join( ' ' );
136
167
  } else if ( wordCountType === 'characters_excluding_spaces' ) {
@@ -143,7 +174,6 @@ export default function PostExcerptEditor( {
143
174
  * so that the spaces are excluded from the word count.
144
175
  */
145
176
  const excerptWithSpaces = rawOrRenderedExcerpt
146
- .trim()
147
177
  .split( '', excerptLength )
148
178
  .join( '' );
149
179
 
@@ -152,14 +182,15 @@ export default function PostExcerptEditor( {
152
182
  excerptWithSpaces.replaceAll( ' ', '' ).length;
153
183
 
154
184
  trimmedExcerpt = rawOrRenderedExcerpt
155
- .trim()
156
185
  .split( '', excerptLength + numberOfSpaces )
157
186
  .join( '' );
158
187
  } else if ( wordCountType === 'characters_including_spaces' ) {
159
- trimmedExcerpt = rawOrRenderedExcerpt.trim().split( '', excerptLength );
188
+ trimmedExcerpt = rawOrRenderedExcerpt
189
+ .split( '', excerptLength )
190
+ .join( '' );
160
191
  }
161
192
 
162
- trimmedExcerpt = trimmedExcerpt + '...';
193
+ const isTrimmed = trimmedExcerpt !== rawOrRenderedExcerpt;
163
194
 
164
195
  const excerptContent = isEditable ? (
165
196
  <RichText
@@ -168,7 +199,9 @@ export default function PostExcerptEditor( {
168
199
  value={
169
200
  isSelected
170
201
  ? rawOrRenderedExcerpt
171
- : ( trimmedExcerpt !== '...' ? trimmedExcerpt : '' ) ||
202
+ : ( ! isTrimmed
203
+ ? rawOrRenderedExcerpt
204
+ : trimmedExcerpt + ELLIPSIS ) ||
172
205
  __( 'No post excerpt found' )
173
206
  }
174
207
  onChange={ setExcerpt }
@@ -176,9 +209,9 @@ export default function PostExcerptEditor( {
176
209
  />
177
210
  ) : (
178
211
  <p className={ excerptClassName }>
179
- { trimmedExcerpt !== '...'
180
- ? trimmedExcerpt
181
- : __( 'No post excerpt found' ) }
212
+ { ! isTrimmed
213
+ ? rawOrRenderedExcerpt || __( 'No post excerpt found' )
214
+ : trimmedExcerpt + ELLIPSIS }
182
215
  </p>
183
216
  );
184
217
  return (
@@ -208,7 +241,6 @@ export default function PostExcerptEditor( {
208
241
  value={ excerptLength }
209
242
  onChange={ ( value ) => {
210
243
  setAttributes( { excerptLength: value } );
211
- setExcerpt();
212
244
  } }
213
245
  min="10"
214
246
  max="100"
@@ -25,11 +25,11 @@ function render_block_core_post_excerpt( $attributes, $content, $block ) {
25
25
  * wp_trim_words is used instead.
26
26
  */
27
27
  $excerpt_length = $attributes['excerptLength'];
28
+ $excerpt = get_the_excerpt( $block->context['postId'] );
28
29
  if ( isset( $excerpt_length ) ) {
29
- $excerpt = wp_trim_words( get_the_excerpt(), $excerpt_length );
30
- } else {
31
- $excerpt = get_the_excerpt();
30
+ $excerpt = wp_trim_words( $excerpt, $excerpt_length );
32
31
  }
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
34
  $filter_excerpt_more = function( $more ) use ( $more_text ) {
35
35
  return empty( $more_text ) ? $more : '';
@@ -1,4 +1,5 @@
1
- .wp-block-post-excerpt {
1
+ // Lowest specificity on wrapper margins to avoid overriding layout styles.
2
+ :where(.wp-block-post-excerpt) {
2
3
  margin-top: var(--wp--style--block-gap);
3
4
  margin-bottom: var(--wp--style--block-gap);
4
5
  }
@@ -70,6 +70,10 @@ const DimensionControls = ( {
70
70
  } );
71
71
  };
72
72
  const scaleLabel = _x( 'Scale', 'Image scaling options' );
73
+
74
+ const showScaleControl =
75
+ height || ( aspectRatio && aspectRatio !== 'auto' );
76
+
73
77
  return (
74
78
  <InspectorControls group="dimensions">
75
79
  <ToolsPanelItem
@@ -170,7 +174,7 @@ const DimensionControls = ( {
170
174
  units={ units }
171
175
  />
172
176
  </ToolsPanelItem>
173
- { ( height || aspectRatio ) && (
177
+ { showScaleControl && (
174
178
  <ToolsPanelItem
175
179
  hasValue={ () => !! scale && scale !== DEFAULT_SCALE }
176
180
  label={ scaleLabel }
@@ -204,7 +208,7 @@ const DimensionControls = ( {
204
208
  { !! imageSizeOptions.length && (
205
209
  <ToolsPanelItem
206
210
  hasValue={ () => !! sizeSlug }
207
- label={ __( 'Image size' ) }
211
+ label={ __( 'Resolution' ) }
208
212
  onDeselect={ () =>
209
213
  setAttributes( { sizeSlug: undefined } )
210
214
  }
@@ -216,7 +220,7 @@ const DimensionControls = ( {
216
220
  >
217
221
  <SelectControl
218
222
  __nextHasNoMarginBottom
219
- label={ __( 'Image size' ) }
223
+ label={ __( 'Resolution' ) }
220
224
  value={ sizeSlug || DEFAULT_SIZE }
221
225
  options={ imageSizeOptions }
222
226
  onChange={ ( nextSizeSlug ) =>
@@ -183,10 +183,15 @@ export default function PostFeaturedImageEdit( {
183
183
  let image;
184
184
 
185
185
  /**
186
- * A post featured image block placed in a query loop
187
- * does not have image replacement or upload options.
186
+ * A Post Featured Image block should not have image replacement
187
+ * or upload options in the following cases:
188
+ * - Is placed in a Query Loop. This is a consious decision to
189
+ * prevent content editing of different posts in Query Loop, and
190
+ * this could change in the future.
191
+ * - Is in a context where it does not have a postId (for example
192
+ * in a template or template part).
188
193
  */
189
- if ( ! featuredImage && isDescendentOfQueryLoop ) {
194
+ if ( ! featuredImage && ( isDescendentOfQueryLoop || ! postId ) ) {
190
195
  return (
191
196
  <>
192
197
  { controls }
@@ -202,32 +207,6 @@ export default function PostFeaturedImageEdit( {
202
207
  );
203
208
  }
204
209
 
205
- /**
206
- * A post featured image placed in a block template, outside a query loop,
207
- * does not have a postId and will always be a placeholder image.
208
- * It does not have image replacement, upload, or link options.
209
- */
210
- if ( ! featuredImage && ! postId ) {
211
- return (
212
- <>
213
- <DimensionControls
214
- clientId={ clientId }
215
- attributes={ attributes }
216
- setAttributes={ setAttributes }
217
- imageSizeOptions={ imageSizeOptions }
218
- />
219
- <div { ...blockProps }>
220
- { placeholder() }
221
- <Overlay
222
- attributes={ attributes }
223
- setAttributes={ setAttributes }
224
- clientId={ clientId }
225
- />
226
- </div>
227
- </>
228
- );
229
- }
230
-
231
210
  const label = __( 'Add a featured image' );
232
211
  const imageStyles = {
233
212
  ...borderProps.style,
@@ -12,6 +12,7 @@
12
12
  justify-content: center;
13
13
  align-items: center;
14
14
  padding: 0;
15
+ display: flex;
15
16
 
16
17
  // Hide the upload button, as it's also available in the media library.
17
18
  .components-form-file-upload {
@@ -18,7 +18,7 @@
18
18
  "supports": {
19
19
  "reusable": false,
20
20
  "html": false,
21
- "align": true,
21
+ "align": [ "wide", "full" ],
22
22
  "anchor": true,
23
23
  "__experimentalLayout": {
24
24
  "allowEditing": false
@@ -16,7 +16,7 @@
16
16
  flex-wrap: wrap;
17
17
  gap: 1.25em;
18
18
 
19
- li {
19
+ > li {
20
20
  margin: 0;
21
21
  width: 100%;
22
22
  }
@@ -14,7 +14,30 @@
14
14
  }
15
15
  },
16
16
  "supports": {
17
+ "color": {
18
+ "gradients": true,
19
+ "__experimentalDefaultControls": {
20
+ "background": true,
21
+ "text": true
22
+ }
23
+ },
17
24
  "html": false,
18
- "multiple": false
25
+ "spacing": {
26
+ "margin": true,
27
+ "padding": true
28
+ },
29
+ "typography": {
30
+ "fontSize": true,
31
+ "lineHeight": true,
32
+ "__experimentalFontFamily": true,
33
+ "__experimentalFontWeight": true,
34
+ "__experimentalFontStyle": true,
35
+ "__experimentalTextTransform": true,
36
+ "__experimentalTextDecoration": true,
37
+ "__experimentalLetterSpacing": true,
38
+ "__experimentalDefaultControls": {
39
+ "fontSize": true
40
+ }
41
+ }
19
42
  }
20
43
  }
@@ -93,7 +93,7 @@ function PostTimeToReadEdit( { attributes, setAttributes, context } ) {
93
93
  } }
94
94
  />
95
95
  </BlockControls>
96
- <p { ...blockProps }>{ minutesToReadString }</p>
96
+ <div { ...blockProps }>{ minutesToReadString }</div>
97
97
  </>
98
98
  );
99
99
  }
@@ -32,8 +32,8 @@ function render_block_core_post_time_to_read( $attributes, $content, $block ) {
32
32
  $minutes_to_read = max( 1, (int) round( wp_word_count( $content, $word_count_type ) / $average_reading_rate ) );
33
33
 
34
34
  $minutes_to_read_string = sprintf(
35
- /* translators: %d is the number of minutes the post will take to read. */
36
- _n( '%d minute', '%d minutes', $minutes_to_read ),
35
+ /* translators: %s is the number of minutes the post will take to read. */
36
+ _n( '%s minute', '%s minutes', $minutes_to_read ),
37
37
  $minutes_to_read
38
38
  );
39
39
 
@@ -42,7 +42,7 @@ function render_block_core_post_time_to_read( $attributes, $content, $block ) {
42
42
  $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
43
43
 
44
44
  return sprintf(
45
- '<p %1$s>%2$s</p>',
45
+ '<div %1$s>%2$s</div>',
46
46
  $wrapper_attributes,
47
47
  $minutes_to_read_string
48
48
  );
@@ -0,0 +1,4 @@
1
+ .wp-block-post-time-to-read {
2
+ // This block has customizable padding, border-box makes that more predictable.
3
+ box-sizing: border-box;
4
+ }
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`core/more/edit/native should match snapshot when content is empty 1`] = `
3
+ exports[`Preformatted should match snapshot when content is empty 1`] = `
4
4
  <View
5
5
  style={
6
6
  [
@@ -46,7 +46,7 @@ exports[`core/more/edit/native should match snapshot when content is empty 1`] =
46
46
  </View>
47
47
  `;
48
48
 
49
- exports[`core/more/edit/native should match snapshot when content is not empty 1`] = `
49
+ exports[`Preformatted should match snapshot when content is not empty 1`] = `
50
50
  <View
51
51
  style={
52
52
  [
@@ -1,14 +1,29 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { render } from 'test/helpers';
4
+ import {
5
+ addBlock,
6
+ changeAndSelectTextOfRichText,
7
+ fireEvent,
8
+ getEditorHtml,
9
+ initializeEditor,
10
+ render,
11
+ setupCoreBlocks,
12
+ } from 'test/helpers';
13
+
14
+ /**
15
+ * WordPress dependencies
16
+ */
17
+ import { ENTER } from '@wordpress/keycodes';
5
18
 
6
19
  /**
7
20
  * Internal dependencies
8
21
  */
9
22
  import PreformattedEdit from '../edit';
10
23
 
11
- describe( 'core/more/edit/native', () => {
24
+ setupCoreBlocks();
25
+
26
+ describe( 'Preformatted', () => {
12
27
  it( 'renders without crashing', () => {
13
28
  const screen = render(
14
29
  <PreformattedEdit
@@ -42,4 +57,32 @@ describe( 'core/more/edit/native', () => {
42
57
  );
43
58
  expect( screen.toJSON() ).toMatchSnapshot();
44
59
  } );
60
+
61
+ it( 'should produce expected markup for multiline text', async () => {
62
+ // Arrange
63
+ const screen = await initializeEditor();
64
+
65
+ // Act
66
+ await addBlock( screen, 'Preformatted' );
67
+ const verseTextInput = await screen.findByPlaceholderText(
68
+ 'Write preformatted text…'
69
+ );
70
+ const string = 'A great statement.';
71
+ changeAndSelectTextOfRichText( verseTextInput, string, {
72
+ selectionStart: string.length,
73
+ selectionEnd: string.length,
74
+ } );
75
+ fireEvent( verseTextInput, 'onKeyDown', {
76
+ nativeEvent: {},
77
+ preventDefault() {},
78
+ keyCode: ENTER,
79
+ } );
80
+
81
+ // Assert
82
+ expect( getEditorHtml() ).toMatchInlineSnapshot( `
83
+ "<!-- wp:preformatted -->
84
+ <pre class="wp-block-preformatted">A great statement.<br></pre>
85
+ <!-- /wp:preformatted -->"
86
+ ` );
87
+ } );
45
88
  } );
@@ -1,5 +1,4 @@
1
1
  .wp-block-pullquote {
2
- margin: 0 0 1em 0;
3
2
  padding: 3em 0;
4
3
  text-align: center; // Default text-alignment where the `textAlign` attribute value isn't specified.
5
4
  overflow-wrap: break-word; // Break long strings of text without spaces so they don't overflow the block.
@@ -25,6 +24,11 @@
25
24
  }
26
25
  }
27
26
 
27
+ // Lowest specificity to avoid overriding layout styles.
28
+ :where(.wp-block-pullquote) {
29
+ margin: 0 0 1em 0;
30
+ }
31
+
28
32
  // Ensure that we are reasonably specific to override theme defaults.
29
33
  .wp-block-pullquote.has-text-align-left blockquote {
30
34
  text-align: left;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import {
5
+ addBlock,
6
+ getBlock,
7
+ initializeEditor,
8
+ setupCoreBlocks,
9
+ getEditorHtml,
10
+ fireEvent,
11
+ within,
12
+ waitFor,
13
+ changeAndSelectTextOfRichText,
14
+ } from 'test/helpers';
15
+
16
+ /**
17
+ * WordPress dependencies
18
+ */
19
+ import { ENTER } from '@wordpress/keycodes';
20
+
21
+ setupCoreBlocks();
22
+
23
+ describe( 'Pullquote', () => {
24
+ it( 'should produce expected markup for multiline text', async () => {
25
+ // Arrange
26
+ const screen = await initializeEditor();
27
+ await addBlock( screen, 'Pullquote' );
28
+ // Await inner blocks to be rendered
29
+ const citationBlock = await waitFor( () =>
30
+ screen.getByPlaceholderText( 'Add citation' )
31
+ );
32
+
33
+ // Act
34
+ const pullquoteBlock = getBlock( screen, 'Pullquote' );
35
+ fireEvent.press( pullquoteBlock );
36
+ const pullquoteTextInput =
37
+ within( pullquoteBlock ).getByPlaceholderText( 'Add quote' );
38
+ const string = 'A great statement.';
39
+ changeAndSelectTextOfRichText( pullquoteTextInput, string, {
40
+ selectionStart: string.length,
41
+ selectionEnd: string.length,
42
+ } );
43
+ fireEvent( pullquoteTextInput, 'onKeyDown', {
44
+ nativeEvent: {},
45
+ preventDefault() {},
46
+ keyCode: ENTER,
47
+ } );
48
+
49
+ // TODO: Determine a way to type after pressing ENTER within the block.
50
+
51
+ const citationTextInput =
52
+ within( citationBlock ).getByPlaceholderText( 'Add citation' );
53
+ changeAndSelectTextOfRichText( citationTextInput, 'A person', {
54
+ selectionStart: 2,
55
+ selectionEnd: 2,
56
+ } );
57
+ fireEvent( citationTextInput, 'onKeyDown', {
58
+ nativeEvent: {},
59
+ preventDefault() {},
60
+ keyCode: ENTER,
61
+ } );
62
+
63
+ // Assert
64
+ expect( getEditorHtml() ).toMatchInlineSnapshot( `
65
+ "<!-- wp:pullquote -->
66
+ <figure class="wp-block-pullquote"><blockquote><p>A great statement.<br></p><cite>A <br>person</cite></blockquote></figure>
67
+ <!-- /wp:pullquote -->"
68
+ ` );
69
+ } );
70
+ } );
@@ -28,12 +28,9 @@ function render_block_core_query_title( $attributes ) {
28
28
  if ( $is_archive ) {
29
29
  $show_prefix = isset( $attributes['showPrefix'] ) ? $attributes['showPrefix'] : true;
30
30
  if ( ! $show_prefix ) {
31
- $filter_title = function( $title, $original_title ) {
32
- return $original_title;
33
- };
34
- add_filter( 'get_the_archive_title', $filter_title, 10, 2 );
31
+ add_filter( 'get_the_archive_title_prefix', '__return_empty_string', 1 );
35
32
  $title = get_the_archive_title();
36
- remove_filter( 'get_the_archive_title', $filter_title, 10, 2 );
33
+ remove_filter( 'get_the_archive_title_prefix', '__return_empty_string', 1 );
37
34
  } else {
38
35
  $title = get_the_archive_title();
39
36
  }
@@ -29,6 +29,7 @@
29
29
  },
30
30
  "supports": {
31
31
  "anchor": true,
32
+ "html": false,
32
33
  "__experimentalOnEnter": true,
33
34
  "typography": {
34
35
  "fontSize": true,