next-cloudinary 0.0.3 → 0.0.6

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.
@@ -39,7 +39,79 @@
39
39
  return target;
40
40
  }
41
41
 
42
+ function _readOnlyError(name) {
43
+ throw new TypeError("\"" + name + "\" is read-only");
44
+ }
45
+
46
+ var cld$1 = new urlGen.Cloudinary({
47
+ cloud: {
48
+ cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
49
+ },
50
+ url: {
51
+ // Used to avoid issues with SSR particularly for the blurred placeholder
52
+ analytics: false
53
+ }
54
+ });
55
+ /**
56
+ * createPlaceholderUrl
57
+ */
58
+
59
+ function createPlaceholderUrl(_ref) {
60
+ var src = _ref.src,
61
+ placeholder = _ref.placeholder;
62
+ var cldImage = cld$1.image(src).resize('c_limit,w_100').delivery('q_1').format('auto');
63
+
64
+ if (placeholder === 'grayscale') {
65
+ cldImage.effect('e_grayscale');
66
+ }
67
+
68
+ if (placeholder.includes('color:')) {
69
+ var color = placeholder.split(':').splice(1).join(':');
70
+ cldImage.effect('e_grayscale');
71
+ cldImage.effect("e_colorize:60,co_" + color);
72
+ }
73
+
74
+ return cldImage.toURL();
75
+ }
76
+
77
+ var cropsGravityAuto = ['crop', 'fill', 'lfill', 'fill_pad', 'thumb'];
78
+ function croppingPlugin(_temp) {
79
+ var _ref = _temp === void 0 ? {} : _temp,
80
+ cldImage = _ref.cldImage,
81
+ options = _ref.options,
82
+ cldOptions = _ref.cldOptions;
83
+
84
+ var width = options.width,
85
+ height = options.height;
86
+ var _cldOptions$crop = cldOptions.crop,
87
+ crop = _cldOptions$crop === void 0 ? 'limit' : _cldOptions$crop,
88
+ gravity = cldOptions.gravity;
89
+ var transformationString = "c_" + crop + ",w_" + width;
90
+
91
+ if (!gravity && cropsGravityAuto.includes(crop)) {
92
+ _readOnlyError("gravity");
93
+ }
94
+
95
+ if (!['limit'].includes(crop)) {
96
+ transformationString = transformationString + ",h_" + height;
97
+ }
98
+
99
+ if (gravity) {
100
+ if (gravity === 'auto' && !cropsGravityAuto.includes(crop)) {
101
+ console.warn('Auto gravity can only be used with crop, fill, lfill, fill_pad or thumb. Not applying gravity.');
102
+ } else {
103
+ transformationString = transformationString + ",g_" + gravity;
104
+ }
105
+ }
106
+
107
+ cldImage.resize(transformationString);
108
+ }
109
+
110
+ // aspectRatio
42
111
  var primary = {
112
+ aspectRatio: {
113
+ qualifier: 'ar'
114
+ },
43
115
  crop: {
44
116
  qualifier: 'c'
45
117
  },
@@ -89,70 +161,31 @@
89
161
  }
90
162
  };
91
163
 
