@atlaskit/editor-plugin-mentions 16.1.0 → 16.1.2

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,21 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 16.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b277d7a23f325`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b277d7a23f325) -
8
+ Adjust profile card migration, check for either FG or experiment to enable new People UX
9
+ - Updated dependencies
10
+
11
+ ## 16.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`716685b30ef93`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/716685b30ef93) -
16
+ Correlate rendered agent mention results with picker selection sessions.
17
+ - Updated dependencies
18
+
3
19
  ## 16.1.0
4
20
 
5
21
  ### Minor Changes
@@ -11,6 +11,7 @@ var _bindEventListener = require("bind-event-listener");
11
11
  var _v = _interopRequireDefault(require("uuid/v4"));
12
12
  var _state = require("@atlaskit/editor-prosemirror/state");
13
13
  var _utils = require("@atlaskit/editor-prosemirror/utils");
14
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
14
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
16
  var _navigation = require("@atlaskit/teams-app-config/navigation");
16
17
  var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
@@ -153,7 +154,7 @@ var profileCardRenderer = exports.profileCardRenderer = function profileCardRend
153
154
  var listenerCleanup = (0, _bindEventListener.bind)(dom, {
154
155
  type: 'click',
155
156
  listener: function listener() {
156
- if ((0, _platformFeatureFlags.fg)('people-teams_migrate-user-profile-card')) {
157
+ if ((0, _platformFeatureFlags.fg)('people-teams_migrate-user-profile-card') || (0, _isExperimentEnabled.isExperimentEnabled)('pt_user_profile_card_migration_exp')) {
157
158
  var _currentNode$attrs, _node$attrs, _options$profilecardP;
158
159
  var userId = (0, _expVal.expVal)('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? (_currentNode$attrs = currentNode.attrs) === null || _currentNode$attrs === void 0 ? void 0 : _currentNode$attrs.id : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.id;
159
160
  if (!userId) {
@@ -67,7 +67,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
67
67
  var AGENT_MENTION_INACTIVITY_MS = 3000;
68
68
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
69
69
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
70
- var PACKAGE_VERSION = "16.0.3";
70
+ var PACKAGE_VERSION = "16.1.1";
71
71
  var setProvider = function setProvider(provider) {
72
72
  return function (state, dispatch) {
73
73
  if (dispatch) {
@@ -153,7 +153,7 @@ var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = func
153
153
  })
154
154
  };
155
155
  };
156
- var buildTypeAheadRenderedPayload = exports.buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams, xProductMentionsLength, agentAnalytics) {
156
+ var buildTypeAheadRenderedPayload = exports.buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams, xProductMentionsLength, mentionTypeaheadSessionId, agentAnalytics) {
157
157
  var _extractAttributesFro4 = extractAttributesFromQuery(query),
158
158
  queryLength = _extractAttributesFro4.queryLength,
159
159
  spaceInQuery = _extractAttributesFro4.spaceInQuery;
@@ -170,6 +170,7 @@ var buildTypeAheadRenderedPayload = exports.buildTypeAheadRenderedPayload = func
170
170
  attributes: _objectSpread({
171
171
  componentName: componentName,
172
172
  duration: duration,
173
+ mentionTypeaheadSessionId: mentionTypeaheadSessionId,
173
174
  userIds: userIds,
174
175
  teams: teams,
175
176
  queryLength: queryLength,
@@ -167,6 +167,7 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
167
167
  var query = _ref5.query,
168
168
  mentions = _ref5.mentions,
169
169
  stats = _ref5.stats,
170
+ mentionTypeaheadSessionId = _ref5.mentionTypeaheadSessionId,
170
171
  agentAnalytics = _ref5.agentAnalytics;
171
172
  var duration = 0;
172
173
  var userOrTeamIds = null;
@@ -200,7 +201,7 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
200
201
  return !!m;
201
202
  });
202
203
  }
203
- var payload = (0, _analytics.buildTypeAheadRenderedPayload)(duration, userOrTeamIds, query, teams, xProductMentionsLength, agentAnalytics);
204
+ var payload = (0, _analytics.buildTypeAheadRenderedPayload)(duration, userOrTeamIds, query, teams, xProductMentionsLength, mentionTypeaheadSessionId, agentAnalytics);
204
205
  fireEvent(payload, 'fabric-elements');
205
206
  };
206
207
  };
@@ -285,22 +286,22 @@ var makeTransformMentionsToTypeAheadItems = function makeTransformMentionsToType
285
286
  var mentionItems = mentions.map(function (mention) {
286
287
  return toItem(mention);
287
288
  });
288
- var agentCount = mentions.filter(isAgentMention).length;
289
- var agentAnalytics = {
290
- agentCount: agentCount,
291
- agentSectioningEnabled: enableAgentSectioning
292
- };
293
-
294
289
  // The loading placeholder is a rendered-only row — keep it in
295
290
  // `mentionItems` so the shimmer shows, but exclude it from analytics
296
291
  // and no-results bookkeeping so it isn't counted as a real result.
297
292
  var realMentions = mentions.filter(function (mention) {
298
293
  return !isLoadingPlaceholder(mention);
299
294
  });
295
+ var agentCount = realMentions.filter(isAgentMention).length;
296
+ var agentAnalytics = {
297
+ agentCount: agentCount,
298
+ agentSectioningEnabled: enableAgentSectioning
299
+ };
300
300
  buildAndSendElementsTypeAheadAnalytics(fireEvent)({
301
301
  query: query,
302
302
  mentions: realMentions,
303
303
  stats: stats,
304
+ mentionTypeaheadSessionId: sessionId,
304
305
  agentAnalytics: agentAnalytics
305
306
  });
306
307
 
@@ -4,6 +4,7 @@ import { bind } from 'bind-event-listener';
4
4
  import uuid from 'uuid/v4';
5
5
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
6
6
  import { findChildrenByAttr } from '@atlaskit/editor-prosemirror/utils';
7
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
7
8
  import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
9
10
  import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
@@ -141,7 +142,7 @@ export const profileCardRenderer = ({
141
142
  const listenerCleanup = bind(dom, {
142
143
  type: 'click',
143
144
  listener: () => {
144
- if (fg('people-teams_migrate-user-profile-card')) {
145
+ if (fg('people-teams_migrate-user-profile-card') || isExperimentEnabled('pt_user_profile_card_migration_exp')) {
145
146
  var _currentNode$attrs, _node$attrs, _options$profilecardP;
146
147
  const userId = expVal('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? (_currentNode$attrs = currentNode.attrs) === null || _currentNode$attrs === void 0 ? void 0 : _currentNode$attrs.id : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.id;
147
148
  if (!userId) {
@@ -51,7 +51,7 @@ const AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
51
51
  const AGENT_MENTION_INACTIVITY_MS = 3000;
52
52
  const MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
53
53
  const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
54
- const PACKAGE_VERSION = "16.0.3";
54
+ const PACKAGE_VERSION = "16.1.1";
55
55
  const setProvider = provider => (state, dispatch) => {
56
56
  if (dispatch) {
57
57
  dispatch(state.tr.setMeta(mentionPluginKey, {
@@ -146,7 +146,7 @@ export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount
146
146
  }
147
147
  };
148
148
  };
149
- export const buildTypeAheadRenderedPayload = (duration, userIds, query, teams, xProductMentionsLength, agentAnalytics) => {
149
+ export const buildTypeAheadRenderedPayload = (duration, userIds, query, teams, xProductMentionsLength, mentionTypeaheadSessionId, agentAnalytics) => {
150
150
  const {
151
151
  queryLength,
152
152
  spaceInQuery
@@ -164,6 +164,7 @@ export const buildTypeAheadRenderedPayload = (duration, userIds, query, teams, x
164
164
  attributes: {
165
165
  componentName,
166
166
  duration,
167
+ mentionTypeaheadSessionId,
167
168
  userIds,
168
169
  teams,
169
170
  queryLength,
@@ -136,6 +136,7 @@ const buildAndSendElementsTypeAheadAnalytics = fireEvent => ({
136
136
  query,
137
137
  mentions,
138
138
  stats,
139
+ mentionTypeaheadSessionId,
139
140
  agentAnalytics
140
141
  }) => {
141
142
  let duration = 0;
@@ -162,7 +163,7 @@ const buildAndSendElementsTypeAheadAnalytics = fireEvent => ({
162
163
  memberCount: mention.context.memberCount
163
164
  } : null).filter(m => !!m);
164
165
  }
165
- const payload = buildTypeAheadRenderedPayload(duration, userOrTeamIds, query, teams, xProductMentionsLength, agentAnalytics);
166
+ const payload = buildTypeAheadRenderedPayload(duration, userOrTeamIds, query, teams, xProductMentionsLength, mentionTypeaheadSessionId, agentAnalytics);
166
167
  fireEvent(payload, 'fabric-elements');
167
168
  };
168
169
 
@@ -252,20 +253,20 @@ const makeTransformMentionsToTypeAheadItems = ({
252
253
  sessionId
253
254
  }) => {
254
255
  const mentionItems = mentions.map(mention => toItem(mention));
255
- const agentCount = mentions.filter(isAgentMention).length;
256
- const agentAnalytics = {
257
- agentCount,
258
- agentSectioningEnabled: enableAgentSectioning
259
- };
260
-
261
256
  // The loading placeholder is a rendered-only row — keep it in
262
257
  // `mentionItems` so the shimmer shows, but exclude it from analytics
263
258
  // and no-results bookkeeping so it isn't counted as a real result.
264
259
  const realMentions = mentions.filter(mention => !isLoadingPlaceholder(mention));
260
+ const agentCount = realMentions.filter(isAgentMention).length;
261
+ const agentAnalytics = {
262
+ agentCount,
263
+ agentSectioningEnabled: enableAgentSectioning
264
+ };
265
265
  buildAndSendElementsTypeAheadAnalytics(fireEvent)({
266
266
  query,
267
267
  mentions: realMentions,
268
268
  stats,
269
+ mentionTypeaheadSessionId: sessionId,
269
270
  agentAnalytics
270
271
  });
271
272
 
@@ -7,6 +7,7 @@ import { bind } from 'bind-event-listener';
7
7
  import uuid from 'uuid/v4';
8
8
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
9
9
  import { findChildrenByAttr } from '@atlaskit/editor-prosemirror/utils';
10
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
10
11
  import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
12
13
  import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
@@ -147,7 +148,7 @@ export var profileCardRenderer = function profileCardRenderer(_ref) {
147
148
  var listenerCleanup = bind(dom, {
148
149
  type: 'click',
149
150
  listener: function listener() {
150
- if (fg('people-teams_migrate-user-profile-card')) {
151
+ if (fg('people-teams_migrate-user-profile-card') || isExperimentEnabled('pt_user_profile_card_migration_exp')) {
151
152
  var _currentNode$attrs, _node$attrs, _options$profilecardP;
152
153
  var userId = expVal('platform_editor_reduced_agent_profile_cards', 'isEnabled', false) ? (_currentNode$attrs = currentNode.attrs) === null || _currentNode$attrs === void 0 ? void 0 : _currentNode$attrs.id : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.id;
153
154
  if (!userId) {
@@ -58,7 +58,7 @@ var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
58
58
  var AGENT_MENTION_INACTIVITY_MS = 3000;
59
59
  var MAX_PENDING_TYPED_AGENT_MENTION_FOCUS_DEFERS = 20;
60
60
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
61
- var PACKAGE_VERSION = "16.0.3";
61
+ var PACKAGE_VERSION = "16.1.1";
62
62
  var setProvider = function setProvider(provider) {
63
63
  return function (state, dispatch) {
64
64
  if (dispatch) {
@@ -146,7 +146,7 @@ export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayloa
146
146
  })
147
147
  };
148
148
  };
149
- export var buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams, xProductMentionsLength, agentAnalytics) {
149
+ export var buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams, xProductMentionsLength, mentionTypeaheadSessionId, agentAnalytics) {
150
150
  var _extractAttributesFro4 = extractAttributesFromQuery(query),
151
151
  queryLength = _extractAttributesFro4.queryLength,
152
152
  spaceInQuery = _extractAttributesFro4.spaceInQuery;
@@ -163,6 +163,7 @@ export var buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayloa
163
163
  attributes: _objectSpread({
164
164
  componentName: componentName,
165
165
  duration: duration,
166
+ mentionTypeaheadSessionId: mentionTypeaheadSessionId,
166
167
  userIds: userIds,
167
168
  teams: teams,
168
169
  queryLength: queryLength,
@@ -158,6 +158,7 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
158
158
  var query = _ref5.query,
159
159
  mentions = _ref5.mentions,
160
160
  stats = _ref5.stats,
161
+ mentionTypeaheadSessionId = _ref5.mentionTypeaheadSessionId,
161
162
  agentAnalytics = _ref5.agentAnalytics;
162
163
  var duration = 0;
163
164
  var userOrTeamIds = null;
@@ -191,7 +192,7 @@ var buildAndSendElementsTypeAheadAnalytics = function buildAndSendElementsTypeAh
191
192
  return !!m;
192
193
  });
193
194
  }
194
- var payload = buildTypeAheadRenderedPayload(duration, userOrTeamIds, query, teams, xProductMentionsLength, agentAnalytics);
195
+ var payload = buildTypeAheadRenderedPayload(duration, userOrTeamIds, query, teams, xProductMentionsLength, mentionTypeaheadSessionId, agentAnalytics);
195
196
  fireEvent(payload, 'fabric-elements');
196
197
  };
197
198
  };
@@ -276,22 +277,22 @@ var makeTransformMentionsToTypeAheadItems = function makeTransformMentionsToType
276
277
  var mentionItems = mentions.map(function (mention) {
277
278
  return toItem(mention);
278
279
  });
279
- var agentCount = mentions.filter(isAgentMention).length;
280
- var agentAnalytics = {
281
- agentCount: agentCount,
282
- agentSectioningEnabled: enableAgentSectioning
283
- };
284
-
285
280
  // The loading placeholder is a rendered-only row — keep it in
286
281
  // `mentionItems` so the shimmer shows, but exclude it from analytics
287
282
  // and no-results bookkeeping so it isn't counted as a real result.
288
283
  var realMentions = mentions.filter(function (mention) {
289
284
  return !isLoadingPlaceholder(mention);
290
285
  });
286
+ var agentCount = realMentions.filter(isAgentMention).length;
287
+ var agentAnalytics = {
288
+ agentCount: agentCount,
289
+ agentSectioningEnabled: enableAgentSectioning
290
+ };
291
291
  buildAndSendElementsTypeAheadAnalytics(fireEvent)({
292
292
  query: query,
293
293
  mentions: realMentions,
294
294
  stats: stats,
295
+ mentionTypeaheadSessionId: sessionId,
295
296
  agentAnalytics: agentAnalytics
296
297
  });
297
298
 
@@ -9,7 +9,7 @@ export declare const buildTypeAheadCancelPayload: (duration: number, upKeyCount:
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
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?: {
12
+ export declare const buildTypeAheadRenderedPayload: (duration: number, userIds: Array<string> | null, query: string, teams: TeamInfoAttrAnalytics[] | null, xProductMentionsLength: number, mentionTypeaheadSessionId: string, agentAnalytics?: {
13
13
  agentCount: number;
14
14
  agentSectioningEnabled: boolean;
15
15
  }) => AnalyticsEventPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "16.1.0",
3
+ "version": "16.1.2",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -56,7 +56,7 @@
56
56
  "uuid": "^3.1.0"
57
57
  },
58
58
  "peerDependencies": {
59
- "@atlaskit/editor-common": "^118.2.0",
59
+ "@atlaskit/editor-common": "^118.3.0",
60
60
  "react": "^18.2.0 || ^19.2.0",
61
61
  "react-dom": "^18.2.0 || ^19.2.0",
62
62
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"