@wix/entity-advanced-permissions 1.1243.0 → 1.1245.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64064,13 +64064,10 @@ function isValidRequest(fittingType, src, target) {
64064
64064
  Object.values(fittingTypes).includes(fittingType));
64065
64065
  }
64066
64066
  /**
64067
- * returns true if image is of WEBP type and transform is allowed or is not WEBP format
64067
+ * returns true unless image is animated webp and allowAnimatedTransform experiment is false
64068
64068
  */
64069
- function canTransformIfWEBP(uri, hasAnimation, allowWEBPTransform = false, allowAnimatedTransform = false) {
64070
- if (!isWEBP(uri)) {
64071
- return true;
64072
- }
64073
- return hasAnimation ? allowAnimatedTransform : allowWEBPTransform;
64069
+ function canTransformIfAnimatedWEBP(uri, hasAnimation, allowAnimatedTransform = false) {
64070
+ return !(isWEBP(uri) && hasAnimation && !allowAnimatedTransform);
64074
64071
  }
64075
64072
  /**
64076
64073
  * returns true if image is of GIF type and animated transform is allowed (experiment in placeholder flow)
@@ -64081,8 +64078,8 @@ function isTransformableGIF(uri, allowAnimatedTransform = false) {
64081
64078
  /**
64082
64079
  * check if image transform is supported for source image
64083
64080
  */
64084
- function isImageTransformApplicable(uri, hasAnimation, allowWEBPTransform, allowAnimatedTransform) {
64085
- return (canTransformIfWEBP(uri, hasAnimation, allowWEBPTransform, allowAnimatedTransform) &&
64081
+ function isImageTransformApplicable(uri, hasAnimation, allowAnimatedTransform) {
64082
+ return (canTransformIfAnimatedWEBP(uri, hasAnimation, allowAnimatedTransform) &&
64086
64083
  (isImageTypeSupported(uri) ||
64087
64084
  isTransformableGIF(uri, allowAnimatedTransform)) &&
64088
64085
  !isExternalUrl(uri));
@@ -65477,7 +65474,7 @@ function getTransform(fittingType, src, target, options) {
65477
65474
  const devicePixelRatio = _isSEOBot ? 1 : getDevicePixelRatio(target);
65478
65475
  const fileExtension = getFileExtension(src.id);
65479
65476
  const preferredExtension = fileExtension;
65480
- const canTransformImage = isImageTransformApplicable(src.id, options?.hasAnimation, options?.allowWEBPTransform, options?.allowAnimatedTransform);
65477
+ const canTransformImage = isImageTransformApplicable(src.id, options?.hasAnimation, options?.allowAnimatedTransform);
65481
65478
  const transformsObj = {
65482
65479
  fileName,
65483
65480
  fileExtension,
@@ -65669,7 +65666,7 @@ function getImageURI(transformsObj) {
65669
65666
  */
65670
65667
  function getURI(fittingType, src, target, options = {}, transformObj) {
65671
65668
  // check if image transformation is applicable (e.g. .gif, .wix_mp)
65672
- if (isImageTransformApplicable(src.id, options?.hasAnimation, options?.allowWEBPTransform, options?.allowAnimatedTransform)) {
65669
+ if (isImageTransformApplicable(src.id, options?.hasAnimation, options?.allowAnimatedTransform)) {
65673
65670
  if (isWEBP(src.id)) {
65674
65671
  // exclude alignment, focalPoint and crop from webp transformation in order not to break webp images before transformation was enabled
65675
65672
  const { alignment, ...transformTarget } = target;
@@ -65941,8 +65938,7 @@ function getPlaceholder(fittingType, src, target, options = {}) {
65941
65938
  return emptyData;
65942
65939
  }
65943
65940
  const { autoEncode = true, isSEOBot, shouldLoadHQImage, hasAnimation, allowAnimatedTransform, } = options;
65944
- const alwaysAllowWEBPTransform = true;
65945
- const canTransformImage = isImageTransformApplicable(src.id, hasAnimation, alwaysAllowWEBPTransform, allowAnimatedTransform);
65941
+ const canTransformImage = isImageTransformApplicable(src.id, hasAnimation, allowAnimatedTransform);
65946
65942
  if (!canTransformImage || shouldLoadHQImage) {
65947
65943
  /* Either:
65948
65944
  * 1. Transform isn't applicable so target is original size applied with fluid CSS
@@ -65973,7 +65969,6 @@ function getPlaceholder(fittingType, src, target, options = {}) {
65973
65969
  autoEncode,
65974
65970
  filters: blur ? { blur } : {},
65975
65971
  hasAnimation,
65976
- allowWEBPTransform: alwaysAllowWEBPTransform,
65977
65972
  allowAnimatedTransform,
65978
65973
  });
65979
65974
  const { attr = {}, css } = getData(fittingType, src, {