@@ -157,6 +157,8 @@ pub enum CreateOp<'a> {
157157 TwoWayListener ( TwoWayListenerOp < ' a > ) ,
158158 /// Animation string binding.
159159 AnimationString ( AnimationStringOp < ' a > ) ,
160+ /// Animation binding (converted from AnimationBinding, emits syntheticHostProperty).
161+ Animation ( AnimationOp < ' a > ) ,
160162 /// Animation listener.
161163 AnimationListener ( AnimationListenerOp < ' a > ) ,
162164 /// Create a pipe instance.
@@ -223,6 +225,7 @@ impl<'a> Op for CreateOp<'a> {
223225 CreateOp :: Listener ( _) => OpKind :: Listener ,
224226 CreateOp :: TwoWayListener ( _) => OpKind :: TwoWayListener ,
225227 CreateOp :: AnimationString ( _) => OpKind :: AnimationString ,
228+ CreateOp :: Animation ( _) => OpKind :: Animation ,
226229 CreateOp :: AnimationListener ( _) => OpKind :: AnimationListener ,
227230 CreateOp :: Pipe ( _) => OpKind :: Pipe ,
228231 CreateOp :: Defer ( _) => OpKind :: Defer ,
@@ -267,6 +270,7 @@ impl<'a> Op for CreateOp<'a> {
267270 CreateOp :: Listener ( op) => op. base . prev ,
268271 CreateOp :: TwoWayListener ( op) => op. base . prev ,
269272 CreateOp :: AnimationString ( op) => op. base . prev ,
273+ CreateOp :: Animation ( op) => op. base . prev ,
270274 CreateOp :: AnimationListener ( op) => op. base . prev ,
271275 CreateOp :: Pipe ( op) => op. base . prev ,
272276 CreateOp :: Defer ( op) => op. base . prev ,
@@ -311,6 +315,7 @@ impl<'a> Op for CreateOp<'a> {
311315 CreateOp :: Listener ( op) => op. base . next ,
312316 CreateOp :: TwoWayListener ( op) => op. base . next ,
313317 CreateOp :: AnimationString ( op) => op. base . next ,
318+ CreateOp :: Animation ( op) => op. base . next ,
314319 CreateOp :: AnimationListener ( op) => op. base . next ,
315320 CreateOp :: Pipe ( op) => op. base . next ,
316321 CreateOp :: Defer ( op) => op. base . next ,
@@ -355,6 +360,7 @@ impl<'a> Op for CreateOp<'a> {
355360 CreateOp :: Listener ( op) => op. base . prev = prev,
356361 CreateOp :: TwoWayListener ( op) => op. base . prev = prev,
357362 CreateOp :: AnimationString ( op) => op. base . prev = prev,
363+ CreateOp :: Animation ( op) => op. base . prev = prev,
358364 CreateOp :: AnimationListener ( op) => op. base . prev = prev,
359365 CreateOp :: Pipe ( op) => op. base . prev = prev,
360366 CreateOp :: Defer ( op) => op. base . prev = prev,
@@ -399,6 +405,7 @@ impl<'a> Op for CreateOp<'a> {
399405 CreateOp :: Listener ( op) => op. base . next = next,
400406 CreateOp :: TwoWayListener ( op) => op. base . next = next,
401407 CreateOp :: AnimationString ( op) => op. base . next = next,
408+ CreateOp :: Animation ( op) => op. base . next = next,
402409 CreateOp :: AnimationListener ( op) => op. base . next = next,
403410 CreateOp :: Pipe ( op) => op. base . next = next,
404411 CreateOp :: Defer ( op) => op. base . next = next,
@@ -484,8 +491,6 @@ pub enum UpdateOp<'a> {
484491 /// Intermediate binding.
485492 Binding ( BindingOp < ' a > ) ,
486493 /// Animation binding.
487- Animation ( AnimationOp < ' a > ) ,
488- /// Animation binding.
489494 AnimationBinding ( AnimationBindingOp < ' a > ) ,
490495 /// Semantic variable declaration.
491496 Variable ( UpdateVariableOp < ' a > ) ,
@@ -517,7 +522,6 @@ impl<'a> Op for UpdateOp<'a> {
517522 UpdateOp :: I18nExpression ( _) => OpKind :: I18nExpression ,
518523 UpdateOp :: I18nApply ( _) => OpKind :: I18nApply ,
519524 UpdateOp :: Binding ( _) => OpKind :: Binding ,
520- UpdateOp :: Animation ( _) => OpKind :: Animation ,
521525 UpdateOp :: AnimationBinding ( _) => OpKind :: AnimationBinding ,
522526 UpdateOp :: Variable ( _) => OpKind :: Variable ,
523527 UpdateOp :: Control ( _) => OpKind :: Control ,
@@ -545,7 +549,6 @@ impl<'a> Op for UpdateOp<'a> {
545549 UpdateOp :: I18nExpression ( op) => op. base . prev ,
546550 UpdateOp :: I18nApply ( op) => op. base . prev ,
547551 UpdateOp :: Binding ( op) => op. base . prev ,
548- UpdateOp :: Animation ( op) => op. base . prev ,
549552 UpdateOp :: AnimationBinding ( op) => op. base . prev ,
550553 UpdateOp :: Variable ( op) => op. base . prev ,
551554 UpdateOp :: Control ( op) => op. base . prev ,
@@ -573,7 +576,6 @@ impl<'a> Op for UpdateOp<'a> {
573576 UpdateOp :: I18nExpression ( op) => op. base . next ,
574577 UpdateOp :: I18nApply ( op) => op. base . next ,
575578 UpdateOp :: Binding ( op) => op. base . next ,
576- UpdateOp :: Animation ( op) => op. base . next ,
577579 UpdateOp :: AnimationBinding ( op) => op. base . next ,
578580 UpdateOp :: Variable ( op) => op. base . next ,
579581 UpdateOp :: Control ( op) => op. base . next ,
@@ -601,7 +603,6 @@ impl<'a> Op for UpdateOp<'a> {
601603 UpdateOp :: I18nExpression ( op) => op. base . prev = prev,
602604 UpdateOp :: I18nApply ( op) => op. base . prev = prev,
603605 UpdateOp :: Binding ( op) => op. base . prev = prev,
604- UpdateOp :: Animation ( op) => op. base . prev = prev,
605606 UpdateOp :: AnimationBinding ( op) => op. base . prev = prev,
606607 UpdateOp :: Variable ( op) => op. base . prev = prev,
607608 UpdateOp :: Control ( op) => op. base . prev = prev,
@@ -629,7 +630,6 @@ impl<'a> Op for UpdateOp<'a> {
629630 UpdateOp :: I18nExpression ( op) => op. base . next = next,
630631 UpdateOp :: I18nApply ( op) => op. base . next = next,
631632 UpdateOp :: Binding ( op) => op. base . next = next,
632- UpdateOp :: Animation ( op) => op. base . next = next,
633633 UpdateOp :: AnimationBinding ( op) => op. base . next = next,
634634 UpdateOp :: Variable ( op) => op. base . next = next,
635635 UpdateOp :: Control ( op) => op. base . next = next,
@@ -1817,17 +1817,35 @@ pub struct BindingOp<'a> {
18171817 pub is_text_attribute : bool ,
18181818}
18191819
1820- /// Animation binding.
1820+ /// Animation binding (CREATE op).
1821+ ///
1822+ /// This operation is converted from AnimationBinding during the convert_animations phase.
1823+ /// It emits a syntheticHostProperty instruction that binds an animation trigger to an element.
1824+ ///
1825+ /// In Angular's TypeScript, AnimationOp has handlerOps for callback bodies, but in our
1826+ /// simplified implementation we keep the expression directly and emit a return statement.
1827+ ///
1828+ /// Ported from Angular's `AnimationOp` in `ir/src/ops/create.ts`.
18211829#[ derive( Debug ) ]
18221830pub struct AnimationOp < ' a > {
18231831 /// Common operation metadata.
1824- pub base : UpdateOpBase < ' a > ,
1832+ pub base : CreateOpBase < ' a > ,
18251833 /// Target element.
18261834 pub target : XrefId ,
18271835 /// Animation name.
18281836 pub name : Atom < ' a > ,
1829- /// Expression.
1830- pub expression : Box < ' a , IrExpression < ' a > > ,
1837+ /// Animation kind (enter or leave).
1838+ pub animation_kind : AnimationKind ,
1839+ /// Handler operations (contains the expression as a return statement).
1840+ pub handler_ops : Vec < ' a , UpdateOp < ' a > > ,
1841+ /// Function name for the handler.
1842+ pub handler_fn_name : Option < Atom < ' a > > ,
1843+ /// I18n message.
1844+ pub i18n_message : Option < XrefId > ,
1845+ /// Security context.
1846+ pub security_context : SecurityContext ,
1847+ /// Sanitizer function.
1848+ pub sanitizer : Option < Atom < ' a > > ,
18311849}
18321850
18331851/// Animation string binding (CREATE op).
0 commit comments