@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.
Files changed (102) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/accordion-heading/block.json +1 -1
  3. package/build/accordion-item/block.json +1 -1
  4. package/build/breadcrumbs/block.json +3 -4
  5. package/build/breadcrumbs/edit.js +43 -77
  6. package/build/breadcrumbs/edit.js.map +2 -2
  7. package/build/categories/edit.js +8 -4
  8. package/build/categories/edit.js.map +2 -2
  9. package/build/latest-comments/block.json +4 -3
  10. package/build/latest-comments/deprecated.js +56 -0
  11. package/build/latest-comments/deprecated.js.map +7 -0
  12. package/build/latest-comments/edit.js +16 -10
  13. package/build/latest-comments/edit.js.map +2 -2
  14. package/build/latest-comments/index.js +3 -1
  15. package/build/latest-comments/index.js.map +3 -3
  16. package/build/math/deprecated.js +54 -0
  17. package/build/math/deprecated.js.map +7 -0
  18. package/build/math/index.js +3 -1
  19. package/build/math/index.js.map +3 -3
  20. package/build/math/save.js +2 -3
  21. package/build/math/save.js.map +2 -2
  22. package/build/navigation/edit/menu-inspector-controls.js +1 -1
  23. package/build/navigation/edit/menu-inspector-controls.js.map +2 -2
  24. package/build/navigation-link/edit.js +1 -1
  25. package/build/navigation-link/edit.js.map +2 -2
  26. package/build/navigation-link/link-ui/page-creator.js +20 -0
  27. package/build/navigation-link/link-ui/page-creator.js.map +3 -3
  28. package/build/navigation-link/shared/controls.js +36 -16
  29. package/build/navigation-link/shared/controls.js.map +2 -2
  30. package/build/navigation-link/shared/use-entity-binding.js +1 -1
  31. package/build/navigation-link/shared/use-entity-binding.js.map +2 -2
  32. package/build/navigation-submenu/edit.js +1 -1
  33. package/build/navigation-submenu/edit.js.map +2 -2
  34. package/build-module/accordion-heading/block.json +1 -1
  35. package/build-module/accordion-item/block.json +1 -1
  36. package/build-module/breadcrumbs/block.json +3 -4
  37. package/build-module/breadcrumbs/edit.js +44 -78
  38. package/build-module/breadcrumbs/edit.js.map +2 -2
  39. package/build-module/categories/edit.js +8 -4
  40. package/build-module/categories/edit.js.map +2 -2
  41. package/build-module/latest-comments/block.json +4 -3
  42. package/build-module/latest-comments/deprecated.js +36 -0
  43. package/build-module/latest-comments/deprecated.js.map +7 -0
  44. package/build-module/latest-comments/edit.js +17 -10
  45. package/build-module/latest-comments/edit.js.map +2 -2
  46. package/build-module/latest-comments/index.js +3 -1
  47. package/build-module/latest-comments/index.js.map +2 -2
  48. package/build-module/math/deprecated.js +34 -0
  49. package/build-module/math/deprecated.js.map +7 -0
  50. package/build-module/math/index.js +3 -1
  51. package/build-module/math/index.js.map +2 -2
  52. package/build-module/math/save.js +2 -3
  53. package/build-module/math/save.js.map +2 -2
  54. package/build-module/navigation/edit/menu-inspector-controls.js +1 -1
  55. package/build-module/navigation/edit/menu-inspector-controls.js.map +2 -2
  56. package/build-module/navigation-link/edit.js +1 -1
  57. package/build-module/navigation-link/edit.js.map +2 -2
  58. package/build-module/navigation-link/link-ui/page-creator.js +21 -1
  59. package/build-module/navigation-link/link-ui/page-creator.js.map +2 -2
  60. package/build-module/navigation-link/shared/controls.js +37 -17
  61. package/build-module/navigation-link/shared/controls.js.map +2 -2
  62. package/build-module/navigation-link/shared/use-entity-binding.js +1 -1
  63. package/build-module/navigation-link/shared/use-entity-binding.js.map +2 -2
  64. package/build-module/navigation-submenu/edit.js +1 -1
  65. package/build-module/navigation-submenu/edit.js.map +2 -2
  66. package/build-style/editor-rtl.css +2 -2
  67. package/build-style/editor.css +2 -2
  68. package/build-style/math/style-rtl.css +4 -0
  69. package/build-style/math/style.css +4 -0
  70. package/build-style/navigation-link/editor-rtl.css +1 -1
  71. package/build-style/navigation-link/editor.css +1 -1
  72. package/build-style/style-rtl.css +5 -0
  73. package/build-style/style.css +5 -0
  74. package/build-style/video/editor-rtl.css +1 -1
  75. package/build-style/video/editor.css +1 -1
  76. package/package.json +37 -37
  77. package/src/accordion-heading/block.json +1 -1
  78. package/src/accordion-item/block.json +1 -1
  79. package/src/breadcrumbs/block.json +3 -4
  80. package/src/breadcrumbs/edit.js +96 -132
  81. package/src/breadcrumbs/index.php +203 -50
  82. package/src/categories/edit.js +10 -6
  83. package/src/categories/index.php +1 -1
  84. package/src/latest-comments/block.json +4 -3
  85. package/src/latest-comments/deprecated.js +37 -0
  86. package/src/latest-comments/edit.js +17 -10
  87. package/src/latest-comments/index.js +2 -0
  88. package/src/latest-comments/index.php +11 -2
  89. package/src/math/deprecated.js +44 -0
  90. package/src/math/index.js +2 -0
  91. package/src/math/save.js +6 -5
  92. package/src/math/style.scss +4 -0
  93. package/src/navigation/edit/menu-inspector-controls.js +1 -1
  94. package/src/navigation-link/edit.js +1 -1
  95. package/src/navigation-link/editor.scss +1 -1
  96. package/src/navigation-link/link-ui/page-creator.js +25 -2
  97. package/src/navigation-link/shared/controls.js +58 -18
  98. package/src/navigation-link/shared/test/controls.js +14 -9
  99. package/src/navigation-link/shared/use-entity-binding.js +1 -1
  100. package/src/navigation-submenu/edit.js +1 -1
  101. package/src/style.scss +1 -0
  102. package/src/video/editor.scss +1 -1
