@atlaskit/editor-plugin-mentions 14.6.6 → 14.7.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,16 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 14.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`f4cf0276c2938`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f4cf0276c2938) -
8
+ Add metric attributes for tracking agent inclusion and selection from the mention picker
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 14.6.6
4
15
 
5
16
  ### Patch Changes
@@ -66,7 +66,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
66
66
  var AGENT_MENTION_INACTIVITY_MS = 3000;
67
67
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
68
68
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
69
- var PACKAGE_VERSION = "14.6.5";
69
+ var PACKAGE_VERSION = "14.6.6";
70
70
  var setProvider = function setProvider(provider) {
71
71
  return function (state, dispatch) {
72
72
  if (dispatch) {
@@ -105,7 +105,7 @@ var buildTypeAheadInviteItemClickedPayload = exports.buildTypeAheadInviteItemCli
105
105
  }, additionalAttributes)
106
106
  };
107
107
  };
108
- var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId, isAgent) {
108
+ var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId, isAgent, agentSectioningEnabled) {
109
109
  var _extractAttributesFro3 = extractAttributesFromQuery(query),
110
110
  queryLength = _extractAttributesFro3.queryLength,
111
111
  spaceInQuery = _extractAttributesFro3.spaceInQuery;
@@ -141,7 +141,8 @@ var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = func
141
141
  memberCount: (0, _utils.isTeamType)(mention.userType) && mention.context ? mention.context.memberCount : null,
142
142
  includesYou: (0, _utils.isTeamType)(mention.userType) && mention.context ? mention.context.includesYou : null
143
143
  }, isAgent ? {
144
- isAgent: isAgent
144
+ isAgent: isAgent,
145
+ agentSectioningEnabled: agentSectioningEnabled
145
146
  } : {}), {}, {
146
147
  taskListId: taskListId,
147
148
  taskItemId: taskItemId,
@@ -152,16 +153,21 @@ var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = func
152
153
  })
153
154
  };
154
155
  };
155
- var buildTypeAheadRenderedPayload = exports.buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams, xProductMentionsLength) {
156
+ var buildTypeAheadRenderedPayload = exports.buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams, xProductMentionsLength, agentAnalytics) {
156
157
  var _extractAttributesFro4 = extractAttributesFromQuery(query),
157
158
  queryLength = _extractAttributesFro4.queryLength,
158
159
  spaceInQuery = _extractAttributesFro4.spaceInQuery;
159
160
  var actionSubject = userIds ? _analytics.ACTION_SUBJECT.MENTION_TYPEAHEAD : _analytics.ACTION_SUBJECT.TEAM_MENTION_TYPEAHEAD;
161
+ var agentAnalyticsAttributes = agentAnalytics ? {
162
+ agentCount: agentAnalytics.agentCount,
163
+ agentsShown: agentAnalytics.agentCount > 0,
164
+ agentSectioningEnabled: agentAnalytics.agentSectioningEnabled
165
+ } : {};
160
166
  return {
161
167
  action: _analytics.ACTION.RENDERED,
162
168
  actionSubject: actionSubject,
163
169
  eventType: _analytics.EVENT_TYPE.OPERATIONAL,
164
- attributes: {
170
+ attributes: _objectSpread({
165
171
  componentName: componentName,
166
172
  duration: duration,
167
173
  userIds: userIds,
@@ -169,6 +175,6 @@ var buildTypeAheadRenderedPayload = exports.buildTypeAheadRenderedPayload = func
169
175
  queryLength: queryLength,
170
176
  spaceInQuery: spaceInQuery,
171
177
  xProductMentionsLength: xProductMentionsLength
172
- }
178
+ }, agentAnalyticsAttributes)
173
179
  };
174
180
  };
@@ -158,7 +158,8 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
158
158
  return function (_ref5) {
159
159
  var query = _ref5.query,
160
160
  mentions = _ref5.mentions,
161
- stats = _ref5.stats;
161
+ stats = _ref5.stats,
162
+ agentAnalytics = _ref5.agentAnalytics;
162
163
  var duration = 0;
163
164
  var userOrTeamIds = null;
164
165
  var teams = null;
@@ -191,7 +192,7 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
191
192
  return !!m;
192
193
  });
193
194
  }
