next-cloudinary 2.2.0 → 2.3.1

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.
@@ -1,419 +0,0 @@
1
- import { useState } from 'react';
2
- import Image from 'next/image';
3
- import { getTransformations } from '@cloudinary-util/util';
4
- import { constructCloudinaryUrl, transformationPlugins } from '@cloudinary-util/url-loader';
5
- import nextPkg from 'next/package.json';
6
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
- import Head from 'next/head';
8
- import Script from 'next/script';
9
-
10
- function _extends() {
11
- _extends = Object.assign ? Object.assign.bind() : function (target) {
12
- for (var i = 1; i < arguments.length; i++) {
13
- var source = arguments[i];
14
- for (var key in source) {
15
- if (Object.prototype.hasOwnProperty.call(source, key)) {
16
- target[key] = source[key];
17
- }
18
- }
19
- }
20
- return target;
21
- };
22
- return _extends.apply(this, arguments);
23
- }
24
- function _objectWithoutPropertiesLoose(source, excluded) {
25
- if (source == null) return {};
26
- var target = {};
27
- var sourceKeys = Object.keys(source);
28
- var key, i;
29
- for (i = 0; i < sourceKeys.length; i++) {
30
- key = sourceKeys[i];
31
- if (excluded.indexOf(key) >= 0) continue;
32
- target[key] = source[key];
33
- }
34
- return target;
35
- }
36
-
37
- /**
38
- * pollForProcessingImage
39
- */
40
- async function pollForProcessingImage(options) {
41
- const {
42
- src
43
- } = options;
44
- try {
45
- await new Promise((resolve, reject) => {
46
- fetch(src).then(res => {
47
- if (!res.ok) {
48
- reject(res);
49
- return;
50
- }
51
- resolve(res);
52
- });
53
- });
54
- } catch (e) {
55
- if (e.status === 423) {
56
- return await pollForProcessingImage(options);
57
- }
58
- return false;
59
- }
60
- return true;
61
- }
62
-
63
- var name = "next-cloudinary";
64
- var version = "2.2.0";
65
- var main = "dist/next-cloudinary.umd.js";
66
- var module = "dist/next-cloudinary.module.js";
67
- var source = "src/index.ts";
68
- var scripts = {
69
- build: "microbundle --no-compress --jsx React.createElement --jsxFragment React.Fragment --jsxImportSource react",
70
- dev: "microbundle watch --no-compress --jsx React.createElement --jsxFragment React.Fragment --jsxImportSource react",
71
- prepublishOnly: "cp ../README.md . && yarn build",
72
- postpublish: "rm ./README.md",
73
- test: "jest"
74
- };
75
- var dependencies = {
76
- "@cloudinary-util/url-loader": "^1.3.0",
77
- "@cloudinary-util/util": "^1.2.0",
78
- "@cloudinary/url-gen": "^1.8.6"
79
- };
80
- var devDependencies = {
81
- "@babel/core": "^7.19.6",
82
- "@babel/preset-env": "^7.19.4",
83
- "@types/jest": "^29.2.0",
84
- "babel-jest": "^29.2.2",
85
- dotenv: "^16.0.3",
86
- jest: "^29.2.2",
87
- "jest-environment-jsdom": "^29.2.2",
88
- microbundle: "^0.15.1",
89
- "ts-jest": "^29.0.3",
90
- typescript: "^4.9.4"
91
- };
92
- var peerDependencies = {
93
- next: "^12 || ^13",
94
- react: "^17 || ^18"
95
- };
96
- var pkg = {
97
- name: name,
98
- version: version,
99
- main: main,
100
- module: module,
101
- "umd:main": "dist/next-cloudinary.umd.js",
102
- source: source,
103
- scripts: scripts,
104
- dependencies: dependencies,
105
- devDependencies: devDependencies,
106
- peerDependencies: peerDependencies
107
- };
108
-
109
- const NEXT_CLOUDINARY_ANALYTICS_ID = 'V';
110
- const NEXT_CLOUDINARY_VERSION = pkg.version;
111
- const NEXT_VERSION = nextPkg.version;
112
-
113
- function cloudinaryLoader({
114
- loaderOptions,
115
- imageProps,
116
- cldOptions,
117
- cldConfig = {}
118
- }) {
119
- const options = _extends({}, imageProps, cldOptions);
120
- options.width = parseInt(options.width);
121
- options.height = parseInt(options.height);
122
-
123
- // The loader options are used to create dynamic sizing when working with responsive images
124
- // so these should override the default options collected from the props alone if
125
- // the results are different. While we don't always use the height in the loader logic,
126
- // we always pass it here, as the usage is determined later based on cropping.js
127
-
128
- if (loaderOptions != null && loaderOptions.width && loaderOptions.width !== options.width) {
129
- const multiplier = loaderOptions.width / options.width;
130
- options.widthResize = loaderOptions.width;
131
- options.heightResize = Math.round(options.height * multiplier);
132
- }
133
- return constructCloudinaryUrl({
134
- options,
135
- config: _extends({
136
- cloud: {
137
- cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
138
- }
139
- }, cldConfig),
140
- analytics: {
141
- sdkCode: NEXT_CLOUDINARY_ANALYTICS_ID,
142
- sdkSemver: NEXT_CLOUDINARY_VERSION,
143
- techVersion: NEXT_VERSION,
144
- feature: ''
145
- }
146
- });
147
- }
148
-
149
- const CldImage = props => {
150
- const CLD_OPTIONS = ['deliveryType', 'preserveTransformations'];
151
- transformationPlugins.forEach(({
152
- props: _props = []
153
- }) => {
154
- _props.forEach(prop => {
155
- if (CLD_OPTIONS.includes(prop)) {
156
- throw new Error(`Option ${prop} already exists!`);
157
- }
158
- CLD_OPTIONS.push(prop);
159
- });
160
- });
161
- const imageProps = {
162
- alt: props.alt,
163
- src: props.src
164
- };
165
- Object.keys(props).filter(key => !CLD_OPTIONS.includes(key)).forEach(key => imageProps[key] = props[key]);
166
- const defaultImgKey = Object.keys(imageProps).map(key => `${key}:${imageProps[key]}`).join(';');
167
- const [imgKey, setImgKey] = useState(defaultImgKey);
168
- const cldOptions = {};
169
- CLD_OPTIONS.forEach(key => {
170
- if (props[key]) {
171
- cldOptions[key] = props[key] || undefined;
172
- }
173
- });
174
- // Try to preserve the original transformations from the Cloudinary URL passed in
175
- // to the component. This only works if the URL has a version number on it and otherwise
176
- // will fail to load
177
- if (props.preserveTransformations) {
178
- try {
179
- const transformations = getTransformations(props.src);
180
- cldOptions.rawTransformations = [...transformations.flat(), ...(props.rawTransformations || [])];
181
- } catch (e) {
182
- console.warn(`Failed to preserve transformations: ${e.message}`);
183
- }
184
- }
185
- /**
186
- * handleOnError
187
- */
188
- async function handleOnError(options) {
189
- const result = await pollForProcessingImage({
190
- src: options.target.src
191
- });
192
- if (result) {
193
- setImgKey(`${defaultImgKey};${Date.now()}`);
194
- }
195
- }
196
- return /*#__PURE__*/jsx(Image, _extends({}, imageProps, {
197
- loader: loaderOptions => cloudinaryLoader({
198
- loaderOptions,
199
- imageProps,
200
- cldOptions
201
- }),
202
- onError: handleOnError
203
- }), imgKey);
204
- };
205
-
206
- const _excluded$1 = ["excludeTags", "twitterTitle"];
207
- const IMAGE_WIDTH = 2400;
208
- const IMAGE_HEIGHT = 1200;
209
- const TWITTER_CARD = 'summary_large_image';
210
- const CldOgImage = _ref => {
211
- let {
212
- excludeTags = [],
213
- twitterTitle
214
- } = _ref,
215
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
216
- const options = _extends({}, props, {
217
- alt: props.alt,
218
- crop: props.crop || 'fill',
219
- gravity: props.gravity || 'center',
220
- height: props.height || IMAGE_HEIGHT,
221
- src: props.src,
222
- width: props.width || IMAGE_WIDTH
223
- });
224
- const ogImageUrl = constructCloudinaryUrl({
225
- options,
226
- config: {
227
- cloud: {
228
- cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
229
- }
230
- },
231
- analytics: {
232
- sdkCode: NEXT_CLOUDINARY_ANALYTICS_ID,
233
- sdkSemver: NEXT_CLOUDINARY_VERSION,
234
- techVersion: NEXT_VERSION,
235
- feature: ''
236
- }
237
- });
238
- // We need to include the tags within the Next.js Head component rather than
239
- // direcly adding them inside of the Head otherwise we get unexpected results
240
- return (
241
- /*#__PURE__*/
242
- // @ts-ignore
243
- jsxs(Head, {
244
- children: [/*#__PURE__*/jsx("meta", {
245
- property: "og:image",
246
- content: ogImageUrl
247
- }), /*#__PURE__*/jsx("meta", {
248
- property: "og:image:secure_url",
249
- content: ogImageUrl
250
- }), /*#__PURE__*/jsx("meta", {
251
- property: "og:image:width",
252
- content: options.width
253
- }), /*#__PURE__*/jsx("meta", {
254
- property: "og:image:height",
255
- content: options.height
256
- }), options.alt && /*#__PURE__*/jsx("meta", {
257
- property: "og:image:alt",
258
- content: options.alt
259
- }), !excludeTags.includes('twitter:title') && /*#__PURE__*/jsx("meta", {
260
- property: "twitter:title",
261
- content: twitterTitle || ' '
262
- }), /*#__PURE__*/jsx("meta", {
263
- property: "twitter:card",
264
- content: TWITTER_CARD
265
- }), /*#__PURE__*/jsx("meta", {
266
- property: "twitter:image",
267
- content: ogImageUrl
268
- })]
269
- })
270
- );
271
- };
272
-
273
- /**
274
- * triggerOnIdle
275
- * @see MDN Polyfill https://github.com/behnammodi/polyfill/blob/master/window.polyfill.js#L7-L24
276
- */
277
- function triggerOnIdle(callback) {
278
- if (window && 'requestIdleCallback' in window) {
279
- return requestIdleCallback(callback);
280
- }
281
- return setTimeout(() => callback(), 1);
282
- }
283
-
284
- let cloudinary;
285
- let widget;
286
- const CldUploadWidget = ({
287
- children,
288
- onUpload,
289
- options,
290
- signatureEndpoint,
291
- uploadPreset
292
- }) => {
293
- const signed = !!signatureEndpoint;
294
- /**
295
- * handleOnLoad
296
- * @description Stores the Cloudinary window instance to a ref when the widget script loads
297
- */
298
- function handleOnLoad() {
299
- if (!cloudinary) {
300
- cloudinary = window.cloudinary;
301
- }
302
- // To help improve load time of the widget on first instance, use requestIdleCallback
303
- // to trigger widget creation. Optional.
304
- triggerOnIdle(() => {
305
- if (!widget) {
306
- widget = createWidget();
307
- }
308
- });
309
- }
310
- /**
311
- * generateSignature
312
- * @description Makes a request to an endpoint to sign Cloudinary parameters as part of widget creation
313
- */
314
- function generateSignature(callback, paramsToSign) {
315
- fetch(signatureEndpoint, {
316
- method: 'POST',
317
- body: JSON.stringify({
318
- paramsToSign
319
- })
320
- }).then(r => r.json()).then(({
321
- signature
322
- }) => {
323
- callback(signature);
324
- });
325
- }
326
- /**
327
- * createWidget
328
- * @description Creates a new instance of the Cloudinary widget and stores in a ref
329
- */
330
- function createWidget() {
331
- var _cloudinary;
332
- // When creating a signed upload, you need to provide both your Cloudinary API Key
333
- // as well as a signature generator function that will sign any paramters
334
- // either on page load or during the upload process. Read more about signed uploads at:
335
- // https://cloudinary.com/documentation/upload_widget#signed_uploads
336
- const uploadOptions = _extends({
337
- cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,
338
- uploadPreset: uploadPreset || process.env.NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET,
339
- apiKey: process.env.NEXT_PUBLIC_CLOUDINARY_API_KEY
340
- }, options);
341
- if (signed) {
342
- uploadOptions.uploadSignature = generateSignature;
343
- // No need for apiSecret here because of api/sign-cloudinary-params
344
- if (!uploadOptions.apiKey) {
345
- return new Error("Signed Upload needs apiKey!");
346
- }
347
- }
348
- return (_cloudinary = cloudinary) == null ? void 0 : _cloudinary.createUploadWidget(uploadOptions, function (error, result) {
349
- // The callback is a bit more chatty than failed or success so
350
- // only trigger when one of those are the case. You can additionally
351
- // create a separate handler such as onEvent and trigger it on
352
- // ever occurrence
353
- if (error || result.event === "success") {
354
- onUpload(error, result, widget);
355
- }
356
- });
357
- }
358
- /**
359
- * open
360
- * @description When triggered, uses the current widget instance to open the upload modal
361
- */
362
- function open() {
363
- if (!widget) {
364
- widget = createWidget();
365
- }
366
- widget && widget.open();
367
- }
368
- return /*#__PURE__*/jsxs(Fragment, {
369
- children: [children({
370
- cloudinary,
371
- widget,
372
- open
373
- }), /*#__PURE__*/jsx(Script, {
374
- id: `cloudinary-${Math.floor(Math.random() * 100)}`,
375
- src: "https://widget.cloudinary.com/v2.0/global/all.js",
376
- onLoad: handleOnLoad,
377
- onError: e => console.error(`Failed to load Cloudinary: ${e.message}`)
378
- })]
379
- });
380
- };
381
-
382
- const _excluded = ["children", "onClick", "onUpload", "options", "signatureEndpoint", "uploadPreset"];
383
- const CldUploadButton = _ref => {
384
- let {
385
- children,
386
- onClick,
387
- onUpload,
388
- options,
389
- signatureEndpoint,
390
- uploadPreset
391
- } = _ref,
392
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
393
- return /*#__PURE__*/jsx(Fragment, {
394
- children: /*#__PURE__*/jsx(CldUploadWidget, {
395
- onUpload: onUpload,
396
- options: options,
397
- signatureEndpoint: signatureEndpoint,
398
- uploadPreset: uploadPreset,
399
- children: ({
400
- open
401
- }) => {
402
- function handleOnClick(e) {
403
- e.preventDefault();
404
- open();
405
- if (typeof onClick === 'function') {
406
- onClick(e);
407
- }
408
- }
409
- return /*#__PURE__*/jsx("button", _extends({}, props, {
410
- onClick: handleOnClick,
411
- children: children || 'Upload'
412
- }));
413
- }
414
- })
415
- });
416
- };
417
-
418
- export { CldImage, CldOgImage, CldUploadButton, CldUploadWidget, cloudinaryLoader };
419
- //# sourceMappingURL=next-cloudinary.modern.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"next-cloudinary.modern.mjs","sources":["../src/lib/cloudinary.ts","../src/constants/analytics.js","../src/loaders/cloudinary-loader.js","../src/components/CldImage/CldImage.tsx","../src/components/CldOgImage/CldOgImage.tsx","../src/lib/util.ts","../src/components/CldUploadWidget/CldUploadWidget.tsx","../src/components/CldUploadButton/CldUploadButton.tsx"],"sourcesContent":["/**\n * pollForProcessingImage\n */\n\nexport async function pollForProcessingImage(options): Promise<boolean> {\n const { src } = options;\n try {\n await new Promise((resolve, reject) => {\n fetch(src).then(res => {\n if ( !res.ok ) {\n reject(res);\n return;\n }\n resolve(res);\n });\n });\n } catch(e: any) {\n if ( e.status === 423 ) {\n return await pollForProcessingImage(options);\n }\n return false;\n }\n return true;\n}","import nextPkg from 'next/package.json';\nimport pkg from '../../package.json';\n\nexport const NEXT_CLOUDINARY_ANALYTICS_ID = 'V';\nexport const NEXT_CLOUDINARY_VERSION = pkg.version;\nexport const NEXT_VERSION = nextPkg.version;","import { constructCloudinaryUrl } from '@cloudinary-util/url-loader';\n\nimport { NEXT_CLOUDINARY_ANALYTICS_ID, NEXT_CLOUDINARY_VERSION, NEXT_VERSION } from '../constants/analytics';\n\nexport function cloudinaryLoader({ loaderOptions, imageProps, cldOptions, cldConfig = {} }) {\n const options = {\n ...imageProps,\n ...cldOptions\n }\n\n options.width = parseInt(options.width);\n options.height = parseInt(options.height);\n\n // The loader options are used to create dynamic sizing when working with responsive images\n // so these should override the default options collected from the props alone if\n // the results are different. While we don't always use the height in the loader logic,\n // we always pass it here, as the usage is determined later based on cropping.js\n\n if ( loaderOptions?.width && loaderOptions.width !== options.width ) {\n const multiplier = loaderOptions.width / options.width;\n options.widthResize = loaderOptions.width;\n options.heightResize = Math.round(options.height * multiplier);\n }\n\n return constructCloudinaryUrl({\n options,\n config: {\n cloud: {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME\n },\n ...cldConfig\n },\n analytics: {\n sdkCode: NEXT_CLOUDINARY_ANALYTICS_ID,\n sdkSemver: NEXT_CLOUDINARY_VERSION,\n techVersion: NEXT_VERSION,\n feature: ''\n }\n });\n}","'use client';\n\nimport { useState } from 'react';\nimport Image from 'next/image';\nimport { getTransformations } from '@cloudinary-util/util';\nimport { transformationPlugins } from '@cloudinary-util/url-loader';\n\nimport { pollForProcessingImage } from '../../lib/cloudinary';\n\nimport { cloudinaryLoader } from '../../loaders/cloudinary-loader';\n\nconst CldImage = props => {\n const CLD_OPTIONS = [\n 'deliveryType',\n 'preserveTransformations'\n ];\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 interface ImageProps {\n alt: string;\n blurDataURL?: string;\n src: string;\n }\n\n const imageProps: ImageProps = {\n alt: props.alt,\n src: props.src\n };\n\n Object.keys(props)\n .filter(key => !CLD_OPTIONS.includes(key))\n .forEach(key => imageProps[key] = props[key]);\n\n const defaultImgKey = Object.keys(imageProps).map(key => `${key}:${imageProps[key]}`).join(';');\n const [imgKey, setImgKey] = useState(defaultImgKey);\n\n // Construct Cloudinary-specific props by looking for values for any of the supported prop keys\n\n interface CldOptions {\n rawTransformations?: string[];\n }\n\n const cldOptions: CldOptions = {};\n\n CLD_OPTIONS.forEach(key => {\n if ( props[key] ) {\n cldOptions[key] = props[key] || undefined;\n }\n });\n\n // Try to preserve the original transformations from the Cloudinary URL passed in\n // to the component. This only works if the URL has a version number on it and otherwise\n // will fail to load\n\n if (props.preserveTransformations) {\n try {\n const transformations = getTransformations(props.src);\n cldOptions.rawTransformations = [...transformations.flat(), ...(props.rawTransformations || [])];\n } catch(e) {\n console.warn(`Failed to preserve transformations: ${(e as Error).message}`)\n }\n }\n\n /**\n * handleOnError\n */\n\n async function handleOnError(options) {\n const result = await pollForProcessingImage({ src: options.target.src })\n if ( result ) {\n setImgKey(`${defaultImgKey};${Date.now()}`);\n }\n }\n\n return (\n <Image\n key={imgKey}\n {...imageProps}\n loader={(loaderOptions) => cloudinaryLoader({ loaderOptions, imageProps, cldOptions })}\n onError={handleOnError}\n />\n );\n}\n\nexport default CldImage;\n","import Head from 'next/head';\nimport { constructCloudinaryUrl } from '@cloudinary-util/url-loader';\n\nimport { NEXT_CLOUDINARY_ANALYTICS_ID, NEXT_CLOUDINARY_VERSION, NEXT_VERSION } from '../../constants/analytics';\n\nconst IMAGE_WIDTH = 2400;\nconst IMAGE_HEIGHT = 1200;\n\nconst TWITTER_CARD = 'summary_large_image';\n\nconst CldOgImage = ({ excludeTags = [] as string[], twitterTitle, ...props }) => {\n const options = {\n ...props,\n alt: props.alt,\n crop: props.crop || 'fill',\n gravity: props.gravity || 'center',\n height: props.height || IMAGE_HEIGHT,\n src: props.src,\n width: props.width || IMAGE_WIDTH,\n }\n\n const ogImageUrl = constructCloudinaryUrl({\n options,\n config: {\n cloud: {\n cloudName: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME\n }\n },\n analytics: {\n sdkCode: NEXT_CLOUDINARY_ANALYTICS_ID,\n sdkSemver: NEXT_CLOUDINARY_VERSION,\n techVersion: NEXT_VERSION,\n feature: ''\n }\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 // @ts-ignore\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;","/**\n * triggerOnIdle\n * @see MDN Polyfill https://github.com/behnammodi/polyfill/blob/master/window.polyfill.js#L7-L24\n */\n\nexport function triggerOnIdle(callback: any) {\n if ( window && 'requestIdleCallback' in window ) {\n return requestIdleCallback(callback);\n }\n return setTimeout(() => callback(), 1);\n}","import Script from 'next/script';\n\nimport { triggerOnIdle } from '../../lib/util';\n\nlet cloudinary;\nlet widget;\n\nconst CldUploadWidget = ({\n children,\n onUpload,\n options,\n signatureEndpoint,\n uploadPreset,\n}) => {\n const signed = !!signatureEndpoint;\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 if ( !cloudinary ) {\n cloudinary = (window as any).cloudinary;\n }\n\n // To help improve load time of the widget on first instance, use requestIdleCallback\n // to trigger widget creation. Optional.\n\n triggerOnIdle(() => {\n if ( !widget ) {\n widget = createWidget();\n }\n });\n }\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?.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 occurrence\n if (error || result.event === \"success\") {\n onUpload(error, result, widget);\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) {\n widget = createWidget();\n }\n widget && widget.open();\n }\n\n return (\n <>\n {children({\n cloudinary,\n widget,\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 {/* @ts-ignore */}\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":["pollForProcessingImage","options","src","Promise","resolve","reject","fetch","then","res","ok","e","status","NEXT_CLOUDINARY_ANALYTICS_ID","NEXT_CLOUDINARY_VERSION","pkg","version","NEXT_VERSION","nextPkg","cloudinaryLoader","loaderOptions","imageProps","cldOptions","cldConfig","width","parseInt","height","multiplier","widthResize","heightResize","Math","round","constructCloudinaryUrl","config","cloud","cloudName","process","env","NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME","analytics","sdkCode","sdkSemver","techVersion","feature","CldImage","props","CLD_OPTIONS","transformationPlugins","forEach","prop","includes","Error","push","alt","Object","keys","filter","key","defaultImgKey","map","join","imgKey","setImgKey","useState","undefined","preserveTransformations","transformations","getTransformations","rawTransformations","flat","console","warn","message","handleOnError","result","target","Date","now","_jsx","IMAGE_WIDTH","IMAGE_HEIGHT","TWITTER_CARD","CldOgImage","excludeTags","twitterTitle","_excluded","crop","gravity","ogImageUrl","_jsxs","triggerOnIdle","callback","window","requestIdleCallback","setTimeout","cloudinary","widget","CldUploadWidget","children","onUpload","signatureEndpoint","uploadPreset","signed","handleOnLoad","createWidget","generateSignature","paramsToSign","method","body","JSON","stringify","r","json","signature","uploadOptions","NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET","apiKey","NEXT_PUBLIC_CLOUDINARY_API_KEY","uploadSignature","createUploadWidget","error","event","open","_Fragment","floor","random","CldUploadButton","onClick","handleOnClick","preventDefault"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEG;AAEI,eAAeA,sBAAsB,CAACC,OAAO,EAAA;EAClD,MAAM;AAAEC,IAAAA,GAAAA;AAAK,GAAA,GAAGD,OAAO,CAAA;EACvB,IAAI;AACF,IAAA,MAAM,IAAIE,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAI;AACpCC,MAAAA,KAAK,CAAC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