@@ -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: 500;
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: 500;
2613
+ font-weight: 499;
2614
2614
  display: block;
2615
2615
  }
2616
2616
 
@@ -0,0 +1,4 @@
1
+ .wp-block-math {
2
+ overflow-x: auto;
3
+ overflow-y: hidden;
4
+ }
@@ -0,0 +1,4 @@
1
+ .wp-block-math {
2
+ overflow-x: auto;
3
+ overflow-y: hidden;
4
+ }
@@ -122,7 +122,7 @@
122
122
  .link-control-transform__subheading {
123
123
  font-size: 11px;
124
124
  text-transform: uppercase;
125
- font-weight: 500;
125
+ font-weight: 499;
126
126
  color: #1e1e1e;
127
127
  margin-bottom: 1.5em;
128
128
  }
@@ -122,7 +122,7 @@
122
122
  .link-control-transform__subheading {
123
123
  font-size: 11px;
124
124
  text-transform: uppercase;
125
- font-weight: 500;
125
+ font-weight: 499;
126
126
  color: #1e1e1e;
127
127
  margin-bottom: 1.5em;
128
128
  }
@@ -2187,6 +2187,11 @@ ul {
2187
2187
  box-sizing: border-box;
2188
2188
  }
2189
2189
 
2190
+ .wp-block-math {
2191
+ overflow-x: auto;
2192
+ overflow-y: hidden;
2193
+ }
2194
+
2190
2195
  .wp-block-media-text {
2191
2196
  direction: ltr;
2192
2197
  display: grid;
@@ -2207,6 +2207,11 @@ ul {
2207
2207
  box-sizing: border-box;
2208
2208
  }
2209
2209
 
2210
+ .wp-block-math {
2211
+ overflow-x: auto;
2212
+ overflow-y: hidden;
2213
+ }
2214
+
2210
2215
  .wp-block-media-text {
2211
2216
  /*!rtl:begin:ignore*/
2212
2217
  direction: ltr;
@@ -79,7 +79,7 @@
79
79
  color: #757575;
80
80
  text-transform: uppercase;
81
81
  font-size: 11px;
82
- font-weight: 500;
82
+ font-weight: 499;
83
83
  display: block;
84
84
  }
85
85
 
@@ -79,7 +79,7 @@
79
79
  color: #757575;
80
80
  text-transform: uppercase;
81
81
  font-size: 11px;
82
- font-weight: 500;
82
+ font-weight: 499;
83
83
  display: block;
84
84
  }
