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.
- package/dist/next-cloudinary.js +233 -92
- package/dist/next-cloudinary.js.map +1 -1
- package/dist/next-cloudinary.modern.mjs +234 -83
- package/dist/next-cloudinary.modern.mjs.map +1 -1
- package/dist/next-cloudinary.module.js +233 -92
- package/dist/next-cloudinary.module.js.map +1 -1
- package/dist/next-cloudinary.umd.js +233 -92
- package/dist/next-cloudinary.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -34,7 +34,78 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
34
34
|
return target;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
const cld$1 = new Cloudinary({
|
|
38
|
+
cloud: {
|
|
39
|
+
cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
|
|
40
|
+
},
|
|
41
|
+
url: {
|
|
42
|
+
// Used to avoid issues with SSR particularly for the blurred placeholder
|
|
43
|
+
analytics: false
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* createPlaceholderUrl
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
function createPlaceholderUrl({
|
|
51
|
+
src,
|
|
52
|
+
placeholder
|
|
53
|
+
}) {
|
|
54
|
+
const cldImage = cld$1.image(src).resize('c_limit,w_100').delivery('q_1').format('auto');
|
|
55
|
+
|
|
56
|
+
if (placeholder === 'grayscale') {
|
|
57
|
+
cldImage.effect('e_grayscale');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (placeholder.includes('color:')) {
|
|
61
|
+
const color = placeholder.split(':').splice(1).join(':');
|
|
62
|
+
cldImage.effect('e_grayscale');
|
|
63
|
+
cldImage.effect(`e_colorize:60,co_${color}`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return cldImage.toURL();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const cropsGravityAuto = ['crop', 'fill', 'lfill', 'fill_pad', 'thumb'];
|
|
70
|
+
function croppingPlugin({
|
|
71
|
+
cldImage,
|
|
72
|
+
options,
|
|
73
|
+
cldOptions
|
|
74
|
+
} = {}) {
|
|
75
|
+
const {
|
|
76
|
+
width,
|
|
77
|
+
height
|
|
78
|
+
} = options;
|
|
79
|
+
const {
|
|
80
|
+
crop = 'limit',
|
|
81
|
+
gravity
|
|
82
|
+
} = cldOptions;
|
|
83
|
+
let transformationString = `c_${crop},w_${width}`;
|
|
84
|
+
|
|
85
|
+
if (!gravity && cropsGravityAuto.includes(crop)) {
|
|
86
|
+
gravity = 'auto';
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (!['limit'].includes(crop)) {
|
|
90
|
+
transformationString = `${transformationString},h_${height}`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (gravity) {
|
|
94
|
+
if (gravity === 'auto' && !cropsGravityAuto.includes(crop)) {
|
|
95
|
+
console.warn('Auto gravity can only be used with crop, fill, lfill, fill_pad or thumb. Not applying gravity.');
|
|
96
|
+
} else {
|
|
97
|
+
transformationString = `${transformationString},g_${gravity}`;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
cldImage.resize(transformationString);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// aspectRatio
|
|
37
105
|
const primary = {
|
|
106
|
+
aspectRatio: {
|
|
107
|
+
qualifier: 'ar'
|
|
108
|
+
},
|
|
38
109
|
crop: {
|
|
39
110
|
qualifier: 'c'
|
|
40
111
|
},
|
|
@@ -84,45 +155,20 @@ const text = {
|
|
|
84
155
|
}
|
|
85
156
|
};
|
|
86
157
|
|
|
87
|
-
const _excluded$1 = ["publicId", "
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
})
|
|
93
|
-
function cloudinaryLoader(options, cldOptions) {
|
|
158
|
+
const _excluded$1 = ["publicId", "position", "text", "effects"];
|
|
159
|
+
function overlaysPlugin({
|
|
160
|
+
cldImage,
|
|
161
|
+
options,
|
|
162
|
+
cldOptions
|
|
163
|
+
} = {}) {
|
|
94
164
|
const {
|
|
95
|
-
|
|
96
|
-
width,
|
|
97
|
-
format = 'auto',
|
|
98
|
-
quality = 'auto'
|
|
99
|
-
} = options;
|
|
100
|
-
const {
|
|
101
|
-
overlays = [],
|
|
102
|
-
effects = [],
|
|
103
|
-
removeBackground = false,
|
|
104
|
-
underlays = []
|
|
165
|
+
overlays = []
|
|
105
166
|
} = cldOptions;
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
cldImage.effect('e_background_removal');
|
|
110
|
-
} // Adding overlays and underlays allows you to compose your image
|
|
111
|
-
// by using layering with overlays appearing on top of and udnerlays
|
|
112
|
-
// appearing below your base image layer
|
|
113
|
-
//
|
|
114
|
-
// Learn more: https://cloudinary.com/documentation/layers
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const layers = [...overlays.map(overlay => _extends({}, overlay, {
|
|
118
|
-
type: 'overlay'
|
|
119
|
-
})), ...underlays.map(underlay => _extends({}, underlay, {
|
|
120
|
-
type: 'underlay'
|
|
121
|
-
}))];
|
|
122
|
-
layers.forEach(_ref => {
|
|
167
|
+
const type = 'overlay';
|
|
168
|
+
const typeQualifier = 'l';
|
|
169
|
+
overlays.forEach(_ref => {
|
|
123
170
|
let {
|
|
124
171
|
publicId,
|
|
125
|
-
type,
|
|
126
172
|
position: position$1,
|
|
127
173
|
text: text$1,
|
|
128
174
|
effects: layerEffects = []
|
|
@@ -134,17 +180,8 @@ function cloudinaryLoader(options, cldOptions) {
|
|
|
134
180
|
const hasPosition = typeof position$1 === 'object';
|
|
135
181
|
|
|
136
182
|
if (!hasPublicId && !hasText) {
|
|
137
|
-
console.warn(
|
|
183
|
+
console.warn(`An ${type} is missing Public ID or Text`);
|
|
138
184
|
return;
|
|
139
|
-
} // Determine the qualifier for the type of layer
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
let typeQualifier;
|
|
143
|
-
|
|
144
|
-
if (type === 'overlay') {
|
|
145
|
-
typeQualifier = 'l';
|
|
146
|
-
} else if (type === 'underlay') {
|
|
147
|
-
typeQualifier = 'u';
|
|
148
185
|
} // Start to construct the transformation string using text or the public ID
|
|
149
186
|
// if it's image-based
|
|
150
187
|
|
|
@@ -221,60 +258,174 @@ function cloudinaryLoader(options, cldOptions) {
|
|
|
221
258
|
|
|
222
259
|
cldImage.addTransformation(layerTransformation);
|
|
223
260
|
});
|
|
224
|
-
return cldImage.resize(`c_limit,w_${width}`).format(format).delivery(`q_${quality}`).toURL();
|
|
225
261
|
}
|
|
226
262
|
|
|
227
|
-
|
|
263
|
+
function removeBackgroundPlugin({
|
|
264
|
+
cldImage,
|
|
265
|
+
options,
|
|
266
|
+
cldOptions
|
|
267
|
+
} = {}) {
|
|
268
|
+
const {
|
|
269
|
+
removeBackground = false
|
|
270
|
+
} = cldOptions;
|
|
271
|
+
|
|
272
|
+
if (removeBackground) {
|
|
273
|
+
cldImage.effect('e_background_removal');
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function tintPlugin({
|
|
278
|
+
cldImage,
|
|
279
|
+
options,
|
|
280
|
+
cldOptions
|
|
281
|
+
} = {}) {
|
|
282
|
+
const {
|
|
283
|
+
tint
|
|
284
|
+
} = cldOptions;
|
|
285
|
+
|
|
286
|
+
if (tint) {
|
|
287
|
+
cldImage.effect(`e_tint:${tint}`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const _excluded = ["publicId", "type", "position", "text", "effects"];
|
|
292
|
+
function underlaysPlugin({
|
|
293
|
+
cldImage,
|
|
294
|
+
options,
|
|
295
|
+
cldOptions
|
|
296
|
+
} = {}) {
|
|
297
|
+
const {
|
|
298
|
+
underlays = []
|
|
299
|
+
} = cldOptions;
|
|
300
|
+
const typeQualifier = 'u';
|
|
301
|
+
underlays.forEach(_ref => {
|
|
302
|
+
let {
|
|
303
|
+
publicId,
|
|
304
|
+
type,
|
|
305
|
+
position: position$1,
|
|
306
|
+
effects: layerEffects = []
|
|
307
|
+
} = _ref,
|
|
308
|
+
options = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
309
|
+
|
|
310
|
+
const hasPublicId = typeof publicId === 'string';
|
|
311
|
+
const hasPosition = typeof position$1 === 'object';
|
|
312
|
+
|
|
313
|
+
if (!hasPublicId) {
|
|
314
|
+
console.warn(`An ${type} is missing a Public ID`);
|
|
315
|
+
return;
|
|
316
|
+
} // Start to construct the transformation string using text or the public ID
|
|
317
|
+
// if it's image-based
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
let layerTransformation = `${typeQualifier}_${publicId.replace(/\//g, ':')}`; // Begin organizing transformations based on what it is and the location
|
|
321
|
+
// it needs to be placed in the URL
|
|
322
|
+
|
|
323
|
+
const primary$1 = [];
|
|
324
|
+
const applied = []; // Gemeral options
|
|
325
|
+
|
|
326
|
+
Object.keys(options).forEach(key => {
|
|
327
|
+
if (!primary[key]) return;
|
|
328
|
+
const {
|
|
329
|
+
qualifier
|
|
330
|
+
} = primary[key];
|
|
331
|
+
primary$1.push(`${qualifier}_${options[key]}`);
|
|
332
|
+
}); // Layer effects
|
|
333
|
+
|
|
334
|
+
layerEffects.forEach(effect => {
|
|
335
|
+
Object.keys(effect).forEach(key => {
|
|
336
|
+
if (!primary[key]) return;
|
|
337
|
+
const {
|
|
338
|
+
qualifier
|
|
339
|
+
} = primary[key];
|
|
340
|
+
primary$1.push(`${qualifier}_${effect[key]}`);
|
|
341
|
+
});
|
|
342
|
+
}); // Positioning
|
|
343
|
+
|
|
344
|
+
if (hasPosition) {
|
|
345
|
+
Object.keys(position$1).forEach(key => {
|
|
346
|
+
if (!position[key]) return;
|
|
347
|
+
const {
|
|
348
|
+
qualifier
|
|
349
|
+
} = position[key];
|
|
350
|
+
applied.push(`${qualifier}_${position$1[key]}`);
|
|
351
|
+
});
|
|
352
|
+
} // Add all primary transformations
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
layerTransformation = `${layerTransformation},${primary$1.join(',')}`; // Add all applied transformations
|
|
356
|
+
|
|
357
|
+
layerTransformation = `${layerTransformation}/fl_layer_apply`;
|
|
358
|
+
|
|
359
|
+
if (applied.length > 0) {
|
|
360
|
+
layerTransformation = `${layerTransformation},${applied.join(',')}`;
|
|
361
|
+
} // Finally add it to the image
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
cldImage.addTransformation(layerTransformation);
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
|
|
228
368
|
const cld = new Cloudinary({
|
|
229
369
|
cloud: {
|
|
230
370
|
cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
|
|
231
|
-
},
|
|
232
|
-
url: {
|
|
233
|
-
// Used to avoid issues with SSR particularly for the blurred placeholder
|
|
234
|
-
analytics: false
|
|
235
371
|
}
|
|
236
372
|
});
|
|
373
|
+
const transformationPlugins = [removeBackgroundPlugin, // Background Removal must always come first
|
|
374
|
+
croppingPlugin, tintPlugin, overlaysPlugin, underlaysPlugin];
|
|
375
|
+
function cloudinaryLoader(options, cldOptions) {
|
|
376
|
+
const {
|
|
377
|
+
src,
|
|
378
|
+
width,
|
|
379
|
+
format = 'auto',
|
|
380
|
+
quality = 'auto'
|
|
381
|
+
} = options;
|
|
382
|
+
const cldImage = cld.image(src);
|
|
383
|
+
transformationPlugins.forEach(plugin => {
|
|
384
|
+
plugin({
|
|
385
|
+
cldImage,
|
|
386
|
+
options,
|
|
387
|
+
cldOptions
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
return cldImage.format(format).delivery(`q_${quality}`).toURL();
|
|
391
|
+
}
|
|
237
392
|
|
|
238
|
-
const
|
|
239
|
-
let {
|
|
240
|
-
overlays,
|
|
241
|
-
removeBackground,
|
|
242
|
-
underlays
|
|
243
|
-
} = _ref,
|
|
244
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
245
|
-
|
|
246
|
-
const cldOptions = {
|
|
247
|
-
overlays,
|
|
248
|
-
removeBackground,
|
|
249
|
-
underlays
|
|
250
|
-
};
|
|
251
|
-
const imageProps = {}; // If we see a placeholder option, configure a Cloudinary-based URL.
|
|
252
|
-
// The resulting image will always be blurred per Next.js, so we're
|
|
253
|
-
// limited on options for placeholders.
|
|
254
|
-
// https://nextjs.org/docs/api-reference/next/image#blurdataurl
|
|
255
|
-
|
|
256
|
-
if (props.placeholder) {
|
|
257
|
-
const cldBlurredImage = cld.image(props.src).resize('c_limit,w_100').delivery('q_1').format('auto');
|
|
393
|
+
const options = ['crop', 'gravity', 'overlays', 'removeBackground', 'tint', 'underlays'];
|
|
258
394
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
395
|
+
const CldImage = props => {
|
|
396
|
+
// Construct the base Image component props by filtering out Cloudinary-specific props
|
|
397
|
+
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
|
|
262
399
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
400
|
+
const cldOptions = {};
|
|
401
|
+
options.forEach(key => {
|
|
402
|
+
if (props[key]) {
|
|
403
|
+
cldOptions[key] = props[key];
|
|
267
404
|
}
|
|
405
|
+
}); // If we see a placeholder option, configure a Cloudinary-based URL.
|
|
406
|
+
// The resulting image will always be blurred per Next.js, so we're
|
|
407
|
+
// limited on options for placeholders.
|
|
408
|
+
//
|
|
409
|
+
// We need to do this logic here as we potentially need to mutate
|
|
410
|
+
// an Image component prop as opposed to simply the URL
|
|
411
|
+
//
|
|
412
|
+
// https://nextjs.org/docs/api-reference/next/image#blurdataurl
|
|
268
413
|
|
|
269
|
-
|
|
414
|
+
if (imageProps.placeholder) {
|
|
415
|
+
imageProps.blurDataURL = createPlaceholderUrl({
|
|
416
|
+
src: props.src,
|
|
417
|
+
placeholder: props.placeholder
|
|
418
|
+
});
|
|
270
419
|
|
|
271
|
-
if (
|
|
272
|
-
|
|
420
|
+
if (imageProps.placeholder !== 'blur') {
|
|
421
|
+
imageProps.placeholder = 'blur';
|
|
273
422
|
}
|
|
274
423
|
}
|
|
275
424
|
|
|
276
|
-
return /*#__PURE__*/jsx(Image, _extends({}, imageProps,
|
|
277
|
-
loader: options => cloudinaryLoader(
|
|
425
|
+
return /*#__PURE__*/jsx(Image, _extends({}, imageProps, {
|
|
426
|
+
loader: options => cloudinaryLoader(_extends({}, imageProps, {
|
|
427
|
+
options
|
|
428
|
+
}), cldOptions)
|
|
278
429
|
}));
|
|
279
430
|
};
|
|
280
431
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-cloudinary.modern.mjs","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","effects","removeBackground","underlays","cldImage","image","effect","layers","map","overlay","type","underlay","forEach","publicId","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAMA,OAAO,GAAG;AACrBC,EAAAA,IAAI,EAAE;AACJC,IAAAA,SAAS,EAAE,GAAA;GAFQ;AAIrBC,EAAAA,OAAO,EAAE;AACPD,IAAAA,SAAS,EAAE,GAAA;GALQ;AAOrBE,EAAAA,MAAM,EAAE;AACNF,IAAAA,SAAS,EAAE,GAAA;GARQ;AAUrBG,EAAAA,KAAK,EAAE;AACLH,IAAAA,SAAS,EAAE,GAAA;AADN,GAAA;AAVc,EAAhB;AAeA,MAAMI,QAAQ,GAAG;AACtBC,EAAAA,KAAK,EAAE;AACLL,IAAAA,SAAS,EAAE,GAAA;GAFS;AAItBC,EAAAA,OAAO,EAAE;AACPD,IAAAA,SAAS,EAAE,GAAA;GALS;AAOtBM,EAAAA,CAAC,EAAE;AACDN,IAAAA,SAAS,EAAE,GAAA;GARS;AAUtBO,EAAAA,CAAC,EAAE;AACDP,IAAAA,SAAS,EAAE,GAAA;AADV,GAAA;AAVm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;IACvB,MAAMC,eAAe,GAAG1D,GAAG,CAACkB,KAAJ,CAAUqC,KAAK,CAAC7C,GAAhB,CAAA,CACKuC,MADL,CACY,eADZ,EAEKC,QAFL,CAEc,KAFd,CAGKvC,CAAAA,MAHL,CAGY,MAHZ,CAAxB,CAAA;;AAKA,IAAA,IAAK4C,KAAK,CAACE,WAAN,KAAsB,WAA3B,EAAyC;MACvCC,eAAe,CAACvC,MAAhB,CAAuB,aAAvB,CAAA,CAAA;AACD,KAAA;;IAED,IAAKoC,KAAK,CAACE,WAAN,CAAkBE,QAAlB,CAA2B,QAA3B,CAAL,EAA4C;AAC1C,MAAA,MAAMlE,KAAK,GAAG8D,KAAK,CAACE,WAAN,CAAkBG,KAAlB,CAAwB,GAAxB,CAAA,CAA6BC,MAA7B,CAAoC,CAApC,EAAuChB,IAAvC,CAA4C,GAA5C,CAAd,CAAA;MACAa,eAAe,CAACvC,MAAhB,CAAuB,aAAvB,CAAA,CAAA;AACAuC,MAAAA,eAAe,CAACvC,MAAhB,CAAwB,CAAA,iBAAA,EAAmB1B,KAAM,CAAjD,CAAA,CAAA,CAAA;AACD,KAAA;;AAED+D,IAAAA,UAAU,CAACM,WAAX,GAAyBJ,eAAe,CAACP,KAAhB,EAAzB,CAAA;;AAEA,IAAA,IAAKI,KAAK,CAACE,WAAN,KAAsB,MAA3B,EAAoC;MAClCF,KAAK,CAACE,WAAN,GAAoB,MAApB,CAAA;AACD,KAAA;AACF,GAAA;;AAED,EAAA,oBACEM,GAAC,CAAA,KAAD,EACMP,QAAAA,CAAAA,EAAAA,EAAAA,UADN,EAEMD,KAFN,EAAA;AAGE,IAAA,MAAM,EAAG/C,OAAD,IAAaD,gBAAgB,CAACC,OAAD,EAAUC,UAAV,CAAA;GAJzC,CAAA,CAAA,CAAA;AAOD;;;;"}
|
|
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 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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