@wordpress/block-library 7.8.0 → 7.9.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 (292) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/audio/edit.js +1 -0
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/audio/save.js +2 -1
  5. package/build/audio/save.js.map +1 -1
  6. package/build/avatar/hooks.js +2 -2
  7. package/build/avatar/hooks.js.map +1 -1
  8. package/build/button/edit.js +1 -1
  9. package/build/button/edit.js.map +1 -1
  10. package/build/button/index.js +1 -24
  11. package/build/button/index.js.map +1 -1
  12. package/build/button/save.js +1 -1
  13. package/build/button/save.js.map +1 -1
  14. package/build/columns/variations.js +2 -2
  15. package/build/columns/variations.js.map +1 -1
  16. package/build/comment-author-name/edit.js +3 -5
  17. package/build/comment-author-name/edit.js.map +1 -1
  18. package/build/comment-author-name/index.js +0 -4
  19. package/build/comment-author-name/index.js.map +1 -1
  20. package/build/comment-date/edit.js +4 -4
  21. package/build/comment-date/edit.js.map +1 -1
  22. package/build/comment-date/index.js +0 -4
  23. package/build/comment-date/index.js.map +1 -1
  24. package/build/comment-edit-link/index.js +0 -4
  25. package/build/comment-edit-link/index.js.map +1 -1
  26. package/build/comment-reply-link/index.js +0 -4
  27. package/build/comment-reply-link/index.js.map +1 -1
  28. package/build/comments/edit.js +10 -2
  29. package/build/comments/edit.js.map +1 -1
  30. package/build/comments-title/deprecated.js +0 -3
  31. package/build/comments-title/deprecated.js.map +1 -1
  32. package/build/cover/index.js +1 -0
  33. package/build/cover/index.js.map +1 -1
  34. package/build/embed/embed-preview.js +1 -0
  35. package/build/embed/embed-preview.js.map +1 -1
  36. package/build/embed/icons.js +21 -1
  37. package/build/embed/icons.js.map +1 -1
  38. package/build/embed/save.js +1 -0
  39. package/build/embed/save.js.map +1 -1
  40. package/build/embed/variations.js +11 -0
  41. package/build/embed/variations.js.map +1 -1
  42. package/build/file/edit.js +1 -1
  43. package/build/file/edit.js.map +1 -1
  44. package/build/file/save.js +1 -1
  45. package/build/file/save.js.map +1 -1
  46. package/build/gallery/gallery.js +1 -1
  47. package/build/gallery/gallery.js.map +1 -1
  48. package/build/gallery/save.js +1 -1
  49. package/build/gallery/save.js.map +1 -1
  50. package/build/gallery/transforms.js +2 -2
  51. package/build/gallery/transforms.js.map +1 -1
  52. package/build/gallery/v1/edit.js +3 -3
  53. package/build/gallery/v1/edit.js.map +1 -1
  54. package/build/gallery/v1/gallery-image.js +1 -0
  55. package/build/gallery/v1/gallery-image.js.map +1 -1
  56. package/build/gallery/v1/gallery.js +1 -1
  57. package/build/gallery/v1/gallery.js.map +1 -1
  58. package/build/gallery/v1/save.js +10 -2
  59. package/build/gallery/v1/save.js.map +1 -1
  60. package/build/group/index.js +1 -0
  61. package/build/group/index.js.map +1 -1
  62. package/build/html/edit.js +11 -20
  63. package/build/html/edit.js.map +1 -1
  64. package/build/html/preview.js +48 -0
  65. package/build/html/preview.js.map +1 -0
  66. package/build/image/edit.native.js +2 -1
  67. package/build/image/edit.native.js.map +1 -1
  68. package/build/image/image.js +1 -0
  69. package/build/image/image.js.map +1 -1
  70. package/build/image/save.js +1 -0
  71. package/build/image/save.js.map +1 -1
  72. package/build/list/v2/transforms.js +33 -17
  73. package/build/list/v2/transforms.js.map +1 -1
  74. package/build/list-item/hooks/use-enter.js +7 -4
  75. package/build/list-item/hooks/use-enter.js.map +1 -1
  76. package/build/list-item/hooks/use-outdent-list-item.js +36 -15
  77. package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
  78. package/build/navigation/edit/index.js +1 -1
  79. package/build/navigation/edit/index.js.map +1 -1
  80. package/build/navigation/index.js +9 -0
  81. package/build/navigation/index.js.map +1 -1
  82. package/build/navigation/use-navigation-menu.js +16 -74
  83. package/build/navigation/use-navigation-menu.js.map +1 -1
  84. package/build/navigation/view.js +5 -3
  85. package/build/navigation/view.js.map +1 -1
  86. package/build/navigation-submenu/view.js +5 -3
  87. package/build/navigation-submenu/view.js.map +1 -1
  88. package/build/post-comments-form/edit.js +12 -2
  89. package/build/post-comments-form/edit.js.map +1 -1
  90. package/build/post-comments-form/form.js +1 -1
  91. package/build/post-comments-form/form.js.map +1 -1
  92. package/build/search/edit.js +1 -1
  93. package/build/search/edit.js.map +1 -1
  94. package/build/table/edit.js +1 -0
  95. package/build/table/edit.js.map +1 -1
  96. package/build/table/save.js +2 -1
  97. package/build/table/save.js.map +1 -1
  98. package/build/video/edit.js +1 -0
  99. package/build/video/edit.js.map +1 -1
  100. package/build/video/save.js +1 -0
  101. package/build/video/save.js.map +1 -1
  102. package/build-module/audio/edit.js +2 -1
  103. package/build-module/audio/edit.js.map +1 -1
  104. package/build-module/audio/save.js +3 -2
  105. package/build-module/audio/save.js.map +1 -1
  106. package/build-module/avatar/hooks.js +2 -2
  107. package/build-module/avatar/hooks.js.map +1 -1
  108. package/build-module/button/edit.js +2 -2
  109. package/build-module/button/edit.js.map +1 -1
  110. package/build-module/button/index.js +1 -24
  111. package/build-module/button/index.js.map +1 -1
  112. package/build-module/button/save.js +2 -2
  113. package/build-module/button/save.js.map +1 -1
  114. package/build-module/columns/variations.js +2 -2
  115. package/build-module/columns/variations.js.map +1 -1
  116. package/build-module/comment-author-name/edit.js +3 -5
  117. package/build-module/comment-author-name/edit.js.map +1 -1
  118. package/build-module/comment-author-name/index.js +0 -4
  119. package/build-module/comment-author-name/index.js.map +1 -1
  120. package/build-module/comment-date/edit.js +4 -4
  121. package/build-module/comment-date/edit.js.map +1 -1
  122. package/build-module/comment-date/index.js +0 -4
  123. package/build-module/comment-date/index.js.map +1 -1
  124. package/build-module/comment-edit-link/index.js +0 -4
  125. package/build-module/comment-edit-link/index.js.map +1 -1
  126. package/build-module/comment-reply-link/index.js +0 -4
  127. package/build-module/comment-reply-link/index.js.map +1 -1
  128. package/build-module/comments/edit.js +10 -2
  129. package/build-module/comments/edit.js.map +1 -1
  130. package/build-module/comments-title/deprecated.js +0 -3
  131. package/build-module/comments-title/deprecated.js.map +1 -1
  132. package/build-module/cover/index.js +1 -0
  133. package/build-module/cover/index.js.map +1 -1
  134. package/build-module/embed/embed-preview.js +2 -1
  135. package/build-module/embed/embed-preview.js.map +1 -1
  136. package/build-module/embed/icons.js +19 -0
  137. package/build-module/embed/icons.js.map +1 -1
  138. package/build-module/embed/save.js +2 -1
  139. package/build-module/embed/save.js.map +1 -1
  140. package/build-module/embed/variations.js +12 -1
  141. package/build-module/embed/variations.js.map +1 -1
  142. package/build-module/file/edit.js +2 -2
  143. package/build-module/file/edit.js.map +1 -1
  144. package/build-module/file/save.js +2 -2
  145. package/build-module/file/save.js.map +1 -1
  146. package/build-module/gallery/gallery.js +2 -2
  147. package/build-module/gallery/gallery.js.map +1 -1
  148. package/build-module/gallery/save.js +2 -2
  149. package/build-module/gallery/save.js.map +1 -1
  150. package/build-module/gallery/transforms.js +3 -3
  151. package/build-module/gallery/transforms.js.map +1 -1
  152. package/build-module/gallery/v1/edit.js +4 -4
  153. package/build-module/gallery/v1/edit.js.map +1 -1
  154. package/build-module/gallery/v1/gallery-image.js +2 -1
  155. package/build-module/gallery/v1/gallery-image.js.map +1 -1
  156. package/build-module/gallery/v1/gallery.js +2 -2
  157. package/build-module/gallery/v1/gallery.js.map +1 -1
  158. package/build-module/gallery/v1/save.js +8 -3
  159. package/build-module/gallery/v1/save.js.map +1 -1
  160. package/build-module/group/index.js +1 -0
  161. package/build-module/group/index.js.map +1 -1
  162. package/build-module/html/edit.js +12 -23
  163. package/build-module/html/edit.js.map +1 -1
  164. package/build-module/html/preview.js +38 -0
  165. package/build-module/html/preview.js.map +1 -0
  166. package/build-module/image/edit.native.js +2 -1
  167. package/build-module/image/edit.native.js.map +1 -1
  168. package/build-module/image/image.js +2 -1
  169. package/build-module/image/image.js.map +1 -1
  170. package/build-module/image/save.js +2 -1
  171. package/build-module/image/save.js.map +1 -1
  172. package/build-module/list/v2/transforms.js +32 -17
  173. package/build-module/list/v2/transforms.js.map +1 -1
  174. package/build-module/list-item/hooks/use-enter.js +7 -4
  175. package/build-module/list-item/hooks/use-enter.js.map +1 -1
  176. package/build-module/list-item/hooks/use-outdent-list-item.js +34 -15
  177. package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
  178. package/build-module/navigation/edit/index.js +1 -1
  179. package/build-module/navigation/edit/index.js.map +1 -1
  180. package/build-module/navigation/index.js +9 -0
  181. package/build-module/navigation/index.js.map +1 -1
  182. package/build-module/navigation/use-navigation-menu.js +17 -75
  183. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  184. package/build-module/navigation/view.js +5 -3
  185. package/build-module/navigation/view.js.map +1 -1
  186. package/build-module/navigation-submenu/view.js +5 -3
  187. package/build-module/navigation-submenu/view.js.map +1 -1
  188. package/build-module/post-comments-form/edit.js +12 -3
  189. package/build-module/post-comments-form/edit.js.map +1 -1
  190. package/build-module/post-comments-form/form.js +2 -2
  191. package/build-module/post-comments-form/form.js.map +1 -1
  192. package/build-module/search/edit.js +2 -2
  193. package/build-module/search/edit.js.map +1 -1
  194. package/build-module/table/edit.js +2 -1
  195. package/build-module/table/edit.js.map +1 -1
  196. package/build-module/table/save.js +3 -2
  197. package/build-module/table/save.js.map +1 -1
  198. package/build-module/video/edit.js +2 -1
  199. package/build-module/video/edit.js.map +1 -1
  200. package/build-module/video/save.js +2 -1
  201. package/build-module/video/save.js.map +1 -1
  202. package/build-style/button/style-rtl.css +5 -0
  203. package/build-style/button/style.css +5 -0
  204. package/build-style/editor-rtl.css +3 -0
  205. package/build-style/editor.css +3 -0
  206. package/build-style/file/style-rtl.css +5 -8
  207. package/build-style/file/style.css +5 -8
  208. package/build-style/navigation/style-rtl.css +9 -1
  209. package/build-style/navigation/style.css +9 -1
  210. package/build-style/post-comments/style-rtl.css +2 -1
  211. package/build-style/post-comments/style.css +2 -1
  212. package/build-style/post-comments-form/editor-rtl.css +3 -0
  213. package/build-style/post-comments-form/editor.css +3 -0
  214. package/build-style/post-template/style-rtl.css +9 -18
  215. package/build-style/post-template/style.css +9 -18
  216. package/build-style/search/style-rtl.css +6 -8
  217. package/build-style/search/style.css +6 -8
  218. package/build-style/style-rtl.css +36 -36
  219. package/build-style/style.css +36 -36
  220. package/package.json +28 -28
  221. package/src/audio/edit.js +4 -0
  222. package/src/audio/save.js +12 -2
  223. package/src/avatar/hooks.js +6 -9
  224. package/src/button/block.json +1 -24
  225. package/src/button/edit.js +2 -2
  226. package/src/button/save.js +2 -2
  227. package/src/button/style.scss +10 -0
  228. package/src/columns/variations.js +2 -2
  229. package/src/comment-author-name/block.json +0 -4
  230. package/src/comment-author-name/edit.js +3 -12
  231. package/src/comment-date/block.json +0 -4
  232. package/src/comment-date/edit.js +10 -14
  233. package/src/comment-date/index.php +0 -3
  234. package/src/comment-edit-link/block.json +0 -4
  235. package/src/comment-reply-link/block.json +0 -4
  236. package/src/comments/edit.js +24 -4
  237. package/src/comments-title/deprecated.js +0 -2
  238. package/src/cover/block.json +1 -0
  239. package/src/cover/index.php +21 -8
  240. package/src/embed/embed-preview.js +8 -1
  241. package/src/embed/icons.js +25 -0
  242. package/src/embed/save.js +10 -2
  243. package/src/embed/test/__snapshots__/index.native.js.snap +1 -1
  244. package/src/embed/variations.js +10 -0
  245. package/src/file/edit.js +4 -2
  246. package/src/file/save.js +2 -2
  247. package/src/file/style.scss +5 -5
  248. package/src/freeform/editor.scss +0 -2
  249. package/src/gallery/gallery.js +9 -2
  250. package/src/gallery/index.php +4 -0
  251. package/src/gallery/save.js +5 -1
  252. package/src/gallery/test/__snapshots__/index.native.js.snap +2 -2
  253. package/src/gallery/test/helpers.native.js +11 -198
  254. package/src/gallery/test/index.native.js +19 -29
  255. package/src/gallery/transforms.js +3 -3
  256. package/src/gallery/v1/edit.js +3 -4
  257. package/src/gallery/v1/gallery-image.js +4 -0
  258. package/src/gallery/v1/gallery.js +8 -2
  259. package/src/gallery/v1/save.js +20 -3
  260. package/src/group/block.json +1 -0
  261. package/src/html/edit.js +10 -40
  262. package/src/html/preview.js +46 -0
  263. package/src/image/edit.native.js +1 -0
  264. package/src/image/image.js +2 -0
  265. package/src/image/save.js +10 -2
  266. package/src/image/test/edit.native.js +51 -19
  267. package/src/list/v2/transforms.js +22 -7
  268. package/src/list-item/hooks/use-enter.js +9 -6
  269. package/src/list-item/hooks/use-outdent-list-item.js +48 -21
  270. package/src/navigation/block.json +9 -0
  271. package/src/navigation/edit/index.js +1 -0
  272. package/src/navigation/style.scss +10 -1
  273. package/src/navigation/test/use-navigation-menu.js +16 -11
  274. package/src/navigation/use-navigation-menu.js +26 -83
  275. package/src/navigation/view.js +7 -2
  276. package/src/navigation-submenu/view.js +7 -2
  277. package/src/post-comments/index.php +1 -1
  278. package/src/post-comments/style.scss +7 -3
  279. package/src/post-comments-form/edit.js +20 -3
  280. package/src/post-comments-form/editor.scss +4 -0
  281. package/src/post-comments-form/form.js +2 -2
  282. package/src/post-comments-form/index.php +1 -1
  283. package/src/post-featured-image/index.php +4 -2
  284. package/src/post-template/index.php +15 -3
  285. package/src/post-template/style.scss +1 -7
  286. package/src/search/edit.js +2 -2
  287. package/src/search/index.php +12 -10
  288. package/src/search/style.scss +9 -8
  289. package/src/table/edit.js +2 -0
  290. package/src/table/save.js +6 -1
  291. package/src/video/edit.js +4 -0
  292. package/src/video/save.js +10 -2
