@wordpress/block-library 7.3.2 → 7.4.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 (266) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/archives/edit.js +1 -1
  3. package/build/archives/edit.js.map +1 -1
  4. package/build/audio/edit.js +1 -1
  5. package/build/audio/edit.js.map +1 -1
  6. package/build/audio/edit.native.js +1 -1
  7. package/build/audio/edit.native.js.map +1 -1
  8. package/build/categories/edit.js +8 -3
  9. package/build/categories/edit.js.map +1 -1
  10. package/build/categories/index.js +4 -0
  11. package/build/categories/index.js.map +1 -1
  12. package/build/column/index.js +10 -0
  13. package/build/column/index.js.map +1 -1
  14. package/build/comment-template/hooks.js +11 -3
  15. package/build/comment-template/hooks.js.map +1 -1
  16. package/build/comments-pagination/edit.js +18 -1
  17. package/build/comments-pagination/edit.js.map +1 -1
  18. package/build/comments-query-loop/edit.js +1 -1
  19. package/build/comments-query-loop/edit.js.map +1 -1
  20. package/build/comments-title/edit.js +149 -0
  21. package/build/comments-title/edit.js.map +1 -0
  22. package/build/comments-title/index.js +101 -0
  23. package/build/comments-title/index.js.map +1 -0
  24. package/build/embed/edit.js +12 -18
  25. package/build/embed/edit.js.map +1 -1
  26. package/build/embed/edit.native.js +1 -7
  27. package/build/embed/edit.native.js.map +1 -1
  28. package/build/embed/util.js +29 -4
  29. package/build/embed/util.js.map +1 -1
  30. package/build/file/inspector.js +2 -4
  31. package/build/file/inspector.js.map +1 -1
  32. package/build/gallery/edit.js +1 -1
  33. package/build/gallery/edit.js.map +1 -1
  34. package/build/gallery/v1/edit.js +1 -1
  35. package/build/gallery/v1/edit.js.map +1 -1
  36. package/build/html/edit.js +2 -2
  37. package/build/html/edit.js.map +1 -1
  38. package/build/image/edit.js +4 -6
  39. package/build/image/edit.js.map +1 -1
  40. package/build/image/edit.native.js +1 -1
  41. package/build/image/edit.native.js.map +1 -1
  42. package/build/image/image.js +1 -1
  43. package/build/image/image.js.map +1 -1
  44. package/build/index.js +3 -1
  45. package/build/index.js.map +1 -1
  46. package/build/index.native.js +14 -3
  47. package/build/index.native.js.map +1 -1
  48. package/build/latest-comments/edit.js +1 -1
  49. package/build/latest-comments/edit.js.map +1 -1
  50. package/build/loginout/edit.js +1 -1
  51. package/build/loginout/edit.js.map +1 -1
  52. package/build/media-text/edit.js +1 -2
  53. package/build/media-text/edit.js.map +1 -1
  54. package/build/media-text/edit.native.js +1 -1
  55. package/build/media-text/edit.native.js.map +1 -1
  56. package/build/navigation/edit/index.js +17 -1
  57. package/build/navigation/edit/index.js.map +1 -1
  58. package/build/navigation/edit/navigation-menu-selector.js +7 -2
  59. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  60. package/build/navigation/edit/unsaved-inner-blocks.js +5 -4
  61. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  62. package/build/navigation/index.js +1 -1
  63. package/build/navigation/view-modal.js +37 -0
  64. package/build/navigation/view-modal.js.map +1 -0
  65. package/build/navigation/view.js +1 -34
  66. package/build/navigation/view.js.map +1 -1
  67. package/build/paragraph/edit.native.js +6 -2
  68. package/build/paragraph/edit.native.js.map +1 -1
  69. package/build/post-author/edit.js +1 -1
  70. package/build/post-author/edit.js.map +1 -1
  71. package/build/post-excerpt/edit.js +1 -1
  72. package/build/post-excerpt/edit.js.map +1 -1
  73. package/build/quote/index.js +6 -0
  74. package/build/quote/index.js.map +1 -1
  75. package/build/quote/v2/edit.js +11 -3
  76. package/build/quote/v2/edit.js.map +1 -1
  77. package/build/rss/edit.js +1 -1
  78. package/build/rss/edit.js.map +1 -1
  79. package/build/search/edit.js +11 -9
  80. package/build/search/edit.js.map +1 -1
  81. package/build/spacer/constants.js +9 -0
  82. package/build/spacer/constants.js.map +1 -0
  83. package/build/spacer/controls.js +3 -3
  84. package/build/spacer/controls.js.map +1 -1
  85. package/build/spacer/controls.native.js +2 -2
  86. package/build/spacer/controls.native.js.map +1 -1
  87. package/build/spacer/edit.js +5 -6
  88. package/build/spacer/edit.js.map +1 -1
  89. package/build/table/edit.js +8 -2
  90. package/build/table/edit.js.map +1 -1
  91. package/build/tag-cloud/edit.js +1 -1
  92. package/build/tag-cloud/edit.js.map +1 -1
  93. package/build/video/edit.js +1 -1
  94. package/build/video/edit.js.map +1 -1
  95. package/build/video/edit.native.js +1 -1
  96. package/build/video/edit.native.js.map +1 -1
  97. package/build-module/archives/edit.js +1 -1
  98. package/build-module/archives/edit.js.map +1 -1
  99. package/build-module/audio/edit.js +1 -1
  100. package/build-module/audio/edit.js.map +1 -1
  101. package/build-module/audio/edit.native.js +1 -1
  102. package/build-module/audio/edit.native.js.map +1 -1
  103. package/build-module/categories/edit.js +8 -3
  104. package/build-module/categories/edit.js.map +1 -1
  105. package/build-module/categories/index.js +4 -0
  106. package/build-module/categories/index.js.map +1 -1
  107. package/build-module/column/index.js +10 -0
  108. package/build-module/column/index.js.map +1 -1
  109. package/build-module/comment-template/hooks.js +11 -3
  110. package/build-module/comment-template/hooks.js.map +1 -1
  111. package/build-module/comments-pagination/edit.js +19 -2
  112. package/build-module/comments-pagination/edit.js.map +1 -1
  113. package/build-module/comments-query-loop/edit.js +1 -1
  114. package/build-module/comments-query-loop/edit.js.map +1 -1
  115. package/build-module/comments-title/edit.js +133 -0
  116. package/build-module/comments-title/edit.js.map +1 -0
  117. package/build-module/comments-title/index.js +88 -0
  118. package/build-module/comments-title/index.js.map +1 -0
  119. package/build-module/embed/edit.js +13 -19
  120. package/build-module/embed/edit.js.map +1 -1
  121. package/build-module/embed/edit.native.js +2 -8
  122. package/build-module/embed/edit.native.js.map +1 -1
  123. package/build-module/embed/util.js +25 -3
  124. package/build-module/embed/util.js.map +1 -1
  125. package/build-module/file/inspector.js +2 -4
  126. package/build-module/file/inspector.js.map +1 -1
  127. package/build-module/gallery/edit.js +1 -1
  128. package/build-module/gallery/edit.js.map +1 -1
  129. package/build-module/gallery/v1/edit.js +1 -1
  130. package/build-module/gallery/v1/edit.js.map +1 -1
  131. package/build-module/html/edit.js +2 -2
  132. package/build-module/html/edit.js.map +1 -1
  133. package/build-module/image/edit.js +4 -6
  134. package/build-module/image/edit.js.map +1 -1
  135. package/build-module/image/edit.native.js +1 -1
  136. package/build-module/image/edit.native.js.map +1 -1
  137. package/build-module/image/image.js +1 -1
  138. package/build-module/image/image.js.map +1 -1
  139. package/build-module/index.js +2 -1
  140. package/build-module/index.js.map +1 -1
  141. package/build-module/index.native.js +14 -3
  142. package/build-module/index.native.js.map +1 -1
  143. package/build-module/latest-comments/edit.js +1 -1
  144. package/build-module/latest-comments/edit.js.map +1 -1
  145. package/build-module/loginout/edit.js +1 -1
  146. package/build-module/loginout/edit.js.map +1 -1
  147. package/build-module/media-text/edit.js +1 -2
  148. package/build-module/media-text/edit.js.map +1 -1
  149. package/build-module/media-text/edit.native.js +1 -1
  150. package/build-module/media-text/edit.native.js.map +1 -1
  151. package/build-module/navigation/edit/index.js +17 -1
  152. package/build-module/navigation/edit/index.js.map +1 -1
  153. package/build-module/navigation/edit/navigation-menu-selector.js +6 -2
  154. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  155. package/build-module/navigation/edit/unsaved-inner-blocks.js +5 -4
  156. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  157. package/build-module/navigation/index.js +1 -1
  158. package/build-module/navigation/view-modal.js +32 -0
  159. package/build-module/navigation/view-modal.js.map +1 -0
  160. package/build-module/navigation/view.js +1 -30
  161. package/build-module/navigation/view.js.map +1 -1
  162. package/build-module/paragraph/edit.native.js +6 -2
  163. package/build-module/paragraph/edit.native.js.map +1 -1
  164. package/build-module/post-author/edit.js +1 -1
  165. package/build-module/post-author/edit.js.map +1 -1
  166. package/build-module/post-excerpt/edit.js +1 -1
  167. package/build-module/post-excerpt/edit.js.map +1 -1
  168. package/build-module/quote/index.js +1 -1
  169. package/build-module/quote/index.js.map +1 -1
  170. package/build-module/quote/v2/edit.js +10 -3
  171. package/build-module/quote/v2/edit.js.map +1 -1
  172. package/build-module/rss/edit.js +1 -1
  173. package/build-module/rss/edit.js.map +1 -1
  174. package/build-module/search/edit.js +11 -9
  175. package/build-module/search/edit.js.map +1 -1
  176. package/build-module/spacer/constants.js +2 -0
  177. package/build-module/spacer/constants.js.map +1 -0
  178. package/build-module/spacer/controls.js +2 -2
  179. package/build-module/spacer/controls.js.map +1 -1
  180. package/build-module/spacer/controls.native.js +1 -1
  181. package/build-module/spacer/controls.native.js.map +1 -1
  182. package/build-module/spacer/edit.js +1 -1
  183. package/build-module/spacer/edit.js.map +1 -1
  184. package/build-module/table/edit.js +9 -3
  185. package/build-module/table/edit.js.map +1 -1
  186. package/build-module/tag-cloud/edit.js +1 -1
  187. package/build-module/tag-cloud/edit.js.map +1 -1
  188. package/build-module/video/edit.js +1 -1
  189. package/build-module/video/edit.js.map +1 -1
  190. package/build-module/video/edit.native.js +1 -1
  191. package/build-module/video/edit.native.js.map +1 -1
  192. package/build-style/comments-title/editor-rtl.css +79 -0
  193. package/build-style/comments-title/editor.css +79 -0
  194. package/build-style/common-rtl.css +32 -0
  195. package/build-style/common.css +32 -0
  196. package/build-style/editor-rtl.css +12 -0
  197. package/build-style/editor.css +12 -0
  198. package/build-style/post-comments-form/style-rtl.css +9 -0
  199. package/build-style/post-comments-form/style.css +9 -0
  200. package/build-style/style-rtl.css +79 -0
  201. package/build-style/style.css +79 -0
  202. package/build-style/table/editor-rtl.css +8 -0
  203. package/build-style/table/editor.css +8 -0
  204. package/build-style/table/style-rtl.css +38 -0
  205. package/build-style/table/style.css +38 -0
  206. package/package.json +28 -28
  207. package/src/archives/edit.js +1 -1
  208. package/src/audio/edit.js +1 -1
  209. package/src/audio/edit.native.js +1 -1
  210. package/src/categories/block.json +4 -0
  211. package/src/categories/edit.js +8 -2
  212. package/src/categories/index.php +1 -0
  213. package/src/column/block.json +10 -0
  214. package/src/comment-template/hooks.js +13 -1
  215. package/src/comment-template/index.php +13 -4
  216. package/src/comments-pagination/edit.js +23 -0
  217. package/src/comments-query-loop/edit.js +1 -0
  218. package/src/comments-title/block.json +70 -0
  219. package/src/comments-title/edit.js +197 -0
  220. package/src/comments-title/editor.scss +4 -0
  221. package/src/comments-title/index.js +18 -0
  222. package/src/comments-title/index.php +68 -0
  223. package/src/common.scss +24 -1
  224. package/src/editor.scss +1 -0
  225. package/src/embed/edit.js +19 -24
  226. package/src/embed/edit.native.js +9 -14
  227. package/src/embed/util.js +34 -2
  228. package/src/file/inspector.js +1 -3
  229. package/src/gallery/edit.js +1 -1
  230. package/src/gallery/v1/edit.js +1 -1
  231. package/src/html/edit.js +2 -2
  232. package/src/image/edit.js +2 -4
  233. package/src/image/edit.native.js +1 -1
  234. package/src/image/image.js +1 -1
  235. package/src/index.js +3 -0
  236. package/src/index.native.js +12 -2
  237. package/src/latest-comments/edit.js +1 -1
  238. package/src/loginout/edit.js +1 -1
  239. package/src/media-text/edit.js +1 -2
  240. package/src/media-text/edit.native.js +1 -1
  241. package/src/navigation/block.json +1 -1
  242. package/src/navigation/edit/index.js +24 -0
  243. package/src/navigation/edit/navigation-menu-selector.js +15 -9
  244. package/src/navigation/edit/unsaved-inner-blocks.js +5 -4
  245. package/src/navigation/index.php +5 -0
  246. package/src/navigation/view-modal.js +36 -0
  247. package/src/navigation/view.js +0 -35
  248. package/src/paragraph/edit.native.js +13 -1
  249. package/src/post-author/edit.js +1 -1
  250. package/src/post-comments-form/style.scss +11 -0
  251. package/src/post-excerpt/edit.js +1 -1
  252. package/src/quote/index.js +1 -1
  253. package/src/quote/v2/edit.js +3 -0
  254. package/src/rss/edit.js +1 -1
  255. package/src/search/edit.js +13 -7
  256. package/src/search/index.php +84 -33
  257. package/src/spacer/constants.js +1 -0
  258. package/src/spacer/controls.js +2 -2
  259. package/src/spacer/controls.native.js +1 -1
  260. package/src/spacer/edit.js +1 -2
  261. package/src/table/edit.js +11 -2
  262. package/src/table/editor.scss +13 -0
  263. package/src/table/style.scss +52 -0
  264. package/src/tag-cloud/edit.js +1 -1
  265. package/src/video/edit.js +1 -1
  266. package/src/video/edit.native.js +1 -1
