next-cloudinary 0.9.0 → 1.1.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
@@ -72,8 +72,8 @@ import { CldImage } from 'next-cloudinary';
72
72
  ### Other Use Cases
73
73
 
74
74
  * [Background Removal](https://next-cloudinary.spacejelly.dev/use-cases/background-removal)
75
- * [Image Overlays](https://next-cloudinary.spacejelly.dev/use-cases/image-underlays)
76
- * [Image Underlays](https://next-cloudinary.spacejelly.dev/use-cases/image-overlays)
75
+ * [Image Overlays](https://next-cloudinary.spacejelly.dev/use-cases/image-overlays)
76
+ * [Image Underlays](https://next-cloudinary.spacejelly.dev/use-cases/image-underlays)
77
77
  * [Social Media Card](https://next-cloudinary.spacejelly.dev/use-cases/social-media-card)
78
78
  * [Text Overlays](https://next-cloudinary.spacejelly.dev/use-cases/text-overlays)
79
79
 
@@ -39,8 +39,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
39
39
  }
40
40
 
41
41
  var cropsGravityAuto = ['crop', 'fill', 'lfill', 'fill_pad', 'thumb'];
42
- var props$6 = ['crop', 'gravity'];
43
- function plugin$6(_temp) {
42
+ var props$7 = ['crop', 'gravity'];
43
+ function plugin$7(_temp) {
44
44
  var _ref = _temp === void 0 ? {} : _temp,
45
45
  cldImage = _ref.cldImage,
46
46
  options = _ref.options;
@@ -67,8 +67,8 @@ function plugin$6(_temp) {
67
67
 
68
68
  var croppingPlugin = {
69
69
  __proto__: null,
70
- props: props$6,
71
- plugin: plugin$6
70
+ props: props$7,
71
+ plugin: plugin$7
72
72
  };
73
73
 
74
74
  var params = ['art', {
@@ -117,10 +117,10 @@ var params = ['art', {
117
117
  prop: 'unsharpMask',
118
118
  effect: 'unsharp_mask'
119
119
  }, 'vectorize', 'vibrance', 'vignette'];
120
- var props$5 = params.map(function (param) {
120
+ var props$6 = params.map(function (param) {
121
121
  return param.prop || param;
122
122
  });
123
- function plugin$5(_temp) {
123
+ function plugin$6(_temp) {
124
124
  var _ref = _temp === void 0 ? {} : _temp,
125
125
  cldImage = _ref.cldImage,
126
126
  options = _ref.options;
@@ -137,8 +137,8 @@ function plugin$5(_temp) {
137
137
 
138
138
  var effectsPlugin = {
139
139
  __proto__: null,
140
- props: props$5,
141
- plugin: plugin$5
140
+ props: props$6,
141
+ plugin: plugin$6
142
142
  };
143
143
 
144
144
  /**
@@ -223,14 +223,14 @@ var text = {
223
223
  };
224
224
 
225
225
  var _excluded$3 = ["publicId", "url", "position", "text", "effects"];
226
- var props$4 = ['text', 'overlays'];
226
+ var props$5 = ['text', 'overlays'];
227
227
  var DEFAULT_TEXT_OPTIONS = {
228
228
  color: 'black',
229
229
  fontFamily: 'Arial',
230
230
  fontSize: 200,
231
231
  fontWeight: 'bold'
232
232
  };
233
- function plugin$4(_temp) {
233
+ function plugin$5(_temp) {
234
234
  var _ref = _temp === void 0 ? {} : _temp,
235
235
  cldImage = _ref.cldImage,
236
236
  options = _ref.options;
@@ -367,8 +367,29 @@ function plugin$4(_temp) {
367
367
 
368
368
  var overlaysPlugin = {
369
369
  __proto__: null,
370
- props: props$4,
370
+ props: props$5,
371
371
  DEFAULT_TEXT_OPTIONS: DEFAULT_TEXT_OPTIONS,
372
+ plugin: plugin$5
373
+ };
374
+
375
+ var props$4 = ['transformations'];
376
+ function plugin$4(_temp) {
377
+ var _ref = _temp === void 0 ? {} : _temp,
378
+ cldImage = _ref.cldImage,
379
+ options = _ref.options;
380
+ var _options$transformati = options.transformations,
381
+ transformations = _options$transformati === void 0 ? [] : _options$transformati;
382
+ if (!Array.isArray(transformations)) {
383
+ transformations = [transformations];
384
+ }
385
+ transformations.forEach(function (transformation) {
386
+ cldImage.addTransformation("t_" + transformation);
387
+ });
388
+ }
389
+
390
+ var namedTransformationsPlugin = {
391
+ __proto__: null,
392
+ props: props$4,
372
393
  plugin: plugin$4
373
394
  };
374
395
 
@@ -564,7 +585,7 @@ var zoompanPlugin = {
564
585
 
565
586
  var transformationPlugins = [
566
587
  // Background Removal must always come first
567
- removeBackgroundPlugin, croppingPlugin, effectsPlugin, overlaysPlugin, underlaysPlugin, zoompanPlugin,
588
+ removeBackgroundPlugin, croppingPlugin, effectsPlugin, overlaysPlugin, namedTransformationsPlugin, underlaysPlugin, zoompanPlugin,
568
589
  // Raw transformations needs to be last simply to make sure
569
590
  // it's always expected to applied the same way
570
591
 
@@ -1 +1 @@
1
- {"version":3,"file":"next-cloudinary.js","sources":["../src/plugins/cropping.js","../src/plugins/effects.js","../src/lib/util.js","../src/constants/qualifiers.js","../src/plugins/overlays.js","../src/plugins/raw-transformations.js","../src/plugins/remove-background.js","../src/plugins/underlays.js","../src/plugins/zoompan.js","../src/lib/cloudinary.js","../src/loaders/cloudinary-loader.js","../src/components/CldImage/CldImage.js","../src/components/CldOgImage/CldOgImage.js","../src/components/CldUploadWidget/CldUploadWidget.js","../src/components/CldUploadButton/CldUploadButton.js"],"sourcesContent":["const cropsGravityAuto = [ 'crop', 'fill', 'lfill', 'fill_pad', 'thumb' ];\n\nexport const props = ['crop', 'gravity'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { width, height, crop = 'limit' } = options;\n\n let transformationString = `c_${crop},w_${width}`;\n\n if ( !options.gravity && cropsGravityAuto.includes(crop) ) {\n options.gravity = 'auto';\n }\n\n if ( !['limit'].includes(crop) ) {\n transformationString = `${transformationString},h_${height}`;\n }\n\n if ( options.gravity ) {\n if ( options.gravity === 'auto' && !cropsGravityAuto.includes(crop) ) {\n console.warn('Auto gravity can only be used with crop, fill, lfill, fill_pad or thumb. Not applying gravity.');\n } else {\n transformationString = `${transformationString},g_${options.gravity}`;\n }\n }\n\n cldImage.resize(transformationString);\n}\n","const params = [\n 'art',\n {\n prop: 'autoBrightness',\n effect: 'auto_brightness',\n },\n {\n prop: 'autoColor',\n effect: 'auto_color',\n },\n {\n prop: 'autoContrast',\n effect: 'auto_contrast',\n },\n {\n prop: 'assistColorblind',\n effect: 'assist_colorblind',\n },\n 'blackwhite',\n 'blur',\n {\n prop: 'blurFaces',\n effect: 'blur_faces',\n },\n {\n prop: 'blurRegion',\n effect: 'blur_region',\n },\n 'brightness',\n {\n prop: 'brightnessHSB',\n effect: 'brightness_hsb',\n },\n 'cartoonify',\n 'colorize',\n 'contrast',\n 'distort',\n {\n prop: 'fillLight',\n effect: 'fill_light',\n },\n 'gamma',\n {\n prop: 'gradientFade',\n effect: 'gradient_fade',\n },\n 'grayscale',\n 'improve',\n 'negate',\n {\n prop: 'oilPaint',\n effect: 'oil_paint',\n },\n 'outline',\n 'pixelate',\n {\n prop: 'pixelateFaces',\n effect: 'pixelate_faces',\n },\n {\n prop: 'pixelateRegion',\n effect: 'pixelate_region',\n },\n 'redeye',\n {\n prop: 'replaceColor',\n effect: 'replace_color',\n },\n 'saturation',\n 'sepia',\n 'shadow',\n 'sharpen',\n 'shear',\n {\n prop: 'simulateColorblind',\n effect: 'simulate_colorblind',\n },\n 'tint',\n {\n prop: 'unsharpMask',\n effect: 'unsharp_mask',\n },\n 'vectorize',\n 'vibrance',\n 'vignette',\n];\n\nexport const props = params.map(param => param.prop || param);\n\nexport function plugin({ cldImage, options } = {}) {\n params.forEach(key => {\n const prop = key.prop || key;\n const effect = key.effect || key;\n\n if ( options[prop] === true ) {\n cldImage.effect(`e_${effect}`);\n } else if ( typeof options[prop] === 'string' ) {\n cldImage.effect(`e_${effect}:${options[prop]}`);\n }\n });\n}","/**\n * encodeBase64\n */\n\nexport function encodeBase64(value) {\n if ( typeof btoa === 'function' ) {\n return btoa(value);\n }\n\n if ( typeof Buffer !== 'undefined' ) {\n return Buffer.from(value).toString('base64');\n }\n}","// aspectRatio\n\nexport const primary = {\n aspectRatio: {\n qualifier: 'ar'\n },\n crop: {\n qualifier: 'c'\n },\n gravity: {\n qualifier: 'g'\n },\n height: {\n qualifier: 'h'\n },\n width: {\n qualifier: 'w'\n },\n};\n\nexport const position = {\n angle: {\n qualifier: 'a'\n },\n gravity: {\n qualifier: 'g'\n },\n x: {\n qualifier: 'x'\n },\n y: {\n qualifier: 'y'\n },\n}\n\nexport const text = {\n alignment: {\n qualifier: 'alignment'\n },\n border: {\n qualifier: 'bo',\n location: 'primary'\n },\n color: {\n qualifier: 'co',\n location: 'primary'\n },\n fontFamily: {\n qualifier: false\n },\n fontSize: {\n qualifier: false\n },\n fontWeight: {\n qualifier: false\n },\n letterSpacing: {\n qualifier: 'letter_spacing'\n },\n lineSpacing: {\n qualifier: 'line_spacing'\n },\n stroke: {\n qualifier: 'self'\n },\n textDecoration: {\n qualifier: false\n }\n}","import { encodeBase64 } from '../lib/util';\n\nimport {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const props = ['text', 'overlays'];\n\nexport const DEFAULT_TEXT_OPTIONS = {\n color: 'black',\n fontFamily: 'Arial',\n fontSize: 200,\n fontWeight: 'bold',\n};\n\nexport function plugin({ cldImage, options } = {}) {\n const { text, overlays = [] } = options;\n\n const type = 'overlay';\n const typeQualifier = 'l';\n\n if ( Array.isArray(overlays) ) {\n overlays.forEach(applyOverlay);\n }\n\n if ( typeof text === 'string' ) {\n applyOverlay({\n text: {\n ...DEFAULT_TEXT_OPTIONS,\n text\n }\n })\n } else if ( typeof text === 'object' ) {\n applyOverlay({\n text: {\n ...DEFAULT_TEXT_OPTIONS,\n ...text\n }\n })\n }\n\n\n\n /**\n * applyOverlay\n */\n\n function applyOverlay({ publicId, url, position, text, effects: layerEffects = [], ...options }) {\n const hasPublicId = typeof publicId === 'string';\n const hasUrl = typeof url === 'string';\n const hasText = typeof text === 'object' || typeof text === 'string';\n const hasPosition = typeof position === 'object';\n\n if ( !hasPublicId && !hasUrl && !hasText ) {\n console.warn(`An ${type} is missing Public ID, URL, or Text`);\n return;\n }\n\n // Start to construct the transformation string using text or the public ID\n // if it's image-based\n\n let layerTransformation;\n\n if ( hasText ) {\n layerTransformation = `${typeQualifier}_text`;\n } else if ( hasPublicId ) {\n layerTransformation = `${typeQualifier}_${publicId.replace(/\\//g, ':')}`;\n } else if ( hasUrl ) {\n layerTransformation = `${typeQualifier}_fetch:${encodeBase64(url)}`;\n }\n\n // Begin organizing transformations based on what it is and the location\n // it needs to be placed in the URL\n\n const primary = [];\n const applied = [];\n\n // Gemeral options\n\n Object.keys(options).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${options[key]}`);\n });\n\n // Layer effects\n\n layerEffects.forEach(effect => {\n Object.keys(effect).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${effect[key]}`);\n });\n });\n\n // Text styling\n\n if ( hasText ) {\n if ( typeof text === 'string' ) {\n text = {\n ...DEFAULT_TEXT_OPTIONS,\n text\n }\n }\n\n\n const textTransformations = [];\n\n Object.keys(text).forEach(key => {\n if ( !qualifiersText[key] ) return;\n\n const { qualifier, location } = qualifiersText[key];\n\n if ( location === 'primary' ) {\n primary.push(`${qualifier}_${text[key]}`);\n } else if ( qualifier === 'self' ) {\n textTransformations.push(key);\n } else if ( qualifier ) {\n textTransformations.push(`${qualifier}_${text[key]}`);\n } else {\n textTransformations.push(text[key]);\n }\n });\n\n layerTransformation = `${layerTransformation}:${textTransformations.join('_')}:${text.text}`\n }\n\n // Positioning\n\n if ( hasPosition ) {\n Object.keys(position).forEach(key => {\n if ( !qualifiersPosition[key] ) return;\n\n const { qualifier } = qualifiersPosition[key];\n\n applied.push(`${qualifier}_${position[key]}`);\n });\n }\n\n // Add all primary transformations\n\n layerTransformation = `${layerTransformation},${primary.join(',')}`;\n\n // Add all applied transformations\n\n layerTransformation = `${layerTransformation}/fl_layer_apply,fl_no_overflow`;\n\n if ( applied.length > 0 ) {\n layerTransformation = `${layerTransformation},${applied.join(',')}`;\n }\n\n // Finally add it to the image\n\n cldImage.addTransformation(layerTransformation);\n }\n}","export const props = ['rawTransformations'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { rawTransformations = [] } = options;\n\n rawTransformations.forEach(transformation => {\n cldImage.addTransformation(transformation);\n });\n}","export const props = ['removeBackground'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { removeBackground = false } = options;\n if ( removeBackground ) {\n cldImage.effect('e_background_removal');\n }\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const props = ['underlay', 'underlays'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { underlay, underlays = [] } = options;\n\n const type = 'underlay';\n const typeQualifier = 'u';\n\n if ( Array.isArray(underlays) ) {\n underlays.forEach(applyUnderlay);\n }\n\n if ( typeof underlay === 'string' ) {\n\n const underlayOptions = {\n publicId: underlay,\n crop: 'fill'\n }\n\n if ( options.width ) {\n underlayOptions.width = options.width;\n }\n\n if ( options.height ) {\n underlayOptions.height = options.height;\n }\n\n applyUnderlay(underlayOptions);\n }\n\n /**\n * applyUnderlay\n */\n\n function applyUnderlay({ publicId, type, position, text, effects: layerEffects = [], ...options }) {\n const hasPublicId = typeof publicId === 'string';\n const hasPosition = typeof position === 'object';\n\n if ( !hasPublicId ) {\n console.warn(`An ${type} is missing a Public ID`);\n return;\n }\n\n // Start to construct the transformation string using text or the public ID\n // if it's image-based\n\n let layerTransformation = `${typeQualifier}_${publicId.replace(/\\//g, ':')}`;\n\n // Begin organizing transformations based on what it is and the location\n // it needs to be placed in the URL\n\n const primary = [];\n const applied = [];\n\n // Gemeral options\n\n Object.keys(options).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${options[key]}`);\n });\n\n // Layer effects\n\n layerEffects.forEach(effect => {\n Object.keys(effect).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${effect[key]}`);\n });\n });\n\n // Positioning\n\n if ( hasPosition ) {\n Object.keys(position).forEach(key => {\n if ( !qualifiersPosition[key] ) return;\n\n const { qualifier } = qualifiersPosition[key];\n\n applied.push(`${qualifier}_${position[key]}`);\n });\n }\n\n // Add all primary transformations\n\n layerTransformation = `${layerTransformation},${primary.join(',')}`;\n\n // Add all applied transformations\n\n layerTransformation = `${layerTransformation}/fl_layer_apply,fl_no_overflow`;\n\n if ( applied.length > 0 ) {\n layerTransformation = `${layerTransformation},${applied.join(',')}`;\n }\n\n // Finally add it to the image\n\n cldImage.addTransformation(layerTransformation);\n }\n}","export const props = ['zoompan'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { zoompan = false } = options;\n const overrides = {};\n\n if ( zoompan === true ) {\n cldImage.effect('e_zoompan');\n } else if ( typeof zoompan === 'string' ) {\n if ( zoompan === 'loop' ) {\n cldImage.effect('e_zoompan');\n cldImage.effect('e_loop');\n } else {\n cldImage.effect(`e_zoompan:${zoompan}`);\n }\n } else if ( typeof zoompan === 'object' ) {\n let zoompanEffect = 'e_zoompan';\n\n if ( typeof zoompan.options === 'string' ) {\n zoompanEffect = `${zoompanEffect}${zoompan.options}`;\n }\n\n cldImage.effect(zoompanEffect);\n\n let loopEffect;\n\n if ( zoompan.loop === true ) {\n loopEffect = 'e_loop';\n } else if ( typeof zoompan.loop === 'string' ) {\n loopEffect = `e_loop${zoompan.loop}`;\n }\n\n if ( loopEffect ) {\n cldImage.effect(loopEffect);\n }\n }\n\n if ( zoompan !== false ) {\n overrides.format = 'gif';\n }\n\n return {\n options: overrides\n }\n}","import { Cloudinary } from '@cloudinary/url-gen';\n\nimport * as croppingPlugin from '../plugins/cropping';\nimport * as effectsPlugin from '../plugins/effects';\nimport * as overlaysPlugin from '../plugins/overlays';\nimport * as rawTransformationsPlugin from '../plugins/raw-transformations';\nimport * as removeBackgroundPlugin from '../plugins/remove-background';\nimport * as underlaysPlugin from '../plugins/underlays';\nimport * as zoompanPlugin from '../plugins/zoompan';\n\nimport {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const transformationPlugins = [\n // Background Removal must always come first\n removeBackgroundPlugin,\n\n croppingPlugin,\n effectsPlugin,\n overlaysPlugin,\n underlaysPlugin,\n zoompanPlugin,\n\n // Raw transformations needs to be last simply to make sure\n // it's always expected to applied the same way\n\n rawTransformationsPlugin\n];\n\nlet cld;\n\n/**\n * constructCloudinaryUrl\n */\n\nexport function constructCloudinaryUrl({ options, config }) {\n if ( !cld ) {\n cld = new Cloudinary({\n cloud: {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME\n },\n url: {\n // Used to avoid issues with SSR particularly for the blurred placeholder\n analytics: false\n },\n ...config\n });\n }\n\n const publicId = getPublicId(options.src);\n\n const cldImage = cld.image(publicId);\n\n transformationPlugins.forEach(({ plugin }) => {\n const { options: pluginOptions } = plugin({\n cldImage,\n options\n }) || {};\n\n if ( pluginOptions?.format ) {\n options.format = pluginOptions.format;\n }\n });\n\n return cldImage\n .setDeliveryType(options.deliveryType || 'upload')\n .format(options.format || 'auto')\n .delivery(`q_${options.quality || 'auto'}`)\n .toURL();\n}\n\n/**\n * Retrieves the public id of a cloudiary image url. If no url is recognized it returns the parameter it self.\n * If it's recognized that is a url and it's not possible to get the public id, it warns the user.\n *\n * @param {string} src The cloudiary url or public id.\n *\n * @return {string} The images public id\n */\n\nexport function getPublicId(src) {\n if ( typeof src !== 'string' ) {\n throw new Error(`Invalid src of type ${typeof src}`);\n }\n\n if ( src.includes('res.cloudinary.com') ) {\n const regexWithTransformations = /(https?)\\:\\/\\/(res.cloudinary.com)\\/([^\\/]+)\\/(image|video|raw)\\/(upload|authenticated)\\/(.*)\\/(v[0-9]+)\\/(.+)(?:\\.[a-z]{3})?/\n const regexWithoutTransformations = /(https?)\\:\\/\\/(res.cloudinary.com)\\/([^\\/]+)\\/(image|video|raw)\\/(upload|authenticated)\\/(v[0-9]+)\\/(.+)(?:\\.[a-z]{3})?/\n\n const withTransformations = src.match(regexWithTransformations)\n const withoutTransformations = src.match(regexWithoutTransformations)\n\n if ( withTransformations ) {\n return withTransformations[withTransformations.length - 1]\n } else if ( withoutTransformations ) {\n return withoutTransformations[withoutTransformations.length - 1]\n } else {\n console.warn(`Not possible to retrieve the publicUrl from ${src}, make sure it's a valid cloudinary image url.`)\n }\n }\n\n return src;\n}\n\n/**\n * createPlaceholderUrl\n */\n\nexport function createPlaceholderUrl({ src, placeholder = true, config }) {\n const rawTransformations = [];\n\n if ( placeholder === 'grayscale' ) {\n rawTransformations.push('e_grayscale');\n }\n\n if ( typeof placeholder === 'string' && placeholder.includes('color:') ) {\n const color = placeholder.split(':').splice(1).join(':')\n rawTransformations.push('e_grayscale');\n rawTransformations.push(`e_colorize:60,co_${color}`);\n }\n\n return constructCloudinaryUrl({\n options: {\n src,\n width: 100,\n quality: 1,\n rawTransformations,\n },\n config\n });;\n}\n","import { constructCloudinaryUrl } from '../lib/cloudinary';\n\nexport function cloudinaryLoader({ loaderOptions, imageProps, cldOptions, cldConfig = {} }) {\n const options = {\n ...imageProps,\n ...cldOptions\n }\n\n // The loader options are used to create dynamic sizing when working with responsive images\n // so these should override the default options collected from the props alone if\n // the results are different. While we don't always use the height in the loader logic,\n // we always pass it here, as the usage is determined later based on cropping.js\n\n if ( loaderOptions?.width && loaderOptions.width !== options.width ) {\n const multiplier = loaderOptions.width / options.width;\n options.width = loaderOptions.width;\n options.height = Math.round(options.height * multiplier);\n }\n\n return constructCloudinaryUrl({\n options,\n config: cldConfig\n });\n}","import Image from 'next/image';\n\nimport { createPlaceholderUrl, getPublicId, transformationPlugins } from '../../lib/cloudinary';\nimport { cloudinaryLoader } from '../../loaders/cloudinary-loader';\n\nconst CldImage = props => {\n\n const CLD_OPTIONS = [\n 'deliveryType'\n ];\n\n transformationPlugins.forEach(({ props = [] }) => {\n props.forEach(prop => {\n if ( CLD_OPTIONS.includes(prop) ) {\n throw new Error(`Option ${prop} already exists!`);\n }\n CLD_OPTIONS.push(prop);\n });\n })\n\n // Construct the base Image component props by filtering out Cloudinary-specific props\n\n const imageProps = {};\n\n Object.keys(props)\n .filter(key => !CLD_OPTIONS.includes(key))\n .forEach(key => imageProps[key] = props[key]);\n\n // Construct Cloudinary-specific props by looking for values for any of the supported prop keys\n\n const cldOptions = {};\n\n CLD_OPTIONS.forEach(key => {\n if ( props[key] ) {\n cldOptions[key] = props[key];\n }\n });\n\n // If we see a placeholder option, configure a Cloudinary-based URL.\n // The resulting image will always be blurred per Next.js, so we're\n // limited on options for placeholders.\n //\n // We need to do this logic here as we potentially need to mutate\n // an Image component prop as opposed to simply the URL\n //\n // https://nextjs.org/docs/api-reference/next/image#blurdataurl\n\n if ( imageProps.placeholder ) {\n const publicId = getPublicId(props.src);\n\n imageProps.blurDataURL = createPlaceholderUrl({\n src: publicId,\n placeholder: props.placeholder\n });\n\n if ( imageProps.placeholder !== 'blur' ) {\n imageProps.placeholder = 'blur';\n }\n }\n\n return (\n <Image\n {...imageProps}\n loader={(loaderOptions) => cloudinaryLoader({ loaderOptions, imageProps, cldOptions })}\n />\n );\n}\n\nexport default CldImage;","import Head from 'next/head';\n\nconst IMAGE_WIDTH = 2400;\nconst IMAGE_HEIGHT = 1200;\n\nimport { constructCloudinaryUrl } from '../../lib/cloudinary';\n\nconst TWITTER_CARD = 'summary_large_image';\n\nconst CldOgImage = ({ excludeTags = [], twitterTitle, ...props }) => {\n const options = {\n ...props,\n width: props.width || IMAGE_WIDTH,\n height: props.height || IMAGE_HEIGHT,\n crop: props.crop || 'fill',\n gravity: props.gravity || 'center'\n }\n\n const ogImageUrl = constructCloudinaryUrl({\n options\n });\n\n // We need to include the tags within the Next.js Head component rather than\n // direcly adding them inside of the Head otherwise we get unexpected results\n\n return (\n <Head>\n <meta property=\"og:image\" content={ogImageUrl} />\n <meta property=\"og:image:secure_url\" content={ogImageUrl} />\n <meta property=\"og:image:width\" content={options.width} />\n <meta property=\"og:image:height\" content={options.height} />\n\n {options.alt && (\n <meta property=\"og:image:alt\" content={options.alt} />\n )}\n\n {/* Required for summary_large_image, exclude vai excludeTags */}\n {/* https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image */}\n\n {!excludeTags.includes('twitter:title') && (\n <meta property=\"twitter:title\" content={twitterTitle || ' '} />\n )}\n\n <meta property=\"twitter:card\" content={TWITTER_CARD} />\n <meta property=\"twitter:image\" content={ogImageUrl} />\n </Head>\n );\n}\n\nexport default CldOgImage;","import { useRef } from 'react';\nimport Script from 'next/script';\n\nconst CldUploadWidget = ({\n children,\n onUpload,\n options,\n signatureEndpoint,\n uploadPreset,\n}) => {\n const cloudinary = useRef();\n const widget = useRef();\n\n const signed = !!signatureEndpoint;\n\n /**\n * generateSignature\n * @description Makes a request to an endpoint to sign Cloudinary parameters as part of widget creation\n */\n\n function generateSignature(callback, paramsToSign) {\n fetch(signatureEndpoint, {\n method: \"POST\",\n body: JSON.stringify({\n paramsToSign,\n }),\n })\n .then((r) => r.json())\n .then(({ signature }) => {\n callback(signature);\n });\n }\n\n /**\n * createWidget\n * @description Creates a new instance of the Cloudinary widget and stores in a ref\n */\n\n function createWidget() {\n // When creating a signed upload, you need to provide both your Cloudinary API Key\n // as well as a signature generator function that will sign any paramters\n // either on page load or during the upload process. Read more about signed uploads at:\n // https://cloudinary.com/documentation/upload_widget#signed_uploads\n\n const uploadOptions = {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,\n uploadPreset: uploadPreset || process.env.NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET,\n apiKey: process.env.NEXT_PUBLIC_CLOUDINARY_API_KEY,\n ...options,\n };\n\n if ( signed ) {\n uploadOptions.uploadSignature = generateSignature;\n\n // No need for apiSecret here because of api/sign-cloudinary-params\n\n if (!uploadOptions.apiKey) {\n return new Error(\"Signed Upload needs apiKey!\");\n }\n }\n\n return cloudinary.current?.createUploadWidget(\n uploadOptions,\n function (error, result) {\n // The callback is a bit more chatty than failed or success so\n // only trigger when one of those are the case. You can additionally\n // create a separate handler such as onEvent and trigger it on\n // ever occurance\n if (error || result.event === \"success\") {\n onUpload(error, result, widget?.current);\n }\n }\n );\n }\n\n /**\n * open\n * @description When triggered, uses the current widget instance to open the upload modal\n */\n\n function open() {\n if (!widget?.current) {\n widget.current = createWidget();\n }\n\n widget?.current && widget.current.open();\n }\n\n /**\n * handleOnLoad\n * @description Stores the Cloudinary window instance to a ref when the widget script loads\n */\n\n function handleOnLoad() {\n cloudinary.current = window.cloudinary;\n }\n\n return (\n <>\n {children({\n cloudinary: cloudinary.current,\n widget: widget.current,\n open,\n })}\n <Script\n id={`cloudinary-${Math.floor(Math.random() * 100)}`}\n src=\"https://widget.cloudinary.com/v2.0/global/all.js\"\n onLoad={handleOnLoad}\n onError={(e) => console.error(`Failed to load Cloudinary: ${e.message}`)}\n />\n </>\n );\n};\n\nexport default CldUploadWidget;\n","import CldUploadWidget from '../CldUploadWidget';\n\nconst CldUploadButton = ({\n children,\n onClick,\n onUpload,\n options,\n signatureEndpoint,\n uploadPreset,\n ...props\n}) => {\n return (\n <>\n <CldUploadWidget\n onUpload={onUpload}\n options={options}\n signatureEndpoint={signatureEndpoint}\n uploadPreset={uploadPreset}\n >\n {({ open }) => {\n function handleOnClick(e) {\n e.preventDefault();\n\n open();\n\n if ( typeof onClick === 'function' ) {\n onClick(e);\n }\n }\n return (\n <button {...props} onClick={handleOnClick} >\n {children || 'Upload'}\n </button>\n );\n }}\n </CldUploadWidget>\n </>\n );\n};\n\nexport default CldUploadButton;\n"],"names":["cropsGravityAuto","props","plugin","cldImage","options","width","height","crop","transformationString","gravity","includes","console","warn","resize","params","prop","effect","map","param","forEach","key","encodeBase64","value","btoa","Buffer","from","toString","primary","aspectRatio","qualifier","position","angle","x","y","text","alignment","border","location","color","fontFamily","fontSize","fontWeight","letterSpacing","lineSpacing","stroke","textDecoration","DEFAULT_TEXT_OPTIONS","overlays","type","typeQualifier","Array","isArray","applyOverlay","publicId","url","effects","layerEffects","_excluded","hasPublicId","hasUrl","hasText","hasPosition","layerTransformation","replace","applied","Object","keys","qualifiersPrimary","push","textTransformations","qualifiersText","join","qualifiersPosition","length","addTransformation","rawTransformations","transformation","removeBackground","underlay","underlays","applyUnderlay","underlayOptions","zoompan","overrides","zoompanEffect","loopEffect","loop","format","transformationPlugins","removeBackgroundPlugin","croppingPlugin","effectsPlugin","overlaysPlugin","underlaysPlugin","zoompanPlugin","rawTransformationsPlugin","cld","constructCloudinaryUrl","config","Cloudinary","cloud","cloudName","process","env","NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME","analytics","getPublicId","src","image","pluginOptions","setDeliveryType","deliveryType","delivery","quality","toURL","Error","regexWithTransformations","regexWithoutTransformations","withTransformations","match","withoutTransformations","createPlaceholderUrl","placeholder","split","splice","cloudinaryLoader","loaderOptions","imageProps","cldOptions","cldConfig","multiplier","Math","round","CldImage","CLD_OPTIONS","filter","blurDataURL","_jsx","Image","IMAGE_WIDTH","IMAGE_HEIGHT","TWITTER_CARD","CldOgImage","excludeTags","twitterTitle","ogImageUrl","_jsxs","Head","alt","CldUploadWidget","children","onUpload","signatureEndpoint","uploadPreset","cloudinary","useRef","widget","signed","generateSignature","callback","paramsToSign","fetch","method","body","JSON","stringify","then","r","json","signature","createWidget","uploadOptions","NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET","apiKey","NEXT_PUBLIC_CLOUDINARY_API_KEY","uploadSignature","current","createUploadWidget","error","result","event","open","handleOnLoad","window","_Fragment","Script","floor","random","e","message","CldUploadButton","onClick","handleOnClick","preventDefault"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,gBAAgB,GAAG,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAE,CAAA;AAElE,IAAMC,OAAK,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAEjC,SAASC,QAAM,CAA6B,KAAA,EAAA;AAAA,EAAA,IAAA,IAAA,GAAA,KAAA,KAAA,KAAA,CAAA,GAAJ,EA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,EAAEc,QAAS;AACnB,MAAA,OAAO,EAAEnJ,OAAQ;AACjB,MAAA,iBAAiB,EAAEoJ,iBAAkB;AACrC,MAAA,YAAY,EAAEC,YAAa;AAAA,MAAA,QAAA,EAE1B,SAAc,QAAA,CAAA,KAAA,EAAA;QAAA,IAAX4B,IAAI,SAAJA,IAAI,CAAA;QACN,SAASW,aAAa,CAACJ,CAAC,EAAE;UACxBA,CAAC,CAACK,cAAc,EAAE,CAAA;AAElBZ,UAAAA,IAAI,EAAE,CAAA;AAEN,UAAA,IAAK,OAAOU,OAAO,KAAK,UAAU,EAAG;YACnCA,OAAO,CAACH,CAAC,CAAC,CAAA;AACZ,WAAA;AACF,SAAA;AACA,QAAA,oBACEnD,sCAAYxI,KAAK,EAAA;AAAE,UAAA,OAAO,EAAE+L,aAAc;AAAA,UAAA,QAAA,EACvC1C,SAAQ,IAAI,QAAA;SACN,CAAA,CAAA,CAAA;AAEb,OAAA;AAAC,KAAA,CAAA;GAEF,CAAA,CAAA;AAEP;;;;;;;;;;;"}
1
+ {"version":3,"file":"next-cloudinary.js","sources":["../src/plugins/cropping.js","../src/plugins/effects.js","../src/lib/util.js","../src/constants/qualifiers.js","../src/plugins/overlays.js","../src/plugins/named-transformations.js","../src/plugins/raw-transformations.js","../src/plugins/remove-background.js","../src/plugins/underlays.js","../src/plugins/zoompan.js","../src/lib/cloudinary.js","../src/loaders/cloudinary-loader.js","../src/components/CldImage/CldImage.js","../src/components/CldOgImage/CldOgImage.js","../src/components/CldUploadWidget/CldUploadWidget.js","../src/components/CldUploadButton/CldUploadButton.js"],"sourcesContent":["const cropsGravityAuto = [ 'crop', 'fill', 'lfill', 'fill_pad', 'thumb' ];\n\nexport const props = ['crop', 'gravity'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { width, height, crop = 'limit' } = options;\n\n let transformationString = `c_${crop},w_${width}`;\n\n if ( !options.gravity && cropsGravityAuto.includes(crop) ) {\n options.gravity = 'auto';\n }\n\n if ( !['limit'].includes(crop) ) {\n transformationString = `${transformationString},h_${height}`;\n }\n\n if ( options.gravity ) {\n if ( options.gravity === 'auto' && !cropsGravityAuto.includes(crop) ) {\n console.warn('Auto gravity can only be used with crop, fill, lfill, fill_pad or thumb. Not applying gravity.');\n } else {\n transformationString = `${transformationString},g_${options.gravity}`;\n }\n }\n\n cldImage.resize(transformationString);\n}\n","const params = [\n 'art',\n {\n prop: 'autoBrightness',\n effect: 'auto_brightness',\n },\n {\n prop: 'autoColor',\n effect: 'auto_color',\n },\n {\n prop: 'autoContrast',\n effect: 'auto_contrast',\n },\n {\n prop: 'assistColorblind',\n effect: 'assist_colorblind',\n },\n 'blackwhite',\n 'blur',\n {\n prop: 'blurFaces',\n effect: 'blur_faces',\n },\n {\n prop: 'blurRegion',\n effect: 'blur_region',\n },\n 'brightness',\n {\n prop: 'brightnessHSB',\n effect: 'brightness_hsb',\n },\n 'cartoonify',\n 'colorize',\n 'contrast',\n 'distort',\n {\n prop: 'fillLight',\n effect: 'fill_light',\n },\n 'gamma',\n {\n prop: 'gradientFade',\n effect: 'gradient_fade',\n },\n 'grayscale',\n 'improve',\n 'negate',\n {\n prop: 'oilPaint',\n effect: 'oil_paint',\n },\n 'outline',\n 'pixelate',\n {\n prop: 'pixelateFaces',\n effect: 'pixelate_faces',\n },\n {\n prop: 'pixelateRegion',\n effect: 'pixelate_region',\n },\n 'redeye',\n {\n prop: 'replaceColor',\n effect: 'replace_color',\n },\n 'saturation',\n 'sepia',\n 'shadow',\n 'sharpen',\n 'shear',\n {\n prop: 'simulateColorblind',\n effect: 'simulate_colorblind',\n },\n 'tint',\n {\n prop: 'unsharpMask',\n effect: 'unsharp_mask',\n },\n 'vectorize',\n 'vibrance',\n 'vignette',\n];\n\nexport const props = params.map(param => param.prop || param);\n\nexport function plugin({ cldImage, options } = {}) {\n params.forEach(key => {\n const prop = key.prop || key;\n const effect = key.effect || key;\n\n if ( options[prop] === true ) {\n cldImage.effect(`e_${effect}`);\n } else if ( typeof options[prop] === 'string' ) {\n cldImage.effect(`e_${effect}:${options[prop]}`);\n }\n });\n}","/**\n * encodeBase64\n */\n\nexport function encodeBase64(value) {\n if ( typeof btoa === 'function' ) {\n return btoa(value);\n }\n\n if ( typeof Buffer !== 'undefined' ) {\n return Buffer.from(value).toString('base64');\n }\n}","// aspectRatio\n\nexport const primary = {\n aspectRatio: {\n qualifier: 'ar'\n },\n crop: {\n qualifier: 'c'\n },\n gravity: {\n qualifier: 'g'\n },\n height: {\n qualifier: 'h'\n },\n width: {\n qualifier: 'w'\n },\n};\n\nexport const position = {\n angle: {\n qualifier: 'a'\n },\n gravity: {\n qualifier: 'g'\n },\n x: {\n qualifier: 'x'\n },\n y: {\n qualifier: 'y'\n },\n}\n\nexport const text = {\n alignment: {\n qualifier: 'alignment'\n },\n border: {\n qualifier: 'bo',\n location: 'primary'\n },\n color: {\n qualifier: 'co',\n location: 'primary'\n },\n fontFamily: {\n qualifier: false\n },\n fontSize: {\n qualifier: false\n },\n fontWeight: {\n qualifier: false\n },\n letterSpacing: {\n qualifier: 'letter_spacing'\n },\n lineSpacing: {\n qualifier: 'line_spacing'\n },\n stroke: {\n qualifier: 'self'\n },\n textDecoration: {\n qualifier: false\n }\n}","import { encodeBase64 } from '../lib/util';\n\nimport {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const props = ['text', 'overlays'];\n\nexport const DEFAULT_TEXT_OPTIONS = {\n color: 'black',\n fontFamily: 'Arial',\n fontSize: 200,\n fontWeight: 'bold',\n};\n\nexport function plugin({ cldImage, options } = {}) {\n const { text, overlays = [] } = options;\n\n const type = 'overlay';\n const typeQualifier = 'l';\n\n if ( Array.isArray(overlays) ) {\n overlays.forEach(applyOverlay);\n }\n\n if ( typeof text === 'string' ) {\n applyOverlay({\n text: {\n ...DEFAULT_TEXT_OPTIONS,\n text\n }\n })\n } else if ( typeof text === 'object' ) {\n applyOverlay({\n text: {\n ...DEFAULT_TEXT_OPTIONS,\n ...text\n }\n })\n }\n\n\n\n /**\n * applyOverlay\n */\n\n function applyOverlay({ publicId, url, position, text, effects: layerEffects = [], ...options }) {\n const hasPublicId = typeof publicId === 'string';\n const hasUrl = typeof url === 'string';\n const hasText = typeof text === 'object' || typeof text === 'string';\n const hasPosition = typeof position === 'object';\n\n if ( !hasPublicId && !hasUrl && !hasText ) {\n console.warn(`An ${type} is missing Public ID, URL, or Text`);\n return;\n }\n\n // Start to construct the transformation string using text or the public ID\n // if it's image-based\n\n let layerTransformation;\n\n if ( hasText ) {\n layerTransformation = `${typeQualifier}_text`;\n } else if ( hasPublicId ) {\n layerTransformation = `${typeQualifier}_${publicId.replace(/\\//g, ':')}`;\n } else if ( hasUrl ) {\n layerTransformation = `${typeQualifier}_fetch:${encodeBase64(url)}`;\n }\n\n // Begin organizing transformations based on what it is and the location\n // it needs to be placed in the URL\n\n const primary = [];\n const applied = [];\n\n // Gemeral options\n\n Object.keys(options).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${options[key]}`);\n });\n\n // Layer effects\n\n layerEffects.forEach(effect => {\n Object.keys(effect).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${effect[key]}`);\n });\n });\n\n // Text styling\n\n if ( hasText ) {\n if ( typeof text === 'string' ) {\n text = {\n ...DEFAULT_TEXT_OPTIONS,\n text\n }\n }\n\n\n const textTransformations = [];\n\n Object.keys(text).forEach(key => {\n if ( !qualifiersText[key] ) return;\n\n const { qualifier, location } = qualifiersText[key];\n\n if ( location === 'primary' ) {\n primary.push(`${qualifier}_${text[key]}`);\n } else if ( qualifier === 'self' ) {\n textTransformations.push(key);\n } else if ( qualifier ) {\n textTransformations.push(`${qualifier}_${text[key]}`);\n } else {\n textTransformations.push(text[key]);\n }\n });\n\n layerTransformation = `${layerTransformation}:${textTransformations.join('_')}:${text.text}`\n }\n\n // Positioning\n\n if ( hasPosition ) {\n Object.keys(position).forEach(key => {\n if ( !qualifiersPosition[key] ) return;\n\n const { qualifier } = qualifiersPosition[key];\n\n applied.push(`${qualifier}_${position[key]}`);\n });\n }\n\n // Add all primary transformations\n\n layerTransformation = `${layerTransformation},${primary.join(',')}`;\n\n // Add all applied transformations\n\n layerTransformation = `${layerTransformation}/fl_layer_apply,fl_no_overflow`;\n\n if ( applied.length > 0 ) {\n layerTransformation = `${layerTransformation},${applied.join(',')}`;\n }\n\n // Finally add it to the image\n\n cldImage.addTransformation(layerTransformation);\n }\n}","export const props = ['transformations'];\n\nexport function plugin({ cldImage, options } = {}) {\n let { transformations = [] } = options;\n\n if ( !Array.isArray(transformations) ) {\n transformations = [transformations];\n }\n\n transformations.forEach(transformation => {\n cldImage.addTransformation(`t_${transformation}`);\n });\n}","export const props = ['rawTransformations'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { rawTransformations = [] } = options;\n\n rawTransformations.forEach(transformation => {\n cldImage.addTransformation(transformation);\n });\n}","export const props = ['removeBackground'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { removeBackground = false } = options;\n if ( removeBackground ) {\n cldImage.effect('e_background_removal');\n }\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const props = ['underlay', 'underlays'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { underlay, underlays = [] } = options;\n\n const type = 'underlay';\n const typeQualifier = 'u';\n\n if ( Array.isArray(underlays) ) {\n underlays.forEach(applyUnderlay);\n }\n\n if ( typeof underlay === 'string' ) {\n\n const underlayOptions = {\n publicId: underlay,\n crop: 'fill'\n }\n\n if ( options.width ) {\n underlayOptions.width = options.width;\n }\n\n if ( options.height ) {\n underlayOptions.height = options.height;\n }\n\n applyUnderlay(underlayOptions);\n }\n\n /**\n * applyUnderlay\n */\n\n function applyUnderlay({ publicId, type, position, text, effects: layerEffects = [], ...options }) {\n const hasPublicId = typeof publicId === 'string';\n const hasPosition = typeof position === 'object';\n\n if ( !hasPublicId ) {\n console.warn(`An ${type} is missing a Public ID`);\n return;\n }\n\n // Start to construct the transformation string using text or the public ID\n // if it's image-based\n\n let layerTransformation = `${typeQualifier}_${publicId.replace(/\\//g, ':')}`;\n\n // Begin organizing transformations based on what it is and the location\n // it needs to be placed in the URL\n\n const primary = [];\n const applied = [];\n\n // Gemeral options\n\n Object.keys(options).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${options[key]}`);\n });\n\n // Layer effects\n\n layerEffects.forEach(effect => {\n Object.keys(effect).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${effect[key]}`);\n });\n });\n\n // Positioning\n\n if ( hasPosition ) {\n Object.keys(position).forEach(key => {\n if ( !qualifiersPosition[key] ) return;\n\n const { qualifier } = qualifiersPosition[key];\n\n applied.push(`${qualifier}_${position[key]}`);\n });\n }\n\n // Add all primary transformations\n\n layerTransformation = `${layerTransformation},${primary.join(',')}`;\n\n // Add all applied transformations\n\n layerTransformation = `${layerTransformation}/fl_layer_apply,fl_no_overflow`;\n\n if ( applied.length > 0 ) {\n layerTransformation = `${layerTransformation},${applied.join(',')}`;\n }\n\n // Finally add it to the image\n\n cldImage.addTransformation(layerTransformation);\n }\n}","export const props = ['zoompan'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { zoompan = false } = options;\n const overrides = {};\n\n if ( zoompan === true ) {\n cldImage.effect('e_zoompan');\n } else if ( typeof zoompan === 'string' ) {\n if ( zoompan === 'loop' ) {\n cldImage.effect('e_zoompan');\n cldImage.effect('e_loop');\n } else {\n cldImage.effect(`e_zoompan:${zoompan}`);\n }\n } else if ( typeof zoompan === 'object' ) {\n let zoompanEffect = 'e_zoompan';\n\n if ( typeof zoompan.options === 'string' ) {\n zoompanEffect = `${zoompanEffect}${zoompan.options}`;\n }\n\n cldImage.effect(zoompanEffect);\n\n let loopEffect;\n\n if ( zoompan.loop === true ) {\n loopEffect = 'e_loop';\n } else if ( typeof zoompan.loop === 'string' ) {\n loopEffect = `e_loop${zoompan.loop}`;\n }\n\n if ( loopEffect ) {\n cldImage.effect(loopEffect);\n }\n }\n\n if ( zoompan !== false ) {\n overrides.format = 'gif';\n }\n\n return {\n options: overrides\n }\n}","import { Cloudinary } from '@cloudinary/url-gen';\n\nimport * as croppingPlugin from '../plugins/cropping';\nimport * as effectsPlugin from '../plugins/effects';\nimport * as overlaysPlugin from '../plugins/overlays';\nimport * as namedTransformationsPlugin from '../plugins/named-transformations';\nimport * as rawTransformationsPlugin from '../plugins/raw-transformations';\nimport * as removeBackgroundPlugin from '../plugins/remove-background';\nimport * as underlaysPlugin from '../plugins/underlays';\nimport * as zoompanPlugin from '../plugins/zoompan';\n\nimport {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const transformationPlugins = [\n // Background Removal must always come first\n removeBackgroundPlugin,\n\n croppingPlugin,\n effectsPlugin,\n overlaysPlugin,\n namedTransformationsPlugin,\n underlaysPlugin,\n zoompanPlugin,\n\n // Raw transformations needs to be last simply to make sure\n // it's always expected to applied the same way\n\n rawTransformationsPlugin\n];\n\nlet cld;\n\n/**\n * constructCloudinaryUrl\n */\n\nexport function constructCloudinaryUrl({ options, config }) {\n if ( !cld ) {\n cld = new Cloudinary({\n cloud: {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME\n },\n url: {\n // Used to avoid issues with SSR particularly for the blurred placeholder\n analytics: false\n },\n ...config\n });\n }\n\n const publicId = getPublicId(options.src);\n\n const cldImage = cld.image(publicId);\n\n transformationPlugins.forEach(({ plugin }) => {\n const { options: pluginOptions } = plugin({\n cldImage,\n options\n }) || {};\n\n if ( pluginOptions?.format ) {\n options.format = pluginOptions.format;\n }\n });\n\n return cldImage\n .setDeliveryType(options.deliveryType || 'upload')\n .format(options.format || 'auto')\n .delivery(`q_${options.quality || 'auto'}`)\n .toURL();\n}\n\n/**\n * Retrieves the public id of a cloudiary image url. If no url is recognized it returns the parameter it self.\n * If it's recognized that is a url and it's not possible to get the public id, it warns the user.\n *\n * @param {string} src The cloudiary url or public id.\n *\n * @return {string} The images public id\n */\n\nexport function getPublicId(src) {\n if ( typeof src !== 'string' ) {\n throw new Error(`Invalid src of type ${typeof src}`);\n }\n\n if ( src.includes('res.cloudinary.com') ) {\n const regexWithTransformations = /(https?)\\:\\/\\/(res.cloudinary.com)\\/([^\\/]+)\\/(image|video|raw)\\/(upload|authenticated)\\/(.*)\\/(v[0-9]+)\\/(.+)(?:\\.[a-z]{3})?/\n const regexWithoutTransformations = /(https?)\\:\\/\\/(res.cloudinary.com)\\/([^\\/]+)\\/(image|video|raw)\\/(upload|authenticated)\\/(v[0-9]+)\\/(.+)(?:\\.[a-z]{3})?/\n\n const withTransformations = src.match(regexWithTransformations)\n const withoutTransformations = src.match(regexWithoutTransformations)\n\n if ( withTransformations ) {\n return withTransformations[withTransformations.length - 1]\n } else if ( withoutTransformations ) {\n return withoutTransformations[withoutTransformations.length - 1]\n } else {\n console.warn(`Not possible to retrieve the publicUrl from ${src}, make sure it's a valid cloudinary image url.`)\n }\n }\n\n return src;\n}\n\n/**\n * createPlaceholderUrl\n */\n\nexport function createPlaceholderUrl({ src, placeholder = true, config }) {\n const rawTransformations = [];\n\n if ( placeholder === 'grayscale' ) {\n rawTransformations.push('e_grayscale');\n }\n\n if ( typeof placeholder === 'string' && placeholder.includes('color:') ) {\n const color = placeholder.split(':').splice(1).join(':')\n rawTransformations.push('e_grayscale');\n rawTransformations.push(`e_colorize:60,co_${color}`);\n }\n\n return constructCloudinaryUrl({\n options: {\n src,\n width: 100,\n quality: 1,\n rawTransformations,\n },\n config\n });;\n}\n","import { constructCloudinaryUrl } from '../lib/cloudinary';\n\nexport function cloudinaryLoader({ loaderOptions, imageProps, cldOptions, cldConfig = {} }) {\n const options = {\n ...imageProps,\n ...cldOptions\n }\n\n // The loader options are used to create dynamic sizing when working with responsive images\n // so these should override the default options collected from the props alone if\n // the results are different. While we don't always use the height in the loader logic,\n // we always pass it here, as the usage is determined later based on cropping.js\n\n if ( loaderOptions?.width && loaderOptions.width !== options.width ) {\n const multiplier = loaderOptions.width / options.width;\n options.width = loaderOptions.width;\n options.height = Math.round(options.height * multiplier);\n }\n\n return constructCloudinaryUrl({\n options,\n config: cldConfig\n });\n}","import Image from 'next/image';\n\nimport { createPlaceholderUrl, getPublicId, transformationPlugins } from '../../lib/cloudinary';\nimport { cloudinaryLoader } from '../../loaders/cloudinary-loader';\n\nconst CldImage = props => {\n\n const CLD_OPTIONS = [\n 'deliveryType'\n ];\n\n transformationPlugins.forEach(({ props = [] }) => {\n props.forEach(prop => {\n if ( CLD_OPTIONS.includes(prop) ) {\n throw new Error(`Option ${prop} already exists!`);\n }\n CLD_OPTIONS.push(prop);\n });\n })\n\n // Construct the base Image component props by filtering out Cloudinary-specific props\n\n const imageProps = {};\n\n Object.keys(props)\n .filter(key => !CLD_OPTIONS.includes(key))\n .forEach(key => imageProps[key] = props[key]);\n\n // Construct Cloudinary-specific props by looking for values for any of the supported prop keys\n\n const cldOptions = {};\n\n CLD_OPTIONS.forEach(key => {\n if ( props[key] ) {\n cldOptions[key] = props[key];\n }\n });\n\n // If we see a placeholder option, configure a Cloudinary-based URL.\n // The resulting image will always be blurred per Next.js, so we're\n // limited on options for placeholders.\n //\n // We need to do this logic here as we potentially need to mutate\n // an Image component prop as opposed to simply the URL\n //\n // https://nextjs.org/docs/api-reference/next/image#blurdataurl\n\n if ( imageProps.placeholder ) {\n const publicId = getPublicId(props.src);\n\n imageProps.blurDataURL = createPlaceholderUrl({\n src: publicId,\n placeholder: props.placeholder\n });\n\n if ( imageProps.placeholder !== 'blur' ) {\n imageProps.placeholder = 'blur';\n }\n }\n\n return (\n <Image\n {...imageProps}\n loader={(loaderOptions) => cloudinaryLoader({ loaderOptions, imageProps, cldOptions })}\n />\n );\n}\n\nexport default CldImage;","import Head from 'next/head';\n\nconst IMAGE_WIDTH = 2400;\nconst IMAGE_HEIGHT = 1200;\n\nimport { constructCloudinaryUrl } from '../../lib/cloudinary';\n\nconst TWITTER_CARD = 'summary_large_image';\n\nconst CldOgImage = ({ excludeTags = [], twitterTitle, ...props }) => {\n const options = {\n ...props,\n width: props.width || IMAGE_WIDTH,\n height: props.height || IMAGE_HEIGHT,\n crop: props.crop || 'fill',\n gravity: props.gravity || 'center'\n }\n\n const ogImageUrl = constructCloudinaryUrl({\n options\n });\n\n // We need to include the tags within the Next.js Head component rather than\n // direcly adding them inside of the Head otherwise we get unexpected results\n\n return (\n <Head>\n <meta property=\"og:image\" content={ogImageUrl} />\n <meta property=\"og:image:secure_url\" content={ogImageUrl} />\n <meta property=\"og:image:width\" content={options.width} />\n <meta property=\"og:image:height\" content={options.height} />\n\n {options.alt && (\n <meta property=\"og:image:alt\" content={options.alt} />\n )}\n\n {/* Required for summary_large_image, exclude vai excludeTags */}\n {/* https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image */}\n\n {!excludeTags.includes('twitter:title') && (\n <meta property=\"twitter:title\" content={twitterTitle || ' '} />\n )}\n\n <meta property=\"twitter:card\" content={TWITTER_CARD} />\n <meta property=\"twitter:image\" content={ogImageUrl} />\n </Head>\n );\n}\n\nexport default CldOgImage;","import { useRef } from 'react';\nimport Script from 'next/script';\n\nconst CldUploadWidget = ({\n children,\n onUpload,\n options,\n signatureEndpoint,\n uploadPreset,\n}) => {\n const cloudinary = useRef();\n const widget = useRef();\n\n const signed = !!signatureEndpoint;\n\n /**\n * generateSignature\n * @description Makes a request to an endpoint to sign Cloudinary parameters as part of widget creation\n */\n\n function generateSignature(callback, paramsToSign) {\n fetch(signatureEndpoint, {\n method: \"POST\",\n body: JSON.stringify({\n paramsToSign,\n }),\n })\n .then((r) => r.json())\n .then(({ signature }) => {\n callback(signature);\n });\n }\n\n /**\n * createWidget\n * @description Creates a new instance of the Cloudinary widget and stores in a ref\n */\n\n function createWidget() {\n // When creating a signed upload, you need to provide both your Cloudinary API Key\n // as well as a signature generator function that will sign any paramters\n // either on page load or during the upload process. Read more about signed uploads at:\n // https://cloudinary.com/documentation/upload_widget#signed_uploads\n\n const uploadOptions = {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,\n uploadPreset: uploadPreset || process.env.NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET,\n apiKey: process.env.NEXT_PUBLIC_CLOUDINARY_API_KEY,\n ...options,\n };\n\n if ( signed ) {\n uploadOptions.uploadSignature = generateSignature;\n\n // No need for apiSecret here because of api/sign-cloudinary-params\n\n if (!uploadOptions.apiKey) {\n return new Error(\"Signed Upload needs apiKey!\");\n }\n }\n\n return cloudinary.current?.createUploadWidget(\n uploadOptions,\n function (error, result) {\n // The callback is a bit more chatty than failed or success so\n // only trigger when one of those are the case. You can additionally\n // create a separate handler such as onEvent and trigger it on\n // ever occurance\n if (error || result.event === \"success\") {\n onUpload(error, result, widget?.current);\n }\n }\n );\n }\n\n /**\n * open\n * @description When triggered, uses the current widget instance to open the upload modal\n */\n\n function open() {\n if (!widget?.current) {\n widget.current = createWidget();\n }\n\n widget?.current && widget.current.open();\n }\n\n /**\n * handleOnLoad\n * @description Stores the Cloudinary window instance to a ref when the widget script loads\n */\n\n function handleOnLoad() {\n cloudinary.current = window.cloudinary;\n }\n\n return (\n <>\n {children({\n cloudinary: cloudinary.current,\n widget: widget.current,\n open,\n })}\n <Script\n id={`cloudinary-${Math.floor(Math.random() * 100)}`}\n src=\"https://widget.cloudinary.com/v2.0/global/all.js\"\n onLoad={handleOnLoad}\n onError={(e) => console.error(`Failed to load Cloudinary: ${e.message}`)}\n />\n </>\n );\n};\n\nexport default CldUploadWidget;\n","import CldUploadWidget from '../CldUploadWidget';\n\nconst CldUploadButton = ({\n children,\n onClick,\n onUpload,\n options,\n signatureEndpoint,\n uploadPreset,\n ...props\n}) => {\n return (\n <>\n <CldUploadWidget\n onUpload={onUpload}\n options={options}\n signatureEndpoint={signatureEndpoint}\n uploadPreset={uploadPreset}\n >\n {({ open }) => {\n function handleOnClick(e) {\n e.preventDefault();\n\n open();\n\n if ( typeof onClick === 'function' ) {\n onClick(e);\n }\n }\n return (\n <button {...props} onClick={handleOnClick} >\n {children || 'Upload'}\n </button>\n );\n }}\n </CldUploadWidget>\n </>\n );\n};\n\nexport default CldUploadButton;\n"],"names":["cropsGravityAuto","props","plugin","cldImage","options","width","height","crop","transformationString","gravity","includes","console","warn","resize","params","prop","effect","map","param","forEach","key","encodeBase64","value","btoa","Buffer","from","toString","primary","aspectRatio","qualifier","position","angle","x","y","text","alignment","border","location","color","fontFamily","fontSize","fontWeight","letterSpacing","lineSpacing","stroke","textDecoration","DEFAULT_TEXT_OPTIONS","overlays","type","typeQualifier","Array","isArray","applyOverlay","publicId","url","effects","layerEffects","_excluded","hasPublicId","hasUrl","hasText","hasPosition","layerTransformation","replace","applied","Object","keys","qualifiersPrimary","push","textTransformations","qualifiersText","join","qualifiersPosition","length","addTransformation","transformations","transformation","rawTransformations","removeBackground","underlay","underlays","applyUnderlay","underlayOptions","zoompan","overrides","zoompanEffect","loopEffect","loop","format","transformationPlugins","removeBackgroundPlugin","croppingPlugin","effectsPlugin","overlaysPlugin","namedTransformationsPlugin","underlaysPlugin","zoompanPlugin","rawTransformationsPlugin","cld","constructCloudinaryUrl","config","Cloudinary","cloud","cloudName","process","env","NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME","analytics","getPublicId","src","image","pluginOptions","setDeliveryType","deliveryType","delivery","quality","toURL","Error","regexWithTransformations","regexWithoutTransformations","withTransformations","match","withoutTransformations","createPlaceholderUrl","placeholder","split","splice","cloudinaryLoader","loaderOptions","imageProps","cldOptions","cldConfig","multiplier","Math","round","CldImage","CLD_OPTIONS","filter","blurDataURL","_jsx","Image","IMAGE_WIDTH","IMAGE_HEIGHT","TWITTER_CARD","CldOgImage","excludeTags","twitterTitle","ogImageUrl","_jsxs","Head","alt","CldUploadWidget","children","onUpload","signatureEndpoint","uploadPreset","cloudinary","useRef","widget","signed","generateSignature","callback","paramsToSign","fetch","method","body","JSON","stringify","then","r","json","signature","createWidget","uploadOptions","NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET","apiKey","NEXT_PUBLIC_CLOUDINARY_API_KEY","uploadSignature","current","createUploadWidget","error","result","event","open","handleOnLoad","window","_Fragment","Script","floor","random","e","message","CldUploadButton","onClick","handleOnClick","preventDefault"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,gBAAgB,GAAG,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAE,CAAA;AAElE,IAAMC,OAAK,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAEjC,SAASC,QAAM,CAA6B,KAAA,EAAA;AAAA,EAAA,IAAA,IAAA,GAAA,KAAA,KAAA,KAAA,CAAA,GAAJ,EAAE,GAAA,KAAA;AAAxBC,IAAAA,QAAQ,QAARA,QAAQ;AAAEC,IAAAA,OAAO,QAAPA,OAAO,CAAA;AACxC,EAAA,IAAQC,KAAK,GAA6BD,OAAO,CAAzCC,KAAK;IAAEC,MAAM,GAAqBF,OAAO,CAAlCE,MAAM;IAAA,aAAqBF,GAAAA,OAAO,CAA1BG,IAAI;AAAJA,IAAAA,IAAI,8BAAG,OAAO,GAAA,aAAA,CAAA;AAErC,EAAA,IAAIC,oBAAoB,GAAA,IAAA,GAAQD,IAAI,GAAA,KAAA,GAAMF,KAAO,CAAA;EAEjD,IAAK,CAACD,OAAO,CAACK,OAAO,IAAIT,gBAAgB,CAACU,QAAQ,CAACH,IAAI,CAAC,EAAG;IACzDH,OAAO,CAACK,OAAO,GAAG,MAAM,CAAA;AAC1B,GAAA;EAEA,IAAK,CAAC,CAAC,OAAO,CAAC,CAACC,QAAQ,CAACH,IAAI,CAAC,EAAG;IAC/BC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AA,CAAA+C,mBAAA,EAAA;AAAA,IAAA,QAAA,eACE/C,eAAC,eAAe,EAAA;AACd,MAAA,QAAQ,EAAEc,QAAS;AACnB,MAAA,OAAO,EAAErJ,OAAQ;AACjB,MAAA,iBAAiB,EAAEsJ,iBAAkB;AACrC,MAAA,YAAY,EAAEC,YAAa;AAAA,MAAA,QAAA,EAE1B,SAAc,QAAA,CAAA,KAAA,EAAA;QAAA,IAAX4B,IAAI,SAAJA,IAAI,CAAA;QACN,SAASW,aAAa,CAACJ,CAAC,EAAE;UACxBA,CAAC,CAACK,cAAc,EAAE,CAAA;AAElBZ,UAAAA,IAAI,EAAE,CAAA;AAEN,UAAA,IAAK,OAAOU,OAAO,KAAK,UAAU,EAAG;YACnCA,OAAO,CAACH,CAAC,CAAC,CAAA;AACZ,WAAA;AACF,SAAA;AACA,QAAA,oBACEnD,sCAAY1I,KAAK,EAAA;AAAE,UAAA,OAAO,EAAEiM,aAAc;AAAA,UAAA,QAAA,EACvC1C,SAAQ,IAAI,QAAA;SACN,CAAA,CAAA,CAAA;AAEb,OAAA;AAAC,KAAA,CAAA;GAEF,CAAA,CAAA;AAEP;;;;;;;;;;;"}
@@ -33,8 +33,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
33
33
  }
34
34
 
35
35
  const cropsGravityAuto = ['crop', 'fill', 'lfill', 'fill_pad', 'thumb'];
36
- const props$6 = ['crop', 'gravity'];
37
- function plugin$6({
36
+ const props$7 = ['crop', 'gravity'];
37
+ function plugin$7({
38
38
  cldImage,
39
39
  options
40
40
  } = {}) {
@@ -62,8 +62,8 @@ function plugin$6({
62
62
 
63
63
  var croppingPlugin = {
64
64
  __proto__: null,
65
- props: props$6,
66
- plugin: plugin$6
65
+ props: props$7,
66
+ plugin: plugin$7
67
67
  };
68
68
 
69
69
  const params = ['art', {
@@ -112,8 +112,8 @@ const params = ['art', {
112
112
  prop: 'unsharpMask',
113
113
  effect: 'unsharp_mask'
114
114
  }, 'vectorize', 'vibrance', 'vignette'];
115
- const props$5 = params.map(param => param.prop || param);
116
- function plugin$5({
115
+ const props$6 = params.map(param => param.prop || param);
116
+ function plugin$6({
117
117
  cldImage,
118
118
  options
119
119
  } = {}) {
@@ -130,8 +130,8 @@ function plugin$5({
130
130
 
131
131
  var effectsPlugin = {
132
132
  __proto__: null,
133
- props: props$5,
134
- plugin: plugin$5
133
+ props: props$6,
134
+ plugin: plugin$6
135
135
  };
136
136
 
137
137
  /**
@@ -216,14 +216,14 @@ const text = {
216
216
  };
217
217
 
218
218
  const _excluded$3 = ["publicId", "url", "position", "text", "effects"];
219
- const props$4 = ['text', 'overlays'];
219
+ const props$5 = ['text', 'overlays'];
220
220
  const DEFAULT_TEXT_OPTIONS = {
221
221
  color: 'black',
222
222
  fontFamily: 'Arial',
223
223
  fontSize: 200,
224
224
  fontWeight: 'bold'
225
225
  };
226
- function plugin$4({
226
+ function plugin$5({
227
227
  cldImage,
228
228
  options
229
229
  } = {}) {
@@ -369,8 +369,30 @@ function plugin$4({
369
369
 
370
370
  var overlaysPlugin = {
371
371
  __proto__: null,
372
- props: props$4,
372
+ props: props$5,
373
373
  DEFAULT_TEXT_OPTIONS: DEFAULT_TEXT_OPTIONS,
374
+ plugin: plugin$5
375
+ };
376
+
377
+ const props$4 = ['transformations'];
378
+ function plugin$4({
379
+ cldImage,
380
+ options
381
+ } = {}) {
382
+ let {
383
+ transformations = []
384
+ } = options;
385
+ if (!Array.isArray(transformations)) {
386
+ transformations = [transformations];
387
+ }
388
+ transformations.forEach(transformation => {
389
+ cldImage.addTransformation(`t_${transformation}`);
390
+ });
391
+ }
392
+
393
+ var namedTransformationsPlugin = {
394
+ __proto__: null,
395
+ props: props$4,
374
396
  plugin: plugin$4
375
397
  };
376
398
 
@@ -577,7 +599,7 @@ var zoompanPlugin = {
577
599
 
578
600
  const transformationPlugins = [
579
601
  // Background Removal must always come first
580
- removeBackgroundPlugin, croppingPlugin, effectsPlugin, overlaysPlugin, underlaysPlugin, zoompanPlugin,
602
+ removeBackgroundPlugin, croppingPlugin, effectsPlugin, overlaysPlugin, namedTransformationsPlugin, underlaysPlugin, zoompanPlugin,
581
603
  // Raw transformations needs to be last simply to make sure
582
604
  // it's always expected to applied the same way
583
605