next-cloudinary 6.0.0-beta.8 → 6.0.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.
package/README.md CHANGED
@@ -12,7 +12,8 @@
12
12
 
13
13
  ######
14
14
 
15
- <a href="https://github.com/cloudinary-community/next-cloudinary/actions/workflows/test_and_release.yml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/cloudinary-community/next-cloudinary/test_and_release.yml?branch=main&label=Test%20%26%20Release&style=flat-square"></a> <a href="https://www.npmjs.com/package/next-cloudinary"><img alt="npm" src="https://img.shields.io/npm/v/next-cloudinary?style=flat-square"></a> <a href="https://github.com/cloudinary-community/next-cloudinary/blob/main/LICENSE"><img alt="GitHub" src="https://img.shields.io/github/license/cloudinary-community/next-cloudinary?label=License&style=flat-square"></a>
15
+ <a href="https://github.com/cloudinary-community/next-cloudinary/actions/workflows/test_and_release.yml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/cloudinary-community/next-cloudinary/test_and_release.yml?branch=main&label=Test%20%26%20Release&style=flat-square"></a> <a href="https://www.npmjs.com/package/next-cloudinary"><img alt="npm" src="https://img.shields.io/npm/v/next-cloudinary?style=flat-square"></a> <a href="https://bundlephobia.com/package/next-cloudinary"><img alt="npm bundle size" src="https://img.shields.io/bundlephobia/min/next-cloudinary?style=flat-square&label=Minified%20Size"></a> <a href="https://github.com/cloudinary-community/next-cloudinary/blob/main/LICENSE"><img alt="GitHub" src="https://img.shields.io/github/license/cloudinary-community/next-cloudinary?label=License&style=flat-square"></a>
16
+
16
17
 
17
18
  # Next Cloudinary
18
19
 
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import * as _cloudinary_util_url_loader_dist_schema_UX7RRFIR from '@cloudinary-util/url-loader/dist/schema-UX7RRFIR';
1
+ import * as _cloudinary_util_url_loader_dist_schema_OKEuUbyx from '@cloudinary-util/url-loader/dist/schema-OKEuUbyx';
2
2
  import React, { MutableRefObject } from 'react';
3
3
  import { ImageProps } from 'next/image';
4
4
  import { ImageOptions, ConfigOptions, AnalyticsOptions, VideoOptions } from '@cloudinary-util/url-loader';
@@ -13,7 +13,23 @@ type CldImageProps = Omit<ImageProps, 'src'> & ImageOptions & {
13
13
  };
14
14
  declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src"> & {
15
15
  src: string;
16
- crop?: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop" | undefined;
16
+ crop?: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop" | {
17
+ type: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop";
18
+ aspectRatio?: string | number | undefined;
19
+ gravity?: string | undefined;
20
+ height?: string | number | undefined;
21
+ width?: string | number | undefined;
22
+ zoom?: string | undefined;
23
+ source?: boolean | undefined;
24
+ } | {
25
+ type: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop";
26
+ aspectRatio?: string | number | undefined;
27
+ gravity?: string | undefined;
28
+ height?: string | number | undefined;
29
+ width?: string | number | undefined;
30
+ zoom?: string | undefined;
31
+ source?: boolean | undefined;
32
+ }[] | undefined;
17
33
  sanitize?: boolean | undefined;
18
34
  assetType?: string | undefined;
19
35
  deliveryType?: string | undefined;
@@ -23,6 +39,9 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
23
39
  quality?: string | number | undefined;
24
40
  strictTransformations?: boolean | undefined;
25
41
  width?: string | number | undefined;
42
+ aspectRatio?: string | number | undefined;
43
+ gravity?: string | undefined;
44
+ zoom?: string | undefined;
26
45
  art?: any;
27
46
  autoBrightness?: any;
28
47
  autoColor?: any;
@@ -119,17 +138,16 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
119
138
  vibrance?: any;
120
139
  vignette?: any;
121
140
  }[] | undefined;
122
- flags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
123
- gravity?: string | undefined;
141
+ flags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
124
142
  text?: string | undefined;
125
143
  version?: string | number | undefined;
126
144
  underlay?: string | undefined;