@@ -112,6 +112,11 @@
112
112
  text-align: right;
113
113
  }
114
114
 
115
+ :where(.wp-block-button__link) {
116
+ border-radius: 9999px;
117
+ padding: calc(0.667em + 2px) calc(1.333em + 2px);
118
+ }
119
+
115
120
  .wp-block-buttons > .wp-block-button.has-custom-width {
116
121
  max-width: none;
117
122
  }
@@ -872,6 +877,9 @@ section.wp-block-cover-image > h2,
872
877
  .wp-block-file {
873
878
  margin-bottom: 1.5em;
874
879
  }
880
+ .wp-block-file:not(.wp-element-button) {
881
+ font-size: 0.8em;
882
+ }
875
883
  .wp-block-file.aligncenter {
876
884
  text-align: center;
877
885
  }
@@ -887,17 +895,11 @@ section.wp-block-cover-image > h2,
887
895
  margin-bottom: 1em;
888
896
  }
889
897
 
890
- .wp-block-file__button {
891
- background: #32373c;
898
+ :where(.wp-block-file__button) {
892
899
  border-radius: 2em;
893
- color: #fff;
894
- font-size: 0.8em;
895
900
  padding: 0.5em 1em;
896
901
  }
897
- .wp-block-file__button:is(a) {
898
- text-decoration: none;
899
- }
900
- .wp-block-file__button:is(a):hover, .wp-block-file__button:is(a):visited, .wp-block-file__button:is(a):focus, .wp-block-file__button:is(a):active {
902
+ :where(.wp-block-file__button):is(a):hover, :where(.wp-block-file__button):is(a):visited, :where(.wp-block-file__button):is(a):focus, :where(.wp-block-file__button):is(a):active {
901
903
  box-shadow: none;
902
904
  color: #fff;
903
905
  opacity: 0.85;
@@ -1602,7 +1604,6 @@ ul.has-background {
1602
1604
  display: none;
1603
1605
  }
1604
1606
  .wp-block-navigation .wp-block-navigation-item__content {
1605
- color: inherit;
1606
1607
  display: block;
1607
1608
  padding: 0;
1608
1609
  }
@@ -2035,6 +2036,15 @@ button.wp-block-navigation-item__content {
2035
2036
  position: relative;
2036
2037
  }
2037
2038
 
2039
+ .has-modal-open .admin-bar .wp-block-navigation__responsive-dialog {
2040
+ margin-top: 46px;
2041
+ }
2042
+ @media (min-width: 782px) {
2043
+ .has-modal-open .admin-bar .wp-block-navigation__responsive-dialog {
2044
+ margin-top: 32px;
2045
+ }
2046
+ }
2047
+
2038
2048
  html.has-modal-open {
2039
2049
  overflow: hidden;
2040
2050
  }
@@ -2228,7 +2238,8 @@ p.has-background {
2228
2238
  .wp-block-post-comments input:not([type=submit]):not([type=checkbox]) {
2229
2239
  padding: calc(0.667em + 2px);
2230
2240
  }
2231
- .wp-block-post-comments input[type=submit] {
2241
+
2242
+ :where(.wp-block-post-comments input[type="submit"]) {
2232
2243
  border: none;
2233
2244
  }
2234
2245
 
@@ -2395,49 +2406,40 @@ p.has-background {
2395
2406
  color: inherit;
2396
2407
  }
2397
2408
 
2398
- .wp-block-post-template,
2399
- .wp-block-query-loop {
2409
+ .wp-block-post-template {
2400
2410
  margin-top: 0;
2401
2411
  margin-bottom: 0;
2402
2412
  max-width: 100%;
2403
2413
  list-style: none;
2404
2414
  padding: 0;
2405
2415
  }
2406
- .wp-block-post-template.wp-block-post-template,
2407
- .wp-block-query-loop.wp-block-post-template {
2416
+ .wp-block-post-template.wp-block-post-template {
2408
2417
  background: none;
2409
2418
  }
2410
- .wp-block-post-template.is-flex-container,
2411
- .wp-block-query-loop.is-flex-container {
2419
+ .wp-block-post-template.is-flex-container {
2412
2420
  flex-direction: row;
2413
2421
  display: flex;
2414
2422
  flex-wrap: wrap;
2415
2423
  gap: 1.25em;
2416
2424
  }
2417
- .wp-block-post-template.is-flex-container li,
2418
- .wp-block-query-loop.is-flex-container li {
2425
+ .wp-block-post-template.is-flex-container li {
2419
2426
  margin: 0;
2420
2427
  width: 100%;
2421
2428
  }
2422
2429
  @media (min-width: 600px) {
2423
- .wp-block-post-template.is-flex-container.is-flex-container.columns-2 > li,
2424
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-2 > li {
2430
+ .wp-block-post-template.is-flex-container.is-flex-container.columns-2 > li {
2425
2431
  width: calc((100% / 2) - 1.25em + (1.25em / 2));
2426
2432
  }
2427
- .wp-block-post-template.is-flex-container.is-flex-container.columns-3 > li,
2428
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-3 > li {
2433
+ .wp-block-post-template.is-flex-container.is-flex-container.columns-3 > li {
2429
2434
  width: calc((100% / 3) - 1.25em + (1.25em / 3));
2430
2435
  }
2431
- .wp-block-post-template.is-flex-container.is-flex-container.columns-4 > li,
2432
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-4 > li {
2436
+ .wp-block-post-template.is-flex-container.is-flex-container.columns-4 > li {
2433
2437
  width: calc((100% / 4) - 1.25em + (1.25em / 4));
2434
2438
  }
2435
- .wp-block-post-template.is-flex-container.is-flex-container.columns-5 > li,
2436
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-5 > li {
2439
+ .wp-block-post-template.is-flex-container.is-flex-container.columns-5 > li {
2437
2440
  width: calc((100% / 5) - 1.25em + (1.25em / 5));
2438
2441
  }
2439
- .wp-block-post-template.is-flex-container.is-flex-container.columns-6 > li,
2440
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-6 > li {
2442
+ .wp-block-post-template.is-flex-container.is-flex-container.columns-6 > li {
2441
2443
  width: calc((100% / 6) - 1.25em + (1.25em / 6));
2442
2444
  }
2443
2445
  }
@@ -2555,15 +2557,8 @@ ul.wp-block-rss.is-grid li {
2555
2557
  }
2556
2558
 
2557
2559
  .wp-block-search__button {
2558
- background: #f7f7f7;
2559
- border: 1px solid #ccc;
2560
- padding: 0.375em 0.625em;
2561
- color: #32373c;
2562
2560
  margin-left: 0.625em;
2563
2561
  word-break: normal;
2564
- font-size: inherit;
2565
- font-family: inherit;
2566
- line-height: inherit;
2567
2562
  }
2568
2563
  .wp-block-search__button.has-icon {
2569
2564
  line-height: 0;
@@ -2574,6 +2569,11 @@ ul.wp-block-rss.is-grid li {
2574
2569
  fill: currentColor;
2575
2570
  }
2576
2571
 
2572
+ :where(.wp-block-search__button) {
2573
+ border: 1px solid #ccc;
2574
+ padding: 0.375em 0.625em;
2575
+ }
2576
+
2577
2577
  .wp-block-search__inside-wrapper {
2578
2578
  display: flex;
2579
2579
  flex: auto;
@@ -2611,7 +2611,7 @@ ul.wp-block-rss.is-grid li {
2611
2611
  :where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) .wp-block-search__input:focus {
2612
2612
  outline: none;
2613
2613
  }
2614
- :where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) .wp-block-search__button {
2614
+ :where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) :where(.wp-block-search__button) {
2615
2615
  padding: 0.125em 0.5em;
2616
2616
  }
2617
2617
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "7.8.0",
3
+ "version": "7.9.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -34,32 +34,32 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.16.0",
37
- "@wordpress/a11y": "^3.11.0",
38
- "@wordpress/api-fetch": "^6.8.0",
39
- "@wordpress/autop": "^3.11.0",
40
- "@wordpress/blob": "^3.11.0",
41
- "@wordpress/block-editor": "^9.3.0",
42
- "@wordpress/blocks": "^11.10.0",
43
- "@wordpress/components": "^19.13.0",
44
- "@wordpress/compose": "^5.9.0",
45
- "@wordpress/core-data": "^4.9.0",
46
- "@wordpress/data": "^6.11.0",
47
- "@wordpress/date": "^4.11.0",
48
- "@wordpress/deprecated": "^3.11.0",
49
- "@wordpress/dom": "^3.11.0",
50
- "@wordpress/element": "^4.9.0",
51
- "@wordpress/hooks": "^3.11.0",
52
- "@wordpress/html-entities": "^3.11.0",
53
- "@wordpress/i18n": "^4.11.0",
54
- "@wordpress/icons": "^9.2.0",
55
- "@wordpress/keycodes": "^3.11.0",
56
- "@wordpress/notices": "^3.11.0",
57
- "@wordpress/primitives": "^3.9.0",
58
- "@wordpress/reusable-blocks": "^3.9.0",
59
- "@wordpress/rich-text": "^5.9.0",
60
- "@wordpress/server-side-render": "^3.9.0",
61
- "@wordpress/url": "^3.12.0",
62
- "@wordpress/viewport": "^4.9.0",
37
+ "@wordpress/a11y": "^3.12.0",
38
+ "@wordpress/api-fetch": "^6.9.0",
39
+ "@wordpress/autop": "^3.12.0",
40
+ "@wordpress/blob": "^3.12.0",
41
+ "@wordpress/block-editor": "^9.4.0",
42
+ "@wordpress/blocks": "^11.11.0",
43
+ "@wordpress/components": "^19.14.0",
44
+ "@wordpress/compose": "^5.10.0",
45
+ "@wordpress/core-data": "^4.10.0",
46
+ "@wordpress/data": "^6.12.0",
47
+ "@wordpress/date": "^4.12.0",
48
+ "@wordpress/deprecated": "^3.12.0",
49
+ "@wordpress/dom": "^3.12.0",
50
+ "@wordpress/element": "^4.10.0",
51
+ "@wordpress/hooks": "^3.12.0",
52
+ "@wordpress/html-entities": "^3.12.0",
53
+ "@wordpress/i18n": "^4.12.0",
54
+ "@wordpress/icons": "^9.3.0",
55
+ "@wordpress/keycodes": "^3.12.0",
56
+ "@wordpress/notices": "^3.12.0",
57
+ "@wordpress/primitives": "^3.10.0",
58
+ "@wordpress/reusable-blocks": "^3.10.0",
59
+ "@wordpress/rich-text": "^5.10.0",
60
+ "@wordpress/server-side-render": "^3.10.0",
61
+ "@wordpress/url": "^3.13.0",
62
+ "@wordpress/viewport": "^4.10.0",
63
63
  "classnames": "^2.3.1",
64
64
  "colord": "^2.7.0",
65
65
  "fast-average-color": "4.3.0",
@@ -76,5 +76,5 @@
76
76
  "publishConfig": {
77
77
  "access": "public"
78
78
  },
79
- "gitHead": "48d5f37dfb52d2e77c8eeb662f9874cf141b8c6b"
79
+ "gitHead": "a80eeb62ec7cb1418b9915c277e084a29d6665e3"
80
80
  }
package/src/audio/edit.js CHANGED
@@ -24,6 +24,7 @@ import {
24
24
  RichText,
25
25
  useBlockProps,
26
26
  store as blockEditorStore,
27
+ __experimentalGetElementClassName,
27
28
  } from '@wordpress/block-editor';
28
29
  import { useEffect } from '@wordpress/element';
29
30
  import { __, _x } from '@wordpress/i18n';
@@ -200,6 +201,9 @@ function AudioEdit( {
200
201
  { ( ! RichText.isEmpty( caption ) || isSelected ) && (
201
202
  <RichText
202
203
  tagName="figcaption"
204
+ className={ __experimentalGetElementClassName(
205
+ 'caption'
206
+ ) }
203
207
  aria-label={ __( 'Audio caption text' ) }
204
208
  placeholder={ __( 'Add caption' ) }
205
209
  value={ caption }
package/src/audio/save.js CHANGED
@@ -1,7 +1,11 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { RichText, useBlockProps } from '@wordpress/block-editor';
4
+ import {
5
+ RichText,
6
+ useBlockProps,
7
+ __experimentalGetElementClassName,
8
+ } from '@wordpress/block-editor';
5
9
 
6
10
  export default function save( { attributes } ) {
7
11
  const { autoplay, caption, loop, preload, src } = attributes;
@@ -17,7 +21,13 @@ export default function save( { attributes } ) {
17
21
  preload={ preload }
18
22
  />
19
23
  { ! RichText.isEmpty( caption ) && (
20
- <RichText.Content tagName="figcaption" value={ caption } />
24
+ <RichText.Content
25
+ tagName="figcaption"
26
+ value={ caption }
27
+ className={ __experimentalGetElementClassName(
28
+ 'caption'
29
+ ) }
30
+ />
21
31
  ) }
22
32
  </figure>
23
33
  )
@@ -76,15 +76,12 @@ export function useUserAvatar( { userId, postId, postType } ) {
76
76
  },
77
77
  [ postType, postId, userId ]
78
78
  );
79
-
80
- const avatarUrls =
81
- authorDetails && authorDetails?.avatar_urls
82
- ? Object.values( authorDetails.avatar_urls )
83
- : null;
84
- const sizes =
85
- authorDetails && authorDetails?.avatar_urls
86
- ? Object.keys( authorDetails.avatar_urls )
87
- : null;
79
+ const avatarUrls = authorDetails?.avatar_urls
80
+ ? Object.values( authorDetails.avatar_urls )
81
+ : null;
82
+ const sizes = authorDetails?.avatar_urls
83
+ ? Object.keys( authorDetails.avatar_urls )
84
+ : null;
88
85
  const { minSize, maxSize } = getAvatarSizes( sizes );
89
86
  const defaultAvatar = useDefaultAvatar();
90
87
  return {
@@ -89,30 +89,7 @@
89
89
  "radius": true
90
90
  }
91
91
  },
92
- "__experimentalSelector": ".wp-block-button__link",
93
- "__experimentalStyle": {
94
- "border": {
95
- "//": "100% causes an oval, but any explicit but really high value retains the pill shape.",
96
- "radius": "9999px"
97
- },
98
- "color": {
99
- "text": "#fff",
100
- "background": "#32373c"
101
- },
102
- "typography": {
103
- "fontSize": "1.125em",
104
- "textDecoration": "none"
105
- },
106
- "spacing": {
107
- "padding": {
108
- "//": "The extra 2px are added to size solids the same as the outline versions.",
109
- "top": "calc(0.667em + 2px)",
110
- "right": "calc(1.333em + 2px)",
111
- "bottom": "calc(0.667em + 2px)",
112
- "left": "calc(1.333em + 2px)"
113
- }
114
- }
115
- }
92
+ "__experimentalSelector": ".wp-block-button__link"
116
93
  },
117
94
  "styles": [
118
95
  { "name": "fill", "label": "Fill", "isDefault": true },
@@ -25,7 +25,7 @@ import {
25
25
  __experimentalUseColorProps as useColorProps,
26
26
  __experimentalGetSpacingClassesAndStyles as useSpacingProps,
27
27
  __experimentalLinkControl as LinkControl,
28
- __experimentalElementButtonClassName,
28
+ __experimentalGetElementClassName,
29
29
  } from '@wordpress/block-editor';
30
30
  import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';
31
31
  import { link, linkOff } from '@wordpress/icons';
@@ -172,7 +172,7 @@ function ButtonEdit( props ) {
172
172
  // provided via block support.
173
173
  'no-border-radius': style?.border?.radius === 0,
174
174
  },
175
- __experimentalElementButtonClassName
175
+ __experimentalGetElementClassName( 'button' )
176
176
  ) }
177
177
  style={ {
178
178
  ...borderProps.style,
@@ -12,7 +12,7 @@ import {
12
12
  __experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,
13
13
  __experimentalGetColorClassesAndStyles as getColorClassesAndStyles,
14
14
  __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,
15
- __experimentalElementButtonClassName,
15
+ __experimentalGetElementClassName,
16
16
  } from '@wordpress/block-editor';
17
17
 
18
18
  export default function save( { attributes, className } ) {
@@ -35,7 +35,7 @@ export default function save( { attributes, className } ) {
35
35
  // block support.
36
36
  'no-border-radius': style?.border?.radius === 0,
37
37
  },
38
- __experimentalElementButtonClassName
38
+ __experimentalGetElementClassName( 'button' )
39
39
  );
40
40
  const buttonStyle = {
41
41
  ...borderProps.style,
@@ -29,6 +29,16 @@ $blocks-block__margin: 0.5em;
29
29
  }
30
30
  }
31
31
 
32
+ // These rules are set to zero specificity to keep the default styles for buttons.
33
+ // They are needed for backwards compatibility.
34
+ :where(.wp-block-button__link) {
35
+ // 100% causes an oval, but any explicit but really high value retains the pill shape.
36
+ border-radius: 9999px;
37
+
38
+ // The extra 2px are added to size solids the same as the outline versions.
39
+ padding: calc(0.667em + 2px) calc(1.333em + 2px);
40
+ }
41
+
32
42
  // Increased specificity needed to override margins.
33
43
  .wp-block-buttons > .wp-block-button {
34
44
  &.has-custom-width {
@@ -57,7 +57,7 @@ const variations = [
57
57
  },
58
58
  {
59
59
  name: 'two-columns-one-third-two-thirds',
60
- title: __( '30 / 70' ),
60
+ title: __( '33 / 66' ),
61
61
  description: __( 'Two columns; one-third, two-thirds split' ),
62
62
  icon: (
63
63
  <SVG
@@ -81,7 +81,7 @@ const variations = [
81
81
  },
82
82
  {
83
83
  name: 'two-columns-two-thirds-one-third',
84
- title: __( '70 / 30' ),
84
+ title: __( '66 / 33' ),
85
85
  description: __( 'Two columns; two-thirds, one-third split' ),
86
86
  icon: (
87
87
  <SVG
@@ -18,10 +18,6 @@
18
18
  },
19
19
  "textAlign": {
20
20
  "type": "string"
21
- },
22
- "fontSize": {
23
- "type": "string",
24
- "default": "small"
25
21
  }
26
22
  },
27
23
  "usesContext": [ "commentId" ],
@@ -41,7 +41,7 @@ export default function Edit( {
41
41
  [ `has-text-align-${ textAlign }` ]: textAlign,
42
42
  } ),
43
43
  } );
44
- const displayName = useSelect(
44
+ let displayName = useSelect(
45
45
  ( select ) => {
46
46
  const { getEntityRecord } = select( coreStore );
47
47
 
@@ -92,15 +92,7 @@ export default function Edit( {
92
92
  );
93
93
 
94
94
  if ( ! commentId || ! displayName ) {
95
- return (
96
- <>
97
- { inspectorControls }
98
- { blockControls }
99
- <div { ...blockProps }>
100
- { _x( 'Comment Author', 'block title' ) }
101
- </div>
102
- </>
103
- );
95
+ displayName = _x( 'Comment Author', 'block title' );
104
96
  }
105
97
 
106
98
  const displayAuthor = isLink ? (
@@ -111,9 +103,8 @@ export default function Edit( {
111
103
  { displayName }
112
104
  </a>
113
105
  ) : (
114
- { displayName }
106
+ displayName
115
107
  );
116
-
117
108
  return (
118
109
  <>
119
110
  { inspectorControls }
@@ -14,10 +14,6 @@
14
14
  "isLink": {
15
15
  "type": "boolean",
16
16
  "default": true
17
- },
18
- "fontSize": {
19
- "type": "string",
20
- "default": "small"
21
17
  }
22
18
  },
23
19
  "usesContext": [ "commentId" ],
@@ -33,7 +33,7 @@ export default function Edit( {
33
33
  setAttributes,
34
34
  } ) {
35
35
  const blockProps = useBlockProps();
36
- const [ date ] = useEntityProp( 'root', 'comment', 'date', commentId );
36
+ let [ date ] = useEntityProp( 'root', 'comment', 'date', commentId );
37
37
  const [ siteFormat = getDateSettings().formats.date ] = useEntityProp(
38
38
  'root',
39
39
  'site',
@@ -60,21 +60,17 @@ export default function Edit( {
60
60
  );
61
61
 
62
62
  if ( ! commentId || ! date ) {
63
- return (
64
- <>
65
- { inspectorControls }
66
- <div { ...blockProps }>
67
- <time>{ _x( 'Comment Date', 'block title' ) }</time>
68
- </div>
69
- </>
70
- );
63
+ date = _x( 'Comment Date', 'block title' );
71
64
  }
72
65
 
73
- let commentDate = (
74
- <time dateTime={ dateI18n( 'c', date ) }>
75
- { dateI18n( format || siteFormat, date ) }
76
- </time>
77
- );
66
+ let commentDate =
67
+ date instanceof Date ? (
68
+ <time dateTime={ dateI18n( 'c', date ) }>
69
+ { dateI18n( format || siteFormat, date ) }
70
+ </time>
71
+ ) : (
72
+ <time>{ date }</time>
73
+ );
78
74
 
79
75
  if ( isLink ) {
80
76
  commentDate = (
@@ -24,9 +24,6 @@ function render_block_core_comment_date( $attributes, $content, $block ) {
24
24
  }
25
25
 
26
26
  $classes = '';
27
- if ( isset( $attributes['fontSize'] ) ) {
28
- $classes .= 'has-' . esc_attr( $attributes['fontSize'] ) . '-font-size';
29
- }
30
27
 
31
28
  $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
32
29
  $formatted_date = get_comment_date(
@@ -15,10 +15,6 @@
15
15
  },
16
16
  "textAlign": {
17
17
  "type": "string"
18
- },
19
- "fontSize": {
20
- "type": "string",
21
- "default": "small"
22
18
  }
23
19
  },
24
20
  "supports": {
@@ -11,10 +11,6 @@
11
11
  "attributes": {
12
12
  "textAlign": {
13
13
  "type": "string"
14
- },
15
- "fontSize": {
16
- "type": "string",
17
- "default": "small"
18
14
  }
19
15
  },
20
16
  "supports": {
@@ -37,7 +37,12 @@ const TEMPLATE = [
37
37
  'core/column',
38
38
  {},
39
39
  [
40
- [ 'core/comment-author-name' ],
40
+ [
41
+ 'core/comment-author-name',
42
+ {
43
+ fontSize: 'small',
44
+ },
45
+ ],
41
46
  [
42
47
  'core/group',
43
48
  {
@@ -52,12 +57,27 @@ const TEMPLATE = [
52
57
  },
53
58
  },
54
59
  [
55
- [ 'core/comment-date' ],
56
- [ 'core/comment-edit-link' ],
60
+ [
61
+ 'core/comment-date',
62
+ {
63
+ fontSize: 'small',
64
+ },
65
+ ],
66
+ [
67
+ 'core/comment-edit-link',
68
+ {
69
+ fontSize: 'small',
70
+ },
71
+ ],
57
72
  ],
58
73
  ],
59
74
  [ 'core/comment-content' ],
60
- [ 'core/comment-reply-link' ],
75
+ [
76
+ 'core/comment-reply-link',
77
+ {
78
+ fontSize: 'small',
79
+ },
80
+ ],
61
81
  ],
62
82
  ],
63
83
  ],
@@ -18,13 +18,11 @@ export default [
18
18
  },
19
19
  supports,
20
20
  migrate: ( oldAttributes ) => {
21
- /* eslint-disable no-unused-vars */
22
21
  const {
23
22
  singleCommentLabel,
24
23
  multipleCommentsLabel,
25
24
  ...newAttributes
26
25
  } = oldAttributes;
27
- /* eslint-enable no-unused-vars */
28
26
  return newAttributes;
29
27
  },
30
28
  isEligible: ( { multipleCommentsLabel, singleCommentLabel } ) =>
@@ -83,6 +83,7 @@
83
83
  "html": false,
84
84
  "spacing": {
85
85
  "padding": true,
86
+ "margin": [ "top", "bottom" ],
86
87
  "__experimentalDefaultControls": {
87
88
  "padding": true
88
89
  }
@@ -32,20 +32,33 @@ function render_block_core_cover( $attributes, $content ) {
32
32
 
33
33
  $image = get_the_post_thumbnail( null, 'post-thumbnail', $attr );
34
34
 
35
- $content = str_replace(
36
- '</span><div',
37
- '</span>' . $image . '<div',
38
- $content
39
- );
40
-
35
+ /*
36
+ * Inserts the featured image between the (1st) cover 'background' `span` and 'inner_container' `div`,
37
+ * and removes eventual withespace characters between the two (typically introduced at template level)
38
+ */
39
+ $inner_container_start = '/<div\b[^>]+wp-block-cover__inner-container[\s|"][^>]*>/U';
40
+ if ( 1 === preg_match( $inner_container_start, $content, $matches, PREG_OFFSET_CAPTURE ) ) {
41
+ $offset = $matches[0][1];
42
+ $content = substr( $content, 0, $offset ) . $image . substr( $content, $offset );
43
+ }
41
44
  } else {
42
45
  if ( in_the_loop() ) {
43
46
  update_post_thumbnail_cache();
44
47
  }
45
48
  $current_featured_image = get_the_post_thumbnail_url();
46
- $content = preg_replace(
49
+
50
+ $styles = 'background-image:url(' . esc_url( $current_featured_image ) . '); ';
51
+
52
+ if ( isset( $attributes['minHeight'] ) ) {
53
+ $height_unit = empty( $attributes['minHeightUnit'] ) ? 'px' : $attributes['minHeightUnit'];
54
+ $height = " min-height:{$attributes['minHeight']}{$height_unit}";
55
+
56
+ $styles .= $height;
57
+ }
58
+
59
+ $content = preg_replace(
47
60
  '/class=\".*?\"/',
48
- '${0} style="background-image:url(' . esc_url( $current_featured_image ) . ')"',
61
+ '${0} style="' . $styles . '"',
49
62
  $content,
50
63
  1
51
64
  );