@wordpress/block-library 9.21.0 → 9.23.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 +4 -0
- package/build/calendar/index.js +1 -0
- package/build/calendar/index.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +13 -13
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments/edit/index.js +4 -2
- package/build/comments/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +9 -12
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/index.js +1 -1
- package/build/cover/index.js.map +1 -1
- package/build/details/edit.js +1 -5
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +1 -1
- package/build/details/index.js.map +1 -1
- package/build/group/edit.js +17 -13
- package/build/group/edit.js.map +1 -1
- package/build/image/edit.js +0 -6
- package/build/image/edit.js.map +1 -1
- package/build/latest-posts/edit.js +100 -54
- package/build/latest-posts/edit.js.map +1 -1
- package/build/navigation/view.js +2 -1
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +0 -21
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +0 -3
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-link/transforms.js +0 -2
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/navigation-link/update-attributes.js +0 -1
- package/build/navigation-link/update-attributes.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -24
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +0 -3
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/post-comments-count/index.js +0 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-link/index.js +0 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-featured-image/edit.js +15 -5
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +47 -59
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +2 -2
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +2 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/query-content.js +15 -29
- package/build/query/edit/query-content.js.map +1 -1
- package/build/quote/index.js +1 -1
- package/build/quote/index.js.map +1 -1
- package/build/separator/edit.js +13 -12
- package/build/separator/edit.js.map +1 -1
- package/build/social-links/edit.js +29 -31
- package/build/social-links/edit.js.map +1 -1
- package/build/table/index.js +3 -3
- package/build/table/index.js.map +1 -1
- package/build/table/transforms.js +11 -3
- package/build/table/transforms.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/hooks.js +6 -3
- package/build/table-of-contents/hooks.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +14 -12
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +2 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build-module/calendar/index.js +1 -0
- package/build-module/calendar/index.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +14 -14
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments/edit/index.js +4 -2
- package/build-module/comments/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +10 -13
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/index.js +1 -1
- package/build-module/cover/index.js.map +1 -1
- package/build-module/details/edit.js +1 -5
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +1 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/group/edit.js +16 -14
- package/build-module/group/edit.js.map +1 -1
- package/build-module/image/edit.js +0 -6
- package/build-module/image/edit.js.map +1 -1
- package/build-module/latest-posts/edit.js +100 -54
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/navigation/view.js +2 -1
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +0 -21
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +0 -3
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-link/transforms.js +0 -2
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +0 -1
- package/build-module/navigation-link/update-attributes.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -24
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +0 -3
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/post-comments-count/index.js +0 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +0 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-featured-image/edit.js +15 -5
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +49 -61
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +2 -2
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +2 -2
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/edit/query-content.js +16 -30
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/quote/index.js +1 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/separator/edit.js +15 -14
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/social-links/edit.js +30 -32
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table/index.js +3 -3
- package/build-module/table/index.js.map +1 -1
- package/build-module/table/transforms.js +11 -3
- package/build-module/table/transforms.js.map +1 -1
- package/build-module/table-of-contents/edit.js +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/hooks.js +6 -3
- package/build-module/table-of-contents/hooks.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +14 -12
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +2 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-style/editor-rtl.css +1 -50
- package/build-style/editor.css +1 -50
- package/build-style/media-text/style-rtl.css +0 -2
- package/build-style/media-text/style.css +0 -2
- package/build-style/search/style-rtl.css +1 -0
- package/build-style/search/style.css +1 -0
- package/build-style/social-links/editor-rtl.css +1 -50
- package/build-style/social-links/editor.css +1 -50
- package/build-style/style-rtl.css +1 -6
- package/build-style/style.css +1 -6
- package/build-style/tag-cloud/style-rtl.css +0 -4
- package/build-style/tag-cloud/style.css +0 -4
- package/package.json +35 -35
- package/src/button/index.php +2 -3
- package/src/calendar/block.json +1 -0
- package/src/comments/edit/comments-inspector-controls.js +14 -12
- package/src/comments/edit/index.js +2 -1
- package/src/cover/edit/inspector-controls.js +9 -12
- package/src/cover/index.js +1 -1
- package/src/details/edit.js +6 -8
- package/src/details/index.js +1 -1
- package/src/file/index.php +2 -3
- package/src/group/edit.js +11 -10
- package/src/image/edit.js +0 -4
- package/src/latest-comments/index.php +1 -1
- package/src/latest-posts/edit.js +113 -81
- package/src/latest-posts/index.php +3 -0
- package/src/loginout/index.php +5 -1
- package/src/media-text/style.scss +0 -2
- package/src/navigation/index.php +1 -2
- package/src/navigation/view.js +2 -1
- package/src/navigation-link/block.json +0 -3
- package/src/navigation-link/edit.js +1 -22
- package/src/navigation-link/index.php +2 -6
- package/src/navigation-link/transforms.js +1 -2
- package/src/navigation-link/update-attributes.js +0 -1
- package/src/navigation-submenu/block.json +0 -3
- package/src/navigation-submenu/edit.js +1 -24
- package/src/navigation-submenu/index.php +1 -5
- package/src/post-author/index.php +1 -1
- package/src/post-author-name/index.php +1 -1
- package/src/post-comments-count/block.json +0 -1
- package/src/post-comments-count/index.php +4 -0
- package/src/post-comments-link/block.json +0 -1
- package/src/post-comments-link/index.php +4 -0
- package/src/post-featured-image/edit.js +94 -77
- package/src/query/edit/inspector-controls/index.js +66 -91
- package/src/query/edit/inspector-controls/parent-control.js +2 -2
- package/src/query/edit/inspector-controls/taxonomy-controls.js +2 -2
- package/src/query/edit/query-content.js +17 -27
- package/src/quote/index.js +1 -1
- package/src/search/index.php +12 -9
- package/src/search/style.scss +1 -0
- package/src/separator/edit.js +16 -12
- package/src/social-links/edit.js +29 -30
- package/src/social-links/editor.scss +1 -59
- package/src/table/index.js +3 -3
- package/src/table/transforms.js +14 -2
- package/src/table-of-contents/edit.js +1 -1
- package/src/table-of-contents/hooks.js +5 -2
- package/src/tag-cloud/style.scss +0 -5
- package/src/template-part/edit/advanced-controls.js +9 -8
- package/src/template-part/edit/index.js +1 -0
- package/build/utils/messages.js +0 -22
- package/build/utils/messages.js.map +0 -1
- package/build-module/utils/messages.js +0 -15
- package/build-module/utils/messages.js.map +0 -1
- package/src/utils/messages.js +0 -31
package/src/separator/edit.js
CHANGED
|
@@ -6,12 +6,13 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { HorizontalRule
|
|
9
|
+
import { HorizontalRule } from '@wordpress/components';
|
|
10
10
|
import {
|
|
11
11
|
useBlockProps,
|
|
12
12
|
getColorClassName,
|
|
13
13
|
__experimentalUseColorProps as useColorProps,
|
|
14
14
|
InspectorControls,
|
|
15
|
+
privateApis as blockEditorPrivateApis,
|
|
15
16
|
} from '@wordpress/block-editor';
|
|
16
17
|
import { __ } from '@wordpress/i18n';
|
|
17
18
|
|
|
@@ -19,9 +20,15 @@ import { __ } from '@wordpress/i18n';
|
|
|
19
20
|
* Internal dependencies
|
|
20
21
|
*/
|
|
21
22
|
import useDeprecatedOpacity from './use-deprecated-opacity';
|
|
22
|
-
import {
|
|
23
|
+
import { unlock } from '../lock-unlock';
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
const { HTMLElementControl } = unlock( blockEditorPrivateApis );
|
|
26
|
+
|
|
27
|
+
export default function SeparatorEdit( {
|
|
28
|
+
attributes,
|
|
29
|
+
setAttributes,
|
|
30
|
+
clientId,
|
|
31
|
+
} ) {
|
|
25
32
|
const { backgroundColor, opacity, style, tagName } = attributes;
|
|
26
33
|
const colorProps = useColorProps( attributes );
|
|
27
34
|
const currentColor = colorProps?.style?.backgroundColor;
|
|
@@ -52,19 +59,16 @@ export default function SeparatorEdit( { attributes, setAttributes } ) {
|
|
|
52
59
|
return (
|
|
53
60
|
<>
|
|
54
61
|
<InspectorControls group="advanced">
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
<HTMLElementControl
|
|
63
|
+
tagName={ tagName }
|
|
64
|
+
onChange={ ( value ) =>
|
|
65
|
+
setAttributes( { tagName: value } )
|
|
66
|
+
}
|
|
67
|
+
clientId={ clientId }
|
|
59
68
|
options={ [
|
|
60
69
|
{ label: __( 'Default (<hr>)' ), value: 'hr' },
|
|
61
70
|
{ label: '<div>', value: 'div' },
|
|
62
71
|
] }
|
|
63
|
-
value={ tagName }
|
|
64
|
-
onChange={ ( value ) =>
|
|
65
|
-
setAttributes( { tagName: value } )
|
|
66
|
-
}
|
|
67
|
-
help={ htmlElementMessages[ tagName ] }
|
|
68
72
|
/>
|
|
69
73
|
</InspectorControls>
|
|
70
74
|
<Wrapper
|
package/src/social-links/edit.js
CHANGED
|
@@ -6,7 +6,7 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useEffect
|
|
9
|
+
import { useEffect } from '@wordpress/element';
|
|
10
10
|
import {
|
|
11
11
|
BlockControls,
|
|
12
12
|
useInnerBlocksProps,
|
|
@@ -57,16 +57,21 @@ export function SocialLinksEdit( props ) {
|
|
|
57
57
|
|
|
58
58
|
const {
|
|
59
59
|
iconBackgroundColorValue,
|
|
60
|
-
customIconBackgroundColor,
|
|
61
60
|
iconColorValue,
|
|
62
61
|
openInNewTab,
|
|
63
62
|
showLabels,
|
|
64
63
|
size,
|
|
65
64
|
} = attributes;
|
|
66
65
|
|
|
67
|
-
const hasSelectedChild = useSelect(
|
|
68
|
-
( select ) =>
|
|
69
|
-
|
|
66
|
+
const { hasSocialIcons, hasSelectedChild } = useSelect(
|
|
67
|
+
( select ) => {
|
|
68
|
+
const { getBlockCount, hasSelectedInnerBlock } =
|
|
69
|
+
select( blockEditorStore );
|
|
70
|
+
return {
|
|
71
|
+
hasSocialIcons: getBlockCount( clientId ) > 0,
|
|
72
|
+
hasSelectedChild: hasSelectedInnerBlock( clientId ),
|
|
73
|
+
};
|
|
74
|
+
},
|
|
70
75
|
[ clientId ]
|
|
71
76
|
);
|
|
72
77
|
|
|
@@ -78,33 +83,25 @@ export function SocialLinksEdit( props ) {
|
|
|
78
83
|
|
|
79
84
|
// Remove icon background color when logos only style is selected or
|
|
80
85
|
// restore it when any other style is selected.
|
|
81
|
-
const backgroundBackupRef = useRef( {} );
|
|
82
86
|
useEffect( () => {
|
|
83
87
|
if ( logosOnly ) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
let restore;
|
|
89
|
+
setAttributes( ( prev ) => {
|
|
90
|
+
restore = {
|
|
91
|
+
iconBackgroundColor: prev.iconBackgroundColor,
|
|
92
|
+
iconBackgroundColorValue: prev.iconBackgroundColorValue,
|
|
93
|
+
customIconBackgroundColor: prev.customIconBackgroundColor,
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
iconBackgroundColor: undefined,
|
|
97
|
+
iconBackgroundColorValue: undefined,
|
|
98
|
+
customIconBackgroundColor: undefined,
|
|
99
|
+
};
|
|
93
100
|
} );
|
|
94
|
-
} else {
|
|
95
|
-
setAttributes( { ...backgroundBackupRef.current } );
|
|
96
|
-
}
|
|
97
|
-
}, [ logosOnly ] );
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<div className="wp-social-link wp-social-link-twitter"></div>
|
|
103
|
-
<div className="wp-social-link wp-social-link-facebook"></div>
|
|
104
|
-
<div className="wp-social-link wp-social-link-instagram"></div>
|
|
105
|
-
</div>
|
|
106
|
-
</li>
|
|
107
|
-
);
|
|
102
|
+
return () => setAttributes( { ...restore } );
|
|
103
|
+
}
|
|
104
|
+
}, [ logosOnly, setAttributes ] );
|
|
108
105
|
|
|
109
106
|
// Fallback color values are used maintain selections in case switching
|
|
110
107
|
// themes and named colors in palette do not match.
|
|
@@ -117,11 +114,13 @@ export function SocialLinksEdit( props ) {
|
|
|
117
114
|
|
|
118
115
|
const blockProps = useBlockProps( { className } );
|
|
119
116
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
120
|
-
placeholder: ! isSelected && SocialPlaceholder,
|
|
121
117
|
templateLock: false,
|
|
122
118
|
orientation: attributes.layout?.orientation ?? 'horizontal',
|
|
123
119
|
__experimentalAppenderTagName: 'li',
|
|
124
|
-
renderAppender:
|
|
120
|
+
renderAppender:
|
|
121
|
+
! hasSocialIcons || hasAnySelected
|
|
122
|
+
? InnerBlocks.ButtonBlockAppender
|
|
123
|
+
: undefined,
|
|
125
124
|
} );
|
|
126
125
|
|
|
127
126
|
const POPOVER_PROPS = {
|
|
@@ -12,67 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
// Specificity for the following styles are fixed at 0-1-0 to match and be
|
|
14
14
|
// overridable by global styles.
|
|
15
|
-
:root :where(.wp-block-social-links)
|
|
16
|
-
:root :where(.wp-block-social-links.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
15
|
+
:root :where(.wp-block-social-links) {
|
|
17
16
|
padding: 0;
|
|
18
17
|
}
|
|
19
|
-
:root :where(.wp-block-social-links__social-placeholder .wp-social-link) {
|
|
20
|
-
padding: 0.25em;
|
|
21
|
-
}
|
|
22
|
-
:root :where(.wp-block-social-links.is-style-pill-shape .wp-block-social-links__social-placeholder .wp-social-link) {
|
|
23
|
-
padding-left: calc((2/3) * 1em);
|
|
24
|
-
padding-right: calc((2/3) * 1em);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Placeholder/setup state.
|
|
28
|
-
.wp-block-social-links__social-placeholder {
|
|
29
|
-
display: flex;
|
|
30
|
-
opacity: 0.8;
|
|
31
|
-
list-style: none;
|
|
32
|
-
|
|
33
|
-
// Use the first link to set the height.
|
|
34
|
-
> .wp-social-link {
|
|
35
|
-
// Use !important to keep the selector simple.
|
|
36
|
-
padding-left: 0 !important;
|
|
37
|
-
margin-left: 0 !important;
|
|
38
|
-
padding-right: 0 !important;
|
|
39
|
-
margin-right: 0 !important;
|
|
40
|
-
width: 0 !important;
|
|
41
|
-
visibility: hidden;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Wrap the remaining placeholders in a container so the plus can overlap.
|
|
45
|
-
> .wp-block-social-links__social-placeholder-icons {
|
|
46
|
-
display: flex;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.wp-social-link::before {
|
|
50
|
-
content: "";
|
|
51
|
-
display: block;
|
|
52
|
-
width: 1em;
|
|
53
|
-
height: 1em;
|
|
54
|
-
border-radius: $radius-round;
|
|
55
|
-
|
|
56
|
-
.is-style-logos-only & {
|
|
57
|
-
background: currentColor;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Selected placeholder state.
|
|
63
|
-
.wp-block-social-links .wp-block-social-links__social-prompt {
|
|
64
|
-
min-height: $button-size-small;
|
|
65
|
-
list-style: none;
|
|
66
|
-
|
|
67
|
-
// Show as block UI.
|
|
68
|
-
font-family: $default-font;
|
|
69
|
-
font-size: $default-font-size;
|
|
70
|
-
line-height: $button-size-small;
|
|
71
|
-
margin-top: auto;
|
|
72
|
-
margin-bottom: auto;
|
|
73
|
-
cursor: default;
|
|
74
|
-
padding-right: $grid-unit-10;
|
|
75
|
-
}
|
|
76
18
|
|
|
77
19
|
// Center flex items. This has an equivalent in style.scss.
|
|
78
20
|
.wp-block[data-align="center"] > .wp-block-social-links,
|
package/src/table/index.js
CHANGED
|
@@ -48,7 +48,7 @@ export const settings = {
|
|
|
48
48
|
tag: 'td',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
content: 'Jaco Pastorius',
|
|
51
|
+
content: __( 'Jaco Pastorius' ),
|
|
52
52
|
tag: 'td',
|
|
53
53
|
},
|
|
54
54
|
{
|
|
@@ -64,7 +64,7 @@ export const settings = {
|
|
|
64
64
|
tag: 'td',
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
content: 'Betty Carter',
|
|
67
|
+
content: __( 'Betty Carter' ),
|
|
68
68
|
tag: 'td',
|
|
69
69
|
},
|
|
70
70
|
{
|
|
@@ -80,7 +80,7 @@ export const settings = {
|
|
|
80
80
|
tag: 'td',
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
|
-
content: 'Bebo Valdés',
|
|
83
|
+
content: __( 'Bebo Valdés' ),
|
|
84
84
|
tag: 'td',
|
|
85
85
|
},
|
|
86
86
|
{
|
package/src/table/transforms.js
CHANGED
|
@@ -15,12 +15,12 @@ const tableContentPasteSchema = ( { phrasingContentSchema } ) => ( {
|
|
|
15
15
|
th: {
|
|
16
16
|
allowEmpty: true,
|
|
17
17
|
children: phrasingContentSchema,
|
|
18
|
-
attributes: [ 'scope', 'colspan', 'rowspan' ],
|
|
18
|
+
attributes: [ 'scope', 'colspan', 'rowspan', 'style' ],
|
|
19
19
|
},
|
|
20
20
|
td: {
|
|
21
21
|
allowEmpty: true,
|
|
22
22
|
children: phrasingContentSchema,
|
|
23
|
-
attributes: [ 'colspan', 'rowspan' ],
|
|
23
|
+
attributes: [ 'colspan', 'rowspan', 'style' ],
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
},
|
|
@@ -79,11 +79,23 @@ const transforms = {
|
|
|
79
79
|
col.getAttribute( 'colspan' )
|
|
80
80
|
);
|
|
81
81
|
|
|
82
|
+
const { textAlign } = col.style || {};
|
|
83
|
+
|
|
84
|
+
let align;
|
|
85
|
+
if (
|
|
86
|
+
textAlign === 'left' ||
|
|
87
|
+
textAlign === 'center' ||
|
|
88
|
+
textAlign === 'right'
|
|
89
|
+
) {
|
|
90
|
+
align = textAlign;
|
|
91
|
+
}
|
|
92
|
+
|
|
82
93
|
colAcc.push( {
|
|
83
94
|
tag: col.nodeName.toLowerCase(),
|
|
84
95
|
content: col.innerHTML,
|
|
85
96
|
rowspan,
|
|
86
97
|
colspan,
|
|
98
|
+
align,
|
|
87
99
|
} );
|
|
88
100
|
|
|
89
101
|
return colAcc;
|
|
@@ -148,8 +148,11 @@ function observeCallback( select, dispatch, clientId ) {
|
|
|
148
148
|
|
|
149
149
|
const headings = getLatestHeadings( select, clientId );
|
|
150
150
|
if ( ! fastDeepEqual( headings, attributes.headings ) ) {
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
// Executing the update in a microtask ensures that the non-persistent marker doesn't affect an attribute triggering the change.
|
|
152
|
+
window.queueMicrotask( () => {
|
|
153
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
154
|
+
updateBlockAttributes( clientId, { headings } );
|
|
155
|
+
} );
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
158
|
|
package/src/tag-cloud/style.scss
CHANGED
|
@@ -5,12 +5,15 @@ import { useEntityProp, store as coreStore } from '@wordpress/core-data';
|
|
|
5
5
|
import { SelectControl, TextControl } from '@wordpress/components';
|
|
6
6
|
import { sprintf, __ } from '@wordpress/i18n';
|
|
7
7
|
import { useSelect } from '@wordpress/data';
|
|
8
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Internal dependencies
|
|
11
12
|
*/
|
|
12
13
|
import { TemplatePartImportControls } from './import-controls';
|
|
13
|
-
import {
|
|
14
|
+
import { unlock } from '../../lock-unlock';
|
|
15
|
+
|
|
16
|
+
const { HTMLElementControl } = unlock( blockEditorPrivateApis );
|
|
14
17
|
|
|
15
18
|
export function TemplatePartAdvancedControls( {
|
|
16
19
|
tagName,
|
|
@@ -19,6 +22,7 @@ export function TemplatePartAdvancedControls( {
|
|
|
19
22
|
templatePartId,
|
|
20
23
|
defaultWrapper,
|
|
21
24
|
hasInnerBlocks,
|
|
25
|
+
clientId,
|
|
22
26
|
} ) {
|
|
23
27
|
const [ area, setArea ] = useEntityProp(
|
|
24
28
|
'postType',
|
|
@@ -73,10 +77,10 @@ export function TemplatePartAdvancedControls( {
|
|
|
73
77
|
/>
|
|
74
78
|
</>
|
|
75
79
|
) }
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
<HTMLElementControl
|
|
81
|
+
tagName={ tagName || '' }
|
|
82
|
+
onChange={ ( value ) => setAttributes( { tagName: value } ) }
|
|
83
|
+
clientId={ clientId }
|
|
80
84
|
options={ [
|
|
81
85
|
{
|
|
82
86
|
label: sprintf(
|
|
@@ -94,9 +98,6 @@ export function TemplatePartAdvancedControls( {
|
|
|
94
98
|
{ label: '<footer>', value: 'footer' },
|
|
95
99
|
{ label: '<div>', value: 'div' },
|
|
96
100
|
] }
|
|
97
|
-
value={ tagName || '' }
|
|
98
|
-
onChange={ ( value ) => setAttributes( { tagName: value } ) }
|
|
99
|
-
help={ htmlElementMessages[ tagName ] }
|
|
100
101
|
/>
|
|
101
102
|
{ ! hasInnerBlocks && (
|
|
102
103
|
<TemplatePartImportControls
|
package/build/utils/messages.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.htmlElementMessages = void 0;
|
|
7
|
-
var _i18n = require("@wordpress/i18n");
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
const htmlElementMessages = exports.htmlElementMessages = {
|
|
13
|
-
article: (0, _i18n.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'),
|
|
14
|
-
aside: (0, _i18n.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
|
|
15
|
-
div: (0, _i18n.__)('The <div> element should only be used if the block is a design element with no semantic meaning.'),
|
|
16
|
-
footer: (0, _i18n.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'),
|
|
17
|
-
header: (0, _i18n.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
|
|
18
|
-
main: (0, _i18n.__)('The <main> element should be used for the primary content of your document only.'),
|
|
19
|
-
nav: (0, _i18n.__)('The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'),
|
|
20
|
-
section: (0, _i18n.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element.")
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","htmlElementMessages","exports","article","__","aside","div","footer","header","main","nav","section"],"sources":["@wordpress/block-library/src/utils/messages.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const htmlElementMessages = {\n\tarticle: __(\n\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t),\n\taside: __(\n\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t),\n\tdiv: __(\n\t\t'The <div> element should only be used if the block is a design element with no semantic meaning.'\n\t),\n\tfooter: __(\n\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t),\n\theader: __(\n\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t),\n\tmain: __(\n\t\t'The <main> element should be used for the primary content of your document only.'\n\t),\n\tnav: __(\n\t\t'The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'\n\t),\n\tsection: __(\n\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t),\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EAClCE,OAAO,EAAE,IAAAC,QAAE,EACV,gGACD,CAAC;EACDC,KAAK,EAAE,IAAAD,QAAE,EACR,uIACD,CAAC;EACDE,GAAG,EAAE,IAAAF,QAAE,EACN,kGACD,CAAC;EACDG,MAAM,EAAE,IAAAH,QAAE,EACT,8HACD,CAAC;EACDI,MAAM,EAAE,IAAAJ,QAAE,EACT,qHACD,CAAC;EACDK,IAAI,EAAE,IAAAL,QAAE,EACP,kFACD,CAAC;EACDM,GAAG,EAAE,IAAAN,QAAE,EACN,mIACD,CAAC;EACDO,OAAO,EAAE,IAAAP,QAAE,EACV,kIACD;AACD,CAAC","ignoreList":[]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
export const htmlElementMessages = {
|
|
6
|
-
article: __('The <article> element should represent a self-contained, syndicatable portion of the document.'),
|
|
7
|
-
aside: __("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
|
|
8
|
-
div: __('The <div> element should only be used if the block is a design element with no semantic meaning.'),
|
|
9
|
-
footer: __('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'),
|
|
10
|
-
header: __('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
|
|
11
|
-
main: __('The <main> element should be used for the primary content of your document only.'),
|
|
12
|
-
nav: __('The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'),
|
|
13
|
-
section: __("The <section> element should represent a standalone portion of the document that can't be better represented by another element.")
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","htmlElementMessages","article","aside","div","footer","header","main","nav","section"],"sources":["@wordpress/block-library/src/utils/messages.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const htmlElementMessages = {\n\tarticle: __(\n\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t),\n\taside: __(\n\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t),\n\tdiv: __(\n\t\t'The <div> element should only be used if the block is a design element with no semantic meaning.'\n\t),\n\tfooter: __(\n\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t),\n\theader: __(\n\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t),\n\tmain: __(\n\t\t'The <main> element should be used for the primary content of your document only.'\n\t),\n\tnav: __(\n\t\t'The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'\n\t),\n\tsection: __(\n\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t),\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,MAAMC,mBAAmB,GAAG;EAClCC,OAAO,EAAEF,EAAE,CACV,gGACD,CAAC;EACDG,KAAK,EAAEH,EAAE,CACR,uIACD,CAAC;EACDI,GAAG,EAAEJ,EAAE,CACN,kGACD,CAAC;EACDK,MAAM,EAAEL,EAAE,CACT,8HACD,CAAC;EACDM,MAAM,EAAEN,EAAE,CACT,qHACD,CAAC;EACDO,IAAI,EAAEP,EAAE,CACP,kFACD,CAAC;EACDQ,GAAG,EAAER,EAAE,CACN,mIACD,CAAC;EACDS,OAAO,EAAET,EAAE,CACV,kIACD;AACD,CAAC","ignoreList":[]}
|
package/src/utils/messages.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
|
|
6
|
-
export const htmlElementMessages = {
|
|
7
|
-
article: __(
|
|
8
|
-
'The <article> element should represent a self-contained, syndicatable portion of the document.'
|
|
9
|
-
),
|
|
10
|
-
aside: __(
|
|
11
|
-
"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
|
|
12
|
-
),
|
|
13
|
-
div: __(
|
|
14
|
-
'The <div> element should only be used if the block is a design element with no semantic meaning.'
|
|
15
|
-
),
|
|
16
|
-
footer: __(
|
|
17
|
-
'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'
|
|
18
|
-
),
|
|
19
|
-
header: __(
|
|
20
|
-
'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'
|
|
21
|
-
),
|
|
22
|
-
main: __(
|
|
23
|
-
'The <main> element should be used for the primary content of your document only.'
|
|
24
|
-
),
|
|
25
|
-
nav: __(
|
|
26
|
-
'The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'
|
|
27
|
-
),
|
|
28
|
-
section: __(
|
|
29
|
-
"The <section> element should represent a standalone portion of the document that can't be better represented by another element."
|
|
30
|
-
),
|
|
31
|
-
};
|