@atlaskit/user-picker 10.25.0 → 10.26.0
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 +12 -0
- package/afm-cc/tsconfig.json +6 -0
- package/afm-jira/tsconfig.json +6 -0
- package/afm-post-office/tsconfig.json +6 -0
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/MultiValue.js +17 -3
- package/dist/cjs/components/SingleValue.js +17 -2
- package/dist/cjs/components/TeamOption/main.js +11 -1
- package/dist/es2019/analytics.js +1 -1
- package/dist/es2019/components/MultiValue.js +23 -5
- package/dist/es2019/components/SingleValue.js +22 -3
- package/dist/es2019/components/TeamOption/main.js +11 -1
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/MultiValue.js +19 -5
- package/dist/esm/components/SingleValue.js +18 -3
- package/dist/esm/components/TeamOption/main.js +11 -1
- package/dist/types/components/BaseUserPicker.d.ts +156 -2
- package/dist/types/components/ExternalUserOption/index.d.ts +5 -1
- package/dist/types/components/ExternalUserOption/main.d.ts +5 -1
- package/dist/types/components/MultiValue.d.ts +1 -0
- package/dist/types/components/PopupUserPicker.d.ts +145 -1
- package/dist/types/components/UserPicker.d.ts +129 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types-ts4.5/components/BaseUserPicker.d.ts +156 -2
- package/dist/types-ts4.5/components/ExternalUserOption/index.d.ts +5 -1
- package/dist/types-ts4.5/components/ExternalUserOption/main.d.ts +5 -1
- package/dist/types-ts4.5/components/MultiValue.d.ts +1 -0
- package/dist/types-ts4.5/components/PopupUserPicker.d.ts +151 -1
- package/dist/types-ts4.5/components/UserPicker.d.ts +129 -1
- package/dist/types-ts4.5/types.d.ts +1 -0
- package/package.json +13 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/user-picker
|
|
2
2
|
|
|
3
|
+
## 10.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#153007](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/153007)
|
|
8
|
+
[`1c28c3db19101`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1c28c3db19101) -
|
|
9
|
+
Show verified icon for teams in user picker
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 10.25.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -33,6 +33,12 @@
|
|
|
33
33
|
{
|
|
34
34
|
"path": "../../../design-system/lozenge/afm-cc/tsconfig.json"
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
"path": "../../../people-and-teams/people-teams-ui-public/afm-cc/tsconfig.json"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
|
|
41
|
+
},
|
|
36
42
|
{
|
|
37
43
|
"path": "../../../design-system/popper/afm-cc/tsconfig.json"
|
|
38
44
|
},
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
{
|
|
33
33
|
"path": "../../../design-system/lozenge/afm-jira/tsconfig.json"
|
|
34
34
|
},
|
|
35
|
+
{
|
|
36
|
+
"path": "../../../people-and-teams/people-teams-ui-public/afm-jira/tsconfig.json"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
|
|
40
|
+
},
|
|
35
41
|
{
|
|
36
42
|
"path": "../../../design-system/popper/afm-jira/tsconfig.json"
|
|
37
43
|
},
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
{
|
|
33
33
|
"path": "../../../design-system/lozenge/afm-post-office/tsconfig.json"
|
|
34
34
|
},
|
|
35
|
+
{
|
|
36
|
+
"path": "../../../people-and-teams/people-teams-ui-public/afm-post-office/tsconfig.json"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
|
|
40
|
+
},
|
|
35
41
|
{
|
|
36
42
|
"path": "../../../design-system/popper/afm-post-office/tsconfig.json"
|
|
37
43
|
},
|
package/dist/cjs/analytics.js
CHANGED
|
@@ -12,7 +12,7 @@ var _utils = require("./components/utils");
|
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
var packageName = "@atlaskit/user-picker";
|
|
15
|
-
var packageVersion = "10.
|
|
15
|
+
var packageVersion = "10.26.0";
|
|
16
16
|
var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
17
17
|
var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
18
18
|
var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -24,6 +24,8 @@ var _SizeableAvatar = require("./SizeableAvatar");
|
|
|
24
24
|
var _i18n = require("./i18n");
|
|
25
25
|
var _utils = require("./utils");
|
|
26
26
|
var _peopleGroupPeople = _interopRequireDefault(require("@atlaskit/icon/core/migration/people-group--people"));
|
|
27
|
+
var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
|
|
28
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
27
29
|
var _excluded = ["children", "innerProps"];
|
|
28
30
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
29
31
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
@@ -85,9 +87,19 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
85
87
|
}
|
|
86
88
|
return (0, _react2.jsx)(_SizeableAvatar.SizeableAvatar, {
|
|
87
89
|
appearance: "multi",
|
|
88
|
-
src: (0, _utils.getAvatarUrl)(data)
|
|
90
|
+
src: (0, _utils.getAvatarUrl)(data),
|
|
91
|
+
type: (0, _utils.isTeam)(data) && (0, _platformFeatureFlags.fg)('verified-team-in-user-picker') ? 'team' : 'person'
|
|
89
92
|
});
|
|
90
93
|
});
|
|
94
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getElemAfter", function () {
|
|
95
|
+
var data = _this.props.data.data;
|
|
96
|
+
if ((0, _utils.isTeam)(data) && data.verified && (0, _platformFeatureFlags.fg)('verified-team-in-user-picker')) {
|
|
97
|
+
return (0, _react2.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
|
|
98
|
+
size: "small"
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
});
|
|
91
103
|
_this.containerRef = /*#__PURE__*/_react.default.createRef();
|
|
92
104
|
return _this;
|
|
93
105
|
}
|
|
@@ -130,9 +142,11 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
130
142
|
ref: this.containerRef
|
|
131
143
|
},
|
|
132
144
|
cropWithEllipsis: false
|
|
133
|
-
}),
|
|
145
|
+
}), (0, _react2.jsx)(_primitives.Inline, {
|
|
146
|
+
alignBlock: "center"
|
|
147
|
+
}, this.getElemBefore(), " ", (0, _react2.jsx)("div", {
|
|
134
148
|
css: nameWrapper
|
|
135
|
-
}, children));
|
|
149
|
+
}, children), this.getElemAfter()));
|
|
136
150
|
}
|
|
137
151
|
}]);
|
|
138
152
|
return MultiValue;
|
|
@@ -12,6 +12,9 @@ var _react = require("@emotion/react");
|
|
|
12
12
|
var _select = require("@atlaskit/select");
|
|
13
13
|
var _SizeableAvatar = require("./SizeableAvatar");
|
|
14
14
|
var _utils = require("./utils");
|
|
15
|
+
var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
+
var _primitives = require("@atlaskit/primitives");
|
|
15
18
|
var _excluded = ["ref"];
|
|
16
19
|
/**
|
|
17
20
|
* @jsxRuntime classic
|
|
@@ -36,6 +39,15 @@ var avatarItemComponent = (0, _react.css)({
|
|
|
36
39
|
border: 'none'
|
|
37
40
|
}
|
|
38
41
|
});
|
|
42
|
+
var ElementAfter = function ElementAfter(props) {
|
|
43
|
+
var data = props.data.data;
|
|
44
|
+
if ((0, _utils.isTeam)(data) && data.verified) {
|
|
45
|
+
return (0, _react.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
|
|
46
|
+
size: "small"
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
39
51
|
var SingleValue = exports.SingleValue = function SingleValue(props) {
|
|
40
52
|
var _props$data = props.data,
|
|
41
53
|
label = _props$data.label,
|
|
@@ -47,9 +59,12 @@ var SingleValue = exports.SingleValue = function SingleValue(props) {
|
|
|
47
59
|
backgroundColor: "transparent",
|
|
48
60
|
avatar: (0, _react.jsx)(_SizeableAvatar.SizeableAvatar, {
|
|
49
61
|
src: (0, _utils.getAvatarUrl)(data),
|
|
50
|
-
appearance: appearance
|
|
62
|
+
appearance: appearance,
|
|
63
|
+
type: (0, _utils.isTeam)(data) && (0, _platformFeatureFlags.fg)('verified-team-in-user-picker') ? 'team' : 'person'
|
|
51
64
|
}),
|
|
52
|
-
primaryText:
|
|
65
|
+
primaryText: (0, _platformFeatureFlags.fg)('verified-team-in-user-picker') ? (0, _react.jsx)(_primitives.Inline, {
|
|
66
|
+
alignBlock: "center"
|
|
67
|
+
}, label, (0, _react.jsx)(ElementAfter, props)) : label
|
|
53
68
|
}, function (_ref) {
|
|
54
69
|
var ref = _ref.ref,
|
|
55
70
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -14,6 +14,9 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
|
+
var _primitives = require("@atlaskit/primitives");
|
|
19
|
+
var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
|
|
17
20
|
var _react = require("@emotion/react");
|
|
18
21
|
var _react2 = _interopRequireDefault(require("react"));
|
|
19
22
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -39,14 +42,21 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
39
42
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getPrimaryText", function () {
|
|
40
43
|
var _this$props$team = _this.props.team,
|
|
41
44
|
name = _this$props$team.name,
|
|
42
|
-
highlight = _this$props$team.highlight
|
|
45
|
+
highlight = _this$props$team.highlight,
|
|
46
|
+
verified = _this$props$team.verified;
|
|
43
47
|
return [(0, _react.jsx)("span", {
|
|
44
48
|
key: "name"
|
|
45
49
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
46
50
|
,
|
|
47
51
|
css: (0, _AvatarItemOption.textWrapper)(_this.props.isSelected ? "var(--ds-text-selected, ".concat(_colors.B400, ")") : "var(--ds-text, ".concat(_colors.N800, ")"))
|
|
52
|
+
}, (0, _platformFeatureFlags.fg)('verified-team-in-user-picker') ? (0, _react.jsx)(_primitives.Inline, {
|
|
53
|
+
alignBlock: "center"
|
|
48
54
|
}, (0, _react.jsx)(_HighlightText.HighlightText, {
|
|
49
55
|
highlights: highlight && highlight.name
|
|
56
|
+
}, name), verified && (0, _react.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
|
|
57
|
+
size: "small"
|
|
58
|
+
})) : (0, _react.jsx)(_HighlightText.HighlightText, {
|
|
59
|
+
highlights: highlight && highlight.name
|
|
50
60
|
}, name))];
|
|
51
61
|
});
|
|
52
62
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderByline", function () {
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
3
|
import { isCustom, isExternalUser } from './components/utils';
|
|
4
4
|
const packageName = "@atlaskit/user-picker";
|
|
5
|
-
const packageVersion = "10.
|
|
5
|
+
const packageVersion = "10.26.0";
|
|
6
6
|
const UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
7
7
|
const UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
8
8
|
const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -6,15 +6,17 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { FormattedMessage } from 'react-intl-next';
|
|
9
|
-
import { Box, xcss } from '@atlaskit/primitives';
|
|
9
|
+
import { Box, Inline, xcss } from '@atlaskit/primitives';
|
|
10
10
|
import { components } from '@atlaskit/select';
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
12
|
import { css, jsx } from '@emotion/react';
|
|
13
13
|
import { AddOptionAvatar } from './AddOptionAvatar';
|
|
14
14
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
15
15
|
import { messages } from './i18n';
|
|
16
|
-
import { getAvatarUrl, isEmail, isGroup } from './utils';
|
|
16
|
+
import { getAvatarUrl, isEmail, isGroup, isTeam } from './utils';
|
|
17
17
|
import PeopleIcon from '@atlaskit/icon/core/migration/people-group--people';
|
|
18
|
+
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
19
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
20
|
export const scrollToValue = (valueContainer, control) => {
|
|
19
21
|
const {
|
|
20
22
|
top,
|
|
@@ -69,9 +71,23 @@ export class MultiValue extends React.Component {
|
|
|
69
71
|
}
|
|
70
72
|
return jsx(SizeableAvatar, {
|
|
71
73
|
appearance: "multi",
|
|
72
|
-
src: getAvatarUrl(data)
|
|
74
|
+
src: getAvatarUrl(data),
|
|
75
|
+
type: isTeam(data) && fg('verified-team-in-user-picker') ? 'team' : 'person'
|
|
73
76
|
});
|
|
74
77
|
});
|
|
78
|
+
_defineProperty(this, "getElemAfter", () => {
|
|
79
|
+
const {
|
|
80
|
+
data: {
|
|
81
|
+
data
|
|
82
|
+
}
|
|
83
|
+
} = this.props;
|
|
84
|
+
if (isTeam(data) && data.verified && fg('verified-team-in-user-picker')) {
|
|
85
|
+
return jsx(VerifiedTeamIcon, {
|
|
86
|
+
size: "small"
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
});
|
|
75
91
|
this.containerRef = /*#__PURE__*/React.createRef();
|
|
76
92
|
}
|
|
77
93
|
componentDidUpdate() {
|
|
@@ -115,8 +131,10 @@ export class MultiValue extends React.Component {
|
|
|
115
131
|
ref: this.containerRef
|
|
116
132
|
},
|
|
117
133
|
cropWithEllipsis: false
|
|
118
|
-
}),
|
|
134
|
+
}), jsx(Inline, {
|
|
135
|
+
alignBlock: "center"
|
|
136
|
+
}, this.getElemBefore(), " ", jsx("div", {
|
|
119
137
|
css: nameWrapper
|
|
120
|
-
}, children));
|
|
138
|
+
}, children), this.getElemAfter()));
|
|
121
139
|
}
|
|
122
140
|
}
|
|
@@ -8,7 +8,10 @@ import { AvatarItem } from '@atlaskit/avatar';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { components } from '@atlaskit/select';
|
|
10
10
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
11
|
-
import { getAvatarUrl } from './utils';
|
|
11
|
+
import { getAvatarUrl, isTeam } from './utils';
|
|
12
|
+
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
+
import { Inline } from '@atlaskit/primitives';
|
|
12
15
|
const avatarItemComponent = css({
|
|
13
16
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
14
17
|
border: 'none !important',
|
|
@@ -27,6 +30,19 @@ const avatarItemComponent = css({
|
|
|
27
30
|
border: 'none'
|
|
28
31
|
}
|
|
29
32
|
});
|
|
33
|
+
const ElementAfter = props => {
|
|
34
|
+
const {
|
|
35
|
+
data: {
|
|
36
|
+
data
|
|
37
|
+
}
|
|
38
|
+
} = props;
|
|
39
|
+
if (isTeam(data) && data.verified) {
|
|
40
|
+
return jsx(VerifiedTeamIcon, {
|
|
41
|
+
size: "small"
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
};
|
|
30
46
|
export const SingleValue = props => {
|
|
31
47
|
const {
|
|
32
48
|
data: {
|
|
@@ -43,9 +59,12 @@ export const SingleValue = props => {
|
|
|
43
59
|
backgroundColor: "transparent",
|
|
44
60
|
avatar: jsx(SizeableAvatar, {
|
|
45
61
|
src: getAvatarUrl(data),
|
|
46
|
-
appearance: appearance
|
|
62
|
+
appearance: appearance,
|
|
63
|
+
type: isTeam(data) && fg('verified-team-in-user-picker') ? 'team' : 'person'
|
|
47
64
|
}),
|
|
48
|
-
primaryText:
|
|
65
|
+
primaryText: fg('verified-team-in-user-picker') ? jsx(Inline, {
|
|
66
|
+
alignBlock: "center"
|
|
67
|
+
}, label, jsx(ElementAfter, props)) : label
|
|
49
68
|
}, ({
|
|
50
69
|
ref,
|
|
51
70
|
...props
|
|
@@ -5,6 +5,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
5
5
|
* @jsx jsx
|
|
6
6
|
*/
|
|
7
7
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { Inline } from '@atlaskit/primitives';
|
|
10
|
+
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
8
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
12
|
import { jsx } from '@emotion/react';
|
|
10
13
|
import React from 'react';
|
|
@@ -20,7 +23,8 @@ export class TeamOption extends React.PureComponent {
|
|
|
20
23
|
const {
|
|
21
24
|
team: {
|
|
22
25
|
name,
|
|
23
|
-
highlight
|
|
26
|
+
highlight,
|
|
27
|
+
verified
|
|
24
28
|
}
|
|
25
29
|
} = this.props;
|
|
26
30
|
return [jsx("span", {
|
|
@@ -28,8 +32,14 @@ export class TeamOption extends React.PureComponent {
|
|
|
28
32
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
29
33
|
,
|
|
30
34
|
css: textWrapper(this.props.isSelected ? `var(--ds-text-selected, ${B400})` : `var(--ds-text, ${N800})`)
|
|
35
|
+
}, fg('verified-team-in-user-picker') ? jsx(Inline, {
|
|
36
|
+
alignBlock: "center"
|
|
31
37
|
}, jsx(HighlightText, {
|
|
32
38
|
highlights: highlight && highlight.name
|
|
39
|
+
}, name), verified && jsx(VerifiedTeamIcon, {
|
|
40
|
+
size: "small"
|
|
41
|
+
})) : jsx(HighlightText, {
|
|
42
|
+
highlights: highlight && highlight.name
|
|
33
43
|
}, name))];
|
|
34
44
|
});
|
|
35
45
|
_defineProperty(this, "renderByline", () => {
|
package/dist/esm/analytics.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
|
5
5
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
6
|
import { isCustom, isExternalUser } from './components/utils';
|
|
7
7
|
var packageName = "@atlaskit/user-picker";
|
|
8
|
-
var packageVersion = "10.
|
|
8
|
+
var packageVersion = "10.26.0";
|
|
9
9
|
var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
10
10
|
var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
11
11
|
var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -16,15 +16,17 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
16
16
|
*/
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import { FormattedMessage } from 'react-intl-next';
|
|
19
|
-
import { Box, xcss } from '@atlaskit/primitives';
|
|
19
|
+
import { Box, Inline, xcss } from '@atlaskit/primitives';
|
|
20
20
|
import { components } from '@atlaskit/select';
|
|
21
21
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
22
|
import { css, jsx } from '@emotion/react';
|
|
23
23
|
import { AddOptionAvatar } from './AddOptionAvatar';
|
|
24
24
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
25
25
|
import { messages } from './i18n';
|
|
26
|
-
import { getAvatarUrl, isEmail, isGroup } from './utils';
|
|
26
|
+
import { getAvatarUrl, isEmail, isGroup, isTeam } from './utils';
|
|
27
27
|
import PeopleIcon from '@atlaskit/icon/core/migration/people-group--people';
|
|
28
|
+
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
29
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
28
30
|
export var scrollToValue = function scrollToValue(valueContainer, control) {
|
|
29
31
|
var _valueContainer$getBo = valueContainer.getBoundingClientRect(),
|
|
30
32
|
top = _valueContainer$getBo.top,
|
|
@@ -80,9 +82,19 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
80
82
|
}
|
|
81
83
|
return jsx(SizeableAvatar, {
|
|
82
84
|
appearance: "multi",
|
|
83
|
-
src: getAvatarUrl(data)
|
|
85
|
+
src: getAvatarUrl(data),
|
|
86
|
+
type: isTeam(data) && fg('verified-team-in-user-picker') ? 'team' : 'person'
|
|
84
87
|
});
|
|
85
88
|
});
|
|
89
|
+
_defineProperty(_assertThisInitialized(_this), "getElemAfter", function () {
|
|
90
|
+
var data = _this.props.data.data;
|
|
91
|
+
if (isTeam(data) && data.verified && fg('verified-team-in-user-picker')) {
|
|
92
|
+
return jsx(VerifiedTeamIcon, {
|
|
93
|
+
size: "small"
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
});
|
|
86
98
|
_this.containerRef = /*#__PURE__*/React.createRef();
|
|
87
99
|
return _this;
|
|
88
100
|
}
|
|
@@ -125,9 +137,11 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
125
137
|
ref: this.containerRef
|
|
126
138
|
},
|
|
127
139
|
cropWithEllipsis: false
|
|
128
|
-
}),
|
|
140
|
+
}), jsx(Inline, {
|
|
141
|
+
alignBlock: "center"
|
|
142
|
+
}, this.getElemBefore(), " ", jsx("div", {
|
|
129
143
|
css: nameWrapper
|
|
130
|
-
}, children));
|
|
144
|
+
}, children), this.getElemAfter()));
|
|
131
145
|
}
|
|
132
146
|
}]);
|
|
133
147
|
return MultiValue;
|
|
@@ -10,7 +10,10 @@ import { AvatarItem } from '@atlaskit/avatar';
|
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { components } from '@atlaskit/select';
|
|
12
12
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
13
|
-
import { getAvatarUrl } from './utils';
|
|
13
|
+
import { getAvatarUrl, isTeam } from './utils';
|
|
14
|
+
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
|
+
import { Inline } from '@atlaskit/primitives';
|
|
14
17
|
var avatarItemComponent = css({
|
|
15
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
16
19
|
border: 'none !important',
|
|
@@ -29,6 +32,15 @@ var avatarItemComponent = css({
|
|
|
29
32
|
border: 'none'
|
|
30
33
|
}
|
|
31
34
|
});
|
|
35
|
+
var ElementAfter = function ElementAfter(props) {
|
|
36
|
+
var data = props.data.data;
|
|
37
|
+
if (isTeam(data) && data.verified) {
|
|
38
|
+
return jsx(VerifiedTeamIcon, {
|
|
39
|
+
size: "small"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
};
|
|
32
44
|
export var SingleValue = function SingleValue(props) {
|
|
33
45
|
var _props$data = props.data,
|
|
34
46
|
label = _props$data.label,
|
|
@@ -40,9 +52,12 @@ export var SingleValue = function SingleValue(props) {
|
|
|
40
52
|
backgroundColor: "transparent",
|
|
41
53
|
avatar: jsx(SizeableAvatar, {
|
|
42
54
|
src: getAvatarUrl(data),
|
|
43
|
-
appearance: appearance
|
|
55
|
+
appearance: appearance,
|
|
56
|
+
type: isTeam(data) && fg('verified-team-in-user-picker') ? 'team' : 'person'
|
|
44
57
|
}),
|
|
45
|
-
primaryText:
|
|
58
|
+
primaryText: fg('verified-team-in-user-picker') ? jsx(Inline, {
|
|
59
|
+
alignBlock: "center"
|
|
60
|
+
}, label, jsx(ElementAfter, props)) : label
|
|
46
61
|
}, function (_ref) {
|
|
47
62
|
var ref = _ref.ref,
|
|
48
63
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -13,6 +13,9 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
13
13
|
* @jsx jsx
|
|
14
14
|
*/
|
|
15
15
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
+
import { Inline } from '@atlaskit/primitives';
|
|
18
|
+
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
16
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
17
20
|
import { jsx } from '@emotion/react';
|
|
18
21
|
import React from 'react';
|
|
@@ -34,14 +37,21 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
34
37
|
_defineProperty(_assertThisInitialized(_this), "getPrimaryText", function () {
|
|
35
38
|
var _this$props$team = _this.props.team,
|
|
36
39
|
name = _this$props$team.name,
|
|
37
|
-
highlight = _this$props$team.highlight
|
|
40
|
+
highlight = _this$props$team.highlight,
|
|
41
|
+
verified = _this$props$team.verified;
|
|
38
42
|
return [jsx("span", {
|
|
39
43
|
key: "name"
|
|
40
44
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
41
45
|
,
|
|
42
46
|
css: textWrapper(_this.props.isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : "var(--ds-text, ".concat(N800, ")"))
|
|
47
|
+
}, fg('verified-team-in-user-picker') ? jsx(Inline, {
|
|
48
|
+
alignBlock: "center"
|
|
43
49
|
}, jsx(HighlightText, {
|
|
44
50
|
highlights: highlight && highlight.name
|
|
51
|
+
}, name), verified && jsx(VerifiedTeamIcon, {
|
|
52
|
+
size: "small"
|
|
53
|
+
})) : jsx(HighlightText, {
|
|
54
|
+
highlights: highlight && highlight.name
|
|
45
55
|
}, name))];
|
|
46
56
|
});
|
|
47
57
|
_defineProperty(_assertThisInitialized(_this), "renderByline", function () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { UserPickerProps, UserPickerState } from '../types';
|
|
2
|
+
import type { Appearance, OptionData, UserPickerProps, UserPickerState } from '../types';
|
|
3
3
|
export type BaseUserPickerProps = UserPickerProps & {
|
|
4
4
|
SelectComponent: React.ComponentType<any>;
|
|
5
5
|
pickerProps?: any;
|
|
@@ -64,7 +64,161 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
|
|
|
64
64
|
private handleClickDraggableParentComponent;
|
|
65
65
|
render(): JSX.Element;
|
|
66
66
|
}
|
|
67
|
-
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<
|
|
67
|
+
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
68
|
+
fieldId: string | null;
|
|
69
|
+
options?: OptionData[] | undefined;
|
|
70
|
+
width?: string | number | undefined;
|
|
71
|
+
menuMinWidth?: number | undefined;
|
|
72
|
+
maxPickerHeight?: number | undefined;
|
|
73
|
+
textFieldBackgroundColor?: boolean | undefined;
|
|
74
|
+
loadOptions?: import("../types").LoadOptions | undefined;
|
|
75
|
+
loadOptionsErrorMessage?: ((value: {
|
|
76
|
+
inputValue: string;
|
|
77
|
+
}) => React.ReactNode) | undefined;
|
|
78
|
+
loadUserSource?: import("../types").LoadUserSource | undefined;
|
|
79
|
+
onChange?: import("../types").OnChange | undefined;
|
|
80
|
+
isMulti?: boolean | undefined;
|
|
81
|
+
search?: string | undefined;
|
|
82
|
+
anchor?: React.ComponentType<any> | undefined;
|
|
83
|
+
open?: boolean | undefined;
|
|
84
|
+
isLoading?: boolean | undefined;
|
|
85
|
+
onInputChange?: import("../types").OnInputChange | undefined;
|
|
86
|
+
onSelection?: import("../types").OnOption | undefined;
|
|
87
|
+
onFocus?: import("../types").OnPicker | undefined;
|
|
88
|
+
onBlur?: import("../types").OnPicker | undefined;
|
|
89
|
+
onClear?: import("../types").OnPicker | undefined;
|
|
90
|
+
onOpen?: import("../types").OnPicker | undefined;
|
|
91
|
+
onClose?: import("../types").OnPicker | undefined;
|
|
92
|
+
onKeyDown?: ((event: React.KeyboardEvent<Element>) => void) | undefined;
|
|
93
|
+
appearance?: Appearance | undefined;
|
|
94
|
+
subtle?: boolean | undefined;
|
|
95
|
+
noBorder?: boolean | undefined;
|
|
96
|
+
styles?: import("@atlaskit/select").StylesConfig | undefined;
|
|
97
|
+
defaultValue?: import("../types").DefaultValue;
|
|
98
|
+
placeholder?: React.ReactNode;
|
|
99
|
+
placeholderAvatar?: "team" | "person" | undefined;
|
|
100
|
+
addMoreMessage?: string | undefined;
|
|
101
|
+
noOptionsMessage?: React.ReactNode | ((value: {
|
|
102
|
+
inputValue: string;
|
|
103
|
+
}) => React.ReactNode);
|
|
104
|
+
footer?: React.ReactNode;
|
|
105
|
+
value?: import("../types").Value;
|
|
106
|
+
isDisabled?: boolean | undefined;
|
|
107
|
+
isInvalid?: boolean | undefined;
|
|
108
|
+
isClearable?: boolean | undefined;
|
|
109
|
+
clearValueLabel?: string | undefined;
|
|
110
|
+
menuPosition?: "absolute" | "fixed" | undefined;
|
|
111
|
+
captureMenuScroll?: boolean | undefined;
|
|
112
|
+
menuPortalTarget?: HTMLElement | undefined;
|
|
113
|
+
allowEmail?: boolean | undefined;
|
|
114
|
+
suggestEmailsForDomain?: string | undefined;
|
|
115
|
+
emailLabel?: string | undefined;
|
|
116
|
+
disableInput?: boolean | undefined;
|
|
117
|
+
isValidEmail?: import("./emailValidation").EmailValidator | undefined;
|
|
118
|
+
autoFocus?: boolean | undefined;
|
|
119
|
+
maxOptions?: number | undefined;
|
|
120
|
+
inputId?: string | undefined;
|
|
121
|
+
closeMenuOnScroll?: boolean | EventListener | undefined;
|
|
122
|
+
menuShouldBlockScroll?: boolean | undefined;
|
|
123
|
+
ariaLabel?: string | undefined;
|
|
124
|
+
ariaLabelledBy?: string | undefined;
|
|
125
|
+
ariaLive?: "polite" | "off" | "assertive" | undefined;
|
|
126
|
+
name?: string | undefined;
|
|
127
|
+
header?: React.ReactNode;
|
|
128
|
+
required?: boolean | undefined;
|
|
129
|
+
UNSAFE_hasDraggableParentComponent?: boolean | undefined;
|
|
130
|
+
openMenuOnClick?: boolean | undefined;
|
|
131
|
+
} & {
|
|
132
|
+
SelectComponent: React.ComponentType<any>;
|
|
133
|
+
pickerProps?: any;
|
|
134
|
+
styles: any;
|
|
135
|
+
components: any;
|
|
136
|
+
width: string | number;
|
|
137
|
+
name?: string | undefined;
|
|
138
|
+
/**
|
|
139
|
+
* @deprecated This is a temporary prop to enable user-pickers to work in Draggable elements in react-beautiful-dnd.
|
|
140
|
+
* See https://product-fabric.atlassian.net/browse/DSP-15701 for more details.
|
|
141
|
+
* It may be removed in a future minor or patch when a longer-term workaround is found.
|
|
142
|
+
*/
|
|
143
|
+
UNSAFE_hasDraggableParentComponent?: boolean | undefined;
|
|
144
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "required" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "onClose" | "appearance" | "placeholderAvatar" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "header" | "UNSAFE_hasDraggableParentComponent" | "SelectComponent" | "pickerProps"> & Partial<Pick<Omit<{
|
|
145
|
+
fieldId: string | null;
|
|
146
|
+
options?: OptionData[] | undefined;
|
|
147
|
+
width?: string | number | undefined;
|
|
148
|
+
menuMinWidth?: number | undefined;
|
|
149
|
+
maxPickerHeight?: number | undefined;
|
|
150
|
+
textFieldBackgroundColor?: boolean | undefined;
|
|
151
|
+
loadOptions?: import("../types").LoadOptions | undefined;
|
|
152
|
+
loadOptionsErrorMessage?: ((value: {
|
|
153
|
+
inputValue: string;
|
|
154
|
+
}) => React.ReactNode) | undefined;
|
|
155
|
+
loadUserSource?: import("../types").LoadUserSource | undefined;
|
|
156
|
+
onChange?: import("../types").OnChange | undefined;
|
|
157
|
+
isMulti?: boolean | undefined;
|
|
158
|
+
search?: string | undefined;
|
|
159
|
+
anchor?: React.ComponentType<any> | undefined;
|
|
160
|
+
open?: boolean | undefined;
|
|
161
|
+
isLoading?: boolean | undefined;
|
|
162
|
+
onInputChange?: import("../types").OnInputChange | undefined;
|
|
163
|
+
onSelection?: import("../types").OnOption | undefined;
|
|
164
|
+
onFocus?: import("../types").OnPicker | undefined;
|
|
165
|
+
onBlur?: import("../types").OnPicker | undefined;
|
|
166
|
+
onClear?: import("../types").OnPicker | undefined;
|
|
167
|
+
onOpen?: import("../types").OnPicker | undefined;
|
|
168
|
+
onClose?: import("../types").OnPicker | undefined;
|
|
169
|
+
onKeyDown?: ((event: React.KeyboardEvent<Element>) => void) | undefined;
|
|
170
|
+
appearance?: Appearance | undefined;
|
|
171
|
+
subtle?: boolean | undefined;
|
|
172
|
+
noBorder?: boolean | undefined;
|
|
173
|
+
styles?: import("@atlaskit/select").StylesConfig | undefined;
|
|
174
|
+
defaultValue?: import("../types").DefaultValue;
|
|
175
|
+
placeholder?: React.ReactNode;
|
|
176
|
+
placeholderAvatar?: "team" | "person" | undefined;
|
|
177
|
+
addMoreMessage?: string | undefined;
|
|
178
|
+
noOptionsMessage?: React.ReactNode | ((value: {
|
|
179
|
+
inputValue: string;
|
|
180
|
+
}) => React.ReactNode);
|
|
181
|
+
footer?: React.ReactNode;
|
|
182
|
+
value?: import("../types").Value;
|
|
183
|
+
isDisabled?: boolean | undefined;
|
|
184
|
+
isInvalid?: boolean | undefined;
|
|
185
|
+
isClearable?: boolean | undefined;
|
|
186
|
+
clearValueLabel?: string | undefined;
|
|
187
|
+
menuPosition?: "absolute" | "fixed" | undefined;
|
|
188
|
+
captureMenuScroll?: boolean | undefined;
|
|
189
|
+
menuPortalTarget?: HTMLElement | undefined;
|
|
190
|
+
allowEmail?: boolean | undefined;
|
|
191
|
+
suggestEmailsForDomain?: string | undefined;
|
|
192
|
+
emailLabel?: string | undefined;
|
|
193
|
+
disableInput?: boolean | undefined;
|
|
194
|
+
isValidEmail?: import("./emailValidation").EmailValidator | undefined;
|
|
195
|
+
autoFocus?: boolean | undefined;
|
|
196
|
+
maxOptions?: number | undefined;
|
|
197
|
+
inputId?: string | undefined;
|
|
198
|
+
closeMenuOnScroll?: boolean | EventListener | undefined;
|
|
199
|
+
menuShouldBlockScroll?: boolean | undefined;
|
|
200
|
+
ariaLabel?: string | undefined;
|
|
201
|
+
ariaLabelledBy?: string | undefined;
|
|
202
|
+
ariaLive?: "polite" | "off" | "assertive" | undefined;
|
|
203
|
+
name?: string | undefined;
|
|
204
|
+
header?: React.ReactNode;
|
|
205
|
+
required?: boolean | undefined;
|
|
206
|
+
UNSAFE_hasDraggableParentComponent?: boolean | undefined;
|
|
207
|
+
openMenuOnClick?: boolean | undefined;
|
|
208
|
+
} & {
|
|
209
|
+
SelectComponent: React.ComponentType<any>;
|
|
210
|
+
pickerProps?: any;
|
|
211
|
+
styles: any;
|
|
212
|
+
components: any;
|
|
213
|
+
width: string | number;
|
|
214
|
+
name?: string | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* @deprecated This is a temporary prop to enable user-pickers to work in Draggable elements in react-beautiful-dnd.
|
|
217
|
+
* See https://product-fabric.atlassian.net/browse/DSP-15701 for more details.
|
|
218
|
+
* It may be removed in a future minor or patch when a longer-term workaround is found.
|
|
219
|
+
*/
|
|
220
|
+
UNSAFE_hasDraggableParentComponent?: boolean | undefined;
|
|
221
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isClearable" | "isMulti" | "openMenuOnClick" | "textFieldBackgroundColor" | "loadOptionsErrorMessage" | "subtle" | "noBorder">> & Partial<Pick<{
|
|
68
222
|
isMulti: boolean;
|
|
69
223
|
subtle: boolean;
|
|
70
224
|
noBorder: boolean;
|