next-cloudinary 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -6
- package/babel.config.js +9 -3
- package/dist/next-cloudinary.js +188 -16
- package/dist/next-cloudinary.js.map +1 -1
- package/dist/next-cloudinary.modern.mjs +185 -18
- package/dist/next-cloudinary.modern.mjs.map +1 -1
- package/dist/next-cloudinary.module.js +187 -18
- package/dist/next-cloudinary.module.js.map +1 -1
- package/dist/next-cloudinary.umd.js +190 -20
- package/dist/next-cloudinary.umd.js.map +1 -1
- package/jest.config.js +0 -5
- package/package.json +2 -1
- package/tests/loaders/cloudinary-loader.spec.js +84 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import Image from 'next/image';
|
|
2
2
|
import { Cloudinary } from '@cloudinary/url-gen';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { useRef } from 'react';
|
|
5
|
+
import Script from 'next/script';
|
|
4
6
|
|
|
5
7
|
function _extends() {
|
|
6
8
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -43,6 +45,33 @@ const cld$1 = new Cloudinary({
|
|
|
43
45
|
analytics: false
|
|
44
46
|
}
|
|
45
47
|
});
|
|
48
|
+
/**
|
|
49
|
+
* Retrieves the public id of a cloudiary image url. If no url is recognized it returns the parameter it self.
|
|
50
|
+
* If it's recognized that is a url and it's not possible to get the public id, it warns the user.
|
|
51
|
+
*
|
|
52
|
+
* @param {string} src The cloudiary url or public id.
|
|
53
|
+
*
|
|
54
|
+
* @return {string} The images public id
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
function getPublicId(src) {
|
|
58
|
+
if (src.includes('res.cloudinary.com')) {
|
|
59
|
+
const regexWithTransformations = /(https?)\:\/\/(res.cloudinary.com)\/([^\/]+)\/(image|video|raw)\/(upload|authenticated)\/(.*)\/(v[0-9]+)\/(.+)(?:\.[a-z]{3})?/;
|
|
60
|
+
const regexWithoutTransformations = /(https?)\:\/\/(res.cloudinary.com)\/([^\/]+)\/(image|video|raw)\/(upload|authenticated)\/(v[0-9]+)\/(.+)(?:\.[a-z]{3})?/;
|
|
61
|
+
const withTransformations = src.match(regexWithTransformations);
|
|
62
|
+
const withoutTransformations = src.match(regexWithoutTransformations);
|
|
63
|
+
|
|
64
|
+
if (withTransformations) {
|
|
65
|
+
return withTransformations[withTransformations.length - 1];
|
|
66
|
+
} else if (withoutTransformations) {
|
|
67
|
+
return withoutTransformations[withoutTransformations.length - 1];
|
|
68
|
+
} else {
|
|
69
|
+
console.warn(`Not possible to retrieve the publicUrl from ${src}, make sure it's a valid cloudinary image url.`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return src;
|
|
74
|
+
}
|
|
46
75
|
/**
|
|
47
76
|
* createPlaceholderUrl
|
|
48
77
|
*/
|
|
@@ -235,7 +264,7 @@ const text = {
|
|
|
235
264
|
}
|
|
236
265
|
};
|
|
237
266
|
|
|
238
|
-
const _excluded$
|
|
267
|
+
const _excluded$2 = ["publicId", "position", "text", "effects"];
|
|
239
268
|
const props$4 = ['overlays'];
|
|
240
269
|
function plugin$4({
|
|
241
270
|
cldImage,
|
|
@@ -254,7 +283,7 @@ function plugin$4({
|
|
|
254
283
|
text: text$1,
|
|
255
284
|
effects: layerEffects = []
|
|
256
285
|
} = _ref,
|
|
257
|
-
options = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
286
|
+
options = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
258
287
|
|
|
259
288
|
const hasPublicId = typeof publicId === 'string';
|
|
260
289
|
const hasText = typeof text$1 === 'object';
|
|
@@ -387,7 +416,7 @@ var removeBackgroundPlugin = {
|
|
|
387
416
|
plugin: plugin$2
|
|
388
417
|
};
|
|
389
418
|
|
|
390
|
-
const _excluded = ["publicId", "type", "position", "text", "effects"];
|
|
419
|
+
const _excluded$1 = ["publicId", "type", "position", "text", "effects"];
|
|
391
420
|
const props$1 = ['underlays'];
|
|
392
421
|
function plugin$1({
|
|
393
422
|
cldImage,
|
|
@@ -405,7 +434,7 @@ function plugin$1({
|
|
|
405
434
|
position: position$1,
|
|
406
435
|
effects: layerEffects = []
|
|
407
436
|
} = _ref,
|
|
408
|
-
options = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
437
|
+
options = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
409
438
|
|
|
410
439
|
const hasPublicId = typeof publicId === 'string';
|
|
411
440
|
const hasPosition = typeof position$1 === 'object';
|
|
@@ -526,26 +555,31 @@ var zoompanPlugin = {
|
|
|
526
555
|
plugin: plugin
|
|
527
556
|
};
|
|
528
557
|
|
|
529
|
-
|
|
530
|
-
cloud: {
|
|
531
|
-
cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
|
|
532
|
-
},
|
|
533
|
-
url: {
|
|
534
|
-
// Used to avoid issues with SSR particularly for the blurred placeholder
|
|
535
|
-
analytics: false
|
|
536
|
-
}
|
|
537
|
-
});
|
|
558
|
+
let cld;
|
|
538
559
|
const transformationPlugins = [// Background Removal must always come first
|
|
539
560
|
removeBackgroundPlugin, croppingPlugin, effectsPlugin, overlaysPlugin, underlaysPlugin, zoompanPlugin, // Raw transformations needs to be last simply to make sure
|
|
540
561
|
// it's always expected to applied the same way
|
|
541
562
|
rawTransformationsPlugin];
|
|
542
|
-
function cloudinaryLoader(defaultOptions, cldOptions) {
|
|
563
|
+
function cloudinaryLoader(defaultOptions, cldOptions, cldConfig = {}) {
|
|
564
|
+
if (!cld) {
|
|
565
|
+
cld = new Cloudinary(_extends({
|
|
566
|
+
cloud: {
|
|
567
|
+
cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
|
|
568
|
+
},
|
|
569
|
+
url: {
|
|
570
|
+
// Used to avoid issues with SSR particularly for the blurred placeholder
|
|
571
|
+
analytics: false
|
|
572
|
+
}
|
|
573
|
+
}, cldConfig));
|
|
574
|
+
}
|
|
575
|
+
|
|
543
576
|
const options = _extends({
|
|
544
577
|
format: 'auto',
|
|
545
578
|
quality: 'auto'
|
|
546
579
|
}, defaultOptions);
|
|
547
580
|
|
|
548
|
-
const
|
|
581
|
+
const publicId = getPublicId(options.src);
|
|
582
|
+
const cldImage = cld.image(publicId);
|
|
549
583
|
transformationPlugins.forEach(({
|
|
550
584
|
plugin
|
|
551
585
|
}) => {
|
|
@@ -596,8 +630,9 @@ const CldImage = props => {
|
|
|
596
630
|
// https://nextjs.org/docs/api-reference/next/image#blurdataurl
|
|
597
631
|
|
|
598
632
|
if (imageProps.placeholder) {
|
|
633
|
+
const publicId = getPublicId(props.src);
|
|
599
634
|
imageProps.blurDataURL = createPlaceholderUrl({
|
|
600
|
-
src:
|
|
635
|
+
src: publicId,
|
|
601
636
|
placeholder: props.placeholder
|
|
602
637
|
});
|
|
603
638
|
|
|
@@ -613,5 +648,137 @@ const CldImage = props => {
|
|
|
613
648
|
}));
|
|
614
649
|
};
|
|
615
650
|
|
|
616
|
-
|
|
651
|
+
const CldUploadWidget = ({
|
|
652
|
+
children,
|
|
653
|
+
onUpload,
|
|
654
|
+
options,
|
|
655
|
+
signed,
|
|
656
|
+
signatureEndpoint
|
|
657
|
+
}) => {
|
|
658
|
+
const cloudinary = useRef();
|
|
659
|
+
const widget = useRef();
|
|
660
|
+
/**
|
|
661
|
+
* generateSignature
|
|
662
|
+
* @description Makes a request to an endpoint to sign Cloudinary parameters as part of widget creation
|
|
663
|
+
*/
|
|
664
|
+
|
|
665
|
+
function generateSignature(callback, paramsToSign) {
|
|
666
|
+
fetch(signatureEndpoint, {
|
|
667
|
+
method: "POST",
|
|
668
|
+
body: JSON.stringify({
|
|
669
|
+
paramsToSign
|
|
670
|
+
})
|
|
671
|
+
}).then(r => r.json()).then(({
|
|
672
|
+
signature
|
|
673
|
+
}) => {
|
|
674
|
+
callback(signature);
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* createWidget
|
|
679
|
+
* @description Creates a new instance of the Cloudinary widget and stores in a ref
|
|
680
|
+
*/
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
function createWidget() {
|
|
684
|
+
var _cloudinary$current;
|
|
685
|
+
|
|
686
|
+
// When creating a signed upload, you need to provide both your Cloudinary API Key
|
|
687
|
+
// as well as a signature generator function that will sign any paramters
|
|
688
|
+
// either on page load or during the upload process. Read more about signed uploads at:
|
|
689
|
+
// https://cloudinary.com/documentation/upload_widget#signed_uploads
|
|
690
|
+
const totalOptions = _extends({}, options, !!signed && {
|
|
691
|
+
uploadSignature: generateSignature
|
|
692
|
+
}); // no need for apiSecret because of api/sign-cloudinary-params
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
if (signed && !totalOptions.apiKey) {
|
|
696
|
+
return new Error("Signed Upload needs apiKey!");
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
return (_cloudinary$current = cloudinary.current) == null ? void 0 : _cloudinary$current.createUploadWidget(totalOptions, function (error, result) {
|
|
700
|
+
// The callback is a bit more chatty than failed or success so
|
|
701
|
+
// only trigger when one of those are the case. You can additionally
|
|
702
|
+
// create a separate handler such as onEvent and trigger it on
|
|
703
|
+
// ever occurance
|
|
704
|
+
if (error || result.event === "success") {
|
|
705
|
+
onUpload(error, result, widget == null ? void 0 : widget.current);
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* open
|
|
711
|
+
* @description When triggered, uses the current widget instance to open the upload modal
|
|
712
|
+
*/
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
function open() {
|
|
716
|
+
if (!(widget != null && widget.current)) {
|
|
717
|
+
widget.current = createWidget();
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
(widget == null ? void 0 : widget.current) && widget.current.open();
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* handleOnLoad
|
|
724
|
+
* @description Stores the Cloudinary window instance to a ref when the widget script loads
|
|
725
|
+
*/
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
function handleOnLoad() {
|
|
729
|
+
cloudinary.current = window.cloudinary;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
733
|
+
children: [children({
|
|
734
|
+
cloudinary: cloudinary.current,
|
|
735
|
+
widget: widget.current,
|
|
736
|
+
open
|
|
737
|
+
}), /*#__PURE__*/jsx(Script, {
|
|
738
|
+
id: `cloudinary-${Math.floor(Math.random() * 100)}`,
|
|
739
|
+
src: "https://widget.cloudinary.com/v2.0/global/all.js",
|
|
740
|
+
onLoad: handleOnLoad,
|
|
741
|
+
onError: e => {
|
|
742
|
+
console.error("Script failed to load", e);
|
|
743
|
+
}
|
|
744
|
+
})]
|
|
745
|
+
});
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
const _excluded = ["onUpload", "options", "signed", "label", "children"];
|
|
749
|
+
|
|
750
|
+
const CldUploadButton = _ref => {
|
|
751
|
+
let {
|
|
752
|
+
onUpload,
|
|
753
|
+
options,
|
|
754
|
+
signed,
|
|
755
|
+
children
|
|
756
|
+
} = _ref,
|
|
757
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
758
|
+
|
|
759
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
760
|
+
children: /*#__PURE__*/jsx(CldUploadWidget, {
|
|
761
|
+
signed: signed,
|
|
762
|
+
options: options,
|
|
763
|
+
onUpload: onUpload,
|
|
764
|
+
signatureEndpoint: signed != null ? signed : props.signatureEndpoint,
|
|
765
|
+
children: ({
|
|
766
|
+
open
|
|
767
|
+
}) => {
|
|
768
|
+
function handleOnClick(e) {
|
|
769
|
+
e.preventDefault();
|
|
770
|
+
open();
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
return /*#__PURE__*/jsx("button", _extends({
|
|
774
|
+
onClick: handleOnClick
|
|
775
|
+
}, props, {
|
|
776
|
+
children: children
|
|
777
|
+
}));
|
|
778
|
+
}
|
|
779
|
+
})
|
|
780
|
+
});
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
export { CldImage, CldUploadButton, CldUploadWidget, cloudinaryLoader, position, primary, text };
|
|
617
784
|
//# sourceMappingURL=next-cloudinary.modern.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-cloudinary.modern.mjs","sources":["../src/lib/cloudinary.js","../src/plugins/cropping.js","../src/plugins/effects.js","../src/constants/qualifiers.js","../src/plugins/overlays.js","../src/plugins/raw-transformations.js","../src/plugins/remove-background.js","../src/plugins/underlays.js","../src/plugins/zoompan.js","../src/loaders/cloudinary-loader.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 props = ['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}","const params = [\n 'art',\n {\n prop: 'autoBrightness',\n effect: 'auto_brightness',\n },\n {\n prop: 'autoColor',\n effect: 'auto_color',\n },\n {\n prop: 'autoContrast',\n effect: 'auto_contrast',\n },\n {\n prop: 'assistColorblind',\n effect: 'assist_colorblind',\n },\n 'blackwhite',\n 'blur',\n {\n prop: 'blurFaces',\n effect: 'blur_faces',\n },\n {\n prop: 'blurRegion',\n effect: 'blur_region',\n },\n 'brightness',\n {\n prop: 'brightnessHSB',\n effect: 'brightness_hsb',\n },\n 'cartoonify',\n 'colorize',\n 'contrast',\n 'distort',\n {\n prop: 'fillLight',\n effect: 'fill_light',\n },\n 'gamma',\n {\n prop: 'gradientFade',\n effect: 'gradient_fade',\n },\n 'grayscale',\n 'improve',\n 'negate',\n {\n prop: 'oilPaint',\n effect: 'oil_paint',\n },\n 'outline',\n 'pixelate',\n {\n prop: 'pixelateFaces',\n effect: 'pixelate_faces',\n },\n {\n prop: 'pixelateRegion',\n effect: 'pixelate_region',\n },\n 'redeye',\n {\n prop: 'replaceColor',\n effect: 'replace_color',\n },\n 'saturation',\n 'sepia',\n 'shadow',\n 'sharpen',\n 'shear',\n {\n prop: 'simulateColorblind',\n effect: 'simulate_colorblind',\n },\n 'tint',\n {\n prop: 'unsharpMask',\n effect: 'unsharp_mask',\n },\n 'vectorize',\n 'vibrance',\n 'vignette',\n];\n\nexport const props = params.map(param => param.prop || param);\n\nexport function plugin({ cldImage, 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}","// 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 props = ['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 props = ['rawTransformations'];\n\nexport function plugin({ cldImage, cldOptions } = {}) {\n const { rawTransformations = [] } = cldOptions;\n\n rawTransformations.forEach(transformation => {\n cldImage.addTransformation(transformation);\n });\n}","export const props = ['removeBackground'];\n\nexport function plugin({ cldImage, options, cldOptions } = {}) {\n const { removeBackground = false } = cldOptions;\n if ( removeBackground ) {\n cldImage.effect('e_background_removal');\n }\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const props = ['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}","export const props = ['zoompan'];\n\nexport function plugin({ cldImage, cldOptions } = {}) {\n const { zoompan = false } = cldOptions;\n const options = {};\n\n if ( zoompan === true ) {\n cldImage.effect('e_zoompan');\n } else if ( typeof zoompan === 'string' ) {\n if ( zoompan === 'loop' ) {\n cldImage.effect('e_zoompan');\n cldImage.effect('e_loop');\n } else {\n cldImage.effect(`e_zoompan:${zoompan}`);\n }\n } else if ( typeof zoompan === 'object' ) {\n let zoompanEffect = 'e_zoompan';\n\n if ( typeof zoompan.options === 'string' ) {\n zoompanEffect = `${zoompanEffect}${zoompan.options}`;\n }\n\n cldImage.effect(zoompanEffect);\n\n let loopEffect;\n\n if ( zoompan.loop === true ) {\n loopEffect = 'e_loop';\n } else if ( typeof zoompan.loop === 'string' ) {\n loopEffect = `e_loop${zoompan.loop}`;\n }\n\n if ( loopEffect ) {\n cldImage.effect(loopEffect);\n }\n }\n\n if ( zoompan !== false ) {\n options.format = 'gif';\n }\n\n return {\n options\n }\n}","import { Cloudinary } from '@cloudinary/url-gen';\n\nimport * as croppingPlugin from '../plugins/cropping';\nimport * as effectsPlugin from '../plugins/effects';\nimport * as overlaysPlugin from '../plugins/overlays';\nimport * as rawTransformationsPlugin from '../plugins/raw-transformations';\nimport * as removeBackgroundPlugin from '../plugins/remove-background';\nimport * as underlaysPlugin from '../plugins/underlays';\nimport * as zoompanPlugin from '../plugins/zoompan';\n\nimport {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\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\nexport const transformationPlugins = [\n // Background Removal must always come first\n removeBackgroundPlugin,\n\n croppingPlugin,\n effectsPlugin,\n overlaysPlugin,\n underlaysPlugin,\n zoompanPlugin,\n\n // Raw transformations needs to be last simply to make sure\n // it's always expected to applied the same way\n\n rawTransformationsPlugin\n];\n\nexport function cloudinaryLoader(defaultOptions, cldOptions) {\n const options = {\n format: 'auto',\n quality: 'auto',\n ...defaultOptions\n };\n\n const cldImage = cld.image(options.src);\n\n transformationPlugins.forEach(({ plugin }) => {\n const { options: pluginOptions } = plugin({\n cldImage,\n options,\n cldOptions\n }) || {};\n\n if ( pluginOptions?.format ) {\n options.format = pluginOptions.format;\n }\n });\n\n return cldImage\n .format(options.format)\n .delivery(`q_${options.quality}`)\n .toURL();\n}","import Image from 'next/image';\n\nimport { createPlaceholderUrl } from '../../lib/cloudinary';\nimport { cloudinaryLoader, transformationPlugins } from '../../loaders/cloudinary-loader';\n\nconst CldImage = props => {\n\n const CLD_OPTIONS = [];\n\n transformationPlugins.forEach(({ props = [] }) => {\n props.forEach(prop => {\n if ( CLD_OPTIONS.includes(prop) ) {\n throw new Error(`Option ${prop} already exists!`);\n }\n CLD_OPTIONS.push(prop);\n });\n })\n\n // Construct the base Image component props by filtering out Cloudinary-specific props\n\n const imageProps = {};\n\n Object.keys(props)\n .filter(key => !CLD_OPTIONS.includes(key))\n .forEach(key => imageProps[key] = props[key]);\n\n // Construct Cloudinary-specific props by looking for values for any of the supported prop keys\n\n const cldOptions = {};\n\n CLD_OPTIONS.forEach(key => {\n if ( props[key] ) {\n cldOptions[key] = props[key];\n }\n });\n\n // If we see a placeholder option, configure a Cloudinary-based URL.\n // The resulting image will always be blurred per Next.js, so we're\n // limited on options for placeholders.\n //\n // We need to do this logic here as we potentially need to mutate\n // an Image component prop as opposed to simply the URL\n //\n // https://nextjs.org/docs/api-reference/next/image#blurdataurl\n\n if ( imageProps.placeholder ) {\n 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","props","plugin","options","cldOptions","width","height","crop","gravity","transformationString","console","warn","params","prop","map","param","forEach","key","log","primary","aspectRatio","qualifier","position","angle","x","y","text","location","fontFamily","fontSize","fontWeight","letterSpacing","textDecoration","overlays","type","typeQualifier","publicId","effects","layerEffects","_excluded","hasPublicId","hasText","hasPosition","layerTransformation","replace","applied","Object","keys","qualifiersPrimary","push","textTransformations","qualifiersText","qualifiersPosition","length","addTransformation","rawTransformations","transformation","removeBackground","underlays","zoompan","zoompanEffect","loopEffect","loop","transformationPlugins","removeBackgroundPlugin","croppingPlugin","effectsPlugin","overlaysPlugin","underlaysPlugin","zoompanPlugin","rawTransformationsPlugin","cloudinaryLoader","defaultOptions","quality","pluginOptions","CldImage","CLD_OPTIONS","Error","imageProps","filter","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,GAAA;;AAED,EAAA,IAAKN,WAAW,CAACO,QAAZ,CAAqB,QAArB,CAAL,EAAsC;AACpC,IAAA,MAAMC,KAAK,GAAGR,WAAW,CAACS,KAAZ,CAAkB,GAAlB,CAAuBC,CAAAA,MAAvB,CAA8B,CAA9B,CAAA,CAAiCC,IAAjC,CAAsC,GAAtC,CAAd,CAAA;IACAV,QAAQ,CAACK,MAAT,CAAgB,aAAhB,CAAA,CAAA;AACAL,IAAAA,QAAQ,CAACK,MA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AA,MADH,CACU9D,GAAG,IAAI,CAAC2D,WAAW,CAAClF,QAAZ,CAAqBuB,GAArB,CADlB,CAAA,CAEGD,OAFH,CAEWC,GAAG,IAAI6D,UAAU,CAAC7D,GAAD,CAAV,GAAkBhB,KAAK,CAACgB,GAAD,CAFzC,EAjBwB;;EAuBxB,MAAMb,UAAU,GAAG,EAAnB,CAAA;AAEAwE,EAAAA,WAAW,CAAC5D,OAAZ,CAAoBC,GAAG,IAAI;AACzB,IAAA,IAAKhB,KAAK,CAACgB,GAAD,CAAV,EAAkB;AAChBb,MAAAA,UAAU,CAACa,GAAD,CAAV,GAAkBhB,KAAK,CAACgB,GAAD,CAAvB,CAAA;AACD,KAAA;AACF,GAJD,EAzBwB;AAgCxB;AACA;AACA;AACA;AACA;AACA;AACA;;EAEA,IAAK6D,UAAU,CAAC3F,WAAhB,EAA8B;AAC5B2F,IAAAA,UAAU,CAACE,WAAX,GAAyB/F,oBAAoB,CAAC;MAC5CC,GAAG,EAAEe,KAAK,CAACf,GADiC;MAE5CC,WAAW,EAAEc,KAAK,CAACd,WAAAA;AAFyB,KAAD,CAA7C,CAAA;;AAKA,IAAA,IAAK2F,UAAU,CAAC3F,WAAX,KAA2B,MAAhC,EAAyC;MACvC2F,UAAU,CAAC3F,WAAX,GAAyB,MAAzB,CAAA;AACD,KAAA;AACF,GAAA;;EAED,oBACE8F,GAAA,CAAC,KAAD,EAAA,QAAA,CAAA,EAAA,EACMH,UADN,EAAA;AAEE,IAAA,MAAM,EAAG3E,OAAD,IAAaoE,gBAAgB,cAAMO,UAAN,EAAA;AAAkB3E,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/plugins/effects.js","../src/constants/qualifiers.js","../src/plugins/overlays.js","../src/plugins/raw-transformations.js","../src/plugins/remove-background.js","../src/plugins/underlays.js","../src/plugins/zoompan.js","../src/loaders/cloudinary-loader.js","../src/components/CldImage/CldImage.js","../src/components/CldUploadWidget/CldUploadWidget.js","../src/components/CldUploadButton/CldUploadButton.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 * Retrieves the public id of a cloudiary image url. If no url is recognized it returns the parameter it self.\n * If it's recognized that is a url and it's not possible to get the public id, it warns the user.\n *\n * @param {string} src The cloudiary url or public id.\n *\n * @return {string} The images public id\n */\nexport function getPublicId(src) {\n if ( src.includes('res.cloudinary.com') ) {\n const regexWithTransformations = /(https?)\\:\\/\\/(res.cloudinary.com)\\/([^\\/]+)\\/(image|video|raw)\\/(upload|authenticated)\\/(.*)\\/(v[0-9]+)\\/(.+)(?:\\.[a-z]{3})?/\n const regexWithoutTransformations = /(https?)\\:\\/\\/(res.cloudinary.com)\\/([^\\/]+)\\/(image|video|raw)\\/(upload|authenticated)\\/(v[0-9]+)\\/(.+)(?:\\.[a-z]{3})?/\n\n const withTransformations = src.match(regexWithTransformations)\n const withoutTransformations = src.match(regexWithoutTransformations)\n\n if ( withTransformations ) {\n return withTransformations[withTransformations.length - 1]\n } else if ( withoutTransformations ) {\n return withoutTransformations[withoutTransformations.length - 1]\n } else {\n console.warn(`Not possible to retrieve the publicUrl from ${src}, make sure it's a valid cloudinary image url.`)\n }\n }\n return src;\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}\n","const cropsGravityAuto = [ 'crop', 'fill', 'lfill', 'fill_pad', 'thumb' ];\n\nexport const props = ['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}","const params = [\n 'art',\n {\n prop: 'autoBrightness',\n effect: 'auto_brightness',\n },\n {\n prop: 'autoColor',\n effect: 'auto_color',\n },\n {\n prop: 'autoContrast',\n effect: 'auto_contrast',\n },\n {\n prop: 'assistColorblind',\n effect: 'assist_colorblind',\n },\n 'blackwhite',\n 'blur',\n {\n prop: 'blurFaces',\n effect: 'blur_faces',\n },\n {\n prop: 'blurRegion',\n effect: 'blur_region',\n },\n 'brightness',\n {\n prop: 'brightnessHSB',\n effect: 'brightness_hsb',\n },\n 'cartoonify',\n 'colorize',\n 'contrast',\n 'distort',\n {\n prop: 'fillLight',\n effect: 'fill_light',\n },\n 'gamma',\n {\n prop: 'gradientFade',\n effect: 'gradient_fade',\n },\n 'grayscale',\n 'improve',\n 'negate',\n {\n prop: 'oilPaint',\n effect: 'oil_paint',\n },\n 'outline',\n 'pixelate',\n {\n prop: 'pixelateFaces',\n effect: 'pixelate_faces',\n },\n {\n prop: 'pixelateRegion',\n effect: 'pixelate_region',\n },\n 'redeye',\n {\n prop: 'replaceColor',\n effect: 'replace_color',\n },\n 'saturation',\n 'sepia',\n 'shadow',\n 'sharpen',\n 'shear',\n {\n prop: 'simulateColorblind',\n effect: 'simulate_colorblind',\n },\n 'tint',\n {\n prop: 'unsharpMask',\n effect: 'unsharp_mask',\n },\n 'vectorize',\n 'vibrance',\n 'vignette',\n];\n\nexport const props = params.map(param => param.prop || param);\n\nexport function plugin({ cldImage, 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}","// 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 props = ['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 props = ['rawTransformations'];\n\nexport function plugin({ cldImage, cldOptions } = {}) {\n const { rawTransformations = [] } = cldOptions;\n\n rawTransformations.forEach(transformation => {\n cldImage.addTransformation(transformation);\n });\n}","export const props = ['removeBackground'];\n\nexport function plugin({ cldImage, options, cldOptions } = {}) {\n const { removeBackground = false } = cldOptions;\n if ( removeBackground ) {\n cldImage.effect('e_background_removal');\n }\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const props = ['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}","export const props = ['zoompan'];\n\nexport function plugin({ cldImage, cldOptions } = {}) {\n const { zoompan = false } = cldOptions;\n const options = {};\n\n if ( zoompan === true ) {\n cldImage.effect('e_zoompan');\n } else if ( typeof zoompan === 'string' ) {\n if ( zoompan === 'loop' ) {\n cldImage.effect('e_zoompan');\n cldImage.effect('e_loop');\n } else {\n cldImage.effect(`e_zoompan:${zoompan}`);\n }\n } else if ( typeof zoompan === 'object' ) {\n let zoompanEffect = 'e_zoompan';\n\n if ( typeof zoompan.options === 'string' ) {\n zoompanEffect = `${zoompanEffect}${zoompan.options}`;\n }\n\n cldImage.effect(zoompanEffect);\n\n let loopEffect;\n\n if ( zoompan.loop === true ) {\n loopEffect = 'e_loop';\n } else if ( typeof zoompan.loop === 'string' ) {\n loopEffect = `e_loop${zoompan.loop}`;\n }\n\n if ( loopEffect ) {\n cldImage.effect(loopEffect);\n }\n }\n\n if ( zoompan !== false ) {\n options.format = 'gif';\n }\n\n return {\n options\n }\n}","import { Cloudinary } from '@cloudinary/url-gen';\nimport { getPublicId } from '../lib/cloudinary';\n\nimport * as croppingPlugin from '../plugins/cropping';\nimport * as effectsPlugin from '../plugins/effects';\nimport * as overlaysPlugin from '../plugins/overlays';\nimport * as rawTransformationsPlugin from '../plugins/raw-transformations';\nimport * as removeBackgroundPlugin from '../plugins/remove-background';\nimport * as underlaysPlugin from '../plugins/underlays';\nimport * as zoompanPlugin from '../plugins/zoompan';\n\nimport {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nlet cld;\n\nexport const transformationPlugins = [\n // Background Removal must always come first\n removeBackgroundPlugin,\n\n croppingPlugin,\n effectsPlugin,\n overlaysPlugin,\n underlaysPlugin,\n zoompanPlugin,\n\n // Raw transformations needs to be last simply to make sure\n // it's always expected to applied the same way\n\n rawTransformationsPlugin\n];\n\nexport function cloudinaryLoader(defaultOptions, cldOptions, cldConfig = {}) {\n if ( !cld ) {\n cld = new Cloudinary({\n cloud: {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME\n },\n url: {\n // Used to avoid issues with SSR particularly for the blurred placeholder\n analytics: false\n },\n ...cldConfig\n });\n }\n\n const options = {\n format: 'auto',\n quality: 'auto',\n ...defaultOptions\n };\n const publicId = getPublicId(options.src);\n\n const cldImage = cld.image(publicId);\n\n transformationPlugins.forEach(({ plugin }) => {\n const { options: pluginOptions } = plugin({\n cldImage,\n options,\n cldOptions\n }) || {};\n\n if ( pluginOptions?.format ) {\n options.format = pluginOptions.format;\n }\n });\n\n return cldImage\n .format(options.format)\n .delivery(`q_${options.quality}`)\n .toURL();\n}","import Image from 'next/image';\n\nimport { createPlaceholderUrl, getPublicId } from '../../lib/cloudinary';\nimport { cloudinaryLoader, transformationPlugins } from '../../loaders/cloudinary-loader';\n\nconst CldImage = props => {\n\n const CLD_OPTIONS = [];\n\n transformationPlugins.forEach(({ props = [] }) => {\n props.forEach(prop => {\n if ( CLD_OPTIONS.includes(prop) ) {\n throw new Error(`Option ${prop} already exists!`);\n }\n CLD_OPTIONS.push(prop);\n });\n })\n\n // Construct the base Image component props by filtering out Cloudinary-specific props\n\n const imageProps = {};\n\n Object.keys(props)\n .filter(key => !CLD_OPTIONS.includes(key))\n .forEach(key => imageProps[key] = props[key]);\n\n // Construct Cloudinary-specific props by looking for values for any of the supported prop keys\n\n const cldOptions = {};\n\n CLD_OPTIONS.forEach(key => {\n if ( props[key] ) {\n cldOptions[key] = props[key];\n }\n });\n\n // If we see a placeholder option, configure a Cloudinary-based URL.\n // The resulting image will always be blurred per Next.js, so we're\n // limited on options for placeholders.\n //\n // We need to do this logic here as we potentially need to mutate\n // an Image component prop as opposed to simply the URL\n //\n // https://nextjs.org/docs/api-reference/next/image#blurdataurl\n\n if ( imageProps.placeholder ) {\n const publicId = getPublicId(props.src);\n\n imageProps.blurDataURL = createPlaceholderUrl({\n src: publicId,\n placeholder: props.placeholder\n });\n\n if ( imageProps.placeholder !== 'blur' ) {\n imageProps.placeholder = 'blur';\n }\n }\n\n return (\n <Image\n {...imageProps}\n loader={(options) => cloudinaryLoader({ ...imageProps, options }, cldOptions)}\n />\n );\n}\n\nexport default CldImage;","import { useRef } from 'react';\nimport Script from 'next/script';\n\nconst CldUploadWidget = ({\n children,\n onUpload,\n options,\n signed,\n signatureEndpoint,\n}) => {\n const cloudinary = useRef();\n const widget = useRef();\n\n /**\n * generateSignature\n * @description Makes a request to an endpoint to sign Cloudinary parameters as part of widget creation\n */\n\n function generateSignature(callback, paramsToSign) {\n fetch(signatureEndpoint, {\n method: \"POST\",\n body: JSON.stringify({\n paramsToSign,\n }),\n })\n .then((r) => r.json())\n .then(({ signature }) => {\n callback(signature);\n });\n }\n\n /**\n * createWidget\n * @description Creates a new instance of the Cloudinary widget and stores in a ref\n */\n\n function createWidget() {\n // When creating a signed upload, you need to provide both your Cloudinary API Key\n // as well as a signature generator function that will sign any paramters\n // either on page load or during the upload process. Read more about signed uploads at:\n // https://cloudinary.com/documentation/upload_widget#signed_uploads\n\n const totalOptions = {\n ...options,\n ...(!!signed && {\n uploadSignature: generateSignature,\n }),\n };\n\n // no need for apiSecret because of api/sign-cloudinary-params\n if (signed && !totalOptions.apiKey) {\n return new Error(\"Signed Upload needs apiKey!\");\n }\n\n return cloudinary.current?.createUploadWidget(\n totalOptions,\n function (error, result) {\n // The callback is a bit more chatty than failed or success so\n // only trigger when one of those are the case. You can additionally\n // create a separate handler such as onEvent and trigger it on\n // ever occurance\n if (error || result.event === \"success\") {\n onUpload(error, result, widget?.current);\n }\n }\n );\n }\n\n /**\n * open\n * @description When triggered, uses the current widget instance to open the upload modal\n */\n\n function open() {\n if (!widget?.current) {\n widget.current = createWidget();\n }\n\n widget?.current && widget.current.open();\n }\n\n /**\n * handleOnLoad\n * @description Stores the Cloudinary window instance to a ref when the widget script loads\n */\n\n function handleOnLoad() {\n cloudinary.current = window.cloudinary;\n }\n\n return (\n <>\n {children({\n cloudinary: cloudinary.current,\n widget: widget.current,\n open,\n })}\n <Script\n id={`cloudinary-${Math.floor(Math.random() * 100)}`}\n src=\"https://widget.cloudinary.com/v2.0/global/all.js\"\n onLoad={handleOnLoad}\n onError={(e) => {\n console.error(\"Script failed to load\", e);\n }}\n />\n </>\n );\n};\n\nexport default CldUploadWidget;\n","import CldUploadWidget from '../CldUploadWidget';\n\nconst CldUploadButton = ({\n onUpload,\n options,\n signed,\n label,\n children,\n ...props\n}) => {\n return (\n <>\n <CldUploadWidget\n signed={signed}\n options={options}\n onUpload={onUpload}\n signatureEndpoint={signed ?? props.signatureEndpoint}\n >\n {({ open }) => {\n function handleOnClick(e) {\n e.preventDefault();\n open();\n }\n return (\n <button onClick={handleOnClick} {...props}>\n {children}\n </button>\n );\n }}\n </CldUploadWidget>\n </>\n );\n};\n\nexport default CldUploadButton;\n"],"names":["cld","Cloudinary","cloud","cloudName","process","env","NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME","url","analytics","getPublicId","src","includes","regexWithTransformations","regexWithoutTransformations","withTransformations","match","withoutTransformations","length","console","warn","createPlaceholderUrl","placeholder","cldImage","image","resize","delivery","format","effect","color","split","splice","join","toURL","cropsGravityAuto","props","plugin","options","cldOptions","width","height","crop","gravity","transformationString","params","prop","map","param","forEach","key","log","primary","aspectRatio","qualifier","position","angle","x","y","text","location","fontFamily","fontSize","fontWeight","letterSpacing","textDecoration","overlays","type","typeQualifier","publicId","effects","layerEffects","_excluded","hasPublicId","hasText","hasPosition","layerTransformation","replace","applied","Object","keys","qualifiersPrimary","push","textTransformations","qualifiersText","qualifiersPosition","addTransformation","rawTransformations","transformation","removeBackground","underlays","zoompan","zoompanEffect","loopEffect","loop","transformationPlugins","removeBackgroundPlugin","croppingPlugin","effectsPlugin","overlaysPlugin","underlaysPlugin","zoompanPlugin","rawTransformationsPlugin","cloudinaryLoader","defaultOptions","cldConfig","quality","pluginOptions","CldImage","CLD_OPTIONS","Error","imageProps","filter","blurDataURL","_jsx","CldUploadWidget","children","onUpload","signed","signatureEndpoint","cloudinary","useRef","widget","generateSignature","callback","paramsToSign","fetch","method","body","JSON","stringify","then","r","json","signature","createWidget","totalOptions","uploadSignature","apiKey","current","createUploadWidget","error","result","event","open","handleOnLoad","window","_jsxs","_Fragment","Math","floor","random","e","CldUploadButton","handleOnClick","preventDefault"],"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;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,WAAT,CAAqBC,GAArB,EAA0B;AAC/B,EAAA,IAAKA,GAAG,CAACC,QAAJ,CAAa,oBAAb,CAAL,EAA0C;IACxC,MAAMC,wBAAwB,GAAG,+HAAjC,CAAA;IACA,MAAMC,2BAA2B,GAAG,yHAApC,CAAA;AAEA,IAAA,MAAMC,mBAAmB,GAAGJ,GAAG,CAACK,KAAJ,CAAUH,wBAAV,CAA5B,CAAA;AACA,IAAA,MAAMI,sBAAsB,GAAGN,GAAG,CAACK,KAAJ,CAAUF,2BAAV,CAA/B,CAAA;;AAEA,IAAA,IAAKC,mBAAL,EAA2B;AACzB,MAAA,OAAOA,mBAAmB,CAACA,mBAAmB,CAACG,MAApB,GAA6B,CAA9B,CAA1B,CAAA;KADF,MAEO,IAAKD,sBAAL,EAA8B;AACnC,MAAA,OAAOA,sBAAsB,CAACA,sBAAsB,CAACC,MAAvB,GAAgC,CAAjC,CAA7B,CAAA;AACD,KAFM,MAEA;AACLC,MAAAA,OAAO,CAACC,IAAR,CAAc,CAAA,4CAAA,EAA8CT,GAAI,CAAhE,8CAAA,CAAA,CAAA,CAAA;AACD,KAAA;AACF,GAAA;;AACD,EAAA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