194
- var payload = (0, _analytics.buildTypeAheadRenderedPayload)(duration, userOrTeamIds, query, teams, xProductMentionsLength);
195
+ var payload = (0, _analytics.buildTypeAheadRenderedPayload)(duration, userOrTeamIds, query, teams, xProductMentionsLength, agentAnalytics);
195
196
  fireEvent(payload, 'fabric-elements');
196
197
  };
197
198
  };
@@ -264,7 +265,8 @@ var makeTransformMentionsToTypeAheadItems = function makeTransformMentionsToType
264
265
  var fireEvent = _ref6.fireEvent,
265
266
  getFirstQueryWithoutResults = _ref6.getFirstQueryWithoutResults,
266
267
  setFirstQueryWithoutResults = _ref6.setFirstQueryWithoutResults,
267
- toItem = _ref6.toItem;
268
+ toItem = _ref6.toItem,
269
+ enableAgentSectioning = _ref6.enableAgentSectioning;
268
270
  return function (_ref7) {
269
271
  var mentions = _ref7.mentions,
270
272
  query = _ref7.query,
@@ -275,10 +277,16 @@ var makeTransformMentionsToTypeAheadItems = function makeTransformMentionsToType
275
277
  var mentionItems = mentions.map(function (mention) {
276
278
  return toItem(mention);
277
279
  });
280
+ var agentCount = mentions.filter(isAgentMention).length;
281
+ var agentAnalytics = {
282
+ agentCount: agentCount,
283
+ agentSectioningEnabled: enableAgentSectioning
284
+ };
278
285
  buildAndSendElementsTypeAheadAnalytics(fireEvent)({
279
286
  query: query,
280
287
  mentions: mentions,
281
- stats: stats
288
+ stats: stats,
289
+ agentAnalytics: agentAnalytics
282
290
  });
283
291
  if (mentions.length === 0 && getFirstQueryWithoutResults() === null) {
284
292
  setFirstQueryWithoutResults(query);
@@ -315,6 +323,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
315
323
  var firstQueryWithoutResults = null;
316
324
  var subscriptionKeys = new Set();
317
325
  var transformMentionsToTypeAheadItems = makeTransformMentionsToTypeAheadItems({
326
+ enableAgentSectioning: enableAgentSectioning,
318
327
  fireEvent: fireEvent,
319
328
  getFirstQueryWithoutResults: function getFirstQueryWithoutResults() {
320
329
  return firstQueryWithoutResults;
@@ -438,8 +447,8 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
438
447
  var mentionContext = _objectSpread(_objectSpread({}, contextIdentifierProvider), {}, {
439
448
  sessionId: sessionId
440
449
  });
441
- var isAgentMentionsExperimentEnabled = (0, _expVal.expVal)('platform_editor_agent_mentions', 'isEnabled', false);
442
- var isAgentMentionInsertion = isAgentMentionsExperimentEnabled && isAgentMention(item.mention);
450
+ var isAgentMentionSelection = isAgentMention(item.mention);
451
+ var isAgentMentionInsertion = isAgentMentionSelection && (0, _expVal.expVal)('platform_editor_agent_mentions', 'isEnabled', false);
443
452
  // userType can be missing for provider-only agent mentions. Copy/paste cannot
444
453
  // see appType, so persist APP only when there is no explicit userType.
445
454
  var persistedUserType = isAgentMentionInsertion && userType == null ? 'APP' : userType;
@@ -512,7 +521,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
512
521
  }
513
522
  fireEvent((0, _analytics.buildTypeAheadInsertedPayload)(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(function (x) {
514
523
  return x.mention;
515
- }), query, contextIdentifierProvider, taskListId, taskItemId, isAgentMentionInsertion));
524
+ }), query, contextIdentifierProvider, taskListId, taskItemId, isAgentMentionSelection, enableAgentSectioning));
516
525
 
517
526
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
518
527
  sessionId = (0, _uuid.default)();
@@ -50,7 +50,7 @@ const AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
50
50
  const AGENT_MENTION_INACTIVITY_MS = 3000;
51
51
  const MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
52
52
  const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
