@atlaskit/mention 30.4.0 → 30.5.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/mention
2
2
 
3
+ ## 30.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6467bc826c20f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6467bc826c20f) -
8
+ Preserve mention userType in rendered HTML, including profile-card and disabled mentions, so
9
+ copying from published pages into an editor retains the type behind
10
+ platform_mention_preserve_user_type. Adds optional userType props to Mention and ResourcedMention,
11
+ restricted to DEFAULT, SPECIAL, or APP, so existing callers remain compatible.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 30.4.1
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 30.4.0
4
24
 
5
25
  ### Minor Changes
@@ -192,6 +192,7 @@ var MentionInternal = exports.MentionInternal = /*#__PURE__*/function (_React$Pu
192
192
  id = props.id,
193
193
  accessLevel = props.accessLevel,
194
194
  localId = props.localId,
195
+ userType = props.userType,
195
196
  disabledTooltip = props.disabledTooltip,
196
197
  isAvatarImagePreShaped = props.isAvatarImagePreShaped,
197
198
  renderAvatarSlot = props.renderAvatarSlot,
@@ -271,6 +272,7 @@ var MentionInternal = exports.MentionInternal = /*#__PURE__*/function (_React$Pu
271
272
  }, /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({
272
273
  id: localId,
273
274
  "data-mention-id": id,
275
+ "data-user-type": (0, _fg.fg)('platform_mention_preserve_user_type') ? userType : undefined,
274
276
  "data-local-id": localId,
275
277
  "data-access-level": accessLevel,
276
278
  spellCheck: false
@@ -128,6 +128,7 @@ var ResourcedMention = exports.default = /*#__PURE__*/function (_React$PureCompo
128
128
  avatarUrl: props.avatarUrl,
129
129
  isAvatarImagePreShaped: props.isAvatarImagePreShaped,
130
130
  localId: props.localId,
131
+ userType: props.userType,
131
132
  onClick: props.onClick,
132
133
  onMouseEnter: props.onMouseEnter,
133
134
  onMouseLeave: props.onMouseLeave,
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.packageVersion = void 0;
7
- var packageVersion = exports.packageVersion = "30.3.4";
7
+ var packageVersion = exports.packageVersion = "30.4.1";
@@ -178,6 +178,7 @@ export class MentionInternal extends React.PureComponent {
178
178
  id,
179
179
  accessLevel,
180
180
  localId,
181
+ userType,
181
182
  disabledTooltip,
182
183
  isAvatarImagePreShaped,
183
184
  renderAvatarSlot,
@@ -259,6 +260,7 @@ export class MentionInternal extends React.PureComponent {
259
260
  }, /*#__PURE__*/React.createElement("span", _extends({
260
261
  id: localId,
261
262
  "data-mention-id": id,
263
+ "data-user-type": fg('platform_mention_preserve_user_type') ? userType : undefined,
262
264
  "data-local-id": localId,
263
265
  "data-access-level": accessLevel,
264
266
  spellCheck: false
@@ -102,6 +102,7 @@ export default class ResourcedMention extends React.PureComponent {
102
102
  avatarUrl: props.avatarUrl,
103
103
  isAvatarImagePreShaped: props.isAvatarImagePreShaped,
104
104
  localId: props.localId,
105
+ userType: props.userType,
105
106
  onClick: props.onClick,
106
107
  onMouseEnter: props.onMouseEnter,
107
108
  onMouseLeave: props.onMouseLeave,
@@ -1 +1 @@
1
- export const packageVersion = "30.3.4";
1
+ export const packageVersion = "30.4.1";
@@ -187,6 +187,7 @@ export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
187
187
  id = props.id,
188
188
  accessLevel = props.accessLevel,
189
189
  localId = props.localId,
190
+ userType = props.userType,
190
191
  disabledTooltip = props.disabledTooltip,
191
192
  isAvatarImagePreShaped = props.isAvatarImagePreShaped,
192
193
  renderAvatarSlot = props.renderAvatarSlot,
@@ -266,6 +267,7 @@ export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
266
267
  }, /*#__PURE__*/React.createElement("span", _extends({
267
268
  id: localId,
268
269
  "data-mention-id": id,
270
+ "data-user-type": fg('platform_mention_preserve_user_type') ? userType : undefined,
269
271
  "data-local-id": localId,
270
272
  "data-access-level": accessLevel,
271
273
  spellCheck: false
@@ -119,6 +119,7 @@ var ResourcedMention = /*#__PURE__*/function (_React$PureComponent) {
119
119
  avatarUrl: props.avatarUrl,
120
120
  isAvatarImagePreShaped: props.isAvatarImagePreShaped,
121
121
  localId: props.localId,
122
+ userType: props.userType,
122
123
  onClick: props.onClick,
123
124
  onMouseEnter: props.onMouseEnter,
124
125
  onMouseLeave: props.onMouseLeave,
@@ -1 +1 @@
1
- export var packageVersion = "30.3.4";
1
+ export var packageVersion = "30.4.1";
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { MentionProvider } from '../../api/MentionResource';
3
3
  import { type MentionEventHandler } from '../../types';
4
+ import { type OwnProps } from './';
4
5
  export interface Props {
5
6
  accessLevel?: string;
6
7
  appType?: string | null;
@@ -18,6 +19,7 @@ export interface Props {
18
19
  renderAvatarSlot?: boolean;
19
20
  ssrPlaceholderId?: string;
20
21
  text: string;
22
+ userType?: OwnProps['userType'];
21
23
  }
22
24
  export interface State {
23
25
  isHighlighted: boolean;
@@ -37,6 +37,7 @@ export type OwnProps = {
37
37
  renderAvatarSlot?: boolean;
38
38
  ssrPlaceholderId?: string;
39
39
  text: string;
40
+ userType?: 'DEFAULT' | 'SPECIAL' | 'APP';
40
41
  };
41
42
  export type Props = OwnProps & WithAnalyticsEventsProps;
42
43
  declare const Mention: React.ForwardRefExoticComponent<Omit<OwnProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
package/package.json CHANGED
@@ -44,9 +44,9 @@
44
44
  "@atlaskit/react-compiler-gating": "^0.2.0",
45
45
  "@atlaskit/skeleton": "^4.4.0",
46
46
  "@atlaskit/tag": "^17.0.0",
47
- "@atlaskit/teams-avatar": "^4.1.0",
48
- "@atlaskit/tmp-editor-statsig": "^245.0.0",
49
- "@atlaskit/tokens": "^20.7.0",
47
+ "@atlaskit/teams-avatar": "^4.2.0",
48
+ "@atlaskit/tmp-editor-statsig": "^246.1.0",
49
+ "@atlaskit/tokens": "^20.8.0",
50
50
  "@atlaskit/tooltip": "^24.4.0",
51
51
  "@atlaskit/ufo": "^2.0.0",
52
52
  "@atlaskit/util-service-support": "^7.4.0",
@@ -129,5 +129,5 @@
129
129
  "*.compiled.css"
130
130
  ],
131
131
  "types": "dist/types/index.d.ts",
132
- "version": "30.4.0"
132
+ "version": "30.5.0"
133
133
  }