@@ -14,6 +14,8 @@ import { useSelect } from '@wordpress/data';
14
14
 
15
15
  const name = 'core/paragraph';
16
16
 
17
+ const allowedParentBlockAlignments = [ 'left', 'center', 'right' ];
18
+
17
19
  function ParagraphBlock( {
18
20
  attributes,
19
21
  mergeBlocks,
@@ -21,6 +23,7 @@ function ParagraphBlock( {
21
23
  setAttributes,
22
24
  style,
23
25
  clientId,
26
+ parentBlockAlignment,
24
27
  } ) {
25
28
  const isRTL = useSelect( ( select ) => {
26
29
  return !! select( blockEditorStore ).getSettings().isRTL;
@@ -40,6 +43,15 @@ function ParagraphBlock( {
40
43
  const onAlignmentChange = useCallback( ( nextAlign ) => {
41
44
  setAttributes( { align: nextAlign } );
42
45
  }, [] );
46
+
47
+ const parentTextAlignment = allowedParentBlockAlignments.includes(
48
+ parentBlockAlignment
49
+ )
50
+ ? parentBlockAlignment
51
+ : undefined;
52
+
53
+ const textAlignment = align || parentTextAlignment;
54
+
43
55
  return (
44
56
  <>
45
57
  <BlockControls group="block">
@@ -82,7 +94,7 @@ function ParagraphBlock( {
82
94
  onReplace={ onReplace }
83
95
  onRemove={ onReplace ? () => onReplace( [] ) : undefined }
84
96
  placeholder={ placeholder || __( 'Start writing…' ) }
85
- textAlign={ align }
97
+ textAlign={ textAlignment }
86
98
  __unstableEmbedURLOnPaste
87
99
  />
88
100
  </>
@@ -69,7 +69,7 @@ function PostAuthorEdit( {
69
69
  return (
70
70
  <>
71
71
  <InspectorControls>
72
- <PanelBody title={ __( 'Author Settings' ) }>
72
+ <PanelBody title={ __( 'Settings' ) }>
73
73
  { ! isDescendentOfQueryLoop && !! authors?.length && (
74
74
  <SelectControl
75
75
  label={ __( 'Author' ) }
@@ -67,4 +67,15 @@
67
67
  margin-top: 0.35em;
68
68
  }
69
69
  }
70
+
71
+ .comment-reply-title {
72
+ align-items: baseline;
73
+ display: flex;
74
+ justify-content: space-between;
75
+ margin-bottom: 0;
76
+
77
+ :where(small) {
78
+ font-size: var(--wp--preset--font-size--medium, smaller);
79
+ }
80
+ }
70
81
  }
@@ -114,7 +114,7 @@ export default function PostExcerptEditor( {
114
114
  />
115
115
  </BlockControls>
116
116
  <InspectorControls>
117
- <PanelBody title={ __( 'Post Excerpt Settings' ) }>
117
+ <PanelBody title={ __( 'Settings' ) }>
118
118
  <ToggleControl
119
119
  label={ __( 'Show link on new line' ) }
120
120
  checked={ showMoreOnNewLine }
@@ -16,7 +16,7 @@ import settingsV2 from './v2';
16
16
 
17
17
  const { name } = metadata;
18
18
 
19
- export { metadata, name };
19
+ export { metadata, name, settingsV2 };
20
20
 
21
21
  export const settingsV1 = {
22
22
  icon,
@@ -74,6 +74,7 @@ export default function QuoteEdit( {
74
74
  insertBlocksAfter,
75
75
  clientId,
76
76
  className,
77
+ style,
77
78
  } ) {
78
79
  const { citation, align } = attributes;
79
80
 
@@ -88,6 +89,7 @@ export default function QuoteEdit( {
88
89
  className: classNames( className, {
89
90
  [ `has-text-align-${ align }` ]: align,
90
91
  } ),
92
+ ...( ! isWebPlatform && { style } ),
91
93
  } );
92
94
  const innerBlocksProps = useInnerBlocksProps( blockProps, {
93
95
  template: TEMPLATE,
@@ -128,6 +130,7 @@ export default function QuoteEdit( {
128
130
  __unstableOnSplitAtEnd={ () =>
129
131
  insertBlocksAfter( createBlock( 'core/paragraph' ) )
130
132
  }
133
+ { ...( ! isWebPlatform ? { textAlign: align } : {} ) }
131
134
  />
132
135
  ) }
133
136
  </BlockQuotation>
package/src/rss/edit.js CHANGED
@@ -109,7 +109,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
109
109
  <ToolbarGroup controls={ toolbarControls } />
110
110
  </BlockControls>
111
111
  <InspectorControls>
112
- <PanelBody title={ __( 'RSS settings' ) }>
112
+ <PanelBody title={ __( 'Settings' ) }>
113
113
  <RangeControl
114
114
  label={ __( 'Number of items' ) }
115
115
  value={ itemsToShow }
@@ -103,8 +103,6 @@ export default function SearchEdit( {
103
103
  } );
104
104
  }, [ insertedInNavigationBlock ] );
105
105
  const borderRadius = style?.border?.radius;
106
- const borderColor = style?.border?.color;
107
- const borderWidth = style?.border?.width;
108
106
  const borderProps = useBorderProps( attributes );
109
107
 
110
108
  // Check for old deprecated numerical border radius. Done as a separate
@@ -392,10 +390,18 @@ export default function SearchEdit( {
392
390
  radius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;
393
391
 
394
392
  const getWrapperStyles = () => {
395
- const styles = {
396
- borderColor,
397
- borderWidth: isButtonPositionInside ? borderWidth : undefined,
398
- };
393
+ const styles = isButtonPositionInside
394
+ ? borderProps.style
395
+ : {
396
+ borderRadius: borderProps.style?.borderRadius,
397
+ borderTopLeftRadius: borderProps.style?.borderTopLeftRadius,
398
+ borderTopRightRadius:
399
+ borderProps.style?.borderTopRightRadius,
400
+ borderBottomLeftRadius:
401
+ borderProps.style?.borderBottomLeftRadius,
402
+ borderBottomRightRadius:
403
+ borderProps.style?.borderBottomRightRadius,
404
+ };
399
405
 
400
406
  const isNonZeroBorderRadius =
401
407
  borderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;
@@ -417,11 +423,11 @@ export default function SearchEdit( {
417
423
  } = borderRadius;
418
424
 
419
425
  return {
426
+ ...styles,
420
427
  borderTopLeftRadius: padBorderRadius( topLeft ),
421
428
  borderTopRightRadius: padBorderRadius( topRight ),
422
429
  borderBottomLeftRadius: padBorderRadius( bottomLeft ),
423
430
  borderBottomRightRadius: padBorderRadius( bottomRight ),
424
- ...styles,
425
431
  };
426
432
  }
427
433
 
@@ -171,6 +171,75 @@ function classnames_for_block_core_search( $attributes ) {
171
171
  return implode( ' ', $classnames );
172
172
  }
173
173
 
174
+ /**
175
+ * This generates a CSS rule for the given border property and side if provided.
176
+ * Based on whether the Search block is configured to display the button inside
177
+ * or not, the generated rule is injected into the appropriate collection of
178
+ * styles for later application in the block's markup.
179
+ *
180
+ * @param array $attributes The block attributes.
181
+ * @param string $property Border property to generate rule for e.g. width or color.
182
+ * @param string $side Optional side border. The dictates the value retrieved and final CSS property.
183
+ * @param array $wrapper_styles Current collection of wrapper styles.
184
+ * @param array $button_styles Current collection of button styles.
185
+ * @param array $input_styles Current collection of input styles.
186
+ *
187
+ * @return void
188
+ */
189
+ function apply_block_core_search_border_style( $attributes, $property, $side, &$wrapper_styles, &$button_styles, &$input_styles ) {
190
+ $is_button_inside = 'button-inside' === _wp_array_get( $attributes, array( 'buttonPosition' ), false );
191
+
192
+ $path = array( 'style', 'border', $property );
193
+
194
+ if ( $side ) {
195
+ array_splice( $path, 2, 0, $side );
196
+ }
197
+
198
+ $value = _wp_array_get( $attributes, $path, false );
199
+
200
+ if ( empty( $value ) ) {
201
+ return;
202
+ }
203
+
204
+ if ( 'color' === $property && $side ) {
205
+ $has_color_preset = strpos( $value, 'var:preset|color|' ) !== false;
206
+ if ( $has_color_preset ) {
207
+ $named_color_value = substr( $value, strrpos( $value, '|' ) + 1 );
208
+ $value = sprintf( 'var(--wp--preset--color--%s)', $named_color_value );
209
+ }
210
+ }
211
+
212
+ $property_suffix = $side ? sprintf( '%s-%s', $side, $property ) : $property;
213
+
214
+ if ( $is_button_inside ) {
215
+ $wrapper_styles[] = sprintf( 'border-%s: %s;', $property_suffix, esc_attr( $value ) );
216
+ } else {
217
+ $button_styles[] = sprintf( 'border-%s: %s;', $property_suffix, esc_attr( $value ) );
218
+ $input_styles[] = sprintf( 'border-%s: %s;', $property_suffix, esc_attr( $value ) );
219
+ }
220
+ }
221
+
222
+ /**
223
+ * This adds CSS rules for a given border property e.g. width or color. It
224
+ * injects rules into the provided wrapper, button and input style arrays for
225
+ * uniform "flat" borders or those with individual sides configured.
226
+ *
227
+ * @param array $attributes The block attributes.
228
+ * @param string $property Border property to generate rule for e.g. width or color.
229
+ * @param array $wrapper_styles Current collection of wrapper styles.
230
+ * @param array $button_styles Current collection of button styles.
231
+ * @param array $input_styles Current collection of input styles.
232
+ *
233
+ * @return void
234
+ */
235
+ function apply_block_core_search_border_styles( $attributes, $property, &$wrapper_styles, &$button_styles, &$input_styles ) {
236
+ apply_block_core_search_border_style( $attributes, $property, null, $wrapper_styles, $button_styles, $input_styles );
237
+ apply_block_core_search_border_style( $attributes, $property, 'top', $wrapper_styles, $button_styles, $input_styles );
238
+ apply_block_core_search_border_style( $attributes, $property, 'right', $wrapper_styles, $button_styles, $input_styles );
239
+ apply_block_core_search_border_style( $attributes, $property, 'bottom', $wrapper_styles, $button_styles, $input_styles );
240
+ apply_block_core_search_border_style( $attributes, $property, 'left', $wrapper_styles, $button_styles, $input_styles );
241
+ }
242
+
174
243
  /**
175
244
  * Builds an array of inline styles for the search block.
176
245
  *
@@ -201,19 +270,10 @@ function styles_for_block_core_search( $attributes ) {
201
270
  );
202
271
  }
203
272
 
204
- // Add border width styles.
205
- $has_border_width = ! empty( $attributes['style']['border']['width'] );
206
-
207
- if ( $has_border_width ) {
208
- $border_width = $attributes['style']['border']['width'];
209
-
210
- if ( $is_button_inside ) {
211
- $wrapper_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
212
- } else {
213
- $button_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
214
- $input_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
215
- }
216
- }
273
+ // Add border width and color styles.
274
+ apply_block_core_search_border_styles( $attributes, 'width', $wrapper_styles, $button_styles, $input_styles );
275
+ apply_block_core_search_border_styles( $attributes, 'color', $wrapper_styles, $button_styles, $input_styles );
276
+ apply_block_core_search_border_styles( $attributes, 'style', $wrapper_styles, $button_styles, $input_styles );
217
277
 
218
278
  // Add border radius styles.
219
279
  $has_border_radius = ! empty( $attributes['style']['border']['radius'] );
@@ -269,21 +329,6 @@ function styles_for_block_core_search( $attributes ) {
269
329
  }
270
330
  }
271
331
 
272
- // Add border color styles.
273
- $has_border_color = ! empty( $attributes['style']['border']['color'] );
274
-
275
- if ( $has_border_color ) {
276
- $border_color = $attributes['style']['border']['color'];
277
-
278
- // Apply wrapper border color if button placed inside.
279
- if ( $is_button_inside ) {
280
- $wrapper_styles[] = sprintf( 'border-color: %s;', esc_attr( $border_color ) );
281
- } else {
282
- $button_styles[] = sprintf( 'border-color: %s;', esc_attr( $border_color ) );
283
- $input_styles[] = sprintf( 'border-color: %s;', esc_attr( $border_color ) );
284
- }
285
- }
286
-
287
332
  // Add color styles.
288
333
  $has_text_color = ! empty( $attributes['style']['color']['text'] );
289
334
  if ( $has_text_color ) {
@@ -315,13 +360,19 @@ function styles_for_block_core_search( $attributes ) {
315
360
  * @return string The border color classnames to be applied to the block elements.
316
361
  */
317
362
  function get_border_color_classes_for_block_core_search( $attributes ) {
363
+ $border_color_classes = array();
318
364
  $has_custom_border_color = ! empty( $attributes['style']['border']['color'] );
319
- $border_color_classes = ! empty( $attributes['borderColor'] ) ? sprintf( 'has-border-color has-%s-border-color', $attributes['borderColor'] ) : '';
320
- // If there's a border color style and no `borderColor` text string, we still want to add the generic `has-border-color` class name to the element.
321
- if ( $has_custom_border_color && empty( $attributes['borderColor'] ) ) {
322
- $border_color_classes = 'has-border-color';
365
+ $has_named_border_color = ! empty( $attributes['borderColor'] );
366
+
367
+ if ( $has_custom_border_color || $has_named_border_color ) {
368
+ $border_color_classes[] = 'has-border-color';
369
+ }
370
+
371
+ if ( $has_named_border_color ) {
372
+ $border_color_classes[] = sprintf( 'has-%s-border-color', esc_attr( $attributes['borderColor'] ) );
323
373
  }
324
- return $border_color_classes;
374
+
375
+ return implode( ' ', $border_color_classes );
325
376
  }
326
377
 
327
378
  /**
@@ -0,0 +1 @@
1
+ export const MIN_SPACER_SIZE = 0;
@@ -15,7 +15,7 @@ import { useInstanceId } from '@wordpress/compose';
15
15
  /**
16
16
  * Internal dependencies
17
17
  */
18
- import { MIN_SPACER_SIZE } from './edit';
18
+ import { MIN_SPACER_SIZE } from './constants';
19
19
 
20
20
  function DimensionInput( { label, onChange, isResizing, value = '' } ) {
21
21
  const inputId = useInstanceId( UnitControl, 'block-spacer-height-input' );
@@ -75,7 +75,7 @@ export default function SpacerControls( {
75
75
  } ) {
76
76
  return (
77
77
  <InspectorControls>
78
- <PanelBody title={ __( 'Spacer settings' ) }>
78
+ <PanelBody title={ __( 'Settings' ) }>
79
79
  { orientation === 'horizontal' && (
80
80
  <DimensionInput
81
81
  label={ __( 'Width' ) }
@@ -14,7 +14,7 @@ import { __ } from '@wordpress/i18n';
14
14
  /**
15
15
  * Internal dependencies
16
16
  */
17
- import { MIN_SPACER_SIZE } from './edit.js';
17
+ import { MIN_SPACER_SIZE } from './constants';
18
18
  import styles from './style.scss';
19
19
 
20
20
  const DEFAULT_VALUES = { px: 100, em: 10, rem: 10, vw: 10, vh: 25 };
@@ -15,8 +15,7 @@ import { View } from '@wordpress/primitives';
15
15
  * Internal dependencies
16
16
  */
17
17
  import SpacerControls from './controls';
18
-
19
- export const MIN_SPACER_SIZE = 0;
18
+ import { MIN_SPACER_SIZE } from './constants';
20
19
 
21
20
  const ResizableSpacer = ( {
22
21
  orientation,
package/src/table/edit.js CHANGED
@@ -25,6 +25,7 @@ import {
25
25
  TextControl,
26
26
  ToggleControl,
27
27
  ToolbarDropdownMenu,
28
+ __experimentalHasSplitBorders as hasSplitBorders,
28
29
  } from '@wordpress/components';
29
30
  import {
30
31
  alignLeft,
@@ -451,7 +452,7 @@ function TableEdit( {
451
452
  { ! isEmpty && (
452
453
  <InspectorControls>
453
454
  <PanelBody
454
- title={ __( 'Table settings' ) }
455
+ title={ __( 'Settings' ) }
455
456
  className="blocks-table-settings"
456
457
  >
457
458
  <ToggleControl
@@ -477,7 +478,15 @@ function TableEdit( {
477
478
  className={ classnames(
478
479
  colorProps.className,
479
480
  borderProps.className,
480
- { 'has-fixed-layout': hasFixedLayout }
481
+ {
482
+ 'has-fixed-layout': hasFixedLayout,
483
+ // This is required in the editor only to overcome
484
+ // the fact the editor rewrites individual border
485
+ // widths into a shorthand format.
486
+ 'has-individual-borders': hasSplitBorders(
487
+ attributes?.style?.border
488
+ ),
489
+ }
481
490
  ) }
482
491
  style={ { ...colorProps.style, ...borderProps.style } }
483
492
  >
@@ -43,6 +43,19 @@
43
43
  figcaption {
44
44
  @include caption-style-theme();
45
45
  }
46
+
47
+ // This is only required in the editor to overcome the fact the editor
48
+ // rewrites border width styles into shorthand.
49
+ table.has-individual-borders {
50
+ > *,
51
+ tr,
52
+ th,
53
+ td {
54
+ border-width: $border-width;
55
+ border-style: solid;
56
+ border-color: currentColor;
57
+ }
58
+ }
46
59
  }
47
60
 
48
61
  .blocks-table__placeholder-form.blocks-table__placeholder-form {
@@ -112,6 +112,58 @@
112
112
  }
113
113
  }
114
114
 
115
+ table[style*="border-top-color"] {
116
+ > *,
117
+ tr:first-child {
118
+ border-top-color: inherit;
119
+
120
+ th,
121
+ td {
122
+ border-top-color: inherit;
123
+ }
124
+ }
125
+
126
+ tr:not(:first-child) {
127
+ border-top-color: currentColor;
128
+ }
129
+ }
130
+ table[style*="border-right-color"] {
131
+ > *,
132
+ tr,
133
+ th,
134
+ td:last-child {
135
+ border-right-color: inherit;
136
+ }
137
+ }
138
+ table[style*="border-bottom-color"] {
139
+ > *,
140
+ tr:last-child {
141
+ border-bottom-color: inherit;
142
+
143
+ th,
144
+ td {
145
+ border-bottom-color: inherit;
146
+ }
147
+ }
148
+
149
+ // Border support classes and styles are applied on the table block
150
+ // itself. This means that without the rule below every table row would
151
+ // have a bottom border matching the color of the table's border.
152
+ // This style gives the best visual appearance and most expected result
153
+ // until we can control individual table rows or cells via inner blocks.
154
+ tr:not(:last-child) {
155
+ border-bottom-color: currentColor;
156
+ }
157
+ }
158
+ table[style*="border-left-color"] {
159
+ > *,
160
+ tr,
161
+ th,
162
+ td:first-child {
163
+ border-left-color: inherit;
164
+ }
165
+ }
166
+
115
167
  table[style*="border-style"] {
116
168
  > *,
117
169
  tr,
@@ -110,7 +110,7 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) {
110
110
 
111
111
  const inspectorControls = (
112
112
  <InspectorControls>
113
- <PanelBody title={ __( 'Tag Cloud settings' ) }>
113
+ <PanelBody title={ __( 'Settings' ) }>
114
114
  <SelectControl
115
115
  label={ __( 'Taxonomy' ) }
116
116
  options={ getTaxonomyOptions() }
package/src/video/edit.js CHANGED
@@ -191,7 +191,7 @@ function VideoEdit( {
191
191
  />
192
192
  </BlockControls>
193
193
  <InspectorControls>
194
- <PanelBody title={ __( 'Video settings' ) }>
194
+ <PanelBody title={ __( 'Settings' ) }>
195
195
  <VideoCommonSettings
196
196
  setAttributes={ setAttributes }
197
197
  attributes={ attributes }
@@ -248,7 +248,7 @@ class VideoEdit extends Component {
248
248
  ) }
249
249
  { isSelected && (
250
250
  <InspectorControls>
251
- <PanelBody title={ __( 'Video settings' ) }>
251
+ <PanelBody title={ __( 'Settings' ) }>
252
252
  <VideoCommonSettings
253
253
  setAttributes={ setAttributes }
254
254
  attributes={ attributes }