@wordpress/interactivity
Advanced tools
Comparing version 5.0.5 to 5.0.6
@@ -266,7 +266,15 @@ /* @jsx createElement */ | ||
}) => { | ||
const events = new Map(); | ||
on.filter(({ | ||
suffix | ||
}) => suffix !== 'default').forEach(entry => { | ||
element.props[`on${entry.suffix}`] = event => { | ||
evaluate(entry, event); | ||
const event = entry.suffix.split('--')[0]; | ||
if (!events.has(event)) events.set(event, new Set()); | ||
events.get(event).add(entry); | ||
}); | ||
events.forEach((entries, eventType) => { | ||
element.props[`on${eventType}`] = event => { | ||
entries.forEach(entry => { | ||
evaluate(entry, event); | ||
}); | ||
}; | ||
@@ -273,0 +281,0 @@ }); |
@@ -272,7 +272,15 @@ "use strict"; | ||
}) => { | ||
const events = new Map(); | ||
on.filter(({ | ||
suffix | ||
}) => suffix !== 'default').forEach(entry => { | ||
element.props[`on${entry.suffix}`] = event => { | ||
evaluate(entry, event); | ||
const event = entry.suffix.split('--')[0]; | ||
if (!events.has(event)) events.set(event, new Set()); | ||
events.get(event).add(entry); | ||
}); | ||
events.forEach((entries, eventType) => { | ||
element.props[`on${eventType}`] = event => { | ||
entries.forEach(entry => { | ||
evaluate(entry, event); | ||
}); | ||
}; | ||
@@ -279,0 +287,0 @@ }); |
{ | ||
"name": "@wordpress/interactivity", | ||
"version": "5.0.5", | ||
"version": "5.0.6", | ||
"description": "Package that provides a standard and simple way to handle the frontend interactivity of Gutenberg blocks.", | ||
@@ -36,3 +36,3 @@ "author": "The WordPress Contributors", | ||
}, | ||
"gitHead": "f8226c028ffa05f4e863c3346e46058ad09431e8" | ||
"gitHead": "88cd256155d396c639216515e05346c687a64112" | ||
} |
@@ -273,9 +273,18 @@ /* @jsx createElement */ | ||
directive( 'on', ( { directives: { on }, element, evaluate } ) => { | ||
const events = new Map(); | ||
on.filter( ( { suffix } ) => suffix !== 'default' ).forEach( | ||
( entry ) => { | ||
element.props[ `on${ entry.suffix }` ] = ( event ) => { | ||
evaluate( entry, event ); | ||
}; | ||
const event = entry.suffix.split( '--' )[ 0 ]; | ||
if ( ! events.has( event ) ) events.set( event, new Set() ); | ||
events.get( event ).add( entry ); | ||
} | ||
); | ||
events.forEach( ( entries, eventType ) => { | ||
element.props[ `on${ eventType }` ] = ( event ) => { | ||
entries.forEach( ( entry ) => { | ||
evaluate( entry, event ); | ||
} ); | ||
}; | ||
} ); | ||
} ); | ||
@@ -282,0 +291,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
968693
5099