@wordpress/block-library 7.15.1-next.4d3b314fd5.0 → 7.17.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 (351) hide show
  1. package/CHANGELOG.md +4 -1
  2. package/build/archives/edit.js +1 -0
  3. package/build/archives/edit.js.map +1 -1
  4. package/build/code/utils.js +3 -3
  5. package/build/code/utils.js.map +1 -1
  6. package/build/comment-template/edit.js +40 -32
  7. package/build/comment-template/edit.js.map +1 -1
  8. package/build/comments/edit/placeholder.js +1 -4
  9. package/build/comments/edit/placeholder.js.map +1 -1
  10. package/build/comments/index.js +5 -1
  11. package/build/comments/index.js.map +1 -1
  12. package/build/comments-title/edit.js +18 -1
  13. package/build/comments-title/edit.js.map +1 -1
  14. package/build/cover/edit/index.js +2 -2
  15. package/build/cover/edit/index.js.map +1 -1
  16. package/build/cover/edit/use-cover-is-dark.js +8 -7
  17. package/build/cover/edit/use-cover-is-dark.js.map +1 -1
  18. package/build/embed/variations.js +1 -1
  19. package/build/embed/variations.js.map +1 -1
  20. package/build/gallery/transforms.js +3 -3
  21. package/build/gallery/transforms.js.map +1 -1
  22. package/build/gallery/v1/edit.js +1 -1
  23. package/build/gallery/v1/edit.js.map +1 -1
  24. package/build/group/edit.js +1 -1
  25. package/build/group/edit.js.map +1 -1
  26. package/build/image/image.js +34 -10
  27. package/build/image/image.js.map +1 -1
  28. package/build/image/transforms.js +1 -7
  29. package/build/image/transforms.js.map +1 -1
  30. package/build/list/transforms.js +9 -1
  31. package/build/list/transforms.js.map +1 -1
  32. package/build/list-item/edit.js +3 -2
  33. package/build/list-item/edit.js.map +1 -1
  34. package/build/list-item/edit.native.js +3 -2
  35. package/build/list-item/edit.native.js.map +1 -1
  36. package/build/list-item/hooks/use-merge.js +19 -22
  37. package/build/list-item/hooks/use-merge.js.map +1 -1
  38. package/build/list-item/hooks/use-outdent-list-item.js +19 -3
  39. package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
  40. package/build/list-item/index.js +14 -1
  41. package/build/list-item/index.js.map +1 -1
  42. package/build/list-item/utils.js +14 -1
  43. package/build/list-item/utils.js.map +1 -1
  44. package/build/navigation/edit/index.js +46 -33
  45. package/build/navigation/edit/index.js.map +1 -1
  46. package/build/navigation/edit/inner-blocks.js +3 -5
  47. package/build/navigation/edit/inner-blocks.js.map +1 -1
  48. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +25 -8
  49. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  50. package/build/navigation/edit/use-create-navigation-menu.js +1 -1
  51. package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
  52. package/build/navigation/index.js +4 -1
  53. package/build/navigation/index.js.map +1 -1
  54. package/build/navigation-link/edit.js +1 -1
  55. package/build/navigation-link/edit.js.map +1 -1
  56. package/build/page-list/index.js +1 -5
  57. package/build/page-list/index.js.map +1 -1
  58. package/build/paragraph/deprecated.js +49 -10
  59. package/build/paragraph/deprecated.js.map +1 -1
  60. package/build/paragraph/edit.js +22 -14
  61. package/build/paragraph/edit.js.map +1 -1
  62. package/build/paragraph/save.js +3 -1
  63. package/build/paragraph/save.js.map +1 -1
  64. package/build/pattern/edit.js +11 -4
  65. package/build/pattern/edit.js.map +1 -1
  66. package/build/post-author/edit.js +20 -2
  67. package/build/post-author/edit.js.map +1 -1
  68. package/build/post-author/index.js +8 -0
  69. package/build/post-author/index.js.map +1 -1
  70. package/build/post-comments-form/form.js +1 -2
  71. package/build/post-comments-form/form.js.map +1 -1
  72. package/build/post-featured-image/index.js +1 -1
  73. package/build/post-featured-image/overlay.js +2 -2
  74. package/build/post-featured-image/overlay.js.map +1 -1
  75. package/build/post-terms/index.js +4 -0
  76. package/build/post-terms/index.js.map +1 -1
  77. package/build/query/edit/inspector-controls/author-control.js +2 -1
  78. package/build/query/edit/inspector-controls/author-control.js.map +1 -1
  79. package/build/query/edit/inspector-controls/index.js +3 -3
  80. package/build/query/edit/inspector-controls/index.js.map +1 -1
  81. package/build/query/edit/inspector-controls/parent-control.js +2 -1
  82. package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
  83. package/build/query/edit/inspector-controls/taxonomy-controls.js +79 -103
  84. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  85. package/build/query/utils.js +1 -1
  86. package/build/query/utils.js.map +1 -1
  87. package/build/quote/index.js +0 -1
  88. package/build/quote/index.js.map +1 -1
  89. package/build/search/edit.js +2 -1
  90. package/build/search/edit.js.map +1 -1
  91. package/build/site-logo/edit.js +6 -9
  92. package/build/site-logo/edit.js.map +1 -1
  93. package/build/site-title/index.js +2 -1
  94. package/build/site-title/index.js.map +1 -1
  95. package/build/table/state.js +1 -1
  96. package/build/table/state.js.map +1 -1
  97. package/build/table-of-contents/edit.js +1 -4
  98. package/build/table-of-contents/edit.js.map +1 -1
  99. package/build/tag-cloud/edit.js +1 -1
  100. package/build/tag-cloud/edit.js.map +1 -1
  101. package/build/tag-cloud/index.js +8 -0
  102. package/build/tag-cloud/index.js.map +1 -1
  103. package/build/template-part/index.js +2 -2
  104. package/build/template-part/index.js.map +1 -1
  105. package/build/video/edit.js +13 -1
  106. package/build/video/edit.js.map +1 -1
  107. package/build-module/archives/edit.js +1 -0
  108. package/build-module/archives/edit.js.map +1 -1
  109. package/build-module/code/utils.js +3 -3
  110. package/build-module/code/utils.js.map +1 -1
  111. package/build-module/comment-template/edit.js +38 -30
  112. package/build-module/comment-template/edit.js.map +1 -1
  113. package/build-module/comments/edit/placeholder.js +1 -3
  114. package/build-module/comments/edit/placeholder.js.map +1 -1
  115. package/build-module/comments/index.js +5 -1
  116. package/build-module/comments/index.js.map +1 -1
  117. package/build-module/comments-title/edit.js +18 -2
  118. package/build-module/comments-title/edit.js.map +1 -1
  119. package/build-module/cover/edit/index.js +2 -2
  120. package/build-module/cover/edit/index.js.map +1 -1
  121. package/build-module/cover/edit/use-cover-is-dark.js +7 -7
  122. package/build-module/cover/edit/use-cover-is-dark.js.map +1 -1
  123. package/build-module/embed/variations.js +1 -1
  124. package/build-module/embed/variations.js.map +1 -1
  125. package/build-module/gallery/transforms.js +4 -4
  126. package/build-module/gallery/transforms.js.map +1 -1
  127. package/build-module/gallery/v1/edit.js +2 -2
  128. package/build-module/gallery/v1/edit.js.map +1 -1
  129. package/build-module/group/edit.js +1 -1
  130. package/build-module/group/edit.js.map +1 -1
  131. package/build-module/image/image.js +35 -11
  132. package/build-module/image/image.js.map +1 -1
  133. package/build-module/image/transforms.js +1 -6
  134. package/build-module/image/transforms.js.map +1 -1
  135. package/build-module/list/transforms.js +9 -1
  136. package/build-module/list/transforms.js.map +1 -1
  137. package/build-module/list-item/edit.js +3 -2
  138. package/build-module/list-item/edit.js.map +1 -1
  139. package/build-module/list-item/edit.native.js +3 -2
  140. package/build-module/list-item/edit.native.js.map +1 -1
  141. package/build-module/list-item/hooks/use-merge.js +19 -21
  142. package/build-module/list-item/hooks/use-merge.js.map +1 -1
  143. package/build-module/list-item/hooks/use-outdent-list-item.js +19 -3
  144. package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
  145. package/build-module/list-item/index.js +14 -1
  146. package/build-module/list-item/index.js.map +1 -1
  147. package/build-module/list-item/utils.js +14 -1
  148. package/build-module/list-item/utils.js.map +1 -1
  149. package/build-module/navigation/edit/index.js +46 -33
  150. package/build-module/navigation/edit/index.js.map +1 -1
  151. package/build-module/navigation/edit/inner-blocks.js +3 -5
  152. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  153. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +25 -8
  154. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  155. package/build-module/navigation/edit/use-create-navigation-menu.js +1 -1
  156. package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
  157. package/build-module/navigation/index.js +4 -1
  158. package/build-module/navigation/index.js.map +1 -1
  159. package/build-module/navigation-link/edit.js +1 -1
  160. package/build-module/navigation-link/edit.js.map +1 -1
  161. package/build-module/page-list/index.js +1 -5
  162. package/build-module/page-list/index.js.map +1 -1
  163. package/build-module/paragraph/deprecated.js +49 -11
  164. package/build-module/paragraph/deprecated.js.map +1 -1
  165. package/build-module/paragraph/edit.js +22 -13
  166. package/build-module/paragraph/edit.js.map +1 -1
  167. package/build-module/paragraph/save.js +2 -1
  168. package/build-module/paragraph/save.js.map +1 -1
  169. package/build-module/pattern/edit.js +10 -3
  170. package/build-module/pattern/edit.js.map +1 -1
  171. package/build-module/post-author/edit.js +21 -2
  172. package/build-module/post-author/edit.js.map +1 -1
  173. package/build-module/post-author/index.js +8 -0
  174. package/build-module/post-author/index.js.map +1 -1
  175. package/build-module/post-comments-form/form.js +2 -3
  176. package/build-module/post-comments-form/form.js.map +1 -1
  177. package/build-module/post-featured-image/index.js +1 -1
  178. package/build-module/post-featured-image/overlay.js +2 -2
  179. package/build-module/post-featured-image/overlay.js.map +1 -1
  180. package/build-module/post-terms/index.js +4 -0
  181. package/build-module/post-terms/index.js.map +1 -1
  182. package/build-module/query/edit/inspector-controls/author-control.js +2 -1
  183. package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
  184. package/build-module/query/edit/inspector-controls/index.js +5 -5
  185. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  186. package/build-module/query/edit/inspector-controls/parent-control.js +2 -1
  187. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
  188. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +81 -101
  189. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  190. package/build-module/query/utils.js +1 -1
  191. package/build-module/query/utils.js.map +1 -1
  192. package/build-module/quote/index.js +0 -1
  193. package/build-module/quote/index.js.map +1 -1
  194. package/build-module/search/edit.js +3 -2
  195. package/build-module/search/edit.js.map +1 -1
  196. package/build-module/site-logo/edit.js +6 -9
  197. package/build-module/site-logo/edit.js.map +1 -1
  198. package/build-module/site-title/index.js +2 -1
  199. package/build-module/site-title/index.js.map +1 -1
  200. package/build-module/table/state.js +2 -2
  201. package/build-module/table/state.js.map +1 -1
  202. package/build-module/table-of-contents/edit.js +1 -3
  203. package/build-module/table-of-contents/edit.js.map +1 -1
  204. package/build-module/tag-cloud/edit.js +1 -1
  205. package/build-module/tag-cloud/edit.js.map +1 -1
  206. package/build-module/tag-cloud/index.js +8 -0
  207. package/build-module/tag-cloud/index.js.map +1 -1
  208. package/build-module/template-part/index.js +2 -2
  209. package/build-module/template-part/index.js.map +1 -1
  210. package/build-module/video/edit.js +15 -3
  211. package/build-module/video/edit.js.map +1 -1
  212. package/build-style/archives/style-rtl.css +4 -0
  213. package/build-style/archives/style.css +4 -0
  214. package/build-style/code/style-rtl.css +3 -0
  215. package/build-style/code/style.css +3 -0
  216. package/build-style/comments/editor-rtl.css +1 -0
  217. package/build-style/comments/editor.css +1 -0
  218. package/build-style/comments/style-rtl.css +1 -0
  219. package/build-style/comments/style.css +1 -0
  220. package/build-style/cover/editor-rtl.css +4 -0
  221. package/build-style/cover/editor.css +4 -0
  222. package/build-style/editor-rtl.css +78 -46
  223. package/build-style/editor.css +78 -46
  224. package/build-style/group/editor-rtl.css +1 -0
  225. package/build-style/group/editor.css +1 -0
  226. package/build-style/image/editor-rtl.css +1 -1
  227. package/build-style/image/editor.css +1 -1
  228. package/build-style/navigation/editor-rtl.css +5 -0
  229. package/build-style/navigation/editor.css +5 -0
  230. package/build-style/navigation/style-rtl.css +3 -0
  231. package/build-style/navigation/style.css +3 -0
  232. package/build-style/paragraph/editor-rtl.css +0 -16
  233. package/build-style/paragraph/editor.css +0 -16
  234. package/build-style/paragraph/style-rtl.css +5 -0
  235. package/build-style/paragraph/style.css +5 -0
  236. package/build-style/post-featured-image/editor-rtl.css +39 -29
  237. package/build-style/post-featured-image/editor.css +39 -29
  238. package/build-style/post-terms/style-rtl.css +4 -1
  239. package/build-style/post-terms/style.css +4 -1
  240. package/build-style/site-logo/editor-rtl.css +1 -0
  241. package/build-style/site-logo/editor.css +1 -0
  242. package/build-style/site-title/editor-rtl.css +4 -0
  243. package/build-style/site-title/editor.css +4 -0
  244. package/build-style/site-title/style-rtl.css +79 -0
  245. package/build-style/site-title/style.css +79 -0
  246. package/build-style/style-rtl.css +27 -1
  247. package/build-style/style.css +27 -1
  248. package/build-style/tag-cloud/style-rtl.css +3 -0
  249. package/build-style/tag-cloud/style.css +3 -0
  250. package/build-style/video/editor-rtl.css +22 -0
  251. package/build-style/video/editor.css +22 -0
  252. package/package.json +28 -28
  253. package/src/archives/edit.js +1 -0
  254. package/src/archives/style.scss +5 -0
  255. package/src/avatar/index.php +1 -1
  256. package/src/categories/index.php +1 -1
  257. package/src/code/style.scss +12 -7
  258. package/src/code/test/__snapshots__/edit.native.js.snap +13 -0
  259. package/src/code/test/edit.native.js +46 -32
  260. package/src/code/utils.js +3 -3
  261. package/src/comment-author-name/index.php +1 -1
  262. package/src/comment-reply-link/index.php +1 -1
  263. package/src/comment-template/edit.js +47 -34
  264. package/src/comment-template/index.php +2 -3
  265. package/src/comments/block.json +5 -1
  266. package/src/comments/edit/placeholder.js +1 -7
  267. package/src/comments/style.scss +2 -0
  268. package/src/comments-title/edit.js +24 -1
  269. package/src/cover/edit/index.js +2 -7
  270. package/src/cover/edit/use-cover-is-dark.js +11 -11
  271. package/src/cover/editor.scss +7 -0
  272. package/src/cover/index.php +1 -1
  273. package/src/embed/variations.js +1 -1
  274. package/src/gallery/transforms.js +8 -5
  275. package/src/gallery/v1/edit.js +2 -2
  276. package/src/group/edit.js +1 -1
  277. package/src/group/editor.scss +1 -0
  278. package/src/image/editor.scss +4 -1
  279. package/src/image/image.js +59 -29
  280. package/src/image/transforms.js +1 -7
  281. package/src/latest-posts/index.php +1 -1
  282. package/src/list/test/edit.native.js +102 -3
  283. package/src/list/transforms.js +11 -0
  284. package/src/list-item/block.json +14 -1
  285. package/src/list-item/edit.js +2 -1
  286. package/src/list-item/edit.native.js +2 -1
  287. package/src/list-item/hooks/use-merge.js +4 -23
  288. package/src/list-item/hooks/use-outdent-list-item.js +6 -2
  289. package/src/navigation/block.json +4 -1
  290. package/src/navigation/edit/index.js +60 -32
  291. package/src/navigation/edit/inner-blocks.js +2 -5
  292. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +32 -5
  293. package/src/navigation/edit/use-create-navigation-menu.js +2 -5
  294. package/src/navigation/editor.scss +7 -0
  295. package/src/navigation/index.php +103 -6
  296. package/src/navigation/style.scss +8 -0
  297. package/src/navigation-link/edit.js +1 -1
  298. package/src/navigation-link/index.php +8 -1
  299. package/src/navigation-submenu/index.php +8 -1
  300. package/src/page-list/block.json +1 -5
  301. package/src/page-list/index.php +10 -8
  302. package/src/paragraph/deprecated.js +36 -0
  303. package/src/paragraph/edit.js +24 -22
  304. package/src/paragraph/editor.scss +0 -20
  305. package/src/paragraph/save.js +5 -1
  306. package/src/paragraph/style.scss +5 -0
  307. package/src/pattern/edit.js +10 -3
  308. package/src/post-author/block.json +8 -0
  309. package/src/post-author/edit.js +29 -3
  310. package/src/post-author/index.php +7 -1
  311. package/src/post-comments-form/form.js +2 -3
  312. package/src/post-featured-image/block.json +1 -1
  313. package/src/post-featured-image/editor.scss +79 -72
  314. package/src/post-featured-image/index.php +18 -24
  315. package/src/post-featured-image/overlay.js +17 -14
  316. package/src/post-terms/block.json +4 -0
  317. package/src/post-terms/style.scss +7 -2
  318. package/src/query/edit/inspector-controls/author-control.js +1 -0
  319. package/src/query/edit/inspector-controls/index.js +5 -7
  320. package/src/query/edit/inspector-controls/parent-control.js +1 -0
  321. package/src/query/edit/inspector-controls/taxonomy-controls.js +82 -86
  322. package/src/query/utils.js +1 -1
  323. package/src/quote/block.json +0 -1
  324. package/src/rss/index.php +3 -3
  325. package/src/search/edit.js +6 -1
  326. package/src/search/index.php +21 -13
  327. package/src/site-logo/edit.js +10 -8
  328. package/src/site-logo/editor.scss +1 -0
  329. package/src/site-title/block.json +2 -1
  330. package/src/site-title/editor.scss +6 -0
  331. package/src/site-title/style.scss +5 -0
  332. package/src/style.scss +1 -0
  333. package/src/table/state.js +2 -2
  334. package/src/table-of-contents/edit.js +1 -3
  335. package/src/tag-cloud/block.json +8 -0
  336. package/src/tag-cloud/edit.js +1 -1
  337. package/src/tag-cloud/style.scss +3 -0
  338. package/src/template-part/index.js +2 -2
  339. package/src/template-part/index.php +4 -0
  340. package/src/video/edit.js +19 -0
  341. package/src/video/editor.scss +37 -0
  342. package/build/navigation-submenu/view.js +0 -56
  343. package/build/navigation-submenu/view.js.map +0 -1
  344. package/build/paragraph/drop-zone.js +0 -99
  345. package/build/paragraph/drop-zone.js.map +0 -1
  346. package/build-module/navigation-submenu/view.js +0 -54
  347. package/build-module/navigation-submenu/view.js.map +0 -1
  348. package/build-module/paragraph/drop-zone.js +0 -88
  349. package/build-module/paragraph/drop-zone.js.map +0 -1
  350. package/src/navigation-submenu/view.js +0 -67
  351. package/src/paragraph/drop-zone.js +0 -105
