@wordpress/block-library 8.28.2 → 8.28.3

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.
@@ -238,15 +238,15 @@ function ButtonEdit( props ) {
238
238
  return {};
239
239
  }
240
240
 
241
- const { getBlockBindingsSource } = unlock(
241
+ const blockBindingsSource = unlock(
242
242
  select( blockEditorStore )
243
- );
243
+ ).getBlockBindingsSource( metadata?.bindings?.url?.source );
244
244
 
245
245
  return {
246
246
  lockUrlControls:
247
247
  !! metadata?.bindings?.url &&
248
- getBlockBindingsSource( metadata?.bindings?.url?.source )
249
- ?.lockAttributesEditing,
248
+ ( ! blockBindingsSource ||
249
+ blockBindingsSource?.lockAttributesEditing ),
250
250
  };
251
251
  },
252
252
  [ isSelected ]
package/src/image/edit.js CHANGED
@@ -341,15 +341,15 @@ export function ImageEdit( {
341
341
  return {};
342
342
  }
343
343
 
344
- const { getBlockBindingsSource } = unlock(
344
+ const blockBindingsSource = unlock(
345
345
  select( blockEditorStore )
346
- );
346
+ ).getBlockBindingsSource( metadata?.bindings?.url?.source );
347
347
 
348
348
  return {
349
349
  lockUrlControls:
350
350
  !! metadata?.bindings?.url &&
351
- getBlockBindingsSource( metadata?.bindings?.url?.source )
352
- ?.lockAttributesEditing,
351
+ ( ! blockBindingsSource ||
352
+ blockBindingsSource?.lockAttributesEditing ),
353
353
  };
354
354
  },
355
355
  [ isSingleSelected ]
@@ -426,23 +426,32 @@ export default function Image( {
426
426
  } = metadata?.bindings || {};
427
427
  const hasParentPattern =
428
428
  getBlockParentsByBlockName( clientId, 'core/block' ).length > 0;
429
+ const urlBindingSource = getBlockBindingsSource(
430
+ urlBinding?.source
431
+ );
432
+ const altBindingSource = getBlockBindingsSource(
433
+ altBinding?.source
434
+ );
435
+ const titleBindingSource = getBlockBindingsSource(
436
+ titleBinding?.source
437
+ );
429
438
  return {
430
439
  lockUrlControls:
431
440
  !! urlBinding &&
432
- getBlockBindingsSource( urlBinding?.source )
433
- ?.lockAttributesEditing,
441
+ ( ! urlBindingSource ||
442
+ urlBindingSource?.lockAttributesEditing ),
434
443
  lockHrefControls:
435
444
  // Disable editing the link of the URL if the image is inside a pattern instance.
436
445
  // This is a temporary solution until we support overriding the link on the frontend.
437
446
  hasParentPattern,
438
447
  lockAltControls:
439
448
  !! altBinding &&
440
- getBlockBindingsSource( altBinding?.source )
441
- ?.lockAttributesEditing,
449
+ ( ! altBindingSource ||
450
+ altBindingSource?.lockAttributesEditing ),
442
451
  lockTitleControls:
443
452
  !! titleBinding &&
444
- getBlockBindingsSource( titleBinding?.source )
445
- ?.lockAttributesEditing,
453
+ ( ! titleBindingSource ||
454
+ titleBindingSource?.lockAttributesEditing ),
446
455
  };
447
456
  },
448
457
  [ clientId, isSingleSelected, metadata?.bindings ]