@wordpress/block-library 8.8.0 → 8.10.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 (437) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/comment-author-name/edit.js +1 -1
  3. package/build/comment-author-name/edit.js.map +1 -1
  4. package/build/comment-edit-link/edit.js +1 -1
  5. package/build/comment-edit-link/edit.js.map +1 -1
  6. package/build/cover/edit/inspector-controls.js +1 -1
  7. package/build/cover/edit/inspector-controls.js.map +1 -1
  8. package/build/cover/index.js +1 -1
  9. package/build/cover/transforms.js +10 -7
  10. package/build/cover/transforms.js.map +1 -1
  11. package/build/cover/variations.js +1 -1
  12. package/build/cover/variations.js.map +1 -1
  13. package/build/details/edit.js +19 -5
  14. package/build/details/edit.js.map +1 -1
  15. package/build/details/index.js +14 -10
  16. package/build/details/index.js.map +1 -1
  17. package/build/details/save.js +4 -1
  18. package/build/details/save.js.map +1 -1
  19. package/build/embed/variations.js +2 -2
  20. package/build/embed/variations.js.map +1 -1
  21. package/build/file/view.js +1 -1
  22. package/build/file/view.js.map +1 -1
  23. package/build/gallery/edit.js +2 -8
  24. package/build/gallery/edit.js.map +1 -1
  25. package/build/group/edit.js +3 -1
  26. package/build/group/edit.js.map +1 -1
  27. package/build/group/index.js +3 -0
  28. package/build/group/index.js.map +1 -1
  29. package/build/image/edit.js +16 -13
  30. package/build/image/edit.js.map +1 -1
  31. package/build/image/index.js +1 -1
  32. package/build/index.js +0 -6
  33. package/build/index.js.map +1 -1
  34. package/build/index.native.js +10 -6
  35. package/build/index.native.js.map +1 -1
  36. package/build/list-item/utils.js +5 -1
  37. package/build/list-item/utils.js.map +1 -1
  38. package/build/loginout/index.js +11 -1
  39. package/build/loginout/index.js.map +1 -1
  40. package/build/media-text/edit.js +4 -2
  41. package/build/media-text/edit.js.map +1 -1
  42. package/build/media-text/index.js +3 -0
  43. package/build/media-text/index.js.map +1 -1
  44. package/build/navigation/constants.js +13 -0
  45. package/build/navigation/constants.js.map +1 -0
  46. package/build/navigation/edit/index.js +26 -68
  47. package/build/navigation/edit/index.js.map +1 -1
  48. package/build/navigation/edit/inner-blocks.js +4 -7
  49. package/build/navigation/edit/inner-blocks.js.map +1 -1
  50. package/build/navigation/edit/unsaved-inner-blocks.js +4 -6
  51. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  52. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  53. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  54. package/build/navigation/interactivity.js +139 -0
  55. package/build/navigation/interactivity.js.map +1 -0
  56. package/build/navigation-link/edit.js +1 -1
  57. package/build/navigation-link/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/paragraph/index.js +5 -1
  61. package/build/paragraph/index.js.map +1 -1
  62. package/build/paragraph/transforms.js +5 -1
  63. package/build/paragraph/transforms.js.map +1 -1
  64. package/build/post-author-name/edit.js +1 -1
  65. package/build/post-author-name/edit.js.map +1 -1
  66. package/build/post-date/edit.js +4 -2
  67. package/build/post-date/edit.js.map +1 -1
  68. package/build/post-excerpt/edit.js +2 -2
  69. package/build/post-excerpt/edit.js.map +1 -1
  70. package/build/post-featured-image/edit.js +6 -4
  71. package/build/post-featured-image/edit.js.map +1 -1
  72. package/build/post-featured-image/overlay.js +5 -0
  73. package/build/post-featured-image/overlay.js.map +1 -1
  74. package/build/post-title/edit.js +14 -4
  75. package/build/post-title/edit.js.map +1 -1
  76. package/build/preformatted/edit.native.js +3 -2
  77. package/build/preformatted/edit.native.js.map +1 -1
  78. package/build/query/deprecated.js +8 -6
  79. package/build/query/deprecated.js.map +1 -1
  80. package/build/query/edit/inspector-controls/create-new-post-link.js +41 -0
  81. package/build/query/edit/inspector-controls/create-new-post-link.js.map +1 -0
  82. package/build/query/edit/inspector-controls/index.js +14 -6
  83. package/build/query/edit/inspector-controls/index.js.map +1 -1
  84. package/build/query/edit/pattern-selection-modal.js +2 -1
  85. package/build/query/edit/pattern-selection-modal.js.map +1 -1
  86. package/build/query/index.js +5 -12
  87. package/build/query/index.js.map +1 -1
  88. package/build/quote/transforms.js +16 -27
  89. package/build/quote/transforms.js.map +1 -1
  90. package/build/read-more/edit.js +1 -1
  91. package/build/read-more/edit.js.map +1 -1
  92. package/build/search/edit.js +9 -1
  93. package/build/search/edit.js.map +1 -1
  94. package/build/site-logo/edit.js +114 -16
  95. package/build/site-logo/edit.js.map +1 -1
  96. package/build/site-logo/index.js +1 -1
  97. package/build/site-title/edit/index.js +1 -1
  98. package/build/site-title/edit/index.js.map +1 -1
  99. package/build/social-link/icons/chain.js +1 -1
  100. package/build/social-link/icons/chain.js.map +1 -1
  101. package/build/social-link/icons/mail.js +1 -1
  102. package/build/social-link/icons/mail.js.map +1 -1
  103. package/build/social-links/edit.js +2 -2
  104. package/build/social-links/edit.js.map +1 -1
  105. package/build/spacer/edit.js +117 -11
  106. package/build/spacer/edit.js.map +1 -1
  107. package/build/template-part/edit/index.js +2 -1
  108. package/build/template-part/edit/index.js.map +1 -1
  109. package/build/template-part/edit/utils/hooks.js +2 -2
  110. package/build/template-part/edit/utils/hooks.js.map +1 -1
  111. package/build/utils/interactivity/constants.js +9 -0
  112. package/build/utils/interactivity/constants.js.map +1 -0
  113. package/build/utils/interactivity/directives.js +208 -0
  114. package/build/utils/interactivity/directives.js.map +1 -0
  115. package/build/utils/interactivity/hooks.js +112 -0
  116. package/build/utils/interactivity/hooks.js.map +1 -0
  117. package/build/utils/interactivity/hydration.js +34 -0
  118. package/build/utils/interactivity/hydration.js.map +1 -0
  119. package/build/utils/interactivity/index.js +34 -0
  120. package/build/utils/interactivity/index.js.map +1 -0
  121. package/build/utils/interactivity/store.js +67 -0
  122. package/build/utils/interactivity/store.js.map +1 -0
  123. package/build/utils/interactivity/utils.js +87 -0
  124. package/build/utils/interactivity/utils.js.map +1 -0
  125. package/build/utils/interactivity/vdom.js +109 -0
  126. package/build/utils/interactivity/vdom.js.map +1 -0
  127. package/build/utils/migrate-font-family.js +12 -5
  128. package/build/utils/migrate-font-family.js.map +1 -1
  129. package/build/video/edit.native.js +4 -3
  130. package/build/video/edit.native.js.map +1 -1
  131. package/build-module/comment-author-name/edit.js +1 -1
  132. package/build-module/comment-author-name/edit.js.map +1 -1
  133. package/build-module/comment-edit-link/edit.js +1 -1
  134. package/build-module/comment-edit-link/edit.js.map +1 -1
  135. package/build-module/cover/edit/inspector-controls.js +1 -1
  136. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  137. package/build-module/cover/index.js +1 -1
  138. package/build-module/cover/transforms.js +5 -1
  139. package/build-module/cover/transforms.js.map +1 -1
  140. package/build-module/cover/variations.js +1 -1
  141. package/build-module/cover/variations.js.map +1 -1
  142. package/build-module/details/edit.js +20 -6
  143. package/build-module/details/edit.js.map +1 -1
  144. package/build-module/details/index.js +14 -10
  145. package/build-module/details/index.js.map +1 -1
  146. package/build-module/details/save.js +5 -2
  147. package/build-module/details/save.js.map +1 -1
  148. package/build-module/embed/variations.js +2 -2
  149. package/build-module/embed/variations.js.map +1 -1
  150. package/build-module/file/view.js +1 -1
  151. package/build-module/file/view.js.map +1 -1
  152. package/build-module/gallery/edit.js +2 -8
  153. package/build-module/gallery/edit.js.map +1 -1
  154. package/build-module/group/edit.js +3 -1
  155. package/build-module/group/edit.js.map +1 -1
  156. package/build-module/group/index.js +3 -0
  157. package/build-module/group/index.js.map +1 -1
  158. package/build-module/image/edit.js +16 -13
  159. package/build-module/image/edit.js.map +1 -1
  160. package/build-module/image/index.js +1 -1
  161. package/build-module/index.js +0 -4
  162. package/build-module/index.js.map +1 -1
  163. package/build-module/index.native.js +10 -6
  164. package/build-module/index.native.js.map +1 -1
  165. package/build-module/list-item/utils.js +5 -1
  166. package/build-module/list-item/utils.js.map +1 -1
  167. package/build-module/loginout/index.js +11 -1
  168. package/build-module/loginout/index.js.map +1 -1
  169. package/build-module/media-text/edit.js +4 -2
  170. package/build-module/media-text/edit.js.map +1 -1
  171. package/build-module/media-text/index.js +3 -0
  172. package/build-module/media-text/index.js.map +1 -1
  173. package/build-module/navigation/constants.js +5 -0
  174. package/build-module/navigation/constants.js.map +1 -0
  175. package/build-module/navigation/edit/index.js +28 -69
  176. package/build-module/navigation/edit/index.js.map +1 -1
  177. package/build-module/navigation/edit/inner-blocks.js +1 -4
  178. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  179. package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -4
  180. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  181. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  182. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  183. package/build-module/navigation/interactivity.js +136 -0
  184. package/build-module/navigation/interactivity.js.map +1 -0
  185. package/build-module/navigation-link/edit.js +1 -1
  186. package/build-module/navigation-link/edit.js.map +1 -1
  187. package/build-module/navigation-submenu/edit.js +1 -1
  188. package/build-module/navigation-submenu/edit.js.map +1 -1
  189. package/build-module/paragraph/index.js +5 -1
  190. package/build-module/paragraph/index.js.map +1 -1
  191. package/build-module/paragraph/transforms.js +5 -1
  192. package/build-module/paragraph/transforms.js.map +1 -1
  193. package/build-module/post-author-name/edit.js +1 -1
  194. package/build-module/post-author-name/edit.js.map +1 -1
  195. package/build-module/post-date/edit.js +4 -2
  196. package/build-module/post-date/edit.js.map +1 -1
  197. package/build-module/post-excerpt/edit.js +2 -2
  198. package/build-module/post-excerpt/edit.js.map +1 -1
  199. package/build-module/post-featured-image/edit.js +6 -4
  200. package/build-module/post-featured-image/edit.js.map +1 -1
  201. package/build-module/post-featured-image/overlay.js +5 -0
  202. package/build-module/post-featured-image/overlay.js.map +1 -1
  203. package/build-module/post-title/edit.js +13 -4
  204. package/build-module/post-title/edit.js.map +1 -1
  205. package/build-module/preformatted/edit.native.js +3 -2
  206. package/build-module/preformatted/edit.native.js.map +1 -1
  207. package/build-module/query/deprecated.js +5 -2
  208. package/build-module/query/deprecated.js.map +1 -1
  209. package/build-module/query/edit/inspector-controls/create-new-post-link.js +33 -0
  210. package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +1 -0
  211. package/build-module/query/edit/inspector-controls/index.js +12 -7
  212. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  213. package/build-module/query/edit/pattern-selection-modal.js +2 -1
  214. package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
  215. package/build-module/query/index.js +5 -10
  216. package/build-module/query/index.js.map +1 -1
  217. package/build-module/quote/transforms.js +16 -27
  218. package/build-module/quote/transforms.js.map +1 -1
  219. package/build-module/read-more/edit.js +1 -1
  220. package/build-module/read-more/edit.js.map +1 -1
  221. package/build-module/search/edit.js +9 -1
  222. package/build-module/search/edit.js.map +1 -1
  223. package/build-module/site-logo/edit.js +115 -18
  224. package/build-module/site-logo/edit.js.map +1 -1
  225. package/build-module/site-logo/index.js +1 -1
  226. package/build-module/site-title/edit/index.js +1 -1
  227. package/build-module/site-title/edit/index.js.map +1 -1
  228. package/build-module/social-link/icons/chain.js +1 -1
  229. package/build-module/social-link/icons/chain.js.map +1 -1
  230. package/build-module/social-link/icons/mail.js +1 -1
  231. package/build-module/social-link/icons/mail.js.map +1 -1
  232. package/build-module/social-links/edit.js +2 -2
  233. package/build-module/social-links/edit.js.map +1 -1
  234. package/build-module/spacer/edit.js +118 -12
  235. package/build-module/spacer/edit.js.map +1 -1
  236. package/build-module/template-part/edit/index.js +2 -1
  237. package/build-module/template-part/edit/index.js.map +1 -1
  238. package/build-module/template-part/edit/utils/hooks.js +2 -2
  239. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  240. package/build-module/utils/interactivity/constants.js +2 -0
  241. package/build-module/utils/interactivity/constants.js.map +1 -0
  242. package/build-module/utils/interactivity/directives.js +193 -0
  243. package/build-module/utils/interactivity/directives.js.map +1 -0
  244. package/build-module/utils/interactivity/hooks.js +98 -0
  245. package/build-module/utils/interactivity/hooks.js.map +1 -0
  246. package/build-module/utils/interactivity/hydration.js +21 -0
  247. package/build-module/utils/interactivity/hydration.js.map +1 -0
  248. package/build-module/utils/interactivity/index.js +17 -0
  249. package/build-module/utils/interactivity/index.js.map +1 -0
  250. package/build-module/utils/interactivity/store.js +56 -0
  251. package/build-module/utils/interactivity/store.js.map +1 -0
  252. package/build-module/utils/interactivity/utils.js +75 -0
  253. package/build-module/utils/interactivity/utils.js.map +1 -0
  254. package/build-module/utils/interactivity/vdom.js +97 -0
  255. package/build-module/utils/interactivity/vdom.js.map +1 -0
  256. package/build-module/utils/migrate-font-family.js +9 -1
  257. package/build-module/utils/migrate-font-family.js.map +1 -1
  258. package/build-module/video/edit.native.js +4 -3
  259. package/build-module/video/edit.native.js.map +1 -1
  260. package/build-style/cover/editor-rtl.css +3 -3
  261. package/build-style/cover/editor.css +3 -3
  262. package/build-style/cover/style-rtl.css +2 -1
  263. package/build-style/cover/style.css +2 -1
  264. package/build-style/{details-summary → details}/editor-rtl.css +1 -1
  265. package/build-style/{details-summary → details}/editor.css +1 -1
  266. package/build-style/details/style-rtl.css +14 -0
  267. package/build-style/details/style.css +14 -0
  268. package/build-style/editor-rtl.css +74 -39
  269. package/build-style/editor.css +74 -39
  270. package/build-style/gallery/editor-rtl.css +0 -4
  271. package/build-style/gallery/editor.css +0 -4
  272. package/build-style/html/editor-rtl.css +2 -2
  273. package/build-style/html/editor.css +2 -2
  274. package/build-style/image/editor-rtl.css +1 -1
  275. package/build-style/image/editor.css +1 -1
  276. package/build-style/query/editor-rtl.css +8 -12
  277. package/build-style/query/editor.css +8 -12
  278. package/build-style/search/editor-rtl.css +1 -0
  279. package/build-style/search/editor.css +1 -0
  280. package/build-style/search/style-rtl.css +2 -0
  281. package/build-style/search/style.css +2 -0
  282. package/build-style/shortcode/editor-rtl.css +3 -4
  283. package/build-style/shortcode/editor.css +3 -4
  284. package/build-style/site-logo/editor-rtl.css +47 -0
  285. package/build-style/site-logo/editor.css +47 -0
  286. package/build-style/style-rtl.css +15 -2
  287. package/build-style/style.css +15 -2
  288. package/build-style/template-part/editor-rtl.css +8 -12
  289. package/build-style/template-part/editor.css +8 -12
  290. package/package.json +36 -32
  291. package/src/buttons/test/__snapshots__/edit.native.js.snap +18 -0
  292. package/src/buttons/test/edit.native.js +123 -2
  293. package/src/comment-author-name/edit.js +1 -1
  294. package/src/comment-edit-link/edit.js +1 -1
  295. package/src/comment-template/index.php +8 -7
  296. package/src/cover/block.json +1 -1
  297. package/src/cover/edit/inspector-controls.js +56 -54
  298. package/src/cover/editor.scss +1 -1
  299. package/src/cover/style.scss +4 -0
  300. package/src/cover/test/edit.js +56 -2
  301. package/src/cover/transforms.js +4 -1
  302. package/src/cover/variations.js +1 -3
  303. package/src/details/block.json +8 -6
  304. package/src/details/edit.js +27 -5
  305. package/src/details/editor.scss +3 -0
  306. package/src/details/index.js +10 -5
  307. package/src/details/save.js +5 -1
  308. package/src/details/style.scss +16 -0
  309. package/src/editor.scss +1 -1
  310. package/src/embed/variations.js +2 -2
  311. package/src/file/view.js +4 -1
  312. package/src/gallery/edit.js +5 -8
  313. package/src/gallery/editor.scss +0 -6
  314. package/src/gallery/test/index.native.js +52 -7
  315. package/src/group/block.json +3 -0
  316. package/src/group/edit.js +8 -2
  317. package/src/heading/test/__snapshots__/index.native.js.snap +12 -0
  318. package/src/heading/test/index.native.js +71 -0
  319. package/src/html/editor.scss +2 -21
  320. package/src/image/block.json +1 -1
  321. package/src/image/edit.js +21 -17
  322. package/src/image/editor.scss +1 -1
  323. package/src/image/test/edit.native.js +38 -16
  324. package/src/index.js +0 -4
  325. package/src/index.native.js +10 -5
  326. package/src/list/test/edit.native.js +7 -7
  327. package/src/loginout/block.json +11 -1
  328. package/src/media-text/block.json +3 -0
  329. package/src/media-text/edit.js +2 -1
  330. package/src/navigation/constants.js +16 -0
  331. package/src/navigation/edit/index.js +77 -163
  332. package/src/navigation/edit/inner-blocks.js +1 -16
  333. package/src/navigation/edit/unsaved-inner-blocks.js +1 -16
  334. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  335. package/src/navigation/index.php +210 -197
  336. package/src/navigation/interactivity.js +144 -0
  337. package/src/navigation-link/edit.js +1 -1
  338. package/src/navigation-submenu/edit.js +1 -1
  339. package/src/paragraph/block.json +5 -1
  340. package/src/paragraph/test/edit.native.js +288 -28
  341. package/src/post-author-name/edit.js +1 -1
  342. package/src/post-date/edit.js +4 -0
  343. package/src/post-date/index.php +17 -8
  344. package/src/post-excerpt/edit.js +1 -1
  345. package/src/post-featured-image/edit.js +5 -4
  346. package/src/post-featured-image/overlay.js +4 -0
  347. package/src/post-terms/index.php +2 -2
  348. package/src/post-title/edit.js +8 -1
  349. package/src/preformatted/edit.native.js +1 -3
  350. package/src/preformatted/test/edit.native.js +6 -9
  351. package/src/pullquote/test/edit.native.js +7 -12
  352. package/src/query/deprecated.js +4 -1
  353. package/src/query/edit/inspector-controls/create-new-post-link.js +26 -0
  354. package/src/query/edit/inspector-controls/index.js +13 -6
  355. package/src/query/edit/pattern-selection-modal.js +1 -0
  356. package/src/query/editor.scss +8 -11
  357. package/src/query/index.js +1 -7
  358. package/src/quote/test/edit.native.js +6 -10
  359. package/src/quote/transforms.js +0 -6
  360. package/src/read-more/edit.js +1 -1
  361. package/src/search/edit.js +9 -4
  362. package/src/search/editor.scss +1 -0
  363. package/src/search/style.scss +3 -0
  364. package/src/shortcode/editor.scss +1 -21
  365. package/src/site-logo/block.json +1 -1
  366. package/src/site-logo/edit.js +123 -9
  367. package/src/site-logo/editor.scss +58 -0
  368. package/src/site-title/edit/index.js +1 -1
  369. package/src/social-link/icons/chain.js +1 -1
  370. package/src/social-link/icons/mail.js +1 -1
  371. package/src/social-link/index.php +2 -2
  372. package/src/social-links/edit.js +33 -31
  373. package/src/spacer/edit.js +157 -18
  374. package/src/style.scss +0 -1
  375. package/src/template-part/edit/index.js +1 -0
  376. package/src/template-part/edit/utils/hooks.js +2 -2
  377. package/src/template-part/editor.scss +9 -11
  378. package/src/template-part/index.php +20 -5
  379. package/src/utils/interactivity/constants.js +1 -0
  380. package/src/utils/interactivity/directives.js +179 -0
  381. package/src/utils/interactivity/hooks.js +76 -0
  382. package/src/utils/interactivity/hydration.js +22 -0
  383. package/src/utils/interactivity/index.js +17 -0
  384. package/src/utils/interactivity/store.js +45 -0
  385. package/src/utils/interactivity/utils.js +66 -0
  386. package/src/utils/interactivity/vdom.js +94 -0
  387. package/src/utils/migrate-font-family.js +8 -1
  388. package/src/verse/test/edit.native.js +4 -9
  389. package/src/video/edit.native.js +2 -2
  390. package/tsconfig.json +2 -0
  391. package/tsconfig.tsbuildinfo +1 -1
  392. package/build/details-content/edit.js +0 -34
  393. package/build/details-content/edit.js.map +0 -1
  394. package/build/details-content/index.js +0 -94
  395. package/build/details-content/index.js.map +0 -1
  396. package/build/details-content/save.js +0 -20
  397. package/build/details-content/save.js.map +0 -1
  398. package/build/details-summary/edit.js +0 -42
  399. package/build/details-summary/edit.js.map +0 -1
  400. package/build/details-summary/index.js +0 -97
  401. package/build/details-summary/index.js.map +0 -1
  402. package/build/details-summary/save.js +0 -24
  403. package/build/details-summary/save.js.map +0 -1
  404. package/build/query/hooks.js +0 -72
  405. package/build/query/hooks.js.map +0 -1
  406. package/build/utils/clean-empty-object.js +0 -37
  407. package/build/utils/clean-empty-object.js.map +0 -1
  408. package/build-module/details-content/edit.js +0 -23
  409. package/build-module/details-content/edit.js.map +0 -1
  410. package/build-module/details-content/index.js +0 -76
  411. package/build-module/details-content/index.js.map +0 -1
  412. package/build-module/details-content/save.js +0 -11
  413. package/build-module/details-content/save.js.map +0 -1
  414. package/build-module/details-summary/edit.js +0 -30
  415. package/build-module/details-summary/edit.js.map +0 -1
  416. package/build-module/details-summary/index.js +0 -79
  417. package/build-module/details-summary/index.js.map +0 -1
  418. package/build-module/details-summary/save.js +0 -16
  419. package/build-module/details-summary/save.js.map +0 -1
  420. package/build-module/query/hooks.js +0 -59
  421. package/build-module/query/hooks.js.map +0 -1
  422. package/build-module/utils/clean-empty-object.js +0 -28
  423. package/build-module/utils/clean-empty-object.js.map +0 -1
  424. package/build-style/details-summary/style-rtl.css +0 -91
  425. package/build-style/details-summary/style.css +0 -91
  426. package/src/details-content/block.json +0 -50
  427. package/src/details-content/edit.js +0 -29
  428. package/src/details-content/index.js +0 -23
  429. package/src/details-content/save.js +0 -12
  430. package/src/details-summary/block.json +0 -53
  431. package/src/details-summary/edit.js +0 -27
  432. package/src/details-summary/editor.scss +0 -3
  433. package/src/details-summary/index.js +0 -23
  434. package/src/details-summary/save.js +0 -13
  435. package/src/details-summary/style.scss +0 -3
  436. package/src/query/hooks.js +0 -53
  437. package/src/utils/clean-empty-object.js +0 -28
