@jetbrains/ring-ui 5.1.20 → 5.1.21
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/auth/request-builder.d.ts +1 -0
- package/components/code/code.d.ts +1 -0
- package/components/grid/row.js +3 -3
- package/components/header/profile.js +1 -1
- package/components/island/header.js +1 -1
- package/components/list/list.js +3 -3
- package/components/loader/loader__core.js +6 -6
- package/components/popup/popup.js +3 -3
- package/components/progress-bar/progress-bar.css +6 -0
- package/components/progress-bar/progress-bar.d.ts +6 -0
- package/components/progress-bar/progress-bar.js +9 -3
- package/components/query-assist/query-assist.js +1 -1
- package/components/select/select-popup.css +4 -0
- package/components/select/select.js +21 -21
- package/dist/_helpers/select__filter.js +1 -1
- package/dist/analytics/analytics__custom-plugin.js +1 -2
- package/dist/analytics/analytics__ga-plugin.js +1 -1
- package/dist/auth/auth__core.js +35 -35
- package/dist/auth/background-flow.js +2 -2
- package/dist/auth/iframe-flow.js +3 -3
- package/dist/auth/request-builder.d.ts +1 -0
- package/dist/auth/request-builder.js +2 -1
- package/dist/auth/storage.js +8 -4
- package/dist/auth/token-validator.js +4 -3
- package/dist/auth/window-flow.js +3 -3
- package/dist/auth-ng/auth-ng.js +0 -1
- package/dist/caret/caret.js +4 -4
- package/dist/clipboard/clipboard-fallback.js +3 -3
- package/dist/code/code.d.ts +1 -0
- package/dist/data-list/data-list.js +2 -2
- package/dist/date-picker/date-picker.js +1 -1
- package/dist/date-picker/date-popup.js +2 -2
- package/dist/dropdown/dropdown.js +2 -2
- package/dist/editable-heading/editable-heading.js +4 -4
- package/dist/global/focus-sensor-hoc.js +6 -6
- package/dist/global/schedule-raf.js +1 -1
- package/dist/grid/row.js +7 -1
- package/dist/header/profile.js +1 -0
- package/dist/header/smart-services.js +2 -2
- package/dist/input/input.js +2 -2
- package/dist/island/content.js +1 -1
- package/dist/island/header.js +1 -0
- package/dist/list/list.js +3 -0
- package/dist/loader/loader.js +1 -1
- package/dist/loader/loader__core.js +19 -7
- package/dist/loader-screen-ng/loader-screen-ng.js +0 -2
- package/dist/message-bundle-ng/message-bundle-ng.js +0 -1
- package/dist/pager/pager.js +4 -4
- package/dist/popup/popup.js +3 -0
- package/dist/progress-bar/progress-bar.d.ts +6 -0
- package/dist/progress-bar/progress-bar.js +11 -4
- package/dist/query-assist/query-assist.js +13 -12
- package/dist/select/select.js +22 -2
- package/dist/select-ng/select-ng.js +0 -2
- package/dist/select-ng/select-ng__lazy.js +1 -1
- package/dist/storage/storage__fallback.js +4 -2
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.js +1 -1
- package/dist/table/multitable.js +7 -7
- package/dist/table/row-with-focus-sensor.js +4 -4
- package/dist/table/selection-shortcuts-hoc.js +11 -11
- package/dist/tag/tag.js +1 -1
- package/dist/tags-input/tags-input.js +7 -7
- package/dist/tooltip/tooltip.js +2 -2
- package/package.json +26 -26
package/components/grid/row.js
CHANGED
|
@@ -4,9 +4,9 @@ import classNames from 'classnames';
|
|
|
4
4
|
import styles from './grid.css';
|
|
5
5
|
const ModifierType = PropTypes.oneOf(['xs', 'sm', 'md', 'lg']);
|
|
6
6
|
const modifierKeys = [
|
|
7
|
-
'start', 'center', 'end',
|
|
8
|
-
'around', 'between',
|
|
9
|
-
'top', 'middle', 'baseline', 'bottom',
|
|
7
|
+
'start', 'center', 'end', // text-align, justify-content
|
|
8
|
+
'around', 'between', // justify-content
|
|
9
|
+
'top', 'middle', 'baseline', 'bottom', // align-items
|
|
10
10
|
'first', 'last' // order
|
|
11
11
|
];
|
|
12
12
|
/**
|
|
@@ -93,7 +93,7 @@ export default class Profile extends PureComponent {
|
|
|
93
93
|
{
|
|
94
94
|
rgItemType: PopupMenu.ListProps.Type.LINK,
|
|
95
95
|
label: translations?.profile ?? translate('profile'),
|
|
96
|
-
target: '_self',
|
|
96
|
+
target: '_self', // Full page reload in Angular
|
|
97
97
|
href: profileUrl,
|
|
98
98
|
LinkComponent
|
|
99
99
|
},
|
|
@@ -45,7 +45,7 @@ class Header extends Component {
|
|
|
45
45
|
});
|
|
46
46
|
const headerStyle = phase != null
|
|
47
47
|
? {
|
|
48
|
-
lineHeight: `${this.style('LINE_HEIGHT')}px`,
|
|
48
|
+
lineHeight: `${this.style('LINE_HEIGHT')}px`, // need to append px because number is a valid line-height value
|
|
49
49
|
paddingTop: this.style('PADDING_TOP'),
|
|
50
50
|
paddingBottom: this.style('PADDING_BOTTOM')
|
|
51
51
|
}
|
package/components/list/list.js
CHANGED
|
@@ -90,9 +90,9 @@ export default class List extends Component {
|
|
|
90
90
|
};
|
|
91
91
|
static defaultProps = {
|
|
92
92
|
data: [],
|
|
93
|
-
restoreActiveIndex: false,
|
|
94
|
-
activateSingleItem: false,
|
|
95
|
-
activateFirstItem: false,
|
|
93
|
+
restoreActiveIndex: false, // restore active item using its "key" property
|
|
94
|
+
activateSingleItem: false, // if there is only one item, activate it
|
|
95
|
+
activateFirstItem: false, // if there no active items, activate the first one
|
|
96
96
|
onMouseOut: noop,
|
|
97
97
|
onSelect: noop,
|
|
98
98
|
onScrollToBottom: noop,
|
|
@@ -40,12 +40,12 @@ export default class LoaderCore {
|
|
|
40
40
|
stop: false,
|
|
41
41
|
deterministic: false,
|
|
42
42
|
colors: [
|
|
43
|
-
{ r: 215, g: 60, b: 234 },
|
|
44
|
-
{ r: 145, g: 53, b: 224 },
|
|
45
|
-
{ r: 88, g: 72, b: 224 },
|
|
46
|
-
{ r: 37, g: 183, b: 255 },
|
|
47
|
-
{ r: 89, g: 189, b: 0 },
|
|
48
|
-
{ r: 251, g: 172, b: 2 },
|
|
43
|
+
{ r: 215, g: 60, b: 234 }, //#D73CEA
|
|
44
|
+
{ r: 145, g: 53, b: 224 }, //#9135E0
|
|
45
|
+
{ r: 88, g: 72, b: 224 }, //#5848F4
|
|
46
|
+
{ r: 37, g: 183, b: 255 }, //#25B7FF
|
|
47
|
+
{ r: 89, g: 189, b: 0 }, //#59BD00
|
|
48
|
+
{ r: 251, g: 172, b: 2 }, //#FBAC02
|
|
49
49
|
{ r: 227, g: 37, b: 129 } //#E32581
|
|
50
50
|
]
|
|
51
51
|
};
|
|
@@ -287,9 +287,9 @@ Popup.propTypes = {
|
|
|
287
287
|
children: PropTypes.node.isRequired,
|
|
288
288
|
dontCloseOnAnchorClick: PropTypes.bool,
|
|
289
289
|
shortcuts: PropTypes.bool,
|
|
290
|
-
keepMounted: PropTypes.bool,
|
|
290
|
+
keepMounted: PropTypes.bool, // pass this prop to preserve the popup's DOM state while hidden
|
|
291
291
|
'data-test': PropTypes.string,
|
|
292
|
-
client: PropTypes.bool,
|
|
292
|
+
client: PropTypes.bool, // true means that it's never used in SSR
|
|
293
293
|
directions: PropTypes.arrayOf(PropTypes.string),
|
|
294
294
|
autoPositioning: PropTypes.bool,
|
|
295
295
|
autoCorrectTopOverflow: PropTypes.bool,
|
|
@@ -298,7 +298,7 @@ Popup.propTypes = {
|
|
|
298
298
|
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
299
299
|
minWidth: PropTypes.number,
|
|
300
300
|
sidePadding: PropTypes.number,
|
|
301
|
-
attached: PropTypes.bool,
|
|
301
|
+
attached: PropTypes.bool, // Popup adjacent to an input, without upper border and shadow
|
|
302
302
|
onMouseDown: PropTypes.func,
|
|
303
303
|
onMouseUp: PropTypes.func,
|
|
304
304
|
onMouseOver: PropTypes.func,
|
|
@@ -63,6 +63,12 @@
|
|
|
63
63
|
|
|
64
64
|
background-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--ring-progress-bar-line-background-color), rgba(0, 0, 0, 0));
|
|
65
65
|
background-repeat: no-repeat;
|
|
66
|
+
|
|
67
|
+
.staticLineColor & {
|
|
68
|
+
animation: none;
|
|
69
|
+
|
|
70
|
+
background-image: var(--ring-progress-bar-line-background-color);
|
|
71
|
+
}
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
|
|
@@ -5,6 +5,7 @@ export interface ProgressBarProps extends HTMLAttributes<HTMLElement> {
|
|
|
5
5
|
value: number;
|
|
6
6
|
label: string;
|
|
7
7
|
global?: boolean | null | undefined;
|
|
8
|
+
staticColor?: boolean;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* @name Progress Bar
|
|
@@ -43,6 +44,11 @@ export default class ProgressBar extends PureComponent<ProgressBarProps> {
|
|
|
43
44
|
* @type {number}
|
|
44
45
|
*/
|
|
45
46
|
value: PropTypes.Requireable<number>;
|
|
47
|
+
/**
|
|
48
|
+
* Disables Disabled progress bar color animation and sets it to static color.
|
|
49
|
+
* @type {boolean}
|
|
50
|
+
*/
|
|
51
|
+
staticColor: PropTypes.Requireable<boolean>;
|
|
46
52
|
};
|
|
47
53
|
static defaultProps: {
|
|
48
54
|
max: number;
|
|
@@ -42,7 +42,12 @@ export default class ProgressBar extends PureComponent {
|
|
|
42
42
|
* A floating point number that specifies current task completion rate.
|
|
43
43
|
* @type {number}
|
|
44
44
|
*/
|
|
45
|
-
value: PropTypes.number
|
|
45
|
+
value: PropTypes.number,
|
|
46
|
+
/**
|
|
47
|
+
* Disables Disabled progress bar color animation and sets it to static color.
|
|
48
|
+
* @type {boolean}
|
|
49
|
+
*/
|
|
50
|
+
staticColor: PropTypes.bool
|
|
46
51
|
};
|
|
47
52
|
static defaultProps = {
|
|
48
53
|
max: 1.0,
|
|
@@ -58,10 +63,11 @@ export default class ProgressBar extends PureComponent {
|
|
|
58
63
|
this.progressbar = el;
|
|
59
64
|
};
|
|
60
65
|
render() {
|
|
61
|
-
const { className, global, max, value, label, ...otherProps } = this.props;
|
|
66
|
+
const { className, global, max, value, label, staticColor, ...otherProps } = this.props;
|
|
62
67
|
const width = value ? `${ProgressBar.toPercent(value, max)}%` : undefined;
|
|
63
68
|
const classes = classNames(styles.progressBar, className, {
|
|
64
|
-
[styles.globalMode]: global
|
|
69
|
+
[styles.globalMode]: global,
|
|
70
|
+
[styles.staticLineColor]: staticColor
|
|
65
71
|
});
|
|
66
72
|
return (<div {...otherProps} className={classes} ref={this.progressbarWrapperRef}>
|
|
67
73
|
<div className={styles.line} ref={this.progressbarRef} role="progressbar" aria-label={label} aria-valuenow={value} aria-valuemin={0} aria-valuemax={max} style={{ width }}/>
|
|
@@ -800,7 +800,7 @@ export default class QueryAssist extends Component {
|
|
|
800
800
|
const inputClasses = classNames(this.props.inputClassName, {
|
|
801
801
|
[`${styles.input} ring-js-shortcuts`]: true,
|
|
802
802
|
[styles.inputGap]: actions.length || this.isRenderingGlassOrLoader() && !glass,
|
|
803
|
-
[styles.inputGap2]: actions.length === 2,
|
|
803
|
+
[styles.inputGap2]: actions.length === 2, // TODO: replace with flex-box layout
|
|
804
804
|
[styles.inputRevertOrder]: !glass || huge
|
|
805
805
|
});
|
|
806
806
|
const placeholderStyles = classNames({
|
|
@@ -181,46 +181,46 @@ function isSameSelected(prevSelected, selected) {
|
|
|
181
181
|
export default class Select extends Component {
|
|
182
182
|
static defaultProps = {
|
|
183
183
|
data: [],
|
|
184
|
-
filter: false,
|
|
184
|
+
filter: false, // enable filter (not in INPUT modes)
|
|
185
185
|
filterIcon: null,
|
|
186
186
|
filterRef: noop,
|
|
187
|
-
multiple: false,
|
|
188
|
-
clear: false,
|
|
189
|
-
loading: false,
|
|
190
|
-
disabled: false,
|
|
187
|
+
multiple: false, // multiple can be an object - see demo for more information
|
|
188
|
+
clear: false, // enable clear button that clears the "selected" state
|
|
189
|
+
loading: false, // show a loading indicator while data is loading
|
|
190
|
+
disabled: false, // disable select
|
|
191
191
|
type: Type.BUTTON,
|
|
192
192
|
size: Size.M,
|
|
193
|
-
targetElement: null,
|
|
194
|
-
hideSelected: false,
|
|
195
|
-
allowAny: false,
|
|
196
|
-
hideArrow: false,
|
|
193
|
+
targetElement: null, // element to bind the popup to (select BUTTON or INPUT by default)
|
|
194
|
+
hideSelected: false, // INPUT mode: clears the input after an option is selected (useful when the selection is displayed in some custom way elsewhere)
|
|
195
|
+
allowAny: false, // INPUT mode: allows any value to be entered
|
|
196
|
+
hideArrow: false, // hide dropdown arrow icon
|
|
197
197
|
showPopup: false,
|
|
198
|
-
maxHeight: 600,
|
|
198
|
+
maxHeight: 600, // height of the options list, including the filter and the 'Add' button
|
|
199
199
|
directions: [
|
|
200
200
|
Popup.PopupProps.Directions.BOTTOM_RIGHT,
|
|
201
201
|
Popup.PopupProps.Directions.BOTTOM_LEFT,
|
|
202
202
|
Popup.PopupProps.Directions.TOP_LEFT,
|
|
203
203
|
Popup.PopupProps.Directions.TOP_RIGHT
|
|
204
204
|
],
|
|
205
|
-
selected: null,
|
|
206
|
-
label: null,
|
|
207
|
-
selectedLabel: null,
|
|
208
|
-
inputPlaceholder: '',
|
|
209
|
-
hint: null,
|
|
205
|
+
selected: null, // current selection (item / array of items)
|
|
206
|
+
label: null, // BUTTON or INPUT label (nothing selected)
|
|
207
|
+
selectedLabel: null, // BUTTON or INPUT label (something selected)
|
|
208
|
+
inputPlaceholder: '', // Placeholder for input modes
|
|
209
|
+
hint: null, // hint text to display under the list
|
|
210
210
|
shortcutsEnabled: false,
|
|
211
211
|
onBeforeOpen: noop,
|
|
212
212
|
onLoadMore: noop,
|
|
213
213
|
onOpen: noop,
|
|
214
214
|
onClose: noop,
|
|
215
|
-
onFilter: noop,
|
|
215
|
+
onFilter: noop, // search string as first argument
|
|
216
216
|
onFocus: noop,
|
|
217
217
|
onBlur: noop,
|
|
218
218
|
onKeyDown: noop,
|
|
219
|
-
onSelect: noop,
|
|
220
|
-
onDeselect: noop,
|
|
221
|
-
onOutsideClick: noop,
|
|
222
|
-
onChange: noop,
|
|
223
|
-
onAdd: noop,
|
|
219
|
+
onSelect: noop, // single + multi
|
|
220
|
+
onDeselect: noop, // multi
|
|
221
|
+
onOutsideClick: noop, // multi
|
|
222
|
+
onChange: noop, // multi
|
|
223
|
+
onAdd: noop, // search string as first argument
|
|
224
224
|
onDone: noop,
|
|
225
225
|
onReset: noop,
|
|
226
226
|
tags: null,
|
|
@@ -10,7 +10,7 @@ import sniffr from '../global/sniffer.js';
|
|
|
10
10
|
import { ActiveItemContext } from '../list/list.js';
|
|
11
11
|
import { I18nContext } from '../i18n/i18n-context.js';
|
|
12
12
|
|
|
13
|
-
var modules_b607bec2 = {"unit":"i__const_unit_0","filterWithTagsFocused":"filterWithTagsFocused_rui_531d","light":"light_rui_2ac4","filterWithTags":"filterWithTags_rui_531d","filterWrapper":"filterWrapper_rui_531d","filterWithTagsInput":"filterWithTagsInput_rui_531d","filter":"filter_rui_531d","filterIcon":"filterIcon_rui_531d","bottomLine":"bottomLine_rui_531d","bottomLineOverItem":"bottomLineOverItem_rui_531d","message":"message_rui_531d","selectAll":"selectAll_rui_531d"};
|
|
13
|
+
var modules_b607bec2 = {"unit":"i__const_unit_0","filterWithTagsFocused":"filterWithTagsFocused_rui_531d","light":"light_rui_2ac4","filterWithTags":"filterWithTags_rui_531d","filterWrapper":"filterWrapper_rui_531d","filterWithTagsInput":"filterWithTagsInput_rui_531d","filter":"filter_rui_531d","popup":"popup_rui_531d","filterIcon":"filterIcon_rui_531d","bottomLine":"bottomLine_rui_531d","bottomLineOverItem":"bottomLineOverItem_rui_531d","message":"message_rui_531d","selectAll":"selectAll_rui_531d"};
|
|
14
14
|
|
|
15
15
|
var _excluded = ["className", "listId"];
|
|
16
16
|
function noop() {}
|
|
@@ -64,7 +64,6 @@ var AnalyticsCustomPlugin = /*#__PURE__*/function () {
|
|
|
64
64
|
if (this._isDevelopment) {
|
|
65
65
|
console.log('TRACKING DATA = ', category, action, data); // eslint-disable-line no-console
|
|
66
66
|
}
|
|
67
|
-
|
|
68
67
|
var baseSendingData = {
|
|
69
68
|
category,
|
|
70
69
|
action,
|
|
@@ -80,7 +79,7 @@ var AnalyticsCustomPlugin = /*#__PURE__*/function () {
|
|
|
80
79
|
this._data.push(sendingData);
|
|
81
80
|
if (this._flushMaxPackSize != null && this._data.length >= this._flushMaxPackSize) {
|
|
82
81
|
var _this$_flush;
|
|
83
|
-
(_this$_flush = this._flush) === null || _this$_flush === void 0
|
|
82
|
+
(_this$_flush = this._flush) === null || _this$_flush === void 0 || _this$_flush.call(this);
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
85
|
}, {
|
|
@@ -31,7 +31,7 @@ var AnalyticsGAPlugin = /*#__PURE__*/function () {
|
|
|
31
31
|
var m = s.getElementsByTagName(o)[0];
|
|
32
32
|
a.async = true;
|
|
33
33
|
a.src = g;
|
|
34
|
-
(_m$parentNode = m.parentNode) === null || _m$parentNode === void 0
|
|
34
|
+
(_m$parentNode = m.parentNode) === null || _m$parentNode === void 0 || _m$parentNode.insertBefore(a, m);
|
|
35
35
|
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
|
|
36
36
|
/**
|
|
37
37
|
* UA-57284711-1 - ga key for development purpose
|
package/dist/auth/auth__core.js
CHANGED
|
@@ -318,7 +318,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
318
318
|
*/
|
|
319
319
|
}, {
|
|
320
320
|
key: "init",
|
|
321
|
-
value: function () {
|
|
321
|
+
value: (function () {
|
|
322
322
|
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
323
323
|
var _this$_storage3,
|
|
324
324
|
_this2 = this;
|
|
@@ -326,7 +326,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
326
326
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
327
327
|
while (1) switch (_context3.prev = _context3.next) {
|
|
328
328
|
case 0:
|
|
329
|
-
(_this$_storage3 = this._storage) === null || _this$_storage3 === void 0
|
|
329
|
+
(_this$_storage3 = this._storage) === null || _this$_storage3 === void 0 || _this$_storage3.onTokenChange( /*#__PURE__*/function () {
|
|
330
330
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(token) {
|
|
331
331
|
var isGuest;
|
|
332
332
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -433,7 +433,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
433
433
|
case 23:
|
|
434
434
|
state = _context3.sent;
|
|
435
435
|
case 24:
|
|
436
|
-
(_this$_initDeferred = this._initDeferred) === null || _this$_initDeferred === void 0 || (_this$_initDeferred$r = _this$_initDeferred.resolve) === null || _this$_initDeferred$r === void 0
|
|
436
|
+
(_this$_initDeferred = this._initDeferred) === null || _this$_initDeferred === void 0 || (_this$_initDeferred$r = _this$_initDeferred.resolve) === null || _this$_initDeferred$r === void 0 || _this$_initDeferred$r.call(_this$_initDeferred, state && state.restoreLocation);
|
|
437
437
|
return _context3.abrupt("return", (_state = state) === null || _state === void 0 ? void 0 : _state.restoreLocation);
|
|
438
438
|
case 28:
|
|
439
439
|
_context3.prev = 28;
|
|
@@ -442,7 +442,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
442
442
|
_context3.next = 35;
|
|
443
443
|
break;
|
|
444
444
|
}
|
|
445
|
-
(_this$_initDeferred2 = this._initDeferred) === null || _this$_initDeferred2 === void 0 || (_this$_initDeferred2$ = _this$_initDeferred2.resolve) === null || _this$_initDeferred2$ === void 0
|
|
445
|
+
(_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
|
|
446
446
|
_context3.next = 34;
|
|
447
447
|
return this.requestUser();
|
|
448
448
|
case 34:
|
|
@@ -459,7 +459,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
459
459
|
return _init.apply(this, arguments);
|
|
460
460
|
}
|
|
461
461
|
return init;
|
|
462
|
-
}()
|
|
462
|
+
}())
|
|
463
463
|
}, {
|
|
464
464
|
key: "sendRedirect",
|
|
465
465
|
value: function () {
|
|
@@ -519,7 +519,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
519
519
|
break;
|
|
520
520
|
}
|
|
521
521
|
state.error = error;
|
|
522
|
-
(_this$_storage5 = this._storage) === null || _this$_storage5 === void 0
|
|
522
|
+
(_this$_storage5 = this._storage) === null || _this$_storage5 === void 0 || _this$_storage5.saveState(error.stateId, state);
|
|
523
523
|
// Return endless promise in the background to avoid service start
|
|
524
524
|
return _context5.abrupt("return", new Promise(noop));
|
|
525
525
|
case 9:
|
|
@@ -578,14 +578,14 @@ var Auth = /*#__PURE__*/function () {
|
|
|
578
578
|
_context6.next = 13;
|
|
579
579
|
return (_this$_tokenValidator2 = this._tokenValidator) === null || _this$_tokenValidator2 === void 0 ? void 0 : _this$_tokenValidator2.validateToken();
|
|
580
580
|
case 13:
|
|
581
|
-
(_this$_initDeferred3 = this._initDeferred) === null || _this$_initDeferred3 === void 0 || (_this$_initDeferred3$ = _this$_initDeferred3.resolve) === null || _this$_initDeferred3$ === void 0
|
|
581
|
+
(_this$_initDeferred3 = this._initDeferred) === null || _this$_initDeferred3 === void 0 || (_this$_initDeferred3$ = _this$_initDeferred3.resolve) === null || _this$_initDeferred3$ === void 0 || _this$_initDeferred3$.call(_this$_initDeferred3);
|
|
582
582
|
return _context6.abrupt("return", undefined);
|
|
583
583
|
case 17:
|
|
584
584
|
_context6.prev = 17;
|
|
585
585
|
_context6.t0 = _context6["catch"](8);
|
|
586
586
|
return _context6.abrupt("return", _context6.t0 instanceof Error ? this.sendRedirect(_context6.t0) : undefined);
|
|
587
587
|
case 20:
|
|
588
|
-
(_this$_initDeferred4 = this._initDeferred) === null || _this$_initDeferred4 === void 0 || (_this$_initDeferred4$ = _this$_initDeferred4.reject) === null || _this$_initDeferred4$ === void 0
|
|
588
|
+
(_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);
|
|
589
589
|
throw error;
|
|
590
590
|
case 22:
|
|
591
591
|
case "end":
|
|
@@ -605,7 +605,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
605
605
|
*/
|
|
606
606
|
}, {
|
|
607
607
|
key: "requestToken",
|
|
608
|
-
value: function () {
|
|
608
|
+
value: (function () {
|
|
609
609
|
var _requestToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
610
610
|
var _this$_initDeferred5, _yield$this$_tokenVal, _this$_tokenValidator3;
|
|
611
611
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
@@ -668,9 +668,10 @@ var Auth = /*#__PURE__*/function () {
|
|
|
668
668
|
* Get new token in the background or redirect to the login page.
|
|
669
669
|
* @return {Promise.<string>}
|
|
670
670
|
*/
|
|
671
|
+
)
|
|
671
672
|
}, {
|
|
672
673
|
key: "forceTokenUpdate",
|
|
673
|
-
value: function () {
|
|
674
|
+
value: (function () {
|
|
674
675
|
var _forceTokenUpdate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
675
676
|
var _this4 = this;
|
|
676
677
|
var _yield$this$_backgrou, _this$_backgroundFlow2, _this$_requestBuilder2, authRequest;
|
|
@@ -793,7 +794,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
793
794
|
return _forceTokenUpdate.apply(this, arguments);
|
|
794
795
|
}
|
|
795
796
|
return forceTokenUpdate;
|
|
796
|
-
}()
|
|
797
|
+
}())
|
|
797
798
|
}, {
|
|
798
799
|
key: "loadCurrentService",
|
|
799
800
|
value: function () {
|
|
@@ -868,7 +869,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
868
869
|
*/
|
|
869
870
|
}, {
|
|
870
871
|
key: "requestUser",
|
|
871
|
-
value: function () {
|
|
872
|
+
value: (function () {
|
|
872
873
|
var _requestUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
873
874
|
var accessToken, user;
|
|
874
875
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
@@ -906,7 +907,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
906
907
|
return _requestUser.apply(this, arguments);
|
|
907
908
|
}
|
|
908
909
|
return requestUser;
|
|
909
|
-
}()
|
|
910
|
+
}())
|
|
910
911
|
}, {
|
|
911
912
|
key: "updateUser",
|
|
912
913
|
value: function () {
|
|
@@ -921,7 +922,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
921
922
|
return this.requestToken();
|
|
922
923
|
case 3:
|
|
923
924
|
accessToken = _context12.sent;
|
|
924
|
-
(_this$_storage7 = this._storage) === null || _this$_storage7 === void 0
|
|
925
|
+
(_this$_storage7 = this._storage) === null || _this$_storage7 === void 0 || _this$_storage7.wipeCachedCurrentUser();
|
|
925
926
|
_context12.next = 7;
|
|
926
927
|
return this.getUser(accessToken);
|
|
927
928
|
case 7:
|
|
@@ -1028,12 +1029,11 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1028
1029
|
this._createInitDeferred();
|
|
1029
1030
|
var closeDialog = function closeDialog() {
|
|
1030
1031
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
1031
|
-
stopTokenListening === null || stopTokenListening === void 0
|
|
1032
|
-
stopMessageListening === null || stopMessageListening === void 0
|
|
1033
|
-
hide === null || hide === void 0
|
|
1032
|
+
stopTokenListening === null || stopTokenListening === void 0 || stopTokenListening();
|
|
1033
|
+
stopMessageListening === null || stopMessageListening === void 0 || stopMessageListening();
|
|
1034
|
+
hide === null || hide === void 0 || hide();
|
|
1034
1035
|
/* eslint-enable @typescript-eslint/no-use-before-define */
|
|
1035
1036
|
};
|
|
1036
|
-
|
|
1037
1037
|
var onConfirm = function onConfirm() {
|
|
1038
1038
|
if (!embeddedLogin) {
|
|
1039
1039
|
closeDialog();
|
|
@@ -1044,12 +1044,12 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1044
1044
|
};
|
|
1045
1045
|
var onCancel = function onCancel() {
|
|
1046
1046
|
var _this7$_embeddedFlow, _this7$_storage, _this7$user;
|
|
1047
|
-
(_this7$_embeddedFlow = _this7._embeddedFlow) === null || _this7$_embeddedFlow === void 0
|
|
1048
|
-
(_this7$_storage = _this7._storage) === null || _this7$_storage === void 0
|
|
1047
|
+
(_this7$_embeddedFlow = _this7._embeddedFlow) === null || _this7$_embeddedFlow === void 0 || _this7$_embeddedFlow.stop();
|
|
1048
|
+
(_this7$_storage = _this7._storage) === null || _this7$_storage === void 0 || _this7$_storage.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
1049
1049
|
closeDialog();
|
|
1050
1050
|
if (!cancelable) {
|
|
1051
1051
|
var _this7$_initDeferred, _this7$_initDeferred$;
|
|
1052
|
-
(_this7$_initDeferred = _this7._initDeferred) === null || _this7$_initDeferred === void 0 || (_this7$_initDeferred$ = _this7$_initDeferred.resolve) === null || _this7$_initDeferred$ === void 0
|
|
1052
|
+
(_this7$_initDeferred = _this7._initDeferred) === null || _this7$_initDeferred === void 0 || (_this7$_initDeferred$ = _this7$_initDeferred.resolve) === null || _this7$_initDeferred$ === void 0 || _this7$_initDeferred$.call(_this7$_initDeferred);
|
|
1053
1053
|
_this7.listeners.trigger(LOGOUT_POSTPONED_EVENT);
|
|
1054
1054
|
onPostponeLogout();
|
|
1055
1055
|
return;
|
|
@@ -1058,7 +1058,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1058
1058
|
_this7.forceTokenUpdate();
|
|
1059
1059
|
} else {
|
|
1060
1060
|
var _this7$_initDeferred2, _this7$_initDeferred3;
|
|
1061
|
-
(_this7$_initDeferred2 = _this7._initDeferred) === null || _this7$_initDeferred2 === void 0 || (_this7$_initDeferred3 = _this7$_initDeferred2.resolve) === null || _this7$_initDeferred3 === void 0
|
|
1061
|
+
(_this7$_initDeferred2 = _this7._initDeferred) === null || _this7$_initDeferred2 === void 0 || (_this7$_initDeferred3 = _this7$_initDeferred2.resolve) === null || _this7$_initDeferred3 === void 0 || _this7$_initDeferred3.call(_this7$_initDeferred2);
|
|
1062
1062
|
}
|
|
1063
1063
|
};
|
|
1064
1064
|
var onTryAgainClick = /*#__PURE__*/function () {
|
|
@@ -1095,7 +1095,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1095
1095
|
if (token) {
|
|
1096
1096
|
var _this7$_initDeferred4, _this7$_initDeferred5;
|
|
1097
1097
|
closeDialog();
|
|
1098
|
-
(_this7$_initDeferred4 = _this7._initDeferred) === null || _this7$_initDeferred4 === void 0 || (_this7$_initDeferred5 = _this7$_initDeferred4.resolve) === null || _this7$_initDeferred5 === void 0
|
|
1098
|
+
(_this7$_initDeferred4 = _this7._initDeferred) === null || _this7$_initDeferred4 === void 0 || (_this7$_initDeferred5 = _this7$_initDeferred4.resolve) === null || _this7$_initDeferred5 === void 0 || _this7$_initDeferred5.call(_this7$_initDeferred4);
|
|
1099
1099
|
}
|
|
1100
1100
|
});
|
|
1101
1101
|
var stopMessageListening = (_this$_storage9 = this._storage) === null || _this$_storage9 === void 0 ? void 0 : _this$_storage9.onMessage(Auth.CLOSE_WINDOW_MESSAGE, function () {
|
|
@@ -1123,9 +1123,9 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1123
1123
|
this._createInitDeferred();
|
|
1124
1124
|
var done = function done() {
|
|
1125
1125
|
var _this8$_initDeferred, _this8$_initDeferred$;
|
|
1126
|
-
(_this8$_initDeferred = _this8._initDeferred) === null || _this8$_initDeferred === void 0 || (_this8$_initDeferred$ = _this8$_initDeferred.resolve) === null || _this8$_initDeferred$ === void 0
|
|
1126
|
+
(_this8$_initDeferred = _this8._initDeferred) === null || _this8$_initDeferred === void 0 || (_this8$_initDeferred$ = _this8$_initDeferred.resolve) === null || _this8$_initDeferred$ === void 0 || _this8$_initDeferred$.call(_this8$_initDeferred);
|
|
1127
1127
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1128
|
-
hide === null || hide === void 0
|
|
1128
|
+
hide === null || hide === void 0 || hide();
|
|
1129
1129
|
};
|
|
1130
1130
|
var hide = (_this$_authDialogServ2 = this._authDialogService) === null || _this$_authDialogServ2 === void 0 ? void 0 : _this$_authDialogServ2.call(this, _objectSpread2(_objectSpread2({}, this._service), {}, {
|
|
1131
1131
|
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 : ''),
|
|
@@ -1183,13 +1183,13 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1183
1183
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
1184
1184
|
hide();
|
|
1185
1185
|
window.removeEventListener('online', onCheckAgain);
|
|
1186
|
-
stopListeningCloseMessage === null || stopListeningCloseMessage === void 0
|
|
1186
|
+
stopListeningCloseMessage === null || stopListeningCloseMessage === void 0 || stopListeningCloseMessage();
|
|
1187
1187
|
/* eslint-enable @typescript-eslint/no-use-before-define */
|
|
1188
|
-
(_this9$_storage = _this9._storage) === null || _this9$_storage === void 0
|
|
1188
|
+
(_this9$_storage = _this9._storage) === null || _this9$_storage === void 0 || _this9$_storage.sendMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, Date.now());
|
|
1189
1189
|
clearTimeout(timerId);
|
|
1190
1190
|
};
|
|
1191
1191
|
var stopListeningCloseMessage = (_this9$_storage2 = _this9._storage) === null || _this9$_storage2 === void 0 ? void 0 : _this9$_storage2.onMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, function () {
|
|
1192
|
-
stopListeningCloseMessage === null || stopListeningCloseMessage === void 0
|
|
1192
|
+
stopListeningCloseMessage === null || stopListeningCloseMessage === void 0 || stopListeningCloseMessage();
|
|
1193
1193
|
done();
|
|
1194
1194
|
resolve();
|
|
1195
1195
|
});
|
|
@@ -1238,7 +1238,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1238
1238
|
*/
|
|
1239
1239
|
}, {
|
|
1240
1240
|
key: "logout",
|
|
1241
|
-
value: function () {
|
|
1241
|
+
value: (function () {
|
|
1242
1242
|
var _logout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(extraParams) {
|
|
1243
1243
|
var _this$_storage10, _this$_requestBuilder3;
|
|
1244
1244
|
var requestParams, authRequest;
|
|
@@ -1276,7 +1276,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1276
1276
|
return _logout.apply(this, arguments);
|
|
1277
1277
|
}
|
|
1278
1278
|
return logout;
|
|
1279
|
-
}()
|
|
1279
|
+
}())
|
|
1280
1280
|
}, {
|
|
1281
1281
|
key: "_runEmbeddedLogin",
|
|
1282
1282
|
value: function () {
|
|
@@ -1286,7 +1286,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1286
1286
|
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1287
1287
|
while (1) switch (_context17.prev = _context17.next) {
|
|
1288
1288
|
case 0:
|
|
1289
|
-
(_this$_storage11 = this._storage) === null || _this$_storage11 === void 0
|
|
1289
|
+
(_this$_storage11 = this._storage) === null || _this$_storage11 === void 0 || _this$_storage11.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
1290
1290
|
_context17.prev = 1;
|
|
1291
1291
|
this._isLoginWindowOpen = true;
|
|
1292
1292
|
_context17.next = 5;
|
|
@@ -1318,7 +1318,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1318
1318
|
*/
|
|
1319
1319
|
}, {
|
|
1320
1320
|
key: "login",
|
|
1321
|
-
value: function () {
|
|
1321
|
+
value: (function () {
|
|
1322
1322
|
var _login = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
1323
1323
|
var _this$_backgroundFlow3, accessToken, _user;
|
|
1324
1324
|
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
@@ -1367,7 +1367,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1367
1367
|
return _login.apply(this, arguments);
|
|
1368
1368
|
}
|
|
1369
1369
|
return login;
|
|
1370
|
-
}()
|
|
1370
|
+
}())
|
|
1371
1371
|
}, {
|
|
1372
1372
|
key: "switchUser",
|
|
1373
1373
|
value: function () {
|
|
@@ -1426,7 +1426,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1426
1426
|
*/
|
|
1427
1427
|
}, {
|
|
1428
1428
|
key: "_checkForAuthResponse",
|
|
1429
|
-
value: function () {
|
|
1429
|
+
value: (function () {
|
|
1430
1430
|
var _checkForAuthResponse2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
1431
1431
|
var _this$_storage12;
|
|
1432
1432
|
var authResponse, _this$config4, defaultScope, defaultExpiresIn, cleanHash, stateId, scope, expiresIn, accessToken, newState, scopes, effectiveExpiresIn, expires, _this$_storage13;
|
|
@@ -1483,7 +1483,7 @@ var Auth = /*#__PURE__*/function () {
|
|
|
1483
1483
|
return _checkForAuthResponse2.apply(this, arguments);
|
|
1484
1484
|
}
|
|
1485
1485
|
return _checkForAuthResponse;
|
|
1486
|
-
}()
|
|
1486
|
+
}())
|
|
1487
1487
|
}, {
|
|
1488
1488
|
key: "_checkForStateRestoration",
|
|
1489
1489
|
value: function () {
|
|
@@ -58,7 +58,7 @@ var BackgroundFlow = /*#__PURE__*/function () {
|
|
|
58
58
|
*/
|
|
59
59
|
}, {
|
|
60
60
|
key: "_load",
|
|
61
|
-
value: function () {
|
|
61
|
+
value: (function () {
|
|
62
62
|
var _load2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
63
63
|
var _this = this;
|
|
64
64
|
var authRequest;
|
|
@@ -124,7 +124,7 @@ var BackgroundFlow = /*#__PURE__*/function () {
|
|
|
124
124
|
return _load2.apply(this, arguments);
|
|
125
125
|
}
|
|
126
126
|
return _load;
|
|
127
|
-
}()
|
|
127
|
+
}())
|
|
128
128
|
}, {
|
|
129
129
|
key: "authorize",
|
|
130
130
|
value: function authorize() {
|
package/dist/auth/iframe-flow.js
CHANGED
|
@@ -98,7 +98,7 @@ var IFrameFlow = /*#__PURE__*/function () {
|
|
|
98
98
|
*/
|
|
99
99
|
_createClass(IFrameFlow, [{
|
|
100
100
|
key: "_load",
|
|
101
|
-
value: function () {
|
|
101
|
+
value: (function () {
|
|
102
102
|
var _load2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
103
103
|
var _this2 = this;
|
|
104
104
|
var authRequest, renderFallbackLink;
|
|
@@ -150,7 +150,7 @@ var IFrameFlow = /*#__PURE__*/function () {
|
|
|
150
150
|
});
|
|
151
151
|
var cleanUp = function cleanUp() {
|
|
152
152
|
var _this2$hideDialog;
|
|
153
|
-
(_this2$hideDialog = _this2.hideDialog) === null || _this2$hideDialog === void 0
|
|
153
|
+
(_this2$hideDialog = _this2.hideDialog) === null || _this2$hideDialog === void 0 || _this2$hideDialog.call(_this2);
|
|
154
154
|
removeStateListener();
|
|
155
155
|
removeTokenListener();
|
|
156
156
|
};
|
|
@@ -165,7 +165,7 @@ var IFrameFlow = /*#__PURE__*/function () {
|
|
|
165
165
|
return _load2.apply(this, arguments);
|
|
166
166
|
}
|
|
167
167
|
return _load;
|
|
168
|
-
}()
|
|
168
|
+
}())
|
|
169
169
|
}, {
|
|
170
170
|
key: "stop",
|
|
171
171
|
value: function stop() {
|
|
@@ -30,7 +30,7 @@ var AuthRequestBuilder = /*#__PURE__*/function () {
|
|
|
30
30
|
*/
|
|
31
31
|
_createClass(AuthRequestBuilder, [{
|
|
32
32
|
key: "prepareAuthRequest",
|
|
33
|
-
value:
|
|
33
|
+
value: (
|
|
34
34
|
/**
|
|
35
35
|
* Save state and build an auth server redirect URL.
|
|
36
36
|
*
|
|
@@ -87,6 +87,7 @@ var AuthRequestBuilder = /*#__PURE__*/function () {
|
|
|
87
87
|
* @return {Promise}
|
|
88
88
|
* @private
|
|
89
89
|
*/
|
|
90
|
+
)
|
|
90
91
|
}, {
|
|
91
92
|
key: "_saveState",
|
|
92
93
|
value: function _saveState(id, storedState) {
|