53
- const PACKAGE_VERSION = "14.6.5";
53
+ const PACKAGE_VERSION = "14.6.6";
54
54
  const setProvider = provider => (state, dispatch) => {
55
55
  if (dispatch) {
56
56
  dispatch(state.tr.setMeta(mentionPluginKey, {
@@ -97,7 +97,7 @@ export const buildTypeAheadInviteItemClickedPayload = (duration, upKeyCount, dow
97
97
  }
98
98
  };
99
99
  };
100
- export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId, isAgent) => {
100
+ export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId, isAgent, agentSectioningEnabled) => {
101
101
  const {
102
102
  queryLength,
103
103
  spaceInQuery
@@ -134,7 +134,8 @@ export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount
134
134
  memberCount: isTeamType(mention.userType) && mention.context ? mention.context.memberCount : null,
135
135
  includesYou: isTeamType(mention.userType) && mention.context ? mention.context.includesYou : null,
136
136
  ...(isAgent ? {
137
- isAgent
137
+ isAgent,
138
+ agentSectioningEnabled
138
139
  } : {}),
139
140
  taskListId,
140
141
  taskItemId,
@@ -145,12 +146,17 @@ export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount
145
146
  }
146
147
  };
147
148
  };
148
- export const buildTypeAheadRenderedPayload = (duration, userIds, query, teams, xProductMentionsLength) => {
149
+ export const buildTypeAheadRenderedPayload = (duration, userIds, query, teams, xProductMentionsLength, agentAnalytics) => {
149
150
  const {
150
151
  queryLength,
151
152
  spaceInQuery
152
153
  } = extractAttributesFromQuery(query);
153
154
  const actionSubject = userIds ? ACTION_SUBJECT.MENTION_TYPEAHEAD : ACTION_SUBJECT.TEAM_MENTION_TYPEAHEAD;
155
+ const agentAnalyticsAttributes = agentAnalytics ? {
156
+ agentCount: agentAnalytics.agentCount,
157
+ agentsShown: agentAnalytics.agentCount > 0,
158
+ agentSectioningEnabled: agentAnalytics.agentSectioningEnabled
159
+ } : {};
154
160
  return {
155
161
  action: ACTION.RENDERED,
156
162
  actionSubject,
@@ -162,7 +168,8 @@ export const buildTypeAheadRenderedPayload = (duration, userIds, query, teams, x
162
168
  teams,
163
169
  queryLength,
164
170
  spaceInQuery,
165
- xProductMentionsLength
171
+ xProductMentionsLength,
172
+ ...agentAnalyticsAttributes
166
173
  }
167
174
  };
168
175
  };
@@ -129,7 +129,8 @@ export function memoize(fn
129
129
  const buildAndSendElementsTypeAheadAnalytics = fireEvent => ({
130
130
  query,
131
131
  mentions,
132
- stats
132
+ stats,
133
+ agentAnalytics
133
134
  }) => {
134
135
  let duration = 0;
135
136
  let userOrTeamIds = null;
@@ -155,7 +156,7 @@ const buildAndSendElementsTypeAheadAnalytics = fireEvent => ({
155
156
  memberCount: mention.context.memberCount
156
157
  } : null).filter(m => !!m);
157
158
  }
158
- const payload = buildTypeAheadRenderedPayload(duration, userOrTeamIds, query, teams, xProductMentionsLength);
159
+ const payload = buildTypeAheadRenderedPayload(duration, userOrTeamIds, query, teams, xProductMentionsLength, agentAnalytics);
159
160
  fireEvent(payload, 'fabric-elements');
160
161
  };
161
162
 
@@ -233,7 +234,8 @@ const makeTransformMentionsToTypeAheadItems = ({
233
234
  fireEvent,
234
235
  getFirstQueryWithoutResults,
235
236
  setFirstQueryWithoutResults,
236
- toItem
237
+ toItem,
238
+ enableAgentSectioning
237
239
  }) => {
238
240
  return ({
239
241
  mentions,
@@ -244,10 +246,16 @@ const makeTransformMentionsToTypeAheadItems = ({
244
246
  sessionId
245
247
  }) => {
246
248
  const mentionItems = mentions.map(mention => toItem(mention));
249
+ const agentCount = mentions.filter(isAgentMention).length;
250
+ const agentAnalytics = {
251
+ agentCount,
252
+ agentSectioningEnabled: enableAgentSectioning
253
+ };
247
254
  buildAndSendElementsTypeAheadAnalytics(fireEvent)({
248
255
  query,
249
256
  mentions,
250
- stats
257
+ stats,
258
+ agentAnalytics
251
259
  });
252
260
  if (mentions.length === 0 && getFirstQueryWithoutResults() === null) {
253
261
  setFirstQueryWithoutResults(query);
@@ -284,6 +292,7 @@ export const createTypeAheadConfig = ({
284
292
  let firstQueryWithoutResults = null;
285
293
  const subscriptionKeys = new Set();
286
294
  const transformMentionsToTypeAheadItems = makeTransformMentionsToTypeAheadItems({
295
+ enableAgentSectioning,
287
296
  fireEvent,
288
297
  getFirstQueryWithoutResults: () => firstQueryWithoutResults,
289
298
  setFirstQueryWithoutResults: query => {
@@ -413,8 +422,8 @@ export const createTypeAheadConfig = ({
413
422
  ...contextIdentifierProvider,
414
423
  sessionId
415
424
  };
416
- const isAgentMentionsExperimentEnabled = expVal('platform_editor_agent_mentions', 'isEnabled', false);
417
- const isAgentMentionInsertion = isAgentMentionsExperimentEnabled && isAgentMention(item.mention);
425
+ const isAgentMentionSelection = isAgentMention(item.mention);
426
+ const isAgentMentionInsertion = isAgentMentionSelection && expVal('platform_editor_agent_mentions', 'isEnabled', false);
418
427
  // userType can be missing for provider-only agent mentions. Copy/paste cannot
419
428
  // see appType, so persist APP only when there is no explicit userType.
420
429
  const persistedUserType = isAgentMentionInsertion && userType == null ? 'APP' : userType;
@@ -489,7 +498,7 @@ export const createTypeAheadConfig = ({
489
498
  handleMentionsChanged([mentionChange]);
490
499
  }
491
500
  }
492
- fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(x => x.mention), query, contextIdentifierProvider, taskListId, taskItemId, isAgentMentionInsertion));
501
+ fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(x => x.mention), query, contextIdentifierProvider, taskListId, taskItemId, isAgentMentionSelection, enableAgentSectioning));
493
502
 
494
503
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
495
504
  sessionId = uuid();
@@ -57,7 +57,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
57
57
  var AGENT_MENTION_INACTIVITY_MS = 3000;
58
58
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
59
59
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
60
- var PACKAGE_VERSION = "14.6.5";
60
+ var PACKAGE_VERSION = "14.6.6";
61
61
  var setProvider = function setProvider(provider) {
62
62
  return function (state, dispatch) {
63
63
  if (dispatch) {
@@ -98,7 +98,7 @@ export var buildTypeAheadInviteItemClickedPayload = function buildTypeAheadInvit
98
98
  }, additionalAttributes)
99
99
  };
100
100
  };
101
- export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId, isAgent) {
101
+ export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId, isAgent, agentSectioningEnabled) {
102
102
  var _extractAttributesFro3 = extractAttributesFromQuery(query),
103
103
  queryLength = _extractAttributesFro3.queryLength,
104
104
  spaceInQuery = _extractAttributesFro3.spaceInQuery;
@@ -134,7 +134,8 @@ export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayloa
134
134
  memberCount: isTeamType(mention.userType) && mention.context ? mention.context.memberCount : null,
135
135
  includesYou: isTeamType(mention.userType) && mention.context ? mention.context.includesYou : null
136
136
  }, isAgent ? {
137
- isAgent: isAgent
137
+ isAgent: isAgent,
138
+ agentSectioningEnabled: agentSectioningEnabled
138
139
  } : {}), {}, {
139
140
  taskListId: taskListId,
140
141
  taskItemId: taskItemId,
@@ -145,16 +146,21 @@ export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayloa
145
146
  })
146
147
  };
147
148
  };
148
- export var buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams, xProductMentionsLength) {
149
+ export var buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams, xProductMentionsLength, agentAnalytics) {
149
150
  var _extractAttributesFro4 = extractAttributesFromQuery(query),
150
151
  queryLength = _extractAttributesFro4.queryLength,
151
152
  spaceInQuery = _extractAttributesFro4.spaceInQuery;
152
153
  var actionSubject = userIds ? ACTION_SUBJECT.MENTION_TYPEAHEAD : ACTION_SUBJECT.TEAM_MENTION_TYPEAHEAD;
154
+ var agentAnalyticsAttributes = agentAnalytics ? {
155
+ agentCount: agentAnalytics.agentCount,
156
+ agentsShown: agentAnalytics.agentCount > 0,
157
+ agentSectioningEnabled: agentAnalytics.agentSectioningEnabled
158
+ } : {};
153
159
  return {
154
160
  action: ACTION.RENDERED,
155
161
  actionSubject: actionSubject,
156
162
  eventType: EVENT_TYPE.OPERATIONAL,
157
- attributes: {
163
+ attributes: _objectSpread({
158
164
  componentName: componentName,
159
165
  duration: duration,
160
166
  userIds: userIds,
@@ -162,6 +168,6 @@ export var buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayloa
162
168
  queryLength: queryLength,
163
169
  spaceInQuery: spaceInQuery,
164
170
  xProductMentionsLength: xProductMentionsLength
165
- }
171
+ }, agentAnalyticsAttributes)
166
172
  };
167
173
  };
@@ -149,7 +149,8 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
149
149
  return function (_ref5) {
150
150
  var query = _ref5.query,
151
151
  mentions = _ref5.mentions,
152
- stats = _ref5.stats;
152
+ stats = _ref5.stats,
153
+ agentAnalytics = _ref5.agentAnalytics;
153
154
  var duration = 0;
154
155
  var userOrTeamIds = null;
155
156
  var teams = null;
@@ -182,7 +183,7 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
182
183
  return !!m;
183
184
  });
184
185
  }
