@atlaskit/editor-plugin-mentions 13.3.14 → 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 +39 -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/editor-commands/package.json +1 -8
- package/mentions-plugin/package.json +1 -8
- package/mentions-plugin-type/package.json +1 -8
- package/package.json +25 -33
- package/types/package.json +1 -8
- package/dist/types-ts4.5/editor-commands/index.d.ts +0 -33
- package/dist/types-ts4.5/entry-points/editor-commands.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/mentions-plugin-type.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/mentions-plugin.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -4
- package/dist/types-ts4.5/mentionsPlugin.d.ts +0 -3
- package/dist/types-ts4.5/mentionsPluginType.d.ts +0 -49
- package/dist/types-ts4.5/nodeviews/disabledTooltipRenderer.d.ts +0 -25
- package/dist/types-ts4.5/nodeviews/mentionNodeSpec.d.ts +0 -8
- package/dist/types-ts4.5/nodeviews/mentionNodeView.d.ts +0 -50
- package/dist/types-ts4.5/nodeviews/profileCardRenderer.d.ts +0 -15
- package/dist/types-ts4.5/pm-plugins/key.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -15
- package/dist/types-ts4.5/pm-plugins/mentionPlaceholder.d.ts +0 -11
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +0 -4
- package/dist/types-ts4.5/types/index.d.ts +0 -74
- package/dist/types-ts4.5/ui/InlineInviteRecaptchaContainer.d.ts +0 -15
- package/dist/types-ts4.5/ui/InviteItem/InviteItemWithEmailDomain.d.ts +0 -38
- package/dist/types-ts4.5/ui/InviteItem/index.d.ts +0 -27
- package/dist/types-ts4.5/ui/PopperWrapper.d.ts +0 -29
- package/dist/types-ts4.5/ui/ProfileCardComponent.d.ts +0 -26
- package/dist/types-ts4.5/ui/SecondaryToolbarComponent.d.ts +0 -12
- package/dist/types-ts4.5/ui/ToolbarMention/index.d.ts +0 -13
- package/dist/types-ts4.5/ui/type-ahead/analytics.d.ts +0 -12
- package/dist/types-ts4.5/ui/type-ahead/index.d.ts +0 -20
- package/dist/types-ts4.5/ui/type-ahead/utils.d.ts +0 -8
- package/dist/types-ts4.5/ui/useFocusTrap.d.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
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
|
+
|
|
36
|
+
## 13.3.15
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies
|
|
41
|
+
|
|
3
42
|
## 13.3.14
|
|
4
43
|
|
|
5
44
|
### 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;
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/editor-commands.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/editor-commands.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/editor-commands.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/mentions-plugin.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/mentions-plugin.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/mentions-plugin.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/mentions-plugin-type.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/mentions-plugin-type.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/mentions-plugin-type.d.ts"
|
|
17
10
|
}
|
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"
|
package/types/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
17
10
|
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI, EditorCommand } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { MentionProvider, MentionDescription } from '@atlaskit/mention/resource';
|
|
5
|
-
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
6
|
-
export type InsertMentionParameters = Pick<MentionDescription, 'name' | 'id' | 'userType' | 'isXProductUser' | 'nickname' | 'accessLevel'> & {
|
|
7
|
-
localId?: string;
|
|
8
|
-
/**
|
|
9
|
-
* The name is the name that will be displayed in the editor and stored in the ADF.
|
|
10
|
-
* If using "sanitizePrivateContent" with the mentions plugin, you can pass an empty
|
|
11
|
-
* name (ie. `name: ''`) to ensure the name is resolved by the mention provider (based
|
|
12
|
-
* on the id).
|
|
13
|
-
*
|
|
14
|
-
* !Warning: This is set without check if it matches the value in the mention provider, that
|
|
15
|
-
* must be done on the client side if using this.
|
|
16
|
-
*/
|
|
17
|
-
name: string;
|
|
18
|
-
};
|
|
19
|
-
type InternalParams = {
|
|
20
|
-
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
21
|
-
mentionInsertDisplayName: boolean;
|
|
22
|
-
sanitizePrivateContent: boolean;
|
|
23
|
-
};
|
|
24
|
-
type SingleMentionFragmentParams = {
|
|
25
|
-
mentionInsertDisplayName: boolean | undefined;
|
|
26
|
-
mentionProvider: MentionProvider | undefined;
|
|
27
|
-
sanitizePrivateContent: boolean | undefined;
|
|
28
|
-
suppressInviteXProductUser?: boolean;
|
|
29
|
-
tr: Transaction;
|
|
30
|
-
};
|
|
31
|
-
export declare const createSingleMentionFragment: ({ mentionInsertDisplayName, mentionProvider, tr, sanitizePrivateContent, suppressInviteXProductUser, }: SingleMentionFragmentParams) => ({ name, id, userType, nickname, localId, accessLevel, isXProductUser, }: InsertMentionParameters) => Fragment;
|
|
32
|
-
export declare const insertMention: ({ sanitizePrivateContent, api, mentionInsertDisplayName }: InternalParams) => ({ name, id, userType, localId, nickname, accessLevel, isXProductUser, }: InsertMentionParameters) => EditorCommand;
|
|
33
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { InsertMentionParameters } from '../editor-commands/index';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { MentionsPlugin, MentionPluginDependencies, MentionActions, } from '../mentionsPluginType';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { mentionsPlugin } from '../mentionsPlugin';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { MentionPluginConfig, MentionPluginOptions, MentionChange, MentionsPluginOptions, MentionSharedState, MentionsChangedHandler, } from '../types/index';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { mentionsPlugin } from './mentionsPlugin';
|
|
2
|
-
export type { MentionsPlugin, MentionPluginDependencies, MentionActions, } from './mentionsPluginType';
|
|
3
|
-
export type { MentionPluginConfig, MentionPluginOptions, MentionsPluginOptions, MentionSharedState, MentionsChangedHandler, } from './types';
|
|
4
|
-
export type { InsertMentionParameters } from './editor-commands';
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { NextEditorPlugin, OptionalPlugin, EditorCommand, TypeAheadSectionTitleUpdate } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
-
import type { BasePlugin } from '@atlaskit/editor-plugin-base';
|
|
4
|
-
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
5
|
-
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
6
|
-
import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
7
|
-
import type { MentionProvider } from '@atlaskit/mention/resource';
|
|
8
|
-
import type { InsertMentionParameters } from './editor-commands';
|
|
9
|
-
import type { MentionChange, MentionPluginOptions, MentionSharedState } from './types';
|
|
10
|
-
export type MentionActionOpenTypeAhead = (inputMethod: TypeAheadInputMethod) => boolean;
|
|
11
|
-
export type MentionActionAnnounceMentionsInsertion = (mentionIds: MentionChange[]) => void;
|
|
12
|
-
export type MentionActionSetProvider = (provider: Promise<MentionProvider>) => Promise<boolean>;
|
|
13
|
-
export type MentionActionUpdateSectionTitle = (props: TypeAheadSectionTitleUpdate) => boolean;
|
|
14
|
-
export type MentionActions = {
|
|
15
|
-
announceMentionsInsertion: MentionActionAnnounceMentionsInsertion;
|
|
16
|
-
openTypeAhead: MentionActionOpenTypeAhead;
|
|
17
|
-
setProvider: MentionActionSetProvider;
|
|
18
|
-
updateSectionTitle: MentionActionUpdateSectionTitle;
|
|
19
|
-
};
|
|
20
|
-
export type MentionPluginDependencies = [
|
|
21
|
-
OptionalPlugin<AnalyticsPlugin>,
|
|
22
|
-
TypeAheadPlugin,
|
|
23
|
-
OptionalPlugin<ContextIdentifierPlugin>,
|
|
24
|
-
OptionalPlugin<BasePlugin>,
|
|
25
|
-
OptionalPlugin<SelectionPlugin>
|
|
26
|
-
];
|
|
27
|
-
export type MentionsPlugin = NextEditorPlugin<'mention', {
|
|
28
|
-
actions: MentionActions;
|
|
29
|
-
commands: {
|
|
30
|
-
/**
|
|
31
|
-
* Inserts mention node into the document based on parameters.
|
|
32
|
-
*
|
|
33
|
-
* !Warning at this stage only inserts single mentions
|
|
34
|
-
*
|
|
35
|
-
* @param params.name string
|
|
36
|
-
* @param params.id string
|
|
37
|
-
* @param params.userType string (optional)
|
|
38
|
-
* @param params.nickname string (optional)
|
|
39
|
-
* @param params.localId string (optional)
|
|
40
|
-
* @param params.accessLevel string (optional)
|
|
41
|
-
* @param params.isXProductUser boolean (optional)
|
|
42
|
-
* @returns
|
|
43
|
-
*/
|
|
44
|
-
insertMention: (params: InsertMentionParameters) => EditorCommand;
|
|
45
|
-
};
|
|
46
|
-
dependencies: MentionPluginDependencies;
|
|
47
|
-
pluginConfiguration: MentionPluginOptions | undefined;
|
|
48
|
-
sharedState: MentionSharedState | undefined;
|
|
49
|
-
}>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
|
-
/**
|
|
3
|
-
* Anchors an ADS `<Tooltip>` to a ProseMirror chip element that is **not** a
|
|
4
|
-
* React child of the tooltip. The chip itself stays in the PM document; this
|
|
5
|
-
* renderer mounts an always-present React subtree via `portalProviderAPI` whose
|
|
6
|
-
* sole job is to host the tooltip and forward the ADS-provided trigger ref +
|
|
7
|
-
* event handlers onto the chip.
|
|
8
|
-
*
|
|
9
|
-
* The forwarding is deliberate: ADS `<Tooltip>` expects to attach its hover /
|
|
10
|
-
* focus / blur listeners to its render-prop child, but our render-prop child
|
|
11
|
-
* is a `display: none` placeholder span that no real event can reach. We bridge
|
|
12
|
-
* those listeners to the chip via `addEventListener` so the tooltip opens and
|
|
13
|
-
* closes in response to the user actually interacting with the chip — keyboard
|
|
14
|
-
* focus, mouse hover, screen-reader focus, the lot.
|
|
15
|
-
*/
|
|
16
|
-
export interface DisabledTooltipController {
|
|
17
|
-
/** Tear down the React subtree. */
|
|
18
|
-
destroy: () => void;
|
|
19
|
-
/** Update the tooltip text. Passing `undefined` hides the tooltip. */
|
|
20
|
-
setTooltip: (text: string | undefined) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare const disabledTooltipRenderer: ({ chipElement, portalProviderAPI, }: {
|
|
23
|
-
chipElement: HTMLElement;
|
|
24
|
-
portalProviderAPI: PortalProviderAPI;
|
|
25
|
-
}) => DisabledTooltipController;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { NodeSpec } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
/**
|
|
3
|
-
* Wrapper for ADF mention node spec to augment toDOM implementation
|
|
4
|
-
* with fallback UI for lazy node view rendering / window virtualization
|
|
5
|
-
* @nodeSpecException:toDOM patch
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare const mentionNodeSpec: () => NodeSpec;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
6
|
-
import type { MentionPluginOptions } from '../types';
|
|
7
|
-
interface MentionNodeViewProps {
|
|
8
|
-
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
9
|
-
options?: MentionPluginOptions;
|
|
10
|
-
portalProviderAPI: PortalProviderAPI;
|
|
11
|
-
}
|
|
12
|
-
export declare class MentionNodeView implements NodeView {
|
|
13
|
-
dom: Node;
|
|
14
|
-
domElement: HTMLElement | undefined;
|
|
15
|
-
contentDOM: HTMLElement | undefined;
|
|
16
|
-
private config;
|
|
17
|
-
private node;
|
|
18
|
-
private cleanup;
|
|
19
|
-
private destroyProfileCard;
|
|
20
|
-
private removeProfileCard;
|
|
21
|
-
private mentionPrimitiveElement;
|
|
22
|
-
private disabledTooltip;
|
|
23
|
-
private unsubscribeFromDisabledStateChanges;
|
|
24
|
-
private subscribedProvider;
|
|
25
|
-
constructor(node: PMNode, config: MentionNodeViewProps);
|
|
26
|
-
private setClassList;
|
|
27
|
-
private getDisabledState;
|
|
28
|
-
/**
|
|
29
|
-
* Subscribes this NodeView to disabled-state-change notifications on the
|
|
30
|
-
* supplied provider so already-rendered chips can re-evaluate themselves
|
|
31
|
-
* when the consumer's predicate inputs change (e.g. the active agent
|
|
32
|
-
* selection toggling in Rovo Chat). No-op for providers that don't
|
|
33
|
-
* implement `subscribeToDisabledStateChanges`.
|
|
34
|
-
*
|
|
35
|
-
* Idempotent: re-calling with the same provider keeps the existing
|
|
36
|
-
* subscription; passing a different provider tears the old subscription
|
|
37
|
-
* down before attaching the new one. Safe to call from the sharedState
|
|
38
|
-
* `onChange` handler when the editor swaps providers.
|
|
39
|
-
*/
|
|
40
|
-
private subscribeToProviderDisabledStateChanges;
|
|
41
|
-
private syncDisabledTooltip;
|
|
42
|
-
private setTextContent;
|
|
43
|
-
private shouldHighlightMention;
|
|
44
|
-
private updateState;
|
|
45
|
-
private nodeIsEqual;
|
|
46
|
-
update(node: PMNode): boolean;
|
|
47
|
-
destroy(): void;
|
|
48
|
-
deselectNode(): void;
|
|
49
|
-
}
|
|
50
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
5
|
-
import type { MentionPluginOptions } from '../types';
|
|
6
|
-
export declare const profileCardRenderer: ({ dom, options, portalProviderAPI, node, api, }: {
|
|
7
|
-
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
8
|
-
dom: Node;
|
|
9
|
-
node: PMNode;
|
|
10
|
-
options?: MentionPluginOptions;
|
|
11
|
-
portalProviderAPI: PortalProviderAPI;
|
|
12
|
-
}) => {
|
|
13
|
-
destroyProfileCard: () => void;
|
|
14
|
-
removeProfileCard: () => void;
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
4
|
-
import type { FireElementsChannelEvent, MentionPluginOptions, MentionPluginState } from '../types';
|
|
5
|
-
export declare const ACTIONS: {
|
|
6
|
-
SET_PROVIDER: string;
|
|
7
|
-
};
|
|
8
|
-
interface CreateMentionPlugin {
|
|
9
|
-
api?: ExtractInjectionAPI<MentionsPlugin>;
|
|
10
|
-
fireEvent: FireElementsChannelEvent;
|
|
11
|
-
options?: MentionPluginOptions;
|
|
12
|
-
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
13
|
-
}
|
|
14
|
-
export declare function createMentionPlugin({ pmPluginFactoryParams, fireEvent, options, api, }: CreateMentionPlugin): SafePlugin<MentionPluginState>;
|
|
15
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export declare const mentionPlaceholderPluginKey: PluginKey;
|
|
4
|
-
export declare const MENTION_PLACEHOLDER_ACTIONS: {
|
|
5
|
-
SHOW_PLACEHOLDER: string;
|
|
6
|
-
HIDE_PLACEHOLDER: string;
|
|
7
|
-
};
|
|
8
|
-
export type MentionPlaceholderPluginState = {
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare function createMentionPlaceholderPlugin(): SafePlugin<{}>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { MentionPluginState } from '../types';
|
|
3
|
-
export declare function getMentionPluginState(state: EditorState): MentionPluginState;
|
|
4
|
-
export declare const canMentionBeCreatedInRange: (from: number, to: number) => (state: EditorState) => boolean;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Providers, ProfilecardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { MentionDescription, MentionProvider } from '@atlaskit/mention';
|
|
5
|
-
export declare const MENTION_PROVIDER_REJECTED = "REJECTED";
|
|
6
|
-
export declare const MENTION_PROVIDER_UNDEFINED = "UNDEFINED";
|
|
7
|
-
export interface TeamInfoAttrAnalytics {
|
|
8
|
-
includesYou: boolean;
|
|
9
|
-
memberCount: number;
|
|
10
|
-
teamId: string;
|
|
11
|
-
}
|
|
12
|
-
export interface MentionPluginConfig {
|
|
13
|
-
HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
|
|
14
|
-
insertDisplayName?: boolean;
|
|
15
|
-
profilecardProvider?: Promise<ProfilecardProvider>;
|
|
16
|
-
}
|
|
17
|
-
export type MentionChange = {
|
|
18
|
-
id: string;
|
|
19
|
-
localId: string;
|
|
20
|
-
method?: 'pasted' | 'typed';
|
|
21
|
-
shouldSuppressMentionNotification?: boolean;
|
|
22
|
-
taskLocalId?: string;
|
|
23
|
-
type: 'added' | 'deleted';
|
|
24
|
-
};
|
|
25
|
-
export type MentionsChangedHandler = (changes: MentionChange[]) => void;
|
|
26
|
-
export interface MentionsPluginOptions extends MentionPluginConfig {
|
|
27
|
-
allowZeroWidthSpaceAfter?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* User ID to highlight as a self-mention (typically the current user).
|
|
30
|
-
*
|
|
31
|
-
* When provided, mentions matching this ID will be highlighted immediately,
|
|
32
|
-
* without waiting for the mention provider to load. This enables instant highlighting on initial render.
|
|
33
|
-
* Takes priority over `MentionProvider.shouldHighlightMention()` if both are present.
|
|
34
|
-
*/
|
|
35
|
-
currentUserId?: string;
|
|
36
|
-
handleMentionsChanged?: MentionsChangedHandler;
|
|
37
|
-
mentionProvider?: Providers['mentionProvider'];
|
|
38
|
-
sanitizePrivateContent?: boolean;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @private
|
|
42
|
-
* @deprecated Use {@link MentionsPluginOptions} instead.
|
|
43
|
-
* @see https://product-fabric.atlassian.net/browse/ED-27496
|
|
44
|
-
*/
|
|
45
|
-
export type MentionPluginOptions = MentionsPluginOptions;
|
|
46
|
-
export type MentionPluginState = {
|
|
47
|
-
canInsertMention?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Increments on each new agent mention insertion (including re-mentions of the same agent).
|
|
50
|
-
* Used to trigger re-renders when the same agent is mentioned again.
|
|
51
|
-
*/
|
|
52
|
-
lastAgentMentionInsertionCount?: number;
|
|
53
|
-
/**
|
|
54
|
-
* Plain-text content of the block node containing the agent mention.
|
|
55
|
-
* Used as a prompt context for Rovo chat.
|
|
56
|
-
*/
|
|
57
|
-
lastInsertedAgentMentionContext?: string | null;
|
|
58
|
-
/**
|
|
59
|
-
* The ID of the most recently inserted agent (APP | AGENT userType) mention.
|
|
60
|
-
* Null when no agent mention is present in the document.
|
|
61
|
-
*/
|
|
62
|
-
lastInsertedAgentMentionId?: string | null;
|
|
63
|
-
/**
|
|
64
|
-
* ProseMirror node type of the direct parent of the agent mention
|
|
65
|
-
* (e.g. 'taskItem', 'paragraph'). Determines auto-send vs. draft behaviour.
|
|
66
|
-
*/
|
|
67
|
-
lastInsertedAgentMentionParentNodeType?: string | null;
|
|
68
|
-
mentionProvider?: MentionProvider;
|
|
69
|
-
mentions?: Array<MentionDescription>;
|
|
70
|
-
};
|
|
71
|
-
export type FireElementsChannelEvent = (payload: AnalyticsEventPayload, channel?: string) => void;
|
|
72
|
-
export type MentionSharedState = MentionPluginState & {
|
|
73
|
-
typeAheadHandler: TypeAheadHandler;
|
|
74
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { MentionProvider } from '@atlaskit/mention/resource';
|
|
3
|
-
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
4
|
-
interface Props {
|
|
5
|
-
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
6
|
-
mentionProvider: Promise<MentionProvider> | undefined;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Container that renders the recaptcha component from the mention provider and manages handleSuccess.
|
|
10
|
-
* Does NOT pass email - the provider's component uses useInlineInviteRecaptcha hook internally
|
|
11
|
-
* and wires showRecaptcha to the provider. When user clicks invite item, type-ahead calls
|
|
12
|
-
* mentionProvider.showInlineInviteRecaptcha(email) which passes email to the component.
|
|
13
|
-
*/
|
|
14
|
-
export declare const InlineInviteRecaptchaContainer: ({ mentionProvider, api, }: Props) => JSX.Element | null;
|
|
15
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
* @jsxFrag React.Fragment
|
|
5
|
-
*/
|
|
6
|
-
import type { SyntheticEvent } from 'react';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
9
|
-
import type { UserRole } from '@atlaskit/mention';
|
|
10
|
-
import type { MentionDescription } from '@atlaskit/mention/resource';
|
|
11
|
-
/**
|
|
12
|
-
* Truncates an email-like string to fit within a max length by inserting an
|
|
13
|
-
* ellipsis into the middle of the local part (before the @).
|
|
14
|
-
*
|
|
15
|
-
* Preserves the full `@domain` suffix so users can always see
|
|
16
|
-
* which domain the invite targets.
|
|
17
|
-
*/
|
|
18
|
-
export declare const truncateInviteOption: (value: string, maxLength?: number) => string;
|
|
19
|
-
interface OnMentionEvent {
|
|
20
|
-
(mention: MentionDescription, event?: SyntheticEvent<any>): void;
|
|
21
|
-
}
|
|
22
|
-
export declare const INVITE_ITEM_DESCRIPTION: {
|
|
23
|
-
id: string;
|
|
24
|
-
};
|
|
25
|
-
interface Props {
|
|
26
|
-
emailDomain?: string;
|
|
27
|
-
onMount?: () => void;
|
|
28
|
-
onMouseEnter?: OnMentionEvent;
|
|
29
|
-
onSelection?: OnMentionEvent;
|
|
30
|
-
productName?: string;
|
|
31
|
-
query?: string;
|
|
32
|
-
selected?: boolean;
|
|
33
|
-
userRole?: UserRole;
|
|
34
|
-
}
|
|
35
|
-
declare const _default_1: React.FC<WithIntlProps<Props & WrappedComponentProps>> & {
|
|
36
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
37
|
-
};
|
|
38
|
-
export default _default_1;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import type { SyntheticEvent } from 'react';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
8
|
-
import type { UserRole } from '@atlaskit/mention';
|
|
9
|
-
import type { MentionDescription } from '@atlaskit/mention/resource';
|
|
10
|
-
interface OnMentionEvent {
|
|
11
|
-
(mention: MentionDescription, event?: SyntheticEvent<any>): void;
|
|
12
|
-
}
|
|
13
|
-
export declare const INVITE_ITEM_DESCRIPTION: {
|
|
14
|
-
id: string;
|
|
15
|
-
};
|
|
16
|
-
interface Props {
|
|
17
|
-
onMount?: () => void;
|
|
18
|
-
onMouseEnter?: OnMentionEvent;
|
|
19
|
-
onSelection?: OnMentionEvent;
|
|
20
|
-
productName?: string;
|
|
21
|
-
selected?: boolean;
|
|
22
|
-
userRole?: UserRole;
|
|
23
|
-
}
|
|
24
|
-
declare const _default_1: React.FC<WithIntlProps<Props & WrappedComponentProps>> & {
|
|
25
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
26
|
-
};
|
|
27
|
-
export default _default_1;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PropsWithChildren } from 'react';
|
|
3
|
-
import type { PopperChildrenProps } from '@atlaskit/popper';
|
|
4
|
-
interface Props {
|
|
5
|
-
/**
|
|
6
|
-
* Returns the element to be positioned.
|
|
7
|
-
*/
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* Replacement reference element to position popper relative to.
|
|
11
|
-
*/
|
|
12
|
-
referenceElement: HTMLElement;
|
|
13
|
-
}
|
|
14
|
-
export declare const RepositionOnUpdate: ({ children, update, }: PropsWithChildren<{
|
|
15
|
-
update: PopperChildrenProps["update"];
|
|
16
|
-
}>) => React.ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* A popup wrapper to match the behaviour of `@atlaskit/popup`
|
|
19
|
-
*
|
|
20
|
-
* Why not `@atlaskit/popup` directly? It requires a trigger element.
|
|
21
|
-
* We can use this when we have a direct reference to the element
|
|
22
|
-
* and it is more convenient to work directly with the lower level API.
|
|
23
|
-
*
|
|
24
|
-
* @param referenceElement HTMLElement - Replacement reference element to position popper relative to.
|
|
25
|
-
* @param children React.ReactNode - Returns the element to be positioned.
|
|
26
|
-
* @returns React popper component
|
|
27
|
-
*/
|
|
28
|
-
export declare function Popup({ referenceElement, children }: Props): React.JSX.Element;
|
|
29
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ProfilecardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { ProfileCardClientData, TeamCentralReportingLinesData } from '@atlaskit/profilecard/types';
|
|
4
|
-
interface ProfileCardStateProps {
|
|
5
|
-
id: string | undefined;
|
|
6
|
-
provider: ProfilecardProvider | undefined;
|
|
7
|
-
}
|
|
8
|
-
export declare const isAgentMentionType: (userType: unknown) => boolean;
|
|
9
|
-
export declare const useProfileCardState: ({ id, provider, }: ProfileCardStateProps) => {
|
|
10
|
-
data: ProfileCardClientData | undefined;
|
|
11
|
-
hasError: boolean;
|
|
12
|
-
isLoading: boolean;
|
|
13
|
-
reportingLinesData: TeamCentralReportingLinesData | undefined;
|
|
14
|
-
shouldShowGiveKudos: boolean;
|
|
15
|
-
teamCentralBaseUrl: string | undefined;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Renders the profile card popup for an editor mention node.
|
|
19
|
-
*/
|
|
20
|
-
export declare function ProfileCardComponent({ profilecardProvider, activeMention, dom, closeComponent, }: {
|
|
21
|
-
activeMention: PMNode;
|
|
22
|
-
closeComponent: () => void;
|
|
23
|
-
dom: HTMLElement;
|
|
24
|
-
profilecardProvider?: Promise<ProfilecardProvider> | undefined;
|
|
25
|
-
}): JSX.Element;
|
|
26
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI, TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
5
|
-
interface SecondaryToolbarComponentProps {
|
|
6
|
-
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
editorView: EditorView;
|
|
9
|
-
typeAhead: TypeAheadHandler;
|
|
10
|
-
}
|
|
11
|
-
export declare function SecondaryToolbarComponent({ editorView, api, typeAhead, disabled, }: SecondaryToolbarComponentProps): React.JSX.Element | null;
|
|
12
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
interface Props {
|
|
5
|
-
editorView?: EditorView;
|
|
6
|
-
isDisabled?: boolean;
|
|
7
|
-
onInsertMention: () => void;
|
|
8
|
-
testId?: string;
|
|
9
|
-
}
|
|
10
|
-
declare const _default_1: React.FC<WithIntlProps<Props & WrappedComponentProps>> & {
|
|
11
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
12
|
-
};
|
|
13
|
-
export default _default_1;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
4
|
-
import type { UserRole } from '@atlaskit/mention';
|
|
5
|
-
import type { MentionDescription } from '@atlaskit/mention/resource';
|
|
6
|
-
import type { TeamInfoAttrAnalytics } from '../../types';
|
|
7
|
-
export declare const MENTION_SOURCE = "mentionInEditor";
|
|
8
|
-
export declare const buildTypeAheadCancelPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, query?: string) => AnalyticsEventPayload;
|
|
9
|
-
export declare const buildTypeAheadInviteItemViewedPayload: (sessionId: string, contextIdentifierProvider?: ContextIdentifierProvider, userRole?: UserRole, additionalAttributes?: Record<string, unknown>) => AnalyticsEventPayload;
|
|
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;
|
|
12
|
-
export declare const buildTypeAheadRenderedPayload: (duration: number, userIds: Array<string> | null, query: string, teams: TeamInfoAttrAnalytics[] | null, xProductMentionsLength: number) => AnalyticsEventPayload;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI, TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { MentionDescription } from '@atlaskit/mention/resource';
|
|
4
|
-
import type { MentionsPlugin } from '../../mentionsPluginType';
|
|
5
|
-
import type { FireElementsChannelEvent, MentionChange } from '../../types';
|
|
6
|
-
export declare const mentionToTypeaheadItem: (mention: MentionDescription) => TypeAheadItem;
|
|
7
|
-
export declare function memoize<ResultFn extends (mention: MentionDescription) => TypeAheadItem>(fn: ResultFn): {
|
|
8
|
-
call: ResultFn;
|
|
9
|
-
clear(): void;
|
|
10
|
-
};
|
|
11
|
-
type Props = {
|
|
12
|
-
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
13
|
-
fireEvent: FireElementsChannelEvent;
|
|
14
|
-
handleMentionsChanged?: (mentionChanges: MentionChange[]) => void;
|
|
15
|
-
HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
|
|
16
|
-
mentionInsertDisplayName?: boolean;
|
|
17
|
-
sanitizePrivateContent?: boolean;
|
|
18
|
-
};
|
|
19
|
-
export declare const createTypeAheadConfig: ({ sanitizePrivateContent, mentionInsertDisplayName, fireEvent, HighlightComponent, api, handleMentionsChanged, }: Props) => TypeAheadHandler;
|
|
20
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { MentionDescription } from '@atlaskit/mention';
|
|
2
|
-
export declare const isTeamType: (userType: any) => boolean;
|
|
3
|
-
export declare const isTeamStats: (stat: any) => boolean;
|
|
4
|
-
export declare const isInviteItem: (mention: MentionDescription) => boolean;
|
|
5
|
-
/**
|
|
6
|
-
* Actions
|
|
7
|
-
*/
|
|
8
|
-
export declare const shouldKeepInviteItem: (query: string, firstQueryWithoutResults: string) => boolean;
|