@atlaskit/editor-plugin-mentions 28.0.2 → 28.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
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
2
|
|
|
3
|
+
## 28.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`e07a1b5505804`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e07a1b5505804) -
|
|
8
|
+
[ux] Add experiment-gated support for rendering agent mention avatars as hexagons in React
|
|
9
|
+
mentions and editable editor mention node views.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 28.0.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -58,6 +58,9 @@ var isMentionTextAnAaid = function isMentionTextAnAaid(text) {
|
|
|
58
58
|
var isAgentMentionsExperimentEnabled = function isAgentMentionsExperimentEnabled() {
|
|
59
59
|
return (0, _expVal2.expVal)('platform_editor_agent_mentions', 'isEnabled', false);
|
|
60
60
|
};
|
|
61
|
+
var isAgentMentionUserType = function isAgentMentionUserType(userType) {
|
|
62
|
+
return userType === 'APP' || userType === 'AGENT';
|
|
63
|
+
};
|
|
61
64
|
|
|
62
65
|
/**
|
|
63
66
|
* Returns true if the node is an APP/AGENT mention whose stored text is a raw
|
|
@@ -66,7 +69,7 @@ var isAgentMentionsExperimentEnabled = function isAgentMentionsExperimentEnabled
|
|
|
66
69
|
* consistent and can't drift apart.
|
|
67
70
|
*/
|
|
68
71
|
var isAgentAaidText = function isAgentAaidText(node, isAgentMentionsEnabled) {
|
|
69
|
-
return isAgentMentionsEnabled && (node.attrs.userType
|
|
72
|
+
return isAgentMentionsEnabled && isAgentMentionUserType(node.attrs.userType) && !!node.attrs.text && isMentionTextAnAaid(node.attrs.text);
|
|
70
73
|
};
|
|
71
74
|
var toDOM = function toDOM(node, hasAvatarSlot) {
|
|
72
75
|
// packages/elements/mention/src/components/Mention/index.tsx
|
|
@@ -195,7 +198,7 @@ var MentionNodeView = exports.MentionNodeView = /*#__PURE__*/function () {
|
|
|
195
198
|
var hasProvider = Boolean(options === null || options === void 0 ? void 0 : options.mentionNodeDataProvider);
|
|
196
199
|
var canReportMissingProvider = !hasProvider && (0, _fg.fg)('platform_editor_mention_avatar_observability');
|
|
197
200
|
var cohort = (0, _expVal.expVal)('convo_ai_entity_hover_cards_non_hello_exp', 'hover_card_cohort', 'control');
|
|
198
|
-
var isAvatarEnabled = (hasProvider || canReportMissingProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && (cohort === 'person' || cohort === 'all' || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_node_avatar') || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_node_graphql_provider'));
|
|
201
|
+
var isAvatarEnabled = (hasProvider || canReportMissingProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && (cohort === 'person' || cohort === 'all' || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_node_avatar') || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_node_graphql_provider') || isAgentMentionUserType(node.attrs.userType) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_drop3_hexagon_agent_avatar'));
|
|
199
202
|
this.hasAvatarSlot = hasProvider && isAvatarEnabled;
|
|
200
203
|
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, toDOM(node, this.hasAvatarSlot)),
|
|
201
204
|
dom = _DOMSerializer$render.dom,
|
|
@@ -41,6 +41,7 @@ const AAID_MENTION_TEXT_PATTERN =
|
|
|
41
41
|
/** Returns true if `text` looks like a raw AAID rather than a display name. */
|
|
42
42
|
const isMentionTextAnAaid = text => AAID_MENTION_TEXT_PATTERN.test(text);
|
|
43
43
|
const isAgentMentionsExperimentEnabled = () => expVal('platform_editor_agent_mentions', 'isEnabled', false);
|
|
44
|
+
const isAgentMentionUserType = userType => userType === 'APP' || userType === 'AGENT';
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* Returns true if the node is an APP/AGENT mention whose stored text is a raw
|
|
@@ -48,7 +49,7 @@ const isAgentMentionsExperimentEnabled = () => expVal('platform_editor_agent_men
|
|
|
48
49
|
* All AAID-workaround guards should go through this helper so the checks stay
|
|
49
50
|
* consistent and can't drift apart.
|
|
50
51
|
*/
|
|
51
|
-
const isAgentAaidText = (node, isAgentMentionsEnabled) => isAgentMentionsEnabled && (node.attrs.userType
|
|
52
|
+
const isAgentAaidText = (node, isAgentMentionsEnabled) => isAgentMentionsEnabled && isAgentMentionUserType(node.attrs.userType) && !!node.attrs.text && isMentionTextAnAaid(node.attrs.text);
|
|
52
53
|
const toDOM = (node, hasAvatarSlot) => {
|
|
53
54
|
// packages/elements/mention/src/components/Mention/index.tsx
|
|
54
55
|
let mentionAttrs = {
|
|
@@ -158,7 +159,7 @@ export class MentionNodeView {
|
|
|
158
159
|
const hasProvider = Boolean(options === null || options === void 0 ? void 0 : options.mentionNodeDataProvider);
|
|
159
160
|
const canReportMissingProvider = !hasProvider && fg('platform_editor_mention_avatar_observability');
|
|
160
161
|
const cohort = platformExpVal('convo_ai_entity_hover_cards_non_hello_exp', 'hover_card_cohort', 'control');
|
|
161
|
-
const isAvatarEnabled = (hasProvider || canReportMissingProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && (cohort === 'person' || cohort === 'all' || isExperimentEnabled('platform_editor_mention_node_avatar') || isExperimentEnabled('platform_editor_mention_node_graphql_provider'));
|
|
162
|
+
const isAvatarEnabled = (hasProvider || canReportMissingProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && (cohort === 'person' || cohort === 'all' || isExperimentEnabled('platform_editor_mention_node_avatar') || isExperimentEnabled('platform_editor_mention_node_graphql_provider') || isAgentMentionUserType(node.attrs.userType) && isExperimentEnabled('platform_editor_drop3_hexagon_agent_avatar'));
|
|
162
163
|
this.hasAvatarSlot = hasProvider && isAvatarEnabled;
|
|
163
164
|
const {
|
|
164
165
|
dom,
|
|
@@ -53,6 +53,9 @@ var isMentionTextAnAaid = function isMentionTextAnAaid(text) {
|
|
|
53
53
|
var isAgentMentionsExperimentEnabled = function isAgentMentionsExperimentEnabled() {
|
|
54
54
|
return expVal('platform_editor_agent_mentions', 'isEnabled', false);
|
|
55
55
|
};
|
|
56
|
+
var isAgentMentionUserType = function isAgentMentionUserType(userType) {
|
|
57
|
+
return userType === 'APP' || userType === 'AGENT';
|
|
58
|
+
};
|
|
56
59
|
|
|
57
60
|
/**
|
|
58
61
|
* Returns true if the node is an APP/AGENT mention whose stored text is a raw
|
|
@@ -61,7 +64,7 @@ var isAgentMentionsExperimentEnabled = function isAgentMentionsExperimentEnabled
|
|
|
61
64
|
* consistent and can't drift apart.
|
|
62
65
|
*/
|
|
63
66
|
var isAgentAaidText = function isAgentAaidText(node, isAgentMentionsEnabled) {
|
|
64
|
-
return isAgentMentionsEnabled && (node.attrs.userType
|
|
67
|
+
return isAgentMentionsEnabled && isAgentMentionUserType(node.attrs.userType) && !!node.attrs.text && isMentionTextAnAaid(node.attrs.text);
|
|
65
68
|
};
|
|
66
69
|
var toDOM = function toDOM(node, hasAvatarSlot) {
|
|
67
70
|
// packages/elements/mention/src/components/Mention/index.tsx
|
|
@@ -190,7 +193,7 @@ export var MentionNodeView = /*#__PURE__*/function () {
|
|
|
190
193
|
var hasProvider = Boolean(options === null || options === void 0 ? void 0 : options.mentionNodeDataProvider);
|
|
191
194
|
var canReportMissingProvider = !hasProvider && fg('platform_editor_mention_avatar_observability');
|
|
192
195
|
var cohort = platformExpVal('convo_ai_entity_hover_cards_non_hello_exp', 'hover_card_cohort', 'control');
|
|
193
|
-
var isAvatarEnabled = (hasProvider || canReportMissingProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && (cohort === 'person' || cohort === 'all' || isExperimentEnabled('platform_editor_mention_node_avatar') || isExperimentEnabled('platform_editor_mention_node_graphql_provider'));
|
|
196
|
+
var isAvatarEnabled = (hasProvider || canReportMissingProvider) && node.attrs.userType !== 'SPECIAL' && !genericMentionIds.includes(node.attrs.id) && (cohort === 'person' || cohort === 'all' || isExperimentEnabled('platform_editor_mention_node_avatar') || isExperimentEnabled('platform_editor_mention_node_graphql_provider') || isAgentMentionUserType(node.attrs.userType) && isExperimentEnabled('platform_editor_drop3_hexagon_agent_avatar'));
|
|
194
197
|
this.hasAvatarSlot = hasProvider && isAvatarEnabled;
|
|
195
198
|
var _DOMSerializer$render = DOMSerializer.renderSpec(document, toDOM(node, this.hasAvatarSlot)),
|
|
196
199
|
dom = _DOMSerializer$render.dom,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-mentions",
|
|
3
|
-
"version": "28.0
|
|
3
|
+
"version": "28.1.0",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/section-message": "^10.2.0",
|
|
48
48
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
49
49
|
"@atlaskit/theme": "^28.2.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^229.0.0",
|
|
51
51
|
"@atlaskit/tokens": "^20.4.0",
|
|
52
52
|
"@atlaskit/tooltip": "^24.4.0",
|
|
53
53
|
"@atlaskit/user-picker": "^14.1.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"uuid": "^11.1.1"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@atlaskit/editor-common": "^130.
|
|
63
|
+
"@atlaskit/editor-common": "^130.3.0",
|
|
64
64
|
"react": "^18.2.0 || ^19.2.0",
|
|
65
65
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
66
66
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|