185
- var payload = buildTypeAheadRenderedPayload(duration, userOrTeamIds, query, teams, xProductMentionsLength);
186
+ var payload = buildTypeAheadRenderedPayload(duration, userOrTeamIds, query, teams, xProductMentionsLength, agentAnalytics);
186
187
  fireEvent(payload, 'fabric-elements');
187
188
  };
188
189
  };
@@ -255,7 +256,8 @@ var makeTransformMentionsToTypeAheadItems = function makeTransformMentionsToType
255
256
  var fireEvent = _ref6.fireEvent,
256
257
  getFirstQueryWithoutResults = _ref6.getFirstQueryWithoutResults,
257
258
  setFirstQueryWithoutResults = _ref6.setFirstQueryWithoutResults,
258
- toItem = _ref6.toItem;
259
+ toItem = _ref6.toItem,
260
+ enableAgentSectioning = _ref6.enableAgentSectioning;
259
261
  return function (_ref7) {
260
262
  var mentions = _ref7.mentions,
261
263
  query = _ref7.query,
@@ -266,10 +268,16 @@ var makeTransformMentionsToTypeAheadItems = function makeTransformMentionsToType
266
268
  var mentionItems = mentions.map(function (mention) {
267
269
  return toItem(mention);
268
270
  });
271
+ var agentCount = mentions.filter(isAgentMention).length;
272
+ var agentAnalytics = {
273
+ agentCount: agentCount,
274
+ agentSectioningEnabled: enableAgentSectioning
275
+ };
269
276
  buildAndSendElementsTypeAheadAnalytics(fireEvent)({
270
277
  query: query,
271
278
  mentions: mentions,
272
- stats: stats
279
+ stats: stats,
280
+ agentAnalytics: agentAnalytics
273
281
  });
274
282
  if (mentions.length === 0 && getFirstQueryWithoutResults() === null) {
275
283
  setFirstQueryWithoutResults(query);
@@ -306,6 +314,7 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref8) {
306
314
  var firstQueryWithoutResults = null;
307
315
  var subscriptionKeys = new Set();
308
316
  var transformMentionsToTypeAheadItems = makeTransformMentionsToTypeAheadItems({
317
+ enableAgentSectioning: enableAgentSectioning,
309
318
  fireEvent: fireEvent,
310
319
  getFirstQueryWithoutResults: function getFirstQueryWithoutResults() {
311
320
  return firstQueryWithoutResults;
@@ -429,8 +438,8 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref8) {
429
438
  var mentionContext = _objectSpread(_objectSpread({}, contextIdentifierProvider), {}, {
430
439
  sessionId: sessionId
431
440
  });
432
- var isAgentMentionsExperimentEnabled = expVal('platform_editor_agent_mentions', 'isEnabled', false);
433
- var isAgentMentionInsertion = isAgentMentionsExperimentEnabled && isAgentMention(item.mention);
441
+ var isAgentMentionSelection = isAgentMention(item.mention);
442
+ var isAgentMentionInsertion = isAgentMentionSelection && expVal('platform_editor_agent_mentions', 'isEnabled', false);
434
443
  // userType can be missing for provider-only agent mentions. Copy/paste cannot
435
444
  // see appType, so persist APP only when there is no explicit userType.
436
445
  var persistedUserType = isAgentMentionInsertion && userType == null ? 'APP' : userType;
@@ -503,7 +512,7 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref8) {
503
512
  }
504
513
  fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(function (x) {
505
514
  return x.mention;
506
- }), query, contextIdentifierProvider, taskListId, taskItemId, isAgentMentionInsertion));
515
+ }), query, contextIdentifierProvider, taskListId, taskItemId, isAgentMentionSelection, enableAgentSectioning));
507
516
 
