@wix/entity-advanced-permissions 1.1354.0 → 1.1356.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.
@@ -60809,6 +60809,7 @@ const fileType = {
60809
60809
  WIX_MP: 'wix_mp',
60810
60810
  GIF: 'gif',
60811
60811
  SVG: 'svg',
60812
+ AVIF: 'avif',
60812
60813
  UNRECOGNIZED: 'unrecognized',
60813
60814
  };
60814
60815
  const encodingTypes = {
@@ -60864,6 +60865,7 @@ const SUPPORTED_IMAGE_EXTENSIONS = [
60864
60865
  fileType.WIX_ICO_MP,
60865
60866
  fileType.WIX_MP,
60866
60867
  fileType.WEBP,
60868
+ fileType.AVIF,
60867
60869
  ];
60868
60870
  const JPG_EXTENSIONS = [
60869
60871
  fileType.JPEG,
@@ -60896,8 +60898,9 @@ function isValidRequest(fittingType, src, target) {
60896
60898
  /**
60897
60899
  * returns true unless image is animated webp and allowAnimatedTransform is false
60898
60900
  */
60899
- function canTransformIfAnimatedWEBP(uri, hasAnimation, allowAnimatedTransform = false) {
60900
- return !(imageServiceUtils_isWEBP(uri) && hasAnimation && !allowAnimatedTransform);
60901
+ function canTransformIfAnimatedImage(uri, hasAnimation, allowAnimatedTransform = false) {
60902
+ const isAvifWebpFormat = imageServiceUtils_isWEBP(uri) || isAVIF(uri);
60903
+ return !(isAvifWebpFormat && hasAnimation && !allowAnimatedTransform);
60901
60904
  }
60902
60905
  /**
60903
60906
  * returns true if image is a gif and allowAnimatedTransform is true
@@ -60909,7 +60912,7 @@ function isTransformableGIF(uri, allowAnimatedTransform = false) {
60909
60912
  * check if image transform is supported for source image
60910
60913
  */
60911
60914
  function isImageTransformApplicable(uri, hasAnimation, allowAnimatedTransform) {
60912
- return (canTransformIfAnimatedWEBP(uri, hasAnimation, allowAnimatedTransform) &&
60915
+ return (canTransformIfAnimatedImage(uri, hasAnimation, allowAnimatedTransform) &&
60913
60916
  (isImageTypeSupported(uri) ||
60914
60917
  isTransformableGIF(uri, allowAnimatedTransform)) &&
60915
60918
  !isExternalUrl(uri));
@@ -60950,6 +60953,15 @@ function imageServiceUtils_isWEBP(uri) {
60950
60953
  function isGIF(uri) {
60951
60954
  return getFileExtension(uri) === fileType.GIF;
60952
60955
  }
60956
+ /**
60957
+ * returns true if image is of webP type
60958
+ * @param {string} uri
60959
+ *
60960
+ * @returns {boolean}
60961
+ */
60962
+ function isAVIF(uri) {
60963
+ return getFileExtension(uri) === fileType.AVIF;
60964
+ }
60953
60965
  /**
60954
60966
  * returns true if the url starts with http, https, // or data
60955
60967
  * @param {string} url
@@ -61027,6 +61039,9 @@ function getFileType(uri) {
61027
61039
  else if (isGIF(uri)) {
61028
61040
  return fileType.GIF;
61029
61041
  }
61042
+ else if (isAVIF(uri)) {
61043
+ return fileType.AVIF;
61044
+ }
61030
61045
  return fileType.UNRECOGNIZED;
61031
61046
  }
61032
61047
  /**
@@ -61410,8 +61425,8 @@ function getUpscaleString(options) {
61410
61425
  return (upscaleMethods[options.upscaleMethod.toUpperCase()] || upscaleMethods.AUTO);
61411
61426
  }
61412
61427
  function imageIsAnimated(uri, hasAnimation) {
61413
- return (getFileExtension(uri) === fileType.GIF ||
61414
- (getFileExtension(uri) === fileType.WEBP && hasAnimation));
61428
+ const isAvifWebpFormat = imageServiceUtils_isWEBP(uri) || isAVIF(uri);
61429
+ return (getFileExtension(uri) === fileType.GIF || (isAvifWebpFormat && hasAnimation));
61415
61430
  }
61416
61431
 
61417
61432
  //# sourceMappingURL=imageServiceUtils.js.map
@@ -62143,7 +62158,8 @@ function getQuality(transformsObj, options) {
62143
62158
  const isPNG = transformsObj.fileType === fileType.PNG;
62144
62159
  const isJPG = transformsObj.fileType === fileType.JPG;
62145
62160
  const isWEBP = transformsObj.fileType === fileType.WEBP;
62146
- const isQualitySupported = isJPG || isPNG || isWEBP;
62161
+ const isAVIF = transformsObj.fileType === fileType.AVIF;
62162
+ const isQualitySupported = isJPG || isPNG || isWEBP || isAVIF;
62147
62163
  if (isQualitySupported) {
62148
62164
  const transformData = last(transformsObj.parts);
62149
62165
  const defaultQuality = getPreferredImageQuality(transformData.width, transformData.height);
@@ -62524,8 +62540,8 @@ function getImageURI(transformsObj) {
62524
62540
  function getURI(fittingType, src, target, options = {}, transformObj) {
62525
62541
  // check if image transformation is applicable (e.g. .gif, .wix_mp)
62526
62542
  if (isImageTransformApplicable(src.id, options?.hasAnimation, options?.allowAnimatedTransform)) {
62527
- if (imageServiceUtils_isWEBP(src.id)) {
62528
- // exclude alignment, focalPoint and crop from webp transformation in order not to break webp images before transformation was enabled
62543
+ if (imageServiceUtils_isWEBP(src.id) || isAVIF(src.id)) {
62544
+ // exclude alignment, focalPoint and crop from webp and avif transformation in order not to break webp or avif images before transformation was enabled
62529
62545
  const { alignment, ...transformTarget } = target;
62530
62546
  src.focalPoint = { x: undefined, y: undefined };
62531
62547
  delete src?.crop;