@jetbrains/ring-ui-built 6.0.32 → 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.
- package/components/_helpers/_rollupPluginBabelHelpers.js +567 -1
- package/components/_helpers/anchor.js +6 -7
- package/components/_helpers/button__classes.js +14 -16
- package/components/_helpers/caption.js +20 -14
- package/components/_helpers/card.js +105 -95
- package/components/_helpers/dialog__body-scroll-preventer.js +19 -11
- package/components/_helpers/icon__svg.js +25 -22
- package/components/_helpers/input.js +176 -146
- package/components/_helpers/query-assist__suggestions.js +90 -74
- package/components/_helpers/select__filter.js +69 -48
- package/components/_helpers/services-link.js +37 -29
- package/components/_helpers/sidebar.js +107 -99
- package/components/_helpers/tab-link.js +7 -7
- package/components/_helpers/theme.js +40 -31
- package/components/_helpers/title.js +72 -57
- package/components/alert/alert.js +202 -150
- package/components/alert/container.js +41 -32
- package/components/alert-service/alert-service.js +170 -105
- package/components/analytics/analytics.js +22 -12
- package/components/analytics/analytics__custom-plugin.js +75 -54
- package/components/auth/auth.js +36 -4
- package/components/auth/auth__core.js +1471 -746
- package/components/auth/background-flow.js +127 -87
- package/components/auth/down-notification.js +73 -30
- package/components/auth/iframe-flow.js +133 -75
- package/components/auth/request-builder.js +82 -46
- package/components/auth/response-parser.js +116 -86
- package/components/auth/storage.js +334 -171
- package/components/auth/token-validator.js +242 -137
- package/components/auth/window-flow.js +134 -92
- package/components/auth-dialog/auth-dialog.js +172 -114
- package/components/auth-dialog-service/auth-dialog-service.js +31 -8
- package/components/avatar/avatar-example-datauri.js +1 -23
- package/components/avatar/avatar.js +152 -119
- package/components/avatar/fallback-avatar.js +38 -22
- package/components/badge/badge.js +45 -35
- package/components/button/button.js +107 -86
- package/components/button-group/button-group.js +33 -19
- package/components/button-set/button-set.js +32 -20
- package/components/button-toolbar/button-toolbar.js +31 -19
- package/components/caret/caret.js +220 -186
- package/components/checkbox/checkbox.js +101 -76
- package/components/clipboard/clipboard-fallback.js +10 -10
- package/components/clipboard/clipboard.js +132 -35
- package/components/code/code.js +166 -92
- package/components/collapse/collapse-content.js +64 -42
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +14 -12
- package/components/collapse/collapse.js +17 -11
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +3 -1
- package/components/confirm/confirm.js +104 -66
- package/components/confirm-service/confirm-service.js +59 -37
- package/components/content-layout/content-layout.js +64 -43
- package/components/content-layout/sidebar.js +1 -0
- package/components/contenteditable/contenteditable.js +59 -50
- package/components/control-label/control-label.js +9 -9
- package/components/data-list/data-list.js +182 -129
- package/components/data-list/data-list.mock.js +6 -2
- package/components/data-list/item.js +170 -143
- package/components/data-list/selection.js +136 -76
- package/components/data-list/title.js +12 -1
- package/components/date-picker/consts.js +26 -19
- package/components/date-picker/date-input.js +144 -113
- package/components/date-picker/date-picker.js +282 -227
- package/components/date-picker/date-popup.js +395 -350
- package/components/date-picker/day.js +116 -87
- package/components/date-picker/month-names.js +66 -43
- package/components/date-picker/month-slider.js +76 -51
- package/components/date-picker/month.js +25 -16
- package/components/date-picker/months.js +50 -43
- package/components/date-picker/weekdays.js +22 -12
- package/components/date-picker/years.js +110 -83
- package/components/dialog/dialog.js +190 -142
- package/components/dialog/dialog__body-scroll-preventer.js +4 -0
- package/components/dropdown/anchor.js +9 -0
- package/components/dropdown/dropdown.js +213 -182
- package/components/dropdown-menu/dropdown-menu.js +97 -71
- package/components/editable-heading/editable-heading.js +127 -75
- package/components/error-bubble/error-bubble.js +60 -31
- package/components/error-message/error-message.js +59 -39
- package/components/footer/footer.js +30 -27
- package/components/global/compose.js +10 -1
- package/components/global/composeRefs.js +12 -7
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +15 -15
- package/components/global/data-tests.js +14 -6
- package/components/global/dom.js +86 -47
- package/components/global/focus-sensor-hoc.js +132 -122
- package/components/global/fuzzy-highlight.js +36 -22
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +8 -4
- package/components/global/inject-styles.js +15 -10
- package/components/global/listeners.js +51 -27
- package/components/global/memoize.js +12 -6
- package/components/global/normalize-indent.js +50 -19
- package/components/global/promise-with-timeout.js +8 -6
- package/components/global/prop-types.js +5 -3
- package/components/global/react-dom-renderer.js +44 -28
- package/components/global/react-render-adapter.js +1 -1
- package/components/global/rerender-hoc.js +30 -12
- package/components/global/schedule-raf.js +6 -5
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.js +22 -0
- package/components/global/trivial-template-tag.js +10 -3
- package/components/global/typescript-utils.js +6 -2
- package/components/global/url.js +26 -20
- package/components/global/use-event-callback.js +4 -6
- package/components/grid/col.js +52 -35
- package/components/grid/grid.js +31 -17
- package/components/grid/row.js +47 -35
- package/components/group/group.js +25 -17
- package/components/header/header.js +78 -33
- package/components/header/logo.js +36 -20
- package/components/header/profile.js +199 -166
- package/components/header/services-link.js +4 -0
- package/components/header/services.js +116 -73
- package/components/header/smart-profile.js +203 -111
- package/components/header/smart-services.js +113 -62
- package/components/header/tray-icon.js +37 -21
- package/components/header/tray.js +32 -21
- package/components/heading/heading.js +25 -24
- package/components/http/http.d.ts +1 -2
- package/components/http/http.js +345 -203
- package/components/http/http.mock.d.ts +1 -5
- package/components/http/http.mock.js +101 -49
- package/components/hub-source/hub-source.js +190 -83
- package/components/hub-source/hub-source__user.js +44 -11
- package/components/hub-source/hub-source__users-groups.js +65 -37
- package/components/i18n/i18n-context.js +10 -7
- package/components/i18n/i18n.js +10 -7
- package/components/icon/icon.js +93 -76
- package/components/icon/icon__svg.js +8 -0
- package/components/icon/index.js +8 -0
- package/components/input/input.js +13 -0
- package/components/island/adaptive-island-hoc.js +43 -30
- package/components/island/content.js +132 -115
- package/components/island/header.js +70 -57
- package/components/island/island.js +40 -28
- package/components/island-legacy/content-legacy.js +25 -17
- package/components/island-legacy/header-legacy.js +27 -19
- package/components/island-legacy/island-legacy.js +25 -17
- package/components/link/clickableLink.js +59 -44
- package/components/link/link.js +68 -57
- package/components/list/consts.js +2 -2
- package/components/list/list.js +698 -611
- package/components/list/list__custom.js +62 -44
- package/components/list/list__hint.js +19 -10
- package/components/list/list__item.js +174 -133
- package/components/list/list__link.js +50 -37
- package/components/list/list__separator.js +24 -14
- package/components/list/list__title.js +32 -22
- package/components/list/list__users-groups-source.js +126 -54
- package/components/loader/loader.js +74 -43
- package/components/loader/loader__core.js +263 -198
- package/components/loader-inline/loader-inline.js +35 -23
- package/components/loader-screen/loader-screen.js +46 -25
- package/components/login-dialog/login-dialog.js +158 -111
- package/components/login-dialog/service.js +34 -8
- package/components/markdown/markdown.js +23 -15
- package/components/message/message.js +203 -161
- package/components/old-browsers-message/old-browsers-message.js +18 -11
- package/components/old-browsers-message/old-browsers-message__stop.js +7 -0
- package/components/old-browsers-message/white-list.js +17 -9
- package/components/pager/pager.js +271 -212
- package/components/panel/panel.js +25 -17
- package/components/permissions/permissions.js +172 -127
- package/components/permissions/permissions__cache.js +224 -194
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +343 -284
- package/components/popup/popup.target.js +8 -9
- package/components/popup/position.js +106 -96
- package/components/popup-menu/popup-menu.js +81 -44
- package/components/progress-bar/progress-bar.js +104 -87
- package/components/query-assist/query-assist.js +916 -838
- package/components/query-assist/query-assist__suggestions.js +30 -1
- package/components/radio/radio.js +34 -19
- package/components/radio/radio__item.js +69 -52
- package/components/select/select.js +957 -852
- package/components/select/select__filter.js +30 -0
- package/components/select/select__popup.js +487 -373
- package/components/shortcuts/core.js +217 -166
- package/components/shortcuts/shortcut-title.js +11 -6
- package/components/shortcuts/shortcuts-hoc.js +45 -19
- package/components/shortcuts/shortcuts.js +75 -50
- package/components/slider/slider.js +122 -99
- package/components/slider/slider.utils.js +24 -14
- package/components/storage/storage.js +33 -4
- package/components/storage/storage__fallback.js +224 -149
- package/components/storage/storage__local.js +153 -90
- package/components/tab-trap/tab-trap.js +153 -122
- package/components/table/cell.js +26 -14
- package/components/table/disable-hover-hoc.js +51 -33
- package/components/table/header-cell.js +89 -64
- package/components/table/header.js +132 -104
- package/components/table/multitable.js +125 -107
- package/components/table/row-with-focus-sensor.js +69 -25
- package/components/table/row.js +216 -175
- package/components/table/selection-adapter.js +3 -1
- package/components/table/selection-shortcuts-hoc.js +181 -180
- package/components/table/selection.js +226 -156
- package/components/table/smart-table.js +88 -50
- package/components/table/table.js +358 -289
- package/components/tabs/collapsible-more.js +79 -46
- package/components/tabs/collapsible-tab.js +38 -31
- package/components/tabs/collapsible-tabs.js +153 -88
- package/components/tabs/custom-item.js +2 -4
- package/components/tabs/dumb-tabs.js +117 -74
- package/components/tabs/smart-tabs.js +69 -29
- package/components/tabs/tab-link.js +5 -1
- package/components/tabs/tab.js +31 -19
- package/components/tabs/tabs.js +31 -0
- package/components/tag/tag.js +173 -133
- package/components/tags-input/tags-input.js +427 -329
- package/components/tags-list/tags-list.js +78 -57
- package/components/text/text.js +39 -28
- package/components/toggle/toggle.js +70 -56
- package/components/tooltip/tooltip.js +190 -146
- package/components/user-agreement/service.js +371 -228
- package/components/user-agreement/toolbox.eula.js +1 -160
- package/components/user-agreement/user-agreement.js +120 -85
- package/components/user-card/card.js +29 -0
- package/components/user-card/smart-user-card-tooltip.js +111 -51
- package/components/user-card/tooltip.js +84 -47
- package/components/user-card/user-card.js +29 -0
- package/package.json +1 -2
@@ -1,14 +1,25 @@
|
|
1
|
+
import { b as _createClass, f as _classCallCheck, _ as _defineProperty, h as _asyncToGenerator, i as _regeneratorRuntime } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import 'core-js/modules/es.object.to-string.js';
|
4
|
+
import 'core-js/modules/es.promise.js';
|
1
5
|
import AuthResponseParser from './response-parser.js';
|
6
|
+
import 'core-js/modules/es.array.index-of.js';
|
7
|
+
import 'core-js/modules/es.regexp.exec.js';
|
8
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
9
|
+
import 'core-js/modules/es.string.replace.js';
|
10
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
2
11
|
import 'es6-error';
|
3
12
|
import '../global/url.js';
|
13
|
+
import 'core-js/modules/es.string.match.js';
|
4
14
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
15
|
+
var HUB_AUTH_PAGE_OPENED = 'HUB_AUTH_PAGE_OPENED';
|
16
|
+
var BackgroundFlow = /*#__PURE__*/function () {
|
17
|
+
function BackgroundFlow(requestBuilder, storage, timeout) {
|
18
|
+
_classCallCheck(this, BackgroundFlow);
|
19
|
+
_defineProperty(this, "_requestBuilder", void 0);
|
20
|
+
_defineProperty(this, "_storage", void 0);
|
21
|
+
_defineProperty(this, "_timeout", void 0);
|
22
|
+
_defineProperty(this, "_promise", void 0);
|
12
23
|
this._requestBuilder = requestBuilder;
|
13
24
|
this._storage = storage;
|
14
25
|
this._timeout = timeout;
|
@@ -18,89 +29,118 @@ class BackgroundFlow {
|
|
18
29
|
* @return {HTMLIFrameElement}
|
19
30
|
* @private
|
20
31
|
*/
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
32
|
+
return _createClass(BackgroundFlow, [{
|
33
|
+
key: "_createHiddenFrame",
|
34
|
+
value: function _createHiddenFrame() {
|
35
|
+
var iframe = document.createElement('iframe');
|
36
|
+
iframe.style.border = iframe.style.width = iframe.style.height = '0px';
|
37
|
+
iframe.style.visibility = 'hidden';
|
38
|
+
iframe.style.position = 'fixed';
|
39
|
+
iframe.style.left = '-10000px';
|
40
|
+
window.document.body.appendChild(iframe);
|
41
|
+
return iframe;
|
42
|
+
}
|
43
|
+
/**
|
44
|
+
* Redirects the given iframe to the given URL
|
45
|
+
* @param {HTMLIFrameElement} iframe
|
46
|
+
* @param {string} url
|
47
|
+
* @private
|
48
|
+
*/
|
49
|
+
}, {
|
50
|
+
key: "_redirectFrame",
|
51
|
+
value: function _redirectFrame(iframe, url) {
|
52
|
+
iframe.src = "".concat(url, "&rnd=").concat(Math.random());
|
53
|
+
}
|
54
|
+
/**
|
55
|
+
* Refreshes the access token in an iframe.
|
56
|
+
*
|
57
|
+
* @return {Promise.<string>} promise that is resolved to access the token when it is loaded in a background iframe. The
|
58
|
+
* promise is rejected if no token was received after {@link BackgroundToken.BACKGROUND_TIMEOUT} ms.
|
59
|
+
*/
|
60
|
+
}, {
|
61
|
+
key: "_load",
|
62
|
+
value: (function () {
|
63
|
+
var _load2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
64
|
+
var _this = this;
|
65
|
+
var authRequest;
|
66
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
67
|
+
while (1) switch (_context.prev = _context.next) {
|
68
|
+
case 0:
|
69
|
+
_context.next = 2;
|
70
|
+
return this._requestBuilder.
|
71
|
+
// eslint-disable-next-line camelcase
|
72
|
+
prepareAuthRequest({
|
73
|
+
request_credentials: 'silent'
|
74
|
+
}, {
|
75
|
+
nonRedirect: true
|
76
|
+
});
|
77
|
+
case 2:
|
78
|
+
authRequest = _context.sent;
|
79
|
+
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
80
|
+
function onMessage(e) {
|
81
|
+
if (e.data === HUB_AUTH_PAGE_OPENED) {
|
82
|
+
reject(new Error('Failed to obtain/refresh token in background'));
|
83
|
+
cleanUp();
|
84
|
+
}
|
85
|
+
}
|
86
|
+
window.addEventListener('message', onMessage);
|
87
|
+
var iframe = _this._createHiddenFrame();
|
88
|
+
var cleanRun;
|
89
|
+
var timeout = setTimeout(function () {
|
90
|
+
reject(new Error('Failed to refresh authorization'));
|
91
|
+
cleanUp();
|
92
|
+
}, _this._timeout);
|
93
|
+
var removeTokenListener = _this._storage.onTokenChange(function (token) {
|
94
|
+
if (token) {
|
95
|
+
cleanUp();
|
96
|
+
resolve(token.accessToken);
|
97
|
+
}
|
98
|
+
});
|
99
|
+
var removeStateListener = _this._storage.onStateChange(authRequest.stateId, function (state) {
|
100
|
+
if (state && state.error) {
|
101
|
+
cleanUp();
|
102
|
+
reject(new AuthResponseParser.AuthError(state));
|
103
|
+
}
|
104
|
+
});
|
105
|
+
function cleanUp() {
|
106
|
+
if (cleanRun) {
|
107
|
+
return;
|
108
|
+
}
|
109
|
+
cleanRun = true;
|
110
|
+
clearTimeout(timeout);
|
111
|
+
removeStateListener();
|
112
|
+
removeTokenListener();
|
113
|
+
window.removeEventListener('message', onMessage);
|
114
|
+
window.document.body.removeChild(iframe);
|
115
|
+
}
|
116
|
+
_this._redirectFrame(iframe, authRequest.url);
|
117
|
+
}));
|
118
|
+
case 4:
|
119
|
+
case "end":
|
120
|
+
return _context.stop();
|
121
|
+
}
|
122
|
+
}, _callee, this);
|
123
|
+
}));
|
124
|
+
function _load() {
|
125
|
+
return _load2.apply(this, arguments);
|
59
126
|
}
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
if (token) {
|
69
|
-
cleanUp();
|
70
|
-
resolve(token.accessToken);
|
71
|
-
}
|
72
|
-
});
|
73
|
-
const removeStateListener = this._storage.onStateChange(authRequest.stateId, state => {
|
74
|
-
if (state && state.error) {
|
75
|
-
cleanUp();
|
76
|
-
reject(new AuthResponseParser.AuthError(state));
|
77
|
-
}
|
78
|
-
});
|
79
|
-
function cleanUp() {
|
80
|
-
if (cleanRun) {
|
81
|
-
return;
|
82
|
-
}
|
83
|
-
cleanRun = true;
|
84
|
-
clearTimeout(timeout);
|
85
|
-
removeStateListener();
|
86
|
-
removeTokenListener();
|
87
|
-
window.removeEventListener('message', onMessage);
|
88
|
-
window.document.body.removeChild(iframe);
|
127
|
+
return _load;
|
128
|
+
}())
|
129
|
+
}, {
|
130
|
+
key: "authorize",
|
131
|
+
value: function authorize() {
|
132
|
+
var _this2 = this;
|
133
|
+
if (this._promise) {
|
134
|
+
return this._promise;
|
89
135
|
}
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
136
|
+
var resetPromise = function resetPromise() {
|
137
|
+
_this2._promise = null;
|
138
|
+
};
|
139
|
+
this._promise = this._load();
|
140
|
+
this._promise.then(resetPromise, resetPromise);
|
95
141
|
return this._promise;
|
96
142
|
}
|
97
|
-
|
98
|
-
|
99
|
-
};
|
100
|
-
this._promise = this._load();
|
101
|
-
this._promise.then(resetPromise, resetPromise);
|
102
|
-
return this._promise;
|
103
|
-
}
|
104
|
-
}
|
143
|
+
}]);
|
144
|
+
}();
|
105
145
|
|
106
146
|
export { HUB_AUTH_PAGE_OPENED, BackgroundFlow as default };
|
@@ -1,15 +1,21 @@
|
|
1
|
+
import { h as _asyncToGenerator, i as _regeneratorRuntime } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.filter.js';
|
3
|
+
import 'core-js/modules/es.object.to-string.js';
|
1
4
|
import React from 'react';
|
2
5
|
import PropTypes from 'prop-types';
|
3
6
|
import alertService from '../alert-service/alert-service.js';
|
4
7
|
import Alert from '../alert/alert.js';
|
5
8
|
import Link from '../link/link.js';
|
6
9
|
import Group from '../group/group.js';
|
7
|
-
import '
|
10
|
+
import 'core-js/modules/es.array.concat.js';
|
11
|
+
import 'core-js/modules/es.array.map.js';
|
8
12
|
import 'react-dom/client';
|
9
13
|
import '../global/get-uid.js';
|
14
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
10
15
|
import '../alert/container.js';
|
11
16
|
import 'react-dom';
|
12
17
|
import 'classnames';
|
18
|
+
import 'core-js/modules/es.object.values.js';
|
13
19
|
import '@jetbrains/icons/exception';
|
14
20
|
import '@jetbrains/icons/checkmark';
|
15
21
|
import '@jetbrains/icons/warning';
|
@@ -18,10 +24,23 @@ import '../icon/icon.js';
|
|
18
24
|
import 'util-deprecate';
|
19
25
|
import '../icon/icon__constants.js';
|
20
26
|
import '../_helpers/icon__svg.js';
|
27
|
+
import 'core-js/modules/es.regexp.exec.js';
|
28
|
+
import 'core-js/modules/es.string.replace.js';
|
29
|
+
import 'core-js/modules/es.string.starts-with.js';
|
21
30
|
import '../global/memoize.js';
|
31
|
+
import 'core-js/modules/es.array.iterator.js';
|
32
|
+
import 'core-js/modules/es.map.js';
|
33
|
+
import 'core-js/modules/es.weak-map.js';
|
34
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
22
35
|
import '../loader-inline/loader-inline.js';
|
23
36
|
import '../global/data-tests.js';
|
37
|
+
import 'core-js/modules/es.array.reduce.js';
|
38
|
+
import 'core-js/modules/es.object.entries.js';
|
24
39
|
import '../global/dom.js';
|
40
|
+
import 'core-js/modules/es.object.assign.js';
|
41
|
+
import 'core-js/modules/es.set.js';
|
42
|
+
import 'core-js/modules/es.string.split.js';
|
43
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
25
44
|
import '../button/button.js';
|
26
45
|
import '@jetbrains/icons/chevron-10px';
|
27
46
|
import '../link/clickableLink.js';
|
@@ -33,20 +52,29 @@ import '../popup/popup.js';
|
|
33
52
|
import '../global/schedule-raf.js';
|
34
53
|
import '../shortcuts/shortcuts.js';
|
35
54
|
import '../shortcuts/core.js';
|
55
|
+
import 'core-js/modules/es.array.find-index.js';
|
56
|
+
import 'core-js/modules/es.array.includes.js';
|
57
|
+
import 'core-js/modules/es.array.slice.js';
|
58
|
+
import 'core-js/modules/es.array.splice.js';
|
59
|
+
import 'core-js/modules/es.string.includes.js';
|
60
|
+
import 'core-js/modules/es.string.match.js';
|
36
61
|
import 'combokeys';
|
37
62
|
import '../global/sniffer.js';
|
38
63
|
import 'sniffr';
|
39
64
|
import '../tab-trap/tab-trap.js';
|
40
65
|
import '../popup/position.js';
|
66
|
+
import 'core-js/modules/es.array.sort.js';
|
41
67
|
import '../popup/popup.consts.js';
|
42
68
|
import '../_helpers/link.js';
|
43
69
|
|
44
70
|
var modules_c87dd562 = {"light":"light_rui_2ac4","title":"title_rui_7659","error":"error_rui_7659"};
|
45
71
|
|
46
|
-
|
72
|
+
var key = null;
|
47
73
|
function renderAlert(message) {
|
48
|
-
|
49
|
-
|
74
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Alert.Type.WARNING;
|
75
|
+
var existingAlert = alertService.showingAlerts.filter(function (alert) {
|
76
|
+
return alert.key === key;
|
77
|
+
})[0];
|
50
78
|
if (!existingAlert) {
|
51
79
|
key = alertService.addAlert(message, type, 0, {
|
52
80
|
closeable: false
|
@@ -58,15 +86,11 @@ function renderAlert(message) {
|
|
58
86
|
}
|
59
87
|
}
|
60
88
|
function Message(_ref) {
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
backendIsNotAvailable,
|
67
|
-
checkAgain,
|
68
|
-
errorMessage
|
69
|
-
} = translations;
|
89
|
+
var translations = _ref.translations,
|
90
|
+
onCheckAgain = _ref.onCheckAgain;
|
91
|
+
var backendIsNotAvailable = translations.backendIsNotAvailable,
|
92
|
+
checkAgain = translations.checkAgain,
|
93
|
+
errorMessage = translations.errorMessage;
|
70
94
|
return /*#__PURE__*/React.createElement("div", {
|
71
95
|
"data-test": "ring-backend-down-notification"
|
72
96
|
}, /*#__PURE__*/React.createElement(Group, null, /*#__PURE__*/React.createElement("div", {
|
@@ -87,28 +111,47 @@ Message.propTypes = {
|
|
87
111
|
onCheckAgain: PropTypes.func
|
88
112
|
};
|
89
113
|
function onBackendDown(_ref2) {
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
114
|
+
var onCheckAgain = _ref2.onCheckAgain,
|
115
|
+
translations = _ref2.translations;
|
116
|
+
function checkAgainWithoutClosing(_x) {
|
117
|
+
return _checkAgainWithoutClosing.apply(this, arguments);
|
118
|
+
}
|
119
|
+
function _checkAgainWithoutClosing() {
|
120
|
+
_checkAgainWithoutClosing = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
|
121
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
122
|
+
while (1) switch (_context.prev = _context.next) {
|
123
|
+
case 0:
|
124
|
+
// Alert has weird behaviour of handling clicks by "a" tags
|
125
|
+
e.stopPropagation();
|
126
|
+
_context.prev = 1;
|
127
|
+
renderAlert('Connecting...', Alert.Type.LOADING);
|
128
|
+
_context.next = 5;
|
129
|
+
return onCheckAgain();
|
130
|
+
case 5:
|
131
|
+
_context.next = 10;
|
132
|
+
break;
|
133
|
+
case 7:
|
134
|
+
_context.prev = 7;
|
135
|
+
_context.t0 = _context["catch"](1);
|
136
|
+
renderAlert( /*#__PURE__*/React.createElement(Message, {
|
137
|
+
translations: translations,
|
138
|
+
onCheckAgain: checkAgainWithoutClosing
|
139
|
+
}));
|
140
|
+
case 10:
|
141
|
+
case "end":
|
142
|
+
return _context.stop();
|
143
|
+
}
|
144
|
+
}, _callee, null, [[1, 7]]);
|
145
|
+
}));
|
146
|
+
return _checkAgainWithoutClosing.apply(this, arguments);
|
106
147
|
}
|
107
148
|
renderAlert( /*#__PURE__*/React.createElement(Message, {
|
108
149
|
translations: translations,
|
109
150
|
onCheckAgain: checkAgainWithoutClosing
|
110
151
|
}));
|
111
|
-
return ()
|
152
|
+
return function () {
|
153
|
+
return alertService.remove(key);
|
154
|
+
};
|
112
155
|
}
|
113
156
|
|
114
157
|
export { onBackendDown as default };
|
@@ -1,3 +1,6 @@
|
|
1
|
+
import { b as _createClass, f as _classCallCheck, _ as _defineProperty, h as _asyncToGenerator, i as _regeneratorRuntime } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.object.to-string.js';
|
3
|
+
import 'core-js/modules/es.promise.js';
|
1
4
|
import React from 'react';
|
2
5
|
import showAuthDialog from '../login-dialog/service.js';
|
3
6
|
import Link from '../link/link.js';
|
@@ -5,14 +8,16 @@ import AuthResponseParser from './response-parser.js';
|
|
5
8
|
import 'react-dom/client';
|
6
9
|
import '../global/controls-height.js';
|
7
10
|
import '../login-dialog/login-dialog.js';
|
11
|
+
import 'core-js/modules/es.array.concat.js';
|
8
12
|
import 'prop-types';
|
9
13
|
import '../dialog/dialog.js';
|
10
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
11
14
|
import 'react-dom';
|
12
15
|
import 'classnames';
|
13
16
|
import '@jetbrains/icons/close';
|
14
17
|
import '../island/island.js';
|
15
18
|
import '../global/data-tests.js';
|
19
|
+
import 'core-js/modules/es.array.reduce.js';
|
20
|
+
import 'core-js/modules/es.object.entries.js';
|
16
21
|
import '../island/adaptive-island-hoc.js';
|
17
22
|
import '../global/linear-function.js';
|
18
23
|
import '../_helpers/island.js';
|
@@ -21,20 +26,40 @@ import '../island/content.js';
|
|
21
26
|
import 'element-resize-detector';
|
22
27
|
import '../global/schedule-raf.js';
|
23
28
|
import '../global/get-uid.js';
|
29
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
24
30
|
import '../shortcuts/shortcuts.js';
|
31
|
+
import 'core-js/modules/es.array.map.js';
|
25
32
|
import '../shortcuts/core.js';
|
33
|
+
import 'core-js/modules/es.array.find-index.js';
|
34
|
+
import 'core-js/modules/es.array.includes.js';
|
35
|
+
import 'core-js/modules/es.array.slice.js';
|
36
|
+
import 'core-js/modules/es.array.splice.js';
|
37
|
+
import 'core-js/modules/es.object.assign.js';
|
38
|
+
import 'core-js/modules/es.regexp.exec.js';
|
39
|
+
import 'core-js/modules/es.string.includes.js';
|
40
|
+
import 'core-js/modules/es.string.match.js';
|
26
41
|
import 'combokeys';
|
27
42
|
import '../global/sniffer.js';
|
28
43
|
import 'sniffr';
|
29
44
|
import '../tab-trap/tab-trap.js';
|
45
|
+
import 'core-js/modules/es.array.filter.js';
|
30
46
|
import '../global/dom.js';
|
47
|
+
import 'core-js/modules/es.array.iterator.js';
|
48
|
+
import 'core-js/modules/es.set.js';
|
49
|
+
import 'core-js/modules/es.string.split.js';
|
50
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
51
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
31
52
|
import '../button/button.js';
|
32
53
|
import '@jetbrains/icons/chevron-10px';
|
33
54
|
import '../icon/icon.js';
|
34
55
|
import 'util-deprecate';
|
35
56
|
import '../icon/icon__constants.js';
|
36
57
|
import '../_helpers/icon__svg.js';
|
58
|
+
import 'core-js/modules/es.string.replace.js';
|
59
|
+
import 'core-js/modules/es.string.starts-with.js';
|
37
60
|
import '../global/memoize.js';
|
61
|
+
import 'core-js/modules/es.map.js';
|
62
|
+
import 'core-js/modules/es.weak-map.js';
|
38
63
|
import '../link/clickableLink.js';
|
39
64
|
import '../_helpers/button__classes.js';
|
40
65
|
import '../popup/popup.target.js';
|
@@ -43,20 +68,28 @@ import 'scrollbar-width';
|
|
43
68
|
import '../loader-screen/loader-screen.js';
|
44
69
|
import '../loader/loader.js';
|
45
70
|
import '../loader/loader__core.js';
|
71
|
+
import 'core-js/modules/es.array.fill.js';
|
46
72
|
import './background-flow.js';
|
73
|
+
import 'core-js/modules/es.array.index-of.js';
|
47
74
|
import 'es6-error';
|
48
75
|
import '../global/url.js';
|
49
76
|
import '../_helpers/link.js';
|
50
77
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
78
|
+
var IFrameFlow = /*#__PURE__*/function () {
|
79
|
+
function IFrameFlow(requestBuilder, storage, translations) {
|
80
|
+
var _this = this;
|
81
|
+
_classCallCheck(this, IFrameFlow);
|
82
|
+
_defineProperty(this, "hideDialog", null);
|
83
|
+
_defineProperty(this, "_requestBuilder", void 0);
|
84
|
+
_defineProperty(this, "_storage", void 0);
|
85
|
+
_defineProperty(this, "_translations", void 0);
|
86
|
+
_defineProperty(this, "reject", void 0);
|
87
|
+
_defineProperty(this, "_promise", void 0);
|
88
|
+
_defineProperty(this, "_loginWindow", void 0);
|
89
|
+
_defineProperty(this, "_reset", function () {
|
90
|
+
_this._promise = null;
|
91
|
+
_this.hideDialog = null;
|
92
|
+
});
|
60
93
|
this._requestBuilder = requestBuilder;
|
61
94
|
this._storage = storage;
|
62
95
|
this._translations = translations;
|
@@ -65,73 +98,98 @@ class IFrameFlow {
|
|
65
98
|
/**
|
66
99
|
* Initiates authorization in window
|
67
100
|
*/
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
101
|
+
return _createClass(IFrameFlow, [{
|
102
|
+
key: "_load",
|
103
|
+
value: (function () {
|
104
|
+
var _load2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
105
|
+
var _this2 = this;
|
106
|
+
var authRequest, renderFallbackLink;
|
107
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
108
|
+
while (1) switch (_context.prev = _context.next) {
|
109
|
+
case 0:
|
110
|
+
_context.next = 2;
|
111
|
+
return this._requestBuilder.prepareAuthRequest(
|
112
|
+
// eslint-disable-next-line camelcase
|
113
|
+
{
|
114
|
+
request_credentials: 'required',
|
115
|
+
auth_mode: 'bypass_to_login'
|
116
|
+
}, {
|
117
|
+
nonRedirect: false
|
118
|
+
});
|
119
|
+
case 2:
|
120
|
+
authRequest = _context.sent;
|
121
|
+
renderFallbackLink = function renderFallbackLink() {
|
122
|
+
return /*#__PURE__*/React.createElement(Link, {
|
123
|
+
href: authRequest.url,
|
124
|
+
target: "_self"
|
125
|
+
}, _this2._translations.nothingHappensLink);
|
126
|
+
};
|
127
|
+
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
128
|
+
_this2.hideDialog = showAuthDialog({
|
129
|
+
url: authRequest.url,
|
130
|
+
loader: true,
|
131
|
+
onCancel: function onCancel() {
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
133
|
+
cleanUp();
|
134
|
+
_this2.stop();
|
135
|
+
},
|
136
|
+
renderFallbackLink
|
137
|
+
});
|
138
|
+
_this2.reject = reject;
|
139
|
+
var removeTokenListener = _this2._storage.onTokenChange(function (token) {
|
140
|
+
if (token) {
|
141
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
142
|
+
cleanUp();
|
143
|
+
resolve(token.accessToken);
|
144
|
+
}
|
145
|
+
});
|
146
|
+
var removeStateListener = _this2._storage.onStateChange(authRequest.stateId, function (state) {
|
147
|
+
if (state && state.error) {
|
148
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
149
|
+
cleanUp();
|
150
|
+
reject(new AuthResponseParser.AuthError(state));
|
151
|
+
}
|
152
|
+
});
|
153
|
+
var cleanUp = function cleanUp() {
|
154
|
+
var _this2$hideDialog;
|
155
|
+
(_this2$hideDialog = _this2.hideDialog) === null || _this2$hideDialog === void 0 || _this2$hideDialog.call(_this2);
|
156
|
+
removeStateListener();
|
157
|
+
removeTokenListener();
|
158
|
+
};
|
159
|
+
}));
|
160
|
+
case 5:
|
161
|
+
case "end":
|
162
|
+
return _context.stop();
|
163
|
+
}
|
164
|
+
}, _callee, this);
|
165
|
+
}));
|
166
|
+
function _load() {
|
167
|
+
return _load2.apply(this, arguments);
|
168
|
+
}
|
169
|
+
return _load;
|
170
|
+
}())
|
171
|
+
}, {
|
172
|
+
key: "stop",
|
173
|
+
value: function stop() {
|
174
|
+
if (this.hideDialog) {
|
175
|
+
this.hideDialog();
|
176
|
+
}
|
177
|
+
if (this.reject) {
|
178
|
+
this.reject('Login form closed');
|
179
|
+
}
|
180
|
+
this._reset();
|
121
181
|
}
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
182
|
+
}, {
|
183
|
+
key: "authorize",
|
184
|
+
value: function authorize() {
|
185
|
+
if (this._promise != null && this._loginWindow != null && !this._loginWindow.closed) {
|
186
|
+
return this._promise;
|
187
|
+
}
|
188
|
+
this._promise = this._load();
|
189
|
+
this._promise.then(this._reset, this._reset);
|
129
190
|
return this._promise;
|
130
191
|
}
|
131
|
-
|
132
|
-
|
133
|
-
return this._promise;
|
134
|
-
}
|
135
|
-
}
|
192
|
+
}]);
|
193
|
+
}();
|
136
194
|
|
137
195
|
export { IFrameFlow as default };
|