@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.
- package/CHANGELOG.md +2 -0
- package/build/archives/edit.js +1 -1
- package/build/archives/edit.js.map +1 -1
- package/build/audio/edit.js +1 -1
- package/build/audio/edit.js.map +1 -1
- package/build/audio/edit.native.js +1 -1
- package/build/audio/edit.native.js.map +1 -1
- package/build/categories/edit.js +8 -3
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +4 -0
- package/build/categories/index.js.map +1 -1
- package/build/column/index.js +10 -0
- package/build/column/index.js.map +1 -1
- package/build/comment-template/hooks.js +11 -3
- package/build/comment-template/hooks.js.map +1 -1
- package/build/comments-pagination/edit.js +18 -1
- package/build/comments-pagination/edit.js.map +1 -1
- package/build/comments-query-loop/edit.js +1 -1
- package/build/comments-query-loop/edit.js.map +1 -1
- package/build/comments-title/edit.js +149 -0
- package/build/comments-title/edit.js.map +1 -0
- package/build/comments-title/index.js +101 -0
- package/build/comments-title/index.js.map +1 -0
- package/build/embed/edit.js +12 -18
- package/build/embed/edit.js.map +1 -1
- package/build/embed/edit.native.js +1 -7
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/util.js +29 -4
- package/build/embed/util.js.map +1 -1
- package/build/file/inspector.js +2 -4
- package/build/file/inspector.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/v1/edit.js +1 -1
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/html/edit.js +2 -2
- package/build/html/edit.js.map +1 -1
- package/build/image/edit.js +4 -6
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +1 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +1 -1
- package/build/image/image.js.map +1 -1
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/build/index.native.js +14 -3
- package/build/index.native.js.map +1 -1
- package/build/latest-comments/edit.js +1 -1
- package/build/latest-comments/edit.js.map +1 -1
- package/build/loginout/edit.js +1 -1
- package/build/loginout/edit.js.map +1 -1
- package/build/media-text/edit.js +1 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/edit.native.js +1 -1
- package/build/media-text/edit.native.js.map +1 -1
- package/build/navigation/edit/index.js +17 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +7 -2
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +5 -4
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/index.js +1 -1
- package/build/navigation/view-modal.js +37 -0
- package/build/navigation/view-modal.js.map +1 -0
- package/build/navigation/view.js +1 -34
- package/build/navigation/view.js.map +1 -1
- package/build/paragraph/edit.native.js +6 -2
- package/build/paragraph/edit.native.js.map +1 -1
- package/build/post-author/edit.js +1 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/quote/index.js +6 -0
- package/build/quote/index.js.map +1 -1
- package/build/quote/v2/edit.js +11 -3
- package/build/quote/v2/edit.js.map +1 -1
- package/build/rss/edit.js +1 -1
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.js +11 -9
- package/build/search/edit.js.map +1 -1
- package/build/spacer/constants.js +9 -0
- package/build/spacer/constants.js.map +1 -0
- package/build/spacer/controls.js +3 -3
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/controls.native.js +2 -2
- package/build/spacer/controls.native.js.map +1 -1
- package/build/spacer/edit.js +5 -6
- package/build/spacer/edit.js.map +1 -1
- package/build/table/edit.js +8 -2
- package/build/table/edit.js.map +1 -1
- package/build/tag-cloud/edit.js +1 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +1 -1
- package/build/video/edit.native.js.map +1 -1
- package/build-module/archives/edit.js +1 -1
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/audio/edit.js +1 -1
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/edit.native.js +1 -1
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/categories/edit.js +8 -3
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +4 -0
- package/build-module/categories/index.js.map +1 -1
- package/build-module/column/index.js +10 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/comment-template/hooks.js +11 -3
- package/build-module/comment-template/hooks.js.map +1 -1
- package/build-module/comments-pagination/edit.js +19 -2
- package/build-module/comments-pagination/edit.js.map +1 -1
- package/build-module/comments-query-loop/edit.js +1 -1
- package/build-module/comments-query-loop/edit.js.map +1 -1
- package/build-module/comments-title/edit.js +133 -0
- package/build-module/comments-title/edit.js.map +1 -0
- package/build-module/comments-title/index.js +88 -0
- package/build-module/comments-title/index.js.map +1 -0
- package/build-module/embed/edit.js +13 -19
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/edit.native.js +2 -8
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/util.js +25 -3
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/inspector.js +2 -4
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/v1/edit.js +1 -1
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/html/edit.js +2 -2
- package/build-module/html/edit.js.map +1 -1
- package/build-module/image/edit.js +4 -6
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +1 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +1 -1
- package/build-module/image/image.js.map +1 -1
- package/build-module/index.js +2 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +14 -3
- package/build-module/index.native.js.map +1 -1
- package/build-module/latest-comments/edit.js +1 -1
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/loginout/edit.js +1 -1
- package/build-module/loginout/edit.js.map +1 -1
- package/build-module/media-text/edit.js +1 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/edit.native.js +1 -1
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/navigation/edit/index.js +17 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +6 -2
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +5 -4
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/index.js +1 -1
- package/build-module/navigation/view-modal.js +32 -0
- package/build-module/navigation/view-modal.js.map +1 -0
- package/build-module/navigation/view.js +1 -30
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/paragraph/edit.native.js +6 -2
- package/build-module/paragraph/edit.native.js.map +1 -1
- package/build-module/post-author/edit.js +1 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -1
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/quote/index.js +1 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/v2/edit.js +10 -3
- package/build-module/quote/v2/edit.js.map +1 -1
- package/build-module/rss/edit.js +1 -1
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.js +11 -9
- package/build-module/search/edit.js.map +1 -1
- package/build-module/spacer/constants.js +2 -0
- package/build-module/spacer/constants.js.map +1 -0
- package/build-module/spacer/controls.js +2 -2
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/controls.native.js +1 -1
- package/build-module/spacer/controls.native.js.map +1 -1
- package/build-module/spacer/edit.js +1 -1
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/table/edit.js +9 -3
- package/build-module/table/edit.js.map +1 -1
- package/build-module/tag-cloud/edit.js +1 -1
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/video/edit.js +1 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +1 -1
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/comments-title/editor-rtl.css +79 -0
- package/build-style/comments-title/editor.css +79 -0
- package/build-style/common-rtl.css +32 -0
- package/build-style/common.css +32 -0
- package/build-style/editor-rtl.css +12 -0
- package/build-style/editor.css +12 -0
- package/build-style/post-comments-form/style-rtl.css +9 -0
- package/build-style/post-comments-form/style.css +9 -0
- package/build-style/style-rtl.css +79 -0
- package/build-style/style.css +79 -0
- package/build-style/table/editor-rtl.css +8 -0
- package/build-style/table/editor.css +8 -0
- package/build-style/table/style-rtl.css +38 -0
- package/build-style/table/style.css +38 -0
- package/package.json +28 -28
- package/src/archives/edit.js +1 -1
- package/src/audio/edit.js +1 -1
- package/src/audio/edit.native.js +1 -1
- package/src/categories/block.json +4 -0
- package/src/categories/edit.js +8 -2
- package/src/categories/index.php +1 -0
- package/src/column/block.json +10 -0
- package/src/comment-template/hooks.js +13 -1
- package/src/comment-template/index.php +13 -4
- package/src/comments-pagination/edit.js +23 -0
- package/src/comments-query-loop/edit.js +1 -0
- package/src/comments-title/block.json +70 -0
- package/src/comments-title/edit.js +197 -0
- package/src/comments-title/editor.scss +4 -0
- package/src/comments-title/index.js +18 -0
- package/src/comments-title/index.php +68 -0
- package/src/common.scss +24 -1
- package/src/editor.scss +1 -0
- package/src/embed/edit.js +19 -24
- package/src/embed/edit.native.js +9 -14
- package/src/embed/util.js +34 -2
- package/src/file/inspector.js +1 -3
- package/src/gallery/edit.js +1 -1
- package/src/gallery/v1/edit.js +1 -1
- package/src/html/edit.js +2 -2
- package/src/image/edit.js +2 -4
- package/src/image/edit.native.js +1 -1
- package/src/image/image.js +1 -1
- package/src/index.js +3 -0
- package/src/index.native.js +12 -2
- package/src/latest-comments/edit.js +1 -1
- package/src/loginout/edit.js +1 -1
- package/src/media-text/edit.js +1 -2
- package/src/media-text/edit.native.js +1 -1
- package/src/navigation/block.json +1 -1
- package/src/navigation/edit/index.js +24 -0
- package/src/navigation/edit/navigation-menu-selector.js +15 -9
- package/src/navigation/edit/unsaved-inner-blocks.js +5 -4
- package/src/navigation/index.php +5 -0
- package/src/navigation/view-modal.js +36 -0
- package/src/navigation/view.js +0 -35
- package/src/paragraph/edit.native.js +13 -1
- package/src/post-author/edit.js +1 -1
- package/src/post-comments-form/style.scss +11 -0
- package/src/post-excerpt/edit.js +1 -1
- package/src/quote/index.js +1 -1
- package/src/quote/v2/edit.js +3 -0
- package/src/rss/edit.js +1 -1
- package/src/search/edit.js +13 -7
- package/src/search/index.php +84 -33
- package/src/spacer/constants.js +1 -0
- package/src/spacer/controls.js +2 -2
- package/src/spacer/controls.native.js +1 -1
- package/src/spacer/edit.js +1 -2
- package/src/table/edit.js +11 -2
- package/src/table/editor.scss +13 -0
- package/src/table/style.scss +52 -0
- package/src/tag-cloud/edit.js +1 -1
- package/src/video/edit.js +1 -1
- 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={
|
|
97
|
+
textAlign={ textAlignment }
|
|
86
98
|
__unstableEmbedURLOnPaste
|
|
87
99
|
/>
|
|
88
100
|
</>
|
package/src/post-author/edit.js
CHANGED
|
@@ -69,7 +69,7 @@ function PostAuthorEdit( {
|
|
|
69
69
|
return (
|
|
70
70
|
<>
|
|
71
71
|
<InspectorControls>
|
|
72
|
-
<PanelBody title={ __( '
|
|
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
|
}
|
package/src/post-excerpt/edit.js
CHANGED
|
@@ -114,7 +114,7 @@ export default function PostExcerptEditor( {
|
|
|
114
114
|
/>
|
|
115
115
|
</BlockControls>
|
|
116
116
|
<InspectorControls>
|
|
117
|
-
<PanelBody title={ __( '
|
|
117
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
118
118
|
<ToggleControl
|
|
119
119
|
label={ __( 'Show link on new line' ) }
|
|
120
120
|
checked={ showMoreOnNewLine }
|
package/src/quote/index.js
CHANGED
package/src/quote/v2/edit.js
CHANGED
|
@@ -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={ __( '
|
|
112
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
113
113
|
<RangeControl
|
|
114
114
|
label={ __( 'Number of items' ) }
|
|
115
115
|
value={ itemsToShow }
|
package/src/search/edit.js
CHANGED
|
@@ -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
|
-
|
|
397
|
-
|
|
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
|
|
package/src/search/index.php
CHANGED
|
@@ -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
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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
|
-
$
|
|
320
|
-
|
|
321
|
-
if ( $has_custom_border_color
|
|
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
|
-
|
|
374
|
+
|
|
375
|
+
return implode( ' ', $border_color_classes );
|
|
325
376
|
}
|
|
326
377
|
|
|
327
378
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const MIN_SPACER_SIZE = 0;
|
package/src/spacer/controls.js
CHANGED
|
@@ -15,7 +15,7 @@ import { useInstanceId } from '@wordpress/compose';
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
17
17
|
*/
|
|
18
|
-
import { MIN_SPACER_SIZE } from './
|
|
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={ __( '
|
|
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 './
|
|
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 };
|
package/src/spacer/edit.js
CHANGED
|
@@ -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={ __( '
|
|
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
|
-
{
|
|
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
|
>
|
package/src/table/editor.scss
CHANGED
|
@@ -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 {
|
package/src/table/style.scss
CHANGED
|
@@ -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,
|
package/src/tag-cloud/edit.js
CHANGED
|
@@ -110,7 +110,7 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) {
|
|
|
110
110
|
|
|
111
111
|
const inspectorControls = (
|
|
112
112
|
<InspectorControls>
|
|
113
|
-
<PanelBody title={ __( '
|
|
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={ __( '
|
|
194
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
195
195
|
<VideoCommonSettings
|
|
196
196
|
setAttributes={ setAttributes }
|
|
197
197
|
attributes={ attributes }
|
package/src/video/edit.native.js
CHANGED
|
@@ -248,7 +248,7 @@ class VideoEdit extends Component {
|
|
|
248
248
|
) }
|
|
249
249
|
{ isSelected && (
|
|
250
250
|
<InspectorControls>
|
|
251
|
-
<PanelBody title={ __( '
|
|
251
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
252
252
|
<VideoCommonSettings
|
|
253
253
|
setAttributes={ setAttributes }
|
|
254
254
|
attributes={ attributes }
|