@atlaskit/mention 24.0.2 → 24.1.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 +14 -0
- package/afm-cc/tsconfig.json +3 -0
- package/dist/cjs/components/MentionAvatar/index.js +33 -0
- package/dist/cjs/components/MentionItem/index.js +6 -1
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/components/MentionAvatar/index.js +30 -0
- package/dist/es2019/components/MentionItem/index.js +6 -1
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/components/MentionAvatar/index.js +26 -0
- package/dist/esm/components/MentionItem/index.js +6 -1
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/components/MentionAvatar/index.d.ts +8 -0
- package/dist/types-ts4.5/components/MentionAvatar/index.d.ts +8 -0
- package/package.json +8 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/mention
|
|
2
2
|
|
|
3
|
+
## 24.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#121564](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/121564)
|
|
8
|
+
[`3de01b4441aaf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3de01b4441aaf) -
|
|
9
|
+
Team refreshed avatar support
|
|
10
|
+
|
|
11
|
+
## 24.0.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 24.0.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.MentionAvatar = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
|
|
10
|
+
var _teamsAvatar = _interopRequireDefault(require("@atlaskit/teams-avatar"));
|
|
11
|
+
var _types = require("../../types");
|
|
12
|
+
var MentionAvatar = exports.MentionAvatar = function MentionAvatar(_ref) {
|
|
13
|
+
var mention = _ref.mention,
|
|
14
|
+
selected = _ref.selected;
|
|
15
|
+
var avatarUrl = mention.avatarUrl,
|
|
16
|
+
presence = mention.presence;
|
|
17
|
+
var borderColor = selected ? "var(--ds-border, #091E4224)" : undefined;
|
|
18
|
+
var _ref2 = presence || {},
|
|
19
|
+
status = _ref2.status;
|
|
20
|
+
if ((0, _types.isTeamMention)(mention)) {
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_teamsAvatar.default, {
|
|
22
|
+
src: avatarUrl,
|
|
23
|
+
size: "medium",
|
|
24
|
+
borderColor: borderColor
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_avatar.default, {
|
|
28
|
+
src: avatarUrl,
|
|
29
|
+
size: "medium",
|
|
30
|
+
presence: status,
|
|
31
|
+
borderColor: borderColor
|
|
32
|
+
});
|
|
33
|
+
};
|
|
@@ -20,6 +20,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
20
20
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
21
21
|
var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
|
|
22
22
|
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
23
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
24
|
var _colors = require("@atlaskit/theme/colors");
|
|
24
25
|
var _react = _interopRequireDefault(require("react"));
|
|
25
26
|
var _informationEditorPanel = _interopRequireDefault(require("@atlaskit/icon/core/migration/information--editor-panel"));
|
|
@@ -32,6 +33,7 @@ var _styles = require("./styles");
|
|
|
32
33
|
var _MentionHighlightHelpers = require("./MentionHighlightHelpers");
|
|
33
34
|
var _MentionDescriptionByline = _interopRequireDefault(require("../MentionDescriptionByline"));
|
|
34
35
|
var _MessagesIntlProvider = _interopRequireDefault(require("../MessagesIntlProvider"));
|
|
36
|
+
var _MentionAvatar = require("../MentionAvatar");
|
|
35
37
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
36
38
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
37
39
|
function renderLozenge(lozenge) {
|
|
@@ -115,7 +117,10 @@ var MentionItem = exports.default = /*#__PURE__*/function (_React$PureComponent)
|
|
|
115
117
|
"data-selected": selected
|
|
116
118
|
}, /*#__PURE__*/_react.default.createElement(_styles.RowStyle, null, /*#__PURE__*/_react.default.createElement(_styles.AvatarStyle, {
|
|
117
119
|
restricted: restricted
|
|
118
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
120
|
+
}, (0, _platformFeatureFlags.fg)('team-avatar-in-mention-picker') ? /*#__PURE__*/_react.default.createElement(_MentionAvatar.MentionAvatar, {
|
|
121
|
+
selected: selected,
|
|
122
|
+
mention: mention
|
|
123
|
+
}) : /*#__PURE__*/_react.default.createElement(_avatar.default, {
|
|
119
124
|
src: avatarUrl,
|
|
120
125
|
size: "medium",
|
|
121
126
|
presence: status,
|
|
@@ -12,7 +12,7 @@ var _types = require("../types");
|
|
|
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/mention";
|
|
15
|
-
var packageVersion = "24.0
|
|
15
|
+
var packageVersion = "24.1.0";
|
|
16
16
|
var SLI_EVENT_TYPE = exports.SLI_EVENT_TYPE = 'sli';
|
|
17
17
|
var SMART_EVENT_TYPE = exports.SMART_EVENT_TYPE = 'smart';
|
|
18
18
|
var fireAnalyticsMentionTypeaheadEvent = exports.fireAnalyticsMentionTypeaheadEvent = function fireAnalyticsMentionTypeaheadEvent(props) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Avatar from '@atlaskit/avatar';
|
|
3
|
+
import TeamAvatar from '@atlaskit/teams-avatar';
|
|
4
|
+
import { isTeamMention } from '../../types';
|
|
5
|
+
export const MentionAvatar = ({
|
|
6
|
+
mention,
|
|
7
|
+
selected
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
avatarUrl,
|
|
11
|
+
presence
|
|
12
|
+
} = mention;
|
|
13
|
+
const borderColor = selected ? "var(--ds-border, #091E4224)" : undefined;
|
|
14
|
+
const {
|
|
15
|
+
status
|
|
16
|
+
} = presence || {};
|
|
17
|
+
if (isTeamMention(mention)) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(TeamAvatar, {
|
|
19
|
+
src: avatarUrl,
|
|
20
|
+
size: "medium",
|
|
21
|
+
borderColor: borderColor
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return /*#__PURE__*/React.createElement(Avatar, {
|
|
25
|
+
src: avatarUrl,
|
|
26
|
+
size: "medium",
|
|
27
|
+
presence: status,
|
|
28
|
+
borderColor: borderColor
|
|
29
|
+
});
|
|
30
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import Avatar from '@atlaskit/avatar';
|
|
3
3
|
import Lozenge from '@atlaskit/lozenge';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { N30 } from '@atlaskit/theme/colors';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
import EditorPanelIcon from '@atlaskit/icon/core/migration/information--editor-panel';
|
|
@@ -13,6 +14,7 @@ import { AccessSectionStyle, AvatarStyle, FullNameStyle, InfoSectionStyle, Menti
|
|
|
13
14
|
import { renderHighlight } from './MentionHighlightHelpers';
|
|
14
15
|
import MentionDescriptionByline from '../MentionDescriptionByline';
|
|
15
16
|
import MessagesIntlProvider from '../MessagesIntlProvider';
|
|
17
|
+
import { MentionAvatar } from '../MentionAvatar';
|
|
16
18
|
export { MENTION_ITEM_HEIGHT } from './styles';
|
|
17
19
|
function renderLozenge(lozenge) {
|
|
18
20
|
if (typeof lozenge === 'string') {
|
|
@@ -92,7 +94,10 @@ export default class MentionItem extends React.PureComponent {
|
|
|
92
94
|
"data-selected": selected
|
|
93
95
|
}, /*#__PURE__*/React.createElement(RowStyle, null, /*#__PURE__*/React.createElement(AvatarStyle, {
|
|
94
96
|
restricted: restricted
|
|
95
|
-
}, /*#__PURE__*/React.createElement(
|
|
97
|
+
}, fg('team-avatar-in-mention-picker') ? /*#__PURE__*/React.createElement(MentionAvatar, {
|
|
98
|
+
selected: selected,
|
|
99
|
+
mention: mention
|
|
100
|
+
}) : /*#__PURE__*/React.createElement(Avatar, {
|
|
96
101
|
src: avatarUrl,
|
|
97
102
|
size: "medium",
|
|
98
103
|
presence: status,
|
|
@@ -2,7 +2,7 @@ import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-t
|
|
|
2
2
|
import { ELEMENTS_CHANNEL } from '../_constants';
|
|
3
3
|
import { ComponentNames, isSpecialMentionText } from '../types';
|
|
4
4
|
const packageName = "@atlaskit/mention";
|
|
5
|
-
const packageVersion = "24.0
|
|
5
|
+
const packageVersion = "24.1.0";
|
|
6
6
|
export const SLI_EVENT_TYPE = 'sli';
|
|
7
7
|
export const SMART_EVENT_TYPE = 'smart';
|
|
8
8
|
export const fireAnalyticsMentionTypeaheadEvent = props => (action, duration, userIds = [], query) => {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Avatar from '@atlaskit/avatar';
|
|
3
|
+
import TeamAvatar from '@atlaskit/teams-avatar';
|
|
4
|
+
import { isTeamMention } from '../../types';
|
|
5
|
+
export var MentionAvatar = function MentionAvatar(_ref) {
|
|
6
|
+
var mention = _ref.mention,
|
|
7
|
+
selected = _ref.selected;
|
|
8
|
+
var avatarUrl = mention.avatarUrl,
|
|
9
|
+
presence = mention.presence;
|
|
10
|
+
var borderColor = selected ? "var(--ds-border, #091E4224)" : undefined;
|
|
11
|
+
var _ref2 = presence || {},
|
|
12
|
+
status = _ref2.status;
|
|
13
|
+
if (isTeamMention(mention)) {
|
|
14
|
+
return /*#__PURE__*/React.createElement(TeamAvatar, {
|
|
15
|
+
src: avatarUrl,
|
|
16
|
+
size: "medium",
|
|
17
|
+
borderColor: borderColor
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return /*#__PURE__*/React.createElement(Avatar, {
|
|
21
|
+
src: avatarUrl,
|
|
22
|
+
size: "medium",
|
|
23
|
+
presence: status,
|
|
24
|
+
borderColor: borderColor
|
|
25
|
+
});
|
|
26
|
+
};
|
|
@@ -9,6 +9,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
import Avatar from '@atlaskit/avatar';
|
|
11
11
|
import Lozenge from '@atlaskit/lozenge';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { N30 } from '@atlaskit/theme/colors';
|
|
13
14
|
import React from 'react';
|
|
14
15
|
import EditorPanelIcon from '@atlaskit/icon/core/migration/information--editor-panel';
|
|
@@ -21,6 +22,7 @@ import { AccessSectionStyle, AvatarStyle, FullNameStyle, InfoSectionStyle, Menti
|
|
|
21
22
|
import { renderHighlight } from './MentionHighlightHelpers';
|
|
22
23
|
import MentionDescriptionByline from '../MentionDescriptionByline';
|
|
23
24
|
import MessagesIntlProvider from '../MessagesIntlProvider';
|
|
25
|
+
import { MentionAvatar } from '../MentionAvatar';
|
|
24
26
|
export { MENTION_ITEM_HEIGHT } from './styles';
|
|
25
27
|
function renderLozenge(lozenge) {
|
|
26
28
|
if (typeof lozenge === 'string') {
|
|
@@ -103,7 +105,10 @@ var MentionItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
103
105
|
"data-selected": selected
|
|
104
106
|
}, /*#__PURE__*/React.createElement(RowStyle, null, /*#__PURE__*/React.createElement(AvatarStyle, {
|
|
105
107
|
restricted: restricted
|
|
106
|
-
}, /*#__PURE__*/React.createElement(
|
|
108
|
+
}, fg('team-avatar-in-mention-picker') ? /*#__PURE__*/React.createElement(MentionAvatar, {
|
|
109
|
+
selected: selected,
|
|
110
|
+
mention: mention
|
|
111
|
+
}) : /*#__PURE__*/React.createElement(Avatar, {
|
|
107
112
|
src: avatarUrl,
|
|
108
113
|
size: "medium",
|
|
109
114
|
presence: status,
|
|
@@ -5,7 +5,7 @@ import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-t
|
|
|
5
5
|
import { ELEMENTS_CHANNEL } from '../_constants';
|
|
6
6
|
import { ComponentNames, isSpecialMentionText } from '../types';
|
|
7
7
|
var packageName = "@atlaskit/mention";
|
|
8
|
-
var packageVersion = "24.0
|
|
8
|
+
var packageVersion = "24.1.0";
|
|
9
9
|
export var SLI_EVENT_TYPE = 'sli';
|
|
10
10
|
export var SMART_EVENT_TYPE = 'smart';
|
|
11
11
|
export var fireAnalyticsMentionTypeaheadEvent = function fireAnalyticsMentionTypeaheadEvent(props) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MentionDescription } from '../../types';
|
|
3
|
+
type MentionAvatarProps = {
|
|
4
|
+
selected?: boolean;
|
|
5
|
+
mention: MentionDescription;
|
|
6
|
+
};
|
|
7
|
+
export declare const MentionAvatar: ({ mention, selected }: MentionAvatarProps) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MentionDescription } from '../../types';
|
|
3
|
+
type MentionAvatarProps = {
|
|
4
|
+
selected?: boolean;
|
|
5
|
+
mention: MentionDescription;
|
|
6
|
+
};
|
|
7
|
+
export declare const MentionAvatar: ({ mention, selected }: MentionAvatarProps) => React.JSX.Element;
|
|
8
|
+
export {};
|
package/package.json
CHANGED
|
@@ -33,15 +33,16 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
36
|
-
"@atlaskit/avatar": "^
|
|
36
|
+
"@atlaskit/avatar": "^24.0.0",
|
|
37
37
|
"@atlaskit/focus-ring": "^3.0.0",
|
|
38
38
|
"@atlaskit/heading": "^5.1.0",
|
|
39
39
|
"@atlaskit/icon": "^24.1.0",
|
|
40
|
-
"@atlaskit/lozenge": "^12.
|
|
40
|
+
"@atlaskit/lozenge": "^12.1.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
42
42
|
"@atlaskit/primitives": "^14.1.0",
|
|
43
|
+
"@atlaskit/teams-avatar": "^2.1.0",
|
|
43
44
|
"@atlaskit/theme": "^17.0.0",
|
|
44
|
-
"@atlaskit/tokens": "^4.
|
|
45
|
+
"@atlaskit/tokens": "^4.3.0",
|
|
45
46
|
"@atlaskit/tooltip": "^20.0.0",
|
|
46
47
|
"@atlaskit/ufo": "^0.4.0",
|
|
47
48
|
"@atlaskit/util-service-support": "^6.2.0",
|
|
@@ -91,6 +92,9 @@
|
|
|
91
92
|
"platform-feature-flags": {
|
|
92
93
|
"platform_editor_ai_remove_mentions_record": {
|
|
93
94
|
"type": "boolean"
|
|
95
|
+
},
|
|
96
|
+
"team-avatar-in-mention-picker": {
|
|
97
|
+
"type": "boolean"
|
|
94
98
|
}
|
|
95
99
|
},
|
|
96
100
|
"publishConfig": {
|
|
@@ -118,5 +122,5 @@
|
|
|
118
122
|
]
|
|
119
123
|
}
|
|
120
124
|
},
|
|
121
|
-
"version": "24.0
|
|
125
|
+
"version": "24.1.0"
|
|
122
126
|
}
|