@atlaskit/user-picker 8.8.6 → 9.0.2
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/CHANGELOG.md +24 -0
- package/dist/cjs/analytics.js +7 -81
- package/dist/cjs/components/AddOptionAvatar.js +16 -12
- package/dist/cjs/components/AvatarItemOption.js +56 -32
- package/dist/cjs/components/EmailOption/main.js +9 -7
- package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +62 -21
- package/dist/cjs/components/ExternalUserOption/InfoIcon.js +9 -15
- package/dist/cjs/components/ExternalUserOption/SourcesTooltipContent.js +29 -23
- package/dist/cjs/components/ExternalUserOption/main.js +61 -35
- package/dist/cjs/components/GroupOption/main.js +23 -19
- package/dist/cjs/components/MultiValue.js +18 -16
- package/dist/cjs/components/PopupControl.js +20 -21
- package/dist/cjs/components/SingleValue.js +25 -11
- package/dist/cjs/components/SingleValueContainer.js +9 -8
- package/dist/cjs/components/TeamOption/main.js +13 -11
- package/dist/cjs/components/UserOption.js +13 -11
- package/dist/cjs/index.js +0 -26
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics.js +3 -61
- package/dist/es2019/components/AddOptionAvatar.js +16 -11
- package/dist/es2019/components/AvatarItemOption.js +47 -42
- package/dist/es2019/components/EmailOption/main.js +11 -8
- package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +56 -41
- package/dist/es2019/components/ExternalUserOption/InfoIcon.js +9 -7
- package/dist/es2019/components/ExternalUserOption/SourcesTooltipContent.js +27 -21
- package/dist/es2019/components/ExternalUserOption/main.js +56 -29
- package/dist/es2019/components/GroupOption/main.js +22 -19
- package/dist/es2019/components/MultiValue.js +19 -13
- package/dist/es2019/components/PopupControl.js +21 -18
- package/dist/es2019/components/SingleValue.js +25 -22
- package/dist/es2019/components/SingleValueContainer.js +11 -7
- package/dist/es2019/components/TeamOption/main.js +15 -12
- package/dist/es2019/components/UserOption.js +15 -12
- package/dist/es2019/index.js +0 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.js +5 -65
- package/dist/esm/components/AddOptionAvatar.js +17 -11
- package/dist/esm/components/AvatarItemOption.js +56 -27
- package/dist/esm/components/EmailOption/main.js +10 -8
- package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +65 -18
- package/dist/esm/components/ExternalUserOption/InfoIcon.js +9 -8
- package/dist/esm/components/ExternalUserOption/SourcesTooltipContent.js +27 -18
- package/dist/esm/components/ExternalUserOption/main.js +65 -32
- package/dist/esm/components/GroupOption/main.js +22 -15
- package/dist/esm/components/MultiValue.js +19 -13
- package/dist/esm/components/PopupControl.js +21 -11
- package/dist/esm/components/SingleValue.js +26 -9
- package/dist/esm/components/SingleValueContainer.js +10 -7
- package/dist/esm/components/TeamOption/main.js +14 -12
- package/dist/esm/components/UserOption.js +14 -12
- package/dist/esm/index.js +0 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics.d.ts +1 -10
- package/dist/types/components/AvatarItemOption.d.ts +3 -2
- package/dist/types/components/BaseUserPicker.d.ts +1 -1
- package/dist/types/components/EmailOption/main.d.ts +1 -0
- package/dist/types/components/ExternalUserOption/ExternalAvatarItemOption.d.ts +1 -0
- package/dist/types/components/ExternalUserOption/SourcesTooltipContent.d.ts +3 -2
- package/dist/types/components/ExternalUserOption/index.d.ts +1 -1
- package/dist/types/components/ExternalUserOption/main.d.ts +6 -11
- package/dist/types/components/GroupOption/main.d.ts +2 -1
- package/dist/types/components/MultiValue.d.ts +1 -0
- package/dist/types/components/PopupControl.d.ts +1 -0
- package/dist/types/components/PopupUserPicker.d.ts +1 -1
- package/dist/types/components/SingleValueContainer.d.ts +1 -0
- package/dist/types/components/UserPicker.d.ts +1 -1
- package/dist/types/index.d.ts +0 -2
- package/docs/1-smart-user-picker.tsx +1 -1
- package/package.json +5 -4
- package/dist/cjs/components/smart-user-picker/components/index.js +0 -602
- package/dist/cjs/components/smart-user-picker/config/index.js +0 -50
- package/dist/cjs/components/smart-user-picker/index.js +0 -41
- package/dist/cjs/components/smart-user-picker/service/UsersClient.js +0 -85
- package/dist/cjs/components/smart-user-picker/service/index.js +0 -15
- package/dist/cjs/components/smart-user-picker/service/recommendationClient.js +0 -75
- package/dist/cjs/components/smart-user-picker/service/users-transformer.js +0 -98
- package/dist/es2019/components/smart-user-picker/components/index.js +0 -398
- package/dist/es2019/components/smart-user-picker/config/index.js +0 -37
- package/dist/es2019/components/smart-user-picker/index.js +0 -7
- package/dist/es2019/components/smart-user-picker/service/UsersClient.js +0 -65
- package/dist/es2019/components/smart-user-picker/service/index.js +0 -1
- package/dist/es2019/components/smart-user-picker/service/recommendationClient.js +0 -56
- package/dist/es2019/components/smart-user-picker/service/users-transformer.js +0 -77
- package/dist/esm/components/smart-user-picker/components/index.js +0 -582
- package/dist/esm/components/smart-user-picker/config/index.js +0 -38
- package/dist/esm/components/smart-user-picker/index.js +0 -7
- package/dist/esm/components/smart-user-picker/service/UsersClient.js +0 -79
- package/dist/esm/components/smart-user-picker/service/index.js +0 -1
- package/dist/esm/components/smart-user-picker/service/recommendationClient.js +0 -64
- package/dist/esm/components/smart-user-picker/service/users-transformer.js +0 -87
- package/dist/types/components/smart-user-picker/components/index.d.ts +0 -196
- package/dist/types/components/smart-user-picker/config/index.d.ts +0 -17
- package/dist/types/components/smart-user-picker/index.d.ts +0 -8
- package/dist/types/components/smart-user-picker/service/UsersClient.d.ts +0 -14
- package/dist/types/components/smart-user-picker/service/index.d.ts +0 -1
- package/dist/types/components/smart-user-picker/service/recommendationClient.d.ts +0 -23
- package/dist/types/components/smart-user-picker/service/users-transformer.d.ts +0 -25
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
3
5
|
import { token } from '@atlaskit/tokens';
|
|
6
|
+
import { jsx } from '@emotion/core';
|
|
4
7
|
import React from 'react';
|
|
5
|
-
import { AvatarItemOption,
|
|
8
|
+
import { AvatarItemOption, textWrapper } from './AvatarItemOption';
|
|
6
9
|
import { HighlightText } from './HighlightText';
|
|
7
10
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
8
11
|
import { hasValue } from './utils';
|
|
@@ -18,19 +21,19 @@ export class UserOption extends React.PureComponent {
|
|
|
18
21
|
highlight
|
|
19
22
|
}
|
|
20
23
|
} = this.props;
|
|
21
|
-
const result = [
|
|
24
|
+
const result = [jsx("span", {
|
|
22
25
|
key: "name",
|
|
23
|
-
|
|
24
|
-
},
|
|
26
|
+
css: textWrapper(this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
27
|
+
}, jsx(HighlightText, {
|
|
25
28
|
highlights: highlight && highlight.name
|
|
26
29
|
}, name))];
|
|
27
30
|
|
|
28
31
|
if (hasValue(publicName) && name.trim() !== publicName.trim()) {
|
|
29
|
-
result.push(
|
|
32
|
+
result.push(jsx(React.Fragment, {
|
|
30
33
|
key: "publicName"
|
|
31
|
-
}, ' ',
|
|
32
|
-
|
|
33
|
-
}, "(",
|
|
34
|
+
}, ' ', jsx("span", {
|
|
35
|
+
css: textWrapper(this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
36
|
+
}, "(", jsx(HighlightText, {
|
|
34
37
|
highlights: highlight && highlight.publicName
|
|
35
38
|
}, publicName), ")")));
|
|
36
39
|
}
|
|
@@ -38,8 +41,8 @@ export class UserOption extends React.PureComponent {
|
|
|
38
41
|
return result;
|
|
39
42
|
});
|
|
40
43
|
|
|
41
|
-
_defineProperty(this, "renderSecondaryText", () => this.props.user.byline ?
|
|
42
|
-
|
|
44
|
+
_defineProperty(this, "renderSecondaryText", () => this.props.user.byline ? jsx("span", {
|
|
45
|
+
css: textWrapper(this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
43
46
|
}, this.props.user.byline) : undefined);
|
|
44
47
|
|
|
45
48
|
_defineProperty(this, "renderAvatar", () => {
|
|
@@ -50,7 +53,7 @@ export class UserOption extends React.PureComponent {
|
|
|
50
53
|
},
|
|
51
54
|
status
|
|
52
55
|
} = this.props;
|
|
53
|
-
return
|
|
56
|
+
return jsx(SizeableAvatar, {
|
|
54
57
|
appearance: "big",
|
|
55
58
|
src: avatarUrl,
|
|
56
59
|
presence: status,
|
|
@@ -64,7 +67,7 @@ export class UserOption extends React.PureComponent {
|
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
render() {
|
|
67
|
-
return
|
|
70
|
+
return jsx(AvatarItemOption, {
|
|
68
71
|
avatar: this.renderAvatar(),
|
|
69
72
|
primaryText: this.getPrimaryText(),
|
|
70
73
|
secondaryText: this.renderSecondaryText(),
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { isValidEmail } from './components/emailValidation';
|
|
2
2
|
export { UserPicker as default } from './components/UserPicker';
|
|
3
|
-
export { getUserRecommendations, hydrateDefaultValues, SmartUserPicker, setSmartUserPickerEnv } from './components/smart-user-picker/index';
|
|
4
3
|
export { PopupUserPicker } from './components/PopupUserPicker';
|
|
5
4
|
export { isEmail, isExternalUser, isTeam, isUser } from './components/utils';
|
|
6
5
|
export { // Constants
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/analytics.js
CHANGED
|
@@ -135,71 +135,11 @@ export var searchedEvent = function searchedEvent(props, state, session, journey
|
|
|
135
135
|
export var failedEvent = function failedEvent(props, _, session, journeyId) {
|
|
136
136
|
return createEvent('operational', 'failed', 'userPicker', _objectSpread({}, createDefaultPickerAttributes(props, session, journeyId)));
|
|
137
137
|
};
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
childObjectId = props.childObjectId,
|
|
144
|
-
prefetch = props.prefetch,
|
|
145
|
-
maxOptions = props.maxOptions,
|
|
146
|
-
includeTeams = props.includeTeams,
|
|
147
|
-
productKey = props.productKey,
|
|
148
|
-
principalId = props.principalId,
|
|
149
|
-
siteId = props.siteId,
|
|
150
|
-
orgId = props.orgId,
|
|
151
|
-
filterOptions = props.filterOptions;
|
|
152
|
-
var sessionId = state.sessionId,
|
|
153
|
-
query = state.query;
|
|
154
|
-
var maxNumberOfResults = maxOptions || 100;
|
|
155
|
-
return {
|
|
156
|
-
context: fieldId,
|
|
157
|
-
childObjectId: childObjectId,
|
|
158
|
-
containerId: containerId,
|
|
159
|
-
hasFilterOptions: Boolean(filterOptions),
|
|
160
|
-
includeTeams: includeTeams,
|
|
161
|
-
maxNumberOfResults: maxNumberOfResults,
|
|
162
|
-
objectId: objectId,
|
|
163
|
-
prefetch: prefetch,
|
|
164
|
-
principalId: principalId,
|
|
165
|
-
productKey: productKey,
|
|
166
|
-
queryLength: (query || '').length,
|
|
167
|
-
siteId: siteId,
|
|
168
|
-
orgId: orgId,
|
|
169
|
-
sessionId: sessionId
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
var createSmartUserPickerEvent = function createSmartUserPickerEvent(action, actionSubect) {
|
|
174
|
-
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
175
|
-
return _objectSpread({
|
|
176
|
-
source: 'smart-user-picker'
|
|
177
|
-
}, createEvent('operational', action, actionSubect, attributes));
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
export var preparedUsersLoadedEvent = function preparedUsersLoadedEvent(props, state) {
|
|
181
|
-
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
182
|
-
return createSmartUserPickerEvent('loaded', 'preparedUsers', _objectSpread(_objectSpread({}, createDefaultSmartPickerAttributes(props, state)), attributes));
|
|
183
|
-
};
|
|
184
|
-
export var mountedWithPrefetchEvent = function mountedWithPrefetchEvent(props, state) {
|
|
185
|
-
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
186
|
-
return createSmartUserPickerEvent('mounted', 'prefetch', _objectSpread(_objectSpread({}, createDefaultSmartPickerAttributes(props, state)), attributes));
|
|
187
|
-
};
|
|
188
|
-
export var filterUsersEvent = function filterUsersEvent(props, state) {
|
|
189
|
-
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
190
|
-
return createSmartUserPickerEvent('filtered', 'users', _objectSpread(_objectSpread({}, createDefaultSmartPickerAttributes(props, state)), attributes));
|
|
191
|
-
};
|
|
192
|
-
export var requestUsersEvent = function requestUsersEvent(props, state) {
|
|
193
|
-
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
194
|
-
return createSmartUserPickerEvent('requested', 'users', _objectSpread(_objectSpread({}, createDefaultSmartPickerAttributes(props, state)), attributes));
|
|
195
|
-
};
|
|
196
|
-
export var successfulRequestUsersEvent = function successfulRequestUsersEvent(props, state) {
|
|
197
|
-
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
198
|
-
return createSmartUserPickerEvent('successful', 'usersRequest', _objectSpread(_objectSpread({}, createDefaultSmartPickerAttributes(props, state)), attributes));
|
|
199
|
-
};
|
|
200
|
-
export var failedRequestUsersEvent = function failedRequestUsersEvent(props, state) {
|
|
201
|
-
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
202
|
-
return createSmartUserPickerEvent('failed', 'usersRequest', _objectSpread(_objectSpread({}, createDefaultSmartPickerAttributes(props, state)), attributes));
|
|
138
|
+
export var userInfoEvent = function userInfoEvent(sources, accountId) {
|
|
139
|
+
return createEvent('ui', 'displayed', 'userInfo', {
|
|
140
|
+
sources: sources,
|
|
141
|
+
accountId: accountId
|
|
142
|
+
});
|
|
203
143
|
};
|
|
204
144
|
|
|
205
145
|
function queryLength(state) {
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _templateObject;
|
|
4
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
5
2
|
import EmailIcon from '@atlaskit/icon/glyph/email';
|
|
6
3
|
import { N40, N500 } from '@atlaskit/theme/colors';
|
|
7
4
|
import { token } from '@atlaskit/tokens';
|
|
8
5
|
import React from 'react';
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import { css, jsx } from '@emotion/core';
|
|
7
|
+
|
|
8
|
+
var getEmailAvatarWrapperStyle = function getEmailAvatarWrapperStyle(isLozenge) {
|
|
9
|
+
var padding = isLozenge ? 0 : 4;
|
|
10
|
+
return css({
|
|
11
|
+
padding: "".concat(padding, "px"),
|
|
12
|
+
backgroundColor: token('color.background.neutral', N40),
|
|
13
|
+
borderRadius: '50%',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
alignItems: 'center'
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
|
|
13
19
|
export var AddOptionAvatar = function AddOptionAvatar(_ref) {
|
|
14
20
|
var isLozenge = _ref.isLozenge,
|
|
15
21
|
label = _ref.label;
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
},
|
|
22
|
+
return jsx("div", {
|
|
23
|
+
css: getEmailAvatarWrapperStyle(isLozenge)
|
|
24
|
+
}, jsx(EmailIcon, {
|
|
19
25
|
label: label,
|
|
20
26
|
size: isLozenge ? 'small' : 'medium',
|
|
21
27
|
primaryColor: token('color.text.subtle', N500)
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
|
|
7
|
+
/** @jsx jsx */
|
|
5
8
|
import React from 'react';
|
|
6
|
-
import
|
|
7
|
-
import { B400 } from '@atlaskit/theme/colors';
|
|
8
|
-
import { token } from '@atlaskit/tokens';
|
|
9
|
+
import { css, jsx } from '@emotion/core';
|
|
9
10
|
import Lozenge from '@atlaskit/lozenge';
|
|
10
11
|
var AsyncTooltip = /*#__PURE__*/React.lazy(function () {
|
|
11
12
|
return import(
|
|
@@ -16,22 +17,48 @@ var AsyncTooltip = /*#__PURE__*/React.lazy(function () {
|
|
|
16
17
|
};
|
|
17
18
|
});
|
|
18
19
|
});
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
var wrapper = css({
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
boxSizing: 'border-box',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
lineHeight: 1,
|
|
25
|
+
outline: 'none',
|
|
26
|
+
margin: 0,
|
|
27
|
+
width: '100%',
|
|
28
|
+
cursor: 'pointer'
|
|
23
29
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
30
|
+
|
|
31
|
+
var getTextStyle = function getTextStyle(isSecondary) {
|
|
32
|
+
var secondaryCssArgs = isSecondary ? {
|
|
33
|
+
fontSize: '0.85em'
|
|
34
|
+
} : {};
|
|
35
|
+
return css(_objectSpread({
|
|
36
|
+
margin: 0,
|
|
37
|
+
overflowX: 'hidden',
|
|
38
|
+
textOverflow: 'ellipsis',
|
|
39
|
+
whiteSpace: 'nowrap'
|
|
40
|
+
}, secondaryCssArgs));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var additionalInfo = css({
|
|
44
|
+
float: 'right'
|
|
28
45
|
});
|
|
29
|
-
export var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
export var textWrapper = function textWrapper(color) {
|
|
47
|
+
return css({
|
|
48
|
+
overflow: 'hidden',
|
|
49
|
+
textOverflow: 'ellipsis',
|
|
50
|
+
display: 'inline-block',
|
|
51
|
+
color: color
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
export var AvatarItemOption = function AvatarItemOption(_ref) {
|
|
55
|
+
var avatar = _ref.avatar,
|
|
56
|
+
primaryText = _ref.primaryText,
|
|
57
|
+
secondaryText = _ref.secondaryText,
|
|
58
|
+
lozenge = _ref.lozenge;
|
|
59
|
+
return jsx("span", {
|
|
60
|
+
css: wrapper
|
|
61
|
+
}, avatar, jsx("div", {
|
|
35
62
|
style: {
|
|
36
63
|
maxWidth: '100%',
|
|
37
64
|
minWidth: 0,
|
|
@@ -39,15 +66,17 @@ export var AvatarItemOption = function AvatarItemOption(_ref3) {
|
|
|
39
66
|
lineHeight: '1.4',
|
|
40
67
|
paddingLeft: '8px'
|
|
41
68
|
}
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
69
|
+
}, jsx("div", null, jsx("span", {
|
|
70
|
+
css: getTextStyle()
|
|
71
|
+
}, primaryText), jsx("span", {
|
|
72
|
+
css: additionalInfo
|
|
73
|
+
}, (lozenge === null || lozenge === void 0 ? void 0 : lozenge.text) && (lozenge !== null && lozenge !== void 0 && lozenge.tooltip ? // Note that entire Lozenge must be wrapped in the Tooltip (rather than just the
|
|
45
74
|
// Lozenge text) or tooltip won't work
|
|
46
|
-
|
|
47
|
-
fallback:
|
|
48
|
-
},
|
|
75
|
+
jsx(React.Suspense, {
|
|
76
|
+
fallback: jsx(Lozenge, lozenge, lozenge.text)
|
|
77
|
+
}, jsx(AsyncTooltip, {
|
|
49
78
|
content: lozenge.tooltip
|
|
50
|
-
},
|
|
51
|
-
|
|
79
|
+
}, jsx(Lozenge, lozenge, lozenge.text))) : jsx(Lozenge, lozenge, lozenge.text)))), jsx("div", null, jsx("span", {
|
|
80
|
+
css: getTextStyle(true)
|
|
52
81
|
}, secondaryText))));
|
|
53
82
|
};
|
|
@@ -10,12 +10,14 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
|
+
/** @jsx jsx */
|
|
13
14
|
import React from 'react';
|
|
14
15
|
import { FormattedMessage } from 'react-intl-next';
|
|
15
16
|
import { B400, N200, N800 } from '@atlaskit/theme/colors';
|
|
16
17
|
import { token } from '@atlaskit/tokens';
|
|
18
|
+
import { jsx } from '@emotion/core';
|
|
17
19
|
import { AddOptionAvatar } from '../AddOptionAvatar';
|
|
18
|
-
import { AvatarItemOption,
|
|
20
|
+
import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
|
|
19
21
|
import { messages } from '../i18n';
|
|
20
22
|
|
|
21
23
|
var getAddEmailMessage = function getAddEmailMessage(validity) {
|
|
@@ -46,21 +48,21 @@ export var EmailOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
46
48
|
|
|
47
49
|
_defineProperty(_assertThisInitialized(_this), "renderPrimaryText", function () {
|
|
48
50
|
var id = _this.props.email.id;
|
|
49
|
-
return
|
|
51
|
+
return jsx("span", {
|
|
50
52
|
key: "name",
|
|
51
|
-
|
|
53
|
+
css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
52
54
|
}, id);
|
|
53
55
|
});
|
|
54
56
|
|
|
55
57
|
_defineProperty(_assertThisInitialized(_this), "renderSecondaryText", function (label) {
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
+
return jsx("span", {
|
|
59
|
+
css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
58
60
|
}, label);
|
|
59
61
|
});
|
|
60
62
|
|
|
61
63
|
_defineProperty(_assertThisInitialized(_this), "renderOption", function (label) {
|
|
62
|
-
return
|
|
63
|
-
avatar:
|
|
64
|
+
return jsx(AvatarItemOption, {
|
|
65
|
+
avatar: jsx(AddOptionAvatar, {
|
|
64
66
|
label: label
|
|
65
67
|
}),
|
|
66
68
|
primaryText: _this.renderPrimaryText(),
|
|
@@ -80,7 +82,7 @@ export var EmailOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
80
82
|
var _this$props = this.props,
|
|
81
83
|
label = _this$props.label,
|
|
82
84
|
emailValidity = _this$props.emailValidity;
|
|
83
|
-
return label !== undefined ? this.renderOption(label) :
|
|
85
|
+
return label !== undefined ? this.renderOption(label) : jsx(FormattedMessage, getAddEmailMessage(emailValidity), function (label) {
|
|
84
86
|
return _this2.renderOption(label);
|
|
85
87
|
});
|
|
86
88
|
}
|
|
@@ -1,24 +1,71 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
|
|
7
|
+
/** @jsx jsx */
|
|
8
|
+
import { css, jsx } from '@emotion/core';
|
|
7
9
|
import { B400 } from '@atlaskit/theme/colors';
|
|
8
10
|
import { token } from '@atlaskit/tokens';
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var outerWrapper = css({
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
boxSizing: 'border-box',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
lineHeight: 1,
|
|
16
|
+
outline: 'none',
|
|
17
|
+
margin: 0,
|
|
18
|
+
width: '100%',
|
|
19
|
+
cursor: 'pointer'
|
|
20
|
+
});
|
|
21
|
+
var detailsWrapper = css({
|
|
22
|
+
display: 'flex',
|
|
23
|
+
maxWidth: '100%',
|
|
24
|
+
minWidth: 0,
|
|
25
|
+
flex: '1 1 100%',
|
|
26
|
+
lineHeight: 1.4,
|
|
27
|
+
paddingLeft: '8px',
|
|
28
|
+
alignItems: 'center'
|
|
29
|
+
});
|
|
30
|
+
var textSection = css({
|
|
31
|
+
width: 'calc(100% - 32px)',
|
|
32
|
+
flex: 'auto'
|
|
15
33
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
|
|
35
|
+
var getTextStyle = function getTextStyle(isSecondary) {
|
|
36
|
+
var secondaryCssArgs = isSecondary ? {
|
|
37
|
+
color: token('color.text.selected', B400),
|
|
38
|
+
fontSize: '0.85em'
|
|
39
|
+
} : {};
|
|
40
|
+
return css(_objectSpread(_objectSpread({
|
|
41
|
+
display: 'flex',
|
|
42
|
+
maxWidth: '100%',
|
|
43
|
+
margin: 0,
|
|
44
|
+
color: token('color.text.selected', B400)
|
|
45
|
+
}, {
|
|
46
|
+
secondaryCssArgs: secondaryCssArgs
|
|
47
|
+
}), {}, {
|
|
48
|
+
whiteSpace: 'nowrap',
|
|
49
|
+
'> span': {
|
|
50
|
+
maxWidth: 'inherit'
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export var ExternalAvatarItemOption = function ExternalAvatarItemOption(_ref) {
|
|
56
|
+
var avatar = _ref.avatar,
|
|
57
|
+
primaryText = _ref.primaryText,
|
|
58
|
+
secondaryText = _ref.secondaryText,
|
|
59
|
+
sourcesInfoTooltip = _ref.sourcesInfoTooltip;
|
|
60
|
+
return jsx("div", {
|
|
61
|
+
css: outerWrapper
|
|
62
|
+
}, avatar, jsx("div", {
|
|
63
|
+
css: detailsWrapper
|
|
64
|
+
}, jsx("div", {
|
|
65
|
+
css: textSection
|
|
66
|
+
}, jsx("div", null, jsx("div", {
|
|
67
|
+
css: getTextStyle()
|
|
68
|
+
}, primaryText)), secondaryText && jsx("div", null, jsx("div", {
|
|
69
|
+
css: getTextStyle(true)
|
|
70
|
+
}, secondaryText))), jsx("div", null, sourcesInfoTooltip)));
|
|
24
71
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import styled from 'styled-components';
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { useCallback, useState } from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/core';
|
|
8
6
|
import EditorPanelIcon from '@atlaskit/icon/glyph/editor/panel';
|
|
9
7
|
import { N50, N200 } from '@atlaskit/theme/colors';
|
|
10
8
|
import { token } from '@atlaskit/tokens';
|
|
11
|
-
var
|
|
9
|
+
var wrapper = css({
|
|
10
|
+
display: 'flex'
|
|
11
|
+
});
|
|
12
12
|
export default (function () {
|
|
13
13
|
var _useState = useState(false),
|
|
14
14
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -21,10 +21,11 @@ export default (function () {
|
|
|
21
21
|
var onMouseLeave = useCallback(function () {
|
|
22
22
|
return setHoverState(false);
|
|
23
23
|
}, [setHoverState]);
|
|
24
|
-
return
|
|
24
|
+
return jsx("div", {
|
|
25
|
+
css: wrapper,
|
|
25
26
|
onMouseEnter: onMouseEnter,
|
|
26
27
|
onMouseLeave: onMouseLeave
|
|
27
|
-
},
|
|
28
|
+
}, jsx(EditorPanelIcon, {
|
|
28
29
|
testId: "source-icon",
|
|
29
30
|
label: "",
|
|
30
31
|
size: "large",
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _templateObject, _templateObject2;
|
|
4
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
5
2
|
import React from 'react';
|
|
6
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
7
|
-
import
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
8
5
|
import { AtlassianIcon, ConfluenceIcon, JiraIcon } from '@atlaskit/logo';
|
|
9
6
|
import Spinner from '@atlaskit/spinner/spinner';
|
|
10
7
|
import { SlackIcon } from '../assets/slack';
|
|
@@ -12,42 +9,49 @@ import { GoogleIcon } from '../assets/google';
|
|
|
12
9
|
import { MicrosoftIcon } from '../assets/microsoft';
|
|
13
10
|
import { GitHubIcon } from '../assets/github';
|
|
14
11
|
import { messages } from '../i18n';
|
|
15
|
-
import {
|
|
16
|
-
export var
|
|
17
|
-
|
|
12
|
+
import { imageContainer } from './main';
|
|
13
|
+
export var sourcesTooltipContainer = css({
|
|
14
|
+
paddingBottom: '4px',
|
|
15
|
+
paddingRight: '4px'
|
|
16
|
+
});
|
|
17
|
+
export var sourceWrapper = css({
|
|
18
|
+
paddingTop: '4px',
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center'
|
|
21
|
+
});
|
|
18
22
|
var SUPPORTED_SOURCES = [{
|
|
19
23
|
sourceType: 'jira',
|
|
20
|
-
icon:
|
|
24
|
+
icon: jsx(JiraIcon, {
|
|
21
25
|
size: 'xsmall'
|
|
22
26
|
}),
|
|
23
27
|
label: messages.jiraSource
|
|
24
28
|
}, {
|
|
25
29
|
sourceType: 'confluence',
|
|
26
|
-
icon:
|
|
30
|
+
icon: jsx(ConfluenceIcon, {
|
|
27
31
|
size: 'xsmall'
|
|
28
32
|
}),
|
|
29
33
|
label: messages.confluenceSource
|
|
30
34
|
}, {
|
|
31
35
|
sourceType: 'other-atlassian',
|
|
32
|
-
icon:
|
|
36
|
+
icon: jsx(AtlassianIcon, {
|
|
33
37
|
size: 'xsmall'
|
|
34
38
|
}),
|
|
35
39
|
label: messages.otherAtlassianSource
|
|
36
40
|
}, {
|
|
37
41
|
sourceType: 'slack',
|
|
38
|
-
icon:
|
|
42
|
+
icon: jsx(SlackIcon, null),
|
|
39
43
|
label: messages.slackProvider
|
|
40
44
|
}, {
|
|
41
45
|
sourceType: 'google',
|
|
42
|
-
icon:
|
|
46
|
+
icon: jsx(GoogleIcon, null),
|
|
43
47
|
label: messages.googleProvider
|
|
44
48
|
}, {
|
|
45
49
|
sourceType: 'microsoft',
|
|
46
|
-
icon:
|
|
50
|
+
icon: jsx(MicrosoftIcon, null),
|
|
47
51
|
label: messages.microsoftProvider
|
|
48
52
|
}, {
|
|
49
53
|
sourceType: 'github',
|
|
50
|
-
icon:
|
|
54
|
+
icon: jsx(GitHubIcon, null),
|
|
51
55
|
label: messages.gitHubProvider
|
|
52
56
|
}];
|
|
53
57
|
export var SourcesTooltipContent = function SourcesTooltipContent(_ref) {
|
|
@@ -58,15 +62,20 @@ export var SourcesTooltipContent = function SourcesTooltipContent(_ref) {
|
|
|
58
62
|
return sources.includes(supportedSource.sourceType);
|
|
59
63
|
});
|
|
60
64
|
}, [sources]);
|
|
61
|
-
return
|
|
65
|
+
return jsx(React.Fragment, null, !sourcesLoading && sources.length === 0 ? jsx("span", null, jsx(FormattedMessage, messages.externalUserSourcesError)) : jsx(React.Fragment, null, jsx("span", null, jsx(FormattedMessage, messages.externalUserSourcesHeading)), jsx("div", {
|
|
66
|
+
css: sourcesTooltipContainer
|
|
67
|
+
}, sourcesLoading && jsx(Spinner, {
|
|
62
68
|
size: "small",
|
|
63
69
|
appearance: "invert"
|
|
64
70
|
}), !sourcesLoading && sourcesToRender.map(function (_ref2) {
|
|
65
71
|
var sourceType = _ref2.sourceType,
|
|
66
72
|
icon = _ref2.icon,
|
|
67
73
|
label = _ref2.label;
|
|
68
|
-
return
|
|
74
|
+
return jsx("div", {
|
|
75
|
+
css: sourceWrapper,
|
|
69
76
|
key: sourceType
|
|
70
|
-
},
|
|
77
|
+
}, jsx("span", {
|
|
78
|
+
css: imageContainer
|
|
79
|
+
}, icon), jsx("span", null, jsx(FormattedMessage, label)));
|
|
71
80
|
}))));
|
|
72
81
|
};
|