next-cloudinary 0.5.0 → 0.6.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 +0 -1
- package/dist/next-cloudinary.js +32 -21
- package/dist/next-cloudinary.js.map +1 -1
- package/dist/next-cloudinary.modern.mjs +31 -22
- package/dist/next-cloudinary.modern.mjs.map +1 -1
- package/dist/next-cloudinary.module.js +32 -21
- package/dist/next-cloudinary.module.js.map +1 -1
- package/dist/next-cloudinary.umd.js +32 -21
- package/dist/next-cloudinary.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-cloudinary.modern.mjs","sources":["../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/lib/cloudinary.js","../src/loaders/cloudinary-loader.js","../src/components/CldImage/CldImage.js","../src/components/CldOgImage/CldOgImage.js","../src/components/CldUploadWidget/CldUploadWidget.js","../src/components/CldUploadButton/CldUploadButton.js"],"sourcesContent":["const cropsGravityAuto = [ 'crop', 'fill', 'lfill', 'fill_pad', 'thumb' ];\n\nexport const props = ['crop', 'gravity'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { width, height, crop = 'limit' } = options;\n\n let transformationString = `c_${crop},w_${width}`;\n\n if ( !options.gravity && cropsGravityAuto.includes(crop) ) {\n options.gravity = 'auto';\n }\n\n if ( !['limit'].includes(crop) ) {\n transformationString = `${transformationString},h_${height}`;\n }\n\n if ( options.gravity ) {\n if ( options.gravity === 'auto' && !cropsGravityAuto.includes(crop) ) {\n console.warn('Auto gravity can only be used with crop, fill, lfill, fill_pad or thumb. Not applying gravity.');\n } else {\n transformationString = `${transformationString},g_${options.gravity}`;\n }\n }\n\n cldImage.resize(transformationString);\n}\n","const params = [\n 'art',\n {\n prop: 'autoBrightness',\n effect: 'auto_brightness',\n },\n {\n prop: 'autoColor',\n effect: 'auto_color',\n },\n {\n prop: 'autoContrast',\n effect: 'auto_contrast',\n },\n {\n prop: 'assistColorblind',\n effect: 'assist_colorblind',\n },\n 'blackwhite',\n 'blur',\n {\n prop: 'blurFaces',\n effect: 'blur_faces',\n },\n {\n prop: 'blurRegion',\n effect: 'blur_region',\n },\n 'brightness',\n {\n prop: 'brightnessHSB',\n effect: 'brightness_hsb',\n },\n 'cartoonify',\n 'colorize',\n 'contrast',\n 'distort',\n {\n prop: 'fillLight',\n effect: 'fill_light',\n },\n 'gamma',\n {\n prop: 'gradientFade',\n effect: 'gradient_fade',\n },\n 'grayscale',\n 'improve',\n 'negate',\n {\n prop: 'oilPaint',\n effect: 'oil_paint',\n },\n 'outline',\n 'pixelate',\n {\n prop: 'pixelateFaces',\n effect: 'pixelate_faces',\n },\n {\n prop: 'pixelateRegion',\n effect: 'pixelate_region',\n },\n 'redeye',\n {\n prop: 'replaceColor',\n effect: 'replace_color',\n },\n 'saturation',\n 'sepia',\n 'shadow',\n 'sharpen',\n 'shear',\n {\n prop: 'simulateColorblind',\n effect: 'simulate_colorblind',\n },\n 'tint',\n {\n prop: 'unsharpMask',\n effect: 'unsharp_mask',\n },\n 'vectorize',\n 'vibrance',\n 'vignette',\n];\n\nexport const props = params.map(param => param.prop || param);\n\nexport function plugin({ cldImage, options } = {}) {\n params.forEach(key => {\n const prop = key.prop || key;\n const effect = key.effect || key;\n\n if ( options[prop] === true ) {\n cldImage.effect(`e_${effect}`);\n } else if ( typeof options[prop] === 'string' ) {\n cldImage.effect(`e_${effect}:${options[prop]}`);\n }\n });\n}","// aspectRatio\n\nexport const primary = {\n aspectRatio: {\n qualifier: 'ar'\n },\n crop: {\n qualifier: 'c'\n },\n gravity: {\n qualifier: 'g'\n },\n height: {\n qualifier: 'h'\n },\n width: {\n qualifier: 'w'\n },\n};\n\nexport const position = {\n angle: {\n qualifier: 'a'\n },\n gravity: {\n qualifier: 'g'\n },\n x: {\n qualifier: 'x'\n },\n y: {\n qualifier: 'y'\n },\n}\n\nexport const text = {\n alignment: {\n qualifier: 'alignment'\n },\n border: {\n qualifier: 'bo',\n location: 'primary'\n },\n color: {\n qualifier: 'co',\n location: 'primary'\n },\n fontFamily: {\n qualifier: false\n },\n fontSize: {\n qualifier: false\n },\n fontWeight: {\n qualifier: false\n },\n letterSpacing: {\n qualifier: 'letter_spacing'\n },\n lineSpacing: {\n qualifier: 'line_spacing'\n },\n stroke: {\n qualifier: 'self'\n },\n textDecoration: {\n qualifier: false\n }\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const props = ['text', 'overlays'];\n\nexport const DEFAULT_TEXT_OPTIONS = {\n color: 'black',\n fontFamily: 'Arial',\n fontSize: 200,\n fontWeight: 'bold',\n};\n\nexport function plugin({ cldImage, options } = {}) {\n const { text, overlays = [] } = options;\n\n const type = 'overlay';\n const typeQualifier = 'l';\n\n if ( Array.isArray(overlays) ) {\n overlays.forEach(applyOverlay);\n }\n\n if ( typeof text === 'string' ) {\n applyOverlay({\n text: {\n ...DEFAULT_TEXT_OPTIONS,\n text\n }\n })\n } else if ( typeof text === 'object' ) {\n applyOverlay({\n text: {\n ...DEFAULT_TEXT_OPTIONS,\n ...text\n }\n })\n }\n\n\n\n /**\n * applyOverlay\n */\n\n function applyOverlay({ publicId, position, text, effects: layerEffects = [], ...options }) {\n const hasPublicId = typeof publicId === 'string';\n const hasText = typeof text === 'object' || typeof text === 'string';\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 if ( typeof text === 'string' ) {\n text = {\n ...DEFAULT_TEXT_OPTIONS,\n text\n }\n }\n\n\n const textTransformations = [];\n\n Object.keys(text).forEach(key => {\n if ( !qualifiersText[key] ) return;\n\n const { qualifier, location } = qualifiersText[key];\n\n if ( location === 'primary' ) {\n primary.push(`${qualifier}_${text[key]}`);\n } else if ( qualifier === 'self' ) {\n textTransformations.push(key);\n } else if ( qualifier ) {\n textTransformations.push(`${qualifier}_${text[key]}`);\n } else {\n textTransformations.push(text[key]);\n }\n });\n\n layerTransformation = `${layerTransformation}:${textTransformations.join('_')}:${text.text}`\n }\n\n // Positioning\n\n if ( hasPosition ) {\n Object.keys(position).forEach(key => {\n if ( !qualifiersPosition[key] ) return;\n\n const { qualifier } = qualifiersPosition[key];\n\n applied.push(`${qualifier}_${position[key]}`);\n });\n }\n\n // Add all primary transformations\n\n layerTransformation = `${layerTransformation},${primary.join(',')}`;\n\n // Add all applied transformations\n\n layerTransformation = `${layerTransformation}/fl_layer_apply,fl_no_overflow`;\n\n if ( applied.length > 0 ) {\n layerTransformation = `${layerTransformation},${applied.join(',')}`;\n }\n\n // Finally add it to the image\n\n cldImage.addTransformation(layerTransformation);\n }\n}","export const props = ['rawTransformations'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { rawTransformations = [] } = options;\n\n rawTransformations.forEach(transformation => {\n cldImage.addTransformation(transformation);\n });\n}","export const props = ['removeBackground'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { removeBackground = false } = options;\n if ( removeBackground ) {\n cldImage.effect('e_background_removal');\n }\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const props = ['underlay', 'underlays'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { underlay, underlays = [] } = options;\n\n const type = 'underlay';\n const typeQualifier = 'u';\n\n if ( Array.isArray(underlays) ) {\n underlays.forEach(applyUnderlay);\n }\n\n if ( typeof underlay === 'string' ) {\n\n const underlayOptions = {\n publicId: underlay,\n crop: 'fill'\n }\n\n if ( options.width ) {\n underlayOptions.width = options.width;\n }\n\n if ( options.height ) {\n underlayOptions.height = options.height;\n }\n\n applyUnderlay(underlayOptions);\n }\n\n /**\n * applyUnderlay\n */\n\n function applyUnderlay({ publicId, type, position, text, effects: layerEffects = [], ...options }) {\n const hasPublicId = typeof publicId === 'string';\n const hasPosition = typeof position === 'object';\n\n if ( !hasPublicId ) {\n console.warn(`An ${type} is missing a Public ID`);\n return;\n }\n\n // Start to construct the transformation string using text or the public ID\n // if it's image-based\n\n let layerTransformation = `${typeQualifier}_${publicId.replace(/\\//g, ':')}`;\n\n // Begin organizing transformations based on what it is and the location\n // it needs to be placed in the URL\n\n const primary = [];\n const applied = [];\n\n // Gemeral options\n\n Object.keys(options).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${options[key]}`);\n });\n\n // Layer effects\n\n layerEffects.forEach(effect => {\n Object.keys(effect).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${effect[key]}`);\n });\n });\n\n // Positioning\n\n if ( hasPosition ) {\n Object.keys(position).forEach(key => {\n if ( !qualifiersPosition[key] ) return;\n\n const { qualifier } = qualifiersPosition[key];\n\n applied.push(`${qualifier}_${position[key]}`);\n });\n }\n\n // Add all primary transformations\n\n layerTransformation = `${layerTransformation},${primary.join(',')}`;\n\n // Add all applied transformations\n\n layerTransformation = `${layerTransformation}/fl_layer_apply,fl_no_overflow`;\n\n if ( applied.length > 0 ) {\n layerTransformation = `${layerTransformation},${applied.join(',')}`;\n }\n\n // Finally add it to the image\n\n cldImage.addTransformation(layerTransformation);\n }\n}","export const props = ['zoompan'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { zoompan = false } = options;\n const overrides = {};\n\n if ( zoompan === true ) {\n cldImage.effect('e_zoompan');\n } else if ( typeof zoompan === 'string' ) {\n if ( zoompan === 'loop' ) {\n cldImage.effect('e_zoompan');\n cldImage.effect('e_loop');\n } else {\n cldImage.effect(`e_zoompan:${zoompan}`);\n }\n } else if ( typeof zoompan === 'object' ) {\n let zoompanEffect = 'e_zoompan';\n\n if ( typeof zoompan.options === 'string' ) {\n zoompanEffect = `${zoompanEffect}${zoompan.options}`;\n }\n\n cldImage.effect(zoompanEffect);\n\n let loopEffect;\n\n if ( zoompan.loop === true ) {\n loopEffect = 'e_loop';\n } else if ( typeof zoompan.loop === 'string' ) {\n loopEffect = `e_loop${zoompan.loop}`;\n }\n\n if ( loopEffect ) {\n cldImage.effect(loopEffect);\n }\n }\n\n if ( zoompan !== false ) {\n overrides.format = 'gif';\n }\n\n return {\n options: overrides\n }\n}","import { Cloudinary } from '@cloudinary/url-gen';\n\nimport * as croppingPlugin from '../plugins/cropping';\nimport * as effectsPlugin from '../plugins/effects';\nimport * as overlaysPlugin from '../plugins/overlays';\nimport * as rawTransformationsPlugin from '../plugins/raw-transformations';\nimport * as removeBackgroundPlugin from '../plugins/remove-background';\nimport * as underlaysPlugin from '../plugins/underlays';\nimport * as zoompanPlugin from '../plugins/zoompan';\n\nimport {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const transformationPlugins = [\n // Background Removal must always come first\n removeBackgroundPlugin,\n\n croppingPlugin,\n effectsPlugin,\n overlaysPlugin,\n underlaysPlugin,\n zoompanPlugin,\n\n // Raw transformations needs to be last simply to make sure\n // it's always expected to applied the same way\n\n rawTransformationsPlugin\n];\n\nlet cld;\n\n/**\n * constructCloudinaryUrl\n */\n\nexport function constructCloudinaryUrl({ options, config }) {\n if ( !cld ) {\n cld = new Cloudinary({\n cloud: {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME\n },\n url: {\n // Used to avoid issues with SSR particularly for the blurred placeholder\n analytics: false\n },\n ...config\n });\n }\n\n const publicId = getPublicId(options.src);\n\n const cldImage = cld.image(publicId);\n\n transformationPlugins.forEach(({ plugin }) => {\n const { options: pluginOptions } = plugin({\n cldImage,\n options\n }) || {};\n\n if ( pluginOptions?.format ) {\n options.format = pluginOptions.format;\n }\n });\n\n return cldImage\n .setDeliveryType(options.deliveryType || 'upload')\n .format(options.format || 'auto')\n .delivery(`q_${options.quality || 'auto'}`)\n .toURL();\n}\n\n/**\n * Retrieves the public id of a cloudiary image url. If no url is recognized it returns the parameter it self.\n * If it's recognized that is a url and it's not possible to get the public id, it warns the user.\n *\n * @param {string} src The cloudiary url or public id.\n *\n * @return {string} The images public id\n */\n\nexport function getPublicId(src) {\n if ( typeof src !== 'string' ) {\n throw new Error(`Invalid src of type ${typeof src}`);\n }\n\n if ( src.includes('res.cloudinary.com') ) {\n const regexWithTransformations = /(https?)\\:\\/\\/(res.cloudinary.com)\\/([^\\/]+)\\/(image|video|raw)\\/(upload|authenticated)\\/(.*)\\/(v[0-9]+)\\/(.+)(?:\\.[a-z]{3})?/\n const regexWithoutTransformations = /(https?)\\:\\/\\/(res.cloudinary.com)\\/([^\\/]+)\\/(image|video|raw)\\/(upload|authenticated)\\/(v[0-9]+)\\/(.+)(?:\\.[a-z]{3})?/\n\n const withTransformations = src.match(regexWithTransformations)\n const withoutTransformations = src.match(regexWithoutTransformations)\n\n if ( withTransformations ) {\n return withTransformations[withTransformations.length - 1]\n } else if ( withoutTransformations ) {\n return withoutTransformations[withoutTransformations.length - 1]\n } else {\n console.warn(`Not possible to retrieve the publicUrl from ${src}, make sure it's a valid cloudinary image url.`)\n }\n }\n\n return src;\n}\n\n/**\n * createPlaceholderUrl\n */\n\nexport function createPlaceholderUrl({ src, placeholder = true, config }) {\n const rawTransformations = [];\n\n if ( placeholder === 'grayscale' ) {\n rawTransformations.push('e_grayscale');\n }\n\n if ( typeof placeholder === 'string' && placeholder.includes('color:') ) {\n const color = placeholder.split(':').splice(1).join(':')\n rawTransformations.push('e_grayscale');\n rawTransformations.push(`e_colorize:60,co_${color}`);\n }\n\n return constructCloudinaryUrl({\n options: {\n src,\n width: 100,\n quality: 1,\n rawTransformations,\n },\n config\n });;\n}\n","import { constructCloudinaryUrl } from '../lib/cloudinary';\n\nexport function cloudinaryLoader(defaultOptions, cldOptions, cldConfig = {}) {\n return constructCloudinaryUrl({\n options: {\n ...defaultOptions,\n ...cldOptions\n },\n config: cldConfig\n });\n}","import Image from 'next/image';\n\nimport { createPlaceholderUrl, getPublicId, transformationPlugins } from '../../lib/cloudinary';\nimport { cloudinaryLoader } from '../../loaders/cloudinary-loader';\n\nconst CldImage = props => {\n\n const CLD_OPTIONS = [];\n\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 Head from 'next/head';\n\nconst IMAGE_WIDTH = 2400;\nconst IMAGE_HEIGHT = 1200;\n\nimport { constructCloudinaryUrl } from '../../lib/cloudinary';\n\nconst TWITTER_CARD = 'summary_large_image';\n\nconst CldOgImage = ({ excludeTags = [], twitterTitle, ...props }) => {\n const options = {\n ...props,\n width: props.width || IMAGE_WIDTH,\n height: props.height || IMAGE_HEIGHT,\n crop: props.crop || 'fill',\n gravity: props.gravity || 'center'\n }\n\n const ogImageUrl = constructCloudinaryUrl({\n options\n });\n\n // We need to include the tags within the Next.js Head component rather than\n // direcly adding them inside of the Head otherwise we get unexpected results\n\n return (\n <Head>\n <meta property=\"og:image\" content={ogImageUrl} />\n <meta property=\"og:image:secure_url\" content={ogImageUrl} />\n <meta property=\"og:image:width\" content={options.width} />\n <meta property=\"og:image:height\" content={options.height} />\n\n {options.alt && (\n <meta property=\"og:image:alt\" content={options.alt} />\n )}\n\n {/* Required for summary_large_image, exclude vai excludeTags */}\n {/* https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image */}\n\n {!excludeTags.includes('twitter:title') && (\n <meta property=\"twitter:title\" content={twitterTitle || ' '} />\n )}\n\n <meta property=\"twitter:card\" content={TWITTER_CARD} />\n <meta property=\"twitter:image\" content={ogImageUrl} />\n </Head>\n );\n}\n\nexport default CldOgImage;","import { useRef } from 'react';\nimport Script from 'next/script';\n\nconst CldUploadWidget = ({\n children,\n onUpload,\n options,\n 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":["cropsGravityAuto","props","plugin","cldImage","options","width","height","crop","transformationString","gravity","includes","console","warn","resize","params","prop","effect","map","param","forEach","key","primary","aspectRatio","qualifier","position","angle","x","y","text","alignment","border","location","color","fontFamily","fontSize","fontWeight","letterSpacing","lineSpacing","stroke","textDecoration","DEFAULT_TEXT_OPTIONS","overlays","type","typeQualifier","Array","isArray","applyOverlay","publicId","effects","layerEffects","_excluded","hasPublicId","hasText","hasPosition","layerTransformation","replace","applied","Object","keys","qualifiersPrimary","push","textTransformations","qualifiersText","join","qualifiersPosition","length","addTransformation","rawTransformations","transformation","removeBackground","underlay","underlays","applyUnderlay","underlayOptions","zoompan","overrides","zoompanEffect","loopEffect","loop","format","transformationPlugins","removeBackgroundPlugin","croppingPlugin","effectsPlugin","overlaysPlugin","underlaysPlugin","zoompanPlugin","rawTransformationsPlugin","cld","constructCloudinaryUrl","config","Cloudinary","cloud","cloudName","process","env","NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME","url","analytics","getPublicId","src","image","pluginOptions","setDeliveryType","deliveryType","delivery","quality","toURL","Error","regexWithTransformations","regexWithoutTransformations","withTransformations","match","withoutTransformations","createPlaceholderUrl","placeholder","split","splice","cloudinaryLoader","defaultOptions","cldOptions","cldConfig","CldImage","CLD_OPTIONS","imageProps","filter","blurDataURL","_jsx","IMAGE_WIDTH","IMAGE_HEIGHT","TWITTER_CARD","CldOgImage","excludeTags","twitterTitle","ogImageUrl","_jsxs","alt","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","_Fragment","Math","floor","random","e","CldUploadButton","handleOnClick","preventDefault"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAMA,gBAAgB,GAAG,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAE,CAAA;AAElE,MAAMC,OAAK,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAEjC,SAASC,QAAM,CAAC;EAAEC,QAAQ;AAAEC,EAAAA,OAAAA;AAAQ,CAAC,GAAG,EAAE,EAAE;EACjD,MAAM;IAAEC,KAAK;IAAEC,MAAM;AAAEC,IAAAA,IAAI,GAAG,OAAA;AAAQ,GAAC,GAAGH,OAAO,CAAA;AAEjD,EAAA,IAAII,oBAAoB,GAAI,CAAA,EAAA,EAAID,IAAK,CAAA,GAAA,EAAKF,KAAM,CAAC,CAAA,CAAA;EAEjD,IAAK,CAACD,OAAO,CAACK,OAAO,IAAIT,gBAAgB,CAACU,QAAQ,CAACH,IAAI,CAAC,EAAG;IACzDH,OAAO,CAACK,OAAO,GAAG,MAAM,CAAA;AAC1B,GAAA;EAEA,IAAK,CAAC,CAAC,OAAO,CAAC,CAACC,QAAQ,CAACH,IAAI,CAAC,EAAG;AAC/BC,IAAAA,oBAAoB,GAAI,CAAA,EAAEA,oBAAqB,CAAA,GAAA,EAAKF,MAAO,CAAC,CAAA,CAAA;AAC9D,GAAA;EAEA,IAAKF,OAAO,CAACK,OAAO,EAAG;AACrB,IAAA,IAAKL,OAAO,CAACK,OAAO,KAAK,MAAM,IAAI,CAACT,gBAAgB,CAACU,QAAQ,CAACH,IAAI,CAAC,EAAG;AACpEI,MAAAA,OAAO,CAACC,IAAI,CAAC,gGAAgG,CAAC,CAAA;AAChH,KAAC,MAAM;AACLJ,MAAAA,oBAAoB,GAAI,CAAEA,EAAAA,oBAAqB,MAAKJ,OAAO,CAACK,OA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AAQ,EAAEuI,QAAS;AACnB,MAAA,iBAAiB,EAAEC,MAAM,IAAA,IAAA,GAANA,MAAM,GAAI3I,KAAK,CAAC4I,iBAAkB;AAAA,MAAA,QAAA,EAEpD,CAAC;AAAEyB,QAAAA,IAAAA;AAAK,OAAC,KAAK;QACb,SAASS,aAAa,CAACF,CAAC,EAAE;UACxBA,CAAC,CAACG,cAAc,EAAE,CAAA;AAClBV,UAAAA,IAAI,EAAE,CAAA;AACR,SAAA;QACA,oBACEvC,GAAA,CAAA,QAAA,EAAA,QAAA,CAAA;AAAQ,UAAA,OAAO,EAAEgD,aAAAA;AAAc,SAAA,EAAK9K,KAAK,EAAA;UAAA,QACtCyI,EAAAA,QAAAA;SACM,CAAA,CAAA,CAAA;AAEb,OAAA;AAAC,KAAA,CAAA;GAEF,CAAA,CAAA;AAEP;;;;"}
|
|
1
|
+
{"version":3,"file":"next-cloudinary.modern.mjs","sources":["../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/lib/cloudinary.js","../src/loaders/cloudinary-loader.js","../src/components/CldImage/CldImage.js","../src/components/CldOgImage/CldOgImage.js","../src/components/CldUploadWidget/CldUploadWidget.js","../src/components/CldUploadButton/CldUploadButton.js"],"sourcesContent":["const cropsGravityAuto = [ 'crop', 'fill', 'lfill', 'fill_pad', 'thumb' ];\n\nexport const props = ['crop', 'gravity'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { width, height, crop = 'limit' } = options;\n\n let transformationString = `c_${crop},w_${width}`;\n\n if ( !options.gravity && cropsGravityAuto.includes(crop) ) {\n options.gravity = 'auto';\n }\n\n if ( !['limit'].includes(crop) ) {\n transformationString = `${transformationString},h_${height}`;\n }\n\n if ( options.gravity ) {\n if ( options.gravity === 'auto' && !cropsGravityAuto.includes(crop) ) {\n console.warn('Auto gravity can only be used with crop, fill, lfill, fill_pad or thumb. Not applying gravity.');\n } else {\n transformationString = `${transformationString},g_${options.gravity}`;\n }\n }\n\n cldImage.resize(transformationString);\n}\n","const params = [\n 'art',\n {\n prop: 'autoBrightness',\n effect: 'auto_brightness',\n },\n {\n prop: 'autoColor',\n effect: 'auto_color',\n },\n {\n prop: 'autoContrast',\n effect: 'auto_contrast',\n },\n {\n prop: 'assistColorblind',\n effect: 'assist_colorblind',\n },\n 'blackwhite',\n 'blur',\n {\n prop: 'blurFaces',\n effect: 'blur_faces',\n },\n {\n prop: 'blurRegion',\n effect: 'blur_region',\n },\n 'brightness',\n {\n prop: 'brightnessHSB',\n effect: 'brightness_hsb',\n },\n 'cartoonify',\n 'colorize',\n 'contrast',\n 'distort',\n {\n prop: 'fillLight',\n effect: 'fill_light',\n },\n 'gamma',\n {\n prop: 'gradientFade',\n effect: 'gradient_fade',\n },\n 'grayscale',\n 'improve',\n 'negate',\n {\n prop: 'oilPaint',\n effect: 'oil_paint',\n },\n 'outline',\n 'pixelate',\n {\n prop: 'pixelateFaces',\n effect: 'pixelate_faces',\n },\n {\n prop: 'pixelateRegion',\n effect: 'pixelate_region',\n },\n 'redeye',\n {\n prop: 'replaceColor',\n effect: 'replace_color',\n },\n 'saturation',\n 'sepia',\n 'shadow',\n 'sharpen',\n 'shear',\n {\n prop: 'simulateColorblind',\n effect: 'simulate_colorblind',\n },\n 'tint',\n {\n prop: 'unsharpMask',\n effect: 'unsharp_mask',\n },\n 'vectorize',\n 'vibrance',\n 'vignette',\n];\n\nexport const props = params.map(param => param.prop || param);\n\nexport function plugin({ cldImage, options } = {}) {\n params.forEach(key => {\n const prop = key.prop || key;\n const effect = key.effect || key;\n\n if ( options[prop] === true ) {\n cldImage.effect(`e_${effect}`);\n } else if ( typeof options[prop] === 'string' ) {\n cldImage.effect(`e_${effect}:${options[prop]}`);\n }\n });\n}","// aspectRatio\n\nexport const primary = {\n aspectRatio: {\n qualifier: 'ar'\n },\n crop: {\n qualifier: 'c'\n },\n gravity: {\n qualifier: 'g'\n },\n height: {\n qualifier: 'h'\n },\n width: {\n qualifier: 'w'\n },\n};\n\nexport const position = {\n angle: {\n qualifier: 'a'\n },\n gravity: {\n qualifier: 'g'\n },\n x: {\n qualifier: 'x'\n },\n y: {\n qualifier: 'y'\n },\n}\n\nexport const text = {\n alignment: {\n qualifier: 'alignment'\n },\n border: {\n qualifier: 'bo',\n location: 'primary'\n },\n color: {\n qualifier: 'co',\n location: 'primary'\n },\n fontFamily: {\n qualifier: false\n },\n fontSize: {\n qualifier: false\n },\n fontWeight: {\n qualifier: false\n },\n letterSpacing: {\n qualifier: 'letter_spacing'\n },\n lineSpacing: {\n qualifier: 'line_spacing'\n },\n stroke: {\n qualifier: 'self'\n },\n textDecoration: {\n qualifier: false\n }\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const props = ['text', 'overlays'];\n\nexport const DEFAULT_TEXT_OPTIONS = {\n color: 'black',\n fontFamily: 'Arial',\n fontSize: 200,\n fontWeight: 'bold',\n};\n\nexport function plugin({ cldImage, options } = {}) {\n const { text, overlays = [] } = options;\n\n const type = 'overlay';\n const typeQualifier = 'l';\n\n if ( Array.isArray(overlays) ) {\n overlays.forEach(applyOverlay);\n }\n\n if ( typeof text === 'string' ) {\n applyOverlay({\n text: {\n ...DEFAULT_TEXT_OPTIONS,\n text\n }\n })\n } else if ( typeof text === 'object' ) {\n applyOverlay({\n text: {\n ...DEFAULT_TEXT_OPTIONS,\n ...text\n }\n })\n }\n\n\n\n /**\n * applyOverlay\n */\n\n function applyOverlay({ publicId, position, text, effects: layerEffects = [], ...options }) {\n const hasPublicId = typeof publicId === 'string';\n const hasText = typeof text === 'object' || typeof text === 'string';\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 if ( typeof text === 'string' ) {\n text = {\n ...DEFAULT_TEXT_OPTIONS,\n text\n }\n }\n\n\n const textTransformations = [];\n\n Object.keys(text).forEach(key => {\n if ( !qualifiersText[key] ) return;\n\n const { qualifier, location } = qualifiersText[key];\n\n if ( location === 'primary' ) {\n primary.push(`${qualifier}_${text[key]}`);\n } else if ( qualifier === 'self' ) {\n textTransformations.push(key);\n } else if ( qualifier ) {\n textTransformations.push(`${qualifier}_${text[key]}`);\n } else {\n textTransformations.push(text[key]);\n }\n });\n\n layerTransformation = `${layerTransformation}:${textTransformations.join('_')}:${text.text}`\n }\n\n // Positioning\n\n if ( hasPosition ) {\n Object.keys(position).forEach(key => {\n if ( !qualifiersPosition[key] ) return;\n\n const { qualifier } = qualifiersPosition[key];\n\n applied.push(`${qualifier}_${position[key]}`);\n });\n }\n\n // Add all primary transformations\n\n layerTransformation = `${layerTransformation},${primary.join(',')}`;\n\n // Add all applied transformations\n\n layerTransformation = `${layerTransformation}/fl_layer_apply,fl_no_overflow`;\n\n if ( applied.length > 0 ) {\n layerTransformation = `${layerTransformation},${applied.join(',')}`;\n }\n\n // Finally add it to the image\n\n cldImage.addTransformation(layerTransformation);\n }\n}","export const props = ['rawTransformations'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { rawTransformations = [] } = options;\n\n rawTransformations.forEach(transformation => {\n cldImage.addTransformation(transformation);\n });\n}","export const props = ['removeBackground'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { removeBackground = false } = options;\n if ( removeBackground ) {\n cldImage.effect('e_background_removal');\n }\n}","import {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const props = ['underlay', 'underlays'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { underlay, underlays = [] } = options;\n\n const type = 'underlay';\n const typeQualifier = 'u';\n\n if ( Array.isArray(underlays) ) {\n underlays.forEach(applyUnderlay);\n }\n\n if ( typeof underlay === 'string' ) {\n\n const underlayOptions = {\n publicId: underlay,\n crop: 'fill'\n }\n\n if ( options.width ) {\n underlayOptions.width = options.width;\n }\n\n if ( options.height ) {\n underlayOptions.height = options.height;\n }\n\n applyUnderlay(underlayOptions);\n }\n\n /**\n * applyUnderlay\n */\n\n function applyUnderlay({ publicId, type, position, text, effects: layerEffects = [], ...options }) {\n const hasPublicId = typeof publicId === 'string';\n const hasPosition = typeof position === 'object';\n\n if ( !hasPublicId ) {\n console.warn(`An ${type} is missing a Public ID`);\n return;\n }\n\n // Start to construct the transformation string using text or the public ID\n // if it's image-based\n\n let layerTransformation = `${typeQualifier}_${publicId.replace(/\\//g, ':')}`;\n\n // Begin organizing transformations based on what it is and the location\n // it needs to be placed in the URL\n\n const primary = [];\n const applied = [];\n\n // Gemeral options\n\n Object.keys(options).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${options[key]}`);\n });\n\n // Layer effects\n\n layerEffects.forEach(effect => {\n Object.keys(effect).forEach(key => {\n if ( !qualifiersPrimary[key] ) return;\n const { qualifier } = qualifiersPrimary[key];\n primary.push(`${qualifier}_${effect[key]}`);\n });\n });\n\n // Positioning\n\n if ( hasPosition ) {\n Object.keys(position).forEach(key => {\n if ( !qualifiersPosition[key] ) return;\n\n const { qualifier } = qualifiersPosition[key];\n\n applied.push(`${qualifier}_${position[key]}`);\n });\n }\n\n // Add all primary transformations\n\n layerTransformation = `${layerTransformation},${primary.join(',')}`;\n\n // Add all applied transformations\n\n layerTransformation = `${layerTransformation}/fl_layer_apply,fl_no_overflow`;\n\n if ( applied.length > 0 ) {\n layerTransformation = `${layerTransformation},${applied.join(',')}`;\n }\n\n // Finally add it to the image\n\n cldImage.addTransformation(layerTransformation);\n }\n}","export const props = ['zoompan'];\n\nexport function plugin({ cldImage, options } = {}) {\n const { zoompan = false } = options;\n const overrides = {};\n\n if ( zoompan === true ) {\n cldImage.effect('e_zoompan');\n } else if ( typeof zoompan === 'string' ) {\n if ( zoompan === 'loop' ) {\n cldImage.effect('e_zoompan');\n cldImage.effect('e_loop');\n } else {\n cldImage.effect(`e_zoompan:${zoompan}`);\n }\n } else if ( typeof zoompan === 'object' ) {\n let zoompanEffect = 'e_zoompan';\n\n if ( typeof zoompan.options === 'string' ) {\n zoompanEffect = `${zoompanEffect}${zoompan.options}`;\n }\n\n cldImage.effect(zoompanEffect);\n\n let loopEffect;\n\n if ( zoompan.loop === true ) {\n loopEffect = 'e_loop';\n } else if ( typeof zoompan.loop === 'string' ) {\n loopEffect = `e_loop${zoompan.loop}`;\n }\n\n if ( loopEffect ) {\n cldImage.effect(loopEffect);\n }\n }\n\n if ( zoompan !== false ) {\n overrides.format = 'gif';\n }\n\n return {\n options: overrides\n }\n}","import { Cloudinary } from '@cloudinary/url-gen';\n\nimport * as croppingPlugin from '../plugins/cropping';\nimport * as effectsPlugin from '../plugins/effects';\nimport * as overlaysPlugin from '../plugins/overlays';\nimport * as rawTransformationsPlugin from '../plugins/raw-transformations';\nimport * as removeBackgroundPlugin from '../plugins/remove-background';\nimport * as underlaysPlugin from '../plugins/underlays';\nimport * as zoompanPlugin from '../plugins/zoompan';\n\nimport {\n primary as qualifiersPrimary,\n text as qualifiersText,\n position as qualifiersPosition\n} from '../constants/qualifiers';\n\nexport const transformationPlugins = [\n // Background Removal must always come first\n removeBackgroundPlugin,\n\n croppingPlugin,\n effectsPlugin,\n overlaysPlugin,\n underlaysPlugin,\n zoompanPlugin,\n\n // Raw transformations needs to be last simply to make sure\n // it's always expected to applied the same way\n\n rawTransformationsPlugin\n];\n\nlet cld;\n\n/**\n * constructCloudinaryUrl\n */\n\nexport function constructCloudinaryUrl({ options, config }) {\n if ( !cld ) {\n cld = new Cloudinary({\n cloud: {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME\n },\n url: {\n // Used to avoid issues with SSR particularly for the blurred placeholder\n analytics: false\n },\n ...config\n });\n }\n\n const publicId = getPublicId(options.src);\n\n const cldImage = cld.image(publicId);\n\n transformationPlugins.forEach(({ plugin }) => {\n const { options: pluginOptions } = plugin({\n cldImage,\n options\n }) || {};\n\n if ( pluginOptions?.format ) {\n options.format = pluginOptions.format;\n }\n });\n\n return cldImage\n .setDeliveryType(options.deliveryType || 'upload')\n .format(options.format || 'auto')\n .delivery(`q_${options.quality || 'auto'}`)\n .toURL();\n}\n\n/**\n * Retrieves the public id of a cloudiary image url. If no url is recognized it returns the parameter it self.\n * If it's recognized that is a url and it's not possible to get the public id, it warns the user.\n *\n * @param {string} src The cloudiary url or public id.\n *\n * @return {string} The images public id\n */\n\nexport function getPublicId(src) {\n if ( typeof src !== 'string' ) {\n throw new Error(`Invalid src of type ${typeof src}`);\n }\n\n if ( src.includes('res.cloudinary.com') ) {\n const regexWithTransformations = /(https?)\\:\\/\\/(res.cloudinary.com)\\/([^\\/]+)\\/(image|video|raw)\\/(upload|authenticated)\\/(.*)\\/(v[0-9]+)\\/(.+)(?:\\.[a-z]{3})?/\n const regexWithoutTransformations = /(https?)\\:\\/\\/(res.cloudinary.com)\\/([^\\/]+)\\/(image|video|raw)\\/(upload|authenticated)\\/(v[0-9]+)\\/(.+)(?:\\.[a-z]{3})?/\n\n const withTransformations = src.match(regexWithTransformations)\n const withoutTransformations = src.match(regexWithoutTransformations)\n\n if ( withTransformations ) {\n return withTransformations[withTransformations.length - 1]\n } else if ( withoutTransformations ) {\n return withoutTransformations[withoutTransformations.length - 1]\n } else {\n console.warn(`Not possible to retrieve the publicUrl from ${src}, make sure it's a valid cloudinary image url.`)\n }\n }\n\n return src;\n}\n\n/**\n * createPlaceholderUrl\n */\n\nexport function createPlaceholderUrl({ src, placeholder = true, config }) {\n const rawTransformations = [];\n\n if ( placeholder === 'grayscale' ) {\n rawTransformations.push('e_grayscale');\n }\n\n if ( typeof placeholder === 'string' && placeholder.includes('color:') ) {\n const color = placeholder.split(':').splice(1).join(':')\n rawTransformations.push('e_grayscale');\n rawTransformations.push(`e_colorize:60,co_${color}`);\n }\n\n return constructCloudinaryUrl({\n options: {\n src,\n width: 100,\n quality: 1,\n rawTransformations,\n },\n config\n });;\n}\n","import { constructCloudinaryUrl } from '../lib/cloudinary';\n\nexport function cloudinaryLoader(defaultOptions, cldOptions, cldConfig = {}) {\n return constructCloudinaryUrl({\n options: {\n ...defaultOptions,\n ...cldOptions\n },\n config: cldConfig\n });\n}","import Image from 'next/image';\n\nimport { createPlaceholderUrl, getPublicId, transformationPlugins } from '../../lib/cloudinary';\nimport { cloudinaryLoader } from '../../loaders/cloudinary-loader';\n\nconst CldImage = props => {\n\n const CLD_OPTIONS = [];\n\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 Head from 'next/head';\n\nconst IMAGE_WIDTH = 2400;\nconst IMAGE_HEIGHT = 1200;\n\nimport { constructCloudinaryUrl } from '../../lib/cloudinary';\n\nconst TWITTER_CARD = 'summary_large_image';\n\nconst CldOgImage = ({ excludeTags = [], twitterTitle, ...props }) => {\n const options = {\n ...props,\n width: props.width || IMAGE_WIDTH,\n height: props.height || IMAGE_HEIGHT,\n crop: props.crop || 'fill',\n gravity: props.gravity || 'center'\n }\n\n const ogImageUrl = constructCloudinaryUrl({\n options\n });\n\n // We need to include the tags within the Next.js Head component rather than\n // direcly adding them inside of the Head otherwise we get unexpected results\n\n return (\n <Head>\n <meta property=\"og:image\" content={ogImageUrl} />\n <meta property=\"og:image:secure_url\" content={ogImageUrl} />\n <meta property=\"og:image:width\" content={options.width} />\n <meta property=\"og:image:height\" content={options.height} />\n\n {options.alt && (\n <meta property=\"og:image:alt\" content={options.alt} />\n )}\n\n {/* Required for summary_large_image, exclude vai excludeTags */}\n {/* https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image */}\n\n {!excludeTags.includes('twitter:title') && (\n <meta property=\"twitter:title\" content={twitterTitle || ' '} />\n )}\n\n <meta property=\"twitter:card\" content={TWITTER_CARD} />\n <meta property=\"twitter:image\" content={ogImageUrl} />\n </Head>\n );\n}\n\nexport default CldOgImage;","import { useRef } from 'react';\nimport Script from 'next/script';\n\nconst CldUploadWidget = ({\n children,\n onUpload,\n options,\n signatureEndpoint,\n uploadPreset,\n}) => {\n const cloudinary = useRef();\n const widget = useRef();\n\n const signed = !!signatureEndpoint;\n\n /**\n * generateSignature\n * @description Makes a request to an endpoint to sign Cloudinary parameters as part of widget creation\n */\n\n function generateSignature(callback, paramsToSign) {\n fetch(signatureEndpoint, {\n method: \"POST\",\n body: JSON.stringify({\n paramsToSign,\n }),\n })\n .then((r) => r.json())\n .then(({ signature }) => {\n callback(signature);\n });\n }\n\n /**\n * createWidget\n * @description Creates a new instance of the Cloudinary widget and stores in a ref\n */\n\n function createWidget() {\n // When creating a signed upload, you need to provide both your Cloudinary API Key\n // as well as a signature generator function that will sign any paramters\n // either on page load or during the upload process. Read more about signed uploads at:\n // https://cloudinary.com/documentation/upload_widget#signed_uploads\n\n const uploadOptions = {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,\n uploadPreset: uploadPreset || process.env.NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET,\n apiKey: process.env.NEXT_PUBLIC_CLOUDINARY_API_KEY,\n ...options,\n };\n\n if ( signed ) {\n uploadOptions.uploadSignature = generateSignature;\n\n // No need for apiSecret here because of api/sign-cloudinary-params\n\n if (!uploadOptions.apiKey) {\n return new Error(\"Signed Upload needs apiKey!\");\n }\n }\n\n return cloudinary.current?.createUploadWidget(\n uploadOptions,\n function (error, result) {\n // The callback is a bit more chatty than failed or success so\n // only trigger when one of those are the case. You can additionally\n // create a separate handler such as onEvent and trigger it on\n // ever occurance\n if (error || result.event === \"success\") {\n onUpload(error, result, widget?.current);\n }\n }\n );\n }\n\n /**\n * open\n * @description When triggered, uses the current widget instance to open the upload modal\n */\n\n function open() {\n if (!widget?.current) {\n widget.current = createWidget();\n }\n\n widget?.current && widget.current.open();\n }\n\n /**\n * handleOnLoad\n * @description Stores the Cloudinary window instance to a ref when the widget script loads\n */\n\n function handleOnLoad() {\n cloudinary.current = window.cloudinary;\n }\n\n return (\n <>\n {children({\n cloudinary: cloudinary.current,\n widget: widget.current,\n open,\n })}\n <Script\n id={`cloudinary-${Math.floor(Math.random() * 100)}`}\n src=\"https://widget.cloudinary.com/v2.0/global/all.js\"\n onLoad={handleOnLoad}\n onError={(e) => console.error(`Failed to load Cloudinary: ${e.message}`)}\n />\n </>\n );\n};\n\nexport default CldUploadWidget;\n","import CldUploadWidget from '../CldUploadWidget';\n\nconst CldUploadButton = ({\n children,\n onClick,\n onUpload,\n options,\n signatureEndpoint,\n uploadPreset,\n ...props\n}) => {\n return (\n <>\n <CldUploadWidget\n onUpload={onUpload}\n options={options}\n signatureEndpoint={signatureEndpoint}\n uploadPreset={uploadPreset}\n >\n {({ open }) => {\n function handleOnClick(e) {\n e.preventDefault();\n\n open();\n\n if ( typeof onClick === 'function' ) {\n onClick(e);\n }\n }\n return (\n <button {...props} onClick={handleOnClick} >\n {children || 'Upload'}\n </button>\n );\n }}\n </CldUploadWidget>\n </>\n );\n};\n\nexport default CldUploadButton;\n"],"names":["cropsGravityAuto","props","plugin","cldImage","options","width","height","crop","transformationString","gravity","includes","console","warn","resize","params","prop","effect","map","param","forEach","key","primary","aspectRatio","qualifier","position","angle","x","y","text","alignment","border","location","color","fontFamily","fontSize","fontWeight","letterSpacing","lineSpacing","stroke","textDecoration","DEFAULT_TEXT_OPTIONS","overlays","type","typeQualifier","Array","isArray","applyOverlay","publicId","effects","layerEffects","_excluded","hasPublicId","hasText","hasPosition","layerTransformation","replace","applied","Object","keys","qualifiersPrimary","push","textTransformations","qualifiersText","join","qualifiersPosition","length","addTransformation","rawTransformations","transformation","removeBackground","underlay","underlays","applyUnderlay","underlayOptions","zoompan","overrides","zoompanEffect","loopEffect","loop","format","transformationPlugins","removeBackgroundPlugin","croppingPlugin","effectsPlugin","overlaysPlugin","underlaysPlugin","zoompanPlugin","rawTransformationsPlugin","cld","constructCloudinaryUrl","config","Cloudinary","cloud","cloudName","process","env","NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME","url","analytics","getPublicId","src","image","pluginOptions","setDeliveryType","deliveryType","delivery","quality","toURL","Error","regexWithTransformations","regexWithoutTransformations","withTransformations","match","withoutTransformations","createPlaceholderUrl","placeholder","split","splice","cloudinaryLoader","defaultOptions","cldOptions","cldConfig","CldImage","CLD_OPTIONS","imageProps","filter","blurDataURL","_jsx","IMAGE_WIDTH","IMAGE_HEIGHT","TWITTER_CARD","CldOgImage","excludeTags","twitterTitle","ogImageUrl","_jsxs","alt","CldUploadWidget","children","onUpload","signatureEndpoint","uploadPreset","cloudinary","useRef","widget","signed","generateSignature","callback","paramsToSign","fetch","method","body","JSON","stringify","then","r","json","signature","createWidget","uploadOptions","NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET","apiKey","NEXT_PUBLIC_CLOUDINARY_API_KEY","uploadSignature","current","createUploadWidget","error","result","event","open","handleOnLoad","window","_Fragment","Math","floor","random","e","message","CldUploadButton","onClick","handleOnClick","preventDefault"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAMA,gBAAgB,GAAG,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAE,CAAA;AAElE,MAAMC,OAAK,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAEjC,SAASC,QAAM,CAAC;EAAEC,QAAQ;AAAEC,EAAAA,OAAAA;AAAQ,CAAC,GAAG,EAAE,EAAE;EACjD,MAAM;IAAEC,KAAK;IAAEC,MAAM;AAAEC,IAAAA,IAAI,GAAG,OAAA;AAAQ,GAAC,GAAGH,OAAO,CAAA;AAEjD,EAAA,IAAII,oBAAoB,GAAI,CAAA,EAAA,EAAID,IAAK,CAAA,GAAA,EAAKF,KAAM,CAAC,CAAA,CAAA;EAEjD,IAAK,CAACD,OAAO,CAACK,OAAO,IAAIT,gBAAgB,CAACU,QAAQ,CAACH,IAAI,CAAC,EAAG;IACzDH,OAAO,CAACK,OAAO,GAAG,MAAM,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,EACvC1C,QAAQ,IAAI,QAAA;SACN,CAAA,CAAA,CAAA;AAEb,OAAA;AAAC,KAAA,CAAA;GAEF,CAAA,CAAA;AAEP;;;;"}
|
|
@@ -764,10 +764,11 @@ var CldUploadWidget = function CldUploadWidget(_ref) {
|
|
|
764
764
|
var children = _ref.children,
|
|
765
765
|
onUpload = _ref.onUpload,
|
|
766
766
|
options = _ref.options,
|
|
767
|
-
|
|
768
|
-
|
|
767
|
+
signatureEndpoint = _ref.signatureEndpoint,
|
|
768
|
+
uploadPreset = _ref.uploadPreset;
|
|
769
769
|
var cloudinary = useRef();
|
|
770
770
|
var widget = useRef();
|
|
771
|
+
var signed = !!signatureEndpoint;
|
|
771
772
|
|
|
772
773
|
/**
|
|
773
774
|
* generateSignature
|
|
@@ -800,15 +801,21 @@ var CldUploadWidget = function CldUploadWidget(_ref) {
|
|
|
800
801
|
// either on page load or during the upload process. Read more about signed uploads at:
|
|
801
802
|
// https://cloudinary.com/documentation/upload_widget#signed_uploads
|
|
802
803
|
|
|
803
|
-
var
|
|
804
|
-
|
|
805
|
-
|
|
804
|
+
var uploadOptions = _extends({
|
|
805
|
+
cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,
|
|
806
|
+
uploadPreset: uploadPreset || process.env.NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET,
|
|
807
|
+
apiKey: process.env.NEXT_PUBLIC_CLOUDINARY_API_KEY
|
|
808
|
+
}, options);
|
|
809
|
+
if (signed) {
|
|
810
|
+
uploadOptions.uploadSignature = generateSignature;
|
|
811
|
+
|
|
812
|
+
// No need for apiSecret here because of api/sign-cloudinary-params
|
|
806
813
|
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
814
|
+
if (!uploadOptions.apiKey) {
|
|
815
|
+
return new Error("Signed Upload needs apiKey!");
|
|
816
|
+
}
|
|
810
817
|
}
|
|
811
|
-
return (_cloudinary$current = cloudinary.current) == null ? void 0 : _cloudinary$current.createUploadWidget(
|
|
818
|
+
return (_cloudinary$current = cloudinary.current) == null ? void 0 : _cloudinary$current.createUploadWidget(uploadOptions, function (error, result) {
|
|
812
819
|
// The callback is a bit more chatty than failed or success so
|
|
813
820
|
// only trigger when one of those are the case. You can additionally
|
|
814
821
|
// create a separate handler such as onEvent and trigger it on
|
|
@@ -849,35 +856,39 @@ var CldUploadWidget = function CldUploadWidget(_ref) {
|
|
|
849
856
|
src: "https://widget.cloudinary.com/v2.0/global/all.js",
|
|
850
857
|
onLoad: handleOnLoad,
|
|
851
858
|
onError: function onError(e) {
|
|
852
|
-
console.error("
|
|
859
|
+
return console.error("Failed to load Cloudinary: " + e.message);
|
|
853
860
|
}
|
|
854
861
|
})]
|
|
855
862
|
});
|
|
856
863
|
};
|
|
857
864
|
|
|
858
|
-
var _excluded = ["
|
|
865
|
+
var _excluded = ["children", "onClick", "onUpload", "options", "signatureEndpoint", "uploadPreset"];
|
|
859
866
|
var CldUploadButton = function CldUploadButton(_ref) {
|
|
860
|
-
var
|
|
867
|
+
var _children = _ref.children,
|
|
868
|
+
onClick = _ref.onClick,
|
|
869
|
+
onUpload = _ref.onUpload,
|
|
861
870
|
options = _ref.options,
|
|
862
|
-
|
|
863
|
-
|
|
871
|
+
signatureEndpoint = _ref.signatureEndpoint,
|
|
872
|
+
uploadPreset = _ref.uploadPreset,
|
|
864
873
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
865
874
|
return /*#__PURE__*/jsx(Fragment, {
|
|
866
875
|
children: /*#__PURE__*/jsx(CldUploadWidget, {
|
|
867
|
-
signed: signed,
|
|
868
|
-
options: options,
|
|
869
876
|
onUpload: onUpload,
|
|
870
|
-
|
|
877
|
+
options: options,
|
|
878
|
+
signatureEndpoint: signatureEndpoint,
|
|
879
|
+
uploadPreset: uploadPreset,
|
|
871
880
|
children: function children(_ref2) {
|
|
872
881
|
var open = _ref2.open;
|
|
873
882
|
function handleOnClick(e) {
|
|
874
883
|
e.preventDefault();
|
|
875
884
|
open();
|
|
885
|
+
if (typeof onClick === 'function') {
|
|
886
|
+
onClick(e);
|
|
887
|
+
}
|
|
876
888
|
}
|
|
877
|
-
return /*#__PURE__*/jsx("button", _extends({
|
|
878
|
-
onClick: handleOnClick
|
|
879
|
-
|
|
880
|
-
children: _children
|
|
889
|
+
return /*#__PURE__*/jsx("button", _extends({}, props, {
|
|
890
|
+
onClick: handleOnClick,
|
|
891
|
+
children: _children || 'Upload'
|
|
881
892
|
}));
|
|
882
893
|
}
|
|
883
894
|
})
|