@@ -2,7 +2,8 @@ use crate::{
22 ExtractStyleProp ,
33 extract_style:: { extract_keyframes:: ExtractKeyframes , extract_style_value:: ExtractStyleValue } ,
44 extractor:: {
5- KeyframesExtractResult , extract_style_from_expression:: extract_style_from_expression,
5+ ExtractResult , KeyframesExtractResult ,
6+ extract_style_from_expression:: extract_style_from_expression,
67 } ,
78} ;
89use oxc_ast:: {
@@ -36,15 +37,16 @@ pub fn extract_keyframes_from_expression<'a>(
3637 None
3738 }
3839 {
39- let mut styles =
40- extract_style_from_expression ( ast_builder, None , & mut o. value , 0 , & None )
41- . styles
42- . into_iter ( )
43- . filter_map ( |s| match s {
44- ExtractStyleProp :: Static ( ExtractStyleValue :: Static ( s) ) => Some ( s) ,
45- _ => None ,
46- } )
47- . collect :: < Vec < _ > > ( ) ;
40+ let ExtractResult { styles, .. } =
41+ extract_style_from_expression ( ast_builder, None , & mut o. value , 0 , & None ) ;
42+
43+ let mut styles = styles
44+ . into_iter ( )
45+ . filter_map ( |s| match s {
46+ ExtractStyleProp :: Static ( ExtractStyleValue :: Static ( s) ) => Some ( s) ,
47+ _ => None ,
48+ } )
49+ . collect :: < Vec < _ > > ( ) ;
4850 styles. sort_by_key ( |a| a. property ( ) . to_string ( ) ) ;
4951 keyframes. keyframes . insert (
5052 name. parse :: < f64 > ( ) . map ( |v| format ! ( "{v}%" ) ) . unwrap_or ( name) ,
0 commit comments