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