@mjhls/mjh-framework 1.0.203 → 1.0.205

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.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD-e2479b7c.js +31 -0
  3. package/dist/cjs/DeckContent.js +430 -0
  4. package/dist/cjs/DeckQueue.js +366 -0
  5. package/dist/cjs/Dfp-d94f7f73.js +97 -0
  6. package/dist/cjs/GridContent.js +613 -0
  7. package/dist/cjs/GroupDeck.js +156 -0
  8. package/dist/cjs/IssueContentDeck.js +81 -0
  9. package/dist/cjs/IssueDeck.js +144 -0
  10. package/dist/cjs/MasterDeck.js +340 -0
  11. package/dist/cjs/Normal-7dd8c339.js +2374 -0
  12. package/dist/cjs/PublicationDeck.js +81 -0
  13. package/dist/cjs/QueueDeckExpanded.js +559 -0
  14. package/dist/cjs/TaxonomyCard-7b5b4298.js +1045 -0
  15. package/dist/cjs/TaxonomyCard.js +18 -0
  16. package/dist/cjs/TemplateNormal.js +29 -0
  17. package/dist/cjs/ThumbnailCard.js +58 -0
  18. package/dist/cjs/Ustream-0d3dd953.js +122 -0
  19. package/dist/cjs/Ustream.js +10 -0
  20. package/dist/cjs/VideoSeriesListing.js +248 -0
  21. package/dist/cjs/YoutubeGroup-f7707ceb.js +228 -0
  22. package/dist/cjs/YoutubeGroup.js +13 -0
  23. package/dist/cjs/_babelHelpers-f321c258.js +119 -0
  24. package/dist/cjs/_commonjsHelpers-3fc1f64e.js +20 -0
  25. package/dist/cjs/debounce-286eb3fb.js +279 -0
  26. package/dist/cjs/entities-3e0b4a16.js +506 -0
  27. package/dist/cjs/get-06aac51b.js +992 -0
  28. package/dist/cjs/index-0d0efcfa.js +610 -0
  29. package/dist/cjs/index-a4c53ff4.js +551 -0
  30. package/dist/cjs/index.es-2289df51.js +5028 -0
  31. package/dist/cjs/index.esm-340d3792.js +113 -0
  32. package/dist/cjs/index.js +12044 -0
  33. package/dist/cjs/isSymbol-311eb805.js +209 -0
  34. package/dist/cjs/main-58839f4e.js +858 -0
  35. package/dist/cjs/visibility-sensor-5c5a7302.js +2251 -0
  36. package/dist/esm/AD-1b2a3dd3.js +26 -0
  37. package/dist/esm/DeckContent.js +424 -0
  38. package/dist/esm/DeckQueue.js +360 -0
  39. package/dist/esm/Dfp-ab7941d3.js +92 -0
  40. package/dist/esm/GridContent.js +607 -0
  41. package/dist/esm/GroupDeck.js +151 -0
  42. package/dist/esm/IssueContentDeck.js +76 -0
  43. package/dist/esm/IssueDeck.js +139 -0
  44. package/dist/esm/MasterDeck.js +334 -0
  45. package/dist/esm/Normal-403c5666.js +2354 -0
  46. package/dist/esm/PublicationDeck.js +76 -0
  47. package/dist/esm/QueueDeckExpanded.js +553 -0
  48. package/dist/esm/TaxonomyCard-f9c93953.js +1039 -0
  49. package/dist/esm/TaxonomyCard.js +12 -0
  50. package/dist/esm/TemplateNormal.js +23 -0
  51. package/dist/esm/ThumbnailCard.js +53 -0
  52. package/dist/esm/Ustream-6bb45fe7.js +116 -0
  53. package/dist/esm/Ustream.js +4 -0
  54. package/dist/esm/VideoSeriesListing.js +242 -0
  55. package/dist/esm/YoutubeGroup-06df4923.js +222 -0
  56. package/dist/esm/YoutubeGroup.js +7 -0
  57. package/dist/esm/_babelHelpers-67c05996.js +111 -0
  58. package/dist/esm/_commonjsHelpers-ae1b5db5.js +15 -0
  59. package/dist/esm/debounce-a0242b4a.js +277 -0
  60. package/dist/esm/entities-e85d3a4a.js +503 -0
  61. package/dist/esm/get-b684ff61.js +990 -0
  62. package/dist/esm/index-3c1ee9ab.js +605 -0
  63. package/dist/esm/index-ca4ff5cb.js +548 -0
  64. package/dist/esm/index.es-f369b3e8.js +5022 -0
  65. package/dist/esm/index.esm-536609db.js +103 -0
  66. package/dist/esm/index.js +11991 -0
  67. package/dist/esm/isSymbol-c2b7d05a.js +203 -0
  68. package/dist/esm/main-dea495b7.js +851 -0
  69. package/dist/esm/visibility-sensor-3cfe6713.js +2243 -0
  70. package/package.json +8 -7
  71. package/dist/index.es.js +0 -30213
  72. package/dist/index.es.js.map +0 -1
  73. package/dist/index.js +0 -30271
  74. package/dist/index.js.map +0 -1
