@jetbrains/ring-ui-built 6.0.33 → 6.0.34
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.
@@ -152,7 +152,6 @@ var Input = /*#__PURE__*/function (_PureComponent) {
|
|
152
152
|
[modules_88cfaf40.active]: active,
|
153
153
|
[modules_88cfaf40.error]: error != null,
|
154
154
|
[modules_88cfaf40.empty]: empty,
|
155
|
-
[modules_88cfaf40.noLabel]: !this.props.label,
|
156
155
|
[modules_88cfaf40.withIcon]: icon != null,
|
157
156
|
[modules_88cfaf40.clearable]: clearable,
|
158
157
|
[modules_88cfaf40.borderless]: borderless
|
@@ -33,12 +33,11 @@ export default class HTTP implements Partial<HTTPAuth> {
|
|
33
33
|
constructor(auth?: HTTPAuth, baseUrl?: string | null | undefined, fetchConfig?: RequestInit);
|
34
34
|
setAuth: (auth: HTTPAuth) => void;
|
35
35
|
setBaseUrl: (baseUrl: string | null | undefined) => void;
|
36
|
-
_fetch(...args: Parameters<typeof fetch>): Promise<Response
|
36
|
+
_fetch(...args: Parameters<typeof fetch>): Promise<Response>;
|
37
37
|
private _makeRequestUrl;
|
38
38
|
private _performRequest;
|
39
39
|
private _storeRequestMeta;
|
40
40
|
private _processResponse;
|
41
|
-
private static _isErrorStatus;
|
42
41
|
fetch: <T = unknown>(url: string, params?: FetchParams) => Promise<T>;
|
43
42
|
authorizedFetch(...args: Parameters<HTTP['_performRequest']>): Promise<any>;
|
44
43
|
request: <T = unknown>(url: string, params?: RequestParams) => Promise<T>;
|
package/components/http/http.js
CHANGED
@@ -22,8 +22,6 @@ var _excluded = ["body", "query"],
|
|
22
22
|
* @name HTTP
|
23
23
|
*/
|
24
24
|
var TOKEN_TYPE = 'Bearer';
|
25
|
-
var STATUS_OK_IF_MORE_THAN = 200;
|
26
|
-
var STATUS_BAD_IF_MORE_THAN = 300;
|
27
25
|
var defaultFetchConfig = {
|
28
26
|
headers: {
|
29
27
|
'Content-Type': 'application/json',
|
@@ -286,20 +284,19 @@ var HTTP = /*#__PURE__*/function () {
|
|
286
284
|
key: "_processResponse",
|
287
285
|
value: function () {
|
288
286
|
var _processResponse2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(response) {
|
289
|
-
var
|
290
|
-
var contentType, isJson, resJson, _response$json, _response$text, _response$json2, _response$text2, parsedResponse;
|
287
|
+
var contentType, isJson, resJson, parsedResponse;
|
291
288
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
292
289
|
while (1) switch (_context3.prev = _context3.next) {
|
293
290
|
case 0:
|
294
|
-
contentType =
|
291
|
+
contentType = response.headers.get('content-type');
|
295
292
|
isJson = contentType && contentType.indexOf('application/json') !== -1;
|
296
|
-
if (
|
293
|
+
if (response.ok) {
|
297
294
|
_context3.next = 12;
|
298
295
|
break;
|
299
296
|
}
|
300
297
|
_context3.prev = 3;
|
301
298
|
_context3.next = 6;
|
302
|
-
return isJson ?
|
299
|
+
return isJson ? response.json() : response.text();
|
303
300
|
case 6:
|
304
301
|
resJson = _context3.sent;
|
305
302
|
_context3.next = 11;
|
@@ -315,12 +312,12 @@ var HTTP = /*#__PURE__*/function () {
|
|
315
312
|
_context3.next = 17;
|
316
313
|
break;
|
317
314
|
}
|
318
|
-
_context3.t1 =
|
315
|
+
_context3.t1 = response.json();
|
319
316
|
_context3.next = 21;
|
320
317
|
break;
|
321
318
|
case 17:
|
322
319
|
_context3.next = 19;
|
323
|
-
return
|
320
|
+
return response.text();
|
324
321
|
case 19:
|
325
322
|
_context3.t2 = _context3.sent;
|
326
323
|
_context3.t1 = {
|
@@ -373,11 +370,6 @@ var HTTP = /*#__PURE__*/function () {
|
|
373
370
|
}
|
374
371
|
return authorizedFetch;
|
375
372
|
}()
|
376
|
-
}], [{
|
377
|
-
key: "_isErrorStatus",
|
378
|
-
value: function _isErrorStatus(status) {
|
379
|
-
return status < STATUS_OK_IF_MORE_THAN || status >= STATUS_BAD_IF_MORE_THAN;
|
380
|
-
}
|
381
373
|
}]);
|
382
374
|
}();
|
383
375
|
|
@@ -8,11 +8,7 @@ export default class HTTPMock extends HTTP {
|
|
8
8
|
requests: HTTPMockRequest[];
|
9
9
|
responsesByUrlMap: Map<string | RegExp, unknown>;
|
10
10
|
constructor();
|
11
|
-
_fetch(url: string, params: RequestInit):
|
12
|
-
status: number;
|
13
|
-
headers: Headers;
|
14
|
-
json: () => Promise<unknown>;
|
15
|
-
};
|
11
|
+
_fetch(url: string, params: RequestInit): Promise<Response>;
|
16
12
|
respondDefault(response: unknown): void;
|
17
13
|
respondForUrl(url: string | RegExp, response: unknown): void;
|
18
14
|
_getResponseForUrl(urlToMatch: string): unknown;
|
@@ -55,7 +55,7 @@ var HTTPMock = /*#__PURE__*/function (_HTTP) {
|
|
55
55
|
body: typeof params.body === 'string' ? JSON.parse(params.body) : params.body
|
56
56
|
})
|
57
57
|
}]);
|
58
|
-
return {
|
58
|
+
return Promise.resolve({
|
59
59
|
status: 200,
|
60
60
|
headers: new Headers({
|
61
61
|
'content-type': 'application/json'
|
@@ -63,7 +63,7 @@ var HTTPMock = /*#__PURE__*/function (_HTTP) {
|
|
63
63
|
json: function json() {
|
64
64
|
return Promise.resolve(_this2._getResponseForUrl(url) || _this2.defaultResponse);
|
65
65
|
}
|
66
|
-
};
|
66
|
+
});
|
67
67
|
}
|
68
68
|
}, {
|
69
69
|
key: "respondDefault",
|
@@ -11,11 +11,11 @@ var MAJOR_VERSION_INDEX = 0;
|
|
11
11
|
/**
|
12
12
|
* SUPPORTED_BROWSERS are defined by Babel plugin, see babel config
|
13
13
|
*/
|
14
|
-
if (!["and_chr
|
14
|
+
if (!["and_chr 125", "chrome 125", "chrome 124", "chrome 123", "chrome 109", "edge 125", "edge 124", "ios_saf 17.4", "ios_saf 16.6-16.7", "op_mob 80", "safari 17.4", "samsung 25"]) {
|
15
15
|
// eslint-disable-next-line no-console
|
16
16
|
console.warn('Ring UI: no SUPPORTED_BROWSERS passed. Please check babel config.');
|
17
17
|
}
|
18
|
-
var SUPPORTED = ["and_chr
|
18
|
+
var SUPPORTED = ["and_chr 125", "chrome 125", "chrome 124", "chrome 123", "chrome 109", "edge 125", "edge 124", "ios_saf 17.4", "ios_saf 16.6-16.7", "op_mob 80", "safari 17.4", "samsung 25"] || [];
|
19
19
|
var WHITE_LISTED_BROWSERS = ['chrome', 'firefox', 'safari', 'edge'];
|
20
20
|
var WHITE_LIST = SUPPORTED.reduce(function (acc, item) {
|
21
21
|
var _item$match;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@jetbrains/ring-ui-built",
|
3
|
-
"version": "6.0.
|
3
|
+
"version": "6.0.34",
|
4
4
|
"description": "JetBrains UI library",
|
5
5
|
"author": "JetBrains",
|
6
6
|
"license": "Apache-2.0",
|
@@ -89,7 +89,6 @@
|
|
89
89
|
},
|
90
90
|
"dependencies": {
|
91
91
|
"@jetbrains/icons": "^4.2.0",
|
92
|
-
"@jetbrains/logos": "^3.0.0-canary.734b213.0",
|
93
92
|
"change-case": "^4.1.1",
|
94
93
|
"classnames": "^2.5.1",
|
95
94
|
"combokeys": "^3.0.1",
|