next-cloudinary 0.0.7 → 0.0.9

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.
@@ -67,7 +67,8 @@ function createPlaceholderUrl({
67
67
  }
68
68
 
69
69
  const cropsGravityAuto = ['crop', 'fill', 'lfill', 'fill_pad', 'thumb'];
70
- function croppingPlugin({
70
+ const options$5 = ['crop', 'gravity'];
71
+ function plugin$4({
71
72
  cldImage,
72
73
  options,
73
74
  cldOptions
@@ -101,6 +102,12 @@ function croppingPlugin({
101
102
  cldImage.resize(transformationString);
102
103
  }
103
104
 
105
+ var croppingPlugin = {
106
+ __proto__: null,
107
+ options: options$5,
108
+ plugin: plugin$4
109
+ };
110
+
104
111
  // aspectRatio
105
112
  const primary = {
106
113
  aspectRatio: {
@@ -156,7 +163,8 @@ const text = {
156
163
  };
157
164
 
158
165
  const _excluded$1 = ["publicId", "position", "text", "effects"];
159
- function overlaysPlugin({
166
+ const options$4 = ['overlays'];
167
+ function plugin$3({
160
168
  cldImage,
161
169
  options,
162
170
  cldOptions
@@ -260,7 +268,14 @@ function overlaysPlugin({
260
268
  });
261
269
  }
262
270
 
263
- function removeBackgroundPlugin({
271
+ var overlaysPlugin = {
272
+ __proto__: null,
273
+ options: options$4,
274
+ plugin: plugin$3
275
+ };
276
+
277
+ const options$3 = ['removeBackground'];
278
+ function plugin$2({
264
279
  cldImage,
265
280
  options,
266
281
  cldOptions
@@ -274,22 +289,89 @@ function removeBackgroundPlugin({
274
289
  }
275
290
  }
276
291
 
277
- function tintPlugin({
292
+ var removeBackgroundPlugin = {
293
+ __proto__: null,
294
+ options: options$3,
295
+ plugin: plugin$2
296
+ };
297
+
298
+ const params = ['art', {
299
+ prop: 'autoBrightness',
300
+ effect: 'auto_brightness'
301
+ }, {
302
+ prop: 'autoColor',
303
+ effect: 'auto_color'
304
+ }, {
305
+ prop: 'autoContrast',
306
+ effect: 'auto_contrast'
307
+ }, {
308
+ prop: 'assistColorblind',
309
+ effect: 'assist_colorblind'
310
+ }, 'blackwhite', 'blur', {
311
+ prop: 'blurFaces',
312
+ effect: 'blur_faces'
313
+ }, {
314
+ prop: 'blurRegion',
315
+ effect: 'blur_region'
316
+ }, 'brightness', {
317
+ prop: 'brightnessHSB',
318
+ effect: 'brightness_hsb'
319
+ }, 'cartoonify', 'colorize', 'contrast', 'distort', {
320
+ prop: 'fillLight',
321
+ effect: 'fill_light'
322
+ }, 'gamma', {
323
+ prop: 'gradientFade',
324
+ effect: 'gradient_fade'
325
+ }, 'grayscale', 'improve', 'negate', {
326
+ prop: 'oilPaint',
327
+ effect: 'oil_paint'
328
+ }, 'outline', 'pixelate', {
329
+ prop: 'pixelateFaces',
330
+ effect: 'pixelate_faces'
331
+ }, {
332
+ prop: 'pixelateRegion',
333
+ effect: 'pixelate_region'
334
+ }, 'redeye', {
335
+ prop: 'replaceColor',
336
+ effect: 'replace_color'
337
+ }, 'saturation', 'sepia', 'shadow', 'sharpen', 'shear', {
338
+ prop: 'simulateColorblind',
339
+ effect: 'simulate_colorblind'
340
+ }, 'tint', {
341
+ prop: 'unsharpMask',
342
+ effect: 'unsharp_mask'
343
+ }, 'vectorize', 'vibrance', 'vignette' // 'zoompan' // requires GIF format
344
+ ];
345
+ const options$2 = params.map(param => param.prop || param);
346
+ function plugin$1({
278
347
  cldImage,
279
- options,
280
348
  cldOptions
281
349
  } = {}) {
282
- const {
283
- tint
284
- } = cldOptions;
350
+ params.forEach(key => {
351
+ const prop = key.prop || key;
352
+ const effect = key.effect || key;
285
353
 
286
- if (tint) {
287
- cldImage.effect(`e_tint:${tint}`);
288
- }
354
+ if (prop === 'oilPaint' && cldOptions[prop]) {
355
+ console.log('cldOptions[prop]', cldOptions[prop]);
356
+ }
357
+
358
+ if (cldOptions[prop] === true) {
359
+ cldImage.effect(`e_${effect}`);
360
+ } else if (typeof cldOptions[prop] === 'string') {
361
+ cldImage.effect(`e_${effect}:${cldOptions[prop]}`);
362
+ }
363
+ });
289
364
  }
290
365
 
366
+ var effectsPlugin = {
367
+ __proto__: null,
368
+ options: options$2,
369
+ plugin: plugin$1
370
+ };
371
+
291
372
  const _excluded = ["publicId", "type", "position", "text", "effects"];
292
- function underlaysPlugin({
373
+ const options$1 = ['underlays'];
374
+ function plugin({
293
375
  cldImage,
294
376
  options,
295
377
  cldOptions
@@ -365,13 +447,19 @@ function underlaysPlugin({
365
447
  });
366
448
  }
367
449
 
450
+ var underlaysPlugin = {
451
+ __proto__: null,
452
+ options: options$1,
453
+ plugin: plugin
454
+ };
455
+
368
456
  const cld = new Cloudinary({
369
457
  cloud: {
370
458
  cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
371
459
  }
372
460
  });
373
461
  const transformationPlugins = [removeBackgroundPlugin, // Background Removal must always come first
374
- croppingPlugin, tintPlugin, overlaysPlugin, underlaysPlugin];
462
+ croppingPlugin, effectsPlugin, overlaysPlugin, underlaysPlugin];
375
463
  function cloudinaryLoader(options, cldOptions) {
376
464
  const {
377
465
  src,
@@ -380,7 +468,9 @@ function cloudinaryLoader(options, cldOptions) {
380
468
  quality = 'auto'
381
469
  } = options;
382
470
  const cldImage = cld.image(src);
383
- transformationPlugins.forEach(plugin => {
471
+ transformationPlugins.forEach(({
472
+ plugin
473
+ }) => {
384
474
  plugin({
385
475
  cldImage,
386
476
  options,
@@ -390,15 +480,27 @@ function cloudinaryLoader(options, cldOptions) {
390
480
  return cldImage.format(format).delivery(`q_${quality}`).toURL();
391
481
  }
392
482
 
393
- const options = ['crop', 'gravity', 'overlays', 'removeBackground', 'tint', 'underlays'];
483
+ const options = [];
394
484
 
395
485
  const CldImage = props => {
396
- // Construct the base Image component props by filtering out Cloudinary-specific props
486
+ const CLD_OPTIONS = [...options];
487
+ transformationPlugins.forEach(({
488
+ options: _options = []
489
+ }) => {
490
+ _options.forEach(option => {
491
+ if (CLD_OPTIONS.includes(option)) {
492
+ throw new Error(`Option ${option} already exists!`);
493
+ }
494
+
495
+ CLD_OPTIONS.push(option);
496
+ });
497
+ }); // Construct the base Image component props by filtering out Cloudinary-specific props
498
+
397
499
  const imageProps = {};
398
- Object.keys(props).filter(key => !options.includes(key)).forEach(key => imageProps[key] = props[key]); // Construct Cloudinary-specific props by looking for values for any of the supported prop keys
500
+ Object.keys(props).filter(key => !CLD_OPTIONS.includes(key)).forEach(key => imageProps[key] = props[key]); // Construct Cloudinary-specific props by looking for values for any of the supported prop keys
399
501
 
400
502
  const cldOptions = {};
401
- options.forEach(key => {
503
+ CLD_OPTIONS.forEach(key => {
402
504
  if (props[key]) {
403
505
  cldOptions[key] = props[key];
404
506
  }
@@ -1 +1 @@
1
- {"version":3,"file":"next-cloudinary.modern.mjs","sources":["../src/lib/cloudinary.js","../src/plugins/cropping.js","../src/constants/qualifiers.js","../src/plugins/overlays.js","../src/plugins/remove-background.js","../src/plugins/tint.js","../src/plugins/underlays.js","../src/loaders/cloudinary-loader.js","../src/constants/options.js","../src/components/CldImage/CldImage.js"],"sourcesContent":["import { Cloudinary } from '@cloudinary/url-gen';\n\nconst 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});\n\n/**\n * createPlaceholderUrl\n */\n\nexport function createPlaceholderUrl({ src, placeholder }) {\n const cldImage = cld.image(src)\n .resize('c_limit,w_100')\n .delivery('q_1')\n .format('auto');\n\n if ( placeholder === 'grayscale' ) {\n cldImage.effect('e_grayscale');\n }\n\n if ( placeholder.includes('color:') ) {\n const color = placeholder.split(':').splice(1).join(':')\n cldImage.effect('e_grayscale');\n cldImage.effect(`e_colorize:60,co_${color}`);\n }\n\n return cldImage.toURL();\n}","const cropsGravityAuto = [ 'crop', 'fill', 'lfill', 'fill_pad', 'thumb' ];\n\nexport function croppingPlugin({ cldImage, options, cldOptions } = {}) {\n const { width, height } = options;\n const { crop = 'limit', gravity } = cldOptions;\n\n let transformationString = `c_${crop},w_${width}`;\n\n if ( !gravity && cropsGravityAuto.includes(crop) ) {\n gravity = 'auto';\n }\n\n if ( !['limit'].includes(crop) ) {\n transformationString = `${transformationString},h_${height}`;\n }\n\n if ( gravity ) {\n if ( 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_${gravity}`;\n }\n }\n\n cldImage.resize(transformationString);\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 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 textDecoration: {\n qualifier: false\n }\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport function overlaysPlugin({ cldImage, options, cldOptions } = {}) {\n const { overlays = [] } = cldOptions;\n\n const type = 'overlay';\n const typeQualifier = 'l';\n\n overlays.forEach(({ publicId, position, text, effects: layerEffects = [], ...options }) => {\n const hasPublicId = typeof publicId === 'string';\n const hasText = typeof text === 'object';\n const hasPosition = typeof position === 'object';\n\n if ( !hasPublicId && !hasText ) {\n console.warn(`An ${type} is missing Public ID 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 {\n layerTransformation = `${typeQualifier}_${publicId.replace(/\\//g, ':')}`;\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 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 {\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`;\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 function removeBackgroundPlugin({ cldImage, options, cldOptions } = {}) {\n const { removeBackground = false } = cldOptions;\n if ( removeBackground ) {\n cldImage.effect('e_background_removal');\n }\n}","export function tintPlugin({ cldImage, options, cldOptions } = {}) {\n const { tint } = cldOptions;\n\n if ( tint ) {\n cldImage.effect(`e_tint:${tint}`);\n }\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport function underlaysPlugin({ cldImage, options, cldOptions } = {}) {\n const { underlays = [] } = cldOptions;\n\n const type = 'underlay';\n const typeQualifier = 'u';\n\n underlays.forEach(({ 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`;\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}","import { Cloudinary } from '@cloudinary/url-gen';\n\nimport { croppingPlugin } from '../plugins/cropping';\nimport { overlaysPlugin } from '../plugins/overlays';\nimport { removeBackgroundPlugin } from '../plugins/remove-background';\nimport { tintPlugin } from '../plugins/tint';\nimport { underlaysPlugin } from '../plugins/underlays';\n\nimport {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nconst cld = new Cloudinary({\n cloud: {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME\n },\n});\n\nconst transformationPlugins = [\n removeBackgroundPlugin, // Background Removal must always come first\n croppingPlugin,\n tintPlugin,\n overlaysPlugin,\n underlaysPlugin\n];\n\nexport function cloudinaryLoader(options, cldOptions) {\n const {\n src,\n width,\n format = 'auto',\n quality = 'auto',\n } = options;\n\n const cldImage = cld.image(src);\n\n transformationPlugins.forEach(plugin => {\n plugin({\n cldImage,\n options,\n cldOptions\n });\n });\n\n return cldImage.format(format).delivery(`q_${quality}`).toURL();\n}","export const options = [\n 'crop',\n 'gravity',\n 'overlays',\n 'removeBackground',\n 'tint',\n 'underlays',\n];\n\n\n","import Image from 'next/image';\n\nimport { createPlaceholderUrl } from '../../lib/cloudinary';\nimport { cloudinaryLoader } from '../../loaders/cloudinary-loader';\n\nimport { options as CLD_OPTIONS } from '../../constants/options';\n\nconst CldImage = props => {\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 imageProps.blurDataURL = createPlaceholderUrl({\n src: props.src,\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={(options) => cloudinaryLoader({ ...imageProps, options }, cldOptions)}\n />\n );\n}\n\nexport default CldImage;"],"names":["cld","Cloudinary","cloud","cloudName","process","env","NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME","url","analytics","createPlaceholderUrl","src","placeholder","cldImage","image","resize","delivery","format","effect","includes","color","split","splice","join","toURL","cropsGravityAuto","croppingPlugin","options","cldOptions","width","height","crop","gravity","transformationString","console","warn","primary","aspectRatio","qualifier","position","angle","x","y","text","location","fontFamily","fontSize","fontWeight","letterSpacing","textDecoration","overlaysPlugin","overlays","type","typeQualifier","forEach","publicId","effects","layerEffects","_excluded","hasPublicId","hasText","hasPosition","layerTransformation","replace","applied","Object","keys","key","qualifiersPrimary","push","textTransformations","qualifiersText","qualifiersPosition","length","addTransformation","removeBackgroundPlugin","removeBackground","tintPlugin","tint","underlaysPlugin","underlays","transformationPlugins","cloudinaryLoader","quality","plugin","CldImage","props","imageProps","filter","CLD_OPTIONS","blurDataURL","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAMA,KAAG,GAAG,IAAIC,UAAJ,CAAe;AACzBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,SAAS,EAAEC,OAAO,CAACC,GAAR,CAAYC,iCAAAA;GAFA;AAIzBC,EAAAA,GAAG,EAAE;AACH;AACAC,IAAAA,SAAS,EAAE,KAAA;AAFR,GAAA;AAJoB,CAAf,CAAZ,CAAA;AAUA;AACA;AACA;;AAEO,SAASC,oBAAT,CAA8B;EAAEC,GAAF;AAAOC,EAAAA,WAAAA;AAAP,CAA9B,EAAoD;AACzD,EAAA,MAAMC,QAAQ,GAAGZ,KAAG,CAACa,KAAJ,CAAUH,GAAV,CACII,CAAAA,MADJ,CACW,eADX,CAAA,CAEIC,QAFJ,CAEa,KAFb,EAGIC,MAHJ,CAGW,MAHX,CAAjB,CAAA;;EAKA,IAAKL,WAAW,KAAK,WAArB,EAAmC;IACjCC,QAAQ,CAACK,MAAT,CAAgB,aAAhB,CAAA,CAAA;AACD,GAA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I,CAACsB,OAAW,CAACtE,QAAZ,CAAqBgD,GAArB,CADlB,CAAA,CAEGb,OAFH,CAEWa,GAAG,IAAIoB,UAAU,CAACpB,GAAD,CAAV,GAAkBmB,KAAK,CAACnB,GAAD,CAFzC,EANwB;;EAYxB,MAAMvC,UAAU,GAAG,EAAnB,CAAA;AAEA6D,EAAAA,OAAW,CAACnC,OAAZ,CAAoBa,GAAG,IAAI;AACzB,IAAA,IAAKmB,KAAK,CAACnB,GAAD,CAAV,EAAkB;AAChBvC,MAAAA,UAAU,CAACuC,GAAD,CAAV,GAAkBmB,KAAK,CAACnB,GAAD,CAAvB,CAAA;AACD,KAAA;AACF,GAJD,EAdwB;AAqBxB;AACA;AACA;AACA;AACA;AACA;AACA;;EAEA,IAAKoB,UAAU,CAAC3E,WAAhB,EAA8B;AAC5B2E,IAAAA,UAAU,CAACG,WAAX,GAAyBhF,oBAAoB,CAAC;MAC5CC,GAAG,EAAE2E,KAAK,CAAC3E,GADiC;MAE5CC,WAAW,EAAE0E,KAAK,CAAC1E,WAAAA;AAFyB,KAAD,CAA7C,CAAA;;AAKA,IAAA,IAAK2E,UAAU,CAAC3E,WAAX,KAA2B,MAAhC,EAAyC;MACvC2E,UAAU,CAAC3E,WAAX,GAAyB,MAAzB,CAAA;AACD,KAAA;AACF,GAAA;;EAED,oBACE+E,GAAA,CAAC,KAAD,EAAA,QAAA,CAAA,EAAA,EACMJ,UADN,EAAA;AAEE,IAAA,MAAM,EAAG5D,OAAD,IAAauD,gBAAgB,cAAMK,UAAN,EAAA;AAAkB5D,MAAAA,OAAAA;AAAlB,KAAA,CAAA,EAA6BC,UAA7B,CAAA;GAHzC,CAAA,CAAA,CAAA;AAMD;;;;"}
1
+ {"version":3,"file":"next-cloudinary.modern.mjs","sources":["../src/lib/cloudinary.js","../src/plugins/cropping.js","../src/constants/qualifiers.js","../src/plugins/overlays.js","../src/plugins/remove-background.js","../src/plugins/effects.js","../src/plugins/underlays.js","../src/loaders/cloudinary-loader.js","../src/constants/options.js","../src/components/CldImage/CldImage.js"],"sourcesContent":["import { Cloudinary } from '@cloudinary/url-gen';\n\nconst 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});\n\n/**\n * createPlaceholderUrl\n */\n\nexport function createPlaceholderUrl({ src, placeholder }) {\n const cldImage = cld.image(src)\n .resize('c_limit,w_100')\n .delivery('q_1')\n .format('auto');\n\n if ( placeholder === 'grayscale' ) {\n cldImage.effect('e_grayscale');\n }\n\n if ( placeholder.includes('color:') ) {\n const color = placeholder.split(':').splice(1).join(':')\n cldImage.effect('e_grayscale');\n cldImage.effect(`e_colorize:60,co_${color}`);\n }\n\n return cldImage.toURL();\n}","const cropsGravityAuto = [ 'crop', 'fill', 'lfill', 'fill_pad', 'thumb' ];\n\nexport const options = ['crop', 'gravity'];\n\nexport function plugin({ cldImage, options, cldOptions } = {}) {\n const { width, height } = options;\n const { crop = 'limit', gravity } = cldOptions;\n\n let transformationString = `c_${crop},w_${width}`;\n\n if ( !gravity && cropsGravityAuto.includes(crop) ) {\n gravity = 'auto';\n }\n\n if ( !['limit'].includes(crop) ) {\n transformationString = `${transformationString},h_${height}`;\n }\n\n if ( gravity ) {\n if ( 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_${gravity}`;\n }\n }\n\n cldImage.resize(transformationString);\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 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 textDecoration: {\n qualifier: false\n }\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const options = ['overlays'];\n\nexport function plugin({ cldImage, options, cldOptions } = {}) {\n const { overlays = [] } = cldOptions;\n\n const type = 'overlay';\n const typeQualifier = 'l';\n\n overlays.forEach(({ publicId, position, text, effects: layerEffects = [], ...options }) => {\n const hasPublicId = typeof publicId === 'string';\n const hasText = typeof text === 'object';\n const hasPosition = typeof position === 'object';\n\n if ( !hasPublicId && !hasText ) {\n console.warn(`An ${type} is missing Public ID 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 {\n layerTransformation = `${typeQualifier}_${publicId.replace(/\\//g, ':')}`;\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 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 {\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`;\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 options = ['removeBackground'];\n\nexport function plugin({ cldImage, options, cldOptions } = {}) {\n const { removeBackground = false } = cldOptions;\n if ( removeBackground ) {\n cldImage.effect('e_background_removal');\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 // 'zoompan' // requires GIF format\n];\n\nexport const options = params.map(param => param.prop || param);\n\nexport function plugin({ cldImage, cldOptions } = {}) {\n params.forEach(key => {\n\n const prop = key.prop || key;\n const effect = key.effect || key;\n\n if ( prop === 'oilPaint' && cldOptions[prop]) {\n console.log('cldOptions[prop]', cldOptions[prop])\n }\n if ( cldOptions[prop] === true ) {\n cldImage.effect(`e_${effect}`);\n } else if ( typeof cldOptions[prop] === 'string' ) {\n cldImage.effect(`e_${effect}:${cldOptions[prop]}`);\n }\n });\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const options = ['underlays'];\n\nexport function plugin({ cldImage, options, cldOptions } = {}) {\n const { underlays = [] } = cldOptions;\n\n const type = 'underlay';\n const typeQualifier = 'u';\n\n underlays.forEach(({ 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`;\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}","import { Cloudinary } from '@cloudinary/url-gen';\n\nimport * as croppingPlugin from '../plugins/cropping';\nimport * as overlaysPlugin from '../plugins/overlays';\nimport * as removeBackgroundPlugin from '../plugins/remove-background';\nimport * as effectsPlugin from '../plugins/effects';\nimport * as underlaysPlugin from '../plugins/underlays';\n\nimport {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nconst cld = new Cloudinary({\n cloud: {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME\n },\n});\n\nexport const transformationPlugins = [\n removeBackgroundPlugin, // Background Removal must always come first\n croppingPlugin,\n effectsPlugin,\n overlaysPlugin,\n underlaysPlugin\n];\n\nexport function cloudinaryLoader(options, cldOptions) {\n const {\n src,\n width,\n format = 'auto',\n quality = 'auto',\n } = options;\n\n const cldImage = cld.image(src);\n\n transformationPlugins.forEach(({ plugin }) => {\n plugin({\n cldImage,\n options,\n cldOptions\n });\n });\n\n return cldImage.format(format).delivery(`q_${quality}`).toURL();\n}","export const options = [];","import Image from 'next/image';\n\nimport { createPlaceholderUrl } from '../../lib/cloudinary';\nimport { cloudinaryLoader, transformationPlugins } from '../../loaders/cloudinary-loader';\n\nimport { options as defaultOptions } from '../../constants/options';\n\nconst CldImage = props => {\n\n const CLD_OPTIONS = [...defaultOptions];\n\n transformationPlugins.forEach(({ options = [] }) => {\n options.forEach(option => {\n if ( CLD_OPTIONS.includes(option) ) {\n throw new Error(`Option ${option} already exists!`);\n }\n CLD_OPTIONS.push(option);\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 imageProps.blurDataURL = createPlaceholderUrl({\n src: props.src,\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={(options) => cloudinaryLoader({ ...imageProps, options }, cldOptions)}\n />\n );\n}\n\nexport default CldImage;"],"names":["cld","Cloudinary","cloud","cloudName","process","env","NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME","url","analytics","createPlaceholderUrl","src","placeholder","cldImage","image","resize","delivery","format","effect","includes","color","split","splice","join","toURL","cropsGravityAuto","options","plugin","cldOptions","width","height","crop","gravity","transformationString","console","warn","primary","aspectRatio","qualifier","position","angle","x","y","text","location","fontFamily","fontSize","fontWeight","letterSpacing","textDecoration","overlays","type","typeQualifier","forEach","publicId","effects","layerEffects","_excluded","hasPublicId","hasText","hasPosition","layerTransformation","replace","applied","Object","keys","key","qualifiersPrimary","push","textTransformations","qualifiersText","qualifiersPosition","length","addTransformation","removeBackground","params","prop","map","param","log","underlays","transformationPlugins","removeBackgroundPlugin","croppingPlugin","effectsPlugin","overlaysPlugin","underlaysPlugin","cloudinaryLoader","quality","CldImage","props","CLD_OPTIONS","defaultOptions","option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AAW,CAACxE,QAAZ,CAAqB+C,GAArB,CADlB,CAAA,CAEGb,OAFH,CAEWa,GAAG,IAAI6B,UAAU,CAAC7B,GAAD,CAAV,GAAkBwB,KAAK,CAACxB,GAAD,CAFzC,EAjBwB;;EAuBxB,MAAMtC,UAAU,GAAG,EAAnB,CAAA;AAEA+D,EAAAA,WAAW,CAACtC,OAAZ,CAAoBa,GAAG,IAAI;AACzB,IAAA,IAAKwB,KAAK,CAACxB,GAAD,CAAV,EAAkB;AAChBtC,MAAAA,UAAU,CAACsC,GAAD,CAAV,GAAkBwB,KAAK,CAACxB,GAAD,CAAvB,CAAA;AACD,KAAA;AACF,GAJD,EAzBwB;AAgCxB;AACA;AACA;AACA;AACA;AACA;AACA;;EAEA,IAAK6B,UAAU,CAACnF,WAAhB,EAA8B;AAC5BmF,IAAAA,UAAU,CAACE,WAAX,GAAyBvF,oBAAoB,CAAC;MAC5CC,GAAG,EAAE+E,KAAK,CAAC/E,GADiC;MAE5CC,WAAW,EAAE8E,KAAK,CAAC9E,WAAAA;AAFyB,KAAD,CAA7C,CAAA;;AAKA,IAAA,IAAKmF,UAAU,CAACnF,WAAX,KAA2B,MAAhC,EAAyC;MACvCmF,UAAU,CAACnF,WAAX,GAAyB,MAAzB,CAAA;AACD,KAAA;AACF,GAAA;;EAED,oBACEsF,GAAA,CAAC,KAAD,EAAA,QAAA,CAAA,EAAA,EACMH,UADN,EAAA;AAEE,IAAA,MAAM,EAAGrE,OAAD,IAAa6D,gBAAgB,cAAMQ,UAAN,EAAA;AAAkBrE,MAAAA,OAAAA;AAAlB,KAAA,CAAA,EAA6BE,UAA7B,CAAA;GAHzC,CAAA,CAAA,CAAA;AAMD;;;;"}
@@ -70,7 +70,8 @@ function createPlaceholderUrl(_ref) {
70
70
  }
71
71
 
72
72
  var cropsGravityAuto = ['crop', 'fill', 'lfill', 'fill_pad', 'thumb'];
73
- function croppingPlugin(_temp) {
73
+ var options$5 = ['crop', 'gravity'];
74
+ function plugin$4(_temp) {
74
75
  var _ref = _temp === void 0 ? {} : _temp,
75
76
  cldImage = _ref.cldImage,
76
77
  options = _ref.options,
@@ -102,6 +103,12 @@ function croppingPlugin(_temp) {
102
103
  cldImage.resize(transformationString);
103
104
  }
104
105
 
106
+ var croppingPlugin = {
107
+ __proto__: null,
108
+ options: options$5,
109
+ plugin: plugin$4
110
+ };
111
+
105
112
  // aspectRatio
106
113
  var primary = {
107
114
  aspectRatio: {
@@ -157,7 +164,8 @@ var text = {
157
164
  };
158
165
 
159
166
  var _excluded$1 = ["publicId", "position", "text", "effects"];
160
- function overlaysPlugin(_temp) {
167
+ var options$4 = ['overlays'];
168
+ function plugin$3(_temp) {
161
169
  var _ref = _temp === void 0 ? {} : _temp,
162
170
  cldImage = _ref.cldImage,
163
171
  cldOptions = _ref.cldOptions;
@@ -252,7 +260,14 @@ function overlaysPlugin(_temp) {
252
260
  });
253
261
  }
254
262
 
255
- function removeBackgroundPlugin(_temp) {
263
+ var overlaysPlugin = {
264
+ __proto__: null,
265
+ options: options$4,
266
+ plugin: plugin$3
267
+ };
268
+
269
+ var options$3 = ['removeBackground'];
270
+ function plugin$2(_temp) {
256
271
  var _ref = _temp === void 0 ? {} : _temp,
257
272
  cldImage = _ref.cldImage,
258
273
  cldOptions = _ref.cldOptions;
@@ -265,20 +280,92 @@ function removeBackgroundPlugin(_temp) {
265
280
  }
266
281
  }
267
282
 
268
- function tintPlugin(_temp) {
283
+ var removeBackgroundPlugin = {
284
+ __proto__: null,
285
+ options: options$3,
286
+ plugin: plugin$2
287
+ };
288
+
289
+ var params = ['art', {
290
+ prop: 'autoBrightness',
291
+ effect: 'auto_brightness'
292
+ }, {
293
+ prop: 'autoColor',
294
+ effect: 'auto_color'
295
+ }, {
296
+ prop: 'autoContrast',
297
+ effect: 'auto_contrast'
298
+ }, {
299
+ prop: 'assistColorblind',
300
+ effect: 'assist_colorblind'
301
+ }, 'blackwhite', 'blur', {
302
+ prop: 'blurFaces',
303
+ effect: 'blur_faces'
304
+ }, {
305
+ prop: 'blurRegion',
306
+ effect: 'blur_region'
307
+ }, 'brightness', {
308
+ prop: 'brightnessHSB',
309
+ effect: 'brightness_hsb'
310
+ }, 'cartoonify', 'colorize', 'contrast', 'distort', {
311
+ prop: 'fillLight',
312
+ effect: 'fill_light'
313
+ }, 'gamma', {
314
+ prop: 'gradientFade',
315
+ effect: 'gradient_fade'
316
+ }, 'grayscale', 'improve', 'negate', {
317
+ prop: 'oilPaint',
318
+ effect: 'oil_paint'
319
+ }, 'outline', 'pixelate', {
320
+ prop: 'pixelateFaces',
321
+ effect: 'pixelate_faces'
322
+ }, {
323
+ prop: 'pixelateRegion',
324
+ effect: 'pixelate_region'
325
+ }, 'redeye', {
326
+ prop: 'replaceColor',
327
+ effect: 'replace_color'
328
+ }, 'saturation', 'sepia', 'shadow', 'sharpen', 'shear', {
329
+ prop: 'simulateColorblind',
330
+ effect: 'simulate_colorblind'
331
+ }, 'tint', {
332
+ prop: 'unsharpMask',
333
+ effect: 'unsharp_mask'
334
+ }, 'vectorize', 'vibrance', 'vignette' // 'zoompan' // requires GIF format
335
+ ];
336
+ var options$2 = params.map(function (param) {
337
+ return param.prop || param;
338
+ });
339
+ function plugin$1(_temp) {
269
340
  var _ref = _temp === void 0 ? {} : _temp,
270
341
  cldImage = _ref.cldImage,
271
342
  cldOptions = _ref.cldOptions;
272
343
 
273
- var tint = cldOptions.tint;
344
+ params.forEach(function (key) {
345
+ var prop = key.prop || key;
346
+ var effect = key.effect || key;
274
347
 
275
- if (tint) {
276
- cldImage.effect("e_tint:" + tint);
277
- }
348
+ if (prop === 'oilPaint' && cldOptions[prop]) {
349
+ console.log('cldOptions[prop]', cldOptions[prop]);
350
+ }
351
+
352
+ if (cldOptions[prop] === true) {
353
+ cldImage.effect("e_" + effect);
354
+ } else if (typeof cldOptions[prop] === 'string') {
355
+ cldImage.effect("e_" + effect + ":" + cldOptions[prop]);
356
+ }
357
+ });
278
358
  }
279
359
 
360
+ var effectsPlugin = {
361
+ __proto__: null,
362
+ options: options$2,
363
+ plugin: plugin$1
364
+ };
365
+
280
366
  var _excluded = ["publicId", "type", "position", "text", "effects"];
281
- function underlaysPlugin(_temp) {
367
+ var options$1 = ['underlays'];
368
+ function plugin(_temp) {
282
369
  var _ref = _temp === void 0 ? {} : _temp,
283
370
  cldImage = _ref.cldImage,
284
371
  cldOptions = _ref.cldOptions;
@@ -346,13 +433,19 @@ function underlaysPlugin(_temp) {
346
433
  });
347
434
  }
348
435
 
436
+ var underlaysPlugin = {
437
+ __proto__: null,
438
+ options: options$1,
439
+ plugin: plugin
440
+ };
441
+
349
442
  var cld = new Cloudinary({
350
443
  cloud: {
351
444
  cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
352
445
  }
353
446
  });
354
447
  var transformationPlugins = [removeBackgroundPlugin, // Background Removal must always come first
355
- croppingPlugin, tintPlugin, overlaysPlugin, underlaysPlugin];
448
+ croppingPlugin, effectsPlugin, overlaysPlugin, underlaysPlugin];
356
449
  function cloudinaryLoader(options, cldOptions) {
357
450
  var src = options.src,
358
451
  _options$format = options.format,
@@ -360,7 +453,8 @@ function cloudinaryLoader(options, cldOptions) {
360
453
  _options$quality = options.quality,
361
454
  quality = _options$quality === void 0 ? 'auto' : _options$quality;
362
455
  var cldImage = cld.image(src);
363
- transformationPlugins.forEach(function (plugin) {
456
+ transformationPlugins.forEach(function (_ref) {
457
+ var plugin = _ref.plugin;
364
458
  plugin({
365
459
  cldImage: cldImage,
366
460
  options: options,
@@ -370,19 +464,31 @@ function cloudinaryLoader(options, cldOptions) {
370
464
  return cldImage.format(format).delivery("q_" + quality).toURL();
371
465
  }
372
466
 
373
- var options = ['crop', 'gravity', 'overlays', 'removeBackground', 'tint', 'underlays'];
467
+ var options = [];
374
468
 
375
469
  var CldImage = function CldImage(props) {
376
- // Construct the base Image component props by filtering out Cloudinary-specific props
470
+ var CLD_OPTIONS = [].concat(options);
471
+ transformationPlugins.forEach(function (_ref) {
472
+ var _ref$options = _ref.options,
473
+ options = _ref$options === void 0 ? [] : _ref$options;
474
+ options.forEach(function (option) {
475
+ if (CLD_OPTIONS.includes(option)) {
476
+ throw new Error("Option " + option + " already exists!");
477
+ }
478
+
479
+ CLD_OPTIONS.push(option);
480
+ });
481
+ }); // Construct the base Image component props by filtering out Cloudinary-specific props
482
+
377
483
  var imageProps = {};
378
484
  Object.keys(props).filter(function (key) {
379
- return !options.includes(key);
485
+ return !CLD_OPTIONS.includes(key);
380
486
  }).forEach(function (key) {
381
487
  return imageProps[key] = props[key];
382
488
  }); // Construct Cloudinary-specific props by looking for values for any of the supported prop keys
383
489
 
384
490
  var cldOptions = {};
385
- options.forEach(function (key) {
491
+ CLD_OPTIONS.forEach(function (key) {
386
492
  if (props[key]) {
387
493
  cldOptions[key] = props[key];
388
494
  }