@@ -74,6 +74,28 @@
74
74
  /**
75
75
  * Reset the WP Admin page styles for Gutenberg-like pages.
76
76
  */
77
+ .wp-block-video.wp-block-video.is-selected .components-placeholder {
78
+ color: #1e1e1e;
79
+ background-color: #fff;
80
+ box-shadow: inset 0 0 0 1px #1e1e1e;
81
+ border: none;
82
+ border-radius: 2px;
83
+ }
84
+ .wp-block-video.wp-block-video.is-selected .components-placeholder > svg {
85
+ opacity: 0;
86
+ }
87
+ .wp-block-video.wp-block-video.is-selected .components-placeholder .components-placeholder__illustration {
88
+ display: none;
89
+ }
90
+ .wp-block-video.wp-block-video.is-selected .components-placeholder::before {
91
+ opacity: 0;
92
+ }
93
+ .wp-block-video.wp-block-video .components-placeholder__label,
94
+ .wp-block-video.wp-block-video .components-placeholder__instructions,
95
+ .wp-block-video.wp-block-video .components-button {
96
+ transition: none;
97
+ }
98
+
77
99
  .wp-block[data-align=center] > .wp-block-video {
78
100
  text-align: center;
79
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "7.15.1-next.4d3b314fd5.0",
3
+ "version": "7.17.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,32 +31,32 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.16.0",
34
- "@wordpress/a11y": "^3.18.1-next.4d3b314fd5.0",
35
- "@wordpress/api-fetch": "^6.15.1-next.4d3b314fd5.0",
36
- "@wordpress/autop": "^3.18.1-next.4d3b314fd5.0",
37
- "@wordpress/blob": "^3.18.1-next.4d3b314fd5.0",
38
- "@wordpress/block-editor": "^10.1.1-next.4d3b314fd5.0",
39
- "@wordpress/blocks": "^11.18.1-next.4d3b314fd5.0",
40
- "@wordpress/components": "^21.1.2-next.4d3b314fd5.0",
41
- "@wordpress/compose": "^5.16.1-next.4d3b314fd5.0",
42
- "@wordpress/core-data": "^5.1.1-next.4d3b314fd5.0",
43
- "@wordpress/data": "^7.2.1-next.4d3b314fd5.0",
44
- "@wordpress/date": "^4.18.1-next.4d3b314fd5.0",
45
- "@wordpress/deprecated": "^3.18.1-next.4d3b314fd5.0",
46
- "@wordpress/dom": "^3.18.1-next.4d3b314fd5.0",
47
- "@wordpress/element": "^4.16.1-next.4d3b314fd5.0",
48
- "@wordpress/hooks": "^3.18.1-next.4d3b314fd5.0",
49
- "@wordpress/html-entities": "^3.18.1-next.4d3b314fd5.0",
50
- "@wordpress/i18n": "^4.18.1-next.4d3b314fd5.0",
51
- "@wordpress/icons": "^9.9.1-next.4d3b314fd5.0",
52
- "@wordpress/keycodes": "^3.18.1-next.4d3b314fd5.0",
53
- "@wordpress/notices": "^3.18.1-next.4d3b314fd5.0",
54
- "@wordpress/primitives": "^3.16.1-next.4d3b314fd5.0",
55
- "@wordpress/reusable-blocks": "^3.16.1-next.4d3b314fd5.0",
56
- "@wordpress/rich-text": "^5.16.1-next.4d3b314fd5.0",
57
- "@wordpress/server-side-render": "^3.16.1-next.4d3b314fd5.0",
58
- "@wordpress/url": "^3.19.1-next.4d3b314fd5.0",
59
- "@wordpress/viewport": "^4.16.1-next.4d3b314fd5.0",
34
+ "@wordpress/a11y": "^3.20.0",
35
+ "@wordpress/api-fetch": "^6.17.0",
36
+ "@wordpress/autop": "^3.20.0",
37
+ "@wordpress/blob": "^3.20.0",
38
+ "@wordpress/block-editor": "^10.3.0",
39
+ "@wordpress/blocks": "^11.19.0",
40
+ "@wordpress/components": "^21.3.0",
41
+ "@wordpress/compose": "^5.18.0",
42
+ "@wordpress/core-data": "^5.3.0",
43
+ "@wordpress/data": "^7.4.0",
44
+ "@wordpress/date": "^4.20.0",
45
+ "@wordpress/deprecated": "^3.20.0",
46
+ "@wordpress/dom": "^3.20.0",
47
+ "@wordpress/element": "^4.18.0",
48
+ "@wordpress/hooks": "^3.20.0",
49
+ "@wordpress/html-entities": "^3.20.0",
50
+ "@wordpress/i18n": "^4.20.0",
51
+ "@wordpress/icons": "^9.11.0",
52
+ "@wordpress/keycodes": "^3.20.0",
53
+ "@wordpress/notices": "^3.20.0",
54
+ "@wordpress/primitives": "^3.18.0",
55
+ "@wordpress/reusable-blocks": "^3.18.0",
56
+ "@wordpress/rich-text": "^5.18.0",
57
+ "@wordpress/server-side-render": "^3.18.0",
58
+ "@wordpress/url": "^3.21.0",
59
+ "@wordpress/viewport": "^4.18.0",
60
60
  "change-case": "^4.1.2",
61
61
  "classnames": "^2.3.1",
62
62
  "colord": "^2.7.0",
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "25054766423cb49d959eb656c2533530073ff5c2"
76
+ "gitHead": "a2ff0e6471c88436dad0287beb88d1729aa6f5dd"
77
77
  }