508
517
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
509
518
  sessionId = uuid();
@@ -8,5 +8,8 @@ export declare const MENTION_SOURCE = "mentionInEditor";
8
8
  export declare const buildTypeAheadCancelPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, query?: string) => AnalyticsEventPayload;
9
9
  export declare const buildTypeAheadInviteItemViewedPayload: (sessionId: string, contextIdentifierProvider?: ContextIdentifierProvider, userRole?: UserRole, additionalAttributes?: Record<string, unknown>) => AnalyticsEventPayload;
10
10
  export declare const buildTypeAheadInviteItemClickedPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, insertType: SelectItemMode, query?: string, contextIdentifierProvider?: ContextIdentifierProvider, userRole?: UserRole, additionalAttributes?: Record<string, unknown>) => AnalyticsEventPayload;
11
- export declare const buildTypeAheadInsertedPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, insertType: SelectItemMode, mention: MentionDescription, mentionLocalId: string, mentionList?: MentionDescription[], query?: string, contextIdentifierProvider?: ContextIdentifierProvider, taskListId?: string, taskItemId?: string, isAgent?: boolean) => AnalyticsEventPayload;
12
- export declare const buildTypeAheadRenderedPayload: (duration: number, userIds: Array<string> | null, query: string, teams: TeamInfoAttrAnalytics[] | null, xProductMentionsLength: number) => AnalyticsEventPayload;
11
+ export declare const buildTypeAheadInsertedPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, insertType: SelectItemMode, mention: MentionDescription, mentionLocalId: string, mentionList?: MentionDescription[], query?: string, contextIdentifierProvider?: ContextIdentifierProvider, taskListId?: string, taskItemId?: string, isAgent?: boolean, agentSectioningEnabled?: boolean) => AnalyticsEventPayload;
12
+ export declare const buildTypeAheadRenderedPayload: (duration: number, userIds: Array<string> | null, query: string, teams: TeamInfoAttrAnalytics[] | null, xProductMentionsLength: number, agentAnalytics?: {
13
+ agentCount: number;
14
+ agentSectioningEnabled: boolean;
15
+ }) => AnalyticsEventPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "14.6.6",
3
+ "version": "14.7.0",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "@atlaskit/insm": "^1.0.0",
34
34
  "@atlaskit/link": "^4.3.0",
