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