@mjhls/mjh-framework 1.0.683 → 1.0.684-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/AD.js +1 -1
- package/dist/cjs/AD300x250.js +3 -3
- package/dist/cjs/AD300x250x600.js +3 -3
- package/dist/cjs/AD728x90.js +4 -4
- package/dist/cjs/ADFloatingFooter.js +2 -2
- package/dist/cjs/ADGutter.js +2 -2
- package/dist/cjs/ADSkyscraper.js +2 -2
- package/dist/cjs/ADSponsoredResources.js +2 -2
- package/dist/cjs/ADWebcast.js +2 -2
- package/dist/cjs/ADWelcome.js +2 -2
- package/dist/cjs/AdSlot.js +2 -2
- package/dist/cjs/AdSlotsProvider.js +1 -1
- package/dist/cjs/ArticleCarousel.js +1 -1
- package/dist/cjs/ArticleSeriesListing.js +4 -4
- package/dist/cjs/Auth.js +256 -507
- package/dist/cjs/{BlockContent-88f69acd.js → BlockContent-091a991f.js} +1 -1
- package/dist/cjs/BrowseVideosListing.js +1 -1
- package/dist/cjs/CMEDeck.js +5 -5
- package/dist/cjs/Column3.js +4 -4
- package/dist/cjs/ConferenceArticleCard.js +2 -2
- package/dist/cjs/DeckContent.js +7 -7
- package/dist/cjs/DeckQueue.js +6 -6
- package/dist/cjs/{Dfp-b2bc3b97.js → Dfp-f6a18ed2.js} +1 -1
- package/dist/cjs/EventsDeck.js +4 -4
- package/dist/cjs/ExternalResources.js +7 -7
- package/dist/cjs/Feature.js +3 -3
- package/dist/cjs/ForbesHero.js +2 -2
- package/dist/cjs/GridContent.js +10 -10
- package/dist/cjs/GridHero.js +2 -2
- package/dist/cjs/GroupDeck.js +1 -1
- package/dist/cjs/HamMagazine.js +4 -4
- package/dist/cjs/Hero.js +1 -1
- package/dist/cjs/HorizontalHero.js +2 -2
- package/dist/cjs/IssueContentDeck.js +2 -2
- package/dist/cjs/IssueDeck.js +2 -2
- package/dist/cjs/IssueLanding.js +8 -7
- package/dist/cjs/LeftNav.js +2 -2
- package/dist/cjs/MasterDeck.js +7 -7
- package/dist/cjs/NavMagazine.js +4 -4
- package/dist/cjs/NavNative.js +3 -3
- package/dist/cjs/OncliveHero.js +2 -2
- package/dist/cjs/OncliveLargeHero.js +2 -2
- package/dist/cjs/PartnerDetailListing.js +1213 -15
- package/dist/cjs/PublicationDeck.js +1 -1
- package/dist/cjs/QueueDeckExpanded.js +256 -18
- package/dist/cjs/RecentNews.js +2 -2
- package/dist/cjs/RelatedContent.js +2 -2
- package/dist/cjs/{SocialSearchComponent-6b5e5b47.js → SocialSearchComponent-9cd24578.js} +5 -5
- package/dist/cjs/TaxonomyCard.js +2 -2
- package/dist/cjs/TemplateNormal.js +3 -3
- package/dist/cjs/ThumbnailCard.js +1 -1
- package/dist/cjs/Ustream.js +2 -2
- package/dist/cjs/VerticalHero.js +2 -2
- package/dist/cjs/VideoSeriesCard.js +2 -2
- package/dist/cjs/VideoSeriesListing.js +3 -3
- package/dist/cjs/View.js +532 -137
- package/dist/cjs/YahooHero.js +2 -2
- package/dist/cjs/YoutubeGroup.js +1 -1
- package/dist/cjs/getQuery.js +2 -2
- package/dist/cjs/getRelatedArticle.js +354 -5
- package/dist/cjs/getSerializers.js +6 -6
- package/dist/cjs/{getTargeting-fee8c429.js → getTargeting-9af0ef69.js} +2 -2
- package/dist/cjs/getTargeting.js +1 -1
- package/dist/cjs/{index-5be2866f.js → index-3294d3bc.js} +1 -1
- package/dist/cjs/index-bd6c9f56.js +211 -0
- package/dist/cjs/{index-b5eb3ff8.js → index-be0c82be.js} +19 -20
- package/dist/cjs/{index-8c9e8ca7.js → index-c49c3b5e.js} +450 -462
- package/dist/cjs/{index-2d0a4911.js → index-fa8ed292.js} +27 -34
- package/dist/cjs/{index.es-ab3f2690.js → index.es-9110add6.js} +1 -3
- package/dist/cjs/index.js +16 -16
- package/dist/cjs/{main-b6c96c8d.js → main-a4cb15bb.js} +36 -67
- package/dist/cjs/{moment-66a6a284.js → moment-575fe24c.js} +1 -1
- package/dist/cjs/timeDifferenceCalc.js +41 -0
- package/dist/cjs/urlFor.js +1 -1
- package/dist/esm/AD.js +1 -1
- package/dist/esm/AD300x250.js +3 -3
- package/dist/esm/AD300x250x600.js +3 -3
- package/dist/esm/AD728x90.js +4 -4
- package/dist/esm/ADFloatingFooter.js +2 -2
- package/dist/esm/ADGutter.js +2 -2
- package/dist/esm/ADSkyscraper.js +2 -2
- package/dist/esm/ADSponsoredResources.js +2 -2
- package/dist/esm/ADWebcast.js +2 -2
- package/dist/esm/ADWelcome.js +2 -2
- package/dist/esm/AdSlot.js +2 -2
- package/dist/esm/AdSlotsProvider.js +1 -1
- package/dist/esm/ArticleCarousel.js +1 -1
- package/dist/esm/ArticleSeriesListing.js +4 -4
- package/dist/esm/Auth.js +248 -499
- package/dist/esm/{BlockContent-a614acdf.js → BlockContent-e9b4ddcf.js} +1 -1
- package/dist/esm/BrowseVideosListing.js +1 -1
- package/dist/esm/CMEDeck.js +5 -5
- package/dist/esm/Column3.js +4 -4
- package/dist/esm/ConferenceArticleCard.js +2 -2
- package/dist/esm/DeckContent.js +7 -7
- package/dist/esm/DeckQueue.js +6 -6
- package/dist/esm/{Dfp-8a8fca18.js → Dfp-96b49def.js} +1 -1
- package/dist/esm/EventsDeck.js +4 -4
- package/dist/esm/ExternalResources.js +7 -7
- package/dist/esm/Feature.js +3 -3
- package/dist/esm/ForbesHero.js +2 -2
- package/dist/esm/GridContent.js +10 -10
- package/dist/esm/GridHero.js +2 -2
- package/dist/esm/GroupDeck.js +1 -1
- package/dist/esm/HamMagazine.js +4 -4
- package/dist/esm/Hero.js +1 -1
- package/dist/esm/HorizontalHero.js +2 -2
- package/dist/esm/IssueContentDeck.js +2 -2
- package/dist/esm/IssueDeck.js +2 -2
- package/dist/esm/IssueLanding.js +8 -7
- package/dist/esm/LeftNav.js +2 -2
- package/dist/esm/MasterDeck.js +7 -7
- package/dist/esm/NavMagazine.js +4 -4
- package/dist/esm/NavNative.js +3 -3
- package/dist/esm/OncliveHero.js +2 -2
- package/dist/esm/OncliveLargeHero.js +2 -2
- package/dist/esm/PartnerDetailListing.js +1210 -13
- package/dist/esm/PublicationDeck.js +1 -1
- package/dist/esm/QueueDeckExpanded.js +256 -18
- package/dist/esm/RecentNews.js +2 -2
- package/dist/esm/RelatedContent.js +2 -2
- package/dist/esm/{SocialSearchComponent-7f14e0f3.js → SocialSearchComponent-93233334.js} +5 -5
- package/dist/esm/TaxonomyCard.js +2 -2
- package/dist/esm/TemplateNormal.js +3 -3
- package/dist/esm/ThumbnailCard.js +1 -1
- package/dist/esm/Ustream.js +2 -2
- package/dist/esm/VerticalHero.js +2 -2
- package/dist/esm/VideoSeriesCard.js +2 -2
- package/dist/esm/VideoSeriesListing.js +3 -3
- package/dist/esm/View.js +512 -117
- package/dist/esm/YahooHero.js +2 -2
- package/dist/esm/YoutubeGroup.js +1 -1
- package/dist/esm/getQuery.js +2 -2
- package/dist/esm/getRelatedArticle.js +354 -5
- package/dist/esm/getSerializers.js +6 -6
- package/dist/esm/{index-93ec3c59.js → index-0e45a0b2.js} +27 -34
- package/dist/esm/{index-51a80699.js → index-73819142.js} +19 -20
- package/dist/esm/{index-5505d4f9.js → index-85783f24.js} +450 -462
- package/dist/esm/index-db3bb315.js +207 -0
- package/dist/esm/{index-d2f90501.js → index-ef6d5dcf.js} +1 -1
- package/dist/esm/{index.es-938a3a58.js → index.es-29c1cef5.js} +1 -3
- package/dist/esm/index.js +14 -14
- package/dist/esm/{main-0465b2a0.js → main-5d1e4bd3.js} +34 -65
- package/dist/esm/{moment-12415288.js → moment-e2f9b20c.js} +1 -1
- package/dist/esm/timeDifferenceCalc.js +39 -0
- package/dist/esm/urlFor.js +1 -1
- package/package.json +1 -1
- /package/dist/cjs/{ADInfeed-c676389b.js → ADInfeed-f27bc4b5.js} +0 -0
- /package/dist/cjs/{ADlgInfeed-57d63c87.js → ADlgInfeed-8decfd9e.js} +0 -0
- /package/dist/esm/{ADInfeed-97b8cea7.js → ADInfeed-1e0ca5e0.js} +0 -0
- /package/dist/esm/{ADlgInfeed-3ab91c75.js → ADlgInfeed-979cf0d5.js} +0 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/*!
|
|
4
|
+
* cookie
|
|
5
|
+
* Copyright(c) 2012-2014 Roman Shtylman
|
|
6
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
7
|
+
* MIT Licensed
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Module exports.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
var parse_1 = parse;
|
|
16
|
+
var serialize_1 = serialize;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Module variables.
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
var decode = decodeURIComponent;
|
|
24
|
+
var encode = encodeURIComponent;
|
|
25
|
+
var pairSplitRegExp = /; */;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* RegExp to match field-content in RFC 7230 sec 3.2
|
|
29
|
+
*
|
|
30
|
+
* field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
|
|
31
|
+
* field-vchar = VCHAR / obs-text
|
|
32
|
+
* obs-text = %x80-FF
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Parse a cookie header.
|
|
39
|
+
*
|
|
40
|
+
* Parse the given cookie header string into an object
|
|
41
|
+
* The object has the various cookies as keys(names) => values
|
|
42
|
+
*
|
|
43
|
+
* @param {string} str
|
|
44
|
+
* @param {object} [options]
|
|
45
|
+
* @return {object}
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
function parse(str, options) {
|
|
50
|
+
if (typeof str !== 'string') {
|
|
51
|
+
throw new TypeError('argument str must be a string');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var obj = {};
|
|
55
|
+
var opt = options || {};
|
|
56
|
+
var pairs = str.split(pairSplitRegExp);
|
|
57
|
+
var dec = opt.decode || decode;
|
|
58
|
+
|
|
59
|
+
for (var i = 0; i < pairs.length; i++) {
|
|
60
|
+
var pair = pairs[i];
|
|
61
|
+
var eq_idx = pair.indexOf('=');
|
|
62
|
+
|
|
63
|
+
// skip things that don't look like key=value
|
|
64
|
+
if (eq_idx < 0) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
var key = pair.substr(0, eq_idx).trim();
|
|
69
|
+
var val = pair.substr(++eq_idx, pair.length).trim();
|
|
70
|
+
|
|
71
|
+
// quoted values
|
|
72
|
+
if ('"' == val[0]) {
|
|
73
|
+
val = val.slice(1, -1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// only assign once
|
|
77
|
+
if (undefined == obj[key]) {
|
|
78
|
+
obj[key] = tryDecode(val, dec);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Serialize data into a cookie header.
|
|
87
|
+
*
|
|
88
|
+
* Serialize the a name value pair into a cookie string suitable for
|
|
89
|
+
* http headers. An optional options object specified cookie parameters.
|
|
90
|
+
*
|
|
91
|
+
* serialize('foo', 'bar', { httpOnly: true })
|
|
92
|
+
* => "foo=bar; httpOnly"
|
|
93
|
+
*
|
|
94
|
+
* @param {string} name
|
|
95
|
+
* @param {string} val
|
|
96
|
+
* @param {object} [options]
|
|
97
|
+
* @return {string}
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
function serialize(name, val, options) {
|
|
102
|
+
var opt = options || {};
|
|
103
|
+
var enc = opt.encode || encode;
|
|
104
|
+
|
|
105
|
+
if (typeof enc !== 'function') {
|
|
106
|
+
throw new TypeError('option encode is invalid');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (!fieldContentRegExp.test(name)) {
|
|
110
|
+
throw new TypeError('argument name is invalid');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
var value = enc(val);
|
|
114
|
+
|
|
115
|
+
if (value && !fieldContentRegExp.test(value)) {
|
|
116
|
+
throw new TypeError('argument val is invalid');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var str = name + '=' + value;
|
|
120
|
+
|
|
121
|
+
if (null != opt.maxAge) {
|
|
122
|
+
var maxAge = opt.maxAge - 0;
|
|
123
|
+
|
|
124
|
+
if (isNaN(maxAge) || !isFinite(maxAge)) {
|
|
125
|
+
throw new TypeError('option maxAge is invalid')
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
str += '; Max-Age=' + Math.floor(maxAge);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (opt.domain) {
|
|
132
|
+
if (!fieldContentRegExp.test(opt.domain)) {
|
|
133
|
+
throw new TypeError('option domain is invalid');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
str += '; Domain=' + opt.domain;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (opt.path) {
|
|
140
|
+
if (!fieldContentRegExp.test(opt.path)) {
|
|
141
|
+
throw new TypeError('option path is invalid');
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
str += '; Path=' + opt.path;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (opt.expires) {
|
|
148
|
+
if (typeof opt.expires.toUTCString !== 'function') {
|
|
149
|
+
throw new TypeError('option expires is invalid');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
str += '; Expires=' + opt.expires.toUTCString();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (opt.httpOnly) {
|
|
156
|
+
str += '; HttpOnly';
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (opt.secure) {
|
|
160
|
+
str += '; Secure';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (opt.sameSite) {
|
|
164
|
+
var sameSite = typeof opt.sameSite === 'string'
|
|
165
|
+
? opt.sameSite.toLowerCase() : opt.sameSite;
|
|
166
|
+
|
|
167
|
+
switch (sameSite) {
|
|
168
|
+
case true:
|
|
169
|
+
str += '; SameSite=Strict';
|
|
170
|
+
break;
|
|
171
|
+
case 'lax':
|
|
172
|
+
str += '; SameSite=Lax';
|
|
173
|
+
break;
|
|
174
|
+
case 'strict':
|
|
175
|
+
str += '; SameSite=Strict';
|
|
176
|
+
break;
|
|
177
|
+
case 'none':
|
|
178
|
+
str += '; SameSite=None';
|
|
179
|
+
break;
|
|
180
|
+
default:
|
|
181
|
+
throw new TypeError('option sameSite is invalid');
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return str;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Try decoding a string using a decoding function.
|
|
190
|
+
*
|
|
191
|
+
* @param {string} str
|
|
192
|
+
* @param {function} decode
|
|
193
|
+
* @private
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
function tryDecode(str, decode) {
|
|
197
|
+
try {
|
|
198
|
+
return decode(str);
|
|
199
|
+
} catch (e) {
|
|
200
|
+
return str;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
var cookie = {
|
|
205
|
+
parse: parse_1,
|
|
206
|
+
serialize: serialize_1
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
exports.cookie = cookie;
|
|
210
|
+
exports.parse_1 = parse_1;
|
|
211
|
+
exports.serialize_1 = serialize_1;
|
|
@@ -60,35 +60,35 @@ function parseSource(source) {
|
|
|
60
60
|
if (typeof source === 'string' && isUrl(source)) {
|
|
61
61
|
// Someone passed an existing image url?
|
|
62
62
|
image = {
|
|
63
|
-
asset: { _ref: urlToId(source) }
|
|
63
|
+
asset: { _ref: urlToId(source) }
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
else if (typeof source === 'string') {
|
|
67
67
|
// Just an asset id
|
|
68
68
|
image = {
|
|
69
|
-
asset: { _ref: source }
|
|
69
|
+
asset: { _ref: source }
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
else if (isRef(source)) {
|
|
73
73
|
// We just got passed an asset directly
|
|
74
74
|
image = {
|
|
75
|
-
asset: source
|
|
75
|
+
asset: source
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
else if (isAsset(source)) {
|
|
79
79
|
// If we were passed an image asset document
|
|
80
80
|
image = {
|
|
81
81
|
asset: {
|
|
82
|
-
_ref: source._id || ''
|
|
83
|
-
}
|
|
82
|
+
_ref: source._id || ''
|
|
83
|
+
}
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
else if (isAssetStub(source)) {
|
|
87
87
|
// If we were passed a partial asset (`url`, but no `_id`)
|
|
88
88
|
image = {
|
|
89
89
|
asset: {
|
|
90
|
-
_ref: urlToId(source.asset.url)
|
|
91
|
-
}
|
|
90
|
+
_ref: urlToId(source.asset.url)
|
|
91
|
+
}
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
else if (typeof source.asset === 'object') {
|
|
@@ -129,7 +129,7 @@ function applyDefaults(image) {
|
|
|
129
129
|
left: 0,
|
|
130
130
|
top: 0,
|
|
131
131
|
bottom: 0,
|
|
132
|
-
right: 0
|
|
132
|
+
right: 0
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
if (!result.hotspot) {
|
|
@@ -137,7 +137,7 @@ function applyDefaults(image) {
|
|
|
137
137
|
x: 0.5,
|
|
138
138
|
y: 0.5,
|
|
139
139
|
height: 1.0,
|
|
140
|
-
width: 1.0
|
|
140
|
+
width: 1.0
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
143
|
return result;
|
|
@@ -184,7 +184,7 @@ exports.SPEC_NAME_TO_URL_NAME_MAPPINGS = [
|
|
|
184
184
|
['crop', 'crop'],
|
|
185
185
|
['saturation', 'sat'],
|
|
186
186
|
['auto', 'auto'],
|
|
187
|
-
['dpr', 'dpr']
|
|
187
|
+
['dpr', 'dpr']
|
|
188
188
|
];
|
|
189
189
|
function urlForImage(options) {
|
|
190
190
|
var spec = __assign({}, (options || {}));
|
|
@@ -203,7 +203,7 @@ function urlForImage(options) {
|
|
|
203
203
|
left: cropLeft,
|
|
204
204
|
top: cropTop,
|
|
205
205
|
width: Math.round(asset.width - image.crop.right * asset.width - cropLeft),
|
|
206
|
-
height: Math.round(asset.height - image.crop.bottom * asset.height - cropTop)
|
|
206
|
+
height: Math.round(asset.height - image.crop.bottom * asset.height - cropTop)
|
|
207
207
|
};
|
|
208
208
|
// Compute hot spot rect in terms of pixel coordinates
|
|
209
209
|
var hotSpotVerticalRadius = (image.hotspot.height * asset.height) / 2;
|
|
@@ -214,7 +214,7 @@ function urlForImage(options) {
|
|
|
214
214
|
left: hotSpotCenterX - hotSpotHorizontalRadius,
|
|
215
215
|
top: hotSpotCenterY - hotSpotVerticalRadius,
|
|
216
216
|
right: hotSpotCenterX + hotSpotHorizontalRadius,
|
|
217
|
-
bottom: hotSpotCenterY + hotSpotVerticalRadius
|
|
217
|
+
bottom: hotSpotCenterY + hotSpotVerticalRadius
|
|
218
218
|
};
|
|
219
219
|
// If irrelevant, or if we are requested to: don't perform crop/fit based on
|
|
220
220
|
// the crop/hotspot.
|
|
@@ -296,7 +296,7 @@ function fit(source, spec) {
|
|
|
296
296
|
left: Math.round(left),
|
|
297
297
|
top: Math.round(top_2),
|
|
298
298
|
width: Math.round(width),
|
|
299
|
-
height: Math.round(height)
|
|
299
|
+
height: Math.round(height)
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
302
|
else {
|
|
@@ -318,13 +318,13 @@ function fit(source, spec) {
|
|
|
318
318
|
left: Math.max(0, Math.floor(left)),
|
|
319
319
|
top: Math.max(0, Math.floor(top_3)),
|
|
320
320
|
width: Math.round(width),
|
|
321
|
-
height: Math.round(height)
|
|
321
|
+
height: Math.round(height)
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
324
|
return {
|
|
325
325
|
width: imgWidth,
|
|
326
326
|
height: imgHeight,
|
|
327
|
-
rect: cropRect
|
|
327
|
+
rect: cropRect
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
330
|
|
|
@@ -377,12 +377,11 @@ function urlBuilder(options) {
|
|
|
377
377
|
var client = options;
|
|
378
378
|
if (isSanityClient(client)) {
|
|
379
379
|
// Inherit config from client
|
|
380
|
-
var _a = client.clientConfig,
|
|
381
|
-
var apiHost = apiUrl || 'https://api.sanity.io';
|
|
380
|
+
var _a = client.clientConfig, apiHost = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
|
|
382
381
|
return new ImageUrlBuilder(null, {
|
|
383
382
|
baseUrl: apiHost.replace(/^https:\/\/api\./, 'https://cdn.'),
|
|
384
383
|
projectId: projectId,
|
|
385
|
-
dataset: dataset
|
|
384
|
+
dataset: dataset
|
|
386
385
|
});
|
|
387
386
|
}
|
|
388
387
|
// Or just accept the options as given
|
|
@@ -395,7 +394,7 @@ var ImageUrlBuilder = /** @class */ (function () {
|
|
|
395
394
|
? __assign(__assign({}, (parent.options || {})), (options || {})) : __assign({}, (options || {})); // Copy options
|
|
396
395
|
}
|
|
397
396
|
ImageUrlBuilder.prototype.withOptions = function (options) {
|
|
398
|
-
var baseUrl = options.baseUrl ||
|
|
397
|
+
var baseUrl = options.baseUrl || '';
|
|
399
398
|
var newOptions = { baseUrl: baseUrl };
|
|
400
399
|
for (var key in options) {
|
|
401
400
|
if (options.hasOwnProperty(key)) {
|
|
@@ -523,7 +522,7 @@ var ImageUrlBuilder = /** @class */ (function () {
|
|
|
523
522
|
ImageUrlBuilder.prototype.url = function () {
|
|
524
523
|
return urlForImage_1$1.default(this.options);
|
|
525
524
|
};
|
|
526
|
-
//
|
|
525
|
+
// Synonym for url()
|
|
527
526
|
ImageUrlBuilder.prototype.toString = function () {
|
|
528
527
|
return this.url();
|
|
529
528
|
};
|