Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Rename to setValuesInBatch
  • Loading branch information
SantosGuillamot committed Jul 5, 2024
commit ba7626a7b8640fa3067b1b1d2a08fc91eeb10928
9 changes: 6 additions & 3 deletions packages/block-editor/src/hooks/use-bindings-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ export const withBlockBindingSupport = createHigherOrderComponent(

const binding = bindings[ attributeName ];
const source = sources[ binding?.source ];
if ( ! source?.setValue && ! source?.setValues ) {
if (
! source?.setValue &&
! source?.setValuesInBatch
) {
continue;
}
updatesBySource.set( source, {
Expand All @@ -196,8 +199,8 @@ export const withBlockBindingSupport = createHigherOrderComponent(
source,
attributes,
] of updatesBySource ) {
if ( source.setValues ) {
source.setValues( {
if ( source.setValuesInBatch ) {
source.setValuesInBatch( {
registry,
context,
clientId,
Expand Down
2 changes: 1 addition & 1 deletion packages/blocks/src/store/private-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function registerBlockBindingsSource( source ) {
sourceLabel: source.label,
getValue: source.getValue,
setValue: source.setValue,
setValues: source.setValues,
setValuesInBatch: source.setValuesInBatch,
getPlaceholder: source.getPlaceholder,
canUserEditValue: source.canUserEditValue,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/blocks/src/store/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export function blockBindingsSources( state = {}, action ) {
label: action.sourceLabel,
getValue: action.getValue,
setValue: action.setValue,
setValues: action.setValues,
setValuesInBatch: action.setValuesInBatch,
getPlaceholder: action.getPlaceholder,
canUserEditValue: action.canUserEditValue || ( () => false ),
},
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/bindings/pattern-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {

return overridableValue === '' ? undefined : overridableValue;
},
setValues( { registry, clientId, attributes } ) {
setValuesInBatch( { registry, clientId, attributes } ) {
const { getBlockAttributes, getBlockParentsByBlockName, getBlocks } =
registry.select( blockEditorStore );
const currentBlockAttributes = getBlockAttributes( clientId );
Expand Down