@atlaskit/editor-plugin-mentions 13.3.15 → 14.0.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 +33 -0
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/ui/type-ahead/analytics.js +7 -4
- package/dist/cjs/ui/type-ahead/index.js +26 -15
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/ui/type-ahead/analytics.js +4 -1
- package/dist/es2019/ui/type-ahead/index.js +18 -11
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/ui/type-ahead/analytics.js +7 -4
- package/dist/esm/ui/type-ahead/index.js +26 -15
- package/dist/types/ui/type-ahead/analytics.d.ts +1 -1
- package/package.json +25 -33
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
2
|
|
|
3
|
+
## 14.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
8
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
9
|
+
|
|
10
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
11
|
+
|
|
12
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- "typesVersions": {
|
|
16
|
+
- ">=4.5 <4.9": {
|
|
17
|
+
- "*": [
|
|
18
|
+
- "dist/types-ts4.5/*",
|
|
19
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
20
|
+
- ]
|
|
21
|
+
- }
|
|
22
|
+
- },
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- [`78adaba64ee33`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/78adaba64ee33) -
|
|
28
|
+
Add opt-in section title display controls for typeahead sections
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- [`94670f6d5975b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/94670f6d5975b) -
|
|
33
|
+
Instrument agent mention analytics and proactive nudge experiment attribution.
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
|
|
3
36
|
## 13.3.15
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -32,7 +32,7 @@ var ACTIONS = exports.ACTIONS = {
|
|
|
32
32
|
var AGENT_USER_TYPES = new Set(['APP', 'AGENT']);
|
|
33
33
|
var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
34
34
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
35
|
-
var PACKAGE_VERSION = "13.3.
|
|
35
|
+
var PACKAGE_VERSION = "13.3.15";
|
|
36
36
|
var setProvider = function setProvider(provider) {
|
|
37
37
|
return function (state, dispatch) {
|
|
38
38
|
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) {
|
|
108
|
+
var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId, isAgent) {
|
|
109
109
|
var _extractAttributesFro3 = extractAttributesFromQuery(query),
|
|
110
110
|
queryLength = _extractAttributesFro3.queryLength,
|
|
111
111
|
spaceInQuery = _extractAttributesFro3.spaceInQuery;
|
|
@@ -124,7 +124,7 @@ var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = func
|
|
|
124
124
|
containerId: containerId,
|
|
125
125
|
objectId: objectId,
|
|
126
126
|
childObjectId: childObjectId,
|
|
127
|
-
attributes: {
|
|
127
|
+
attributes: _objectSpread(_objectSpread({
|
|
128
128
|
sessionId: sessionId,
|
|
129
129
|
duration: duration,
|
|
130
130
|
position: getPosition(mentionList, mention),
|
|
@@ -139,14 +139,17 @@ var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = func
|
|
|
139
139
|
upKeyCount: upKeyCount,
|
|
140
140
|
downKeyCount: downKeyCount,
|
|
141
141
|
memberCount: (0, _utils.isTeamType)(mention.userType) && mention.context ? mention.context.memberCount : null,
|
|
142
|
-
includesYou: (0, _utils.isTeamType)(mention.userType) && mention.context ? mention.context.includesYou : null
|
|
142
|
+
includesYou: (0, _utils.isTeamType)(mention.userType) && mention.context ? mention.context.includesYou : null
|
|
143
|
+
}, isAgent ? {
|
|
144
|
+
isAgent: isAgent
|
|
145
|
+
} : {}), {}, {
|
|
143
146
|
taskListId: taskListId,
|
|
144
147
|
taskItemId: taskItemId,
|
|
145
148
|
localId: mentionLocalId,
|
|
146
149
|
containerId: containerId,
|
|
147
150
|
objectId: objectId,
|
|
148
151
|
childObjectId: childObjectId
|
|
149
|
-
}
|
|
152
|
+
})
|
|
150
153
|
};
|
|
151
154
|
};
|
|
152
155
|
var buildTypeAheadRenderedPayload = exports.buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams, xProductMentionsLength) {
|
|
@@ -40,6 +40,9 @@ var isAgentUserType = function isAgentUserType(userType) {
|
|
|
40
40
|
var isAgentMention = function isAgentMention(mention) {
|
|
41
41
|
return isAgentUserType(mention.userType) || mention.appType === 'agent';
|
|
42
42
|
};
|
|
43
|
+
var isAgentTypeAheadItem = function isAgentTypeAheadItem(item) {
|
|
44
|
+
return item.mention ? isAgentMention(item.mention) : false;
|
|
45
|
+
};
|
|
43
46
|
var createInviteItem = function createInviteItem(_ref) {
|
|
44
47
|
var mentionProvider = _ref.mentionProvider,
|
|
45
48
|
onInviteItemMount = _ref.onInviteItemMount,
|
|
@@ -326,23 +329,31 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
326
329
|
},
|
|
327
330
|
getSections: function getSections(_ref9) {
|
|
328
331
|
var intl = _ref9.intl;
|
|
329
|
-
return [{
|
|
332
|
+
return [_objectSpread({
|
|
330
333
|
id: 'people',
|
|
331
334
|
title: intl.formatMessage(_messages.mentionMessages.typeAheadSectionPeople),
|
|
332
335
|
filter: function filter(item) {
|
|
333
|
-
|
|
334
|
-
return !isAgentUserType(((_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.userType) || '');
|
|
336
|
+
return !isAgentTypeAheadItem(item);
|
|
335
337
|
},
|
|
336
338
|
limit: (0, _expVal.expVal)('platform_editor_agent_mentions', 'isEnabled', false) ? 5 : 6
|
|
337
|
-
}, {
|
|
339
|
+
}, (0, _expVal.expVal)('platform_editor_agent_mentions', 'isEnabled', false) ? {
|
|
340
|
+
sectionTitleDisplay: {
|
|
341
|
+
showWhenQueryPresent: false,
|
|
342
|
+
showWhenOnlySection: true
|
|
343
|
+
}
|
|
344
|
+
} : {}), _objectSpread({
|
|
338
345
|
id: 'agents',
|
|
339
346
|
title: intl.formatMessage(_messages.mentionMessages.typeAheadSectionAgents),
|
|
340
347
|
filter: function filter(item) {
|
|
341
|
-
|
|
342
|
-
return isAgentUserType(((_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.userType) || '');
|
|
348
|
+
return isAgentTypeAheadItem(item);
|
|
343
349
|
},
|
|
344
350
|
limit: (0, _expVal.expVal)('platform_editor_agent_mentions', 'isEnabled', false) ? 5 : undefined
|
|
345
|
-
}
|
|
351
|
+
}, (0, _expVal.expVal)('platform_editor_agent_mentions', 'isEnabled', false) ? {
|
|
352
|
+
sectionTitleDisplay: {
|
|
353
|
+
showWhenQueryPresent: false,
|
|
354
|
+
showWhenOnlySection: true
|
|
355
|
+
}
|
|
356
|
+
} : {})];
|
|
346
357
|
},
|
|
347
358
|
onOpen: function onOpen() {
|
|
348
359
|
firstQueryWithoutResults = null;
|
|
@@ -356,13 +367,13 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
356
367
|
var schema = state.schema;
|
|
357
368
|
var pluginState = (0, _utils2.getMentionPluginState)(state);
|
|
358
369
|
var mentionProvider = pluginState.mentionProvider;
|
|
359
|
-
var _item$
|
|
360
|
-
id = _item$
|
|
361
|
-
name = _item$
|
|
362
|
-
nickname = _item$
|
|
363
|
-
accessLevel = _item$
|
|
364
|
-
userType = _item$
|
|
365
|
-
isXProductUser = _item$
|
|
370
|
+
var _item$mention = item.mention,
|
|
371
|
+
id = _item$mention.id,
|
|
372
|
+
name = _item$mention.name,
|
|
373
|
+
nickname = _item$mention.nickname,
|
|
374
|
+
accessLevel = _item$mention.accessLevel,
|
|
375
|
+
userType = _item$mention.userType,
|
|
376
|
+
isXProductUser = _item$mention.isXProductUser;
|
|
366
377
|
var _ref1 = (_api$contextIdentifie3 = api === null || api === void 0 || (_api$contextIdentifie4 = api.contextIdentifier) === null || _api$contextIdentifie4 === void 0 ? void 0 : _api$contextIdentifie4.sharedState.currentState()) !== null && _api$contextIdentifie3 !== void 0 ? _api$contextIdentifie3 : {},
|
|
367
378
|
contextIdentifierProvider = _ref1.contextIdentifierProvider;
|
|
368
379
|
var mentionContext = _objectSpread(_objectSpread({}, contextIdentifierProvider), {}, {
|
|
@@ -442,7 +453,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
442
453
|
}
|
|
443
454
|
fireEvent((0, _analytics.buildTypeAheadInsertedPayload)(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(function (x) {
|
|
444
455
|
return x.mention;
|
|
445
|
-
}), query, contextIdentifierProvider, taskListId, taskItemId));
|
|
456
|
+
}), query, contextIdentifierProvider, taskListId, taskItemId, shouldSuppressInviteForAgentMention));
|
|
446
457
|
|
|
447
458
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
448
459
|
sessionId = (0, _uuid.default)();
|
|
@@ -17,7 +17,7 @@ export const ACTIONS = {
|
|
|
17
17
|
const AGENT_USER_TYPES = new Set(['APP', 'AGENT']);
|
|
18
18
|
const AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
19
19
|
const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
20
|
-
const PACKAGE_VERSION = "13.3.
|
|
20
|
+
const PACKAGE_VERSION = "13.3.15";
|
|
21
21
|
const setProvider = provider => (state, dispatch) => {
|
|
22
22
|
if (dispatch) {
|
|
23
23
|
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) => {
|
|
100
|
+
export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId, isAgent) => {
|
|
101
101
|
const {
|
|
102
102
|
queryLength,
|
|
103
103
|
spaceInQuery
|
|
@@ -133,6 +133,9 @@ export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount
|
|
|
133
133
|
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
|
+
...(isAgent ? {
|
|
137
|
+
isAgent
|
|
138
|
+
} : {}),
|
|
136
139
|
taskListId,
|
|
137
140
|
taskItemId,
|
|
138
141
|
localId: mentionLocalId,
|
|
@@ -20,6 +20,7 @@ import { buildTypeAheadCancelPayload, buildTypeAheadInsertedPayload, buildTypeAh
|
|
|
20
20
|
import { isInviteItem, isTeamStats, isTeamType, shouldKeepInviteItem } from './utils';
|
|
21
21
|
const isAgentUserType = userType => userType === 'APP' || userType === 'AGENT';
|
|
22
22
|
const isAgentMention = mention => isAgentUserType(mention.userType) || mention.appType === 'agent';
|
|
23
|
+
const isAgentTypeAheadItem = item => item.mention ? isAgentMention(item.mention) : false;
|
|
23
24
|
const createInviteItem = ({
|
|
24
25
|
mentionProvider,
|
|
25
26
|
onInviteItemMount,
|
|
@@ -307,19 +308,25 @@ export const createTypeAheadConfig = ({
|
|
|
307
308
|
return [{
|
|
308
309
|
id: 'people',
|
|
309
310
|
title: intl.formatMessage(mentionMessages.typeAheadSectionPeople),
|
|
310
|
-
filter: item =>
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
311
|
+
filter: item => !isAgentTypeAheadItem(item),
|
|
312
|
+
limit: expVal('platform_editor_agent_mentions', 'isEnabled', false) ? 5 : 6,
|
|
313
|
+
...(expVal('platform_editor_agent_mentions', 'isEnabled', false) ? {
|
|
314
|
+
sectionTitleDisplay: {
|
|
315
|
+
showWhenQueryPresent: false,
|
|
316
|
+
showWhenOnlySection: true
|
|
317
|
+
}
|
|
318
|
+
} : {})
|
|
315
319
|
}, {
|
|
316
320
|
id: 'agents',
|
|
317
321
|
title: intl.formatMessage(mentionMessages.typeAheadSectionAgents),
|
|
318
|
-
filter: item =>
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
322
|
+
filter: item => isAgentTypeAheadItem(item),
|
|
323
|
+
limit: expVal('platform_editor_agent_mentions', 'isEnabled', false) ? 5 : undefined,
|
|
324
|
+
...(expVal('platform_editor_agent_mentions', 'isEnabled', false) ? {
|
|
325
|
+
sectionTitleDisplay: {
|
|
326
|
+
showWhenQueryPresent: false,
|
|
327
|
+
showWhenOnlySection: true
|
|
328
|
+
}
|
|
329
|
+
} : {})
|
|
323
330
|
}];
|
|
324
331
|
},
|
|
325
332
|
onOpen: () => {
|
|
@@ -430,7 +437,7 @@ export const createTypeAheadConfig = ({
|
|
|
430
437
|
handleMentionsChanged([mentionChange]);
|
|
431
438
|
}
|
|
432
439
|
}
|
|
433
|
-
fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(x => x.mention), query, contextIdentifierProvider, taskListId, taskItemId));
|
|
440
|
+
fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(x => x.mention), query, contextIdentifierProvider, taskListId, taskItemId, shouldSuppressInviteForAgentMention));
|
|
434
441
|
|
|
435
442
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
436
443
|
sessionId = uuid();
|
|
@@ -24,7 +24,7 @@ export var ACTIONS = {
|
|
|
24
24
|
var AGENT_USER_TYPES = new Set(['APP', 'AGENT']);
|
|
25
25
|
var AI_STREAMING_TRANSFORMATION_META_KEY = 'isAIStreamingTransformation';
|
|
26
26
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
27
|
-
var PACKAGE_VERSION = "13.3.
|
|
27
|
+
var PACKAGE_VERSION = "13.3.15";
|
|
28
28
|
var setProvider = function setProvider(provider) {
|
|
29
29
|
return function (state, dispatch) {
|
|
30
30
|
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) {
|
|
101
|
+
export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId, isAgent) {
|
|
102
102
|
var _extractAttributesFro3 = extractAttributesFromQuery(query),
|
|
103
103
|
queryLength = _extractAttributesFro3.queryLength,
|
|
104
104
|
spaceInQuery = _extractAttributesFro3.spaceInQuery;
|
|
@@ -117,7 +117,7 @@ export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayloa
|
|
|
117
117
|
containerId: containerId,
|
|
118
118
|
objectId: objectId,
|
|
119
119
|
childObjectId: childObjectId,
|
|
120
|
-
attributes: {
|
|
120
|
+
attributes: _objectSpread(_objectSpread({
|
|
121
121
|
sessionId: sessionId,
|
|
122
122
|
duration: duration,
|
|
123
123
|
position: getPosition(mentionList, mention),
|
|
@@ -132,14 +132,17 @@ export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayloa
|
|
|
132
132
|
upKeyCount: upKeyCount,
|
|
133
133
|
downKeyCount: downKeyCount,
|
|
134
134
|
memberCount: isTeamType(mention.userType) && mention.context ? mention.context.memberCount : null,
|
|
135
|
-
includesYou: isTeamType(mention.userType) && mention.context ? mention.context.includesYou : null
|
|
135
|
+
includesYou: isTeamType(mention.userType) && mention.context ? mention.context.includesYou : null
|
|
136
|
+
}, isAgent ? {
|
|
137
|
+
isAgent: isAgent
|
|
138
|
+
} : {}), {}, {
|
|
136
139
|
taskListId: taskListId,
|
|
137
140
|
taskItemId: taskItemId,
|
|
138
141
|
localId: mentionLocalId,
|
|
139
142
|
containerId: containerId,
|
|
140
143
|
objectId: objectId,
|
|
141
144
|
childObjectId: childObjectId
|
|
142
|
-
}
|
|
145
|
+
})
|
|
143
146
|
};
|
|
144
147
|
};
|
|
145
148
|
export var buildTypeAheadRenderedPayload = function buildTypeAheadRenderedPayload(duration, userIds, query, teams, xProductMentionsLength) {
|
|
@@ -31,6 +31,9 @@ var isAgentUserType = function isAgentUserType(userType) {
|
|
|
31
31
|
var isAgentMention = function isAgentMention(mention) {
|
|
32
32
|
return isAgentUserType(mention.userType) || mention.appType === 'agent';
|
|
33
33
|
};
|
|
34
|
+
var isAgentTypeAheadItem = function isAgentTypeAheadItem(item) {
|
|
35
|
+
return item.mention ? isAgentMention(item.mention) : false;
|
|
36
|
+
};
|
|
34
37
|
var createInviteItem = function createInviteItem(_ref) {
|
|
35
38
|
var mentionProvider = _ref.mentionProvider,
|
|
36
39
|
onInviteItemMount = _ref.onInviteItemMount,
|
|
@@ -317,23 +320,31 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
|
|
|
317
320
|
},
|
|
318
321
|
getSections: function getSections(_ref9) {
|
|
319
322
|
var intl = _ref9.intl;
|
|
320
|
-
return [{
|
|
323
|
+
return [_objectSpread({
|
|
321
324
|
id: 'people',
|
|
322
325
|
title: intl.formatMessage(mentionMessages.typeAheadSectionPeople),
|
|
323
326
|
filter: function filter(item) {
|
|
324
|
-
|
|
325
|
-
return !isAgentUserType(((_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.userType) || '');
|
|
327
|
+
return !isAgentTypeAheadItem(item);
|
|
326
328
|
},
|
|
327
329
|
limit: expVal('platform_editor_agent_mentions', 'isEnabled', false) ? 5 : 6
|
|
328
|
-
}, {
|
|
330
|
+
}, expVal('platform_editor_agent_mentions', 'isEnabled', false) ? {
|
|
331
|
+
sectionTitleDisplay: {
|
|
332
|
+
showWhenQueryPresent: false,
|
|
333
|
+
showWhenOnlySection: true
|
|
334
|
+
}
|
|
335
|
+
} : {}), _objectSpread({
|
|
329
336
|
id: 'agents',
|
|
330
337
|
title: intl.formatMessage(mentionMessages.typeAheadSectionAgents),
|
|
331
338
|
filter: function filter(item) {
|
|
332
|
-
|
|
333
|
-
return isAgentUserType(((_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.userType) || '');
|
|
339
|
+
return isAgentTypeAheadItem(item);
|
|
334
340
|
},
|
|
335
341
|
limit: expVal('platform_editor_agent_mentions', 'isEnabled', false) ? 5 : undefined
|
|
336
|
-
}
|
|
342
|
+
}, expVal('platform_editor_agent_mentions', 'isEnabled', false) ? {
|
|
343
|
+
sectionTitleDisplay: {
|
|
344
|
+
showWhenQueryPresent: false,
|
|
345
|
+
showWhenOnlySection: true
|
|
346
|
+
}
|
|
347
|
+
} : {})];
|
|
337
348
|
},
|
|
338
349
|
onOpen: function onOpen() {
|
|
339
350
|
firstQueryWithoutResults = null;
|
|
@@ -347,13 +358,13 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
|
|
|
347
358
|
var schema = state.schema;
|
|
348
359
|
var pluginState = getMentionPluginState(state);
|
|
349
360
|
var mentionProvider = pluginState.mentionProvider;
|
|
350
|
-
var _item$
|
|
351
|
-
id = _item$
|
|
352
|
-
name = _item$
|
|
353
|
-
nickname = _item$
|
|
354
|
-
accessLevel = _item$
|
|
355
|
-
userType = _item$
|
|
356
|
-
isXProductUser = _item$
|
|
361
|
+
var _item$mention = item.mention,
|
|
362
|
+
id = _item$mention.id,
|
|
363
|
+
name = _item$mention.name,
|
|
364
|
+
nickname = _item$mention.nickname,
|
|
365
|
+
accessLevel = _item$mention.accessLevel,
|
|
366
|
+
userType = _item$mention.userType,
|
|
367
|
+
isXProductUser = _item$mention.isXProductUser;
|
|
357
368
|
var _ref1 = (_api$contextIdentifie3 = api === null || api === void 0 || (_api$contextIdentifie4 = api.contextIdentifier) === null || _api$contextIdentifie4 === void 0 ? void 0 : _api$contextIdentifie4.sharedState.currentState()) !== null && _api$contextIdentifie3 !== void 0 ? _api$contextIdentifie3 : {},
|
|
358
369
|
contextIdentifierProvider = _ref1.contextIdentifierProvider;
|
|
359
370
|
var mentionContext = _objectSpread(_objectSpread({}, contextIdentifierProvider), {}, {
|
|
@@ -433,7 +444,7 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
|
|
|
433
444
|
}
|
|
434
445
|
fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(function (x) {
|
|
435
446
|
return x.mention;
|
|
436
|
-
}), query, contextIdentifierProvider, taskListId, taskItemId));
|
|
447
|
+
}), query, contextIdentifierProvider, taskListId, taskItemId, shouldSuppressInviteForAgentMention));
|
|
437
448
|
|
|
438
449
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
439
450
|
sessionId = uuid();
|
|
@@ -8,5 +8,5 @@ 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) => 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
12
|
export declare const buildTypeAheadRenderedPayload: (duration: number, userIds: Array<string> | null, query: string, teams: TeamInfoAttrAnalytics[] | null, xProductMentionsLength: number) => AnalyticsEventPayload;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-mentions",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -16,42 +16,34 @@
|
|
|
16
16
|
"module": "dist/esm/index.js",
|
|
17
17
|
"module:es2019": "dist/es2019/index.js",
|
|
18
18
|
"types": "dist/types/index.d.ts",
|
|
19
|
-
"typesVersions": {
|
|
20
|
-
">=4.5 <4.9": {
|
|
21
|
-
"*": [
|
|
22
|
-
"dist/types-ts4.5/*",
|
|
23
|
-
"dist/types-ts4.5/index.d.ts"
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
19
|
"sideEffects": [
|
|
28
20
|
"**/*.compiled.css"
|
|
29
21
|
],
|
|
30
22
|
"atlaskit:src": "src/index.ts",
|
|
31
23
|
"dependencies": {
|
|
32
|
-
"@atlaskit/adf-schema": "^
|
|
33
|
-
"@atlaskit/css": "^0.
|
|
34
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
35
|
-
"@atlaskit/editor-plugin-base": "^
|
|
36
|
-
"@atlaskit/editor-plugin-context-identifier": "^
|
|
37
|
-
"@atlaskit/editor-plugin-selection": "^
|
|
38
|
-
"@atlaskit/editor-plugin-type-ahead": "^
|
|
39
|
-
"@atlaskit/editor-prosemirror": "^
|
|
40
|
-
"@atlaskit/icon": "^
|
|
41
|
-
"@atlaskit/insm": "^0.
|
|
42
|
-
"@atlaskit/link": "^
|
|
43
|
-
"@atlaskit/mention": "^
|
|
44
|
-
"@atlaskit/platform-feature-flags": "^
|
|
45
|
-
"@atlaskit/popper": "^
|
|
46
|
-
"@atlaskit/portal": "^
|
|
47
|
-
"@atlaskit/primitives": "^
|
|
48
|
-
"@atlaskit/profilecard": "^
|
|
49
|
-
"@atlaskit/teams-app-config": "^
|
|
50
|
-
"@atlaskit/theme": "^
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
52
|
-
"@atlaskit/tokens": "^
|
|
53
|
-
"@atlaskit/tooltip": "^
|
|
54
|
-
"@atlaskit/user-picker": "^
|
|
24
|
+
"@atlaskit/adf-schema": "^55.0.0",
|
|
25
|
+
"@atlaskit/css": "^1.0.0",
|
|
26
|
+
"@atlaskit/editor-plugin-analytics": "^12.0.0",
|
|
27
|
+
"@atlaskit/editor-plugin-base": "^13.0.0",
|
|
28
|
+
"@atlaskit/editor-plugin-context-identifier": "^12.0.0",
|
|
29
|
+
"@atlaskit/editor-plugin-selection": "^12.0.0",
|
|
30
|
+
"@atlaskit/editor-plugin-type-ahead": "^12.0.0",
|
|
31
|
+
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
32
|
+
"@atlaskit/icon": "^36.0.0",
|
|
33
|
+
"@atlaskit/insm": "^1.0.0",
|
|
34
|
+
"@atlaskit/link": "^4.0.0",
|
|
35
|
+
"@atlaskit/mention": "^27.0.0",
|
|
36
|
+
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
37
|
+
"@atlaskit/popper": "^8.0.0",
|
|
38
|
+
"@atlaskit/portal": "^6.0.0",
|
|
39
|
+
"@atlaskit/primitives": "^20.0.0",
|
|
40
|
+
"@atlaskit/profilecard": "^26.0.0",
|
|
41
|
+
"@atlaskit/teams-app-config": "^2.0.0",
|
|
42
|
+
"@atlaskit/theme": "^26.0.0",
|
|
43
|
+
"@atlaskit/tmp-editor-statsig": "^104.0.0",
|
|
44
|
+
"@atlaskit/tokens": "^14.0.0",
|
|
45
|
+
"@atlaskit/tooltip": "^23.0.0",
|
|
46
|
+
"@atlaskit/user-picker": "^13.0.0",
|
|
55
47
|
"@babel/runtime": "^7.0.0",
|
|
56
48
|
"@compiled/react": "^0.20.0",
|
|
57
49
|
"bind-event-listener": "^3.0.0",
|
|
@@ -60,7 +52,7 @@
|
|
|
60
52
|
"uuid": "^3.1.0"
|
|
61
53
|
},
|
|
62
54
|
"peerDependencies": {
|
|
63
|
-
"@atlaskit/editor-common": "^
|
|
55
|
+
"@atlaskit/editor-common": "^116.0.0",
|
|
64
56
|
"react": "^18.2.0",
|
|
65
57
|
"react-dom": "^18.2.0",
|
|
66
58
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|