35
35
  "@atlaskit/lozenge": "^14.1.0",
36
- "@atlaskit/mention": "^27.5.0",
36
+ "@atlaskit/mention": "^27.6.0",
37
37
  "@atlaskit/platform-feature-flags": "^2.0.0",
38
38
  "@atlaskit/popper": "^8.3.0",
39
39
  "@atlaskit/portal": "^6.1.0",
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/profilecard": "^26.9.0",
42
42
  "@atlaskit/teams-app-config": "^2.1.0",
43
43
  "@atlaskit/theme": "^26.1.0",
44
- "@atlaskit/tmp-editor-statsig": "^126.0.0",
44
+ "@atlaskit/tmp-editor-statsig": "^126.1.0",
45
45
  "@atlaskit/tokens": "^15.8.0",
46
46
  "@atlaskit/tooltip": "^23.1.0",
47
47
  "@atlaskit/user-picker": "^13.4.0",
@@ -53,7 +53,7 @@
53
53
  "uuid": "^3.1.0"
54
54
  },
55
55
  "peerDependencies": {
56
- "@atlaskit/editor-common": "^116.30.0",
56
+ "@atlaskit/editor-common": "^116.31.0",
57
57
  "react": "^18.2.0",
58
58
  "react-dom": "^18.2.0",
59
59
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"