92
- var _excluded$1 = ["publicId", "type", "position", "text", "effects"];
93
- var cld$1 = new urlGen.Cloudinary({
94
- cloud: {
95
- cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
96
- }
97
- });
98
- function cloudinaryLoader(options, cldOptions) {
99
- var src = options.src,
100
- width = options.width,
101
- _options$format = options.format,
102
- format = _options$format === void 0 ? 'auto' : _options$format,
103
- _options$quality = options.quality,
104
- quality = _options$quality === void 0 ? 'auto' : _options$quality;
105
- var _cldOptions$overlays = cldOptions.overlays,
106
- overlays = _cldOptions$overlays === void 0 ? [] : _cldOptions$overlays,
107
- _cldOptions$removeBac = cldOptions.removeBackground,
108
- removeBackground = _cldOptions$removeBac === void 0 ? false : _cldOptions$removeBac,
109
- _cldOptions$underlays = cldOptions.underlays,
110
- underlays = _cldOptions$underlays === void 0 ? [] : _cldOptions$underlays;
111
- var cldImage = cld$1.image(src);
112
-
113
- if (removeBackground) {
114
- cldImage.effect('e_background_removal');
115
- } // Adding overlays and underlays allows you to compose your image
116
- // by using layering with overlays appearing on top of and udnerlays
117
- // appearing below your base image layer
118
- //
119
- // Learn more: https://cloudinary.com/documentation/layers
120
-
164
+ var _excluded$1 = ["publicId", "position", "text", "effects"];
165
+ function overlaysPlugin(_temp) {
166
+ var _ref = _temp === void 0 ? {} : _temp,
167
+ cldImage = _ref.cldImage,
168
+ cldOptions = _ref.cldOptions;
121
169
 
122
- var layers = [].concat(overlays.map(function (overlay) {
123
- return _extends({}, overlay, {
124
- type: 'overlay'
125
- });
126
- }), underlays.map(function (underlay) {
127
- return _extends({}, underlay, {
128
- type: 'underlay'
129
- });
130
- }));
131
- layers.forEach(function (_ref) {
132
- var publicId = _ref.publicId,
133
- type = _ref.type,
134
- position$1 = _ref.position,
135
- text$1 = _ref.text,
136
- _ref$effects = _ref.effects,
137
- layerEffects = _ref$effects === void 0 ? [] : _ref$effects,
138
- options = _objectWithoutPropertiesLoose(_ref, _excluded$1);
170
+ var _cldOptions$overlays = cldOptions.overlays,
171
+ overlays = _cldOptions$overlays === void 0 ? [] : _cldOptions$overlays;
172
+ var type = 'overlay';
173
+ var typeQualifier = 'l';
174
+ overlays.forEach(function (_ref2) {
175
+ var publicId = _ref2.publicId,
176
+ position$1 = _ref2.position,
177
+ text$1 = _ref2.text,
178
+ _ref2$effects = _ref2.effects,
179
+ layerEffects = _ref2$effects === void 0 ? [] : _ref2$effects,
180
+ options = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
139
181
 
140
182
  var hasPublicId = typeof publicId === 'string';
141
183
  var hasText = typeof text$1 === 'object';
142
184
  var hasPosition = typeof position$1 === 'object';
143
185
 
144
186
  if (!hasPublicId && !hasText) {
145
- console.warn(type + " is missing Public ID or Text");
187
+ console.warn("An " + type + " is missing Public ID or Text");
146
188
  return;
147
- } // Determine the qualifier for the type of layer
148
-
149
-
150
- var typeQualifier;
151
-
152
- if (type === 'overlay') {
153
- typeQualifier = 'l';
154
- } else if (type === 'underlay') {
155
- typeQualifier = 'u';
156
189
  } // Start to construct the transformation string using text or the public ID
157
190
  // if it's image-based
158
191
 
@@ -222,59 +255,167 @@
222
255
 
223
256
  cldImage.addTransformation(layerTransformation);
224
257
  });
225
- return cldImage.resize("c_limit,w_" + width).format(format).delivery("q_" + quality).toURL();
226
258
  }
227
259
 
228
- var _excluded = ["overlays", "removeBackground", "underlays"];
260
+ function removeBackgroundPlugin(_temp) {
261
+ var _ref = _temp === void 0 ? {} : _temp,
262
+ cldImage = _ref.cldImage,
263
+ cldOptions = _ref.cldOptions;
264
+
265
+ var _cldOptions$removeBac = cldOptions.removeBackground,
266
+ removeBackground = _cldOptions$removeBac === void 0 ? false : _cldOptions$removeBac;
267
+
268
+ if (removeBackground) {
269
+ cldImage.effect('e_background_removal');
270
+ }
271
+ }
272
+
273
+ function tintPlugin(_temp) {
274
+ var _ref = _temp === void 0 ? {} : _temp,
275
+ cldImage = _ref.cldImage,
276
+ cldOptions = _ref.cldOptions;
277
+
278
+ var tint = cldOptions.tint;
279
+
280
+ if (tint) {
281
+ cldImage.effect("e_tint:" + tint);
282
+ }
283
+ }
284
+
285
+ var _excluded = ["publicId", "type", "position", "text", "effects"];
286
+ function underlaysPlugin(_temp) {
287
+ var _ref = _temp === void 0 ? {} : _temp,
288
+ cldImage = _ref.cldImage,
289
+ cldOptions = _ref.cldOptions;
290
+
291
+ var _cldOptions$underlays = cldOptions.underlays,
292
+ underlays = _cldOptions$underlays === void 0 ? [] : _cldOptions$underlays;
293
+ var typeQualifier = 'u';
294
+ underlays.forEach(function (_ref2) {
295
+ var publicId = _ref2.publicId,
296
+ type = _ref2.type,
297
+ position$1 = _ref2.position,
298
+ _ref2$effects = _ref2.effects,
299
+ layerEffects = _ref2$effects === void 0 ? [] : _ref2$effects,
300
+ options = _objectWithoutPropertiesLoose(_ref2, _excluded);
301
+
302
+ var hasPublicId = typeof publicId === 'string';
303
+ var hasPosition = typeof position$1 === 'object';
304
+
305
+ if (!hasPublicId) {
306
+ console.warn("An " + type + " is missing a Public ID");
307
+ return;
308
+ } // Start to construct the transformation string using text or the public ID
309
+ // if it's image-based
310
+
311
+
312
+ var layerTransformation = typeQualifier + "_" + publicId.replace(/\//g, ':'); // Begin organizing transformations based on what it is and the location
313
+ // it needs to be placed in the URL
314
+
315
+ var primary$1 = [];
316
+ var applied = []; // Gemeral options
317
+
318
+ Object.keys(options).forEach(function (key) {
319
+ if (!primary[key]) return;
320
+ var qualifier = primary[key].qualifier;
321
+ primary$1.push(qualifier + "_" + options[key]);
322
+ }); // Layer effects
323
+
324
+ layerEffects.forEach(function (effect) {
325
+ Object.keys(effect).forEach(function (key) {
326
+ if (!primary[key]) return;
327
+ var qualifier = primary[key].qualifier;
328
+ primary$1.push(qualifier + "_" + effect[key]);
329
+ });
330
+ }); // Positioning
331
+
332
+ if (hasPosition) {
333
+ Object.keys(position$1).forEach(function (key) {
334
+ if (!position[key]) return;
335
+ var qualifier = position[key].qualifier;
336
+ applied.push(qualifier + "_" + position$1[key]);
337
+ });
338
+ } // Add all primary transformations
339
+
340
+
341
+ layerTransformation = layerTransformation + "," + primary$1.join(','); // Add all applied transformations
342
+
343
+ layerTransformation = layerTransformation + "/fl_layer_apply";
344
+
345
+ if (applied.length > 0) {
346
+ layerTransformation = layerTransformation + "," + applied.join(',');
347
+ } // Finally add it to the image
348
+
349
+
350
+ cldImage.addTransformation(layerTransformation);
351
+ });
352
+ }
353
+
229
354
  var cld = new urlGen.Cloudinary({
230
355
  cloud: {
231
356
  cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
232
- },
233
- url: {
234
- // Used to avoid issues with SSR particularly for the blurred placeholder
235
- analytics: false
236
357
  }
237
358
  });
359
+ var transformationPlugins = [removeBackgroundPlugin, // Background Removal must always come first
360
+ croppingPlugin, tintPlugin, overlaysPlugin, underlaysPlugin];
361
+ function cloudinaryLoader(options, cldOptions) {
362
+ var src = options.src,
363
+ _options$format = options.format,
364
+ format = _options$format === void 0 ? 'auto' : _options$format,
365
+ _options$quality = options.quality,
366
+ quality = _options$quality === void 0 ? 'auto' : _options$quality;
367
+ var cldImage = cld.image(src);
368
+ transformationPlugins.forEach(function (plugin) {
369
+ plugin({
370
+ cldImage: cldImage,
371
+ options: options,
372
+ cldOptions: cldOptions
373
+ });
374
+ });
375
+ return cldImage.format(format).delivery("q_" + quality).toURL();
376
+ }
238
377
 
239
- var CldImage = function CldImage(_ref) {
240
- var overlays = _ref.overlays,
241
- removeBackground = _ref.removeBackground,
242
- underlays = _ref.underlays,
243
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
244
-
245
- var cldOptions = {
246
- overlays: overlays,
247
- removeBackground: removeBackground,
248
- underlays: underlays
249
- };
250
- var imageProps = {}; // If we see a placeholder option, configure a Cloudinary-based URL.
378
+ var options = ['crop', 'gravity', 'overlays', 'removeBackground', 'tint', 'underlays'];
379
+
380
+ var CldImage = function CldImage(props) {
381
+ // Construct the base Image component props by filtering out Cloudinary-specific props
382
+ var imageProps = {};
383
+ Object.keys(props).filter(function (key) {
384
+ return !options.includes(key);
385
+ }).forEach(function (key) {
386
+ return imageProps[key] = props[key];
387
+ }); // Construct Cloudinary-specific props by looking for values for any of the supported prop keys
388
+
389
+ var cldOptions = {};
390
+ options.forEach(function (key) {
391
+ if (props[key]) {
392
+ cldOptions[key] = props[key];
393
+ }
394
+ }); // If we see a placeholder option, configure a Cloudinary-based URL.
251
395
  // The resulting image will always be blurred per Next.js, so we're
252
396
  // limited on options for placeholders.
397
+ //
398
+ // We need to do this logic here as we potentially need to mutate
399
+ // an Image component prop as opposed to simply the URL
400
+ //
253
401
  // https://nextjs.org/docs/api-reference/next/image#blurdataurl
254
402
 
255
- if (props.placeholder) {
256
- var cldBlurredImage = cld.image(props.src).resize('c_limit,w_100').delivery('q_1').format('auto');
257
-
258
- if (props.placeholder === 'grayscale') {
259
- cldBlurredImage.effect('e_grayscale');
260
- }
261
-
262
- if (props.placeholder.includes('color:')) {
263
- var color = props.placeholder.split(':').splice(1).join(':');
264
- cldBlurredImage.effect('e_grayscale');
265
- cldBlurredImage.effect("e_colorize:60,co_" + color);
266
- }
267
-
268
- imageProps.blurDataURL = cldBlurredImage.toURL();
403
+ if (imageProps.placeholder) {
404
+ imageProps.blurDataURL = createPlaceholderUrl({
405
+ src: props.src,
406
+ placeholder: props.placeholder
407
+ });
269
408
 
270
- if (props.placeholder !== 'blur') {
271
- props.placeholder = 'blur';
409
+ if (imageProps.placeholder !== 'blur') {
410
+ imageProps.placeholder = 'blur';
272
411
  }
273
412
  }
274
413
 
275
- return /*#__PURE__*/jsxRuntime.jsx(Image__default["default"], _extends({}, imageProps, props, {
414
+ return /*#__PURE__*/jsxRuntime.jsx(Image__default["default"], _extends({}, imageProps, {
276
415
  loader: function loader(options) {
277
- return cloudinaryLoader(options, cldOptions);
416
+ return cloudinaryLoader(_extends({}, imageProps, {
417
+ options: options
418
+ }), cldOptions);
278
419
  }
279
420
  }));
280
421
  };
@@ -1 +1 @@
1
- {"version":3,"file":"next-cloudinary.umd.js","sources":["../src/constants/qualifiers.js","../src/loaders/cloudinary-loader.js","../src/components/CldImage/CldImage.js"],"sourcesContent":["export const primary = {\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 textDecoration: {\n qualifier: false\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}","import { Cloudinary } from '@cloudinary/url-gen';\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 function cloudinaryLoader(options, cldOptions) {\n const {\n src,\n width,\n format = 'auto',\n quality = 'auto',\n } = options;\n\n const {\n overlays = [],\n effects = [],\n removeBackground = false,\n underlays = []\n } = cldOptions;\n\n const cldImage = cld.image(src);\n\n if ( removeBackground ) {\n cldImage.effect('e_background_removal');\n }\n\n // Adding overlays and underlays allows you to compose your image\n // by using layering with overlays appearing on top of and udnerlays\n // appearing below your base image layer\n //\n // Learn more: https://cloudinary.com/documentation/layers\n\n const layers = [\n ...overlays.map(overlay => ({ ...overlay, type: 'overlay' })),\n ...underlays.map(underlay => ({ ...underlay, type: 'underlay' })),\n ];\n\n layers.forEach(({ publicId, type, 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(`${type} is missing Public ID or Text`);\n return;\n }\n\n // Determine the qualifier for the type of layer\n\n let typeQualifier;\n\n if ( type === 'overlay' ) {\n typeQualifier = 'l';\n } else if ( type === 'underlay' ) {\n typeQualifier = 'u';\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\n return cldImage.resize(`c_limit,w_${width}`).format(format).delivery(`q_${quality}`).toURL();\n}","import Image from 'next/image';\nimport { Cloudinary } from '@cloudinary/url-gen';\n\nimport { cloudinaryLoader } from '../../loaders/cloudinary-loader';\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\nconst CldImage = ({ overlays, removeBackground, underlays, ...props }) => {\n const cldOptions = {\n overlays,\n removeBackground,\n underlays,\n };\n\n const imageProps = {};\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 // https://nextjs.org/docs/api-reference/next/image#blurdataurl\n\n if ( props.placeholder ) {\n const cldBlurredImage = cld.image(props.src)\n .resize('c_limit,w_100')\n .delivery('q_1')\n .format('auto');\n\n if ( props.placeholder === 'grayscale' ) {\n cldBlurredImage.effect('e_grayscale');\n }\n\n if ( props.placeholder.includes('color:') ) {\n const color = props.placeholder.split(':').splice(1).join(':')\n cldBlurredImage.effect('e_grayscale');\n cldBlurredImage.effect(`e_colorize:60,co_${color}`);\n }\n\n imageProps.blurDataURL = cldBlurredImage.toURL();\n\n if ( props.placeholder !== 'blur' ) {\n props.placeholder = 'blur';\n }\n }\n\n return (\n <Image\n {...imageProps}\n {...props}\n loader={(options) => cloudinaryLoader(options, cldOptions)}\n />\n );\n}\n\nexport default CldImage;"],"names":["primary","crop","qualifier","gravity","height","width","position","angle","x","y","text","color","location","textDecoration","fontFamily","fontSize","fontWeight","letterSpacing","cld","Cloudinary","cloud","cloudName","process","env","NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME","cloudinaryLoader","options","cldOptions","src","format","quality","overlays","removeBackground","underlays","cldImage","image","effect","layers","map","overlay","type","underlay","forEach","publicId","effects","layerEffects","_excluded","hasPublicId","hasText","hasPosition","console","warn","typeQualifier","layerTransformation","replace","applied","Object","keys","key","qualifiersPrimary","push","textTransformations","qualifiersText","join","qualifiersPosition","length","addTransformation","resize","delivery","toURL","url","analytics","CldImage","props","imageProps","placeholder","cldBlurredImage","includes","split","splice","blurDataURL","_jsx","Image"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAMA,OAAO,GAAG;EACrBC,EAAAA,IAAI,EAAE;EACJC,IAAAA,SAAS,EAAE,GAAA;KAFQ;EAIrBC,EAAAA,OAAO,EAAE;EACPD,IAAAA,SAAS,EAAE,GAAA;KALQ;EAOrBE,EAAAA,MAAM,EAAE;EACNF,IAAAA,SAAS,EAAE,GAAA;KARQ;EAUrBG,EAAAA,KAAK,EAAE;EACLH,IAAAA,SAAS,EAAE,GAAA;EADN,GAAA;EAVc,EAAhB;AAeA,MAAMI,QAAQ,GAAG;EACtBC,EAAAA,KAAK,EAAE;EACLL,IAAAA,SAAS,EAAE,GAAA;KAFS;EAItBC,EAAAA,OAAO,EAAE;EACPD,IAAAA,SAAS,EAAE,GAAA;KALS;EAOtBM,EAAAA,CAAC,EAAE;EACDN,IAAAA,SAAS,EAAE,GAAA;KARS;EAUtBO,EAAAA,CAAC,EAAE;EACDP,IAAAA,SAAS,EAAE,GAAA;EADV,GAAA;EAVmB,EAAjB;AAeA,MAAMQ,IAAI,GAAG;EAClBC,EAAAA,KAAK,EAAE;EACLT,IAAAA,SAAS,EAAE,IAD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MAAA,OAAaD,gBAAgB,CAACC,OAAD,EAAUC,UAAV,CAA7B,CAAA;EAAA,KAAA;KAJZ,CAAA,CAAA,CAAA;EAOD;;;;;;;;;;;;"}
1
+ {"version":3,"file":"next-cloudinary.umd.js","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 textDecoration: {\n qualifier: false\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}","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];","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","textDecoration","fontFamily","fontSize","fontWeight","letterSpacing","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","Image"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA,IAAMA,KAAG,GAAG,IAAIC,iBAAJ,CAAe;EACzBC,EAAAA,KAAK,EAAE;EACLC,IAAAA,SAAS,EAAEC,OAAO,CAACC,GAAR,CAAYC,iCAAAA;KAFA;EAIzBC,EAAAA,GAAG,EAAE;EACH;EACAC,IAAAA,SAAS,EAAE,KAAA;EAFR,GAAA;EAJoB,CAAf,CAAZ,CAAA;EAUA;EACA;EACA;;EAEO,SAASC,oBAAT,CAAoD,IAAA,EAAA;IAAA,IAApBC,GAAoB,QAApBA,GAAoB;QAAfC,WAAe,QAAfA,WAAe,CAAA;EACzD,EAAA,IAAMC,QAAQ,GAAGZ,KAAG,CAACa,KAAJ,CAAUH,GAAV,CACII,CAAAA,MADJ,CACW,eADX,CAAA,CAEIC,QAFJ,CAEa,KAFb,EAGIC,MAHJ,CAGW,MAHX,CAAjB,CAAA;;IAKA,IAAKL,WAAW,KAAK,WAArB,EAAmC;MACjCC,QAAQ,CAACK,MAAT,CAAgB,aAAhB,CAAA,CAAA;EACD,GAAA;;EAED,EAAA,IAAKN,WAAW,CAACO,QAAZ,CAAqB,QAArB,CAAL,EAAsC;EACpC,IAAA,IAAMC,KAAK,GAAGR,WAAW,CAACS,KAAZ,CAAkB,GAAlB,CAAuBC,CAAAA,MAAvB,CAA8B,CAA9B,CAAA,CAAiCC,IAAjC,CAAsC,GAAtC,CAAd,CAAA;MACAV,QAAQ,CAACK,MAAT,C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,EAAPA,OAAAA;EAAlB,OAAA,CAAA,EAA6BC,UAA7B,CAA7B,CAAA;EAAA,KAAA;KAHZ,CAAA,CAAA,CAAA;EAMD;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-cloudinary",
3
- "version": "0.0.3",
3
+ "version": "0.0.6",
4
4
  "main": "dist/next-cloudinary.umd.js",
5
5
  "module": "dist/next-cloudinary.module.js",
6
6
  "umd:main": "dist/next-cloudinary.umd.js",