@@ -5,13 +5,13 @@ import {
5
5
  act,
6
6
  addBlock,
7
7
  getBlock,
8
- changeTextOfRichText,
9
- changeAndSelectTextOfRichText,
8
+ typeInRichText,
10
9
  fireEvent,
11
10
  getEditorHtml,
12
11
  initializeEditor,
13
12
  render,
14
13
  setupCoreBlocks,
14
+ waitFor,
15
15
  within,
16
16
  } from 'test/helpers';
17
17
  import Clipboard from '@react-native-clipboard/clipboard';
@@ -55,10 +55,10 @@ describe( 'Paragraph block', () => {
55
55
  fireEvent.press( paragraphBlock );
56
56
  const paragraphTextInput =
57
57
  within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
58
- changeAndSelectTextOfRichText(
58
+ typeInRichText(
59
59
  paragraphTextInput,
60
60
  'A quick brown fox jumps over the lazy dog.',
61
- { selectionStart: 2, selectionEnd: 7 }
61
+ { finalSelectionStart: 2, finalSelectionEnd: 7 }
62
62
  );
63
63
  fireEvent.press( screen.getByLabelText( 'Bold' ) );
64
64
 
@@ -80,10 +80,10 @@ describe( 'Paragraph block', () => {
80
80
  fireEvent.press( paragraphBlock );
81
81
  const paragraphTextInput =
82
82
  within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
83
- changeAndSelectTextOfRichText(
83
+ typeInRichText(
84
84
  paragraphTextInput,
85
85
  'A quick brown fox jumps over the lazy dog.',
86
- { selectionStart: 2, selectionEnd: 7 }
86
+ { finalSelectionStart: 2, finalSelectionEnd: 7 }
87
87
  );
88
88
  fireEvent.press( screen.getByLabelText( 'Italic' ) );
89
89
 
@@ -105,10 +105,10 @@ describe( 'Paragraph block', () => {
105
105
  fireEvent.press( paragraphBlock );
106
106
  const paragraphTextInput =
107
107
  within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
108
- changeAndSelectTextOfRichText(
108
+ typeInRichText(
109
109
  paragraphTextInput,
110
110
  'A quick brown fox jumps over the lazy dog.',
111
- { selectionStart: 2, selectionEnd: 7 }
111
+ { finalSelectionStart: 2, finalSelectionEnd: 7 }
112
112
  );
113
113
  fireEvent.press( screen.getByLabelText( 'Strikethrough' ) );
114
114
 
@@ -130,7 +130,7 @@ describe( 'Paragraph block', () => {
130
130
  fireEvent.press( paragraphBlock );
131
131
  const paragraphTextInput =
132
132
  within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
133
- changeTextOfRichText(
133
+ typeInRichText(
134
134
  paragraphTextInput,
135
135
  'A quick brown fox jumps over the lazy dog.'
136
136
  );
@@ -155,7 +155,7 @@ describe( 'Paragraph block', () => {
155
155
  fireEvent.press( paragraphBlock );
156
156
  const paragraphTextInput =
157
157
  within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
158
- changeTextOfRichText(
158
+ typeInRichText(
159
159
  paragraphTextInput,
160
160
  'A quick brown fox jumps over the lazy dog.'
161
161
  );
@@ -180,7 +180,7 @@ describe( 'Paragraph block', () => {
180
180
  fireEvent.press( paragraphBlock );
181
181
  const paragraphTextInput =
182
182
  within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
183
- changeTextOfRichText(
183
+ typeInRichText(
184
184
  paragraphTextInput,
185
185
  'A quick brown fox jumps over the lazy dog.'
186
186
  );
@@ -208,9 +208,9 @@ describe( 'Paragraph block', () => {
208
208
  const paragraphTextInput =
209
209
  within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
210
210
  const string = 'A quick brown fox jumps over the lazy dog.';
211
- changeAndSelectTextOfRichText( paragraphTextInput, string, {
212
- selectionStart: string.length / 2,
213
- selectionEnd: string.length / 2,
211
+ typeInRichText( paragraphTextInput, string, {
212
+ finalSelectionStart: string.length / 2,
213
+ finalSelectionEnd: string.length / 2,
214
214
  } );
215
215
  fireEvent( paragraphTextInput, 'onKeyDown', {
216
216
  nativeEvent: {},
@@ -279,12 +279,12 @@ describe( 'Paragraph block', () => {
279
279
  fireEvent.press( paragraphBlock );
280
280
  const paragraphTextInput =
281
281
  within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
282
- changeAndSelectTextOfRichText(
282
+ typeInRichText(
283
283
  paragraphTextInput,
284
284
  'A quick brown fox jumps over the lazy dog.',
285
285
  {
286
- selectionStart: 2,
287
- selectionEnd: 7,
286
+ finalSelectionStart: 2,
287
+ finalSelectionEnd: 7,
288
288
  }
289
289
  );
290
290
  // Await React Navigation: https://github.com/WordPress/gutenberg/issues/35685#issuecomment-961919931
@@ -325,12 +325,12 @@ describe( 'Paragraph block', () => {
325
325
  fireEvent.press( paragraphBlock );
326
326
  const paragraphTextInput =
327
327
  within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
328
- changeAndSelectTextOfRichText(
328
+ typeInRichText(
329
329
  paragraphTextInput,
330
330
  'A quick brown fox jumps over the lazy dog.',
331
331
  {
332
- selectionStart: 2,
333
- selectionEnd: 7,
332
+ finalSelectionStart: 2,
333
+ finalSelectionEnd: 7,
334
334
  }
335
335
  );
336
336
  // Await React Navigation: https://github.com/WordPress/gutenberg/issues/35685#issuecomment-961919931
@@ -362,14 +362,10 @@ describe( 'Paragraph block', () => {
362
362
  fireEvent.press( paragraphBlock );
363
363
  const paragraphTextInput =
364
364
  within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
365
- changeAndSelectTextOfRichText(
366
- paragraphTextInput,
367
- ' some text ',
368
- {
369
- selectionStart: 5,
370
- selectionEnd: 14,
371
- }
372
- );
365
+ typeInRichText( paragraphTextInput, ' some text ', {
366
+ finalSelectionStart: 5,
367
+ finalSelectionEnd: 14,
368
+ } );
373
369
  fireEvent.press( screen.getByLabelText( 'Italic' ) );
374
370
 
375
371
  // Assert
@@ -379,4 +375,268 @@ describe( 'Paragraph block', () => {
379
375
  <!-- /wp:paragraph -->"
380
376
  ` );
381
377
  } );
378
+
379
+ it( 'should set a text color', async () => {
380
+ // Arrange
381
+ const screen = await initializeEditor();
382
+ await addBlock( screen, 'Paragraph' );
383
+
384
+ // Act
385
+ const paragraphBlock = getBlock( screen, 'Paragraph' );
386
+ fireEvent.press( paragraphBlock );
387
+ const paragraphTextInput =
388
+ within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
389
+ typeInRichText(
390
+ paragraphTextInput,
391
+ 'A quick brown fox jumps over the lazy dog.'
392
+ );
393
+ // Open Block Settings.
394
+ fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
395
+
396
+ // Wait for Block Settings to be visible.
397
+ const blockSettingsModal = screen.getByTestId( 'block-settings-modal' );
398
+ await waitFor( () => blockSettingsModal.props.isVisible );
399
+
400
+ // Open Text color settings
401
+ fireEvent.press( screen.getByLabelText( 'Text, Default' ) );
402
+
403
+ // Tap one color
404
+ fireEvent.press( screen.getByLabelText( 'Pale pink' ) );
405
+
406
+ // Dismiss the Block Settings modal.
407
+ fireEvent( blockSettingsModal, 'backdropPress' );
408
+
409
+ // Assert
410
+ expect( getEditorHtml() ).toMatchInlineSnapshot( `
411
+ "<!-- wp:paragraph {"textColor":"pale-pink"} -->
412
+ <p class="has-pale-pink-color has-text-color">A quick brown fox jumps over the lazy dog.</p>
413
+ <!-- /wp:paragraph -->"
414
+ ` );
415
+ } );
416
+
417
+ it( 'should set a background color', async () => {
418
+ // Arrange
419
+ const screen = await initializeEditor();
420
+ await addBlock( screen, 'Paragraph' );
421
+
422
+ // Act
423
+ const paragraphBlock = getBlock( screen, 'Paragraph' );
424
+ fireEvent.press( paragraphBlock );
425
+ const paragraphTextInput =
426
+ within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
427
+ typeInRichText(
428
+ paragraphTextInput,
429
+ 'A quick brown fox jumps over the lazy dog.'
430
+ );
431
+ // Open Block Settings.
432
+ fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
433
+
434
+ // Wait for Block Settings to be visible.
435
+ const blockSettingsModal = screen.getByTestId( 'block-settings-modal' );
436
+ await waitFor( () => blockSettingsModal.props.isVisible );
437
+
438
+ // Open Background color settings
439
+ fireEvent.press( screen.getByLabelText( 'Background, Default' ) );
440
+
441
+ // Tap one color
442
+ fireEvent.press( screen.getByLabelText( 'Luminous vivid orange' ) );
443
+
444
+ // Dismiss the Block Settings modal.
445
+ fireEvent( blockSettingsModal, 'backdropPress' );
446
+
447
+ // Assert
448
+ expect( getEditorHtml() ).toMatchInlineSnapshot( `
449
+ "<!-- wp:paragraph {"backgroundColor":"luminous-vivid-orange"} -->
450
+ <p class="has-luminous-vivid-orange-background-color has-background">A quick brown fox jumps over the lazy dog.</p>
451
+ <!-- /wp:paragraph -->"
452
+ ` );
453
+ } );
454
+
455
+ it( 'should set a text and background color', async () => {
456
+ // Arrange
457
+ const screen = await initializeEditor();
458
+ await addBlock( screen, 'Paragraph' );
459
+
460
+ // Act
461
+ const paragraphBlock = getBlock( screen, 'Paragraph' );
462
+ fireEvent.press( paragraphBlock );
463
+ const paragraphTextInput =
464
+ within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
465
+ typeInRichText(
466
+ paragraphTextInput,
467
+ 'A quick brown fox jumps over the lazy dog.'
468
+ );
469
+ // Open Block Settings.
470
+ fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
471
+
472
+ // Wait for Block Settings to be visible.
473
+ const blockSettingsModal = screen.getByTestId( 'block-settings-modal' );
474
+ await waitFor( () => blockSettingsModal.props.isVisible );
475
+
476
+ // Open Text color settings
477
+ fireEvent.press( screen.getByLabelText( 'Text, Default' ) );
478
+
479
+ // Tap one color
480
+ fireEvent.press( screen.getByLabelText( 'White' ) );
481
+
482
+ // Go back to the settings menu
483
+ fireEvent.press( screen.getByLabelText( 'Go back' ) );
484
+
485
+ // Open Background color settings
486
+ fireEvent.press( screen.getByLabelText( 'Background, Default' ) );
487
+
488
+ // Tap one color
489
+ fireEvent.press( screen.getByLabelText( 'Luminous vivid orange' ) );
490
+
491
+ // Dismiss the Block Settings modal.
492
+ fireEvent( blockSettingsModal, 'backdropPress' );
493
+
494
+ // Assert
495
+ expect( getEditorHtml() ).toMatchInlineSnapshot( `
496
+ "<!-- wp:paragraph {"backgroundColor":"luminous-vivid-orange","textColor":"white"} -->
497
+ <p class="has-white-color has-luminous-vivid-orange-background-color has-text-color has-background">A quick brown fox jumps over the lazy dog.</p>
498
+ <!-- /wp:paragraph -->"
499
+ ` );
500
+ } );
501
+
502
+ it( 'should remove text and background colors', async () => {
503
+ // Arrange
504
+ const screen = await initializeEditor( {
505
+ initialHtml: `<!-- wp:paragraph {"backgroundColor":"luminous-vivid-orange","textColor":"white"} -->
506
+ <p class="has-white-color has-luminous-vivid-orange-background-color has-text-color has-background">A quick brown fox jumps over the lazy dog.</p>
507
+ <!-- /wp:paragraph -->`,
508
+ } );
509
+
510
+ // Act
511
+ const paragraphBlock = getBlock( screen, 'Paragraph' );
512
+ fireEvent.press( paragraphBlock );
513
+
514
+ // Open Block Settings.
515
+ fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
516
+
517
+ // Wait for Block Settings to be visible.
518
+ const blockSettingsModal = screen.getByTestId( 'block-settings-modal' );
519
+ await waitFor( () => blockSettingsModal.props.isVisible );
520
+
521
+ // Open Text color settings
522
+ fireEvent.press( screen.getByLabelText( 'Text. Empty' ) );
523
+
524
+ // Reset color
525
+ fireEvent.press( await screen.findByText( 'Reset' ) );
526
+
527
+ // Go back to the settings menu
528
+ fireEvent.press( screen.getByLabelText( 'Go back' ) );
529
+
530
+ // Open Background color settings
531
+ fireEvent.press( screen.getByLabelText( 'Background. Empty' ) );
532
+
533
+ // Reset color
534
+ fireEvent.press( await screen.findByText( 'Reset' ) );
535
+
536
+ // Dismiss the Block Settings modal.
537
+ fireEvent( blockSettingsModal, 'backdropPress' );
538
+
539
+ // Assert
540
+ expect( getEditorHtml() ).toMatchInlineSnapshot( `
541
+ "<!-- wp:paragraph -->
542
+ <p>A quick brown fox jumps over the lazy dog.</p>
543
+ <!-- /wp:paragraph -->"
544
+ ` );
545
+ } );
546
+
547
+ it( 'should not have a gradient background color option', async () => {
548
+ // Arrange
549
+ const screen = await initializeEditor();
550
+ await addBlock( screen, 'Paragraph' );
551
+
552
+ // Act
553
+ const paragraphBlock = getBlock( screen, 'Paragraph' );
554
+ fireEvent.press( paragraphBlock );
555
+ const paragraphTextInput =
556
+ within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
557
+ typeInRichText(
558
+ paragraphTextInput,
559
+ 'A quick brown fox jumps over the lazy dog.'
560
+ );
561
+ // Open Block Settings.
562
+ fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
563
+
564
+ // Wait for Block Settings to be visible.
565
+ const blockSettingsModal = screen.getByTestId( 'block-settings-modal' );
566
+ await waitFor( () => blockSettingsModal.props.isVisible );
567
+
568
+ // Open Background color settings
569
+ fireEvent.press( screen.getByLabelText( 'Background, Default' ) );
570
+
571
+ // Assert
572
+ const colorButton = screen.getByLabelText( 'Luminous vivid orange' );
573
+ expect( colorButton ).toBeDefined();
574
+
575
+ const gradientButton = screen.queryByLabelText( 'Gradient' );
576
+ expect( gradientButton ).toBeNull();
577
+ } );
578
+
579
+ it( 'should set a theme text color', async () => {
580
+ // Arrange
581
+ const screen = await initializeEditor( { withGlobalStyles: true } );
582
+ await addBlock( screen, 'Paragraph' );
583
+
584
+ // Act
585
+ const paragraphBlock = getBlock( screen, 'Paragraph' );
586
+ fireEvent.press( paragraphBlock );
587
+ const paragraphTextInput =
588
+ within( paragraphBlock ).getByPlaceholderText( 'Start writing…' );
589
+ typeInRichText(
590
+ paragraphTextInput,
591
+ 'A quick brown fox jumps over the lazy dog.'
592
+ );
593
+ // Open Block Settings.
594
+ fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
595
+
596
+ // Wait for Block Settings to be visible.
597
+ const blockSettingsModal = screen.getByTestId( 'block-settings-modal' );
598
+ await waitFor( () => blockSettingsModal.props.isVisible );
599
+
600
+ // Open Text color settings
601
+ fireEvent.press( screen.getByLabelText( 'Text, Default' ) );
602
+
603
+ // Tap one color
604
+ fireEvent.press( screen.getByLabelText( 'Tertiary' ) );
605
+
606
+ // Dismiss the Block Settings modal.
607
+ fireEvent( blockSettingsModal, 'backdropPress' );
608
+
609
+ // Assert
610
+ expect( getEditorHtml() ).toMatchInlineSnapshot( `
611
+ "<!-- wp:paragraph {"textColor":"tertiary"} -->
612
+ <p class="has-tertiary-color has-text-color">A quick brown fox jumps over the lazy dog.</p>
613
+ <!-- /wp:paragraph -->"
614
+ ` );
615
+ } );
616
+
617
+ it( 'should show the contrast check warning', async () => {
618
+ // Arrange
619
+ const screen = await initializeEditor( {
620
+ initialHtml: `<!-- wp:paragraph {"backgroundColor":"white","textColor":"white"} -->
621
+ <p class="has-white-color has-white-background-color has-text-color has-background">A quick brown fox jumps over the lazy dog.</p>
622
+ <!-- /wp:paragraph -->`,
623
+ } );
624
+
625
+ // Act
626
+ const paragraphBlock = getBlock( screen, 'Paragraph' );
627
+ fireEvent.press( paragraphBlock );
628
+
629
+ // Open Block Settings.
630
+ fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
631
+
632
+ // Wait for Block Settings to be visible.
633
+ const blockSettingsModal = screen.getByTestId( 'block-settings-modal' );
634
+ await waitFor( () => blockSettingsModal.props.isVisible );
635
+
636
+ // Assert
637
+ const contrastCheckElement = screen.getByText(
638
+ /This color combination/
639
+ );
640
+ expect( contrastCheckElement ).toBeDefined();
641
+ } );
382
642
  } );
@@ -69,7 +69,7 @@ function PostAuthorNameEdit( {
69
69
  />
70
70
  </BlockControls>
71
71
  <InspectorControls>
72
- <PanelBody title={ __( 'Link settings' ) }>
72
+ <PanelBody title={ __( 'Settings' ) }>
73
73
  <ToggleControl
74
74
  __nextHasNoMarginBottom
75
75
  label={ __( 'Link to author archive' ) }
@@ -37,6 +37,7 @@ export default function PostDateEdit( {
37
37
  const blockProps = useBlockProps( {
38
38
  className: classnames( {
39
39
  [ `has-text-align-${ textAlign }` ]: textAlign,
40
+ [ `wp-block-post-date__modified-date` ]: displayType === 'modified',
40
41
  } ),
41
42
  } );
42
43
 
@@ -175,6 +176,9 @@ export default function PostDateEdit( {
175
176
  } )
176
177
  }
177
178
  checked={ displayType === 'modified' }
179
+ help={ __(
180
+ 'Only shows if the post has been modified'
181
+ ) }
178
182
  />
179
183
  </PanelBody>
180
184
  </InspectorControls>
@@ -18,25 +18,34 @@ function render_block_core_post_date( $attributes, $content, $block ) {
18
18
  return '';
19
19
  }
20
20
 
21
- $post_ID = $block->context['postId'];
21
+ $post_ID = $block->context['postId'];
22
+ $formatted_date = get_the_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
23
+ $unformatted_date = esc_attr( get_the_date( 'c', $post_ID ) );
24
+ $classes = array();
22
25
 
23
- $classes = array();
24
26
  if ( isset( $attributes['textAlign'] ) ) {
25
27
  $classes[] = 'has-text-align-' . $attributes['textAlign'];
26
28
  }
27
29
  if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {
28
30
  $classes[] = 'has-link-color';
29
31
  }
30
- $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) );
31
32
 
33
+ /*
34
+ * If the "Display last modified date" setting is enabled,
35
+ * only display the modified date if it is later than the publishing date.
36
+ */
32
37
  if ( isset( $attributes['displayType'] ) && 'modified' === $attributes['displayType'] ) {
33
- $formatted_date = get_the_modified_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
34
- $unformatted_date = esc_attr( get_the_modified_date( 'c', $post_ID ) );
35
- } else {
36
- $formatted_date = get_the_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
37
- $unformatted_date = esc_attr( get_the_date( 'c', $post_ID ) );
38
+ if ( get_the_modified_date( 'Ymdhi', $post_ID ) > get_the_date( 'Ymdhi', $post_ID ) ) {
39
+ $formatted_date = get_the_modified_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
40
+ $unformatted_date = esc_attr( get_the_modified_date( 'c', $post_ID ) );
41
+ $classes[] = 'wp-block-post-date__modified-date';
42
+ } else {
43
+ return '';
44
+ }
38
45
  }
39
46
 
47
+ $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) );
48
+
40
49
  if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
41
50
  $formatted_date = sprintf( '<a href="%1s">%2s</a>', get_the_permalink( $post_ID ), $formatted_date );
42
51
  }
@@ -56,7 +56,7 @@ export default function PostExcerptEditor( {
56
56
  return true;
57
57
  }
58
58
  return !! select( coreStore ).getPostType( postType )?.supports
59
- .excerpt;
59
+ ?.excerpt;
60
60
  },
61
61
  [ postType ]
62
62
  );
@@ -110,7 +110,8 @@ export default function PostFeaturedImageEdit( {
110
110
  ) }
111
111
  withIllustration={ true }
112
112
  style={ {
113
- ...blockProps.style,
113
+ height: !! aspectRatio && '100%',
114
+ width: !! aspectRatio && '100%',
114
115
  ...borderProps.style,
115
116
  } }
116
117
  >
@@ -145,9 +146,9 @@ export default function PostFeaturedImageEdit( {
145
146
  label={
146
147
  postType?.labels.singular_name
147
148
  ? sprintf(
148
- // translators: %s: Name of the post type e.g: "post".
149
+ // translators: %s: Name of the post type e.g: "Page".
149
150
  __( 'Link to %s' ),
150
- postType.labels.singular_name.toLowerCase()
151
+ postType.labels.singular_name
151
152
  )
152
153
  : __( 'Link to post' )
153
154
  }
@@ -210,7 +211,7 @@ export default function PostFeaturedImageEdit( {
210
211
  const label = __( 'Add a featured image' );
211
212
  const imageStyles = {
212
213
  ...borderProps.style,
213
- height: ( !! aspectRatio && '100%' ) || height,
214
+ height: aspectRatio ? '100%' : height,
214
215
  width: !! aspectRatio && '100%',
215
216
  objectFit: !! ( height || aspectRatio ) && scale,
216
217
  };
@@ -45,6 +45,10 @@ const Overlay = ( {
45
45
  ...borderProps.style,
46
46
  };
47
47
 
48
+ if ( ! colorGradientSettings.hasColorsOrGradients ) {
49
+ return null;
50
+ }
51
+
48
52
  return (
49
53
  <>
50
54
  { !! dimRatio && (
@@ -64,8 +64,8 @@ function render_block_core_post_terms( $attributes, $content, $block ) {
64
64
  function register_block_core_post_terms() {
65
65
  $taxonomies = get_taxonomies(
66
66
  array(
67
- 'public' => true,
68
- 'show_in_rest' => true,
67
+ 'publicly_queryable' => true,
68
+ 'show_in_rest' => true,
69
69
  ),
70
70
  'objects'
71
71
  );
@@ -15,6 +15,7 @@ import {
15
15
  } from '@wordpress/block-editor';
16
16
  import { ToggleControl, TextControl, PanelBody } from '@wordpress/components';
17
17
  import { __ } from '@wordpress/i18n';
18
+ import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
18
19
  import { useEntityProp } from '@wordpress/core-data';
19
20
 
20
21
  /**
@@ -27,6 +28,7 @@ export default function PostTitleEdit( {
27
28
  attributes: { level, textAlign, isLink, rel, linkTarget },
28
29
  setAttributes,
29
30
  context: { postType, postId, queryId },
31
+ insertBlocksAfter,
30
32
  } ) {
31
33
  const TagName = 0 === level ? 'p' : 'h' + level;
32
34
  const isDescendentOfQueryLoop = Number.isFinite( queryId );
@@ -38,6 +40,9 @@ export default function PostTitleEdit( {
38
40
  postId
39
41
  );
40
42
  const [ link ] = useEntityProp( 'postType', postType, 'link', postId );
43
+ const onSplitAtEnd = () => {
44
+ insertBlocksAfter( createBlock( getDefaultBlockName() ) );
45
+ };
41
46
  const blockProps = useBlockProps( {
42
47
  className: classnames( {
43
48
  [ `has-text-align-${ textAlign }` ]: textAlign,
@@ -57,6 +62,7 @@ export default function PostTitleEdit( {
57
62
  value={ rawTitle }
58
63
  onChange={ setTitle }
59
64
  __experimentalVersion={ 2 }
65
+ __unstableOnSplitAtEnd={ onSplitAtEnd }
60
66
  { ...blockProps }
61
67
  />
62
68
  ) : (
@@ -82,6 +88,7 @@ export default function PostTitleEdit( {
82
88
  value={ rawTitle }
83
89
  onChange={ setTitle }
84
90
  __experimentalVersion={ 2 }
91
+ __unstableOnSplitAtEnd={ onSplitAtEnd }
85
92
  />
86
93
  </TagName>
87
94
  ) : (
@@ -116,7 +123,7 @@ export default function PostTitleEdit( {
116
123
  />
117
124
  </BlockControls>
118
125
  <InspectorControls>
119
- <PanelBody title={ __( 'Link settings' ) }>
126
+ <PanelBody title={ __( 'Settings' ) }>
120
127
  <ToggleControl
121
128
  __nextHasNoMarginBottom
122
129
  label={ __( 'Make title a link' ) }
@@ -28,12 +28,10 @@ export default function PreformattedEdit( props ) {
28
28
  ...( style?.fontSize && { fontSize: style.fontSize } ),
29
29
  ...( style?.color && { color: style.color } ),
30
30
  };
31
- const hasBaseColors =
32
- style?.baseColors && Object.entries( style.baseColors ).length !== 0;
33
31
  const containerStyles = [
34
32
  wpBlockPreformatted,
35
33
  style?.backgroundColor && { backgroundColor: style.backgroundColor },
36
- hasBaseColors &&
34
+ style?.baseColors?.color &&
37
35
  ! style?.backgroundColor &&
38
36
  styles[ 'wp-block-preformatted__no-background' ],
39
37
  ];
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import {
5
5
  addBlock,
6
- changeAndSelectTextOfRichText,
6
+ typeInRichText,
7
7
  fireEvent,
8
8
  getEditorHtml,
9
9
  initializeEditor,
@@ -64,24 +64,21 @@ describe( 'Preformatted', () => {
64
64
 
65
65
  // Act
66
66
  await addBlock( screen, 'Preformatted' );
67
- const verseTextInput = await screen.findByPlaceholderText(
67
+ const preformattedTextInput = await screen.findByPlaceholderText(
68
68
  'Write preformatted text…'
69
69
  );
70
- const string = 'A great statement.';
71
- changeAndSelectTextOfRichText( verseTextInput, string, {
72
- selectionStart: string.length,
73
- selectionEnd: string.length,
74
- } );
75
- fireEvent( verseTextInput, 'onKeyDown', {
70
+ typeInRichText( preformattedTextInput, 'A great statement.' );
71
+ fireEvent( preformattedTextInput, 'onKeyDown', {
76
72
  nativeEvent: {},
77
73
  preventDefault() {},
78
74
  keyCode: ENTER,
79
75
  } );
76
+ typeInRichText( preformattedTextInput, 'Again' );
80
77
 
81
78
  // Assert
82
79
  expect( getEditorHtml() ).toMatchInlineSnapshot( `
83
80
  "<!-- wp:preformatted -->
84
- <pre class="wp-block-preformatted">A great statement.<br></pre>
81
+ <pre class="wp-block-preformatted">A great statement.<br>Again</pre>
85
82
  <!-- /wp:preformatted -->"
86
83
  ` );
87
84
  } );