@@ -0,0 +1,548 @@
1
+ import { c as createCommonjsModule, u as unwrapExports, a as commonjsGlobal } from './_commonjsHelpers-ae1b5db5.js';
2
+
3
+ var parseAssetId_1 = createCommonjsModule(function (module, exports) {
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var example = 'image-Tb9Ew8CXIwaY6R1kjMvI0uRR-2000x3000-jpg';
6
+ function parseAssetId(ref) {
7
+ var _a = ref.split('-'), id = _a[1], dimensionString = _a[2], format = _a[3];
8
+ if (!id || !dimensionString || !format) {
9
+ throw new Error("Malformed asset _ref '" + ref + "'. Expected an id like \"" + example + "\".");
10
+ }
11
+ var _b = dimensionString.split('x'), imgWidthStr = _b[0], imgHeightStr = _b[1];
12
+ var width = +imgWidthStr;
13
+ var height = +imgHeightStr;
14
+ var isValidAssetId = isFinite(width) && isFinite(height);
15
+ if (!isValidAssetId) {
16
+ throw new Error("Malformed asset _ref '" + ref + "'. Expected an id like \"" + example + "\".");
17
+ }
18
+ return { id: id, width: width, height: height, format: format };
19
+ }
20
+ exports.default = parseAssetId;
21
+
22
+ });
23
+
24
+ unwrapExports(parseAssetId_1);
25
+
26
+ var parseSource_1 = createCommonjsModule(function (module, exports) {
27
+ var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
28
+ __assign = Object.assign || function(t) {
29
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
30
+ s = arguments[i];
31
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
32
+ t[p] = s[p];
33
+ }
34
+ return t;
35
+ };
36
+ return __assign.apply(this, arguments);
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ var isRef = function (src) {
40
+ var source = src;
41
+ return source ? typeof source._ref === 'string' : false;
42
+ };
43
+ var isAsset = function (src) {
44
+ var source = src;
45
+ return source ? typeof source._id === 'string' : false;
46
+ };
47
+ var isAssetStub = function (src) {
48
+ var source = src;
49
+ return source && source.asset ? typeof source.asset.url === 'string' : false;
50
+ };
51
+ // Convert an asset-id, asset or image to an image record suitable for processing
52
+ // eslint-disable-next-line complexity
53
+ function parseSource(source) {
54
+ if (!source) {
55
+ return null;
56
+ }
57
+ var image;
58
+ if (typeof source === 'string' && isUrl(source)) {
59
+ // Someone passed an existing image url?
60
+ image = {
61
+ asset: { _ref: urlToId(source) }
62
+ };
63
+ }
64
+ else if (typeof source === 'string') {
65
+ // Just an asset id
66
+ image = {
67
+ asset: { _ref: source }
68
+ };
69
+ }
70
+ else if (isRef(source)) {
71
+ // We just got passed an asset directly
72
+ image = {
73
+ asset: source
74
+ };
75
+ }
76
+ else if (isAsset(source)) {
77
+ // If we were passed an image asset document
78
+ image = {
79
+ asset: {
80
+ _ref: source._id || ''
81
+ }
82
+ };
83
+ }
84
+ else if (isAssetStub(source)) {
85
+ // If we were passed a partial asset (`url`, but no `_id`)
86
+ image = {
87
+ asset: {
88
+ _ref: urlToId(source.asset.url)
89
+ }
90
+ };
91
+ }
92
+ else if (typeof source.asset === 'object') {
93
+ // Probably an actual image with materialized asset
94
+ image = source;
95
+ }
96
+ else {
97
+ // We got something that does not look like an image, or it is an image
98
+ // that currently isn't sporting an asset.
99
+ return null;
100
+ }
101
+ var img = source;
102
+ if (img.crop) {
103
+ image.crop = img.crop;
104
+ }
105
+ if (img.hotspot) {
106
+ image.hotspot = img.hotspot;
107
+ }
108
+ return applyDefaults(image);
109
+ }
110
+ exports.default = parseSource;
111
+ function isUrl(url) {
112
+ return /^https?:\/\//.test("" + url);
113
+ }
114
+ function urlToId(url) {
115
+ var parts = url.split('/').slice(-1);
116
+ return ("image-" + parts[0]).replace(/\.([a-z]+)$/, '-$1');
117
+ }
118
+ // Mock crop and hotspot if image lacks it
119
+ function applyDefaults(image) {
120
+ if (image.crop && image.hotspot) {
121
+ return image;
122
+ }
123
+ // We need to pad in default values for crop or hotspot
124
+ var result = __assign({}, image);
125
+ if (!result.crop) {
126
+ result.crop = {
127
+ left: 0,
128
+ top: 0,
129
+ bottom: 0,
130
+ right: 0
131
+ };
132
+ }
133
+ if (!result.hotspot) {
134
+ result.hotspot = {
135
+ x: 0.5,
136
+ y: 0.5,
137
+ height: 1.0,
138
+ width: 1.0
139
+ };
140
+ }
141
+ return result;
142
+ }
143
+
144
+ });
145
+
146
+ unwrapExports(parseSource_1);
147
+
148
+ var urlForImage_1 = createCommonjsModule(function (module, exports) {
149
+ var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
150
+ __assign = Object.assign || function(t) {
151
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
152
+ s = arguments[i];
153
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
154
+ t[p] = s[p];
155
+ }
156
+ return t;
157
+ };
158
+ return __assign.apply(this, arguments);
159
+ };
160
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
161
+ return (mod && mod.__esModule) ? mod : { "default": mod };
162
+ };
163
+ Object.defineProperty(exports, "__esModule", { value: true });
164
+ var parseAssetId_1$1 = __importDefault(parseAssetId_1);
165
+ var parseSource_1$1 = __importDefault(parseSource_1);
166
+ exports.parseSource = parseSource_1$1.default;
167
+ exports.SPEC_NAME_TO_URL_NAME_MAPPINGS = [
168
+ ['width', 'w'],
169
+ ['height', 'h'],
170
+ ['format', 'fm'],
171
+ ['download', 'dl'],
172
+ ['blur', 'blur'],
173
+ ['sharpen', 'sharp'],
174
+ ['invert', 'invert'],
175
+ ['orientation', 'or'],
176
+ ['minHeight', 'min-h'],
177
+ ['maxHeight', 'max-h'],
178
+ ['minWidth', 'min-w'],
179
+ ['maxWidth', 'max-w'],
180
+ ['quality', 'q'],
181
+ ['fit', 'fit'],
182
+ ['crop', 'crop'],
183
+ ['saturation', 'sat'],
184
+ ['auto', 'auto'],
185
+ ['dpr', 'dpr']
186
+ ];
187
+ function urlForImage(options) {
188
+ var spec = __assign({}, (options || {}));
189
+ var source = spec.source;
190
+ delete spec.source;
191
+ var image = parseSource_1$1.default(source);
192
+ if (!image) {
193
+ return null;
194
+ }
195
+ var id = image.asset._ref || image.asset._id || '';
196
+ var asset = parseAssetId_1$1.default(id);
197
+ // Compute crop rect in terms of pixel coordinates in the raw source image
198
+ var cropLeft = Math.round(image.crop.left * asset.width);
199
+ var cropTop = Math.round(image.crop.top * asset.height);
200
+ var crop = {
201
+ left: cropLeft,
202
+ top: cropTop,
203
+ width: Math.round(asset.width - image.crop.right * asset.width - cropLeft),
204
+ height: Math.round(asset.height - image.crop.bottom * asset.height - cropTop)
205
+ };
206
+ // Compute hot spot rect in terms of pixel coordinates
207
+ var hotSpotVerticalRadius = (image.hotspot.height * asset.height) / 2;
208
+ var hotSpotHorizontalRadius = (image.hotspot.width * asset.width) / 2;
209
+ var hotSpotCenterX = image.hotspot.x * asset.width;
210
+ var hotSpotCenterY = image.hotspot.y * asset.height;
211
+ var hotspot = {
212
+ left: hotSpotCenterX - hotSpotHorizontalRadius,
213
+ top: hotSpotCenterY - hotSpotVerticalRadius,
214
+ right: hotSpotCenterX + hotSpotHorizontalRadius,
215
+ bottom: hotSpotCenterY + hotSpotVerticalRadius
216
+ };
217
+ // If irrelevant, or if we are requested to: don't perform crop/fit based on
218
+ // the crop/hotspot.
219
+ if (!(spec.rect || spec.focalPoint || spec.ignoreImageParams || spec.crop)) {
220
+ spec = __assign(__assign({}, spec), fit({ crop: crop, hotspot: hotspot }, spec));
221
+ }
222
+ return specToImageUrl(__assign(__assign({}, spec), { asset: asset }));
223
+ }
224
+ exports.default = urlForImage;
225
+ // eslint-disable-next-line complexity
226
+ function specToImageUrl(spec) {
227
+ var cdnUrl = spec.baseUrl || 'https://cdn.sanity.io';
228
+ var filename = spec.asset.id + "-" + spec.asset.width + "x" + spec.asset.height + "." + spec.asset.format;
229
+ var baseUrl = cdnUrl + "/images/" + spec.projectId + "/" + spec.dataset + "/" + filename;
230
+ var params = [];
231
+ if (spec.rect) {
232
+ // Only bother url with a crop if it actually crops anything
233
+ var _a = spec.rect, left = _a.left, top_1 = _a.top, width = _a.width, height = _a.height;
234
+ var isEffectiveCrop = left !== 0 || top_1 !== 0 || height !== spec.asset.height || width !== spec.asset.width;
235
+ if (isEffectiveCrop) {
236
+ params.push("rect=" + left + "," + top_1 + "," + width + "," + height);
237
+ }
238
+ }
239
+ if (spec.bg) {
240
+ params.push("bg=" + spec.bg);
241
+ }
242
+ if (spec.focalPoint) {
243
+ params.push("fp-x=" + spec.focalPoint.x);
244
+ params.push("fp-y=" + spec.focalPoint.y);
245
+ }
246
+ var flip = [spec.flipHorizontal && 'h', spec.flipVertical && 'v'].filter(Boolean).join('');
247
+ if (flip) {
248
+ params.push("flip=" + flip);
249
+ }
250
+ // Map from spec name to url param name, and allow using the actual param name as an alternative
251
+ exports.SPEC_NAME_TO_URL_NAME_MAPPINGS.forEach(function (mapping) {
252
+ var specName = mapping[0], param = mapping[1];
253
+ if (typeof spec[specName] !== 'undefined') {
254
+ params.push(param + "=" + encodeURIComponent(spec[specName]));
255
+ }
256
+ else if (typeof spec[param] !== 'undefined') {
257
+ params.push(param + "=" + encodeURIComponent(spec[param]));
258
+ }
259
+ });
260
+ if (params.length === 0) {
261
+ return baseUrl;
262
+ }
263
+ return baseUrl + "?" + params.join('&');
264
+ }
265
+ function fit(source, spec) {
266
+ var cropRect;
267
+ var imgWidth = spec.width;
268
+ var imgHeight = spec.height;
269
+ // If we are not constraining the aspect ratio, we'll just use the whole crop
270
+ if (!(imgWidth && imgHeight)) {
271
+ return { width: imgWidth, height: imgHeight, rect: source.crop };
272
+ }
273
+ var crop = source.crop;
274
+ var hotspot = source.hotspot;
275
+ // If we are here, that means aspect ratio is locked and fitting will be a bit harder
276
+ var desiredAspectRatio = imgWidth / imgHeight;
277
+ var cropAspectRatio = crop.width / crop.height;
278
+ if (cropAspectRatio > desiredAspectRatio) {
279
+ // The crop is wider than the desired aspect ratio. That means we are cutting from the sides
280
+ var height = crop.height;
281
+ var width = height * desiredAspectRatio;
282
+ var top_2 = crop.top;
283
+ // Center output horizontally over hotspot
284
+ var hotspotXCenter = (hotspot.right - hotspot.left) / 2 + hotspot.left;
285
+ var left = hotspotXCenter - width / 2;
286
+ // Keep output within crop
287
+ if (left < crop.left) {
288
+ left = crop.left;
289
+ }
290
+ else if (left + width > crop.left + crop.width) {
291
+ left = crop.left + crop.width - width;
292
+ }
293
+ cropRect = {
294
+ left: Math.round(left),
295
+ top: Math.round(top_2),
296
+ width: Math.round(width),
297
+ height: Math.round(height)
298
+ };
299
+ }
300
+ else {
301
+ // The crop is taller than the desired ratio, we are cutting from top and bottom
302
+ var width = crop.width;
303
+ var height = width / desiredAspectRatio;
304
+ var left = crop.left;
305
+ // Center output vertically over hotspot
306
+ var hotspotYCenter = (hotspot.bottom - hotspot.top) / 2 + hotspot.top;
307
+ var top_3 = hotspotYCenter - height / 2;
308
+ // Keep output rect within crop
309
+ if (top_3 < crop.top) {
310
+ top_3 = crop.top;
311
+ }
312
+ else if (top_3 + height > crop.top + crop.height) {
313
+ top_3 = crop.top + crop.height - height;
314
+ }
315
+ cropRect = {
316
+ left: Math.max(0, Math.floor(left)),
317
+ top: Math.max(0, Math.floor(top_3)),
318
+ width: Math.round(width),
319
+ height: Math.round(height)
320
+ };
321
+ }
322
+ return {
323
+ width: imgWidth,
324
+ height: imgHeight,
325
+ rect: cropRect
326
+ };
327
+ }
328
+
329
+ });
330
+
331
+ unwrapExports(urlForImage_1);
332
+ var urlForImage_2 = urlForImage_1.parseSource;
333
+ var urlForImage_3 = urlForImage_1.SPEC_NAME_TO_URL_NAME_MAPPINGS;
334
+
335
+ var builder = createCommonjsModule(function (module, exports) {
336
+ var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
337
+ __assign = Object.assign || function(t) {
338
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
339
+ s = arguments[i];
340
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
341
+ t[p] = s[p];
342
+ }
343
+ return t;
344
+ };
345
+ return __assign.apply(this, arguments);
346
+ };
347
+ var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
348
+ if (mod && mod.__esModule) return mod;
349
+ var result = {};
350
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
351
+ result["default"] = mod;
352
+ return result;
353
+ };
354
+ Object.defineProperty(exports, "__esModule", { value: true });
355
+ var urlForImage_1$1 = __importStar(urlForImage_1);
356
+ var validFits = ['clip', 'crop', 'fill', 'fillmax', 'max', 'scale', 'min'];
357
+ var validCrops = ['top', 'bottom', 'left', 'right', 'center', 'focalpoint', 'entropy'];
358
+ var validAutoModes = ['format'];
359
+ function isSanityClient(client) {
360
+ return client ? typeof client.clientConfig === 'object' : false;
361
+ }
362
+ function rewriteSpecName(key) {
363
+ var specs = urlForImage_1$1.SPEC_NAME_TO_URL_NAME_MAPPINGS;
364
+ for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) {
365
+ var entry = specs_1[_i];
366
+ var specName = entry[0], param = entry[1];
367
+ if (key === specName || key === param) {
368
+ return specName;
369
+ }
370
+ }
371
+ return key;
372
+ }
373
+ function urlBuilder(options) {
374
+ // Did we get a SanityClient?
375
+ var client = options;
376
+ if (isSanityClient(client)) {
377
+ // Inherit config from client
378
+ var _a = client.clientConfig, apiUrl = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
379
+ var apiHost = apiUrl || 'https://api.sanity.io';
380
+ return new ImageUrlBuilder(null, {
381
+ baseUrl: apiHost.replace(/^https:\/\/api\./, 'https://cdn.'),
382
+ projectId: projectId,
383
+ dataset: dataset
384
+ });
385
+ }
386
+ // Or just accept the options as given
387
+ return new ImageUrlBuilder(null, options);
388
+ }
389
+ exports.default = urlBuilder;
390
+ var ImageUrlBuilder = /** @class */ (function () {
391
+ function ImageUrlBuilder(parent, options) {
392
+ this.options = parent
393
+ ? __assign(__assign({}, (parent.options || {})), (options || {})) : __assign({}, (options || {})); // Copy options
394
+ }
395
+ ImageUrlBuilder.prototype.withOptions = function (options) {
396
+ var baseUrl = options.baseUrl || '';
397
+ var newOptions = { baseUrl: baseUrl };
398
+ for (var key in options) {
399
+ if (options.hasOwnProperty(key)) {
400
+ var specKey = rewriteSpecName(key);
401
+ newOptions[specKey] = options[key];
402
+ }
403
+ }
404
+ return new ImageUrlBuilder(this, __assign({ baseUrl: baseUrl }, newOptions));
405
+ };
406
+ // The image to be represented. Accepts a Sanity 'image'-document, 'asset'-document or
407
+ // _id of asset. To get the benefit of automatic hot-spot/crop integration with the content
408
+ // studio, the 'image'-document must be provided.
409
+ ImageUrlBuilder.prototype.image = function (source) {
410
+ return this.withOptions({ source: source });
411
+ };
412
+ // Specify the dataset
413
+ ImageUrlBuilder.prototype.dataset = function (dataset) {
414
+ return this.withOptions({ dataset: dataset });
415
+ };
416
+ // Specify the projectId
417
+ ImageUrlBuilder.prototype.projectId = function (projectId) {
418
+ return this.withOptions({ projectId: projectId });
419
+ };
420
+ // Specify background color
421
+ ImageUrlBuilder.prototype.bg = function (bg) {
422
+ return this.withOptions({ bg: bg });
423
+ };
424
+ // Set DPR scaling factor
425
+ ImageUrlBuilder.prototype.dpr = function (dpr) {
426
+ return this.withOptions({ dpr: dpr });
427
+ };
428
+ // Specify the width of the image in pixels
429
+ ImageUrlBuilder.prototype.width = function (width) {
430
+ return this.withOptions({ width: width });
431
+ };
432
+ // Specify the height of the image in pixels
433
+ ImageUrlBuilder.prototype.height = function (height) {
434
+ return this.withOptions({ height: height });
435
+ };
436
+ // Specify focal point in fraction of image dimensions. Each component 0.0-1.0
437
+ ImageUrlBuilder.prototype.focalPoint = function (x, y) {
438
+ return this.withOptions({ focalPoint: { x: x, y: y } });
439
+ };
440
+ ImageUrlBuilder.prototype.maxWidth = function (maxWidth) {
441
+ return this.withOptions({ maxWidth: maxWidth });
442
+ };
443
+ ImageUrlBuilder.prototype.minWidth = function (minWidth) {
444
+ return this.withOptions({ minWidth: minWidth });
445
+ };
446
+ ImageUrlBuilder.prototype.maxHeight = function (maxHeight) {
447
+ return this.withOptions({ maxHeight: maxHeight });
448
+ };
449
+ ImageUrlBuilder.prototype.minHeight = function (minHeight) {
450
+ return this.withOptions({ minHeight: minHeight });
451
+ };
452
+ // Specify width and height in pixels
453
+ ImageUrlBuilder.prototype.size = function (width, height) {
454
+ return this.withOptions({ width: width, height: height });
455
+ };
456
+ // Specify blur between 0 and 100
457
+ ImageUrlBuilder.prototype.blur = function (blur) {
458
+ return this.withOptions({ blur: blur });
459
+ };
460
+ ImageUrlBuilder.prototype.sharpen = function (sharpen) {
461
+ return this.withOptions({ sharpen: sharpen });
462
+ };
463
+ // Specify the desired rectangle of the image
464
+ ImageUrlBuilder.prototype.rect = function (left, top, width, height) {
465
+ return this.withOptions({ rect: { left: left, top: top, width: width, height: height } });
466
+ };
467
+ // Specify the image format of the image. 'jpg', 'pjpg', 'png', 'webp'
468
+ ImageUrlBuilder.prototype.format = function (format) {
469
+ return this.withOptions({ format: format });
470
+ };
471
+ ImageUrlBuilder.prototype.invert = function (invert) {
472
+ return this.withOptions({ invert: invert });
473
+ };
474
+ // Rotation in degrees 0, 90, 180, 270
475
+ ImageUrlBuilder.prototype.orientation = function (orientation) {
476
+ return this.withOptions({ orientation: orientation });
477
+ };
478
+ // Compression quality 0-100
479
+ ImageUrlBuilder.prototype.quality = function (quality) {
480
+ return this.withOptions({ quality: quality });
481
+ };
482
+ // Make it a download link. Parameter is default filename.
483
+ ImageUrlBuilder.prototype.forceDownload = function (download) {
484
+ return this.withOptions({ download: download });
485
+ };
486
+ // Flip image horizontally
487
+ ImageUrlBuilder.prototype.flipHorizontal = function () {
488
+ return this.withOptions({ flipHorizontal: true });
489
+ };
490
+ // Flip image verically
491
+ ImageUrlBuilder.prototype.flipVertical = function () {
492
+ return this.withOptions({ flipVertical: true });
493
+ };
494
+ // Ignore crop/hotspot from image record, even when present
495
+ ImageUrlBuilder.prototype.ignoreImageParams = function () {
496
+ return this.withOptions({ ignoreImageParams: true });
497
+ };
498
+ ImageUrlBuilder.prototype.fit = function (value) {
499
+ if (validFits.indexOf(value) === -1) {
500
+ throw new Error("Invalid fit mode \"" + value + "\"");
501
+ }
502
+ return this.withOptions({ fit: value });
503
+ };
504
+ ImageUrlBuilder.prototype.crop = function (value) {
505
+ if (validCrops.indexOf(value) === -1) {
506
+ throw new Error("Invalid crop mode \"" + value + "\"");
507
+ }
508
+ return this.withOptions({ crop: value });
509
+ };
510
+ // Saturation
511
+ ImageUrlBuilder.prototype.saturation = function (saturation) {
512
+ return this.withOptions({ saturation: saturation });
513
+ };
514
+ ImageUrlBuilder.prototype.auto = function (value) {
515
+ if (validAutoModes.indexOf(value) === -1) {
516
+ throw new Error("Invalid auto mode \"" + value + "\"");
517
+ }
518
+ return this.withOptions({ auto: value });
519
+ };
520
+ // Gets the url based on the submitted parameters
521
+ ImageUrlBuilder.prototype.url = function () {
522
+ return urlForImage_1$1.default(this.options);
523
+ };
524
+ // Synonym for url()
525
+ ImageUrlBuilder.prototype.toString = function () {
526
+ return this.url();
527
+ };
528
+ return ImageUrlBuilder;
529
+ }());
530
+ exports.ImageUrlBuilder = ImageUrlBuilder;
531
+
532
+ });
533
+
534
+ unwrapExports(builder);
535
+ var builder_1 = builder.ImageUrlBuilder;
536
+
537
+ var node = createCommonjsModule(function (module) {
538
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
539
+ return (mod && mod.__esModule) ? mod : { "default": mod };
540
+ };
541
+ var builder_1 = __importDefault(builder);
542
+ module.exports = builder_1.default;
543
+
544
+ });
545
+
546
+ var imageUrlBuilder = unwrapExports(node);
547
+
548
+ export { imageUrlBuilder as i, node as n };