@atlaskit/user-picker 8.4.0 → 8.6.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 +25 -0
- package/dist/cjs/analytics.js +4 -2
- package/dist/cjs/clients/UserSourceProvider.js +27 -20
- package/dist/cjs/components/AddOptionAvatar.js +2 -2
- package/dist/cjs/components/AvatarItemOption.js +12 -18
- package/dist/cjs/components/EmailOption/main.js +2 -2
- package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +43 -0
- package/dist/cjs/components/ExternalUserOption/InfoIcon.js +57 -0
- package/dist/cjs/components/ExternalUserOption/main.js +11 -14
- package/dist/cjs/components/ExternalUserSourcesContainer.js +1 -2
- package/dist/cjs/components/GroupOption/main.js +3 -3
- package/dist/cjs/components/PopupControl.js +2 -2
- package/dist/cjs/components/TeamOption/main.js +2 -2
- package/dist/cjs/components/UserOption.js +3 -3
- package/dist/cjs/components/UserPicker.js +26 -2
- package/dist/cjs/components/assets/github.js +1 -1
- package/dist/cjs/components/assets/google.js +4 -4
- package/dist/cjs/components/assets/microsoft.js +5 -5
- package/dist/cjs/components/assets/slack.js +9 -9
- package/dist/cjs/components/smart-user-picker/components/index.js +6 -5
- package/dist/cjs/components/styles.js +6 -6
- package/dist/cjs/components/utils.js +13 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics.js +4 -2
- package/dist/es2019/clients/UserSourceProvider.js +20 -15
- package/dist/es2019/components/AddOptionAvatar.js +2 -2
- package/dist/es2019/components/AvatarItemOption.js +5 -11
- package/dist/es2019/components/EmailOption/main.js +2 -2
- package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +49 -0
- package/dist/es2019/components/ExternalUserOption/InfoIcon.js +22 -0
- package/dist/es2019/components/ExternalUserOption/main.js +9 -13
- package/dist/es2019/components/ExternalUserSourcesContainer.js +1 -1
- package/dist/es2019/components/GroupOption/main.js +3 -3
- package/dist/es2019/components/PopupControl.js +2 -2
- package/dist/es2019/components/TeamOption/main.js +2 -2
- package/dist/es2019/components/UserOption.js +3 -3
- package/dist/es2019/components/UserPicker.js +19 -0
- package/dist/es2019/components/assets/github.js +1 -1
- package/dist/es2019/components/assets/google.js +4 -4
- package/dist/es2019/components/assets/microsoft.js +5 -5
- package/dist/es2019/components/assets/slack.js +9 -9
- package/dist/es2019/components/smart-user-picker/components/index.js +5 -3
- package/dist/es2019/components/styles.js +6 -6
- package/dist/es2019/components/utils.js +10 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.js +4 -2
- package/dist/esm/clients/UserSourceProvider.js +27 -20
- package/dist/esm/components/AddOptionAvatar.js +2 -2
- package/dist/esm/components/AvatarItemOption.js +12 -18
- package/dist/esm/components/EmailOption/main.js +2 -2
- package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +24 -0
- package/dist/esm/components/ExternalUserOption/InfoIcon.js +33 -0
- package/dist/esm/components/ExternalUserOption/main.js +9 -13
- package/dist/esm/components/ExternalUserSourcesContainer.js +1 -2
- package/dist/esm/components/GroupOption/main.js +3 -3
- package/dist/esm/components/PopupControl.js +2 -2
- package/dist/esm/components/TeamOption/main.js +2 -2
- package/dist/esm/components/UserOption.js +3 -3
- package/dist/esm/components/UserPicker.js +22 -2
- package/dist/esm/components/assets/github.js +1 -1
- package/dist/esm/components/assets/google.js +4 -4
- package/dist/esm/components/assets/microsoft.js +5 -5
- package/dist/esm/components/assets/slack.js +9 -9
- package/dist/esm/components/smart-user-picker/components/index.js +6 -5
- package/dist/esm/components/styles.js +6 -6
- package/dist/esm/components/utils.js +10 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/AvatarItemOption.d.ts +1 -2
- package/dist/types/components/ExternalUserOption/ExternalAvatarItemOption.d.ts +8 -0
- package/dist/types/components/ExternalUserOption/InfoIcon.d.ts +3 -0
- package/dist/types/components/UserPicker.d.ts +3 -0
- package/dist/types/components/smart-user-picker/components/index.d.ts +4 -0
- package/dist/types/components/smart-user-picker/service/recommendationClient.d.ts +1 -0
- package/dist/types/components/utils.d.ts +2 -0
- package/package.json +8 -2
|
@@ -40,7 +40,7 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
40
40
|
highlight = _this$props$user.highlight;
|
|
41
41
|
var result = [/*#__PURE__*/React.createElement(TextWrapper, {
|
|
42
42
|
key: "name",
|
|
43
|
-
color: _this.props.isSelected ? token('color.text.
|
|
43
|
+
color: _this.props.isSelected ? token('color.text.brand', B400) : token('color.text', N800)
|
|
44
44
|
}, /*#__PURE__*/React.createElement(HighlightText, {
|
|
45
45
|
highlights: highlight && highlight.name
|
|
46
46
|
}, name))];
|
|
@@ -49,7 +49,7 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
49
49
|
result.push( /*#__PURE__*/React.createElement(React.Fragment, {
|
|
50
50
|
key: "publicName"
|
|
51
51
|
}, ' ', /*#__PURE__*/React.createElement(TextWrapper, {
|
|
52
|
-
color: _this.props.isSelected ? token('color.text.
|
|
52
|
+
color: _this.props.isSelected ? token('color.text.brand', B400) : token('color.text.subtlest', N200)
|
|
53
53
|
}, "(", /*#__PURE__*/React.createElement(HighlightText, {
|
|
54
54
|
highlights: highlight && highlight.publicName
|
|
55
55
|
}, publicName), ")")));
|
|
@@ -60,7 +60,7 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
60
60
|
|
|
61
61
|
_defineProperty(_assertThisInitialized(_this), "renderSecondaryText", function () {
|
|
62
62
|
return _this.props.user.byline ? /*#__PURE__*/React.createElement(TextWrapper, {
|
|
63
|
-
color: _this.props.isSelected ? token('color.text.
|
|
63
|
+
color: _this.props.isSelected ? token('color.text.brand', B400) : token('color.text.subtlest', N200)
|
|
64
64
|
}, _this.props.user.byline) : undefined;
|
|
65
65
|
});
|
|
66
66
|
|
|
@@ -24,18 +24,38 @@ import { getCreatableProps } from './creatable';
|
|
|
24
24
|
import { getCreatableSuggestedEmailProps } from './creatableEmailSuggestion';
|
|
25
25
|
import MessagesIntlProvider from './MessagesIntlProvider';
|
|
26
26
|
import { ExusUserSourceProvider } from './../clients/UserSourceProvider';
|
|
27
|
+
import { userPickerRenderedUfoExperience as experience } from './utils';
|
|
28
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
27
29
|
export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
28
30
|
_inherits(UserPickerWithoutAnalytics, _React$Component);
|
|
29
31
|
|
|
30
32
|
var _super = _createSuper(UserPickerWithoutAnalytics);
|
|
31
33
|
|
|
32
|
-
function UserPickerWithoutAnalytics() {
|
|
34
|
+
function UserPickerWithoutAnalytics(props) {
|
|
35
|
+
var _this;
|
|
36
|
+
|
|
33
37
|
_classCallCheck(this, UserPickerWithoutAnalytics);
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
_this = _super.call(this, props);
|
|
40
|
+
_this.ufoId = uuidv4();
|
|
41
|
+
|
|
42
|
+
if (_this.ufoId) {
|
|
43
|
+
var experienceForId = experience.getInstance(_this.ufoId);
|
|
44
|
+
experienceForId.start();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return _this;
|
|
36
48
|
}
|
|
37
49
|
|
|
38
50
|
_createClass(UserPickerWithoutAnalytics, [{
|
|
51
|
+
key: "componentDidMount",
|
|
52
|
+
value: function componentDidMount() {
|
|
53
|
+
if (this.ufoId) {
|
|
54
|
+
var experienceForId = experience.getInstance(this.ufoId);
|
|
55
|
+
experienceForId.success();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
39
59
|
key: "render",
|
|
40
60
|
value: function render() {
|
|
41
61
|
var _this$props = this.props,
|
|
@@ -12,6 +12,6 @@ export function GitHubIcon(props) {
|
|
|
12
12
|
fillRule: "evenodd",
|
|
13
13
|
clipRule: "evenodd",
|
|
14
14
|
d: "M11.9778 0C5.3635 0 0 5.45261 0 12.179C0 17.5601 3.432 22.1253 8.19114 23.7357C8.78975 23.8484 9.00952 23.4715 9.00952 23.1498C9.00952 22.8594 8.99841 21.9 8.99326 20.8823C5.66103 21.6191 4.95789 19.4454 4.95789 19.4454C4.41303 18.0376 3.62796 17.6633 3.62796 17.6633C2.54122 16.9074 3.70988 16.923 3.70988 16.923C4.91266 17.0089 5.54598 18.178 5.54598 18.178C6.61428 20.0399 8.34803 19.5016 9.03154 19.1904C9.13904 18.4033 9.44945 17.866 9.792 17.5619C7.13157 17.2539 4.33487 16.2096 4.33487 11.5429C4.33487 10.2133 4.80278 9.12682 5.56899 8.27391C5.44463 7.96716 5.03464 6.72844 5.68502 5.05087C5.68502 5.05087 6.69084 4.72354 8.97976 6.29927C9.9352 6.02942 10.9599 5.89409 11.9778 5.88945C12.9957 5.89409 14.0212 6.02942 14.9784 6.29927C17.2645 4.72354 18.269 5.05087 18.269 5.05087C18.9209 6.72844 18.5107 7.96716 18.3864 8.27391C19.1544 9.12682 19.6191 10.2133 19.6191 11.5429C19.6191 16.2207 16.8171 17.2507 14.1499 17.5522C14.5795 17.9301 14.9623 18.6713 14.9623 19.8076C14.9623 21.4371 14.9484 22.7487 14.9484 23.1498C14.9484 23.4739 15.164 23.8537 15.7712 23.7341C20.5277 22.1219 23.9554 17.5582 23.9554 12.179C23.9554 5.45261 18.5927 0 11.9778 0Z",
|
|
15
|
-
fill: token('color.text.
|
|
15
|
+
fill: token('color.text.inverse', 'white')
|
|
16
16
|
}));
|
|
17
17
|
}
|
|
@@ -12,21 +12,21 @@ export function GoogleIcon(props) {
|
|
|
12
12
|
fillRule: "evenodd",
|
|
13
13
|
clipRule: "evenodd",
|
|
14
14
|
d: "M8.32062 3.21332L10.014 1.55999C8.97396 0.593331 7.62063 0 6.00062 0C3.65396 0 1.62729 1.34666 0.640625 3.30665L2.58062 4.81331C3.06729 3.36665 4.41396 2.31999 6.00062 2.31999C7.12729 2.31999 7.88729 2.80665 8.32062 3.21332Z",
|
|
15
|
-
fill: token('color.text.
|
|
15
|
+
fill: token('color.text.inverse', 'white')
|
|
16
16
|
}), /*#__PURE__*/React.createElement("path", {
|
|
17
17
|
fillRule: "evenodd",
|
|
18
18
|
clipRule: "evenodd",
|
|
19
19
|
d: "M11.76 6.13291C11.76 5.63958 11.72 5.27958 11.6333 4.90625H6V7.13291H9.30667C9.24 7.68624 8.88 8.51957 8.08 9.07957L9.97333 10.5462C11.1067 9.49956 11.76 7.95957 11.76 6.13291V6.13291V6.13291Z",
|
|
20
|
-
fill: token('color.text.
|
|
20
|
+
fill: token('color.text.inverse', 'white')
|
|
21
21
|
}), /*#__PURE__*/React.createElement("path", {
|
|
22
22
|
fillRule: "evenodd",
|
|
23
23
|
clipRule: "evenodd",
|
|
24
24
|
d: "M2.58667 7.18662C2.46 6.81329 2.38667 6.41329 2.38667 5.99996C2.38667 5.58663 2.46 5.18663 2.58 4.8133L0.64 3.30664C0.233333 4.11997 0 5.0333 0 5.99996C0 6.96662 0.233333 7.87995 0.64 8.69328L2.58667 7.18662V7.18662Z",
|
|
25
|
-
fill: token('color.text.
|
|
25
|
+
fill: token('color.text.inverse', 'white')
|
|
26
26
|
}), /*#__PURE__*/React.createElement("path", {
|
|
27
27
|
fillRule: "evenodd",
|
|
28
28
|
clipRule: "evenodd",
|
|
29
29
|
d: "M6.00079 12.0008C7.62079 12.0008 8.98079 11.4675 9.97413 10.5475L8.08079 9.08083C7.57413 9.43416 6.89413 9.68082 6.00079 9.68082C4.41413 9.68082 3.06746 8.63416 2.58746 7.1875L0.647461 8.69416C1.63413 10.6542 3.65413 12.0008 6.00079 12.0008V12.0008V12.0008Z",
|
|
30
|
-
fill: token('color.text.
|
|
30
|
+
fill: token('color.text.inverse', 'white')
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
@@ -12,21 +12,21 @@ export function MicrosoftIcon(props) {
|
|
|
12
12
|
clipPath: "url(#clip0)"
|
|
13
13
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
14
|
d: "M0 0H5.70233V5.7023H0V0Z",
|
|
15
|
-
fill: token('color.text.
|
|
15
|
+
fill: token('color.text.inverse', 'white')
|
|
16
16
|
}), /*#__PURE__*/React.createElement("path", {
|
|
17
17
|
d: "M6.29785 0H12.0002V5.7023H6.29785V0Z",
|
|
18
|
-
fill: token('color.text.
|
|
18
|
+
fill: token('color.text.inverse', 'white')
|
|
19
19
|
}), /*#__PURE__*/React.createElement("path", {
|
|
20
20
|
d: "M0 6.29688H5.70233V11.9992H0V6.29688Z",
|
|
21
|
-
fill: token('color.text.
|
|
21
|
+
fill: token('color.text.inverse', 'white')
|
|
22
22
|
}), /*#__PURE__*/React.createElement("path", {
|
|
23
23
|
d: "M6.29785 6.29688H12.0002V11.9992H6.29785V6.29688Z",
|
|
24
|
-
fill: token('color.text.
|
|
24
|
+
fill: token('color.text.inverse', 'white')
|
|
25
25
|
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
26
26
|
id: "clip0"
|
|
27
27
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
28
28
|
width: "12",
|
|
29
29
|
height: "11.9999",
|
|
30
|
-
fill: token('color.text.
|
|
30
|
+
fill: token('color.text.inverse', 'white')
|
|
31
31
|
}))));
|
|
32
32
|
}
|
|
@@ -12,33 +12,33 @@ export function SlackIcon(props) {
|
|
|
12
12
|
clipPath: "url(#clip0)"
|
|
13
13
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
14
|
d: "M2.51653 7.5688C2.51653 8.26133 1.9508 8.82706 1.25826 8.82706C0.565731 8.82706 0 8.26133 0 7.5688C0 6.87627 0.565731 6.31055 1.25826 6.31055H2.51653V7.5688Z",
|
|
15
|
-
fill: token('color.text.
|
|
15
|
+
fill: token('color.text.inverse', 'white')
|
|
16
16
|
}), /*#__PURE__*/React.createElement("path", {
|
|
17
17
|
d: "M3.15039 7.5688C3.15039 6.87627 3.71612 6.31055 4.40865 6.31055C5.10119 6.31055 5.66692 6.87627 5.66692 7.5688V10.7193C5.66692 11.4119 5.10119 11.9776 4.40865 11.9776C3.71612 11.9776 3.15039 11.4119 3.15039 10.7193V7.5688Z",
|
|
18
|
-
fill: token('color.text.
|
|
18
|
+
fill: token('color.text.inverse', 'white')
|
|
19
19
|
}), /*#__PURE__*/React.createElement("path", {
|
|
20
20
|
d: "M4.40865 2.51651C3.71612 2.51651 3.15039 1.95079 3.15039 1.25826C3.15039 0.565728 3.71612 0 4.40865 0C5.10119 0 5.66692 0.565728 5.66692 1.25826V2.51651H4.40865Z",
|
|
21
|
-
fill: token('color.text.
|
|
21
|
+
fill: token('color.text.inverse', 'white')
|
|
22
22
|
}), /*#__PURE__*/React.createElement("path", {
|
|
23
23
|
d: "M4.4088 3.15039C5.10133 3.15039 5.66706 3.71612 5.66706 4.40865C5.66706 5.10118 5.10133 5.6669 4.4088 5.6669H1.25826C0.565731 5.6669 0 5.10118 0 4.40865C0 3.71612 0.565731 3.15039 1.25826 3.15039H4.4088Z",
|
|
24
|
-
fill: token('color.text.
|
|
24
|
+
fill: token('color.text.inverse', 'white')
|
|
25
25
|
}), /*#__PURE__*/React.createElement("path", {
|
|
26
26
|
d: "M9.46094 4.40865C9.46094 3.71612 10.0267 3.15039 10.7192 3.15039C11.4117 3.15039 11.9775 3.71612 11.9775 4.40865C11.9775 5.10118 11.4117 5.6669 10.7192 5.6669H9.46094V4.40865Z",
|
|
27
|
-
fill: token('color.text.
|
|
27
|
+
fill: token('color.text.inverse', 'white')
|
|
28
28
|
}), /*#__PURE__*/React.createElement("path", {
|
|
29
29
|
d: "M8.8261 4.40878C8.8261 5.10131 8.26036 5.66704 7.56783 5.66704C6.8753 5.66704 6.30957 5.10131 6.30957 4.40878V1.25826C6.30957 0.565728 6.8753 0 7.56783 0C8.26036 0 8.8261 0.565728 8.8261 1.25826V4.40878Z",
|
|
30
|
-
fill: token('color.text.
|
|
30
|
+
fill: token('color.text.inverse', 'white')
|
|
31
31
|
}), /*#__PURE__*/React.createElement("path", {
|
|
32
32
|
d: "M7.56881 9.46094C8.26134 9.46094 8.82707 10.0267 8.82707 10.7192C8.82707 11.4117 8.26134 11.9775 7.56881 11.9775C6.87628 11.9775 6.31055 11.4117 6.31055 10.7192V9.46094H7.56881Z",
|
|
33
|
-
fill: token('color.text.
|
|
33
|
+
fill: token('color.text.inverse', 'white')
|
|
34
34
|
}), /*#__PURE__*/React.createElement("path", {
|
|
35
35
|
d: "M7.56881 8.82706C6.87628 8.82706 6.31055 8.26133 6.31055 7.5688C6.31055 6.87627 6.87628 6.31055 7.56881 6.31055H10.7193C11.4119 6.31055 11.9776 6.87627 11.9776 7.5688C11.9776 8.26133 11.4119 8.82706 10.7193 8.82706H7.56881Z",
|
|
36
|
-
fill: token('color.text.
|
|
36
|
+
fill: token('color.text.inverse', 'white')
|
|
37
37
|
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
38
38
|
id: "clip0"
|
|
39
39
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
40
40
|
width: "12",
|
|
41
41
|
height: "11.9999",
|
|
42
|
-
fill: token('color.text.
|
|
42
|
+
fill: token('color.text.inverse', 'white')
|
|
43
43
|
}))));
|
|
44
44
|
}
|
|
@@ -19,7 +19,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
19
19
|
|
|
20
20
|
import React from 'react';
|
|
21
21
|
import debounce from 'lodash/debounce';
|
|
22
|
-
import
|
|
22
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
23
23
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
24
24
|
import memoizeOne from 'memoize-one';
|
|
25
25
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -31,7 +31,7 @@ import getUsersById from '../service/UsersClient';
|
|
|
31
31
|
import MessagesIntlProvider from '../../MessagesIntlProvider';
|
|
32
32
|
|
|
33
33
|
var hasContextChanged = function hasContextChanged(oldContext, newContext) {
|
|
34
|
-
return oldContext.siteId !== newContext.siteId || oldContext.productKey !== newContext.productKey || oldContext.principalId !== newContext.principalId || oldContext.containerId !== newContext.containerId || oldContext.objectId !== newContext.objectId || oldContext.childObjectId !== newContext.childObjectId;
|
|
34
|
+
return oldContext.siteId !== newContext.siteId || oldContext.orgId !== newContext.orgId || oldContext.productKey !== newContext.productKey || oldContext.principalId !== newContext.principalId || oldContext.containerId !== newContext.containerId || oldContext.objectId !== newContext.objectId || oldContext.childObjectId !== newContext.childObjectId;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
var stringContains = function stringContains(str, substr) {
|
|
@@ -217,14 +217,14 @@ var SmartUserPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
217
217
|
_defineProperty(_assertThisInitialized(_this), "memoizedFilterOptions", memoizeOne(_this.filterOptions));
|
|
218
218
|
|
|
219
219
|
_defineProperty(_assertThisInitialized(_this), "getUsers", debounce( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
220
|
-
var _this$state, query, sessionId, _this$props, containerId, childObjectId, objectId, principalId, productKey, siteId, baseUrl, includeUsers, includeGroups, includeTeams, maxOptions, searchQueryFilter, onEmpty, productAttributes, intl, maxNumberOfResults, startTime, recommendationsRequest, _yield$onEmpty, recommendedUsers, elapsedTimeMilli, displayedUsers, defaultUsers, _elapsedTimeMilli;
|
|
220
|
+
var _this$state, query, sessionId, _this$props, containerId, childObjectId, objectId, principalId, productKey, siteId, orgId, baseUrl, includeUsers, includeGroups, includeTeams, maxOptions, searchQueryFilter, onEmpty, productAttributes, intl, maxNumberOfResults, startTime, recommendationsRequest, _yield$onEmpty, recommendedUsers, elapsedTimeMilli, displayedUsers, defaultUsers, _elapsedTimeMilli;
|
|
221
221
|
|
|
222
222
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
223
223
|
while (1) {
|
|
224
224
|
switch (_context.prev = _context.next) {
|
|
225
225
|
case 0:
|
|
226
226
|
_this$state = _this.state, query = _this$state.query, sessionId = _this$state.sessionId;
|
|
227
|
-
_this$props = _this.props, containerId = _this$props.containerId, childObjectId = _this$props.childObjectId, objectId = _this$props.objectId, principalId = _this$props.principalId, productKey = _this$props.productKey, siteId = _this$props.siteId, baseUrl = _this$props.baseUrl, includeUsers = _this$props.includeUsers, includeGroups = _this$props.includeGroups, includeTeams = _this$props.includeTeams, maxOptions = _this$props.maxOptions, searchQueryFilter = _this$props.searchQueryFilter, onEmpty = _this$props.onEmpty, productAttributes = _this$props.productAttributes, intl = _this$props.intl;
|
|
227
|
+
_this$props = _this.props, containerId = _this$props.containerId, childObjectId = _this$props.childObjectId, objectId = _this$props.objectId, principalId = _this$props.principalId, productKey = _this$props.productKey, siteId = _this$props.siteId, orgId = _this$props.orgId, baseUrl = _this$props.baseUrl, includeUsers = _this$props.includeUsers, includeGroups = _this$props.includeGroups, includeTeams = _this$props.includeTeams, maxOptions = _this$props.maxOptions, searchQueryFilter = _this$props.searchQueryFilter, onEmpty = _this$props.onEmpty, productAttributes = _this$props.productAttributes, intl = _this$props.intl;
|
|
228
228
|
maxNumberOfResults = maxOptions || 100;
|
|
229
229
|
startTime = window.performance.now();
|
|
230
230
|
recommendationsRequest = {
|
|
@@ -236,6 +236,7 @@ var SmartUserPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
236
236
|
principalId: principalId,
|
|
237
237
|
productKey: productKey,
|
|
238
238
|
siteId: siteId,
|
|
239
|
+
orgId: orgId,
|
|
239
240
|
childObjectId: childObjectId,
|
|
240
241
|
sessionId: sessionId,
|
|
241
242
|
productAttributes: productAttributes
|
|
@@ -501,7 +502,7 @@ var SmartUserPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
501
502
|
prefetch = this.props.prefetch;
|
|
502
503
|
|
|
503
504
|
if (prefetch) {
|
|
504
|
-
sessionId =
|
|
505
|
+
sessionId = uuidv4();
|
|
505
506
|
this.fireEvent(mountedWithPrefetchEvent, {
|
|
506
507
|
sessionId: sessionId
|
|
507
508
|
});
|
|
@@ -32,14 +32,14 @@ export var getStyles = memoizeOne(function (width, isMulti, overrideStyles) {
|
|
|
32
32
|
var isMulti = state.selectProps.isMulti;
|
|
33
33
|
return _objectSpread(_objectSpread({}, css), {}, {
|
|
34
34
|
width: width,
|
|
35
|
-
borderColor: state.isFocused ? token('color.border
|
|
36
|
-
backgroundColor: state.isFocused ? token('
|
|
35
|
+
borderColor: state.isFocused ? token('color.border', css.borderColor) : state.selectProps.subtle || state.selectProps.noBorder ? 'transparent' : token('color.border', N40),
|
|
36
|
+
backgroundColor: state.isFocused ? token('elevation.surface', css['backgroundColor']) : state.selectProps.subtle ? 'transparent' : state.selectProps.textFieldBackgroundColor ? token('color.background.input', N10) : token('color.background.neutral', N20),
|
|
37
37
|
'&:hover .fabric-user-picker__clear-indicator': {
|
|
38
38
|
opacity: 1
|
|
39
39
|
},
|
|
40
40
|
':hover': _objectSpread(_objectSpread({}, css[':hover']), {}, {
|
|
41
|
-
borderColor: state.isFocused ? css[':hover'] ? token('color.border.
|
|
42
|
-
backgroundColor: state.selectProps.subtle && state.selectProps.hoveringClearIndicator ? token('color.background.
|
|
41
|
+
borderColor: state.isFocused ? css[':hover'] ? token('color.border.focused', css[':hover'].borderColor) : token('color.border.focused', B100) : state.selectProps.subtle ? state.selectProps.hoveringClearIndicator ? token('color.icon.danger', R50) : token('color.border', N30) : token('color.border', N40),
|
|
42
|
+
backgroundColor: state.selectProps.subtle && state.selectProps.hoveringClearIndicator ? token('color.background.danger', R50) : state.isFocused ? css[':hover'] ? token('elevation.surface', css[':hover'].backgroundColor) : token('elevation.surface', N0) : state.isDisabled ? token('color.background.disabled', N10) : token('elevation.surface', N30)
|
|
43
43
|
}),
|
|
44
44
|
padding: 0,
|
|
45
45
|
minHeight: isCompact ? 'none' : 44,
|
|
@@ -161,14 +161,14 @@ export var getStyles = memoizeOne(function (width, isMulti, overrideStyles) {
|
|
|
161
161
|
paddingLeft: isMulti ? 0 : AVATAR_PADDING,
|
|
162
162
|
'& input::placeholder': {
|
|
163
163
|
/* Chrome, Firefox, Opera, Safari 10.1+ */
|
|
164
|
-
color: token('color.text.
|
|
164
|
+
color: token('color.text.subtlest', N100),
|
|
165
165
|
opacity: 1
|
|
166
166
|
/* Firefox */
|
|
167
167
|
|
|
168
168
|
},
|
|
169
169
|
'& input:-ms-input-placeholder': {
|
|
170
170
|
/* Internet Explorer 10-11 */
|
|
171
|
-
color: token('color.text.
|
|
171
|
+
color: token('color.text.subtlest', N100)
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
174
|
}
|
|
@@ -8,6 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
import memoizeOne from 'memoize-one';
|
|
9
9
|
import { EmailType, TeamType, GroupType, UserType } from '../types';
|
|
10
10
|
import { PopupSelect } from '@atlaskit/select';
|
|
11
|
+
import { ExperiencePerformanceTypes, ExperienceTypes, ConcurrentExperience } from '@atlaskit/ufo';
|
|
11
12
|
export var isExternalUser = function isExternalUser(option) {
|
|
12
13
|
return isUser(option) && Boolean(option.isExternal);
|
|
13
14
|
};
|
|
@@ -115,4 +116,12 @@ export var isPopupUserPickerByComponent = function isPopupUserPickerByComponent(
|
|
|
115
116
|
};
|
|
116
117
|
export var isPopupUserPickerByProps = function isPopupUserPickerByProps(selectProps) {
|
|
117
118
|
return selectProps.searchThreshold === -1;
|
|
118
|
-
};
|
|
119
|
+
};
|
|
120
|
+
var COMPONENT_NAME = 'user-picker';
|
|
121
|
+
export var userPickerRenderedUfoExperience = new ConcurrentExperience('user-picker-rendered', {
|
|
122
|
+
platform: {
|
|
123
|
+
component: COMPONENT_NAME
|
|
124
|
+
},
|
|
125
|
+
type: ExperienceTypes.Load,
|
|
126
|
+
performanceType: ExperiencePerformanceTypes.PageSegmentLoad
|
|
127
|
+
});
|
package/dist/esm/version.json
CHANGED
|
@@ -6,6 +6,5 @@ export declare type AvatarItemOptionProps = {
|
|
|
6
6
|
primaryText?: ReactNode;
|
|
7
7
|
secondaryText?: ReactNode;
|
|
8
8
|
lozenge?: LozengeProps;
|
|
9
|
-
sourcesInfoTooltip?: ReactNode;
|
|
10
9
|
};
|
|
11
|
-
export declare const AvatarItemOption: ({ avatar, primaryText, secondaryText, lozenge,
|
|
10
|
+
export declare const AvatarItemOption: ({ avatar, primaryText, secondaryText, lozenge, }: AvatarItemOptionProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type ExternalAvatarItemOptionProps = {
|
|
3
|
+
avatar: ReactNode;
|
|
4
|
+
primaryText: ReactNode;
|
|
5
|
+
secondaryText?: ReactNode;
|
|
6
|
+
sourcesInfoTooltip?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const ExternalAvatarItemOption: ({ avatar, primaryText, secondaryText, sourcesInfoTooltip, }: ExternalAvatarItemOptionProps) => JSX.Element;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UserPickerProps } from '../types';
|
|
3
3
|
export declare class UserPickerWithoutAnalytics extends React.Component<UserPickerProps> {
|
|
4
|
+
ufoId: string;
|
|
5
|
+
constructor(props: UserPickerProps);
|
|
4
6
|
static defaultProps: {
|
|
5
7
|
width: number;
|
|
6
8
|
isMulti: boolean;
|
|
7
9
|
};
|
|
10
|
+
componentDidMount(): void;
|
|
8
11
|
render(): JSX.Element;
|
|
9
12
|
}
|
|
10
13
|
export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Pick<UserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions">, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions"> & Partial<Pick<Pick<UserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions">, "isMulti" | "width">> & Partial<Pick<{
|
|
@@ -90,6 +90,10 @@ export interface SmartProps {
|
|
|
90
90
|
* Identifier for the product's tenant, also known as tenantId or cloudId
|
|
91
91
|
*/
|
|
92
92
|
siteId: string;
|
|
93
|
+
/**
|
|
94
|
+
* Identifier for the organization in which to search for teams.
|
|
95
|
+
*/
|
|
96
|
+
orgId?: string;
|
|
93
97
|
}
|
|
94
98
|
/**
|
|
95
99
|
* @deprecated Please use @atlassian/smart-user-picker
|
|
@@ -13,6 +13,7 @@ export interface Context {
|
|
|
13
13
|
childObjectId?: string;
|
|
14
14
|
productKey: 'jira' | 'confluence' | 'people' | 'bitbucket' | 'compass';
|
|
15
15
|
siteId: string;
|
|
16
|
+
orgId?: string;
|
|
16
17
|
productAttributes?: ProductAttributes;
|
|
17
18
|
}
|
|
18
19
|
declare const getUserRecommendations: (request: RecommendationRequest, intl: IntlShape) => Promise<OptionData[]>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactChild, ReactElement } from 'react';
|
|
2
2
|
import { AtlaskitSelectValue, ExternalUser, Email, Option, OptionData, Promisable, Team, Group, User, OptionIdentifier, DefaultValue } from '../types';
|
|
3
|
+
import { ConcurrentExperience } from '@atlaskit/ufo';
|
|
3
4
|
export declare const isExternalUser: (option: OptionData) => option is ExternalUser;
|
|
4
5
|
export declare const isUser: (option: OptionData) => option is User;
|
|
5
6
|
export declare const isTeam: (option: OptionData) => option is Team;
|
|
@@ -24,3 +25,4 @@ export declare const callCallback: <U extends any[], R>(callback: ((...U: U) =>
|
|
|
24
25
|
export declare const getAvatarUrl: (optionData: OptionData) => string | undefined;
|
|
25
26
|
export declare const isPopupUserPickerByComponent: (SelectComponent: React.ComponentClass<any>) => boolean;
|
|
26
27
|
export declare const isPopupUserPickerByProps: (selectProps: any) => boolean;
|
|
28
|
+
export declare const userPickerRenderedUfoExperience: ConcurrentExperience;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/user-picker",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.1",
|
|
4
4
|
"description": "Fabric component for display a dropdown to select a user from",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@atlaskit/theme": "^12.1.0",
|
|
38
38
|
"@atlaskit/tokens": "^0.6.0",
|
|
39
39
|
"@atlaskit/tooltip": "^17.5.0",
|
|
40
|
+
"@atlaskit/ufo": "^0.1.0",
|
|
40
41
|
"@babel/runtime": "^7.0.0",
|
|
41
42
|
"lodash": "^4.17.21",
|
|
42
43
|
"memoize-one": "^6.0.0",
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
"@atlaskit/elements-test-helpers": "^0.7.0",
|
|
56
57
|
"@atlaskit/modal-dialog": "^12.2.0",
|
|
57
58
|
"@atlaskit/radio": "^5.3.4",
|
|
58
|
-
"@atlaskit/range": "^
|
|
59
|
+
"@atlaskit/range": "^6.0.0",
|
|
59
60
|
"@atlaskit/section-message": "^6.0.0",
|
|
60
61
|
"@atlaskit/textfield": "^5.0.0",
|
|
61
62
|
"@atlaskit/util-data-test": "^17.2.0",
|
|
@@ -73,6 +74,11 @@
|
|
|
73
74
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
74
75
|
"typescript": "3.9.6"
|
|
75
76
|
},
|
|
77
|
+
"techstack": {
|
|
78
|
+
"@repo/internal": {
|
|
79
|
+
"theming": "tokens"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
76
82
|
"keywords": [
|
|
77
83
|
"fabric",
|
|
78
84
|
"ui"
|