85
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.33.2",
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.33.1",
85
- "@wordpress/api-fetch": "^7.33.1",
86
- "@wordpress/autop": "^4.33.1",
87
- "@wordpress/base-styles": "^6.9.1",
88
- "@wordpress/blob": "^4.33.1",
89
- "@wordpress/block-editor": "^15.6.1",
90
- "@wordpress/blocks": "^15.6.1",
91
- "@wordpress/components": "^30.6.1",
92
- "@wordpress/compose": "^7.33.1",
93
- "@wordpress/core-data": "^7.33.1",
94
- "@wordpress/data": "^10.33.1",
95
- "@wordpress/date": "^5.33.1",
96
- "@wordpress/deprecated": "^4.33.1",
97
- "@wordpress/dom": "^4.33.1",
98
- "@wordpress/element": "^6.33.1",
99
- "@wordpress/escape-html": "^3.33.1",
100
- "@wordpress/hooks": "^4.33.1",
101
- "@wordpress/html-entities": "^4.33.1",
102
- "@wordpress/i18n": "^6.6.1",
103
- "@wordpress/icons": "^11.0.1",
104
- "@wordpress/interactivity": "^6.33.1",
105
- "@wordpress/interactivity-router": "^2.33.1",
106
- "@wordpress/keyboard-shortcuts": "^5.33.1",
107
- "@wordpress/keycodes": "^4.33.1",
108
- "@wordpress/latex-to-mathml": "^1.1.1",
109
- "@wordpress/notices": "^5.33.1",
110
- "@wordpress/patterns": "^2.33.1",
111
- "@wordpress/primitives": "^4.33.1",
112
- "@wordpress/private-apis": "^1.33.1",
113
- "@wordpress/reusable-blocks": "^5.33.1",
114
- "@wordpress/rich-text": "^7.33.1",
115
- "@wordpress/server-side-render": "^6.9.1",
116
- "@wordpress/url": "^4.33.1",
117
- "@wordpress/viewport": "^6.33.1",
118
- "@wordpress/wordcount": "^4.33.1",
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": "5f84bafdec1bed05247c1080c12f6a237951b862"
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": "Toggles the accordion panel.",
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",
@@ -33,7 +33,7 @@
33
33
  "shadow": true,
34
34
  "layout": {
35
35
  "allowEditing": false
36
- },
36
+ },
37
37
  "typography": {
38
38
  "fontSize": true,
39
39
  "lineHeight": true,
@@ -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
- "type": {
12
- "type": "string",
13
- "default": "auto",
14
- "enum": [ "auto", "postWithTerms", "postWithAncestors" ]
11
+ "prefersTaxonomy": {
12
+ "type": "boolean",
13
+ "default": false
15
14
  },
16
15
  "separator": {
17
16
  "type": "string",
@@ -6,7 +6,7 @@ import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
6
6
  import {
7
7
  ToggleControl,
8
8
  TextControl,
9
- SelectControl,
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, type } = attributes;
53
- const { post, isPostTypeHierarchical, hasTermsAssigned, isLoading } =
54
- useSelect(
55
- ( select ) => {
56
- if ( ! postType ) {
57
- return {};
58
- }
59
- const _post = select( coreStore ).getEntityRecord(
60
- 'postType',
61
- postType,
62
- postId
63
- );
64
- const postTypeObject =
65
- select( coreStore ).getPostType( postType );
66
- const postTypeHasTaxonomies =
67
- postTypeObject && postTypeObject.taxonomies.length;
68
- let taxonomies;
69
- if ( postTypeHasTaxonomies ) {
70
- taxonomies = select( coreStore ).getTaxonomies( {
71
- type: postType,
72
- per_page: -1,
73
- } );
74
- }
75
- return {
76
- post: _post,
77
- isPostTypeHierarchical: postTypeObject?.hierarchical,
78
- hasTermsAssigned:
79
- _post &&
80
- ( taxonomies || [] )
81
- .filter(
82
- ( { visibility } ) =>
83
- visibility?.publicly_queryable
84
- )
85
- .some( ( taxonomy ) => {
86
- return !! _post[ taxonomy.rest_base ]?.length;
87
- } ),
88
- isLoading:
89
- ! _post ||
90
- ! postTypeObject ||
91
- ( postTypeHasTaxonomies && ! taxonomies ),
92
- };
93
- },
94
- [ postType, postId ]
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
- // Counter used to cache-bust `useServerSideRender`
98
- //
99
- // This is a catch-all signal to re-render the block when a post's title,
100
- // parent ID, or terms change.
101
- //
102
- // This is fundamentally imperfect, because there are other entities which
103
- // could change in the meantime (the titles of ancestor posts, or the
104
- // labels of taxonomy terms), hence the choice to re-render systematically
105
- // upon saving.
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
- // TODO: this should be handled better when we add more types.
128
- let breadcrumbsType;
129
- const isSpecificSupportedTypeSet = [
130
- 'postWithAncestors',
131
- 'postWithTerms',
132
- ].includes( type );
133
- if ( isSpecificSupportedTypeSet ) {
134
- breadcrumbsType = type;
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
- breadcrumbsType = isPostTypeHierarchical
137
- ? 'postWithAncestors'
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
- ( breadcrumbsType === 'postWithAncestors' &&
151
- ! isPostTypeHierarchical ) ||
152
- ( breadcrumbsType === 'postWithTerms' && ! hasTermsAssigned );
134
+ ( ! _showTerms && ! isPostTypeHierarchical ) ||
135
+ ( _showTerms && ! hasTermsAssigned );
153
136
  if ( showPlaceholder ) {
154
- const placeholderItems = [
155
- showHomeLink && __( 'Home' ),
156
- // For now if we are adding this in a template show a generic placeholder.
157
- ...( templateSlug && ! isSpecificSupportedTypeSet
158
- ? [ __( 'Page' ) ]
159
- : BREADCRUMB_TYPES[ breadcrumbsType ].placeholderItems ),
160
- ].filter( Boolean );
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