@@ -66,6 +66,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
66
66
  <Disabled>
67
67
  <ServerSideRender
68
68
  block="core/archives"
69
+ skipBlockSupportAttributes
69
70
  attributes={ attributes }
70
71
  />
71
72
  </Disabled>
@@ -1,3 +1,8 @@
1
+ .wp-block-archives {
2
+ // This block has customizable padding, border-box makes that more predictable.
3
+ box-sizing: border-box;
4
+ }
5
+
1
6
  .wp-block-archives-dropdown {
2
7
  label {
3
8
  display: block;
@@ -127,7 +127,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
127
127
  $label = 'aria-label="' . sprintf( esc_attr__( '(%s website link, opens in a new tab)' ), $comment->comment_author ) . '"';
128
128
  }
129
129
  // translators: %1$s: Comment Author website link. %2$s: Link target. %3$s Aria label. %4$s Avatar image.
130
- $avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', $comment->comment_author_url, esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
130
+ $avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', esc_url( $comment->comment_author_url ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
131
131
  }
132
132
  return sprintf( '<div %1s>%2s</div>', $wrapper_attributes, $avatar_block );
133
133
  }
@@ -14,7 +14,7 @@
14
14
  */
15
15
  function render_block_core_categories( $attributes ) {
16
16
  static $block_id = 0;
17
- $block_id++;
17
+ ++$block_id;
18
18
 
19
19
  $args = array(
20
20
  'echo' => false,
@@ -1,8 +1,13 @@
1
- // Provide a minimum of overflow handling and ensure the code markup inherits
2
- // the font-family set on pre.
3
- .wp-block-code code {
4
- display: block;
5
- font-family: inherit;
6
- overflow-wrap: break-word;
7
- white-space: pre-wrap;
1
+ .wp-block-code {
2
+ // This block has customizable padding, border-box makes that more predictable.
3
+ box-sizing: border-box;
4
+
5
+ // Provide a minimum of overflow handling and ensure the code markup inherits
6
+ // the font-family set on pre.
7
+ code {
8
+ display: block;
9
+ font-family: inherit;
10
+ overflow-wrap: break-word;
11
+ white-space: pre-wrap;
12
+ }
8
13
  }
@@ -0,0 +1,13 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Code renders given text without crashing 1`] = `
4
+ "<!-- wp:code -->
5
+ <pre class=\\"wp-block-code\\"><code>Sample text</code></pre>
6
+ <!-- /wp:code -->"
7
+ `;
8
+
9
+ exports[`Code renders without crashing 1`] = `
10
+ "<!-- wp:code -->
11
+ <pre class=\\"wp-block-code\\"><code></code></pre>
12
+ <!-- /wp:code -->"
13
+ `;
@@ -1,51 +1,65 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import renderer from 'react-test-renderer';
5
- import { TextInput } from 'react-native';
4
+ import {
5
+ fireEvent,
6
+ getEditorHtml,
7
+ initializeEditor,
8
+ addBlock,
9
+ getBlock,
10
+ } from 'test/helpers';
6
11
 
7
12
  /**
8
13
  * WordPress dependencies
9
14
  */
10
- import { BlockEdit } from '@wordpress/block-editor';
11
- import { registerBlockType, unregisterBlockType } from '@wordpress/blocks';
12
-
13
- /**
14
- * Internal dependencies
15
- */
16
- import { metadata, settings, name } from '../index';
17
-
18
- const Code = ( { clientId, ...props } ) => (
19
- <BlockEdit name={ name } clientId={ clientId || 0 } { ...props } />
20
- );
15
+ import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
16
+ import { registerCoreBlocks } from '@wordpress/block-library';
21
17
 
22
18
  describe( 'Code', () => {
23
19
  beforeAll( () => {
24
- registerBlockType( name, {
25
- ...metadata,
26
- ...settings,
27
- } );
20
+ // Register all core blocks
21
+ registerCoreBlocks();
28
22
  } );
29
23
 
30
24
  afterAll( () => {
31
- unregisterBlockType( name );
25
+ // Clean up registered blocks
26
+ getBlockTypes().forEach( ( block ) => {
27
+ unregisterBlockType( block.name );
28
+ } );
32
29
  } );
33
30
 
34
- it( 'renders without crashing', () => {
35
- const component = renderer.create(
36
- <Code attributes={ { content: '' } } />
37
- );
38
- const rendered = component.toJSON();
39
- expect( rendered ).toBeTruthy();
31
+ it( 'renders without crashing', async () => {
32
+ const screen = await initializeEditor();
33
+
34
+ // Add block
35
+ await addBlock( screen, 'Code' );
36
+
37
+ // Get block
38
+ const codeBlock = await getBlock( screen, 'Code' );
39
+ expect( codeBlock ).toBeVisible();
40
+
41
+ expect( getEditorHtml() ).toMatchSnapshot();
40
42
  } );
41
43
 
42
- it( 'renders given text without crashing', () => {
43
- const component = renderer.create(
44
- <Code attributes={ { content: 'sample text' } } />
45
- );
46
- const testInstance = component.root;
47
- const textInput = testInstance.findByType( TextInput );
48
- expect( textInput ).toBeTruthy();
49
- expect( textInput.props.value ).toBe( 'sample text' );
44
+ it( 'renders given text without crashing', async () => {
45
+ const initialHtml = `<!-- wp:code -->
46
+ <pre class="wp-block-code"><code>Sample text</code></pre>
47
+ <!-- /wp:code -->`;
48
+
49
+ const screen = await initializeEditor( {
50
+ initialHtml,
51
+ } );
52
+ const { getByDisplayValue } = screen;
53
+
54
+ // Get block
55
+ const codeBlock = await getBlock( screen, 'Code' );
56
+ expect( codeBlock ).toBeVisible();
57
+ fireEvent.press( codeBlock );
58
+
59
+ // Get initial text
60
+ const codeBlockText = getByDisplayValue( 'Sample text' );
61
+ expect( codeBlockText ).toBeVisible();
62
+
63
+ expect( getEditorHtml() ).toMatchSnapshot();
50
64
  } );
51
65
  } );
package/src/code/utils.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * External dependencies
2
+ * WordPress dependencies
3
3
  */
4
- import { flow } from 'lodash';
4
+ import { pipe } from '@wordpress/compose';
5
5
 
6
6
  /**
7
7
  * Escapes ampersands, shortcodes, and links.
@@ -10,7 +10,7 @@ import { flow } from 'lodash';
10
10
  * @return {string} The given content with some characters escaped.
11
11
  */
12
12
  export function escape( content ) {
13
- return flow(
13
+ return pipe(
14
14
  escapeOpeningSquareBrackets,
15
15
  escapeProtocolInIsolatedUrls
16
16
  )( content || '' );
@@ -34,7 +34,7 @@ function render_block_core_comment_author_name( $attributes, $content, $block )
34
34
  $comment_author = get_comment_author( $comment );
35
35
  $link = get_comment_author_url( $comment );
36
36
 
37
- if ( ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) {
37
+ if ( ! empty( $link ) && ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) {
38
38
  $comment_author = sprintf( '<a rel="external nofollow ugc" href="%1s" target="%2s" >%3s</a>', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author );
39
39
  }
40
40
  if ( '0' === $comment->comment_approved && ! $show_pending_links ) {
@@ -34,7 +34,7 @@ function render_block_core_comment_reply_link( $attributes, $content, $block ) {
34
34
 
35
35
  // Compute comment's depth iterating over its ancestors.
36
36
  while ( ! empty( $parent_id ) ) {
37
- $depth++;
37
+ ++$depth;
38
38
  $parent_id = get_comment( $parent_id )->comment_parent;
39
39
  }
40
40
 
@@ -37,6 +37,7 @@ const TEMPLATE = [
37
37
  *
38
38
  * @param {Object} settings Discussion Settings.
39
39
  * @param {number} [settings.perPage] - Comments per page setting or block attribute.
40
+ * @param {boolean} [settings.pageComments] - Enable break comments into pages setting.
40
41
  * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting.
41
42
  * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments.
42
43
  *
@@ -45,42 +46,53 @@ const TEMPLATE = [
45
46
  */
46
47
  const getCommentsPlaceholder = ( {
47
48
  perPage,
49
+ pageComments,
48
50
  threadComments,
49
51
  threadCommentsDepth,
50
52
  } ) => {
51
- // In case that `threadCommentsDepth` is falsy, we default to a somewhat
52
- // arbitrary value of 3.
53
- // In case that the value is set but larger than 3 we truncate it to 3.
54
- const commentsDepth = Math.min( threadCommentsDepth || 3, 3 );
53
+ // Limit commentsDepth to 3
54
+ const commentsDepth = ! threadComments
55
+ ? 1
56
+ : Math.min( threadCommentsDepth, 3 );
55
57
 
56
- // We set a limit in order not to overload the editor of empty comments.
57
- const defaultCommentsToShow =
58
- perPage <= commentsDepth ? perPage : commentsDepth;
59
- if ( ! threadComments || defaultCommentsToShow === 1 ) {
60
- // If displaying threaded comments is disabled, we only show one comment
61
- // A commentId is negative in order to avoid conflicts with the actual comments.
62
- return [ { commentId: -1, children: [] } ];
63
- } else if ( defaultCommentsToShow === 2 ) {
64
- return [
65
- {
66
- commentId: -1,
67
- children: [ { commentId: -2, children: [] } ],
68
- },
69
- ];
70
- }
58
+ const buildChildrenComment = ( commentsLevel ) => {
59
+ // Render children comments until commentsDepth is reached
60
+ if ( commentsLevel < commentsDepth ) {
61
+ const nextLevel = commentsLevel + 1;
71
62
 
72
- // In case that the value is set but larger than 3 we truncate it to 3.
73
- return [
74
- {
75
- commentId: -1,
76
- children: [
63
+ return [
77
64
  {
78
- commentId: -2,
79
- children: [ { commentId: -3, children: [] } ],
65
+ commentId: -( commentsLevel + 3 ),
66
+ children: buildChildrenComment( nextLevel ),
80
67
  },
81
- ],
82
- },
68
+ ];
69
+ }
70
+ return [];
71
+ };
72
+
73
+ // Add the first comment and its children
74
+ const placeholderComments = [
75
+ { commentId: -1, children: buildChildrenComment( 1 ) },
83
76
  ];
77
+
78
+ // Add a second comment unless the break comments setting is active and set to less than 2, and there is one nested comment max
79
+ if ( ( ! pageComments || perPage >= 2 ) && commentsDepth < 3 ) {
80
+ placeholderComments.push( {
81
+ commentId: -2,
82
+ children: [],
83
+ } );
84
+ }
85
+
86
+ // Add a third comment unless the break comments setting is active and set to less than 3, and there aren't nested comments
87
+ if ( ( ! pageComments || perPage >= 3 ) && commentsDepth < 2 ) {
88
+ placeholderComments.push( {
89
+ commentId: -3,
90
+ children: [],
91
+ } );
92
+ }
93
+
94
+ // In case that the value is set but larger than 3 we truncate it to 3.
95
+ return placeholderComments;
84
96
  };
85
97
 
86
98
  /**
@@ -114,12 +126,11 @@ function CommentTemplateInnerBlocks( {
114
126
  : null }
115
127
 
116
128
  { /* To avoid flicker when switching active block contexts, a preview
117
- is ALWAYS rendered and the preview for the active block is hidden.
118
- This ensures that when switching the active block, the component is not
119
- mounted again but rather it only toggles the `isHidden` prop.
120
-
121
- The same strategy is used for preventing the flicker in the Post Template
122
- block. */ }
129
+ is ALWAYS rendered and the preview for the active block is hidden.
130
+ This ensures that when switching the active block, the component is not
131
+ mounted again but rather it only toggles the `isHidden` prop.
132
+ The same strategy is used for preventing the flicker in the Post Template
133
+ block. */ }
123
134
  <MemoizedCommentTemplatePreview
124
135
  blocks={ blocks }
125
136
  commentId={ comment.commentId }
@@ -239,6 +250,7 @@ export default function CommentTemplateEdit( {
239
250
  threadCommentsDepth,
240
251
  threadComments,
241
252
  commentsPerPage,
253
+ pageComments,
242
254
  } = useSelect( ( select ) => {
243
255
  const { getSettings } = select( blockEditorStore );
244
256
  return getSettings().__experimentalDiscussionSettings;
@@ -282,6 +294,7 @@ export default function CommentTemplateEdit( {
282
294
  if ( ! postId ) {
283
295
  commentTree = getCommentsPlaceholder( {
284
296
  perPage: commentsPerPage,
297
+ pageComments,
285
298
  threadComments,
286
299
  threadCommentsDepth,
287
300
  } );
@@ -50,13 +50,13 @@ function block_core_comment_template_render_comments( $comments, $block ) {
50
50
  // comments.
51
51
  if ( ! empty( $children ) && ! empty( $thread_comments ) ) {
52
52
  if ( $comment_depth < $thread_comments_depth ) {
53
- $comment_depth += 1;
53
+ ++$comment_depth;
54
54
  $inner_content = block_core_comment_template_render_comments(
55
55
  $children,
56
56
  $block
57
57
  );
58
58
  $block_content .= sprintf( '<ol>%1$s</ol>', $inner_content );
59
- $comment_depth -= 1;
59
+ --$comment_depth;
60
60
  } else {
61
61
  $inner_content = block_core_comment_template_render_comments(
62
62
  $children,
@@ -70,7 +70,6 @@ function block_core_comment_template_render_comments( $comments, $block ) {
70
70
  }
71
71
 
72
72
  return $content;
73
-
74
73
  }
75
74
 
76
75
  /**
@@ -18,7 +18,6 @@
18
18
  },
19
19
  "supports": {
20
20
  "align": [ "wide", "full" ],
21
- "html": false,
22
21
  "color": {
23
22
  "gradients": true,
24
23
  "link": true,
@@ -28,6 +27,11 @@
28
27
  "link": true
29
28
  }
30
29
  },
30
+ "html": false,
31
+ "spacing": {
32
+ "margin": true,
33
+ "padding": true
34
+ },
31
35
  "typography": {
32
36
  "fontSize": true,
33
37
  "lineHeight": true,
@@ -5,7 +5,6 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
5
5
  import { __, sprintf } from '@wordpress/i18n';
6
6
  import { useSelect } from '@wordpress/data';
7
7
  import { useEntityProp } from '@wordpress/core-data';
8
- import { useDisabled } from '@wordpress/compose';
9
8
 
10
9
  /**
11
10
  * Internal dependencies
@@ -22,13 +21,8 @@ export default function PostCommentsPlaceholder( { postType, postId } ) {
22
21
  .__experimentalDiscussionSettings
23
22
  );
24
23
 
25
- const disabledRef = useDisabled();
26
-
27
24
  return (
28
- <div
29
- className="wp-block-comments__legacy-placeholder"
30
- ref={ disabledRef }
31
- >
25
+ <div className="wp-block-comments__legacy-placeholder" inert="true">
32
26
  <h3>
33
27
  {
34
28
  /* translators: %s: Post title. */
@@ -1,5 +1,7 @@
1
1
  /* Styles for backwards compatibility with the legacy `post-comments` block */
2
2
  .wp-block-post-comments {
3
+ // This block has customizable padding, border-box makes that more predictable.
4
+ box-sizing: border-box;
3
5
 
4
6
  /* utility classes */
5
7
  .alignleft {
@@ -11,11 +11,13 @@ import {
11
11
  BlockControls,
12
12
  useBlockProps,
13
13
  InspectorControls,
14
+ store as blockEditorStore,
14
15
  } from '@wordpress/block-editor';
15
16
  import { __, _n, sprintf } from '@wordpress/i18n';
16
17
  import { useEntityProp } from '@wordpress/core-data';
17
18
  import { PanelBody, ToggleControl } from '@wordpress/components';
18
19
  import { useState, useEffect } from '@wordpress/element';
20
+ import { useSelect } from '@wordpress/data';
19
21
  import apiFetch from '@wordpress/api-fetch';
20
22
  import { addQueryArgs } from '@wordpress/url';
21
23
 
@@ -39,9 +41,30 @@ export default function Edit( {
39
41
  } ),
40
42
  } );
41
43
 
44
+ const {
45
+ threadCommentsDepth,
46
+ threadComments,
47
+ commentsPerPage,
48
+ pageComments,
49
+ } = useSelect( ( select ) => {
50
+ const { getSettings } = select( blockEditorStore );
51
+ return getSettings().__experimentalDiscussionSettings;
52
+ } );
53
+
42
54
  useEffect( () => {
43
55
  if ( isSiteEditor ) {
44
- setCommentsCount( 3 );
56
+ // Match the number of comments that will be shown in the comment-template/edit.js placeholder
57
+
58
+ const nestedCommentsNumber = threadComments
59
+ ? Math.min( threadCommentsDepth, 3 ) - 1
60
+ : 0;
61
+ const topLevelCommentsNumber = pageComments ? commentsPerPage : 3;
62
+
63
+ const commentsNumber =
64
+ parseInt( nestedCommentsNumber ) +
65
+ parseInt( topLevelCommentsNumber );
66
+
67
+ setCommentsCount( Math.min( commentsNumber, 3 ) );
45
68
  return;
46
69
  }
47
70
  const currentPostId = postId;
@@ -131,13 +131,7 @@ function CoverEdit( {
131
131
  createErrorNotice( message, { type: 'snackbar' } );
132
132
  };
133
133
 
134
- const mediaElement = useRef();
135
- const isCoverDark = useCoverIsDark(
136
- url,
137
- dimRatio,
138
- overlayColor.color,
139
- mediaElement
140
- );
134
+ const isCoverDark = useCoverIsDark( url, dimRatio, overlayColor.color );
141
135
 
142
136
  useEffect( () => {
143
137
  // This side-effect should not create an undo level.
@@ -201,6 +195,7 @@ function CoverEdit( {
201
195
  }
202
196
  );
203
197
 
198
+ const mediaElement = useRef();
204
199
  const currentSettings = {
205
200
  isVideoBackground,
206
201
  isImageBackground,
@@ -8,6 +8,7 @@ import { colord } from 'colord';
8
8
  * WordPress dependencies
9
9
  */
10
10
  import { useEffect, useState } from '@wordpress/element';
11
+ import { applyFilters } from '@wordpress/hooks';
11
12
 
12
13
  function retrieveFastAverageColor() {
13
14
  if ( ! retrieveFastAverageColor.fastAverageColor ) {
@@ -25,34 +26,33 @@ function retrieveFastAverageColor() {
25
26
  * color are set, dimRatio is used to decide what is used
26
27
  * for background darkness checking purposes.
27
28
  * @param {?string} overlayColor String containing the overlay color value if one exists.
28
- * @param {?Object} elementRef If a media background is set, elementRef should contain a reference to a
29
- * dom element that renders that media.
30
29
  *
31
30
  * @return {boolean} True if the cover background is considered "dark" and false otherwise.
32
31
  */
33
- export default function useCoverIsDark(
34
- url,
35
- dimRatio = 50,
36
- overlayColor,
37
- elementRef
38
- ) {
32
+ export default function useCoverIsDark( url, dimRatio = 50, overlayColor ) {
39
33
  const [ isDark, setIsDark ] = useState( false );
40
34
  useEffect( () => {
41
35
  // If opacity is lower than 50 the dominant color is the image or video color,
42
36
  // so use that color for the dark mode computation.
43
- if ( url && dimRatio <= 50 && elementRef.current ) {
37
+ if ( url && dimRatio <= 50 ) {
38
+ const imgCrossOrigin = applyFilters(
39
+ 'media.crossOrigin',
40
+ undefined,
41
+ url
42
+ );
44
43
  retrieveFastAverageColor()
45
- .getColorAsync( elementRef.current, {
44
+ .getColorAsync( url, {
46
45
  // Previously the default color was white, but that changed
47
46
  // in v6.0.0 so it has to be manually set now.
48
47
  defaultColor: [ 255, 255, 255, 255 ],
49
48
  // Errors that come up don't reject the promise, so error
50
49
  // logging has to be silenced with this option.
51
50
  silent: process.env.NODE_ENV === 'production',
51
+ crossOrigin: imgCrossOrigin,
52
52
  } )
53
53
  .then( ( color ) => setIsDark( color.isDark ) );
54
54
  }
55
- }, [ url, url && dimRatio <= 50 && elementRef.current, setIsDark ] );
55
+ }, [ url, url && dimRatio <= 50, setIsDark ] );
56
56
  useEffect( () => {
57
57
  // If opacity is greater than 50 the dominant color is the overlay color,
58
58
  // so use that color for the dark mode computation.
@@ -107,3 +107,10 @@
107
107
  .color-block-support-panel__inner-wrapper > :not(.block-editor-tools-panel-color-gradient-settings__item) {
108
108
  margin-top: $grid-unit-30;
109
109
  }
110
+
111
+
112
+ // The frontend style.scss includes a min-height as an IE11 fix.
113
+ // This fix causes extra spacing for the focus style in the editor, so we omit it here.
114
+ .wp-block-cover::after {
115
+ min-height: auto;
116
+ }