127
145
  underlays?: {
128
146
  appliedEffects?: {}[] | undefined;
129
- appliedFlags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
147
+ appliedFlags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
130
148
  effects?: {}[] | undefined;
131
149
  crop?: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop" | undefined;
132
- flags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
150
+ flags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
133
151
  height?: string | number | undefined;
134
152
  position?: {
135
153
  angle?: string | number | undefined;
@@ -147,10 +165,10 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
147
165
  rawTransformations?: string | string[] | undefined;
148
166
  overlay?: {
149
167
  appliedEffects?: {}[] | undefined;
150
- appliedFlags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
168
+ appliedFlags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
151
169
  effects?: {}[] | undefined;
152
170
  crop?: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop" | undefined;
153
- flags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
171
+ flags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
154
172
  height?: string | number | undefined;
155
173
  position?: {
156
174
  angle?: string | number | undefined;
@@ -179,10 +197,10 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
179
197
  } | undefined;
180
198
  overlays?: {
181
199
  appliedEffects?: {}[] | undefined;
182
- appliedFlags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
200
+ appliedFlags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
183
201
  effects?: {}[] | undefined;
184
202
  crop?: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop" | undefined;
185
- flags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
203
+ flags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
186
204
  height?: string | number | undefined;
187
205
  position?: {
188
206
  angle?: string | number | undefined;
@@ -211,9 +229,6 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
211
229
  }[] | undefined;
212
230
  namedTransformations?: string | string[] | undefined;
213
231
  transformations?: string | string[] | undefined;
214
- aspectRatio?: string | number | undefined;
215
- widthResize?: string | number | undefined;
216
- zoom?: string | undefined;
217
232
  zoompan?: string | boolean | {
218
233
  options: string;
219
234
  loop: string | boolean;
@@ -242,7 +257,7 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
242
257
  } | undefined;
243
258
  defaultImage?: string | undefined;
244
259
  } & {
245
- config?: _cloudinary_util_url_loader_dist_schema_UX7RRFIR.g | undefined;
260
+ config?: _cloudinary_util_url_loader_dist_schema_OKEuUbyx.e | undefined;
246
261
  preserveTransformations?: boolean | undefined;
247
262
  src: string;
248
263
  unoptimized?: boolean | undefined;
@@ -349,7 +364,6 @@ interface CldVideoPlayerPropsLogo {
349
364
  declare const CldVideoPlayer: (props: CldVideoPlayerProps) => React.JSX.Element;
350
365
 
351
366
  interface CloudinaryLoaderCldOptions {
352
- widthResize?: string | number;
353
367
  }
354
368
  interface CloudinaryLoaderLoaderOptions {
355
369
  height?: string | number;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as _cloudinary_util_url_loader_dist_schema_UX7RRFIR from '@cloudinary-util/url-loader/dist/schema-UX7RRFIR';
1
+ import * as _cloudinary_util_url_loader_dist_schema_OKEuUbyx from '@cloudinary-util/url-loader/dist/schema-OKEuUbyx';
2
2
  import React, { MutableRefObject } from 'react';
3
3
  import { ImageProps } from 'next/image';
4
4
  import { ImageOptions, ConfigOptions, AnalyticsOptions, VideoOptions } from '@cloudinary-util/url-loader';
@@ -13,7 +13,23 @@ type CldImageProps = Omit<ImageProps, 'src'> & ImageOptions & {
13
13
  };
14
14
  declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src"> & {
15
15
  src: string;
16
- crop?: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop" | undefined;
16
+ crop?: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop" | {
17
+ type: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop";
18
+ aspectRatio?: string | number | undefined;
19
+ gravity?: string | undefined;
20
+ height?: string | number | undefined;
21
+ width?: string | number | undefined;
22
+ zoom?: string | undefined;
23
+ source?: boolean | undefined;
24
+ } | {
25
+ type: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop";
26
+ aspectRatio?: string | number | undefined;
27
+ gravity?: string | undefined;
28
+ height?: string | number | undefined;
29
+ width?: string | number | undefined;
30
+ zoom?: string | undefined;
31
+ source?: boolean | undefined;
32
+ }[] | undefined;
17
33
  sanitize?: boolean | undefined;
18
34
  assetType?: string | undefined;
19
35
  deliveryType?: string | undefined;
@@ -23,6 +39,9 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
23
39
  quality?: string | number | undefined;
24
40
  strictTransformations?: boolean | undefined;
25
41
  width?: string | number | undefined;
42
+ aspectRatio?: string | number | undefined;
43
+ gravity?: string | undefined;
44
+ zoom?: string | undefined;
26
45
  art?: any;
27
46
  autoBrightness?: any;
28
47
  autoColor?: any;
@@ -119,17 +138,16 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
119
138
  vibrance?: any;
120
139
  vignette?: any;
121
140
  }[] | undefined;
122
- flags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
123
- gravity?: string | undefined;
141
+ flags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
124
142
  text?: string | undefined;
125
143
  version?: string | number | undefined;
126
144
  underlay?: string | undefined;
127
145
  underlays?: {
128
146
  appliedEffects?: {}[] | undefined;
129
- appliedFlags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
147
+ appliedFlags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
130
148
  effects?: {}[] | undefined;
131
149
  crop?: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop" | undefined;
132
- flags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
150
+ flags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
133
151
  height?: string | number | undefined;
134
152
  position?: {
135
153
  angle?: string | number | undefined;
@@ -147,10 +165,10 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
147
165
  rawTransformations?: string | string[] | undefined;
148
166
  overlay?: {
149
167
  appliedEffects?: {}[] | undefined;
150
- appliedFlags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
168
+ appliedFlags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
151
169
  effects?: {}[] | undefined;
152
170
  crop?: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop" | undefined;
153
- flags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
171
+ flags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
154
172
  height?: string | number | undefined;
155
173
  position?: {
156
174
  angle?: string | number | undefined;
@@ -179,10 +197,10 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
179
197
  } | undefined;
180
198
  overlays?: {
181
199
  appliedEffects?: {}[] | undefined;
182
- appliedFlags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
200
+ appliedFlags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
183
201
  effects?: {}[] | undefined;
184
202
  crop?: "fill" | "lfill" | "fill_pad" | "crop" | "thumb" | "scale" | "fit" | "limit" | "mfit" | "pad" | "lpad" | "mpad" | "imagga_scale" | "imagga_crop" | undefined;
185
- flags?: "splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("splice" | "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
203
+ flags?: "animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform" | ("animated" | "any_format" | "apng" | "attachment" | "awebp" | "clip" | "clip_evenodd" | "cutter" | "force_icc" | "force_strip" | "getinfo" | "group4" | "hlsv3" | "ignore_aspect_ratio" | "ignore_mask_channels" | "immutable_cache" | "keep_attribution" | "keep_dar" | "keep_iptc" | "layer_apply" | "lossy" | "mono" | "no_overflow" | "no_stream" | "png8_fl_png24_fl_png32" | "preserve_transparency" | "progressive" | "rasterize" | "region_relative" | "relative" | "replace_image" | "sanitize" | "splice" | "streaming_attachment" | "strip_profile" | "text_disallow_overflow" | "text_no_trim" | "tiff8_lzw" | "tiled" | "truncate_ts" | "waveform")[] | undefined;
186
204
  height?: string | number | undefined;
187
205
  position?: {
188
206
  angle?: string | number | undefined;
@@ -211,9 +229,6 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
211
229
  }[] | undefined;
212
230
  namedTransformations?: string | string[] | undefined;
213
231
  transformations?: string | string[] | undefined;
214
- aspectRatio?: string | number | undefined;
215
- widthResize?: string | number | undefined;
216
- zoom?: string | undefined;
217
232
  zoompan?: string | boolean | {
218
233
  options: string;
219
234
  loop: string | boolean;
@@ -242,7 +257,7 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
242
257
  } | undefined;
243
258
  defaultImage?: string | undefined;
244
259
  } & {
245
- config?: _cloudinary_util_url_loader_dist_schema_UX7RRFIR.g | undefined;
260
+ config?: _cloudinary_util_url_loader_dist_schema_OKEuUbyx.e | undefined;
246
261
  preserveTransformations?: boolean | undefined;
247
262
  src: string;
248
263
  unoptimized?: boolean | undefined;
@@ -349,7 +364,6 @@ interface CldVideoPlayerPropsLogo {
349
364
  declare const CldVideoPlayer: (props: CldVideoPlayerProps) => React.JSX.Element;
350
365
 
351
366
  interface CloudinaryLoaderCldOptions {
352
- widthResize?: string | number;
353
367
  }
354
368
  interface CloudinaryLoaderLoaderOptions {
355
369
  height?: string | number;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var ve=Object.create;var q=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var We=Object.getOwnPropertyNames;var Ve=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty;var Se=(e,t)=>{for(var i in t)q(e,i,{get:t[i],enumerable:!0})},ge=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of We(t))!De.call(e,o)&&o!==i&&q(e,o,{get:()=>t[o],enumerable:!(n=Me(t,o))||n.enumerable});return e};var w=(e,t,i)=>(i=e!=null?ve(Ve(e)):{},ge(t||!e||!e.__esModule?q(i,"default",{value:e,enumerable:!0}):i,e)),ke=e=>ge(q({},"__esModule",{value:!0}),e);var ze={};Se(ze,{CldImage:()=>ie,CldOgImage:()=>le,CldUploadButton:()=>se,CldUploadWidget:()=>Y,CldVideoPlayer:()=>pe,cloudinaryLoader:()=>ee,getCldImageUrl:()=>U,getCldOgImageUrl:()=>Te,getCldVideoUrl:()=>te});module.exports=ke(ze);var T=w(require("react")),he=w(require("next/image")),Ie=require("@cloudinary-util/util"),Ue=require("@cloudinary-util/url-loader");async function K(e){let{src:t}=e;try{await new Promise((i,n)=>{fetch(t).then(o=>{if(!o.ok){n(o);return}i(o)})})}catch(i){return i.status===423?await K(e):!1}return!0}function b(e){if(!e)throw new Error("A Cloudinary Cloud name is required, please make sure NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME is set and configured in your environment.")}var Ce=require("@cloudinary-util/url-loader");var ye=w(require("next/package.json"));var fe={name:"next-cloudinary",version:"6.0.0-beta.8",license:"MIT",main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",source:"src/index.ts",scripts:{build:"tsup",dev:"tsup --watch",prepublishOnly:"cp ../README.md . && cp ../LICENSE . && pnpm build",postpublish:"rm ./README.md && rm ./LICENSE",test:"jest","test:app":'NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="test" pnpm build && cd tests/nextjs-app && pnpm build'},dependencies:{"@cloudinary-util/types":"1.0.0","@cloudinary-util/url-loader":"4.2.0","@cloudinary-util/util":"^2.3.0"},devDependencies:{"@babel/core":"^7.23.2","@babel/preset-env":"^7.23.2","@types/jest":"^29.5.6","@types/node":"^20.11.5","@types/react":"^18.2.33","@types/react-dom":"^18.2.14","babel-jest":"^29.7.0",dotenv:"^16.3.1",jest:"^29.7.0","jest-environment-jsdom":"^29.7.0",mkdirp:"^3.0.1","ts-jest":"^29.1.1",tsup:"^7.2.0",typescript:"^5.2.2"},peerDependencies:{next:"^12 || ^13 || ^14",react:"^17 || ^18"}};var Q="V",J=fe.version,Z=ye.default.version;function U(e,t,i){var o,r;let n=(r=(o=t==null?void 0:t.cloud)==null?void 0:o.cloudName)!=null?r:process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME;return b(n),(0,Ce.constructCloudinaryUrl)({options:e,config:Object.assign({cloud:{cloudName:n}},t),analytics:Object.assign({sdkCode:Q,sdkSemver:J,techVersion:Z,feature:""},i)})}function ee({loaderOptions:e,imageProps:t,cldOptions:i,cldConfig:n={}}){let o={...t,...i};o.width=typeof o.width=="string"?parseInt(o.width):o.width,o.height=typeof o.height=="string"?parseInt(o.height):o.height;let r;return typeof(e==null?void 0:e.width)=="number"&&typeof o.width=="number"&&e.width!==o.width?r=e.width:typeof(e==null?void 0:e.width)=="number"&&typeof(o==null?void 0:o.width)!="number"&&(r=e.width,o.width=r),o.width&&r&&r<o.width&&(o.widthResize=e.width),U(o,n)}var je=(0,T.forwardRef)(function(t,i){let n=!1,o=["deliveryType","preserveTransformations","strictTransformations","assetType"];Ue.transformationPlugins.forEach(({props:a})=>{Object.keys(a).forEach(E=>{if(o.includes(E))throw new Error(`Option ${E} already exists!`);o.push(E)})});let r={alt:t.alt,src:t.src};Object.keys(t).filter(a=>!o.includes(a)).forEach(a=>r[a]=t[a]);let u=Object.keys(r).map(a=>`${a}:${r[a]}`).join(";"),[h,I]=(0,T.useState)(u),d={};if(o.forEach(a=>{t[a]&&(d[a]=t[a]||void 0)}),t.preserveTransformations)try{let a=(0,Ie.getTransformations)(t.src).map(O=>O.join(","));d.rawTransformations=[...a.flat(),...t.rawTransformations||[]]}catch(a){console.warn(`Failed to preserve transformations: ${a.message}`)}let s=process.env.__NEXT_IMAGE_OPTS||{};(t.unoptimized===!0||(s==null?void 0:s.unoptimized)===!0)&&(r.src=U({...d,width:r.width,height:r.height,src:r.src,format:"default",quality:"default"},t.config));async function x(a){let O=!0;if(n)return;if(n=!0,typeof t.onError=="function"){let L=t.onError(a);typeof L=="boolean"&&L===!1&&(O=!1)}else typeof t.onError=="boolean"&&t.onError===!1&&(O=!1);if(O===!1)return;let E=a.target;await K({src:E.src})&&I(`${u};${Date.now()}`)}let A=(0,T.useCallback)(x,[K,u]),m=he.default;return"default"in m&&(m=m.default),T.default.createElement(m,{key:h,...r,loader:a=>ee({loaderOptions:a,imageProps:r,cldOptions:d,cldConfig:t.config}),onError:A,ref:i})}),ie=je;var _=w(require("react")),Oe=w(require("next/head"));var Re="summary_large_image",He=({excludeTags:e=[],twitterTitle:t,keys:i={},...n})=>{let{alt:o}=n,r={...n,crop:n.crop||"fill",gravity:n.gravity||"center",height:n.height||1254,src:n.src,width:n.width||2400,widthResize:n.width||1200},u=typeof r.width=="string"?parseInt(r.width):r.width,h=typeof r.height=="string"?parseInt(r.height):r.height;typeof h=="number"&&typeof u=="number"&&(h=1200/u*h),u=1200;let I=U({...r,format:n.format||"jpg"}),d=U({...r,format:n.format||"webp"}),s={"og:image":"og-image","og:image:secure_url":"og-image-secureurl","og:image:width":"og-image-width","og:image:height":"og-image-height","og:image:alt":"og-image-alt","twitter:title":"twitter-title","twitter:card":"twitter-card","twitter:image":"twitter-image",...i};return _.default.createElement(Oe.default,null,_.default.createElement("meta",{key:s["og:image"],property:"og:image",content:I}),_.default.createElement("meta",{key:s["og:image:secure_url"],property:"og:image:secure_url",content:I}),_.default.createElement("meta",{key:s["og:image:width"],property:"og:image:width",content:`${u}`}),_.default.createElement("meta",{key:s["og:image:height"],property:"og:image:height",content:`${h}`}),o&&_.default.createElement("meta",{key:s["og:image:alt"],property:"og:image:alt",content:o}),!e.includes("twitter:title")&&_.default.createElement("meta",{key:s["twitter:title"],property:"twitter:title",content:t||" "}),_.default.createElement("meta",{key:s["twitter:card"],property:"twitter:card",content:Re}),_.default.createElement("meta",{key:s["twitter:image"],property:"twitter:image",content:d}))},le=He;var $=w(require("react"));var y=w(require("react")),we=w(require("next/script"));function Ee(e){return window&&"requestIdleCallback"in window?requestIdleCallback(e):setTimeout(()=>e(),1)}var Xe=["success"],Be={abort:"onAbort","batch-cancelled":"onBatchCancelled",close:"onClose","display-changed":"onDisplayChanged",publicid:"onPublicId","queues-end":"onQueuesEnd","queues-start":"onQueuesStart",retry:"onRetry","show-completed":"onShowCompleted","source-changed":"onSourceChanged",success:"onSuccess",tags:"onTags","upload-added":"onUploadAdded"},Fe=({children:e,onError:t,onOpen:i,onUpload:n,options:o,signatureEndpoint:r,uploadPreset:u,...h})=>{let I=(0,y.useRef)(),d=(0,y.useRef)(),s=!!r,[x,A]=(0,y.useState)(void 0),[m,a]=(0,y.useState)(void 0),[O,E]=(0,y.useState)(!0),N={cloudName:process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,uploadPreset:u||process.env.NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET,apiKey:process.env.NEXT_PUBLIC_CLOUDINARY_API_KEY,...o};b(process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME),s&&(N.uploadSignature=P,N.apiKey||console.warn("Missing dependency: Signed Upload requires an API key")),(0,y.useEffect)(()=>{if(typeof m=="undefined")return;m.event==="success"&&typeof n=="function"&&(process.env.NODE_ENVIRONMENT==="development"&&console.warn("The onUpload callback is deprecated. Please use onSuccess instead."),n(m,d.current))},[m]);function L(){E(!1),I.current||(I.current=window.cloudinary),Ee(()=>{d.current||(d.current=V())})}(0,y.useEffect)(()=>()=>{var l;(l=d.current)==null||l.destroy(),d.current=void 0},[]);function P(l,g){if(typeof r=="undefined")throw Error("Failed to generate signature: signatureEndpoint undefined.");fetch(r,{method:"POST",body:JSON.stringify({paramsToSign:g}),headers:{"Content-Type":"application/json"}}).then(f=>f.json()).then(({signature:f})=>{l(f)})}function c(l,g=[]){if(d.current||(d.current=V()),typeof(d==null?void 0:d.current[l])=="function")return d.current[l](...g)}function k(l){c("close",[l])}function v(l){return c("destroy",[l])}function j(){c("hide")}function R(){return c("isDestroyed")}function H(){return c("isMinimized")}function M(){return c("isShowing")}function W(){c("minimize")}function z(l,g){c("open",[l,g]),typeof i=="function"&&i(d.current)}function re(){c("show")}function X(){c("update")}let B={close:k,destroy:v,hide:j,isDestroyed:R,isMinimized:H,isShowing:M,minimize:W,open:z,show:re,update:X};function V(){var l;return(l=I.current)==null?void 0:l.createUploadWidget(N,(g,f)=>{if(g&&g!==null&&(A(g),typeof t=="function"&&t(g,{widget:d.current,...B})),typeof(f==null?void 0:f.event)=="string"){Xe.includes(f==null?void 0:f.event)&&a(f);let D=Be[f.event];if(typeof D=="string"&&typeof h[D]=="function"){let ne=h[D];ne(f,{widget:d.current,...B})}}})}return y.default.createElement(y.default.Fragment,null,typeof e=="function"&&e({cloudinary:I.current,widget:d.current,results:m,error:x,isLoading:O,...B}),y.default.createElement(we.default,{id:`cloudinary-uploadwidget-${Math.floor(Math.random()*100)}`,src:"https://upload-widget.cloudinary.com/global/all.js",onLoad:L,onError:l=>console.error(`Failed to load Cloudinary Upload Widget: ${l.message}`)}))},Y=Fe;var Ye=({className:e,children:t,onClick:i,onError:n,onOpen:o,onUpload:r,onAbort:u,onBatchCancelled:h,onClose:I,onDisplayChanged:d,onPublicId:s,onQueuesEnd:x,onQueuesStart:A,onRetry:m,onShowCompleted:a,onSourceChanged:O,onSuccess:E,onTags:N,onUploadAdded:L,options:P,signatureEndpoint:c,uploadPreset:k,...v})=>$.default.createElement($.default.Fragment,null,$.default.createElement(Y,{onError:n,onOpen:o,onUpload:r,onAbort:u,onBatchCancelled:h,onClose:I,onDisplayChanged:d,onPublicId:s,onQueuesEnd:x,onQueuesStart:A,onRetry:m,onShowCompleted:a,onSourceChanged:O,onSuccess:E,onTags:N,onUploadAdded:L,options:P,signatureEndpoint:c,uploadPreset:k},({open:j,isLoading:R})=>{function H(M){M.preventDefault(),j(),typeof i=="function"&&i(M)}return $.default.createElement("button",{...v,className:e||"",onClick:H,disabled:R},t||"Upload")})),se=Ye;var C=w(require("react")),Ne=w(require("next/script")),Le=w(require("next/head")),be=require("@cloudinary-util/util");var Pe=require("@cloudinary-util/url-loader");function te(e,t,i){var o,r;let n=(r=(o=t==null?void 0:t.cloud)==null?void 0:o.cloudName)!=null?r:process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME;return b(n),(0,Pe.constructCloudinaryUrl)({options:{assetType:"video",...e},config:Object.assign({cloud:{cloudName:n}},t),analytics:Object.assign({sdkCode:Q,sdkSemver:J,techVersion:Z,feature:""},i)})}var oe=[],_e="1.10.4",$e=e=>{let{autoplay:t,className:i,colors:n,controls:o=!0,fontFace:r,height:u,id:h,language:I,languages:d,logo:s=!0,loop:x=!1,muted:A=!1,onDataLoad:m,onError:a,onMetadataLoad:O,onPause:E,onPlay:N,onEnded:L,poster:P,src:c,sourceTypes:k,transformation:v,quality:j="auto",width:R,...H}=e,M=Array.isArray(v)?v:[v],W=c||"";if(W.startsWith("http"))try{let p=(0,be.parseUrl)(c);typeof(p==null?void 0:p.publicId)=="string"&&(W=p==null?void 0:p.publicId)}catch(p){}M.unshift({quality:j});let z=(0,C.useRef)(),re=(0,C.useRef)(),X=e.videoRef||re,B=(0,C.useRef)(),V=e.playerRef||B,l=h||`player-${W.replace("/","-")}`,g="cld-video-player cld-fluid";i&&(g=`${g} ${i}`),oe.filter(p=>p===l).length>1?console.warn(`Multiple instances of the same video detected on the
1
+ "use strict";var Me=Object.create;var q=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var We=Object.getPrototypeOf,Ve=Object.prototype.hasOwnProperty;var Se=(t,e)=>{for(var r in e)q(t,r,{get:e[r],enumerable:!0})},me=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of De(e))!Ve.call(t,o)&&o!==r&&q(t,o,{get:()=>e[o],enumerable:!(n=ve(e,o))||n.enumerable});return t};var O=(t,e,r)=>(r=t!=null?Me(We(t)):{},me(e||!t||!t.__esModule?q(r,"default",{value:t,enumerable:!0}):r,t)),ke=t=>me(q({},"__esModule",{value:!0}),t);var ze={};Se(ze,{CldImage:()=>ie,CldOgImage:()=>le,CldUploadButton:()=>se,CldUploadWidget:()=>$,CldVideoPlayer:()=>pe,cloudinaryLoader:()=>te,getCldImageUrl:()=>P,getCldOgImageUrl:()=>F,getCldVideoUrl:()=>oe});module.exports=ke(ze);var A=O(require("react")),Ie=O(require("next/image")),he=require("@cloudinary-util/util"),Ue=require("@cloudinary-util/url-loader");async function K(t){let{src:e}=t;try{await new Promise((r,n)=>{fetch(e).then(o=>{if(!o.ok){n(o);return}r(o)})})}catch(r){return r.status===423?(await new Promise(n=>setTimeout(()=>n(void 0),200)),await K(t)):!1}return!0}function L(t){if(!t)throw new Error("A Cloudinary Cloud name is required, please make sure NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME is set and configured in your environment.")}var Ce=require("@cloudinary-util/url-loader");var fe=O(require("next/package.json"));var ge={name:"next-cloudinary",version:"6.0.0",license:"MIT",main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",source:"src/index.ts",scripts:{build:"tsup",dev:"tsup --watch",prepublishOnly:"cp ../README.md . && cp ../LICENSE . && pnpm build",postpublish:"rm ./README.md && rm ./LICENSE",test:"vitest run","test:app":'NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="test" pnpm build && cd tests/nextjs-app && npm install && npm run build',"test:watch":"vitest"},dependencies:{"@cloudinary-util/types":"1.0.0","@cloudinary-util/url-loader":"5.0.0-beta.3","@cloudinary-util/util":"^2.3.0","@tsconfig/recommended":"^1.0.3"},devDependencies:{"@babel/core":"^7.23.2","@babel/preset-env":"^7.23.2","@types/node":"^20.11.5","@types/react":"^18.2.33","@types/react-dom":"^18.2.14",dotenv:"^16.3.1",mkdirp:"^3.0.1",tsup:"^7.2.0",typescript:"^5.2.2",vitest:"^1.3.1"},peerDependencies:{next:"^12 || ^13 || ^14",react:"^17 || ^18"}};var Q="A",J="V",Z=ye(fe.default.version),ee=ye(ge.version);function ye(t){let e=t;return e.includes("-")&&(e=e.split("-")[0]),e}function P(t,e,r){let n=e?.cloud?.cloudName??process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME;return L(n),(0,Ce.constructCloudinaryUrl)({options:t,config:Object.assign({cloud:{cloudName:n}},e),analytics:Object.assign({product:Q,sdkCode:J,sdkSemver:ee,techVersion:Z,feature:""},r)})}function te({loaderOptions:t,imageProps:e,cldOptions:r,cldConfig:n={}}){let o={...e,...r};if(o.width=typeof o.width=="string"?parseInt(o.width):o.width,o.height=typeof o.height=="string"?parseInt(o.height):o.height,typeof t?.width=="number"&&typeof o.width=="number"&&t.width!==o.width){let d=t.width/o.width;o.width=t.width,typeof o.height=="number"&&(o.height=Math.floor(o.height*d))}else typeof t?.width=="number"&&typeof o?.width!="number"&&(o.width=t?.width);return P(o,n)}var Re=(0,A.forwardRef)(function(e,r){let n=!1,o=["deliveryType","preserveTransformations","strictTransformations","assetType"];Ue.transformationPlugins.forEach(({props:a})=>{Object.keys(a).forEach(U=>{if(o.includes(U))throw new Error(`Option ${U} already exists!`);o.push(U)})});let d={alt:e.alt,src:e.src};Object.keys(e).filter(a=>!o.includes(a)).forEach(a=>d[a]=e[a]);let s=Object.keys(d).map(a=>`${a}:${d[a]}`).join(";"),[I,y]=(0,A.useState)(s),i={};if(o.forEach(a=>{e[a]&&(i[a]=e[a]||void 0)}),e.preserveTransformations)try{let a=(0,he.getTransformations)(e.src).map(C=>C.join(","));i.rawTransformations=[...a.flat(),...e.rawTransformations||[]]}catch(a){console.warn(`Failed to preserve transformations: ${a.message}`)}let h=process.env.__NEXT_IMAGE_OPTS||{};(e.unoptimized===!0||h?.unoptimized===!0)&&(d.src=P({...i,width:d.width,height:d.height,src:d.src,format:"default",quality:"default"},e.config));async function x(a){let C=!0;if(n)return;if(n=!0,typeof e.onError=="function"){let N=e.onError(a);typeof N=="boolean"&&N===!1&&(C=!1)}else typeof e.onError=="boolean"&&e.onError===!1&&(C=!1);if(C===!1)return;let U=a.target;await K({src:U.src})&&y(`${s};${Date.now()}`)}let b=(0,A.useCallback)(x,[K,s]),m=Ie.default;return"default"in m&&(m=m.default),A.default.createElement(m,{key:I,...d,loader:a=>te({loaderOptions:a,imageProps:d,cldOptions:i,cldConfig:e.config}),onError:b,ref:r})}),ie=Re;var _=O(require("react")),Oe=O(require("next/head"));function F(t){return P({...t,format:t.format||"jpg",width:t.width||1200,height:t.height||627,crop:t.crop||{type:"fill",gravity:"center",source:!0}})}var je="summary_large_image",Ye=({excludeTags:t=[],twitterTitle:e,keys:r={},...n})=>{let{alt:o}=n,{width:d=1200,height:s=627}=n;d=typeof d=="string"?parseInt(d):d,s=typeof s=="string"?parseInt(s):s;let I=F({...n,width:d,height:s}),y=F({...n,width:d,height:s,format:n.format||"webp"}),i={"og:image":"og-image","og:image:secure_url":"og-image-secureurl","og:image:width":"og-image-width","og:image:height":"og-image-height","og:image:alt":"og-image-alt","twitter:title":"twitter-title","twitter:card":"twitter-card","twitter:image":"twitter-image",...r};return _.default.createElement(Oe.default,null,_.default.createElement("meta",{key:i["og:image"],property:"og:image",content:I}),_.default.createElement("meta",{key:i["og:image:secure_url"],property:"og:image:secure_url",content:I}),_.default.createElement("meta",{key:i["og:image:width"],property:"og:image:width",content:`${d}`}),_.default.createElement("meta",{key:i["og:image:height"],property:"og:image:height",content:`${s}`}),o&&_.default.createElement("meta",{key:i["og:image:alt"],property:"og:image:alt",content:o}),!t.includes("twitter:title")&&_.default.createElement("meta",{key:i["twitter:title"],property:"twitter:title",content:e||" "}),_.default.createElement("meta",{key:i["twitter:card"],property:"twitter:card",content:je}),_.default.createElement("meta",{key:i["twitter:image"],property:"twitter:image",content:y}))},le=Ye;var H=O(require("react"));var g=O(require("react")),Pe=O(require("next/script"));function Ee(t){return window&&"requestIdleCallback"in window?requestIdleCallback(t):setTimeout(()=>t(),1)}var Xe=["success"],Be={abort:"onAbort","batch-cancelled":"onBatchCancelled",close:"onClose","display-changed":"onDisplayChanged",publicid:"onPublicId","queues-end":"onQueuesEnd","queues-start":"onQueuesStart",retry:"onRetry","show-completed":"onShowCompleted","source-changed":"onSourceChanged",success:"onSuccess",tags:"onTags","upload-added":"onUploadAdded"},Fe=({children:t,onError:e,onOpen:r,onUpload:n,options:o,signatureEndpoint:d,uploadPreset:s,...I})=>{let y=(0,g.useRef)(),i=(0,g.useRef)(),h=!!d,[x,b]=(0,g.useState)(void 0),[m,a]=(0,g.useState)(void 0),[C,U]=(0,g.useState)(!0),w={cloudName:process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,uploadPreset:s||process.env.NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET,apiKey:process.env.NEXT_PUBLIC_CLOUDINARY_API_KEY,...o};L(process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME),h&&(w.uploadSignature=E,w.apiKey||console.warn("Missing dependency: Signed Upload requires an API key")),(0,g.useEffect)(()=>{if(typeof m>"u")return;m.event==="success"&&typeof n=="function"&&(process.env.NODE_ENVIRONMENT==="development"&&console.warn("The onUpload callback is deprecated. Please use onSuccess instead."),n(m,i.current))},[m]);function N(){U(!1),y.current||(y.current=window.cloudinary),Ee(()=>{i.current||(i.current=W())})}(0,g.useEffect)(()=>()=>{i.current?.destroy(),i.current=void 0},[]);function E(l,u){if(typeof d>"u")throw Error("Failed to generate signature: signatureEndpoint undefined.");fetch(d,{method:"POST",body:JSON.stringify({paramsToSign:u}),headers:{"Content-Type":"application/json"}}).then(T=>T.json()).then(({signature:T})=>{l(T)})}function c(l,u=[]){if(i.current||(i.current=W()),typeof i?.current[l]=="function")return i.current[l](...u)}function V(l){c("close",[l])}function M(l){return c("destroy",[l])}function k(){c("hide")}function G(){return c("isDestroyed")}function R(){return c("isMinimized")}function v(){return c("isShowing")}function D(){c("minimize")}function z(l,u){c("open",[l,u]),typeof r=="function"&&r(i.current)}function ne(){c("show")}function j(){c("update")}let Y={close:V,destroy:M,hide:k,isDestroyed:G,isMinimized:R,isShowing:v,minimize:D,open:z,show:ne,update:j};function W(){return y.current?.createUploadWidget(w,(l,u)=>{if(l&&l!==null&&(b(l),typeof e=="function"&&e(l,{widget:i.current,...Y})),typeof u?.event=="string"){Xe.includes(u?.event)&&a(u);let T=Be[u.event];if(typeof T=="string"&&typeof I[T]=="function"){let X=I[T];X(u,{widget:i.current,...Y})}}})}return g.default.createElement(g.default.Fragment,null,typeof t=="function"&&t({cloudinary:y.current,widget:i.current,results:m,error:x,isLoading:C,...Y}),g.default.createElement(Pe.default,{id:`cloudinary-uploadwidget-${Math.floor(Math.random()*100)}`,src:"https://upload-widget.cloudinary.com/global/all.js",onLoad:N,onError:l=>console.error(`Failed to load Cloudinary Upload Widget: ${l.message}`)}))},$=Fe;var $e=({className:t,children:e,onClick:r,onError:n,onOpen:o,onUpload:d,onAbort:s,onBatchCancelled:I,onClose:y,onDisplayChanged:i,onPublicId:h,onQueuesEnd:x,onQueuesStart:b,onRetry:m,onShowCompleted:a,onSourceChanged:C,onSuccess:U,onTags:w,onUploadAdded:N,options:E,signatureEndpoint:c,uploadPreset:V,...M})=>H.default.createElement(H.default.Fragment,null,H.default.createElement($,{onError:n,onOpen:o,onUpload:d,onAbort:s,onBatchCancelled:I,onClose:y,onDisplayChanged:i,onPublicId:h,onQueuesEnd:x,onQueuesStart:b,onRetry:m,onShowCompleted:a,onSourceChanged:C,onSuccess:U,onTags:w,onUploadAdded:N,options:E,signatureEndpoint:c,uploadPreset:V},({open:k,isLoading:G})=>{function R(v){v.preventDefault(),k(),typeof r=="function"&&r(v)}return H.default.createElement("button",{...M,className:t||"",onClick:R,disabled:G},e||"Upload")})),se=$e;var f=O(require("react")),Ne=O(require("next/script")),Te=O(require("next/head")),Le=require("@cloudinary-util/util");var _e=require("@cloudinary-util/url-loader");function oe(t,e,r){let n=e?.cloud?.cloudName??process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME;return L(n),(0,_e.constructCloudinaryUrl)({options:{assetType:"video",...t},config:Object.assign({cloud:{cloudName:n}},e),analytics:Object.assign({product:Q,sdkCode:J,sdkSemver:ee,techVersion:Z,feature:""},r)})}var re=[],we="1.10.4",He=t=>{let{autoplay:e,className:r,colors:n,controls:o=!0,fontFace:d,height:s,id:I,language:y,languages:i,logo:h=!0,loop:x=!1,muted:b=!1,onDataLoad:m,onError:a,onMetadataLoad:C,onPause:U,onPlay:w,onEnded:N,poster:E,src:c,sourceTypes:V,transformation:M,quality:k="auto",width:G,...R}=t,v=Array.isArray(M)?M:[M],D=c||"";if(D.startsWith("http"))try{let p=(0,Le.parseUrl)(c);typeof p?.publicId=="string"&&(D=p?.publicId)}catch{}v.unshift({quality:k});let z=(0,f.useRef)(),ne=(0,f.useRef)(),j=t.videoRef||ne,Y=(0,f.useRef)(),W=t.playerRef||Y,l=I||`player-${D.replace("/","-")}`,u="cld-video-player cld-fluid";r&&(u=`${u} ${r}`),re.filter(p=>p===l).length>1?console.warn(`Multiple instances of the same video detected on the
2
2
  page which may cause some features to not work.
3
- Try adding a unique id to each player.`):oe.push(l);let D={error:a,loadeddata:m,loadedmetadata:O,pause:E,play:N,ended:L};function ne(p){let S=D[p.type];typeof S=="function"&&S(Ae())}b(process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME);function xe(){if("cloudinary"in window){z.current=window.cloudinary;let p={};typeof s=="boolean"?p.showLogo=s:typeof s=="object"&&(p={...p,showLogo:!0,logoImageUrl:s.imageUrl,logoOnclickUrl:s.onClickUrl});let S=!1,ce;(typeof t=="boolean"||t==="true"||t==="false")&&(S=t),typeof t=="string"&&t!=="true"&&t!=="false"&&(ce=t);let G={autoplayMode:ce,autoplay:S,cloud_name:process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,controls:o,fontFace:r||"",language:I,languages:d,loop:x,muted:A,publicId:W,transformation:M,...p,...H};Array.isArray(k)&&(G.sourceTypes=k),typeof n=="object"&&(G.colors=n),typeof P=="string"?G.posterOptions={publicId:P}:typeof P=="object"&&(typeof P.src!="string"?G.posterOptions={publicId:te({...P,src:W,format:"auto:image"})}:G.posterOptions={publicId:U(P)}),V.current=z.current.videoPlayer(X.current,G),Object.keys(D).forEach(ue=>{var me;typeof D[ue]=="function"&&((me=V.current)==null||me.on(ue,ne))})}}(0,C.useEffect)(()=>()=>{var p;(p=V.current)==null||p.videojs.cloudinary.dispose(),oe=oe.filter(S=>S!==l)},[]);function Ae(){return{player:V.current,video:X.current}}return C.default.createElement(C.default.Fragment,null,C.default.createElement(Le.default,null,C.default.createElement("link",{href:`https://unpkg.com/cloudinary-video-player@${_e}/dist/cld-video-player.min.css`,rel:"stylesheet"})),C.default.createElement("div",{style:{width:"100%",aspectRatio:`${e.width} / ${e.height}`}},C.default.createElement("video",{ref:X,id:l,className:g,width:R,height:u}),C.default.createElement(Ne.default,{id:`cloudinary-videoplayer-${l}-${Math.floor(Math.random()*100)}`,src:`https://unpkg.com/cloudinary-video-player@${_e}/dist/cld-video-player.min.js`,onLoad:xe,onError:p=>console.error(`Failed to load Cloudinary Video Player: ${p.message}`)})))},pe=$e;function Te(e){return U({...e,crop:e.crop||"fill",format:e.format||"jpg",gravity:e.gravity||"center",height:e.height||1254,width:e.width||2400,widthResize:e.width||1200})}0&&(module.exports={CldImage,CldOgImage,CldUploadButton,CldUploadWidget,CldVideoPlayer,cloudinaryLoader,getCldImageUrl,getCldOgImageUrl,getCldVideoUrl});
3
+ Try adding a unique id to each player.`):re.push(l);let X={error:a,loadeddata:m,loadedmetadata:C,pause:U,play:w,ended:N};function Ae(p){let B=X[p.type];typeof B=="function"&&B(be())}L(process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME);function xe(){if("cloudinary"in window){z.current=window.cloudinary;let p={};typeof h=="boolean"?p.showLogo=h:typeof h=="object"&&(p={...p,showLogo:!0,logoImageUrl:h.imageUrl,logoOnclickUrl:h.onClickUrl});let B=!1,ce;(typeof e=="boolean"||e==="true"||e==="false")&&(B=e),typeof e=="string"&&e!=="true"&&e!=="false"&&(ce=e);let S={autoplayMode:ce,autoplay:B,cloud_name:process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,controls:o,fontFace:d||"",language:y,languages:i,loop:x,muted:b,publicId:D,transformation:v,...p,...R};Array.isArray(V)&&(S.sourceTypes=V),typeof n=="object"&&(S.colors=n),typeof E=="string"?S.posterOptions={publicId:E}:typeof E=="object"&&(typeof E.src!="string"?S.posterOptions={publicId:oe({...E,src:D,format:"auto:image"})}:S.posterOptions={publicId:P(E)}),W.current=z.current.videoPlayer(j.current,S),Object.keys(X).forEach(ue=>{typeof X[ue]=="function"&&W.current?.on(ue,Ae)})}}(0,f.useEffect)(()=>()=>{W.current?.videojs.cloudinary.dispose(),re=re.filter(p=>p!==l)},[]);function be(){return{player:W.current,video:j.current}}return f.default.createElement(f.default.Fragment,null,f.default.createElement(Te.default,null,f.default.createElement("link",{href:`https://unpkg.com/cloudinary-video-player@${we}/dist/cld-video-player.min.css`,rel:"stylesheet"})),f.default.createElement("div",{style:{width:"100%",aspectRatio:`${t.width} / ${t.height}`}},f.default.createElement("video",{ref:j,id:l,className:u,width:G,height:s}),f.default.createElement(Ne.default,{id:`cloudinary-videoplayer-${l}-${Math.floor(Math.random()*100)}`,src:`https://unpkg.com/cloudinary-video-player@${we}/dist/cld-video-player.min.js`,onLoad:xe,onError:p=>console.error(`Failed to load Cloudinary Video Player: ${p.message}`)})))},pe=He;0&&(module.exports={CldImage,CldOgImage,CldUploadButton,CldUploadWidget,CldVideoPlayer,cloudinaryLoader,getCldImageUrl,getCldOgImageUrl,getCldVideoUrl});
4
4
  //# sourceMappingURL=index.js.map