@wordpress/block-library 9.33.2 → 9.34.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/accordion-heading/block.json +1 -1
- package/build/accordion-item/block.json +1 -1
- package/build/breadcrumbs/block.json +3 -4
- package/build/breadcrumbs/edit.js +43 -77
- package/build/breadcrumbs/edit.js.map +2 -2
- package/build/categories/edit.js +8 -4
- package/build/categories/edit.js.map +2 -2
- package/build/latest-comments/block.json +4 -3
- package/build/latest-comments/deprecated.js +56 -0
- package/build/latest-comments/deprecated.js.map +7 -0
- package/build/latest-comments/edit.js +16 -10
- package/build/latest-comments/edit.js.map +2 -2
- package/build/latest-comments/index.js +3 -1
- package/build/latest-comments/index.js.map +3 -3
- package/build/math/deprecated.js +54 -0
- package/build/math/deprecated.js.map +7 -0
- package/build/math/index.js +3 -1
- package/build/math/index.js.map +3 -3
- package/build/math/save.js +2 -3
- package/build/math/save.js.map +2 -2
- package/build/navigation/edit/menu-inspector-controls.js +1 -1
- package/build/navigation/edit/menu-inspector-controls.js.map +2 -2
- package/build/navigation-link/edit.js +1 -1
- package/build/navigation-link/edit.js.map +2 -2
- package/build/navigation-link/link-ui/page-creator.js +20 -0
- package/build/navigation-link/link-ui/page-creator.js.map +3 -3
- package/build/navigation-link/shared/controls.js +36 -16
- package/build/navigation-link/shared/controls.js.map +2 -2
- package/build/navigation-link/shared/use-entity-binding.js +1 -1
- package/build/navigation-link/shared/use-entity-binding.js.map +2 -2
- package/build/navigation-submenu/edit.js +1 -1
- package/build/navigation-submenu/edit.js.map +2 -2
- package/build-module/accordion-heading/block.json +1 -1
- package/build-module/accordion-item/block.json +1 -1
- package/build-module/breadcrumbs/block.json +3 -4
- package/build-module/breadcrumbs/edit.js +44 -78
- package/build-module/breadcrumbs/edit.js.map +2 -2
- package/build-module/categories/edit.js +8 -4
- package/build-module/categories/edit.js.map +2 -2
- package/build-module/latest-comments/block.json +4 -3
- package/build-module/latest-comments/deprecated.js +36 -0
- package/build-module/latest-comments/deprecated.js.map +7 -0
- package/build-module/latest-comments/edit.js +17 -10
- package/build-module/latest-comments/edit.js.map +2 -2
- package/build-module/latest-comments/index.js +3 -1
- package/build-module/latest-comments/index.js.map +2 -2
- package/build-module/math/deprecated.js +34 -0
- package/build-module/math/deprecated.js.map +7 -0
- package/build-module/math/index.js +3 -1
- package/build-module/math/index.js.map +2 -2
- package/build-module/math/save.js +2 -3
- package/build-module/math/save.js.map +2 -2
- package/build-module/navigation/edit/menu-inspector-controls.js +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js.map +2 -2
- package/build-module/navigation-link/edit.js +1 -1
- package/build-module/navigation-link/edit.js.map +2 -2
- package/build-module/navigation-link/link-ui/page-creator.js +21 -1
- package/build-module/navigation-link/link-ui/page-creator.js.map +2 -2
- package/build-module/navigation-link/shared/controls.js +37 -17
- package/build-module/navigation-link/shared/controls.js.map +2 -2
- package/build-module/navigation-link/shared/use-entity-binding.js +1 -1
- package/build-module/navigation-link/shared/use-entity-binding.js.map +2 -2
- package/build-module/navigation-submenu/edit.js +1 -1
- package/build-module/navigation-submenu/edit.js.map +2 -2
- package/build-style/editor-rtl.css +2 -2
- package/build-style/editor.css +2 -2
- package/build-style/math/style-rtl.css +4 -0
- package/build-style/math/style.css +4 -0
- package/build-style/navigation-link/editor-rtl.css +1 -1
- package/build-style/navigation-link/editor.css +1 -1
- package/build-style/style-rtl.css +5 -0
- package/build-style/style.css +5 -0
- package/build-style/video/editor-rtl.css +1 -1
- package/build-style/video/editor.css +1 -1
- package/package.json +37 -37
- package/src/accordion-heading/block.json +1 -1
- package/src/accordion-item/block.json +1 -1
- package/src/breadcrumbs/block.json +3 -4
- package/src/breadcrumbs/edit.js +96 -132
- package/src/breadcrumbs/index.php +203 -50
- package/src/categories/edit.js +10 -6
- package/src/categories/index.php +1 -1
- package/src/latest-comments/block.json +4 -3
- package/src/latest-comments/deprecated.js +37 -0
- package/src/latest-comments/edit.js +17 -10
- package/src/latest-comments/index.js +2 -0
- package/src/latest-comments/index.php +11 -2
- package/src/math/deprecated.js +44 -0
- package/src/math/index.js +2 -0
- package/src/math/save.js +6 -5
- package/src/math/style.scss +4 -0
- package/src/navigation/edit/menu-inspector-controls.js +1 -1
- package/src/navigation-link/edit.js +1 -1
- package/src/navigation-link/editor.scss +1 -1
- package/src/navigation-link/link-ui/page-creator.js +25 -2
- package/src/navigation-link/shared/controls.js +58 -18
- package/src/navigation-link/shared/test/controls.js +14 -9
- package/src/navigation-link/shared/use-entity-binding.js +1 -1
- package/src/navigation-submenu/edit.js +1 -1
- package/src/style.scss +1 -0
- package/src/video/editor.scss +1 -1
package/build-style/editor.css
CHANGED
|
@@ -1963,7 +1963,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
1963
1963
|
.link-control-transform__subheading {
|
|
1964
1964
|
font-size: 11px;
|
|
1965
1965
|
text-transform: uppercase;
|
|
1966
|
-
font-weight:
|
|
1966
|
+
font-weight: 499;
|
|
1967
1967
|
color: #1e1e1e;
|
|
1968
1968
|
margin-bottom: 1.5em;
|
|
1969
1969
|
}
|
|
@@ -2610,7 +2610,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2610
2610
|
color: #757575;
|
|
2611
2611
|
text-transform: uppercase;
|
|
2612
2612
|
font-size: 11px;
|
|
2613
|
-
font-weight:
|
|
2613
|
+
font-weight: 499;
|
|
2614
2614
|
display: block;
|
|
2615
2615
|
}
|
|
2616
2616
|
|
package/build-style/style.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.34.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -81,41 +81,41 @@
|
|
|
81
81
|
"{src,build,build-module}/*/init.js"
|
|
82
82
|
],
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@wordpress/a11y": "^4.
|
|
85
|
-
"@wordpress/api-fetch": "^7.
|
|
86
|
-
"@wordpress/autop": "^4.
|
|
87
|
-
"@wordpress/base-styles": "^6.
|
|
88
|
-
"@wordpress/blob": "^4.
|
|
89
|
-
"@wordpress/block-editor": "^15.
|
|
90
|
-
"@wordpress/blocks": "^15.
|
|
91
|
-
"@wordpress/components": "^30.
|
|
92
|
-
"@wordpress/compose": "^7.
|
|
93
|
-
"@wordpress/core-data": "^7.
|
|
94
|
-
"@wordpress/data": "^10.
|
|
95
|
-
"@wordpress/date": "^5.
|
|
96
|
-
"@wordpress/deprecated": "^4.
|
|
97
|
-
"@wordpress/dom": "^4.
|
|
98
|
-
"@wordpress/element": "^6.
|
|
99
|
-
"@wordpress/escape-html": "^3.
|
|
100
|
-
"@wordpress/hooks": "^4.
|
|
101
|
-
"@wordpress/html-entities": "^4.
|
|
102
|
-
"@wordpress/i18n": "^6.
|
|
103
|
-
"@wordpress/icons": "^11.0
|
|
104
|
-
"@wordpress/interactivity": "^6.
|
|
105
|
-
"@wordpress/interactivity-router": "^2.
|
|
106
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
107
|
-
"@wordpress/keycodes": "^4.
|
|
108
|
-
"@wordpress/latex-to-mathml": "^1.
|
|
109
|
-
"@wordpress/notices": "^5.
|
|
110
|
-
"@wordpress/patterns": "^2.
|
|
111
|
-
"@wordpress/primitives": "^4.
|
|
112
|
-
"@wordpress/private-apis": "^1.
|
|
113
|
-
"@wordpress/reusable-blocks": "^5.
|
|
114
|
-
"@wordpress/rich-text": "^7.
|
|
115
|
-
"@wordpress/server-side-render": "^6.
|
|
116
|
-
"@wordpress/url": "^4.
|
|
117
|
-
"@wordpress/viewport": "^6.
|
|
118
|
-
"@wordpress/wordcount": "^4.
|
|
84
|
+
"@wordpress/a11y": "^4.34.0",
|
|
85
|
+
"@wordpress/api-fetch": "^7.34.0",
|
|
86
|
+
"@wordpress/autop": "^4.34.0",
|
|
87
|
+
"@wordpress/base-styles": "^6.10.0",
|
|
88
|
+
"@wordpress/blob": "^4.34.0",
|
|
89
|
+
"@wordpress/block-editor": "^15.7.0",
|
|
90
|
+
"@wordpress/blocks": "^15.7.0",
|
|
91
|
+
"@wordpress/components": "^30.7.0",
|
|
92
|
+
"@wordpress/compose": "^7.34.0",
|
|
93
|
+
"@wordpress/core-data": "^7.34.0",
|
|
94
|
+
"@wordpress/data": "^10.34.0",
|
|
95
|
+
"@wordpress/date": "^5.34.0",
|
|
96
|
+
"@wordpress/deprecated": "^4.34.0",
|
|
97
|
+
"@wordpress/dom": "^4.34.0",
|
|
98
|
+
"@wordpress/element": "^6.34.0",
|
|
99
|
+
"@wordpress/escape-html": "^3.34.0",
|
|
100
|
+
"@wordpress/hooks": "^4.34.0",
|
|
101
|
+
"@wordpress/html-entities": "^4.34.0",
|
|
102
|
+
"@wordpress/i18n": "^6.7.0",
|
|
103
|
+
"@wordpress/icons": "^11.1.0",
|
|
104
|
+
"@wordpress/interactivity": "^6.34.0",
|
|
105
|
+
"@wordpress/interactivity-router": "^2.34.0",
|
|
106
|
+
"@wordpress/keyboard-shortcuts": "^5.34.0",
|
|
107
|
+
"@wordpress/keycodes": "^4.34.0",
|
|
108
|
+
"@wordpress/latex-to-mathml": "^1.2.0",
|
|
109
|
+
"@wordpress/notices": "^5.34.0",
|
|
110
|
+
"@wordpress/patterns": "^2.34.0",
|
|
111
|
+
"@wordpress/primitives": "^4.34.0",
|
|
112
|
+
"@wordpress/private-apis": "^1.34.0",
|
|
113
|
+
"@wordpress/reusable-blocks": "^5.34.0",
|
|
114
|
+
"@wordpress/rich-text": "^7.34.0",
|
|
115
|
+
"@wordpress/server-side-render": "^6.10.0",
|
|
116
|
+
"@wordpress/url": "^4.34.0",
|
|
117
|
+
"@wordpress/viewport": "^6.34.0",
|
|
118
|
+
"@wordpress/wordcount": "^4.34.0",
|
|
119
119
|
"change-case": "^4.1.2",
|
|
120
120
|
"clsx": "^2.1.1",
|
|
121
121
|
"colord": "^2.7.0",
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"publishConfig": {
|
|
134
134
|
"access": "public"
|
|
135
135
|
},
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "ceebff807958d2e8fc755b5a20473939c78b4d1d"
|
|
137
137
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/accordion-heading",
|
|
5
5
|
"title": "Accordion Heading",
|
|
6
6
|
"category": "design",
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "Displays a heading that toggles the accordion panel.",
|
|
8
8
|
"parent": [ "core/accordion-item" ],
|
|
9
9
|
"usesContext": [
|
|
10
10
|
"core/accordion-icon-position",
|
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
"description": "Display a breadcrumb trail for hierarchical post types or based on taxonomy terms.",
|
|
9
9
|
"textdomain": "default",
|
|
10
10
|
"attributes": {
|
|
11
|
-
"
|
|
12
|
-
"type": "
|
|
13
|
-
"default":
|
|
14
|
-
"enum": [ "auto", "postWithTerms", "postWithAncestors" ]
|
|
11
|
+
"prefersTaxonomy": {
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"default": false
|
|
15
14
|
},
|
|
16
15
|
"separator": {
|
|
17
16
|
"type": "string",
|
package/src/breadcrumbs/edit.js
CHANGED
|
@@ -6,7 +6,7 @@ import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
|
|
6
6
|
import {
|
|
7
7
|
ToggleControl,
|
|
8
8
|
TextControl,
|
|
9
|
-
|
|
9
|
+
CheckboxControl,
|
|
10
10
|
__experimentalToolsPanel as ToolsPanel,
|
|
11
11
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
12
12
|
Spinner,
|
|
@@ -22,87 +22,72 @@ import { useServerSideRender } from '@wordpress/server-side-render';
|
|
|
22
22
|
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
23
23
|
|
|
24
24
|
const separatorDefaultValue = '/';
|
|
25
|
-
const typeDefaultValue = 'auto';
|
|
26
|
-
|
|
27
|
-
const BREADCRUMB_TYPES = {
|
|
28
|
-
auto: {
|
|
29
|
-
help: __(
|
|
30
|
-
'Try to automatically determine the best type of breadcrumb for the template.'
|
|
31
|
-
),
|
|
32
|
-
},
|
|
33
|
-
postWithAncestors: {
|
|
34
|
-
help: __(
|
|
35
|
-
'Shows breadcrumbs based on post hierarchy. Only works for hierarchical post types.'
|
|
36
|
-
),
|
|
37
|
-
placeholderItems: [ __( 'Ancestor' ), __( 'Parent' ) ],
|
|
38
|
-
},
|
|
39
|
-
postWithTerms: {
|
|
40
|
-
help: __(
|
|
41
|
-
'Shows breadcrumbs based on taxonomy terms. Chooses the first taxonomy with assigned terms and includes ancestors if the taxonomy is hierarchical.'
|
|
42
|
-
),
|
|
43
|
-
placeholderItems: [ __( 'Category' ) ],
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
25
|
|
|
47
26
|
export default function BreadcrumbEdit( {
|
|
48
27
|
attributes,
|
|
49
28
|
setAttributes,
|
|
50
29
|
context: { postId, postType, templateSlug },
|
|
51
30
|
} ) {
|
|
52
|
-
const { separator, showHomeLink,
|
|
53
|
-
const {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
} )
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
31
|
+
const { separator, showHomeLink, prefersTaxonomy } = attributes;
|
|
32
|
+
const {
|
|
33
|
+
post,
|
|
34
|
+
isPostTypeHierarchical,
|
|
35
|
+
postTypeHasTaxonomies,
|
|
36
|
+
hasTermsAssigned,
|
|
37
|
+
isLoading,
|
|
38
|
+
} = useSelect(
|
|
39
|
+
( select ) => {
|
|
40
|
+
if ( ! postType ) {
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
const _post = select( coreStore ).getEntityRecord(
|
|
44
|
+
'postType',
|
|
45
|
+
postType,
|
|
46
|
+
postId
|
|
47
|
+
);
|
|
48
|
+
const postTypeObject = select( coreStore ).getPostType( postType );
|
|
49
|
+
const _postTypeHasTaxonomies =
|
|
50
|
+
postTypeObject && postTypeObject.taxonomies.length;
|
|
51
|
+
let taxonomies;
|
|
52
|
+
if ( _postTypeHasTaxonomies ) {
|
|
53
|
+
taxonomies = select( coreStore ).getTaxonomies( {
|
|
54
|
+
type: postType,
|
|
55
|
+
per_page: -1,
|
|
56
|
+
} );
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
post: _post,
|
|
60
|
+
isPostTypeHierarchical: postTypeObject?.hierarchical,
|
|
61
|
+
postTypeHasTaxonomies: _postTypeHasTaxonomies,
|
|
62
|
+
hasTermsAssigned:
|
|
63
|
+
_post &&
|
|
64
|
+
( taxonomies || [] )
|
|
65
|
+
.filter(
|
|
66
|
+
( { visibility } ) => visibility?.publicly_queryable
|
|
67
|
+
)
|
|
68
|
+
.some( ( taxonomy ) => {
|
|
69
|
+
return !! _post[ taxonomy.rest_base ]?.length;
|
|
70
|
+
} ),
|
|
71
|
+
isLoading:
|
|
72
|
+
( postId && ! _post ) ||
|
|
73
|
+
! postTypeObject ||
|
|
74
|
+
( _postTypeHasTaxonomies && ! taxonomies ),
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
[ postType, postId ]
|
|
78
|
+
);
|
|
96
79
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Counter used to cache-bust `useServerSideRender`.
|
|
82
|
+
*
|
|
83
|
+
* This is a catch-all signal to re-render the block when a post's title,
|
|
84
|
+
* parent ID, or terms change.
|
|
85
|
+
*
|
|
86
|
+
* This is fundamentally imperfect, because there are other entities which
|
|
87
|
+
* could change in the meantime (the titles of ancestor posts, or the
|
|
88
|
+
* labels of taxonomy terms), hence the choice to re-render systematically
|
|
89
|
+
* upon saving.
|
|
90
|
+
*/
|
|
106
91
|
const [ invalidationKey, setInvalidationKey ] = useState( 0 );
|
|
107
92
|
useEffect( () => {
|
|
108
93
|
setInvalidationKey( ( c ) => c + 1 );
|
|
@@ -124,18 +109,17 @@ export default function BreadcrumbEdit( {
|
|
|
124
109
|
</div>
|
|
125
110
|
);
|
|
126
111
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
112
|
+
|
|
113
|
+
// Determine breadcrumb type for accurate previews (matching PHP logic).
|
|
114
|
+
let _showTerms;
|
|
115
|
+
if ( ! isPostTypeHierarchical ) {
|
|
116
|
+
_showTerms = true;
|
|
117
|
+
} else if ( ! postTypeHasTaxonomies ) {
|
|
118
|
+
// Hierarchical post type without taxonomies can only use ancestors.
|
|
119
|
+
_showTerms = false;
|
|
135
120
|
} else {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
: 'postWithTerms';
|
|
121
|
+
// For hierarchical post types with taxonomies, use the attribute.
|
|
122
|
+
_showTerms = prefersTaxonomy;
|
|
139
123
|
}
|
|
140
124
|
let placeholder = null;
|
|
141
125
|
// This is fragile because this block is server side rendered and we'll have to
|
|
@@ -147,17 +131,20 @@ export default function BreadcrumbEdit( {
|
|
|
147
131
|
// This is needed because when we are showing the template in post editor we
|
|
148
132
|
// want to show the real breadcrumbs if we have the post type.
|
|
149
133
|
( templateSlug && ! postType ) ||
|
|
150
|
-
(
|
|
151
|
-
|
|
152
|
-
( breadcrumbsType === 'postWithTerms' && ! hasTermsAssigned );
|
|
134
|
+
( ! _showTerms && ! isPostTypeHierarchical ) ||
|
|
135
|
+
( _showTerms && ! hasTermsAssigned );
|
|
153
136
|
if ( showPlaceholder ) {
|
|
154
|
-
const placeholderItems = [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
137
|
+
const placeholderItems = [];
|
|
138
|
+
if ( showHomeLink ) {
|
|
139
|
+
placeholderItems.push( __( 'Home' ) );
|
|
140
|
+
}
|
|
141
|
+
if ( templateSlug && ! postId ) {
|
|
142
|
+
placeholderItems.push( __( 'Page' ) );
|
|
143
|
+
} else if ( _showTerms ) {
|
|
144
|
+
placeholderItems.push( __( 'Category' ) );
|
|
145
|
+
} else {
|
|
146
|
+
placeholderItems.push( __( 'Ancestor' ), __( 'Parent' ) );
|
|
147
|
+
}
|
|
161
148
|
placeholder = (
|
|
162
149
|
<nav
|
|
163
150
|
style={ {
|
|
@@ -189,46 +176,10 @@ export default function BreadcrumbEdit( {
|
|
|
189
176
|
setAttributes( {
|
|
190
177
|
separator: separatorDefaultValue,
|
|
191
178
|
showHomeLink: true,
|
|
192
|
-
type: typeDefaultValue,
|
|
193
179
|
} );
|
|
194
180
|
} }
|
|
195
181
|
dropdownMenuProps={ dropdownMenuProps }
|
|
196
182
|
>
|
|
197
|
-
<ToolsPanelItem
|
|
198
|
-
label={ __( 'Type' ) }
|
|
199
|
-
isShownByDefault
|
|
200
|
-
hasValue={ () => type !== typeDefaultValue }
|
|
201
|
-
onDeselect={ () =>
|
|
202
|
-
setAttributes( {
|
|
203
|
-
type: typeDefaultValue,
|
|
204
|
-
} )
|
|
205
|
-
}
|
|
206
|
-
>
|
|
207
|
-
<SelectControl
|
|
208
|
-
__nextHasNoMarginBottom
|
|
209
|
-
__next40pxDefaultSize
|
|
210
|
-
label={ __( 'Type' ) }
|
|
211
|
-
value={ type }
|
|
212
|
-
onChange={ ( value ) =>
|
|
213
|
-
setAttributes( { type: value } )
|
|
214
|
-
}
|
|
215
|
-
options={ [
|
|
216
|
-
{
|
|
217
|
-
label: __( 'Auto' ),
|
|
218
|
-
value: 'auto',
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
label: __( 'Post with ancestors' ),
|
|
222
|
-
value: 'postWithAncestors',
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
label: __( 'Post with terms' ),
|
|
226
|
-
value: 'postWithTerms',
|
|
227
|
-
},
|
|
228
|
-
] }
|
|
229
|
-
help={ BREADCRUMB_TYPES[ type ].help }
|
|
230
|
-
/>
|
|
231
|
-
</ToolsPanelItem>
|
|
232
183
|
<ToolsPanelItem
|
|
233
184
|
label={ __( 'Show home link' ) }
|
|
234
185
|
isShownByDefault
|
|
@@ -278,6 +229,19 @@ export default function BreadcrumbEdit( {
|
|
|
278
229
|
</ToolsPanelItem>
|
|
279
230
|
</ToolsPanel>
|
|
280
231
|
</InspectorControls>
|
|
232
|
+
<InspectorControls group="advanced">
|
|
233
|
+
<CheckboxControl
|
|
234
|
+
__nextHasNoMarginBottom
|
|
235
|
+
label={ __( 'Prefer taxonomy terms' ) }
|
|
236
|
+
checked={ prefersTaxonomy }
|
|
237
|
+
onChange={ ( value ) =>
|
|
238
|
+
setAttributes( { prefersTaxonomy: value } )
|
|
239
|
+
}
|
|
240
|
+
help={ __(
|
|
241
|
+
'The exact type of breadcrumbs shown will vary automatically depending on the page in which this block is displayed. In the specific case of a hierarchical post type with taxonomies, the breadcrumbs can either reflect its post hierarchy (default) or the hierarchy of its assigned taxonomy terms.'
|
|
242
|
+
) }
|
|
243
|
+
/>
|
|
244
|
+
</InspectorControls>
|
|
281
245
|
<div { ...blockProps }>
|
|
282
246
|
{ showPlaceholder ? (
|
|
283
247
|
placeholder
|