@wordpress/block-library 9.24.0 → 9.25.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 (202) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/button/edit.js +29 -17
  3. package/build/button/edit.js.map +1 -1
  4. package/build/columns/edit.js +18 -22
  5. package/build/columns/edit.js.map +1 -1
  6. package/build/comment-author-name/edit.js +41 -12
  7. package/build/comment-author-name/edit.js.map +1 -1
  8. package/build/comment-date/edit.js +41 -12
  9. package/build/comment-date/edit.js.map +1 -1
  10. package/build/comment-edit-link/edit.js +27 -7
  11. package/build/comment-edit-link/edit.js.map +1 -1
  12. package/build/comments/edit/comments-inspector-controls.js +1 -3
  13. package/build/comments/edit/comments-inspector-controls.js.map +1 -1
  14. package/build/comments-pagination/edit.js +23 -9
  15. package/build/comments-pagination/edit.js.map +1 -1
  16. package/build/comments-title/edit.js +41 -12
  17. package/build/comments-title/edit.js.map +1 -1
  18. package/build/details/edit.js +27 -3
  19. package/build/details/edit.js.map +1 -1
  20. package/build/embed/edit.js +2 -4
  21. package/build/embed/edit.js.map +1 -1
  22. package/build/embed/embed-controls.js +41 -22
  23. package/build/embed/embed-controls.js.map +1 -1
  24. package/build/file/inspector.js +73 -30
  25. package/build/file/inspector.js.map +1 -1
  26. package/build/form/edit.js +67 -37
  27. package/build/form/edit.js.map +1 -1
  28. package/build/form-input/edit.js +47 -18
  29. package/build/form-input/edit.js.map +1 -1
  30. package/build/latest-posts/edit.js +154 -82
  31. package/build/latest-posts/edit.js.map +1 -1
  32. package/build/list/ordered-list-settings.js +131 -52
  33. package/build/list/ordered-list-settings.js.map +1 -1
  34. package/build/navigation/edit/index.js +93 -51
  35. package/build/navigation/edit/index.js.map +1 -1
  36. package/build/navigation/edit/overlay-menu-preview.js +43 -27
  37. package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
  38. package/build/navigation-link/index.js +3 -0
  39. package/build/navigation-link/index.js.map +1 -1
  40. package/build/navigation-link/transforms.js +2 -0
  41. package/build/navigation-link/transforms.js.map +1 -1
  42. package/build/navigation-link/update-attributes.js +1 -0
  43. package/build/navigation-link/update-attributes.js.map +1 -1
  44. package/build/navigation-submenu/index.js +3 -0
  45. package/build/navigation-submenu/index.js.map +1 -1
  46. package/build/post-comments-count/index.js +3 -1
  47. package/build/post-comments-count/index.js.map +1 -1
  48. package/build/post-comments-count/transforms.js +26 -0
  49. package/build/post-comments-count/transforms.js.map +1 -0
  50. package/build/post-comments-link/index.js +3 -1
  51. package/build/post-comments-link/index.js.map +1 -1
  52. package/build/post-comments-link/transforms.js +26 -0
  53. package/build/post-comments-link/transforms.js.map +1 -0
  54. package/build/post-title/edit.js +56 -18
  55. package/build/post-title/edit.js.map +1 -1
  56. package/build/query/edit/enhanced-pagination-modal.js +1 -1
  57. package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
  58. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
  59. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  60. package/build/rss/edit.js +120 -46
  61. package/build/rss/edit.js.map +1 -1
  62. package/build/separator/edit.js +52 -20
  63. package/build/separator/edit.js.map +1 -1
  64. package/build/shortcode/index.js +2 -1
  65. package/build/shortcode/index.js.map +1 -1
  66. package/build/social-link/variations.js +53 -48
  67. package/build/social-link/variations.js.map +1 -1
  68. package/build/social-links/edit.js +35 -45
  69. package/build/social-links/edit.js.map +1 -1
  70. package/build/video/tracks-editor.js +40 -12
  71. package/build/video/tracks-editor.js.map +1 -1
  72. package/build-module/button/edit.js +30 -18
  73. package/build-module/button/edit.js.map +1 -1
  74. package/build-module/columns/edit.js +18 -22
  75. package/build-module/columns/edit.js.map +1 -1
  76. package/build-module/comment-author-name/edit.js +42 -13
  77. package/build-module/comment-author-name/edit.js.map +1 -1
  78. package/build-module/comment-date/edit.js +42 -13
  79. package/build-module/comment-date/edit.js.map +1 -1
  80. package/build-module/comment-edit-link/edit.js +28 -8
  81. package/build-module/comment-edit-link/edit.js.map +1 -1
  82. package/build-module/comments/edit/comments-inspector-controls.js +1 -3
  83. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
  84. package/build-module/comments-pagination/edit.js +24 -10
  85. package/build-module/comments-pagination/edit.js.map +1 -1
  86. package/build-module/comments-title/edit.js +42 -13
  87. package/build-module/comments-title/edit.js.map +1 -1
  88. package/build-module/details/edit.js +29 -5
  89. package/build-module/details/edit.js.map +1 -1
  90. package/build-module/embed/edit.js +2 -4
  91. package/build-module/embed/edit.js.map +1 -1
  92. package/build-module/embed/embed-controls.js +42 -23
  93. package/build-module/embed/embed-controls.js.map +1 -1
  94. package/build-module/file/inspector.js +74 -31
  95. package/build-module/file/inspector.js.map +1 -1
  96. package/build-module/form/edit.js +68 -38
  97. package/build-module/form/edit.js.map +1 -1
  98. package/build-module/form-input/edit.js +48 -19
  99. package/build-module/form-input/edit.js.map +1 -1
  100. package/build-module/latest-posts/edit.js +155 -83
  101. package/build-module/latest-posts/edit.js.map +1 -1
  102. package/build-module/list/ordered-list-settings.js +132 -53
  103. package/build-module/list/ordered-list-settings.js.map +1 -1
  104. package/build-module/navigation/edit/index.js +94 -52
  105. package/build-module/navigation/edit/index.js.map +1 -1
  106. package/build-module/navigation/edit/overlay-menu-preview.js +44 -28
  107. package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
  108. package/build-module/navigation-link/index.js +3 -0
  109. package/build-module/navigation-link/index.js.map +1 -1
  110. package/build-module/navigation-link/transforms.js +2 -0
  111. package/build-module/navigation-link/transforms.js.map +1 -1
  112. package/build-module/navigation-link/update-attributes.js +1 -0
  113. package/build-module/navigation-link/update-attributes.js.map +1 -1
  114. package/build-module/navigation-submenu/index.js +3 -0
  115. package/build-module/navigation-submenu/index.js.map +1 -1
  116. package/build-module/post-comments-count/index.js +3 -1
  117. package/build-module/post-comments-count/index.js.map +1 -1
  118. package/build-module/post-comments-count/transforms.js +19 -0
  119. package/build-module/post-comments-count/transforms.js.map +1 -0
  120. package/build-module/post-comments-link/index.js +3 -1
  121. package/build-module/post-comments-link/index.js.map +1 -1
  122. package/build-module/post-comments-link/transforms.js +19 -0
  123. package/build-module/post-comments-link/transforms.js.map +1 -0
  124. package/build-module/post-title/edit.js +57 -19
  125. package/build-module/post-title/edit.js.map +1 -1
  126. package/build-module/query/edit/enhanced-pagination-modal.js +1 -1
  127. package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
  128. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
  129. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  130. package/build-module/rss/edit.js +121 -47
  131. package/build-module/rss/edit.js.map +1 -1
  132. package/build-module/separator/edit.js +54 -22
  133. package/build-module/separator/edit.js.map +1 -1
  134. package/build-module/shortcode/index.js +2 -1
  135. package/build-module/shortcode/index.js.map +1 -1
  136. package/build-module/social-link/variations.js +53 -48
  137. package/build-module/social-link/variations.js.map +1 -1
  138. package/build-module/social-links/edit.js +37 -47
  139. package/build-module/social-links/edit.js.map +1 -1
  140. package/build-module/video/tracks-editor.js +41 -13
  141. package/build-module/video/tracks-editor.js.map +1 -1
  142. package/build-style/editor-rtl.css +9 -4
  143. package/build-style/editor.css +9 -4
  144. package/build-style/gallery/style-rtl.css +1 -0
  145. package/build-style/gallery/style.css +1 -0
  146. package/build-style/navigation/editor-rtl.css +8 -3
  147. package/build-style/navigation/editor.css +8 -3
  148. package/build-style/pullquote/editor-rtl.css +1 -1
  149. package/build-style/pullquote/editor.css +1 -1
  150. package/build-style/pullquote/style-rtl.css +2 -3
  151. package/build-style/pullquote/style.css +2 -3
  152. package/build-style/pullquote/theme-rtl.css +2 -2
  153. package/build-style/pullquote/theme.css +2 -2
  154. package/build-style/style-rtl.css +3 -3
  155. package/build-style/style.css +3 -3
  156. package/build-style/theme-rtl.css +2 -2
  157. package/build-style/theme.css +2 -2
  158. package/package.json +35 -35
  159. package/src/button/edit.js +44 -29
  160. package/src/columns/edit.js +20 -31
  161. package/src/comment-author-name/edit.js +54 -13
  162. package/src/comment-date/edit.js +50 -15
  163. package/src/comment-edit-link/edit.js +39 -11
  164. package/src/comments/edit/comments-inspector-controls.js +0 -2
  165. package/src/comments-pagination/edit.js +29 -9
  166. package/src/comments-title/edit.js +53 -15
  167. package/src/details/edit.js +36 -4
  168. package/src/embed/edit.js +3 -5
  169. package/src/embed/embed-controls.js +55 -33
  170. package/src/file/inspector.js +99 -45
  171. package/src/form/edit.js +91 -46
  172. package/src/form-input/edit.js +56 -18
  173. package/src/gallery/style.scss +1 -0
  174. package/src/latest-posts/edit.js +206 -98
  175. package/src/list/ordered-list-settings.js +172 -62
  176. package/src/navigation/edit/index.js +127 -64
  177. package/src/navigation/edit/overlay-menu-preview.js +43 -26
  178. package/src/navigation/editor.scss +8 -4
  179. package/src/navigation-link/block.json +3 -0
  180. package/src/navigation-link/index.php +4 -0
  181. package/src/navigation-link/transforms.js +2 -1
  182. package/src/navigation-link/update-attributes.js +1 -0
  183. package/src/navigation-submenu/block.json +3 -0
  184. package/src/navigation-submenu/index.php +4 -0
  185. package/src/post-comments-count/index.js +2 -0
  186. package/src/post-comments-count/transforms.js +20 -0
  187. package/src/post-comments-link/index.js +2 -0
  188. package/src/post-comments-link/transforms.js +20 -0
  189. package/src/post-title/edit.js +76 -24
  190. package/src/pullquote/editor.scss +1 -1
  191. package/src/pullquote/style.scss +2 -3
  192. package/src/pullquote/theme.scss +2 -2
  193. package/src/query/edit/enhanced-pagination-modal.js +1 -5
  194. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -13
  195. package/src/rss/edit.js +141 -55
  196. package/src/separator/edit.js +66 -21
  197. package/src/shortcode/block.json +2 -1
  198. package/src/site-title/index.php +1 -1
  199. package/src/social-link/index.php +49 -49
  200. package/src/social-link/variations.js +53 -48
  201. package/src/social-links/edit.js +39 -60
  202. package/src/video/tracks-editor.js +57 -16
