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