/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */
import { AnimationZoom } from '../../parts/zoom';
import { SCALE_DIRECTION } from '../../constants';

export function EffectZoom({
  scaleDirection = SCALE_DIRECTION.SCALE_IN,
  duration = 1000,
  delay,
  easing = 'cubic-bezier(.3,0,.55,1)',
}) {
  return AnimationZoom({
    zoomFrom: scaleDirection === SCALE_DIRECTION.SCALE_OUT ? 3 : 1 / 3,
    zoomTo: 1,
    duration,
    delay,
    easing,
  });
}

@@ -588,16 +588,85 @@
 se.%0A */%0A
+/**%0A * External dependencies%0A */%0Aimport %7B v4 as uuidv4 %7D from 'uuid';
 %0A/**%0A * 
@@ -741,16 +741,66 @@
 /zoom';%0A
+import %7B AnimationFade %7D from '../../parts/fade';%0A
 import %7B
@@ -995,159 +995,1546 @@
 %7B%0A  
-return AnimationZoom(%7B%0A    zoomFrom: scaleDirection === SCALE_DIRECTION.SCALE_OUT ? 3 : 1 / 3,%0A    zoomTo: 1,%0A    duration,%0A    delay,%0A    easing,%0A  %7D)
+const id = uuidv4();%0A%0A  const %7B%0A    WAAPIAnimation: ZoomWAAPIAnimation,%0A    AMPTarget: ZoomAMPTarget,%0A    AMPAnimation: ZoomAMPAnimation,%0A    generatedKeyframes: zoomKeyframes,%0A  %7D = AnimationZoom(%7B%0A    zoomFrom: scaleDirection === SCALE_DIRECTION.SCALE_OUT ? 3 : 1 / 3,%0A    zoomTo: 1,%0A    duration,%0A    delay,%0A    easing,%0A  %7D);%0A%0A  const %7B%0A    WAAPIAnimation: FadeWAAPIAnimation,%0A    AMPTarget: FadeAMPTarget,%0A    AMPAnimation: FadeAMPAnimation,%0A    generatedKeyframes: fadeKeyframes,%0A  %7D = AnimationFade(%7B%0A    fadeFrom: scaleDirection === SCALE_DIRECTION.SCALE_OUT ? 1 : 0,%0A    fadeTo: 1,%0A    duration: duration,%0A    delay,%0A    easing,%0A  %7D);%0A%0A  return %7B%0A    id,%0A    // eslint-disable-next-line react/prop-types%0A    WAAPIAnimation: function WAAPIAnimation(%7B children, hoistAnimation %7D) %7B%0A      return (%0A        %3CFadeWAAPIAnimation hoistAnimation=%7BhoistAnimation%7D%3E%0A          %3CZoomWAAPIAnimation hoistAnimation=%7BhoistAnimation%7D%3E%0A            %7Bchildren%7D%0A          %3C/ZoomWAAPIAnimation%3E%0A        %3C/FadeWAAPIAnimation%3E%0A      );%0A    %7D,%0A    // eslint-disable-next-line react/prop-types%0A    AMPTarget: function AMPTarget(%7B children, style %7D) %7B%0A      return (%0A        %3CFadeAMPTarget style=%7Bstyle%7D%3E%0A          %3CZoomAMPTarget style=%7Bstyle%7D%3E%7Bchildren%7D%3C/ZoomAMPTarget%3E%0A        %3C/FadeAMPTarget%3E%0A      );%0A    %7D,%0A    AMPAnimation: function AMPAnimation() %7B%0A      return (%0A        %3C%3E%0A          %3CFadeAMPAnimation /%3E%0A          %3CZoomAMPAnimation /%3E%0A        %3C/%3E%0A      );%0A    %7D,%0A    generatedKeyframes: %7B%0A      ...fadeKeyframes,%0A      ...zoomKeyframes,%0A    %7D,%0A  %7D
 ;%0A%7D%0A

add opacity anim to scale in anim (#8270)