@@ -540,7 +540,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
540
540
  background-color: #f0f0f0;
541
541
  padding: 0 24px;
542
542
  height: 64px !important;
543
- margin-bottom: 12px;
543
+ grid-column: span 2;
544
544
  }
545
545
  .wp-block-navigation__overlay-menu-preview.open {
546
546
  box-shadow: inset 0 0 0 1px #e0e0e0;
@@ -627,6 +627,11 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
627
627
  margin-right: 24px;
628
628
  }
629
629
 
630
- .wp-block-navigation__overlay-menu-icon-toggle-group {
631
- margin-bottom: 16px;
630
+ .editor-sidebar__panel .wp-block-navigation__submenu-header {
631
+ margin-top: 0;
632
+ margin-bottom: 0;
633
+ }
634
+
635
+ .wp-block-navigation__submenu-accessibility-notice {
636
+ grid-column: span 2;
632
637
  }
@@ -540,7 +540,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
540
540
  background-color: #f0f0f0;
541
541
  padding: 0 24px;
542
542
  height: 64px !important;
543
- margin-bottom: 12px;
543
+ grid-column: span 2;
544
544
  }
545
545
  .wp-block-navigation__overlay-menu-preview.open {
546
546
  box-shadow: inset 0 0 0 1px #e0e0e0;
@@ -627,6 +627,11 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
627
627
  margin-left: 24px;
628
628
  }
