@jetbrains/ring-ui 5.0.137 → 5.0.139
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/auth__core.d.ts +1 -1
- package/components/auth/auth__core.js +21 -26
- package/components/auth-dialog/auth-dialog.js +3 -1
- package/components/date-picker/date-input.js +3 -1
- package/components/editable-heading/editable-heading.css +7 -3
- package/components/editable-heading/editable-heading.js +29 -8
- package/components/global/react-render-adapter.js +16 -31
- package/components/header/profile.d.ts +3 -1
- package/components/header/profile.js +15 -11
- package/components/i18n/README.md +46 -0
- package/components/i18n/i18n-context.d.ts +13 -0
- package/components/i18n/i18n-context.js +14 -0
- package/components/i18n/i18n.d.ts +59 -0
- package/components/i18n/i18n.js +26 -0
- package/components/i18n/messages.json +53 -0
- package/components/input/input.d.ts +1 -4
- package/components/input/input.js +16 -16
- package/components/message/message.d.ts +1 -5
- package/components/message/message.js +17 -16
- package/components/pager/pager.d.ts +3 -8
- package/components/pager/pager.js +11 -12
- package/components/query-assist/query-assist.d.ts +1 -5
- package/components/query-assist/query-assist.js +30 -29
- package/components/select/select.d.ts +2 -4
- package/components/select/select.js +14 -11
- package/components/select/select__filter.d.ts +0 -1
- package/components/select/select__filter.js +4 -2
- package/components/user-agreement/user-agreement.d.ts +1 -9
- package/components/user-agreement/user-agreement.js +31 -30
- package/components/user-card/card.d.ts +14 -13
- package/components/user-card/card.js +26 -27
- package/dist/_helpers/card.js +28 -33
- package/dist/_helpers/select__filter.js +17 -10
- package/dist/auth/auth.js +1 -0
- package/dist/auth/auth__core.d.ts +1 -1
- package/dist/auth/auth__core.js +18 -27
- package/dist/auth/landing.js +1 -0
- package/dist/auth-dialog/auth-dialog.js +1 -1
- package/dist/auth-ng/auth-ng.js +1 -0
- package/dist/date-picker/date-input.js +3 -1
- package/dist/date-picker/date-picker.js +2 -0
- package/dist/date-picker/date-popup.js +2 -0
- package/dist/editable-heading/editable-heading.js +32 -9
- package/dist/global/react-render-adapter.js +0 -2
- package/dist/header/header.js +2 -0
- package/dist/header/profile.d.ts +3 -1
- package/dist/header/profile.js +27 -15
- package/dist/header/smart-profile.js +2 -0
- package/dist/header/smart-services.js +1 -0
- package/dist/i18n/i18n-context.d.ts +13 -0
- package/dist/i18n/i18n-context.js +24 -0
- package/dist/i18n/i18n.d.ts +59 -0
- package/dist/i18n/i18n.js +136 -0
- package/dist/input/input.d.ts +1 -4
- package/dist/input/input.js +35 -30
- package/dist/link/link.js +1 -1
- package/dist/message/message.d.ts +1 -5
- package/dist/message/message.js +41 -35
- package/dist/pager/pager.d.ts +3 -8
- package/dist/pager/pager.js +25 -15
- package/dist/pager-ng/pager-ng.js +2 -0
- package/dist/permissions-ng/permissions-ng.js +1 -0
- package/dist/query-assist/query-assist.d.ts +1 -5
- package/dist/query-assist/query-assist.js +105 -93
- package/dist/query-assist-ng/query-assist-ng.js +2 -0
- package/dist/select/select.d.ts +2 -4
- package/dist/select/select.js +54 -47
- package/dist/select/select__filter.d.ts +0 -1
- package/dist/select/select__filter.js +2 -0
- package/dist/select/select__popup.js +2 -0
- package/dist/select-ng/select-ng.js +2 -0
- package/dist/select-ng/select-ng__lazy.js +2 -0
- package/dist/style.css +1 -1
- package/dist/table-legacy-ng/table-legacy-ng.js +2 -0
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +2 -0
- package/dist/tags-input/tags-input.js +2 -0
- package/dist/tags-input-ng/tags-input-ng.js +2 -0
- package/dist/user-agreement/service.js +2 -0
- package/dist/user-agreement/user-agreement.d.ts +1 -9
- package/dist/user-agreement/user-agreement.js +41 -41
- package/dist/user-card/card.d.ts +14 -13
- package/dist/user-card/card.js +2 -0
- package/dist/user-card/smart-user-card-tooltip.js +2 -0
- package/dist/user-card/tooltip.js +2 -0
- package/dist/user-card/user-card.js +2 -0
- package/dist/user-card-ng/user-card-ng.js +2 -0
- package/package.json +32 -32
|
@@ -7,7 +7,17 @@ import Link from '../link/link';
|
|
|
7
7
|
import clipboard from '../clipboard/clipboard';
|
|
8
8
|
import badgeStyles from '../badge/badge.css';
|
|
9
9
|
import Icon, { Size as IconSize } from '../icon/icon';
|
|
10
|
+
import { I18nContext } from '../i18n/i18n-context';
|
|
10
11
|
import styles from './user-card.css';
|
|
12
|
+
const translationsShape = PropTypes.shape({
|
|
13
|
+
banned: PropTypes.string.isRequired,
|
|
14
|
+
online: PropTypes.string.isRequired,
|
|
15
|
+
offline: PropTypes.string.isRequired,
|
|
16
|
+
copyToClipboard: PropTypes.string,
|
|
17
|
+
copiedToClipboard: PropTypes.string,
|
|
18
|
+
copingToClipboardError: PropTypes.string,
|
|
19
|
+
unverified: PropTypes.string
|
|
20
|
+
});
|
|
11
21
|
class UserCard extends PureComponent {
|
|
12
22
|
static propTypes = {
|
|
13
23
|
children: PropTypes.node,
|
|
@@ -24,34 +34,19 @@ class UserCard extends PureComponent {
|
|
|
24
34
|
banReason: PropTypes.string,
|
|
25
35
|
unverifiedEmail: PropTypes.bool
|
|
26
36
|
}).isRequired,
|
|
27
|
-
wording:
|
|
28
|
-
|
|
29
|
-
online: PropTypes.string.isRequired,
|
|
30
|
-
offline: PropTypes.string.isRequired,
|
|
31
|
-
copyToClipboard: PropTypes.string,
|
|
32
|
-
copiedToClipboard: PropTypes.string,
|
|
33
|
-
copingToClipboardError: PropTypes.string,
|
|
34
|
-
unverified: PropTypes.string
|
|
35
|
-
})
|
|
36
|
-
};
|
|
37
|
-
static defaultProps = {
|
|
38
|
-
wording: {
|
|
39
|
-
banned: 'banned',
|
|
40
|
-
online: 'online',
|
|
41
|
-
offline: 'offline',
|
|
42
|
-
copyToClipboard: 'Copy email to clipboard',
|
|
43
|
-
copiedToClipboard: 'Email was copied to clipboard',
|
|
44
|
-
copingToClipboardError: 'Failed to copy to clipboard',
|
|
45
|
-
unverified: 'Unverified'
|
|
46
|
-
}
|
|
37
|
+
wording: translationsShape,
|
|
38
|
+
translations: translationsShape
|
|
47
39
|
};
|
|
40
|
+
static contextType = I18nContext;
|
|
48
41
|
copyEmail = () => {
|
|
49
|
-
const
|
|
50
|
-
|
|
42
|
+
const { translate } = this.context;
|
|
43
|
+
const wording = this.props.translations || this.props.wording;
|
|
44
|
+
clipboard.copyText(this.props.user.email || '', wording?.copiedToClipboard ?? translate('copyToClipboard'), wording?.copingToClipboardError ?? translate('copingToClipboardError'));
|
|
51
45
|
};
|
|
52
46
|
render() {
|
|
53
47
|
const { children, info, className, user, avatarInfo, ...restProps } = this.props;
|
|
54
|
-
const
|
|
48
|
+
const { translate } = this.context;
|
|
49
|
+
const wording = this.props.translations || this.props.wording;
|
|
55
50
|
const classes = classNames(className, {});
|
|
56
51
|
const userActiveStatusClasses = classNames(styles.userActiveStatus, user.online ? styles.online : '');
|
|
57
52
|
return (<div className={classes} {...restProps}>
|
|
@@ -68,18 +63,22 @@ class UserCard extends PureComponent {
|
|
|
68
63
|
</Link>)}
|
|
69
64
|
{!user.href && <span className={styles.userName}>{user.name}</span>}
|
|
70
65
|
{typeof user.online === 'boolean' &&
|
|
71
|
-
(<span className={userActiveStatusClasses} title={user.online
|
|
66
|
+
(<span className={userActiveStatusClasses} title={user.online
|
|
67
|
+
? (wording?.online ?? translate('online'))
|
|
68
|
+
: (wording?.offline ?? translate('offline'))}/>)}
|
|
72
69
|
{!!info && <span className={styles.userNameInfo}>{info}</span>}
|
|
73
70
|
{user.banned &&
|
|
74
|
-
(<span className={classNames(badgeStyles.badge, badgeStyles.invalid)} title={user.banReason}>{wording
|
|
71
|
+
(<span className={classNames(badgeStyles.badge, badgeStyles.invalid)} title={user.banReason}>{wording?.banned ?? translate('banned')}</span>)}
|
|
75
72
|
</div>
|
|
76
73
|
<div className={styles.userLogin}>{user.login}</div>
|
|
77
74
|
{user.email && (<span className={styles.userEmailWrapper}>
|
|
78
75
|
<Link href={`mailto:${user.email}`} title={`mailto:${user.email}`} target="_blank" className={styles.userEmail}>
|
|
79
76
|
{user.email}
|
|
80
77
|
</Link>
|
|
81
|
-
{user.unverifiedEmail && (<span className={styles.unverifiedLabel}>
|
|
82
|
-
|
|
78
|
+
{user.unverifiedEmail && (<span className={styles.unverifiedLabel}>
|
|
79
|
+
{wording?.unverified ?? translate('unverified')}
|
|
80
|
+
</span>)}
|
|
81
|
+
<Icon title={wording?.copyToClipboard ?? translate('copyToClipboard')} className={styles.userCopyIcon} onClick={this.copyEmail} glyph={copyIcon} size={IconSize.Size14} suppressSizeWarning/>
|
|
83
82
|
</span>)}
|
|
84
83
|
</div>
|
|
85
84
|
{children}
|
package/dist/_helpers/card.js
CHANGED
|
@@ -8,10 +8,20 @@ import Link from '../link/link.js';
|
|
|
8
8
|
import clipboard from '../clipboard/clipboard.js';
|
|
9
9
|
import { m as modules_6c9187df } from './badge.js';
|
|
10
10
|
import Icon from '../icon/icon.js';
|
|
11
|
+
import { I18nContext } from '../i18n/i18n-context.js';
|
|
11
12
|
import { Size as Size$1 } from '../icon/icon__constants.js';
|
|
12
13
|
|
|
13
14
|
var modules_a4196c17 = {"unit":"i__const_unit_0","light":"light_rui_6e59","userCardSpaced":"userCardSpaced_rui_6e59","userInformationContainer":"userInformationContainer_rui_6e59","userAvatar":"userAvatar_rui_6e59","userInformation":"userInformation_rui_6e59","userInformationGeneral":"userInformationGeneral_rui_6e59","userNameLine":"userNameLine_rui_6e59","userName":"userName_rui_6e59","userLogin":"userLogin_rui_6e59","userEmail":"userEmail_rui_6e59","userCopyIcon":"userCopyIcon_rui_6e59","userEmailWrapper":"userEmailWrapper_rui_6e59","unverifiedLabel":"unverifiedLabel_rui_6e59","userNameInfo":"userNameInfo_rui_6e59","userActiveStatus":"userActiveStatus_rui_6e59","online":"online_rui_6e59"};
|
|
14
15
|
|
|
16
|
+
const translationsShape = PropTypes.shape({
|
|
17
|
+
banned: PropTypes.string.isRequired,
|
|
18
|
+
online: PropTypes.string.isRequired,
|
|
19
|
+
offline: PropTypes.string.isRequired,
|
|
20
|
+
copyToClipboard: PropTypes.string,
|
|
21
|
+
copiedToClipboard: PropTypes.string,
|
|
22
|
+
copingToClipboardError: PropTypes.string,
|
|
23
|
+
unverified: PropTypes.string
|
|
24
|
+
});
|
|
15
25
|
class UserCard extends PureComponent {
|
|
16
26
|
static propTypes = {
|
|
17
27
|
children: PropTypes.node,
|
|
@@ -28,35 +38,20 @@ class UserCard extends PureComponent {
|
|
|
28
38
|
banReason: PropTypes.string,
|
|
29
39
|
unverifiedEmail: PropTypes.bool
|
|
30
40
|
}).isRequired,
|
|
31
|
-
wording:
|
|
32
|
-
|
|
33
|
-
online: PropTypes.string.isRequired,
|
|
34
|
-
offline: PropTypes.string.isRequired,
|
|
35
|
-
copyToClipboard: PropTypes.string,
|
|
36
|
-
copiedToClipboard: PropTypes.string,
|
|
37
|
-
copingToClipboardError: PropTypes.string,
|
|
38
|
-
unverified: PropTypes.string
|
|
39
|
-
})
|
|
40
|
-
};
|
|
41
|
-
static defaultProps = {
|
|
42
|
-
wording: {
|
|
43
|
-
banned: 'banned',
|
|
44
|
-
online: 'online',
|
|
45
|
-
offline: 'offline',
|
|
46
|
-
copyToClipboard: 'Copy email to clipboard',
|
|
47
|
-
copiedToClipboard: 'Email was copied to clipboard',
|
|
48
|
-
copingToClipboardError: 'Failed to copy to clipboard',
|
|
49
|
-
unverified: 'Unverified'
|
|
50
|
-
}
|
|
41
|
+
wording: translationsShape,
|
|
42
|
+
translations: translationsShape
|
|
51
43
|
};
|
|
44
|
+
static contextType = I18nContext;
|
|
52
45
|
copyEmail = () => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
|
|
46
|
+
var _wording$copiedToClip, _wording$copingToClip;
|
|
47
|
+
const {
|
|
48
|
+
translate
|
|
49
|
+
} = this.context;
|
|
50
|
+
const wording = this.props.translations || this.props.wording;
|
|
51
|
+
clipboard.copyText(this.props.user.email || '', (_wording$copiedToClip = wording?.copiedToClipboard) !== null && _wording$copiedToClip !== void 0 ? _wording$copiedToClip : translate('copyToClipboard'), (_wording$copingToClip = wording?.copingToClipboardError) !== null && _wording$copingToClip !== void 0 ? _wording$copingToClip : translate('copingToClipboardError'));
|
|
58
52
|
};
|
|
59
53
|
render() {
|
|
54
|
+
var _wording$online, _wording$offline, _wording$banned, _wording$unverified, _wording$copyToClipbo;
|
|
60
55
|
const {
|
|
61
56
|
children,
|
|
62
57
|
info,
|
|
@@ -65,10 +60,10 @@ class UserCard extends PureComponent {
|
|
|
65
60
|
avatarInfo,
|
|
66
61
|
...restProps
|
|
67
62
|
} = this.props;
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
const {
|
|
64
|
+
translate
|
|
65
|
+
} = this.context;
|
|
66
|
+
const wording = this.props.translations || this.props.wording;
|
|
72
67
|
const classes = classNames(className, {});
|
|
73
68
|
const userActiveStatusClasses = classNames(modules_a4196c17.userActiveStatus, user.online ? modules_a4196c17.online : '');
|
|
74
69
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
@@ -94,13 +89,13 @@ class UserCard extends PureComponent {
|
|
|
94
89
|
className: modules_a4196c17.userName
|
|
95
90
|
}, user.name), typeof user.online === 'boolean' && /*#__PURE__*/React.createElement("span", {
|
|
96
91
|
className: userActiveStatusClasses,
|
|
97
|
-
title: user.online ? wording
|
|
92
|
+
title: user.online ? (_wording$online = wording?.online) !== null && _wording$online !== void 0 ? _wording$online : translate('online') : (_wording$offline = wording?.offline) !== null && _wording$offline !== void 0 ? _wording$offline : translate('offline')
|
|
98
93
|
}), !!info && /*#__PURE__*/React.createElement("span", {
|
|
99
94
|
className: modules_a4196c17.userNameInfo
|
|
100
95
|
}, info), user.banned && /*#__PURE__*/React.createElement("span", {
|
|
101
96
|
className: classNames(modules_6c9187df.badge, modules_6c9187df.invalid),
|
|
102
97
|
title: user.banReason
|
|
103
|
-
}, wording
|
|
98
|
+
}, (_wording$banned = wording?.banned) !== null && _wording$banned !== void 0 ? _wording$banned : translate('banned'))), /*#__PURE__*/React.createElement("div", {
|
|
104
99
|
className: modules_a4196c17.userLogin
|
|
105
100
|
}, user.login), user.email && /*#__PURE__*/React.createElement("span", {
|
|
106
101
|
className: modules_a4196c17.userEmailWrapper
|
|
@@ -111,8 +106,8 @@ class UserCard extends PureComponent {
|
|
|
111
106
|
className: modules_a4196c17.userEmail
|
|
112
107
|
}, user.email), user.unverifiedEmail && /*#__PURE__*/React.createElement("span", {
|
|
113
108
|
className: modules_a4196c17.unverifiedLabel
|
|
114
|
-
}, wording
|
|
115
|
-
title: wording
|
|
109
|
+
}, (_wording$unverified = wording?.unverified) !== null && _wording$unverified !== void 0 ? _wording$unverified : translate('unverified')), /*#__PURE__*/React.createElement(Icon, {
|
|
110
|
+
title: (_wording$copyToClipbo = wording?.copyToClipboard) !== null && _wording$copyToClipbo !== void 0 ? _wording$copyToClipbo : translate('copyToClipboard'),
|
|
116
111
|
className: modules_a4196c17.userCopyIcon,
|
|
117
112
|
onClick: this.copyEmail,
|
|
118
113
|
glyph: copyIcon,
|
|
@@ -5,13 +5,13 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { Input } from '../input/input.js';
|
|
6
6
|
import sniffr from '../global/sniffer.js';
|
|
7
7
|
import { ActiveItemContext } from '../list/list.js';
|
|
8
|
+
import { I18nContext } from '../i18n/i18n-context.js';
|
|
8
9
|
|
|
9
10
|
var modules_b607bec2 = {"unit":"i__const_unit_0","filterWithTagsFocused":"filterWithTagsFocused_rui_531d","light":"light_rui_531d","filterWithTags":"filterWithTags_rui_531d","filterWrapper":"filterWrapper_rui_531d","filterWithTagsInput":"filterWithTagsInput_rui_531d","filter":"filter_rui_531d","filterIcon":"filterIcon_rui_531d","bottomLine":"bottomLine_rui_531d","message":"message_rui_531d","selectAll":"selectAll_rui_531d"};
|
|
10
11
|
|
|
11
12
|
function noop() {}
|
|
12
13
|
class SelectFilter extends Component {
|
|
13
14
|
static defaultProps = {
|
|
14
|
-
placeholder: 'Filter items',
|
|
15
15
|
inputRef: noop
|
|
16
16
|
};
|
|
17
17
|
componentWillUnmount() {
|
|
@@ -42,15 +42,22 @@ class SelectFilter extends Component {
|
|
|
42
42
|
...restProps
|
|
43
43
|
} = this.props;
|
|
44
44
|
const classes = classNames(modules_b607bec2.filter, className);
|
|
45
|
-
return /*#__PURE__*/React.createElement(ActiveItemContext.ValueContext.Consumer, null, activeItemId => /*#__PURE__*/React.createElement(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
return /*#__PURE__*/React.createElement(ActiveItemContext.ValueContext.Consumer, null, activeItemId => /*#__PURE__*/React.createElement(I18nContext.Consumer, null, _ref => {
|
|
46
|
+
var _restProps$placeholde;
|
|
47
|
+
let {
|
|
48
|
+
translate
|
|
49
|
+
} = _ref;
|
|
50
|
+
return /*#__PURE__*/React.createElement(Input, _extends({}, restProps, {
|
|
51
|
+
placeholder: (_restProps$placeholde = restProps.placeholder) !== null && _restProps$placeholde !== void 0 ? _restProps$placeholde : translate('filterItems'),
|
|
52
|
+
"aria-owns": listId,
|
|
53
|
+
"aria-activedescendant": activeItemId,
|
|
54
|
+
autoComplete: "off",
|
|
55
|
+
autoFocus: true,
|
|
56
|
+
borderless: true,
|
|
57
|
+
inputRef: this.inputRef,
|
|
58
|
+
className: classes
|
|
59
|
+
}));
|
|
60
|
+
}));
|
|
54
61
|
}
|
|
55
62
|
}
|
|
56
63
|
SelectFilter.propTypes = {
|
package/dist/auth/auth.js
CHANGED
|
@@ -53,6 +53,7 @@ import '../_helpers/group.js';
|
|
|
53
53
|
import '../global/listeners.js';
|
|
54
54
|
import '../http/http.js';
|
|
55
55
|
import '../global/promise-with-timeout.js';
|
|
56
|
+
import '../i18n/i18n.js';
|
|
56
57
|
import './storage.js';
|
|
57
58
|
import '../storage/storage.js';
|
|
58
59
|
import '../storage/storage__local.js';
|
|
@@ -77,7 +77,7 @@ export interface AuthConfig extends TokenValidatorConfig {
|
|
|
77
77
|
checkBackendIsUp: () => Promise<unknown>;
|
|
78
78
|
onBackendDown: (params: BackendDownParams) => () => void;
|
|
79
79
|
defaultExpiresIn: number;
|
|
80
|
-
translations
|
|
80
|
+
translations?: AuthTranslations | null | undefined;
|
|
81
81
|
userParams?: RequestParams | undefined;
|
|
82
82
|
waitForRedirectTimeout: number;
|
|
83
83
|
}
|
package/dist/auth/auth__core.js
CHANGED
|
@@ -2,6 +2,7 @@ import { getAbsoluteBaseURL, fixUrl } from '../global/url.js';
|
|
|
2
2
|
import Listeners from '../global/listeners.js';
|
|
3
3
|
import HTTP from '../http/http.js';
|
|
4
4
|
import promiseWithTimeout from '../global/promise-with-timeout.js';
|
|
5
|
+
import { getTranslationsWithFallback, translate, getTranslations } from '../i18n/i18n.js';
|
|
5
6
|
import AuthStorage from './storage.js';
|
|
6
7
|
import AuthResponseParser from './response-parser.js';
|
|
7
8
|
import AuthRequestBuilder from './request-builder.js';
|
|
@@ -90,19 +91,7 @@ const DEFAULT_CONFIG = {
|
|
|
90
91
|
onBackendDown: () => () => {},
|
|
91
92
|
defaultExpiresIn: DEFAULT_EXPIRES_TIMEOUT,
|
|
92
93
|
waitForRedirectTimeout: DEFAULT_WAIT_FOR_REDIRECT_TIMEOUT,
|
|
93
|
-
translations:
|
|
94
|
-
login: 'Log in',
|
|
95
|
-
loginTo: 'Log in to %serviceName%',
|
|
96
|
-
cancel: 'Cancel',
|
|
97
|
-
tryAgainLabel: 'Try again',
|
|
98
|
-
postpone: 'Postpone',
|
|
99
|
-
youHaveLoggedInAs: 'You have logged in as another user: %userName%',
|
|
100
|
-
applyChange: 'Apply change',
|
|
101
|
-
backendIsNotAvailable: 'Connection lost',
|
|
102
|
-
checkAgain: 'try again',
|
|
103
|
-
nothingHappensLink: 'Click here if nothing happens',
|
|
104
|
-
errorMessage: 'There may be a problem with your network connection. Make sure that you are online and'
|
|
105
|
-
}
|
|
94
|
+
translations: null
|
|
106
95
|
};
|
|
107
96
|
class Auth {
|
|
108
97
|
static DEFAULT_CONFIG = DEFAULT_CONFIG;
|
|
@@ -190,7 +179,8 @@ class Auth {
|
|
|
190
179
|
}
|
|
191
180
|
this._backgroundFlow = new BackgroundFlow(this._requestBuilder, this._storage, backgroundRefreshTimeout);
|
|
192
181
|
if (this.config.EmbeddedLoginFlow) {
|
|
193
|
-
|
|
182
|
+
var _this$config$translat;
|
|
183
|
+
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());
|
|
194
184
|
}
|
|
195
185
|
const API_BASE = this.config.serverUri + Auth.API_PATH;
|
|
196
186
|
const fetchConfig = config.fetchCredentials ? {
|
|
@@ -567,6 +557,7 @@ class Auth {
|
|
|
567
557
|
translations
|
|
568
558
|
} = this.config;
|
|
569
559
|
const cancelable = this.user?.guest || canCancel;
|
|
560
|
+
const actualTranslations = translations !== null && translations !== void 0 ? translations : getTranslations();
|
|
570
561
|
this._createInitDeferred();
|
|
571
562
|
const closeDialog = () => {
|
|
572
563
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
@@ -606,11 +597,11 @@ class Auth {
|
|
|
606
597
|
};
|
|
607
598
|
const hide = this._authDialogService?.({
|
|
608
599
|
...this._service,
|
|
609
|
-
loginCaption:
|
|
610
|
-
loginToCaption:
|
|
611
|
-
confirmLabel:
|
|
612
|
-
tryAgainLabel:
|
|
613
|
-
cancelLabel: cancelable ?
|
|
600
|
+
loginCaption: actualTranslations.login,
|
|
601
|
+
loginToCaption: actualTranslations.loginTo,
|
|
602
|
+
confirmLabel: actualTranslations.login,
|
|
603
|
+
tryAgainLabel: actualTranslations.tryAgainLabel,
|
|
604
|
+
cancelLabel: cancelable ? actualTranslations.cancel : actualTranslations.postpone,
|
|
614
605
|
errorMessage: this._extractErrorMessage(error, true),
|
|
615
606
|
onConfirm,
|
|
616
607
|
onCancel,
|
|
@@ -625,7 +616,7 @@ class Auth {
|
|
|
625
616
|
const stopMessageListening = this._storage?.onMessage(Auth.CLOSE_WINDOW_MESSAGE, () => this._embeddedFlow?.stop());
|
|
626
617
|
}
|
|
627
618
|
_showUserChangedDialog(_ref) {
|
|
628
|
-
var _newUser$name;
|
|
619
|
+
var _translations$youHave, _newUser$name, _newUser$name2, _translations$login, _translations$loginTo, _translations$applyCh, _translations$tryAgai, _translations$postpon;
|
|
629
620
|
let {
|
|
630
621
|
newUser,
|
|
631
622
|
onApply,
|
|
@@ -642,12 +633,12 @@ class Auth {
|
|
|
642
633
|
};
|
|
643
634
|
const hide = this._authDialogService?.({
|
|
644
635
|
...this._service,
|
|
645
|
-
title: translations
|
|
646
|
-
loginCaption: translations
|
|
647
|
-
loginToCaption: translations
|
|
648
|
-
confirmLabel: translations
|
|
649
|
-
tryAgainLabel: translations
|
|
650
|
-
cancelLabel: translations
|
|
636
|
+
title: (_translations$youHave = 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 : ''),
|
|
637
|
+
loginCaption: (_translations$login = translations?.login) !== null && _translations$login !== void 0 ? _translations$login : translate('login'),
|
|
638
|
+
loginToCaption: (_translations$loginTo = translations?.loginTo) !== null && _translations$loginTo !== void 0 ? _translations$loginTo : translate('loginTo'),
|
|
639
|
+
confirmLabel: (_translations$applyCh = translations?.applyChange) !== null && _translations$applyCh !== void 0 ? _translations$applyCh : translate('applyChange'),
|
|
640
|
+
tryAgainLabel: (_translations$tryAgai = translations?.tryAgainLabel) !== null && _translations$tryAgai !== void 0 ? _translations$tryAgai : translate('tryAgainLabel'),
|
|
641
|
+
cancelLabel: (_translations$postpon = translations?.postpone) !== null && _translations$postpon !== void 0 ? _translations$postpon : translate('postpone'),
|
|
651
642
|
onConfirm: () => {
|
|
652
643
|
done();
|
|
653
644
|
onApply();
|
|
@@ -714,7 +705,7 @@ class Auth {
|
|
|
714
705
|
onCheckAgain,
|
|
715
706
|
onPostpone,
|
|
716
707
|
backendError,
|
|
717
|
-
translations
|
|
708
|
+
translations: translations !== null && translations !== void 0 ? translations : getTranslationsWithFallback()
|
|
718
709
|
});
|
|
719
710
|
window.addEventListener('online', onCheckAgain);
|
|
720
711
|
function networkWatchdog() {
|
package/dist/auth/landing.js
CHANGED
|
@@ -55,6 +55,7 @@ import '../group/group.js';
|
|
|
55
55
|
import '../_helpers/group.js';
|
|
56
56
|
import '../global/listeners.js';
|
|
57
57
|
import '../global/promise-with-timeout.js';
|
|
58
|
+
import '../i18n/i18n.js';
|
|
58
59
|
import '../storage/storage.js';
|
|
59
60
|
import '../storage/storage__local.js';
|
|
60
61
|
import '../storage/storage__fallback.js';
|
|
@@ -120,7 +120,7 @@ class AuthDialog extends Component {
|
|
|
120
120
|
retrying
|
|
121
121
|
} = this.state;
|
|
122
122
|
const defaultTitle = serviceName ? loginToCaption : loginCaption;
|
|
123
|
-
const title = (this.props.title || defaultTitle).replace('%serviceName%', serviceName !== null && serviceName !== void 0 ? serviceName : '');
|
|
123
|
+
const title = (this.props.title || defaultTitle).replace('%serviceName%', serviceName !== null && serviceName !== void 0 ? serviceName : '').replace('{{serviceName}}', serviceName !== null && serviceName !== void 0 ? serviceName : '');
|
|
124
124
|
return /*#__PURE__*/React.createElement(Dialog, {
|
|
125
125
|
label: title,
|
|
126
126
|
"data-test": "ring-auth-dialog",
|
package/dist/auth-ng/auth-ng.js
CHANGED
|
@@ -54,6 +54,7 @@ import '../_helpers/group.js';
|
|
|
54
54
|
import '../global/listeners.js';
|
|
55
55
|
import '../http/http.js';
|
|
56
56
|
import '../global/promise-with-timeout.js';
|
|
57
|
+
import '../i18n/i18n.js';
|
|
57
58
|
import '../auth/storage.js';
|
|
58
59
|
import '../storage/storage.js';
|
|
59
60
|
import '../storage/storage__local.js';
|
|
@@ -19,6 +19,8 @@ import '../global/memoize.js';
|
|
|
19
19
|
import '../link/clickableLink.js';
|
|
20
20
|
import '../_helpers/button__classes.js';
|
|
21
21
|
import '../global/get-uid.js';
|
|
22
|
+
import '../i18n/i18n-context.js';
|
|
23
|
+
import '../i18n/i18n.js';
|
|
22
24
|
import '../global/composeRefs.js';
|
|
23
25
|
import '../_helpers/input.js';
|
|
24
26
|
import '../input/input-label.js';
|
|
@@ -131,7 +133,7 @@ class DateInput extends React.PureComponent {
|
|
|
131
133
|
case 'time':
|
|
132
134
|
return timePlaceholder || translations.addTime;
|
|
133
135
|
default:
|
|
134
|
-
return translations.selectName.replace('%name%', name);
|
|
136
|
+
return translations.selectName.replace('%name%', name).replace('{{name}}', name);
|
|
135
137
|
}
|
|
136
138
|
})();
|
|
137
139
|
const classes = classNames(modules_0c7b7d96.filter, modules_0c7b7d96[`${name}Input`], divider && modules_0c7b7d96[`${name}InputWithDivider`], 'ring-js-shortcuts');
|
|
@@ -50,6 +50,8 @@ import '../_helpers/button__classes.js';
|
|
|
50
50
|
import '../_helpers/link.js';
|
|
51
51
|
import '@jetbrains/icons/close-12px';
|
|
52
52
|
import '../global/prop-types.js';
|
|
53
|
+
import '../i18n/i18n-context.js';
|
|
54
|
+
import '../i18n/i18n.js';
|
|
53
55
|
import '../global/composeRefs.js';
|
|
54
56
|
import '../_helpers/input.js';
|
|
55
57
|
import '../input/input-label.js';
|
|
@@ -28,6 +28,8 @@ import '../link/clickableLink.js';
|
|
|
28
28
|
import '../global/controls-height.js';
|
|
29
29
|
import '../_helpers/button__classes.js';
|
|
30
30
|
import '../global/get-uid.js';
|
|
31
|
+
import '../i18n/i18n-context.js';
|
|
32
|
+
import '../i18n/i18n.js';
|
|
31
33
|
import '../global/composeRefs.js';
|
|
32
34
|
import '../_helpers/input.js';
|
|
33
35
|
import '../input/input-label.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import Heading, { Levels } from '../heading/heading.js';
|
|
5
5
|
import { Button } from '../button/button.js';
|
|
@@ -20,6 +20,8 @@ import '../global/controls-height.js';
|
|
|
20
20
|
import '../_helpers/button__classes.js';
|
|
21
21
|
import '@jetbrains/icons/close-12px';
|
|
22
22
|
import '../global/prop-types.js';
|
|
23
|
+
import '../i18n/i18n-context.js';
|
|
24
|
+
import '../i18n/i18n.js';
|
|
23
25
|
import '../global/composeRefs.js';
|
|
24
26
|
import '../input/input-label.js';
|
|
25
27
|
import '../shortcuts/core.js';
|
|
@@ -27,7 +29,7 @@ import 'combokeys';
|
|
|
27
29
|
import '../global/sniffer.js';
|
|
28
30
|
import 'sniffr';
|
|
29
31
|
|
|
30
|
-
var modules_6e69b0fe = {"unit":"i__const_unit_0","editableHeading":"editableHeading_rui_0870","fullSize":"fullSize_rui_0870","isEditing":"isEditing_rui_0870","headingWrapperButton":"headingWrapperButton_rui_0870","disabled":"disabled_rui_0870","heading":"heading_rui_0870","multiline":"multiline_rui_0870","input":"input_rui_0870","error":"error_rui_0870","button":"button_rui_0870","errorText":"errorText_rui_0870","level1":"level1_rui_0870","level2":"level2_rui_0870","level3":"level3_rui_0870","sizeS":"sizeS_rui_0870","sizeM":"sizeM_rui_0870","sizeL":"sizeL_rui_0870","sizeFULL":"sizeFULL_rui_0870"};
|
|
32
|
+
var modules_6e69b0fe = {"unit":"i__const_unit_0","editableHeading":"editableHeading_rui_0870","fullSize":"fullSize_rui_0870","isEditing":"isEditing_rui_0870","headingWrapperButton":"headingWrapperButton_rui_0870","disabled":"disabled_rui_0870","selectionMode":"selectionMode_rui_0870","heading":"heading_rui_0870","multiline":"multiline_rui_0870","input":"input_rui_0870","error":"error_rui_0870","button":"button_rui_0870","errorText":"errorText_rui_0870","level1":"level1_rui_0870","level2":"level2_rui_0870","level3":"level3_rui_0870","sizeS":"sizeS_rui_0870","sizeM":"sizeM_rui_0870","sizeL":"sizeL_rui_0870","sizeFULL":"sizeFULL_rui_0870"};
|
|
31
33
|
|
|
32
34
|
function noop() {}
|
|
33
35
|
const EditableHeading = props => {
|
|
@@ -61,6 +63,8 @@ const EditableHeading = props => {
|
|
|
61
63
|
} = props;
|
|
62
64
|
const [shortcutsScope] = React.useState(getUID('ring-editable-heading-'));
|
|
63
65
|
const [isInFocus, setIsInFocus] = React.useState(false);
|
|
66
|
+
const [isMouseDown, setIsMouseDown] = React.useState(false);
|
|
67
|
+
const [isInSelectionMode, setIsInSelectionMode] = React.useState(false);
|
|
64
68
|
const hasError = error !== undefined;
|
|
65
69
|
const isSaveDisabled = !isSavingPossible || !children || children.trim() === '' || hasError || isSaving;
|
|
66
70
|
const isCancelDisabled = isSaving;
|
|
@@ -80,16 +84,27 @@ const EditableHeading = props => {
|
|
|
80
84
|
[modules_6e69b0fe.isEditing]: isEditing,
|
|
81
85
|
[modules_6e69b0fe.error]: hasError,
|
|
82
86
|
[modules_6e69b0fe.disabled]: disabled,
|
|
83
|
-
[modules_6e69b0fe.multiline]: multiline
|
|
87
|
+
[modules_6e69b0fe.multiline]: multiline,
|
|
88
|
+
[modules_6e69b0fe.selectionMode]: isInSelectionMode
|
|
84
89
|
});
|
|
85
90
|
const headingClasses = classNames(modules_6e69b0fe.heading, headingClassName, modules_6e69b0fe[`size${size}`]);
|
|
86
91
|
const inputClasses = classNames('ring-js-shortcuts', modules_6e69b0fe.input, modules_88cfaf40[`size${size}`], modules_6e69b0fe[`level${level}`], inputClassName);
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
const onHeadingMouseDown = React.useCallback(() => {
|
|
93
|
+
setIsMouseDown(true);
|
|
94
|
+
}, []);
|
|
95
|
+
const onMouseMove = React.useCallback(() => {
|
|
96
|
+
if (!isMouseDown) {
|
|
97
|
+
return;
|
|
90
98
|
}
|
|
91
|
-
|
|
92
|
-
}, [
|
|
99
|
+
setIsInSelectionMode(true);
|
|
100
|
+
}, [isMouseDown]);
|
|
101
|
+
const onMouseUp = React.useCallback(() => {
|
|
102
|
+
if (isMouseDown && !isInSelectionMode && !disabled) {
|
|
103
|
+
onEdit();
|
|
104
|
+
}
|
|
105
|
+
setIsMouseDown(false);
|
|
106
|
+
setIsInSelectionMode(false);
|
|
107
|
+
}, [isMouseDown, isInSelectionMode, disabled, onEdit]);
|
|
93
108
|
const onInputFocus = React.useCallback(e => {
|
|
94
109
|
setIsInFocus(true);
|
|
95
110
|
onFocus?.(e);
|
|
@@ -98,6 +113,14 @@ const EditableHeading = props => {
|
|
|
98
113
|
setIsInFocus(false);
|
|
99
114
|
onBlur?.(e);
|
|
100
115
|
}, [onBlur]);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
window.addEventListener('mousemove', onMouseMove);
|
|
118
|
+
window.addEventListener('mouseup', onMouseUp);
|
|
119
|
+
return () => {
|
|
120
|
+
window.removeEventListener('mousemove', onMouseMove);
|
|
121
|
+
window.removeEventListener('mouseup', onMouseUp);
|
|
122
|
+
};
|
|
123
|
+
});
|
|
101
124
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
102
125
|
className: classes
|
|
103
126
|
}, !disabled && isEditing ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Shortcuts, {
|
|
@@ -116,7 +139,7 @@ const EditableHeading = props => {
|
|
|
116
139
|
}))) : /*#__PURE__*/React.createElement("button", {
|
|
117
140
|
type: "button",
|
|
118
141
|
className: modules_6e69b0fe.headingWrapperButton,
|
|
119
|
-
|
|
142
|
+
onMouseDown: onHeadingMouseDown
|
|
120
143
|
}, /*#__PURE__*/React.createElement(Heading, {
|
|
121
144
|
className: headingClasses,
|
|
122
145
|
level: level,
|
package/dist/header/header.js
CHANGED
|
@@ -69,6 +69,8 @@ import '../dropdown/dropdown.js';
|
|
|
69
69
|
import '../global/typescript-utils.js';
|
|
70
70
|
import '../_helpers/anchor.js';
|
|
71
71
|
import '../popup-menu/popup-menu.js';
|
|
72
|
+
import '../i18n/i18n-context.js';
|
|
73
|
+
import '../i18n/i18n.js';
|
|
72
74
|
import '../auth/auth.js';
|
|
73
75
|
import '../auth/window-flow.js';
|
|
74
76
|
import '../auth/response-parser.js';
|
package/dist/header/profile.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface ProfileTranslations {
|
|
|
15
15
|
export interface ProfileProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
16
16
|
closeOnSelect: boolean;
|
|
17
17
|
renderPopupItems: (items: ListDataItem[]) => readonly ListDataItem[];
|
|
18
|
-
translations
|
|
18
|
+
translations?: ProfileTranslations | null | undefined;
|
|
19
19
|
size: Size;
|
|
20
20
|
renderGuest: (props: ProfileProps) => ReactNode;
|
|
21
21
|
hasUpdates?: boolean | null | undefined;
|
|
@@ -67,6 +67,8 @@ export default class Profile extends PureComponent<ProfileProps> {
|
|
|
67
67
|
renderGuest: PropTypes.Requireable<(...args: any[]) => any>;
|
|
68
68
|
};
|
|
69
69
|
static defaultProps: ProfileProps;
|
|
70
|
+
static contextType: React.Context<import("../i18n/i18n-context").I18nContextProps>;
|
|
71
|
+
context: React.ContextType<typeof Profile.contextType>;
|
|
70
72
|
static Size: typeof Size;
|
|
71
73
|
render(): string | number | boolean | JSX.Element | React.ReactFragment | null | undefined;
|
|
72
74
|
}
|