@wordpress/block-library 9.33.7 → 9.33.8

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.
@@ -221,7 +221,7 @@ export function Controls( { attributes, setAttributes, clientId } ) {
221
221
  } }
222
222
  help={
223
223
  hasUrlBinding && ! isBoundEntityAvailable ? (
224
- <MissingEntityHelpText
224
+ <MissingEntityHelp
225
225
  id={ helpTextId }
226
226
  type={ attributes.type }
227
227
  kind={ attributes.kind }
@@ -327,7 +327,7 @@ export function Controls( { attributes, setAttributes, clientId } ) {
327
327
  * @param {string} props.kind - The entity kind
328
328
  * @return {string} Help text for the bound URL
329
329
  */
330
- function BindingHelpText( { type, kind } ) {
330
+ export function BindingHelpText( { type, kind } ) {
331
331
  const entityType = getEntityTypeName( type, kind );
332
332
  return sprintf(
333
333
  /* translators: %s is the entity type (e.g., "page", "post", "category") */
@@ -340,27 +340,23 @@ function BindingHelpText( { type, kind } ) {
340
340
  * Component to display error help text for missing entity bindings.
341
341
  *
342
342
  * @param {Object} props - Component props
343
- * @param {string} props.id - ID for the help text element (for aria-describedby)
344
343
  * @param {string} props.type - The entity type
345
344
  * @param {string} props.kind - The entity kind
346
345
  * @return {JSX.Element} Error help text component
347
346
  */
348
- function MissingEntityHelpText( { id, type, kind } ) {
347
+ export function MissingEntityHelpText( { type, kind } ) {
349
348
  const entityType = getEntityTypeName( type, kind );
349
+ return sprintf(
350
+ /* translators: %s is the entity type (e.g., "page", "post", "category") */
351
+ __( 'Synced %s is missing. Please update or remove this link.' ),
352
+ entityType
353
+ );
354
+ }
355
+
356
+ function MissingEntityHelp( { id, type, kind } ) {
350
357
  return (
351
- <span
352
- id={ id }
353
- className="navigation-link-control__error-text"
354
- role="alert"
355
- aria-live="polite"
356
- >
357
- { sprintf(
358
- /* translators: %s is the entity type (e.g., "page", "post", "category") */
359
- __(
360
- 'Synced %s is missing. Please update or remove this link.'
361
- ),
362
- entityType
363
- ) }
358
+ <span id={ id } className="navigation-link-control__error-text">
359
+ <MissingEntityHelpText type={ type } kind={ kind } />
364
360
  </span>
365
361
  );
366
362
  }
@@ -5,7 +5,7 @@
5
5
  * to reduce code duplication and ensure consistent behavior.
6
6
  */
7
7
 
8
- export { Controls } from './controls';
8
+ export { Controls, BindingHelpText, MissingEntityHelpText } from './controls';
9
9
  export { updateAttributes } from './update-attributes';
10
10
  export {
11
11
  useEntityBinding,
@@ -98,10 +98,13 @@ export function useEntityBinding( { clientId, attributes } ) {
98
98
 
99
99
  // Use the correct entity type based on kind.
100
100
  const entityType = isTaxonomy ? 'taxonomy' : 'postType';
101
- const entityRecord = getEntityRecord( entityType, type, id );
101
+ // Convert 'tag' back to 'post_tag' for the API call
102
+ // (it was converted from 'post_tag' to 'tag' for storage in updateAttributes)
103
+ const typeForAPI = type === 'tag' ? 'post_tag' : type;
104
+ const entityRecord = getEntityRecord( entityType, typeForAPI, id );
102
105
  const hasResolved = hasFinishedResolution( 'getEntityRecord', [
103
106
  entityType,
104
- type,
107
+ typeForAPI,
105
108
  id,
106
109
  ] );
107
110
 
@@ -183,7 +183,7 @@ export function SocialLinksEdit( props ) {
183
183
  <SelectControl
184
184
  __next40pxDefaultSize
185
185
  __nextHasNoMarginBottom
186
- label={ __( 'Icon Size' ) }
186
+ label={ __( 'Icon size' ) }
187
187
  onChange={ ( newSize ) => {
188
188
  setAttributes( {
189
189
  size: newSize === '' ? undefined : newSize,