629
629
 
630
- .wp-block-navigation__overlay-menu-icon-toggle-group {
631
- margin-bottom: 16px;
630
+ .editor-sidebar__panel .wp-block-navigation__submenu-header {
631
+ margin-top: 0;
632
+ margin-bottom: 0;
633
+ }
634
+
635
+ .wp-block-navigation__submenu-accessibility-notice {
636
+ grid-column: span 2;
632
637
  }
@@ -142,6 +142,6 @@
142
142
  font-style: normal;
143
143
  }
144
144
 
145
- .wp-block-pullquote .wp-block-pullquote__citation {
145
+ .wp-block-pullquote__citation {
146
146
  color: inherit;
147
147
  }
@@ -142,6 +142,6 @@
142
142
  font-style: normal;
143
143
  }
144
144
 
145
- .wp-block-pullquote .wp-block-pullquote__citation {
145
+ .wp-block-pullquote__citation {
146
146
  color: inherit;
147
147
  }
@@ -142,8 +142,7 @@
142
142
  padding: 4em 0;
143
143
  }
144
144
  .wp-block-pullquote p,
145
- .wp-block-pullquote blockquote,
146
- .wp-block-pullquote cite {
145
+ .wp-block-pullquote blockquote {
147
146
  color: inherit;
148
147
  }
149
148
  .wp-block-pullquote blockquote {
@@ -196,7 +195,7 @@
196
195
  font-style: normal;
197
196
  }
198
197
 
199
- .wp-block-pullquote cite {
198
+ .wp-block-pullquote :where(cite) {
200
199
  color: inherit;
201
200
  display: block;
202
201
  }
@@ -142,8 +142,7 @@
142
142
  padding: 4em 0;
143
143
  }
144
144
  .wp-block-pullquote p,
145
- .wp-block-pullquote blockquote,
146
- .wp-block-pullquote cite {
145
+ .wp-block-pullquote blockquote {
147
146
  color: inherit;
148
147
  }
149
148
  .wp-block-pullquote blockquote {
@@ -196,7 +195,7 @@
196
195
  font-style: normal;
197
196
  }
198
197
 
199
- .wp-block-pullquote cite {
198
+ .wp-block-pullquote :where(cite) {
200
199
  color: inherit;
201
200
  display: block;
202
201
  }
@@ -140,8 +140,8 @@
140
140
  margin-bottom: 1.75em;
141
141
  color: currentColor;
142
142
  }
143
- .wp-block-pullquote cite,
144
- .wp-block-pullquote footer, .wp-block-pullquote__citation {
143
+ .wp-block-pullquote :where(cite),
144
+ .wp-block-pullquote :where(footer), .wp-block-pullquote__citation {
145
145
  color: currentColor;
146
146
  text-transform: uppercase;
147
147
  font-size: 0.8125em;
@@ -140,8 +140,8 @@
140
140
  margin-bottom: 1.75em;
141
141
  color: currentColor;
142
142
  }
143
- .wp-block-pullquote cite,
144
- .wp-block-pullquote footer, .wp-block-pullquote__citation {
143
+ .wp-block-pullquote :where(cite),
144
+ .wp-block-pullquote :where(footer), .wp-block-pullquote__citation {
145
145
  color: currentColor;
146
146
  text-transform: uppercase;
147
147
  font-size: 0.8125em;
@@ -1471,6 +1471,7 @@ figure.wp-block-gallery.has-nested-images {
1471
1471
  content: "";
1472
1472
  height: 100%;
1473
1473
  max-height: 40%;
1474
+ pointer-events: none;
1474
1475
  -webkit-backdrop-filter: blur(3px);
1475
1476
  backdrop-filter: blur(3px);
1476
1477
  -webkit-mask-image: linear-gradient(0deg, #000 20%, transparent 100%);
@@ -3135,8 +3136,7 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3135
3136
  padding: 4em 0;
3136
3137
  }
3137
3138
  .wp-block-pullquote p,
3138
- .wp-block-pullquote blockquote,
3139
- .wp-block-pullquote cite {
3139
+ .wp-block-pullquote blockquote {
3140
3140
  color: inherit;
3141
3141
  }
3142
3142
  .wp-block-pullquote blockquote {
@@ -3189,7 +3189,7 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3189
3189
  font-style: normal;
3190
3190
  }
3191
3191
 
3192
- .wp-block-pullquote cite {
3192
+ .wp-block-pullquote :where(cite) {
3193
3193
  color: inherit;
3194
3194
  display: block;
3195
3195
  }
@@ -1481,6 +1481,7 @@ figure.wp-block-gallery.has-nested-images {
1481
1481
  content: "";
1482
1482
  height: 100%;
1483
1483
  max-height: 40%;
1484
+ pointer-events: none;
1484
1485
  -webkit-backdrop-filter: blur(3px);
1485
1486
  backdrop-filter: blur(3px);
1486
1487
  -webkit-mask-image: linear-gradient(0deg, #000 20%, transparent 100%);
@@ -3167,8 +3168,7 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3167
3168
  padding: 4em 0;
3168
3169
  }
3169
3170
  .wp-block-pullquote p,
3170
- .wp-block-pullquote blockquote,
3171
- .wp-block-pullquote cite {
3171
+ .wp-block-pullquote blockquote {
3172
3172
  color: inherit;
3173
3173
  }
3174
3174
  .wp-block-pullquote blockquote {
@@ -3221,7 +3221,7 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3221
3221
  font-style: normal;
3222
3222
  }
3223
3223
 
3224
- .wp-block-pullquote cite {
3224
+ .wp-block-pullquote :where(cite) {
3225
3225
  color: inherit;
3226
3226
  display: block;
3227
3227
  }
@@ -195,8 +195,8 @@
195
195
  margin-bottom: 1.75em;
196
196
  color: currentColor;
197
197
  }
198
- .wp-block-pullquote cite,
199
- .wp-block-pullquote footer, .wp-block-pullquote__citation {
198
+ .wp-block-pullquote :where(cite),
199
+ .wp-block-pullquote :where(footer), .wp-block-pullquote__citation {
200
200
  color: currentColor;
201
201
  text-transform: uppercase;
202
202
  font-size: 0.8125em;
@@ -195,8 +195,8 @@
195
195
  margin-bottom: 1.75em;
196
196
  color: currentColor;
197
197
  }
198
- .wp-block-pullquote cite,
199
- .wp-block-pullquote footer, .wp-block-pullquote__citation {
198
+ .wp-block-pullquote :where(cite),
199
+ .wp-block-pullquote :where(footer), .wp-block-pullquote__citation {
200
200
  color: currentColor;
201
201
  text-transform: uppercase;
202
202
  font-size: 0.8125em;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.24.0",
3
+ "version": "9.25.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -41,39 +41,39 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@babel/runtime": "7.25.7",
44
- "@wordpress/a11y": "^4.24.0",
45
- "@wordpress/api-fetch": "^7.24.0",
46
- "@wordpress/autop": "^4.24.0",
47
- "@wordpress/blob": "^4.24.0",
48
- "@wordpress/block-editor": "^14.19.0",
49
- "@wordpress/blocks": "^14.13.0",
50
- "@wordpress/components": "^29.10.0",
51
- "@wordpress/compose": "^7.24.0",
52
- "@wordpress/core-data": "^7.24.0",
53
- "@wordpress/data": "^10.24.0",
54
- "@wordpress/date": "^5.24.0",
55
- "@wordpress/deprecated": "^4.24.0",
56
- "@wordpress/dom": "^4.24.0",
57
- "@wordpress/element": "^6.24.0",
58
- "@wordpress/escape-html": "^3.24.0",
59
- "@wordpress/hooks": "^4.24.0",
60
- "@wordpress/html-entities": "^4.24.0",
61
- "@wordpress/i18n": "^5.24.0",
62
- "@wordpress/icons": "^10.24.0",
63
- "@wordpress/interactivity": "^6.24.0",
64
- "@wordpress/interactivity-router": "^2.24.0",
65
- "@wordpress/keyboard-shortcuts": "^5.24.0",
66
- "@wordpress/keycodes": "^4.24.0",
67
- "@wordpress/notices": "^5.24.0",
68
- "@wordpress/patterns": "^2.24.0",
69
- "@wordpress/primitives": "^4.24.0",
70
- "@wordpress/private-apis": "^1.24.0",
71
- "@wordpress/reusable-blocks": "^5.24.0",
72
- "@wordpress/rich-text": "^7.24.0",
73
- "@wordpress/server-side-render": "^6.0.0",
74
- "@wordpress/url": "^4.24.0",
75
- "@wordpress/viewport": "^6.24.0",
76
- "@wordpress/wordcount": "^4.24.0",
44
+ "@wordpress/a11y": "^4.25.0",
45
+ "@wordpress/api-fetch": "^7.25.0",
46
+ "@wordpress/autop": "^4.25.0",
47
+ "@wordpress/blob": "^4.25.0",
48
+ "@wordpress/block-editor": "^14.20.0",
49
+ "@wordpress/blocks": "^14.14.0",
50
+ "@wordpress/components": "^29.11.0",
51
+ "@wordpress/compose": "^7.25.0",
52
+ "@wordpress/core-data": "^7.25.0",
53
+ "@wordpress/data": "^10.25.0",
54
+ "@wordpress/date": "^5.25.0",
55
+ "@wordpress/deprecated": "^4.25.0",
56
+ "@wordpress/dom": "^4.25.0",
57
+ "@wordpress/element": "^6.25.0",
58
+ "@wordpress/escape-html": "^3.25.0",
59
+ "@wordpress/hooks": "^4.25.0",
60
+ "@wordpress/html-entities": "^4.25.0",
61
+ "@wordpress/i18n": "^5.25.0",
62
+ "@wordpress/icons": "^10.25.0",
63
+ "@wordpress/interactivity": "^6.25.0",
64
+ "@wordpress/interactivity-router": "^2.25.0",
65
+ "@wordpress/keyboard-shortcuts": "^5.25.0",
66
+ "@wordpress/keycodes": "^4.25.0",
67
+ "@wordpress/notices": "^5.25.0",
68
+ "@wordpress/patterns": "^2.25.0",
69
+ "@wordpress/primitives": "^4.25.0",
70
+ "@wordpress/private-apis": "^1.25.0",
71
+ "@wordpress/reusable-blocks": "^5.25.0",
72
+ "@wordpress/rich-text": "^7.25.0",
73
+ "@wordpress/server-side-render": "^6.1.0",
74
+ "@wordpress/url": "^4.25.0",
75
+ "@wordpress/viewport": "^6.25.0",
76
+ "@wordpress/wordcount": "^4.25.0",
77
77
  "change-case": "^4.1.2",
78
78
  "clsx": "^2.1.1",
79
79
  "colord": "^2.7.0",
@@ -91,5 +91,5 @@
91
91
  "publishConfig": {
92
92
  "access": "public"
93
93
  },
94
- "gitHead": "9c03d1458cae76792ae15e67b421205836bf4393"
94
+ "gitHead": "d1acd76ffff33ab01f0a948d2f51e5e45c95158d"
95
95
  }
@@ -10,6 +10,7 @@ import { NEW_TAB_TARGET, NOFOLLOW_REL } from './constants';
10
10
  import { getUpdatedLinkAttributes } from './get-updated-link-attributes';
11
11
  import removeAnchorTag from '../utils/remove-anchor-tag';
12
12
  import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
13
+ import { unlock } from '../lock-unlock';
13
14
 
14
15
  /**
15
16
  * WordPress dependencies
@@ -47,6 +48,7 @@ import {
47
48
  useBlockEditingMode,
48
49
  getTypographyClassesAndStyles as useTypographyProps,
49
50
  useSettings,
51
+ privateApis as blockEditorPrivateApis,
50
52
  } from '@wordpress/block-editor';
51
53
  import { displayShortcut, isKeyboardEvent, ENTER } from '@wordpress/keycodes';
52
54
  import { link, linkOff } from '@wordpress/icons';
@@ -59,6 +61,8 @@ import {
59
61
  import { useMergeRefs, useRefEffect } from '@wordpress/compose';
60
62
  import { useSelect, useDispatch } from '@wordpress/data';
61
63
 
64
+ const { HTMLElementControl } = unlock( blockEditorPrivateApis );
65
+
62
66
  const LINK_SETTINGS = [
63
67
  ...LinkControl.DEFAULT_LINK_SETTINGS,
64
68
  {
@@ -325,6 +329,10 @@ function ButtonEdit( props ) {
325
329
  },
326
330
  } );
327
331
 
332
+ const hasNonContentControls = blockEditingMode === 'default';
333
+ const hasBlockControls =
334
+ hasNonContentControls || ( isLinkTag && ! lockUrlControls );
335
+
328
336
  return (
329
337
  <>
330
338
  <div
@@ -374,35 +382,32 @@ function ButtonEdit( props ) {
374
382
  identifier="text"
375
383
  />
376
384
  </div>
377
- <BlockControls group="block">
378
- { blockEditingMode === 'default' && (
379
- <AlignmentControl
380
- value={ textAlign }
381
- onChange={ ( nextAlign ) => {
382
- setAttributes( { textAlign: nextAlign } );
383
- } }
384
- />
385
- ) }
386
- { ! isURLSet && isLinkTag && ! lockUrlControls && (
387
- <ToolbarButton
388
- name="link"
389
- icon={ link }
390
- title={ __( 'Link' ) }
391
- shortcut={ displayShortcut.primary( 'k' ) }
392
- onClick={ startEditing }
393
- />
394
- ) }
395
- { isURLSet && isLinkTag && ! lockUrlControls && (
396
- <ToolbarButton
397
- name="link"
398
- icon={ linkOff }
399
- title={ __( 'Unlink' ) }
400
- shortcut={ displayShortcut.primaryShift( 'k' ) }
401
- onClick={ unlink }
402
- isActive
403
- />
404
- ) }
405
- </BlockControls>
385
+ { hasBlockControls && (
386
+ <BlockControls group="block">
387
+ { hasNonContentControls && (
388
+ <AlignmentControl
389
+ value={ textAlign }
390
+ onChange={ ( nextAlign ) => {
391
+ setAttributes( { textAlign: nextAlign } );
392
+ } }
393
+ />
394
+ ) }
395
+ { isLinkTag && ! lockUrlControls && (
396
+ <ToolbarButton
397
+ name="link"
398
+ icon={ ! isURLSet ? link : linkOff }
399
+ title={ ! isURLSet ? __( 'Link' ) : __( 'Unlink' ) }
400
+ shortcut={
401
+ ! isURLSet
402
+ ? displayShortcut.primary( 'k' )
403
+ : displayShortcut.primaryShift( 'k' )
404
+ }
405
+ onClick={ ! isURLSet ? startEditing : unlink }
406
+ isActive={ isURLSet }
407
+ />
408
+ ) }
409
+ </BlockControls>
410
+ ) }
406
411
  { isLinkTag &&
407
412
  isSelected &&
408
413
  ( isEditingURL || isURLSet ) &&
@@ -455,6 +460,16 @@ function ButtonEdit( props ) {
455
460
  />
456
461
  </InspectorControls>
457
462
  <InspectorControls group="advanced">
463
+ <HTMLElementControl
464
+ tagName={ tagName }
465
+ onChange={ ( value ) =>
466
+ setAttributes( { tagName: value } )
467
+ }
468
+ options={ [
469
+ { label: __( 'Default (<a>)' ), value: 'a' },
470
+ { label: '<button>', value: 'button' },
471
+ ] }
472
+ />
458
473
  { isLinkTag && (
459
474
  <TextControl
460
475
  __next40pxDefaultSize
@@ -153,7 +153,6 @@ function ColumnInspectorControls( {
153
153
  <ToolsPanel
154
154
  label={ __( 'Settings' ) }
155
155
  resetAll={ () => {
156
- updateColumns( count, minCount );
157
156
  setAttributes( {
158
157
  isStackedOnMobile: true,
159
158
  } );
@@ -161,36 +160,26 @@ function ColumnInspectorControls( {
161
160
  dropdownMenuProps={ dropdownMenuProps }
162
161
  >
163
162
  { canInsertColumnBlock && (
164
- <ToolsPanelItem
165
- label={ __( 'Columns' ) }
166
- isShownByDefault
167
- hasValue={ () => count }
168
- onDeselect={ () => updateColumns( count, minCount ) }
169
- >
170
- <VStack spacing={ 4 }>
171
- <RangeControl
172
- __nextHasNoMarginBottom
173
- __next40pxDefaultSize
174
- label={ __( 'Columns' ) }
175
- value={ count }
176
- onChange={ ( value ) =>
177
- updateColumns(
178
- count,
179
- Math.max( minCount, value )
180
- )
181
- }
182
- min={ Math.max( 1, minCount ) }
183
- max={ Math.max( 6, count ) }
184
- />
185
- { count > 6 && (
186
- <Notice status="warning" isDismissible={ false }>
187
- { __(
188
- 'This column count exceeds the recommended amount and may cause visual breakage.'
189
- ) }
190
- </Notice>
191
- ) }
192
- </VStack>
193
- </ToolsPanelItem>
163
+ <VStack spacing={ 4 } style={ { gridColumn: '1 / -1' } }>
164
+ <RangeControl
165
+ __nextHasNoMarginBottom
166
+ __next40pxDefaultSize
167
+ label={ __( 'Columns' ) }
168
+ value={ count }
169
+ onChange={ ( value ) =>
170
+ updateColumns( count, Math.max( minCount, value ) )
171
+ }
172
+ min={ Math.max( 1, minCount ) }
173
+ max={ Math.max( 6, count ) }
174
+ />
175
+ { count > 6 && (
176
+ <Notice status="warning" isDismissible={ false }>
177
+ { __(
178
+ 'This column count exceeds the recommended amount and may cause visual breakage.'
179
+ ) }
180
+ </Notice>
181
+ ) }
182
+ </VStack>
194
183
  ) }
195
184
  <ToolsPanelItem
196
185
  label={ __( 'Stack on mobile' ) }
@@ -15,7 +15,16 @@ import {
15
15
  useBlockProps,
16
16
  } from '@wordpress/block-editor';
17
17
  import { store as coreStore } from '@wordpress/core-data';
18
- import { PanelBody, ToggleControl } from '@wordpress/components';
18
+ import {
19
+ ToggleControl,
20
+ __experimentalToolsPanel as ToolsPanel,
21
+ __experimentalToolsPanelItem as ToolsPanelItem,
22
+ } from '@wordpress/components';
23
+
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
19
28
 
20
29
  /**
21
30
  * Renders the `core/comment-author-name` block on the editor.
@@ -36,6 +45,7 @@ export default function Edit( {
36
45
  context: { commentId },
37
46
  setAttributes,
38
47
  } ) {
48
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
39
49
  const blockProps = useBlockProps( {
40
50
  className: clsx( {
41
51
  [ `has-text-align-${ textAlign }` ]: textAlign,
@@ -70,26 +80,57 @@ export default function Edit( {
70
80
 
71
81
  const inspectorControls = (
72
82
  <InspectorControls>
73
- <PanelBody title={ __( 'Settings' ) }>
74
- <ToggleControl
75
- __nextHasNoMarginBottom
83
+ <ToolsPanel
84
+ label={ __( 'Settings' ) }
85
+ resetAll={ () => {
86
+ setAttributes( {
87
+ isLink: true,
88
+ linkTarget: '_self',
89
+ } );
90
+ } }
91
+ dropdownMenuProps={ dropdownMenuProps }
92
+ >
93
+ <ToolsPanelItem
76
94
  label={ __( 'Link to authors URL' ) }
77
- onChange={ () => setAttributes( { isLink: ! isLink } ) }
78
- checked={ isLink }
79
- />
80
- { isLink && (
95
+ isShownByDefault
96
+ hasValue={ () => ! isLink }
97
+ onDeselect={ () =>
98
+ setAttributes( {
99
+ isLink: true,
100
+ } )
101
+ }
102
+ >
81
103
  <ToggleControl
82
104
  __nextHasNoMarginBottom
105
+ label={ __( 'Link to authors URL' ) }
106
+ onChange={ () => setAttributes( { isLink: ! isLink } ) }
107
+ checked={ isLink }
108
+ />
109
+ </ToolsPanelItem>
110
+ { isLink && (
111
+ <ToolsPanelItem
83
112
  label={ __( 'Open in new tab' ) }
84
- onChange={ ( value ) =>
113
+ isShownByDefault
114
+ hasValue={ () => linkTarget !== '_self' }
115
+ onDeselect={ () =>
85
116
  setAttributes( {
86
- linkTarget: value ? '_blank' : '_self',
117
+ linkTarget: '_self',
87
118
  } )
88
119
  }
89
- checked={ linkTarget === '_blank' }
90
- />
120
+ >
121
+ <ToggleControl
122
+ __nextHasNoMarginBottom
123
+ label={ __( 'Open in new tab' ) }
124
+ onChange={ ( value ) =>
125
+ setAttributes( {
126
+ linkTarget: value ? '_blank' : '_self',
127
+ } )
128
+ }
129
+ checked={ linkTarget === '_blank' }
130
+ />
131
+ </ToolsPanelItem>
91
132
  ) }
92
- </PanelBody>
133
+ </ToolsPanel>
93
134
  </InspectorControls>
94
135
  );
95
136
 
@@ -12,9 +12,18 @@ import {
12
12
  useBlockProps,
13
13
  __experimentalDateFormatPicker as DateFormatPicker,
14
14
  } from '@wordpress/block-editor';
15
- import { PanelBody, ToggleControl } from '@wordpress/components';
15
+ import {
16
+ __experimentalToolsPanel as ToolsPanel,
17
+ __experimentalToolsPanelItem as ToolsPanelItem,
18
+ ToggleControl,
19
+ } from '@wordpress/components';
16
20
  import { __, _x } from '@wordpress/i18n';
17
21
 
22
+ /**
23
+ * Internal dependencies
24
+ */
25
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
26
+
18
27
  /**
19
28
  * Renders the `core/comment-date` block on the editor.
20
29
  *
@@ -34,6 +43,8 @@ export default function Edit( {
34
43
  setAttributes,
35
44
  } ) {
36
45
  const blockProps = useBlockProps();
46
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
47
+
37
48
  let [ date ] = useEntityProp( 'root', 'comment', 'date', commentId );
38
49
  const [ siteFormat = getDateSettings().formats.date ] = useEntityProp(
39
50
  'root',
@@ -43,21 +54,45 @@ export default function Edit( {
43
54
 
44
55
  const inspectorControls = (
45
56
  <InspectorControls>
46
- <PanelBody title={ __( 'Settings' ) }>
47
- <DateFormatPicker
48
- format={ format }
49
- defaultFormat={ siteFormat }
50
- onChange={ ( nextFormat ) =>
51
- setAttributes( { format: nextFormat } )
52
- }
53
- />
54
- <ToggleControl
55
- __nextHasNoMarginBottom
57
+ <ToolsPanel
58
+ label={ __( 'Settings' ) }
59
+ resetAll={ () => {
60
+ setAttributes( {
61
+ format: undefined,
62
+ isLink: true,
63
+ } );
64
+ } }
65
+ dropdownMenuProps={ dropdownMenuProps }
66
+ >
67
+ <ToolsPanelItem
68
+ label={ __( 'Date format' ) }
69
+ hasValue={ () => format !== undefined }
70
+ onDeselect={ () => setAttributes( { format: undefined } ) }
71
+ isShownByDefault
72
+ >
73
+ <DateFormatPicker
74
+ format={ format }
75
+ defaultFormat={ siteFormat }
76
+ onChange={ ( nextFormat ) =>
77
+ setAttributes( { format: nextFormat } )
78
+ }
79
+ />
80
+ </ToolsPanelItem>
81
+
82
+ <ToolsPanelItem
56
83
  label={ __( 'Link to comment' ) }
57
- onChange={ () => setAttributes( { isLink: ! isLink } ) }
58
- checked={ isLink }
59
- />
60
- </PanelBody>
84
+ hasValue={ () => ! isLink }
85
+ onDeselect={ () => setAttributes( { isLink: true } ) }
86
+ isShownByDefault
87
+ >
88
+ <ToggleControl
89
+ __nextHasNoMarginBottom
90
+ label={ __( 'Link to comment' ) }
91
+ onChange={ () => setAttributes( { isLink: ! isLink } ) }
92
+ checked={ isLink }
93
+ />
94
+ </ToolsPanelItem>
95
+ </ToolsPanel>
61
96
  </InspectorControls>
62
97
  );
63
98