@jetbrains/ring-ui-built 7.0.27 → 7.0.29
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 +1 -1
- package/components/_helpers/card.js +5 -5
- package/components/_helpers/input.js +7 -7
- package/components/_helpers/select__filter.js +2 -2
- package/components/_helpers/sidebar.js +2 -2
- package/components/alert/alert.js +2 -2
- package/components/alert-service/alert-service.js +2 -2
- package/components/analytics/analytics.js +1 -1
- package/components/analytics/analytics__custom-plugin.js +8 -8
- package/components/auth/auth__core.js +54 -54
- package/components/auth/background-flow.js +4 -4
- package/components/auth/iframe-flow.js +7 -7
- package/components/auth/request-builder.js +3 -3
- package/components/auth/response-parser.js +4 -4
- package/components/auth/storage.js +12 -12
- package/components/auth/token-validator.js +7 -7
- package/components/auth/window-flow.js +7 -7
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/avatar-stack/avatar-stack.js +8 -9
- package/components/button/button.js +2 -2
- package/components/caret/caret.js +7 -7
- package/components/checkbox/checkbox.js +1 -1
- package/components/clipboard/clipboard-fallback.js +3 -3
- package/components/code/code.js +1 -1
- package/components/collapse/collapse-content.js +2 -2
- package/components/collapse/collapse.js +1 -1
- package/components/data-list/data-list.js +3 -3
- package/components/data-list/item.js +1 -1
- package/components/date-picker/consts.js +1 -1
- package/components/date-picker/date-input.js +5 -5
- package/components/date-picker/date-picker.js +9 -9
- package/components/date-picker/date-popup.js +4 -4
- package/components/date-picker/years.js +1 -1
- package/components/dialog/dialog.js +1 -1
- package/components/dropdown/dropdown.js +4 -4
- package/components/dropdown-menu/dropdown-menu.js +6 -7
- package/components/editable-heading/editable-heading.js +4 -4
- package/components/global/focus-sensor-hoc.js +10 -10
- package/components/global/memoize.js +1 -1
- package/components/global/normalize-indent.js +1 -1
- package/components/global/react-dom-renderer.js +1 -1
- package/components/global/schedule-raf.js +1 -1
- package/components/header/header.js +5 -6
- package/components/header/profile.js +11 -12
- package/components/header/smart-profile.js +5 -6
- package/components/header/smart-services.js +4 -4
- package/components/http/http.js +9 -9
- package/components/http/http.mock.js +3 -3
- package/components/hub-source/hub-source.js +6 -6
- package/components/hub-source/hub-source__user.js +2 -2
- package/components/hub-source/hub-source__users-groups.js +4 -4
- package/components/i18n/i18n.js +1 -1
- package/components/island/adaptive-island-hoc.js +1 -1
- package/components/island/content.js +3 -3
- package/components/island/header.js +1 -1
- package/components/list/list.js +8 -12
- package/components/list/list__item.js +83 -59
- package/components/list/list__users-groups-source.js +8 -9
- package/components/loader/loader.js +2 -2
- package/components/loader/loader__core.js +27 -27
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/message/message.js +8 -8
- package/components/old-browsers-message/white-list.js +1 -1
- package/components/pager/pager.js +13 -14
- package/components/permissions/permissions.js +7 -7
- package/components/permissions/permissions__cache.js +4 -4
- package/components/popup/popup.js +8 -8
- package/components/popup/position.js +1 -1
- package/components/popup-menu/popup-menu.js +7 -8
- package/components/progress-bar/progress-bar.js +2 -2
- package/components/query-assist/query-assist.js +55 -54
- package/components/query-assist/query-assist__suggestions.js +6 -7
- package/components/radio/radio__item.js +2 -2
- package/components/select/select.js +32 -33
- package/components/select/select__filter.js +5 -6
- package/components/select/select__popup.js +15 -16
- package/components/shortcuts/core.js +1 -1
- package/components/slider/slider.js +8 -8
- package/components/slider/slider.utils.js +1 -1
- package/components/storage/storage__local.js +1 -1
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +4 -4
- package/components/table/header-cell.js +2 -2
- package/components/table/multitable.js +7 -7
- package/components/table/row-with-focus-sensor.js +4 -4
- package/components/table/row.js +1 -1
- package/components/table/selection-shortcuts-hoc.js +12 -12
- package/components/table/selection.js +7 -7
- package/components/table/table.js +1 -1
- package/components/tabs/collapsible-more.js +6 -7
- package/components/tabs/collapsible-tab.js +3 -3
- package/components/tabs/collapsible-tabs.js +10 -11
- package/components/tabs/dumb-tabs.js +4 -5
- package/components/tabs/smart-tabs.js +4 -5
- package/components/tabs/tabs.js +3 -4
- package/components/tag/tag.js +2 -2
- package/components/tags-input/tags-input.js +22 -23
- package/components/tooltip/tooltip.js +8 -8
- package/components/upload/upload.js +3 -3
- package/components/user-agreement/service.js +3 -3
- package/components/user-agreement/user-agreement.js +8 -8
- package/package.json +2 -2
- package/components/list/list__link.d.ts +0 -9
- package/components/list/list__link.js +0 -52
@@ -50,7 +50,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
50
50
|
function _toPrimitive(t, r) {
|
51
51
|
if ("object" != typeof t || !t) return t;
|
52
52
|
var e = t[Symbol.toPrimitive];
|
53
|
-
if (
|
53
|
+
if (void 0 !== e) {
|
54
54
|
var i = e.call(t, r);
|
55
55
|
if ("object" != typeof i) return i;
|
56
56
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
@@ -26,7 +26,7 @@ class UserCard extends PureComponent {
|
|
26
26
|
translate
|
27
27
|
} = this.context;
|
28
28
|
const translations = this.props.translations;
|
29
|
-
clipboard.copyText(this.props.user.email || '', (_translations$copiedT = translations === null || translations ===
|
29
|
+
clipboard.copyText(this.props.user.email || '', (_translations$copiedT = translations === null || translations === void 0 ? void 0 : translations.copiedToClipboard) !== null && _translations$copiedT !== void 0 ? _translations$copiedT : translate('copyToClipboard'), (_translations$copingT = translations === null || translations === void 0 ? void 0 : translations.copingToClipboardError) !== null && _translations$copingT !== void 0 ? _translations$copingT : translate('copingToClipboardError'));
|
30
30
|
});
|
31
31
|
}
|
32
32
|
render() {
|
@@ -74,7 +74,7 @@ class UserCard extends PureComponent {
|
|
74
74
|
children: user.name
|
75
75
|
}), typeof user.online === 'boolean' && jsx("span", {
|
76
76
|
className: userActiveStatusClasses,
|
77
|
-
title: user.online ? (_translations$online = translations === null || translations ===
|
77
|
+
title: user.online ? (_translations$online = translations === null || translations === void 0 ? void 0 : translations.online) !== null && _translations$online !== void 0 ? _translations$online : translate('online') : (_translations$offline = translations === null || translations === void 0 ? void 0 : translations.offline) !== null && _translations$offline !== void 0 ? _translations$offline : translate('offline')
|
78
78
|
}), !!info && jsx("span", {
|
79
79
|
className: styles.userNameInfo,
|
80
80
|
children: info
|
@@ -82,7 +82,7 @@ class UserCard extends PureComponent {
|
|
82
82
|
title: user.banReason,
|
83
83
|
children: jsx(Tag, {
|
84
84
|
className: styles.banLabel,
|
85
|
-
children: (_translations$banned = translations === null || translations ===
|
85
|
+
children: (_translations$banned = translations === null || translations === void 0 ? void 0 : translations.banned) !== null && _translations$banned !== void 0 ? _translations$banned : translate('banned')
|
86
86
|
})
|
87
87
|
})]
|
88
88
|
}), jsx("div", {
|
@@ -98,9 +98,9 @@ class UserCard extends PureComponent {
|
|
98
98
|
children: user.email
|
99
99
|
}), user.unverifiedEmail && jsx("span", {
|
100
100
|
className: styles.unverifiedLabel,
|
101
|
-
children: (_translations$unverif = translations === null || translations ===
|
101
|
+
children: (_translations$unverif = translations === null || translations === void 0 ? void 0 : translations.unverified) !== null && _translations$unverif !== void 0 ? _translations$unverif : translate('unverified')
|
102
102
|
}), jsx(Icon, {
|
103
|
-
title: (_translations$copyToC = translations === null || translations ===
|
103
|
+
title: (_translations$copyToC = translations === null || translations === void 0 ? void 0 : translations.copyToClipboard) !== null && _translations$copyToC !== void 0 ? _translations$copyToC : translate('copyToClipboard'),
|
104
104
|
className: styles.userCopyIcon,
|
105
105
|
onClick: this.copyEmail,
|
106
106
|
glyph: copyIcon,
|
@@ -34,8 +34,8 @@ class Input extends PureComponent {
|
|
34
34
|
_defineProperty(this, "state", {
|
35
35
|
empty: true
|
36
36
|
});
|
37
|
-
_defineProperty(this, "frame",
|
38
|
-
_defineProperty(this, "input",
|
37
|
+
_defineProperty(this, "frame", void 0);
|
38
|
+
_defineProperty(this, "input", void 0);
|
39
39
|
_defineProperty(this, "id", getUID('ring-input-'));
|
40
40
|
_defineProperty(this, "inputRef", el => {
|
41
41
|
this.input = el;
|
@@ -43,19 +43,19 @@ class Input extends PureComponent {
|
|
43
43
|
_defineProperty(this, "composedInputRef", createComposedRef());
|
44
44
|
_defineProperty(this, "clear", e => {
|
45
45
|
var _this$props$onClear, _this$props;
|
46
|
-
(_this$props$onClear = (_this$props = this.props).onClear) === null || _this$props$onClear ===
|
46
|
+
(_this$props$onClear = (_this$props = this.props).onClear) === null || _this$props$onClear === void 0 || _this$props$onClear.call(_this$props, e);
|
47
47
|
});
|
48
48
|
_defineProperty(this, "handleInputChange", e => {
|
49
49
|
if (!this.props.multiline) {
|
50
50
|
var _this$props$onChange, _this$props2;
|
51
|
-
(_this$props$onChange = (_this$props2 = this.props).onChange) === null || _this$props$onChange ===
|
51
|
+
(_this$props$onChange = (_this$props2 = this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props2, e);
|
52
52
|
this.checkValue();
|
53
53
|
}
|
54
54
|
});
|
55
55
|
_defineProperty(this, "handleTextareaChange", e => {
|
56
56
|
if (this.props.multiline) {
|
57
57
|
var _this$props$onChange2, _this$props3;
|
58
|
-
(_this$props$onChange2 = (_this$props3 = this.props).onChange) === null || _this$props$onChange2 ===
|
58
|
+
(_this$props$onChange2 = (_this$props3 = this.props).onChange) === null || _this$props$onChange2 === void 0 || _this$props$onChange2.call(_this$props3, e);
|
59
59
|
this.checkValue();
|
60
60
|
}
|
61
61
|
});
|
@@ -77,7 +77,7 @@ class Input extends PureComponent {
|
|
77
77
|
checkValue() {
|
78
78
|
var _this$input;
|
79
79
|
this.setState({
|
80
|
-
empty: !((_this$input = this.input) !== null && _this$input !==
|
80
|
+
empty: !((_this$input = this.input) !== null && _this$input !== void 0 && _this$input.value)
|
81
81
|
});
|
82
82
|
if (this.props.multiline && this.input != null && this.input.scrollHeight >= this.input.clientHeight) {
|
83
83
|
this.stretch(this.input);
|
@@ -171,7 +171,7 @@ class Input extends PureComponent {
|
|
171
171
|
}, commonProps), restProps)) : jsx("input", _objectSpread2(_objectSpread2({
|
172
172
|
onChange: this.handleInputChange
|
173
173
|
}, commonProps), restProps)), clearable && !disabled && jsx(Button, {
|
174
|
-
title: (_translations$clear = translations === null || translations ===
|
174
|
+
title: (_translations$clear = translations === null || translations === void 0 ? void 0 : translations.clear) !== null && _translations$clear !== void 0 ? _translations$clear : translate('clear'),
|
175
175
|
"data-test": "ring-input-clear",
|
176
176
|
className: inputStyles.clear,
|
177
177
|
icon: closeIcon,
|
@@ -15,7 +15,7 @@ function noop() {}
|
|
15
15
|
class SelectFilter extends Component {
|
16
16
|
constructor() {
|
17
17
|
super(...arguments);
|
18
|
-
_defineProperty(this, "input",
|
18
|
+
_defineProperty(this, "input", void 0);
|
19
19
|
_defineProperty(this, "inputRef", el => {
|
20
20
|
this.input = el;
|
21
21
|
this.props.inputRef(el);
|
@@ -57,7 +57,7 @@ class SelectFilter extends Component {
|
|
57
57
|
translate
|
58
58
|
} = _ref;
|
59
59
|
return jsx(Input, _objectSpread2(_objectSpread2({}, restProps), {}, {
|
60
|
-
placeholder: (_restProps$placeholde = restProps.placeholder) !== null && _restProps$placeholde !==
|
60
|
+
placeholder: (_restProps$placeholde = restProps.placeholder) !== null && _restProps$placeholde !== void 0 ? _restProps$placeholde : translate('filterItems'),
|
61
61
|
"aria-owns": listId,
|
62
62
|
"aria-activedescendant": activeItemId,
|
63
63
|
autoComplete: "off",
|
@@ -18,7 +18,7 @@ class Sidebar extends Component {
|
|
18
18
|
bottomIsOutside: true,
|
19
19
|
sidebarVisibleHeight: undefined
|
20
20
|
});
|
21
|
-
_defineProperty(this, "sidebarNode",
|
21
|
+
_defineProperty(this, "sidebarNode", void 0);
|
22
22
|
_defineProperty(this, "handleTopWaypoint", _ref => {
|
23
23
|
let {
|
24
24
|
currentPosition
|
@@ -85,7 +85,7 @@ class Sidebar extends Component {
|
|
85
85
|
[styles.sidebarRight]: right,
|
86
86
|
[styles.sidebarFixedTop]: shouldFixateTop,
|
87
87
|
[styles.sidebarFixedBottom]: shouldFixateBottom,
|
88
|
-
[fixedClassName !== null && fixedClassName !==
|
88
|
+
[fixedClassName !== null && fixedClassName !== void 0 ? fixedClassName : '']: shouldFixateTop || shouldFixateBottom
|
89
89
|
});
|
90
90
|
const style = {
|
91
91
|
maxHeight: shouldFixateBottom && sidebarVisibleHeight ? "".concat(sidebarVisibleHeight, "px") : undefined
|
@@ -97,8 +97,8 @@ class Alert extends PureComponent {
|
|
97
97
|
_defineProperty(this, "state", {
|
98
98
|
height: null
|
99
99
|
});
|
100
|
-
_defineProperty(this, "node",
|
101
|
-
_defineProperty(this, "hideTimeout",
|
100
|
+
_defineProperty(this, "node", void 0);
|
101
|
+
_defineProperty(this, "hideTimeout", void 0);
|
102
102
|
_defineProperty(this, "closeRequest", event => {
|
103
103
|
this.startCloseAnimation();
|
104
104
|
return this.props.onCloseRequest(event);
|
@@ -135,11 +135,11 @@ class AlertService {
|
|
135
135
|
timeout,
|
136
136
|
isClosing: false,
|
137
137
|
onCloseRequest: () => {
|
138
|
-
_onCloseRequest === null || _onCloseRequest ===
|
138
|
+
_onCloseRequest === null || _onCloseRequest === void 0 || _onCloseRequest();
|
139
139
|
this.startAlertClosing(alert);
|
140
140
|
},
|
141
141
|
onClose: () => {
|
142
|
-
_onClose === null || _onClose ===
|
142
|
+
_onClose === null || _onClose === void 0 || _onClose();
|
143
143
|
this.removeWithoutAnimation(alert.key);
|
144
144
|
}
|
145
145
|
}, restOptions);
|
@@ -4,12 +4,12 @@ const DEFAULT_FLUSH_INTERVAL = 10000;
|
|
4
4
|
const DEFAULT_FLUSH_MAX_PACK_SIZE = 100;
|
5
5
|
class AnalyticsCustomPlugin {
|
6
6
|
constructor(send, isDevelopment, flushInterval) {
|
7
|
-
_defineProperty(this, "_data",
|
8
|
-
_defineProperty(this, "_flush",
|
9
|
-
_defineProperty(this, "_isDevelopment",
|
10
|
-
_defineProperty(this, "_flushInterval",
|
11
|
-
_defineProperty(this, "_flushMaxPackSize",
|
12
|
-
_defineProperty(this, "_hasSendSchedule",
|
7
|
+
_defineProperty(this, "_data", void 0);
|
8
|
+
_defineProperty(this, "_flush", void 0);
|
9
|
+
_defineProperty(this, "_isDevelopment", void 0);
|
10
|
+
_defineProperty(this, "_flushInterval", void 0);
|
11
|
+
_defineProperty(this, "_flushMaxPackSize", void 0);
|
12
|
+
_defineProperty(this, "_hasSendSchedule", void 0);
|
13
13
|
this._data = [];
|
14
14
|
this.config({
|
15
15
|
send,
|
@@ -37,7 +37,7 @@ class AnalyticsCustomPlugin {
|
|
37
37
|
_initSendSchedule() {
|
38
38
|
window.addEventListener('beforeunload', () => {
|
39
39
|
var _this$_flush;
|
40
|
-
return (_this$_flush = this._flush) === null || _this$_flush ===
|
40
|
+
return (_this$_flush = this._flush) === null || _this$_flush === void 0 ? void 0 : _this$_flush.call(this);
|
41
41
|
});
|
42
42
|
if (this._flush != null) {
|
43
43
|
setInterval(this._flush, this._flushInterval);
|
@@ -64,7 +64,7 @@ class AnalyticsCustomPlugin {
|
|
64
64
|
this._data.push(sendingData);
|
65
65
|
if (this._flushMaxPackSize != null && this._data.length >= this._flushMaxPackSize) {
|
66
66
|
var _this$_flush2;
|
67
|
-
(_this$_flush2 = this._flush) === null || _this$_flush2 ===
|
67
|
+
(_this$_flush2 = this._flush) === null || _this$_flush2 === void 0 || _this$_flush2.call(this);
|
68
68
|
}
|
69
69
|
}
|
70
70
|
}
|
@@ -108,23 +108,23 @@ const DEFAULT_CONFIG = {
|
|
108
108
|
};
|
109
109
|
class Auth {
|
110
110
|
constructor(config) {
|
111
|
-
_defineProperty(this, "config",
|
111
|
+
_defineProperty(this, "config", void 0);
|
112
112
|
_defineProperty(this, "listeners", new Listeners());
|
113
|
-
_defineProperty(this, "http",
|
113
|
+
_defineProperty(this, "http", void 0);
|
114
114
|
_defineProperty(this, "_service", {});
|
115
|
-
_defineProperty(this, "_storage",
|
115
|
+
_defineProperty(this, "_storage", void 0);
|
116
116
|
_defineProperty(this, "_responseParser", new AuthResponseParser());
|
117
117
|
_defineProperty(this, "_requestBuilder", null);
|
118
|
-
_defineProperty(this, "_backgroundFlow",
|
118
|
+
_defineProperty(this, "_backgroundFlow", void 0);
|
119
119
|
_defineProperty(this, "_embeddedFlow", null);
|
120
120
|
_defineProperty(this, "_tokenValidator", null);
|
121
121
|
_defineProperty(this, "_postponed", false);
|
122
122
|
_defineProperty(this, "_backendCheckPromise", null);
|
123
123
|
_defineProperty(this, "_authDialogService", undefined);
|
124
|
-
_defineProperty(this, "_domainStorage",
|
124
|
+
_defineProperty(this, "_domainStorage", void 0);
|
125
125
|
_defineProperty(this, "user", null);
|
126
|
-
_defineProperty(this, "_initDeferred",
|
127
|
-
_defineProperty(this, "_isLoginWindowOpen",
|
126
|
+
_defineProperty(this, "_initDeferred", void 0);
|
127
|
+
_defineProperty(this, "_isLoginWindowOpen", void 0);
|
128
128
|
if (!config) {
|
129
129
|
throw new Error('Config is required');
|
130
130
|
}
|
@@ -182,7 +182,7 @@ class Auth {
|
|
182
182
|
this._backgroundFlow = new BackgroundFlow(this._requestBuilder, this._storage, backgroundRefreshTimeout);
|
183
183
|
if (this.config.EmbeddedLoginFlow) {
|
184
184
|
var _this$config$translat;
|
185
|
-
this._embeddedFlow = new this.config.EmbeddedLoginFlow(this._requestBuilder, this._storage, (_this$config$translat = this.config.translations) !== null && _this$config$translat !==
|
185
|
+
this._embeddedFlow = new this.config.EmbeddedLoginFlow(this._requestBuilder, this._storage, (_this$config$translat = this.config.translations) !== null && _this$config$translat !== void 0 ? _this$config$translat : getTranslationsWithFallback());
|
186
186
|
}
|
187
187
|
const API_BASE = this.config.serverUri + Auth.API_PATH;
|
188
188
|
const fetchConfig = config.fetchCredentials ? {
|
@@ -215,11 +215,11 @@ class Auth {
|
|
215
215
|
if (this.config.cacheCurrentUser) {
|
216
216
|
this.addListener(LOGOUT_EVENT, () => {
|
217
217
|
var _this$_storage;
|
218
|
-
return (_this$_storage = this._storage) === null || _this$_storage ===
|
218
|
+
return (_this$_storage = this._storage) === null || _this$_storage === void 0 ? void 0 : _this$_storage.wipeCachedCurrentUser();
|
219
219
|
});
|
220
220
|
this.addListener(USER_CHANGED_EVENT, () => {
|
221
221
|
var _this$_storage2;
|
222
|
-
return (_this$_storage2 = this._storage) === null || _this$_storage2 ===
|
222
|
+
return (_this$_storage2 = this._storage) === null || _this$_storage2 === void 0 ? void 0 : _this$_storage2.onUserChanged();
|
223
223
|
});
|
224
224
|
}
|
225
225
|
this._createInitDeferred();
|
@@ -261,7 +261,7 @@ class Auth {
|
|
261
261
|
*/
|
262
262
|
async init() {
|
263
263
|
var _this$_storage3;
|
264
|
-
(_this$_storage3 = this._storage) === null || _this$_storage3 ===
|
264
|
+
(_this$_storage3 = this._storage) === null || _this$_storage3 === void 0 || _this$_storage3.onTokenChange(async token => {
|
265
265
|
const isGuest = this.user ? this.user.guest : false;
|
266
266
|
if (isGuest && !token) {
|
267
267
|
return;
|
@@ -335,7 +335,7 @@ class Auth {
|
|
335
335
|
} catch (error) {
|
336
336
|
if (Auth.storageIsUnavailable) {
|
337
337
|
var _this$_initDeferred2, _this$_initDeferred2$;
|
338
|
-
(_this$_initDeferred2 = this._initDeferred) === null || _this$_initDeferred2 ===
|
338
|
+
(_this$_initDeferred2 = this._initDeferred) === null || _this$_initDeferred2 === void 0 || (_this$_initDeferred2$ = _this$_initDeferred2.resolve) === null || _this$_initDeferred2$ === void 0 || _this$_initDeferred2$.call(_this$_initDeferred2); // No way to handle if cookies are disabled
|
339
339
|
await this.requestUser(); // Someone may expect user to be loaded as a part of token validation
|
340
340
|
return null;
|
341
341
|
}
|
@@ -344,7 +344,7 @@ class Auth {
|
|
344
344
|
}
|
345
345
|
async sendRedirect(error) {
|
346
346
|
var _this$_requestBuilder;
|
347
|
-
const authRequest = await ((_this$_requestBuilder = this._requestBuilder) === null || _this$_requestBuilder ===
|
347
|
+
const authRequest = await ((_this$_requestBuilder = this._requestBuilder) === null || _this$_requestBuilder === void 0 ? void 0 : _this$_requestBuilder.prepareAuthRequest());
|
348
348
|
if (authRequest != null) {
|
349
349
|
this._redirectCurrentPage(authRequest.url);
|
350
350
|
}
|
@@ -374,7 +374,7 @@ class Auth {
|
|
374
374
|
}
|
375
375
|
async handleInitValidationError(error) {
|
376
376
|
var _error$cause, _this$_initDeferred4, _this$_initDeferred4$;
|
377
|
-
if ('cause' in error && error.cause instanceof Error && ((_error$cause = error.cause) === null || _error$cause ===
|
377
|
+
if ('cause' in error && error.cause instanceof Error && ((_error$cause = error.cause) === null || _error$cause === void 0 ? void 0 : _error$cause.message) === 'invalid_client') {
|
378
378
|
// eslint-disable-next-line no-console
|
379
379
|
console.error('RingUI Auth: invalid client detected. Logging out', error);
|
380
380
|
await this.logout();
|
@@ -397,7 +397,7 @@ class Auth {
|
|
397
397
|
return validationError instanceof Error ? this.sendRedirect(validationError) : undefined;
|
398
398
|
}
|
399
399
|
}
|
400
|
-
(_this$_initDeferred4 = this._initDeferred) === null || _this$_initDeferred4 ===
|
400
|
+
(_this$_initDeferred4 = this._initDeferred) === null || _this$_initDeferred4 === void 0 || (_this$_initDeferred4$ = _this$_initDeferred4.reject) === null || _this$_initDeferred4$ === void 0 || _this$_initDeferred4$.call(_this$_initDeferred4, error);
|
401
401
|
throw error;
|
402
402
|
}
|
403
403
|
/**
|
@@ -468,7 +468,7 @@ class Auth {
|
|
468
468
|
});
|
469
469
|
} else {
|
470
470
|
var _this$_requestBuilder2;
|
471
|
-
const authRequest = await ((_this$_requestBuilder2 = this._requestBuilder) === null || _this$_requestBuilder2 ===
|
471
|
+
const authRequest = await ((_this$_requestBuilder2 = this._requestBuilder) === null || _this$_requestBuilder2 === void 0 ? void 0 : _this$_requestBuilder2.prepareAuthRequest());
|
472
472
|
if (authRequest != null) {
|
473
473
|
this._redirectCurrentPage(authRequest.url);
|
474
474
|
}
|
@@ -502,7 +502,7 @@ class Auth {
|
|
502
502
|
getUser(accessToken) {
|
503
503
|
if (this.config.cacheCurrentUser) {
|
504
504
|
var _this$_storage6;
|
505
|
-
return (_this$_storage6 = this._storage) === null || _this$_storage6 ===
|
505
|
+
return (_this$_storage6 = this._storage) === null || _this$_storage6 === void 0 ? void 0 : _this$_storage6.getCachedUser(() => this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams));
|
506
506
|
} else {
|
507
507
|
return this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams);
|
508
508
|
}
|
@@ -527,7 +527,7 @@ class Auth {
|
|
527
527
|
var _this$_storage7;
|
528
528
|
this._setPostponed(false);
|
529
529
|
const accessToken = await this.requestToken();
|
530
|
-
(_this$_storage7 = this._storage) === null || _this$_storage7 ===
|
530
|
+
(_this$_storage7 = this._storage) === null || _this$_storage7 === void 0 || _this$_storage7.wipeCachedCurrentUser();
|
531
531
|
const user = await this.getUser(accessToken);
|
532
532
|
this.user = user;
|
533
533
|
this.listeners.trigger(USER_CHANGED_EVENT, user);
|
@@ -580,14 +580,14 @@ class Auth {
|
|
580
580
|
onPostponeLogout,
|
581
581
|
translations
|
582
582
|
} = this.config;
|
583
|
-
const cancelable = ((_this$user2 = this.user) === null || _this$user2 ===
|
584
|
-
const actualTranslations = translations !== null && translations !==
|
583
|
+
const cancelable = ((_this$user2 = this.user) === null || _this$user2 === void 0 ? void 0 : _this$user2.guest) || canCancel;
|
584
|
+
const actualTranslations = translations !== null && translations !== void 0 ? translations : getTranslations();
|
585
585
|
this._createInitDeferred();
|
586
586
|
const closeDialog = () => {
|
587
587
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
588
|
-
stopTokenListening === null || stopTokenListening ===
|
589
|
-
stopMessageListening === null || stopMessageListening ===
|
590
|
-
hide === null || hide ===
|
588
|
+
stopTokenListening === null || stopTokenListening === void 0 || stopTokenListening();
|
589
|
+
stopMessageListening === null || stopMessageListening === void 0 || stopMessageListening();
|
590
|
+
hide === null || hide === void 0 || hide();
|
591
591
|
/* eslint-enable @typescript-eslint/no-use-before-define */
|
592
592
|
};
|
593
593
|
const onConfirm = () => {
|
@@ -600,28 +600,28 @@ class Auth {
|
|
600
600
|
};
|
601
601
|
const onCancel = () => {
|
602
602
|
var _this$_embeddedFlow, _this$_storage8, _this$user3;
|
603
|
-
(_this$_embeddedFlow = this._embeddedFlow) === null || _this$_embeddedFlow ===
|
604
|
-
(_this$_storage8 = this._storage) === null || _this$_storage8 ===
|
603
|
+
(_this$_embeddedFlow = this._embeddedFlow) === null || _this$_embeddedFlow === void 0 || _this$_embeddedFlow.stop();
|
604
|
+
(_this$_storage8 = this._storage) === null || _this$_storage8 === void 0 || _this$_storage8.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
605
605
|
closeDialog();
|
606
606
|
if (!cancelable) {
|
607
607
|
var _this$_initDeferred6, _this$_initDeferred6$;
|
608
|
-
(_this$_initDeferred6 = this._initDeferred) === null || _this$_initDeferred6 ===
|
608
|
+
(_this$_initDeferred6 = this._initDeferred) === null || _this$_initDeferred6 === void 0 || (_this$_initDeferred6$ = _this$_initDeferred6.resolve) === null || _this$_initDeferred6$ === void 0 || _this$_initDeferred6$.call(_this$_initDeferred6);
|
609
609
|
this.listeners.trigger(LOGOUT_POSTPONED_EVENT);
|
610
610
|
onPostponeLogout();
|
611
611
|
return;
|
612
612
|
}
|
613
|
-
if ((_this$user3 = this.user) !== null && _this$user3 !==
|
613
|
+
if ((_this$user3 = this.user) !== null && _this$user3 !== void 0 && _this$user3.guest && nonInteractive) {
|
614
614
|
this.forceTokenUpdate();
|
615
615
|
} else {
|
616
616
|
var _this$_initDeferred7, _this$_initDeferred7$;
|
617
|
-
(_this$_initDeferred7 = this._initDeferred) === null || _this$_initDeferred7 ===
|
617
|
+
(_this$_initDeferred7 = this._initDeferred) === null || _this$_initDeferred7 === void 0 || (_this$_initDeferred7$ = _this$_initDeferred7.resolve) === null || _this$_initDeferred7$ === void 0 || _this$_initDeferred7$.call(_this$_initDeferred7);
|
618
618
|
}
|
619
619
|
};
|
620
620
|
const onTryAgainClick = async () => {
|
621
|
-
await (onTryAgain === null || onTryAgain ===
|
621
|
+
await (onTryAgain === null || onTryAgain === void 0 ? void 0 : onTryAgain());
|
622
622
|
closeDialog();
|
623
623
|
};
|
624
|
-
const hide = (_this$_authDialogServ = this._authDialogService) === null || _this$_authDialogServ ===
|
624
|
+
const hide = (_this$_authDialogServ = this._authDialogService) === null || _this$_authDialogServ === void 0 ? void 0 : _this$_authDialogServ.call(this, _objectSpread2(_objectSpread2({}, this._service), {}, {
|
625
625
|
loginCaption: actualTranslations.login,
|
626
626
|
loginToCaption: actualTranslations.loginTo,
|
627
627
|
confirmLabel: actualTranslations.login,
|
@@ -632,16 +632,16 @@ class Auth {
|
|
632
632
|
onCancel,
|
633
633
|
onTryAgain: onTryAgain ? onTryAgainClick : undefined
|
634
634
|
}));
|
635
|
-
const stopTokenListening = (_this$_storage9 = this._storage) === null || _this$_storage9 ===
|
635
|
+
const stopTokenListening = (_this$_storage9 = this._storage) === null || _this$_storage9 === void 0 ? void 0 : _this$_storage9.onTokenChange(token => {
|
636
636
|
if (token) {
|
637
637
|
var _this$_initDeferred8, _this$_initDeferred8$;
|
638
638
|
closeDialog();
|
639
|
-
(_this$_initDeferred8 = this._initDeferred) === null || _this$_initDeferred8 ===
|
639
|
+
(_this$_initDeferred8 = this._initDeferred) === null || _this$_initDeferred8 === void 0 || (_this$_initDeferred8$ = _this$_initDeferred8.resolve) === null || _this$_initDeferred8$ === void 0 || _this$_initDeferred8$.call(_this$_initDeferred8);
|
640
640
|
}
|
641
641
|
});
|
642
|
-
const stopMessageListening = (_this$_storage10 = this._storage) === null || _this$_storage10 ===
|
642
|
+
const stopMessageListening = (_this$_storage10 = this._storage) === null || _this$_storage10 === void 0 ? void 0 : _this$_storage10.onMessage(Auth.CLOSE_WINDOW_MESSAGE, () => {
|
643
643
|
var _this$_embeddedFlow2;
|
644
|
-
return (_this$_embeddedFlow2 = this._embeddedFlow) === null || _this$_embeddedFlow2 ===
|
644
|
+
return (_this$_embeddedFlow2 = this._embeddedFlow) === null || _this$_embeddedFlow2 === void 0 ? void 0 : _this$_embeddedFlow2.stop();
|
645
645
|
});
|
646
646
|
}
|
647
647
|
_showUserChangedDialog(_ref) {
|
@@ -657,17 +657,17 @@ class Auth {
|
|
657
657
|
this._createInitDeferred();
|
658
658
|
const done = () => {
|
659
659
|
var _this$_initDeferred9, _this$_initDeferred9$;
|
660
|
-
(_this$_initDeferred9 = this._initDeferred) === null || _this$_initDeferred9 ===
|
660
|
+
(_this$_initDeferred9 = this._initDeferred) === null || _this$_initDeferred9 === void 0 || (_this$_initDeferred9$ = _this$_initDeferred9.resolve) === null || _this$_initDeferred9$ === void 0 || _this$_initDeferred9$.call(_this$_initDeferred9);
|
661
661
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
662
|
-
hide === null || hide ===
|
662
|
+
hide === null || hide === void 0 || hide();
|
663
663
|
};
|
664
|
-
const hide = (_this$_authDialogServ2 = this._authDialogService) === null || _this$_authDialogServ2 ===
|
665
|
-
title: (_translations$youHave = translations === null || translations ===
|
666
|
-
loginCaption: (_translations$login = translations === null || translations ===
|
667
|
-
loginToCaption: (_translations$loginTo = translations === null || translations ===
|
668
|
-
confirmLabel: (_translations$applyCh = translations === null || translations ===
|
669
|
-
tryAgainLabel: (_translations$tryAgai = translations === null || translations ===
|
670
|
-
cancelLabel: (_translations$postpon = translations === null || translations ===
|
664
|
+
const hide = (_this$_authDialogServ2 = this._authDialogService) === null || _this$_authDialogServ2 === void 0 ? void 0 : _this$_authDialogServ2.call(this, _objectSpread2(_objectSpread2({}, this._service), {}, {
|
665
|
+
title: (_translations$youHave = translations === null || translations === void 0 ? void 0 : translations.youHaveLoggedInAs) !== null && _translations$youHave !== void 0 ? _translations$youHave : translate('youHaveLoggedInAs').replace('%userName%', (_newUser$name = newUser.name) !== null && _newUser$name !== void 0 ? _newUser$name : '').replace('{{userName}}', (_newUser$name2 = newUser.name) !== null && _newUser$name2 !== void 0 ? _newUser$name2 : ''),
|
666
|
+
loginCaption: (_translations$login = translations === null || translations === void 0 ? void 0 : translations.login) !== null && _translations$login !== void 0 ? _translations$login : translate('login'),
|
667
|
+
loginToCaption: (_translations$loginTo = translations === null || translations === void 0 ? void 0 : translations.loginTo) !== null && _translations$loginTo !== void 0 ? _translations$loginTo : translate('loginTo'),
|
668
|
+
confirmLabel: (_translations$applyCh = translations === null || translations === void 0 ? void 0 : translations.applyChange) !== null && _translations$applyCh !== void 0 ? _translations$applyCh : translate('applyChange'),
|
669
|
+
tryAgainLabel: (_translations$tryAgai = translations === null || translations === void 0 ? void 0 : translations.tryAgainLabel) !== null && _translations$tryAgai !== void 0 ? _translations$tryAgai : translate('tryAgainLabel'),
|
670
|
+
cancelLabel: (_translations$postpon = translations === null || translations === void 0 ? void 0 : translations.postpone) !== null && _translations$postpon !== void 0 ? _translations$postpon : translate('postpone'),
|
671
671
|
onConfirm: () => {
|
672
672
|
done();
|
673
673
|
onApply();
|
@@ -713,13 +713,13 @@ class Auth {
|
|
713
713
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
714
714
|
hide();
|
715
715
|
window.removeEventListener('online', onCheckAgain);
|
716
|
-
stopListeningCloseMessage === null || stopListeningCloseMessage ===
|
716
|
+
stopListeningCloseMessage === null || stopListeningCloseMessage === void 0 || stopListeningCloseMessage();
|
717
717
|
/* eslint-enable @typescript-eslint/no-use-before-define */
|
718
|
-
(_this$_storage11 = this._storage) === null || _this$_storage11 ===
|
718
|
+
(_this$_storage11 = this._storage) === null || _this$_storage11 === void 0 || _this$_storage11.sendMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, Date.now());
|
719
719
|
clearTimeout(timerId);
|
720
720
|
};
|
721
|
-
const stopListeningCloseMessage = (_this$_storage12 = this._storage) === null || _this$_storage12 ===
|
722
|
-
stopListeningCloseMessage === null || stopListeningCloseMessage ===
|
721
|
+
const stopListeningCloseMessage = (_this$_storage12 = this._storage) === null || _this$_storage12 === void 0 ? void 0 : _this$_storage12.onMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, () => {
|
722
|
+
stopListeningCloseMessage === null || stopListeningCloseMessage === void 0 || stopListeningCloseMessage();
|
723
723
|
done();
|
724
724
|
resolve();
|
725
725
|
});
|
@@ -736,7 +736,7 @@ class Auth {
|
|
736
736
|
onCheckAgain,
|
737
737
|
onPostpone,
|
738
738
|
backendError,
|
739
|
-
translations: translations !== null && translations !==
|
739
|
+
translations: translations !== null && translations !== void 0 ? translations : getTranslationsWithFallback()
|
740
740
|
});
|
741
741
|
window.addEventListener('online', onCheckAgain);
|
742
742
|
function networkWatchdog() {
|
@@ -760,15 +760,15 @@ class Auth {
|
|
760
760
|
await this._checkBackendsStatusesIfEnabled();
|
761
761
|
await this.listeners.trigger('logout');
|
762
762
|
this._updateDomainUser(null);
|
763
|
-
await ((_this$_storage13 = this._storage) === null || _this$_storage13 ===
|
764
|
-
const authRequest = await ((_this$_requestBuilder3 = this._requestBuilder) === null || _this$_requestBuilder3 ===
|
763
|
+
await ((_this$_storage13 = this._storage) === null || _this$_storage13 === void 0 ? void 0 : _this$_storage13.wipeToken());
|
764
|
+
const authRequest = await ((_this$_requestBuilder3 = this._requestBuilder) === null || _this$_requestBuilder3 === void 0 ? void 0 : _this$_requestBuilder3.prepareAuthRequest(requestParams));
|
765
765
|
if (authRequest != null) {
|
766
766
|
this._redirectCurrentPage(authRequest.url);
|
767
767
|
}
|
768
768
|
}
|
769
769
|
async _runEmbeddedLogin() {
|
770
770
|
var _this$_storage14;
|
771
|
-
(_this$_storage14 = this._storage) === null || _this$_storage14 ===
|
771
|
+
(_this$_storage14 = this._storage) === null || _this$_storage14 === void 0 || _this$_storage14.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
772
772
|
try {
|
773
773
|
var _this$_embeddedFlow3;
|
774
774
|
this._isLoginWindowOpen = true;
|
@@ -877,7 +877,7 @@ class Auth {
|
|
877
877
|
const expires = TokenValidator._epoch() + effectiveExpiresIn;
|
878
878
|
if (accessToken != null) {
|
879
879
|
var _this$_storage15;
|
880
|
-
await ((_this$_storage15 = this._storage) === null || _this$_storage15 ===
|
880
|
+
await ((_this$_storage15 = this._storage) === null || _this$_storage15 === void 0 ? void 0 : _this$_storage15.saveToken({
|
881
881
|
accessToken,
|
882
882
|
scopes,
|
883
883
|
expires,
|
@@ -892,8 +892,8 @@ class Auth {
|
|
892
892
|
if (authResponse && this.config.cleanHash) {
|
893
893
|
this.setHash('');
|
894
894
|
}
|
895
|
-
const stateId = authResponse === null || authResponse ===
|
896
|
-
return (await (stateId && ((_this$_storage16 = this._storage) === null || _this$_storage16 ===
|
895
|
+
const stateId = authResponse === null || authResponse === void 0 ? void 0 : authResponse.restoreAuthState;
|
896
|
+
return (await (stateId && ((_this$_storage16 = this._storage) === null || _this$_storage16 === void 0 ? void 0 : _this$_storage16.getState(stateId)))) || {};
|
897
897
|
}
|
898
898
|
_checkBackendsAreUp() {
|
899
899
|
const abortCtrl = new AbortController();
|
@@ -11,10 +11,10 @@ import 'core-js/modules/es.string.match.js';
|
|
11
11
|
const HUB_AUTH_PAGE_OPENED = 'HUB_AUTH_PAGE_OPENED';
|
12
12
|
class BackgroundFlow {
|
13
13
|
constructor(requestBuilder, storage, timeout) {
|
14
|
-
_defineProperty(this, "_requestBuilder",
|
15
|
-
_defineProperty(this, "_storage",
|
16
|
-
_defineProperty(this, "_timeout",
|
17
|
-
_defineProperty(this, "_promise",
|
14
|
+
_defineProperty(this, "_requestBuilder", void 0);
|
15
|
+
_defineProperty(this, "_storage", void 0);
|
16
|
+
_defineProperty(this, "_timeout", void 0);
|
17
|
+
_defineProperty(this, "_promise", void 0);
|
18
18
|
this._requestBuilder = requestBuilder;
|
19
19
|
this._storage = storage;
|
20
20
|
this._timeout = timeout;
|
@@ -67,12 +67,12 @@ import '../_helpers/link.js';
|
|
67
67
|
class IFrameFlow {
|
68
68
|
constructor(requestBuilder, storage, translations) {
|
69
69
|
_defineProperty(this, "hideDialog", null);
|
70
|
-
_defineProperty(this, "_requestBuilder",
|
71
|
-
_defineProperty(this, "_storage",
|
72
|
-
_defineProperty(this, "_translations",
|
73
|
-
_defineProperty(this, "reject",
|
74
|
-
_defineProperty(this, "_promise",
|
75
|
-
_defineProperty(this, "_loginWindow",
|
70
|
+
_defineProperty(this, "_requestBuilder", void 0);
|
71
|
+
_defineProperty(this, "_storage", void 0);
|
72
|
+
_defineProperty(this, "_translations", void 0);
|
73
|
+
_defineProperty(this, "reject", void 0);
|
74
|
+
_defineProperty(this, "_promise", void 0);
|
75
|
+
_defineProperty(this, "_loginWindow", void 0);
|
76
76
|
_defineProperty(this, "_reset", () => {
|
77
77
|
this._promise = null;
|
78
78
|
this.hideDialog = null;
|
@@ -127,7 +127,7 @@ class IFrameFlow {
|
|
127
127
|
});
|
128
128
|
const cleanUp = () => {
|
129
129
|
var _this$hideDialog;
|
130
|
-
(_this$hideDialog = this.hideDialog) === null || _this$hideDialog ===
|
130
|
+
(_this$hideDialog = this.hideDialog) === null || _this$hideDialog === void 0 || _this$hideDialog.call(this);
|
131
131
|
removeStateListener();
|
132
132
|
removeTokenListener();
|
133
133
|
};
|
@@ -19,8 +19,8 @@ class AuthRequestBuilder {
|
|
19
19
|
* @param {AuthStorage} storage
|
20
20
|
*/
|
21
21
|
constructor(config, storage) {
|
22
|
-
_defineProperty(this, "config",
|
23
|
-
_defineProperty(this, "storage",
|
22
|
+
_defineProperty(this, "config", void 0);
|
23
|
+
_defineProperty(this, "storage", void 0);
|
24
24
|
this.config = config;
|
25
25
|
this.storage = storage;
|
26
26
|
}
|
@@ -67,7 +67,7 @@ class AuthRequestBuilder {
|
|
67
67
|
*/
|
68
68
|
_saveState(id, storedState) {
|
69
69
|
var _this$storage;
|
70
|
-
return (_this$storage = this.storage) === null || _this$storage ===
|
70
|
+
return (_this$storage = this.storage) === null || _this$storage === void 0 ? void 0 : _this$storage.saveState(id, storedState);
|
71
71
|
}
|
72
72
|
}
|
73
73
|
_defineProperty(AuthRequestBuilder, "_uuid", uuid.generate);
|
@@ -11,9 +11,9 @@ class AuthError extends ExtendableError {
|
|
11
11
|
constructor() {
|
12
12
|
let authResponse = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
13
13
|
super(authResponse.errorDescription);
|
14
|
-
_defineProperty(this, "code",
|
15
|
-
_defineProperty(this, "uri",
|
16
|
-
_defineProperty(this, "stateId",
|
14
|
+
_defineProperty(this, "code", void 0);
|
15
|
+
_defineProperty(this, "uri", void 0);
|
16
|
+
_defineProperty(this, "stateId", void 0);
|
17
17
|
this.code = authResponse.error;
|
18
18
|
this.uri = authResponse.errorUri;
|
19
19
|
this.stateId = authResponse.state;
|
@@ -30,7 +30,7 @@ class AuthError extends ExtendableError {
|
|
30
30
|
*/
|
31
31
|
class AuthResponseParser {
|
32
32
|
constructor() {
|
33
|
-
_defineProperty(this, "_authResponse",
|
33
|
+
_defineProperty(this, "_authResponse", void 0);
|
34
34
|
this._authResponse = this.readAuthResponseFromURL();
|
35
35
|
}
|
36
36
|
static convertKey(key) {
|