@atlaskit/user-picker 8.8.5 → 9.0.1
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 +1 -84
- 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 +28 -24
- 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/components/i18n.js +1 -1
- package/dist/cjs/index.js +0 -26
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics.js +0 -62
- 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 +28 -24
- 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/components/i18n.js +1 -1
- package/dist/es2019/index.js +0 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.js +0 -66
- 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 +27 -18
- 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/components/i18n.js +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics.d.ts +0 -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/main.d.ts +3 -2
- 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 +4 -3
- 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
package/dist/esm/analytics.js
CHANGED
|
@@ -136,72 +136,6 @@ export var failedEvent = function failedEvent(props, _, session, journeyId) {
|
|
|
136
136
|
return createEvent('operational', 'failed', 'userPicker', _objectSpread({}, createDefaultPickerAttributes(props, session, journeyId)));
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
var createDefaultSmartPickerAttributes = function createDefaultSmartPickerAttributes(props, state) {
|
|
140
|
-
var fieldId = props.fieldId,
|
|
141
|
-
objectId = props.objectId,
|
|
142
|
-
containerId = props.containerId,
|
|
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));
|
|
203
|
-
};
|
|
204
|
-
|
|
205
139
|
function queryLength(state) {
|
|
206
140
|
return state.inputValue.length;
|
|
207
141
|
}
|
|
@@ -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
|
};
|
|
@@ -6,27 +6,34 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
10
|
-
|
|
11
|
-
var _templateObject, _templateObject2;
|
|
12
9
|
|
|
13
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
11
|
|
|
15
12
|
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; } }
|
|
16
13
|
|
|
14
|
+
/** @jsx jsx */
|
|
17
15
|
import React from 'react';
|
|
18
|
-
import
|
|
16
|
+
import { css, jsx } from '@emotion/core';
|
|
19
17
|
import { B400, N200, N800 } from '@atlaskit/theme/colors';
|
|
20
18
|
import { token } from '@atlaskit/tokens';
|
|
21
19
|
import Tooltip from '@atlaskit/tooltip';
|
|
22
|
-
import {
|
|
20
|
+
import { textWrapper } from '../AvatarItemOption';
|
|
23
21
|
import { SizeableAvatar } from '../SizeableAvatar';
|
|
24
22
|
import { ExternalUserSourcesContainer } from '../ExternalUserSourcesContainer';
|
|
25
23
|
import InfoIcon from './InfoIcon';
|
|
26
24
|
import { ExternalAvatarItemOption } from './ExternalAvatarItemOption';
|
|
27
25
|
import { SourcesTooltipContent } from './SourcesTooltipContent';
|
|
28
|
-
export var
|
|
29
|
-
|
|
26
|
+
export var imageContainer = css({
|
|
27
|
+
height: '16px',
|
|
28
|
+
width: '16px',
|
|
29
|
+
paddingRight: '4px',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
justifyContent: 'center'
|
|
33
|
+
});
|
|
34
|
+
export var emailDomainWrapper = css({
|
|
35
|
+
fontWeight: 'bold'
|
|
36
|
+
});
|
|
30
37
|
export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
31
38
|
_inherits(ExternalUserOption, _React$PureComponent);
|
|
32
39
|
|
|
@@ -45,9 +52,9 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
45
52
|
|
|
46
53
|
_defineProperty(_assertThisInitialized(_this), "getPrimaryText", function () {
|
|
47
54
|
var name = _this.props.user.name;
|
|
48
|
-
return
|
|
55
|
+
return jsx("span", {
|
|
49
56
|
key: "name",
|
|
50
|
-
|
|
57
|
+
css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
51
58
|
}, name);
|
|
52
59
|
});
|
|
53
60
|
|
|
@@ -64,9 +71,11 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
64
71
|
emailDomain = _email$split2[1];
|
|
65
72
|
|
|
66
73
|
var emailDomainWithAt = "@".concat(emailDomain);
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
}, emailUser,
|
|
74
|
+
return jsx("span", {
|
|
75
|
+
css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
76
|
+
}, emailUser, jsx("span", {
|
|
77
|
+
css: emailDomainWrapper
|
|
78
|
+
}, emailDomainWithAt));
|
|
70
79
|
});
|
|
71
80
|
|
|
72
81
|
_defineProperty(_assertThisInitialized(_this), "renderAvatar", function () {
|
|
@@ -75,7 +84,7 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
75
84
|
avatarUrl = _this$props$user.avatarUrl,
|
|
76
85
|
name = _this$props$user.name,
|
|
77
86
|
status = _this$props.status;
|
|
78
|
-
return
|
|
87
|
+
return jsx(SizeableAvatar, {
|
|
79
88
|
appearance: "big",
|
|
80
89
|
src: avatarUrl,
|
|
81
90
|
presence: status,
|
|
@@ -84,10 +93,10 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
84
93
|
});
|
|
85
94
|
|
|
86
95
|
_defineProperty(_assertThisInitialized(_this), "getSourcesInfoTooltip", function () {
|
|
87
|
-
return _this.props.user.isExternal ?
|
|
96
|
+
return _this.props.user.isExternal ? jsx(Tooltip, {
|
|
88
97
|
content: _this.formattedTooltipContent(),
|
|
89
98
|
position: 'right-start'
|
|
90
|
-
},
|
|
99
|
+
}, jsx(InfoIcon, null)) : undefined;
|
|
91
100
|
});
|
|
92
101
|
|
|
93
102
|
return _this;
|
|
@@ -96,7 +105,7 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
96
105
|
_createClass(ExternalUserOption, [{
|
|
97
106
|
key: "render",
|
|
98
107
|
value: function render() {
|
|
99
|
-
return
|
|
108
|
+
return jsx(ExternalAvatarItemOption, {
|
|
100
109
|
avatar: this.renderAvatar(),
|
|
101
110
|
primaryText: this.getPrimaryText(),
|
|
102
111
|
secondaryText: this.renderSecondaryText(),
|
|
@@ -110,12 +119,12 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
110
119
|
id = _this$props$user2.id,
|
|
111
120
|
requiresSourceHydration = _this$props$user2.requiresSourceHydration,
|
|
112
121
|
sources = _this$props$user2.sources;
|
|
113
|
-
return
|
|
122
|
+
return jsx(ExternalUserSourcesContainer, {
|
|
114
123
|
accountId: id,
|
|
115
124
|
shouldFetchSources: Boolean(requiresSourceHydration),
|
|
116
125
|
initialSources: sources
|
|
117
126
|
}, function (sourceData) {
|
|
118
|
-
return
|
|
127
|
+
return jsx(SourcesTooltipContent, sourceData);
|
|
119
128
|
});
|
|
120
129
|
}
|
|
121
130
|
}]);
|