@atlaskit/mention 22.1.1 → 22.1.3
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 +12 -0
- package/compass.yml +43 -0
- package/dist/cjs/i18n/en_ZZ.js +1 -4
- package/dist/cjs/util/analytics.js +10 -9
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/i18n/en_ZZ.js +1 -4
- package/dist/es2019/util/analytics.js +2 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/i18n/en_ZZ.js +1 -4
- package/dist/esm/util/analytics.js +2 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/i18n/en_ZZ.d.ts +0 -4
- package/dist/types-ts4.5/_constants.d.ts +1 -0
- package/dist/types-ts4.5/api/ContextMentionResource.d.ts +23 -0
- package/dist/types-ts4.5/api/MentionNameClient.d.ts +11 -0
- package/dist/types-ts4.5/api/MentionNameResolver.d.ts +23 -0
- package/dist/types-ts4.5/api/MentionResource.d.ts +93 -0
- package/dist/types-ts4.5/api/PresenceResource.d.ts +119 -0
- package/dist/types-ts4.5/api/TeamMentionResource.d.ts +33 -0
- package/dist/types-ts4.5/api/analytics.d.ts +17 -0
- package/dist/types-ts4.5/components/LockCircleIcon/index.d.ts +3 -0
- package/dist/types-ts4.5/components/Mention/PrimitiveMention.d.ts +7 -0
- package/dist/types-ts4.5/components/Mention/ResourcedMention.d.ts +27 -0
- package/dist/types-ts4.5/components/Mention/index.d.ts +31 -0
- package/dist/types-ts4.5/components/Mention/ufoExperiences.d.ts +9 -0
- package/dist/types-ts4.5/components/MentionDescriptionByline/TeamMentionDescriptionByline.d.ts +7 -0
- package/dist/types-ts4.5/components/MentionDescriptionByline/UserMentionDescriptionByline.d.ts +5 -0
- package/dist/types-ts4.5/components/MentionDescriptionByline/index.d.ts +5 -0
- package/dist/types-ts4.5/components/MentionDescriptionByline/styles.d.ts +5 -0
- package/dist/types-ts4.5/components/MentionDescriptionByline/types.d.ts +4 -0
- package/dist/types-ts4.5/components/MentionItem/MentionHighlightHelpers.d.ts +3 -0
- package/dist/types-ts4.5/components/MentionItem/index.d.ts +16 -0
- package/dist/types-ts4.5/components/MentionItem/styles.d.ts +46 -0
- package/dist/types-ts4.5/components/MentionList/index.d.ts +41 -0
- package/dist/types-ts4.5/components/MentionList/styles.d.ts +8 -0
- package/dist/types-ts4.5/components/MentionListError/GenericErrorIllustration.d.ts +7 -0
- package/dist/types-ts4.5/components/MentionListError/index.d.ts +13 -0
- package/dist/types-ts4.5/components/MentionListError/styles.d.ts +17 -0
- package/dist/types-ts4.5/components/MentionPicker/index.d.ts +77 -0
- package/dist/types-ts4.5/components/MentionPicker/styles.d.ts +12 -0
- package/dist/types-ts4.5/components/MessagesIntlProvider/index.d.ts +3 -0
- package/dist/types-ts4.5/components/NoAccessTooltip/index.d.ts +6 -0
- package/dist/types-ts4.5/components/NoAccessTooltip/main.d.ts +7 -0
- package/dist/types-ts4.5/components/Popup/index.d.ts +26 -0
- package/dist/types-ts4.5/components/ResourcedMentionList/index.d.ts +46 -0
- package/dist/types-ts4.5/components/Scrollable/index.d.ts +11 -0
- package/dist/types-ts4.5/components/Scrollable/styles.d.ts +5 -0
- package/dist/types-ts4.5/components/i18n.d.ts +57 -0
- package/dist/types-ts4.5/config/index.d.ts +5 -0
- package/dist/types-ts4.5/element.d.ts +3 -0
- package/dist/types-ts4.5/i18n/cs.d.ts +20 -0
- package/dist/types-ts4.5/i18n/da.d.ts +20 -0
- package/dist/types-ts4.5/i18n/de.d.ts +20 -0
- package/dist/types-ts4.5/i18n/en.d.ts +20 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +20 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +20 -0
- package/dist/types-ts4.5/i18n/es.d.ts +20 -0
- package/dist/types-ts4.5/i18n/et.d.ts +20 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +20 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +20 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +20 -0
- package/dist/types-ts4.5/i18n/index.d.ts +35 -0
- package/dist/types-ts4.5/i18n/is.d.ts +24 -0
- package/dist/types-ts4.5/i18n/it.d.ts +20 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +20 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +20 -0
- package/dist/types-ts4.5/i18n/languages.d.ts +33 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +20 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +20 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +20 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +20 -0
- package/dist/types-ts4.5/i18n/pt_PT.d.ts +20 -0
- package/dist/types-ts4.5/i18n/ro.d.ts +24 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +20 -0
- package/dist/types-ts4.5/i18n/sk.d.ts +20 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +20 -0
- package/dist/types-ts4.5/i18n/th.d.ts +20 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +20 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +20 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +20 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +20 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +20 -0
- package/dist/types-ts4.5/i18n.d.ts +1 -0
- package/dist/types-ts4.5/index.d.ts +17 -0
- package/dist/types-ts4.5/item.d.ts +2 -0
- package/dist/types-ts4.5/resource.d.ts +10 -0
- package/dist/types-ts4.5/shared-styles.d.ts +5 -0
- package/dist/types-ts4.5/team-resource.d.ts +8 -0
- package/dist/types-ts4.5/typeahead.d.ts +3 -0
- package/dist/types-ts4.5/types.d.ts +168 -0
- package/dist/types-ts4.5/util/analytics.d.ts +30 -0
- package/dist/types-ts4.5/util/i18n.d.ts +29 -0
- package/dist/types-ts4.5/util/id.d.ts +2 -0
- package/dist/types-ts4.5/util/index.d.ts +1 -0
- package/dist/types-ts4.5/util/logger.d.ts +4 -0
- package/dist/types-ts4.5/util/mouse.d.ts +8 -0
- package/package.json +4 -9
- package/report.api.md +6 -6
- package/tmp/api-report-tmp.d.ts +818 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/mention
|
|
2
2
|
|
|
3
|
+
## 22.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f01deb5e6ab`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f01deb5e6ab) - Use injected env vars instead of version.json
|
|
8
|
+
|
|
9
|
+
## 22.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
14
|
+
|
|
3
15
|
## 22.1.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/compass.yml
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: Mention Picker
|
|
2
|
+
id: 'ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/51ba2b73-b329-481e-a904-9ec3fb9b8ae2'
|
|
3
|
+
description: A React component used to display user profiles in a list for 'Mention' functionality
|
|
4
|
+
configVersion: 1
|
|
5
|
+
typeId: UI_ELEMENT
|
|
6
|
+
ownerId: 'ari:cloud:teams::team/8c518cea-39e4-4a9e-976b-2eec1db07eb2'
|
|
7
|
+
fields:
|
|
8
|
+
tier: 2
|
|
9
|
+
links:
|
|
10
|
+
- name: null
|
|
11
|
+
type: REPOSITORY
|
|
12
|
+
url: 'https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/elements/mention/'
|
|
13
|
+
- name: ''
|
|
14
|
+
type: DASHBOARD
|
|
15
|
+
url: 'https://atlassian.signalfx.com/#/dashboard/D8fcwRTA4AA?groupId=D8fcwEEA0AA&configId=D8fcwSbAwAA'
|
|
16
|
+
- name: ''
|
|
17
|
+
type: ON_CALL
|
|
18
|
+
url: 'https://atlassian.app.opsgenie.com/settings/schedule/detail/24075951-e992-4184-a5e4-ba89245072f9'
|
|
19
|
+
- name: '#help-search'
|
|
20
|
+
type: CHAT_CHANNEL
|
|
21
|
+
url: 'https://atlassian.slack.com/app_redirect?channel=help-search'
|
|
22
|
+
- name: ''
|
|
23
|
+
type: PROJECT
|
|
24
|
+
url: 'https://product-fabric.atlassian.net/jira/software/c/projects/SP/boards/684'
|
|
25
|
+
- name: ''
|
|
26
|
+
type: DOCUMENT
|
|
27
|
+
url: 'https://hello.atlassian.net/wiki/spaces/SEARCH/overview'
|
|
28
|
+
relationships: {}
|
|
29
|
+
labels:
|
|
30
|
+
- atlassian-platform
|
|
31
|
+
customFields:
|
|
32
|
+
- name: Dev Owner
|
|
33
|
+
type: user
|
|
34
|
+
value: null
|
|
35
|
+
- name: Product
|
|
36
|
+
type: text
|
|
37
|
+
value: null
|
|
38
|
+
- name: Test
|
|
39
|
+
type: text
|
|
40
|
+
value: null
|
|
41
|
+
|
|
42
|
+
# Learn more about formatting compass.yml:
|
|
43
|
+
# https://go.atlassian.com/compass-yml-format
|
package/dist/cjs/i18n/en_ZZ.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
/* prettier-ignore */
|
|
7
8
|
/**
|
|
8
9
|
* NOTE:
|
|
9
10
|
*
|
|
@@ -12,14 +13,10 @@ exports.default = void 0;
|
|
|
12
13
|
*/
|
|
13
14
|
//
|
|
14
15
|
var _default = {
|
|
15
|
-
'fabric.elements.mentions.team.meantion.highlight.close.button.tooltip': 'Dismiss',
|
|
16
16
|
'fabric.elements.mentions.team.member.50plus': 'Team • 50+ members',
|
|
17
17
|
'fabric.elements.mentions.team.member.50plus.including.you': 'Team • 50+ members, including you',
|
|
18
18
|
'fabric.elements.mentions.team.member.count': '{0, plural, one {Team • 1 member} other {Team • {0} members}}',
|
|
19
19
|
'fabric.elements.mentions.team.member.count.including.you': '{0, plural, one {Team • 1 member, including you} other {Team • {0} members, including you}}',
|
|
20
|
-
'fabric.elements.mentions.team.mention.highlight.description': 'Get everyone on the page with one click. No team?',
|
|
21
|
-
'fabric.elements.mentions.team.mention.highlight.description.link': 'Start one.',
|
|
22
|
-
'fabric.elements.mentions.team.mention.highlight.title': 'Mention your team',
|
|
23
20
|
'fabric.mention.error.defaultAction': 'Try again in a few seconds',
|
|
24
21
|
'fabric.mention.error.defaultHeadline': 'Something went wrong',
|
|
25
22
|
'fabric.mention.error.differentText': 'Try entering different text',
|
|
@@ -8,10 +8,11 @@ exports.fireSliAnalyticsEvent = exports.fireAnalyticsMentionTypeaheadEvent = exp
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _analyticsGasTypes = require("@atlaskit/analytics-gas-types");
|
|
10
10
|
var _constants = require("../_constants");
|
|
11
|
-
var _version = require("../version.json");
|
|
12
11
|
var _types = require("../types");
|
|
13
12
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
|
+
var packageName = "@atlaskit/mention";
|
|
15
|
+
var packageVersion = "22.1.3";
|
|
15
16
|
var SLI_EVENT_TYPE = 'sli';
|
|
16
17
|
exports.SLI_EVENT_TYPE = SLI_EVENT_TYPE;
|
|
17
18
|
var SMART_EVENT_TYPE = 'smart';
|
|
@@ -49,8 +50,8 @@ var fireAnalyticsMentionTypeaheadEvent = function fireAnalyticsMentionTypeaheadE
|
|
|
49
50
|
action: action,
|
|
50
51
|
actionSubject: ComponentNames.TYPEAHEAD,
|
|
51
52
|
attributes: {
|
|
52
|
-
packageName:
|
|
53
|
-
packageVersion:
|
|
53
|
+
packageName: packageName,
|
|
54
|
+
packageVersion: packageVersion,
|
|
54
55
|
componentName: ComponentNames.MENTION,
|
|
55
56
|
duration: Math.round(duration),
|
|
56
57
|
userIds: userIds,
|
|
@@ -71,8 +72,8 @@ var fireAnalyticsMentionEvent = function fireAnalyticsMentionEvent(createEvent)
|
|
|
71
72
|
actionSubject: actionSubject,
|
|
72
73
|
eventType: _analyticsGasTypes.UI_EVENT_TYPE,
|
|
73
74
|
attributes: {
|
|
74
|
-
packageName:
|
|
75
|
-
packageVersion:
|
|
75
|
+
packageName: packageName,
|
|
76
|
+
packageVersion: packageVersion,
|
|
76
77
|
componentName: ComponentNames.MENTION,
|
|
77
78
|
accessLevel: accessLevel,
|
|
78
79
|
isSpecial: (0, _types.isSpecialMentionText)(text),
|
|
@@ -100,8 +101,8 @@ var buildSliPayload = function buildSliPayload(actionSubject, action, attributes
|
|
|
100
101
|
actionSubject: actionSubject,
|
|
101
102
|
eventType: _analyticsGasTypes.OPERATIONAL_EVENT_TYPE,
|
|
102
103
|
attributes: _objectSpread({
|
|
103
|
-
packageName:
|
|
104
|
-
packageVersion:
|
|
104
|
+
packageName: packageName,
|
|
105
|
+
packageVersion: packageVersion,
|
|
105
106
|
componentName: ComponentNames.MENTION
|
|
106
107
|
}, attributes)
|
|
107
108
|
};
|
|
@@ -116,8 +117,8 @@ var fireAnalyticsMentionHydrationEvent = function fireAnalyticsMentionHydrationE
|
|
|
116
117
|
actionSubject: ComponentNames.MENTION,
|
|
117
118
|
actionSubjectId: 'hydration',
|
|
118
119
|
attributes: {
|
|
119
|
-
packageName:
|
|
120
|
-
packageVersion:
|
|
120
|
+
packageName: packageName,
|
|
121
|
+
packageVersion: packageVersion,
|
|
121
122
|
componentName: ComponentNames.MENTION,
|
|
122
123
|
userId: userId,
|
|
123
124
|
fromCache: fromCache,
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* prettier-ignore */
|
|
1
2
|
/**
|
|
2
3
|
* NOTE:
|
|
3
4
|
*
|
|
@@ -6,14 +7,10 @@
|
|
|
6
7
|
*/
|
|
7
8
|
//
|
|
8
9
|
export default {
|
|
9
|
-
'fabric.elements.mentions.team.meantion.highlight.close.button.tooltip': 'Dismiss',
|
|
10
10
|
'fabric.elements.mentions.team.member.50plus': 'Team • 50+ members',
|
|
11
11
|
'fabric.elements.mentions.team.member.50plus.including.you': 'Team • 50+ members, including you',
|
|
12
12
|
'fabric.elements.mentions.team.member.count': '{0, plural, one {Team • 1 member} other {Team • {0} members}}',
|
|
13
13
|
'fabric.elements.mentions.team.member.count.including.you': '{0, plural, one {Team • 1 member, including you} other {Team • {0} members, including you}}',
|
|
14
|
-
'fabric.elements.mentions.team.mention.highlight.description': 'Get everyone on the page with one click. No team?',
|
|
15
|
-
'fabric.elements.mentions.team.mention.highlight.description.link': 'Start one.',
|
|
16
|
-
'fabric.elements.mentions.team.mention.highlight.title': 'Mention your team',
|
|
17
14
|
'fabric.mention.error.defaultAction': 'Try again in a few seconds',
|
|
18
15
|
'fabric.mention.error.defaultHeadline': 'Something went wrong',
|
|
19
16
|
'fabric.mention.error.differentText': 'Try entering different text',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
|
|
2
2
|
import { ELEMENTS_CHANNEL } from '../_constants';
|
|
3
|
-
import { name as packageName, version as packageVersion } from '../version.json';
|
|
4
3
|
import { isSpecialMentionText } from '../types';
|
|
4
|
+
const packageName = "@atlaskit/mention";
|
|
5
|
+
const packageVersion = "22.1.3";
|
|
5
6
|
export const SLI_EVENT_TYPE = 'sli';
|
|
6
7
|
export const SMART_EVENT_TYPE = 'smart';
|
|
7
8
|
export let SliNames = /*#__PURE__*/function (SliNames) {
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/i18n/en_ZZ.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* prettier-ignore */
|
|
1
2
|
/**
|
|
2
3
|
* NOTE:
|
|
3
4
|
*
|
|
@@ -6,14 +7,10 @@
|
|
|
6
7
|
*/
|
|
7
8
|
//
|
|
8
9
|
export default {
|
|
9
|
-
'fabric.elements.mentions.team.meantion.highlight.close.button.tooltip': 'Dismiss',
|
|
10
10
|
'fabric.elements.mentions.team.member.50plus': 'Team • 50+ members',
|
|
11
11
|
'fabric.elements.mentions.team.member.50plus.including.you': 'Team • 50+ members, including you',
|
|
12
12
|
'fabric.elements.mentions.team.member.count': '{0, plural, one {Team • 1 member} other {Team • {0} members}}',
|
|
13
13
|
'fabric.elements.mentions.team.member.count.including.you': '{0, plural, one {Team • 1 member, including you} other {Team • {0} members, including you}}',
|
|
14
|
-
'fabric.elements.mentions.team.mention.highlight.description': 'Get everyone on the page with one click. No team?',
|
|
15
|
-
'fabric.elements.mentions.team.mention.highlight.description.link': 'Start one.',
|
|
16
|
-
'fabric.elements.mentions.team.mention.highlight.title': 'Mention your team',
|
|
17
14
|
'fabric.mention.error.defaultAction': 'Try again in a few seconds',
|
|
18
15
|
'fabric.mention.error.defaultHeadline': 'Something went wrong',
|
|
19
16
|
'fabric.mention.error.differentText': 'Try entering different text',
|
|
@@ -3,8 +3,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
|
|
5
5
|
import { ELEMENTS_CHANNEL } from '../_constants';
|
|
6
|
-
import { name as packageName, version as packageVersion } from '../version.json';
|
|
7
6
|
import { isSpecialMentionText } from '../types';
|
|
7
|
+
var packageName = "@atlaskit/mention";
|
|
8
|
+
var packageVersion = "22.1.3";
|
|
8
9
|
export var SLI_EVENT_TYPE = 'sli';
|
|
9
10
|
export var SMART_EVENT_TYPE = 'smart';
|
|
10
11
|
export var SliNames = /*#__PURE__*/function (SliNames) {
|
package/dist/esm/version.json
CHANGED
|
@@ -5,14 +5,10 @@
|
|
|
5
5
|
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
6
|
*/
|
|
7
7
|
declare const _default: {
|
|
8
|
-
'fabric.elements.mentions.team.meantion.highlight.close.button.tooltip': string;
|
|
9
8
|
'fabric.elements.mentions.team.member.50plus': string;
|
|
10
9
|
'fabric.elements.mentions.team.member.50plus.including.you': string;
|
|
11
10
|
'fabric.elements.mentions.team.member.count': string;
|
|
12
11
|
'fabric.elements.mentions.team.member.count.including.you': string;
|
|
13
|
-
'fabric.elements.mentions.team.mention.highlight.description': string;
|
|
14
|
-
'fabric.elements.mentions.team.mention.highlight.description.link': string;
|
|
15
|
-
'fabric.elements.mentions.team.mention.highlight.title': string;
|
|
16
12
|
'fabric.mention.error.defaultAction': string;
|
|
17
13
|
'fabric.mention.error.defaultHeadline': string;
|
|
18
14
|
'fabric.mention.error.differentText': string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ELEMENTS_CHANNEL = "fabric-elements";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MentionProvider, MentionContextIdentifier, ErrorCallback, InfoCallback, ResultCallback } from './MentionResource';
|
|
2
|
+
import { MentionDescription, InviteFromMentionProvider } from '../types';
|
|
3
|
+
export type { MentionDescription };
|
|
4
|
+
export type MentionProviderFunctions = Omit<{
|
|
5
|
+
[Key in keyof MentionProvider]: MentionProvider[Key] extends Function ? MentionProvider[Key] : never;
|
|
6
|
+
}, keyof InviteFromMentionProvider>;
|
|
7
|
+
/**
|
|
8
|
+
* This component is stateful and should be instantianted per contextIdentifiers.
|
|
9
|
+
*/
|
|
10
|
+
export default class ContextMentionResource implements MentionProvider {
|
|
11
|
+
private mentionProvider;
|
|
12
|
+
private contextIdentifier;
|
|
13
|
+
constructor(mentionProvider: MentionProvider, contextIdentifier: MentionContextIdentifier);
|
|
14
|
+
getContextIdentifier(): MentionContextIdentifier | undefined;
|
|
15
|
+
callWithContextIds: <K extends "subscribe" | "unsubscribe" | "filter" | "recordMentionSelection" | "shouldHighlightMention" | "isFiltering">(f: K, declaredArgs: number) => MentionProvider[K];
|
|
16
|
+
callDefault: <K extends "subscribe" | "unsubscribe" | "filter" | "recordMentionSelection" | "shouldHighlightMention" | "isFiltering">(f: K) => MentionProvider[K];
|
|
17
|
+
subscribe: (key: string, callback?: ResultCallback<MentionDescription[]> | undefined, errCallback?: ErrorCallback | undefined, infoCallback?: InfoCallback | undefined, allResultsCallback?: ResultCallback<MentionDescription[]> | undefined, analyticsCallback?: import("../types").AnalyticsCallback | undefined) => void;
|
|
18
|
+
unsubscribe: (key: string) => void;
|
|
19
|
+
filter: (query?: string | undefined, contextIdentifier?: MentionContextIdentifier | undefined) => void;
|
|
20
|
+
recordMentionSelection: (mention: MentionDescription, contextIdentifier?: MentionContextIdentifier | undefined) => void;
|
|
21
|
+
shouldHighlightMention: (mention: MentionDescription) => boolean;
|
|
22
|
+
isFiltering: (query: string) => boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MentionNameDetails } from '../types';
|
|
2
|
+
export interface MentionNameClient {
|
|
3
|
+
getLookupLimit(): number;
|
|
4
|
+
lookupMentionNames(ids: string[]): Promise<MentionNameDetails[]>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Supports the Atlassian Profile retrieval service.
|
|
8
|
+
*
|
|
9
|
+
* Uses:
|
|
10
|
+
* https://statlas.prod.atl-paas.net/swagger-ui-2.2.6/index.html?url=https://profile-retrieval-service.prod.atl-paas.net:443/api/swagger.yaml#!/default/getUsersByIds
|
|
11
|
+
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
2
|
+
import { MentionNameDetails, MentionNameResolver } from '../types';
|
|
3
|
+
import { MentionNameClient } from './MentionNameClient';
|
|
4
|
+
export type { MentionNameResolver } from '../types';
|
|
5
|
+
export declare class DefaultMentionNameResolver implements MentionNameResolver {
|
|
6
|
+
static waitForBatch: number;
|
|
7
|
+
private client;
|
|
8
|
+
private nameCache;
|
|
9
|
+
private nameQueue;
|
|
10
|
+
private nameStartTime;
|
|
11
|
+
private processingQueue;
|
|
12
|
+
private debounce;
|
|
13
|
+
private fireHydrationEvent;
|
|
14
|
+
constructor(client: MentionNameClient, analyticsProps?: WithAnalyticsEventsProps);
|
|
15
|
+
lookupName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
|
|
16
|
+
cacheName(id: string, name: string): void;
|
|
17
|
+
private scheduleProcessQueue;
|
|
18
|
+
private isQueueAtLimit;
|
|
19
|
+
private splitQueueAtLimit;
|
|
20
|
+
private resolveQueueItem;
|
|
21
|
+
private processQueue;
|
|
22
|
+
private fireAnalytics;
|
|
23
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { AnalyticsCallback, ErrorCallback, InfoCallback, InviteExperimentCohort, InviteFlow, MentionContextIdentifier, MentionDescription, MentionNameDetails, MentionProvider, MentionResourceConfig, MentionsResult, MentionStats, ResourceProvider, ResultCallback, UserRole } from '../types';
|
|
2
|
+
export type { MentionStats, ResultCallback, ErrorCallback, InfoCallback, MentionResourceConfig, ResourceProvider, MentionContextIdentifier, MentionProvider, } from '../types';
|
|
3
|
+
export interface TeamMentionResourceConfig extends MentionResourceConfig {
|
|
4
|
+
teamLinkResolver?: (teamId: string) => string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Support
|
|
8
|
+
*/
|
|
9
|
+
export interface ResolvingMentionProvider extends MentionProvider {
|
|
10
|
+
resolveMentionName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
|
|
11
|
+
cacheMentionName(id: string, mentionName: string): void;
|
|
12
|
+
supportsMentionNameResolving(): boolean;
|
|
13
|
+
}
|
|
14
|
+
declare class AbstractResource<Result> implements ResourceProvider<Result> {
|
|
15
|
+
protected changeListeners: Map<string, ResultCallback<Result>>;
|
|
16
|
+
protected errListeners: Map<string, ErrorCallback>;
|
|
17
|
+
protected infoListeners: Map<string, InfoCallback>;
|
|
18
|
+
protected allResultsListeners: Map<string, ResultCallback<Result>>;
|
|
19
|
+
protected analyticsListeners: Map<string, AnalyticsCallback>;
|
|
20
|
+
constructor();
|
|
21
|
+
subscribe(key: string, callback?: ResultCallback<Result>, errCallback?: ErrorCallback, infoCallback?: InfoCallback, allResultsCallback?: ResultCallback<Result>, analyticsListeners?: AnalyticsCallback): void;
|
|
22
|
+
unsubscribe(key: string): void;
|
|
23
|
+
}
|
|
24
|
+
declare class AbstractMentionResource extends AbstractResource<MentionDescription[]> implements MentionProvider {
|
|
25
|
+
shouldHighlightMention(_mention: MentionDescription): boolean;
|
|
26
|
+
filter(query?: string): void;
|
|
27
|
+
recordMentionSelection(_mention: MentionDescription): void;
|
|
28
|
+
isFiltering(_query: string): boolean;
|
|
29
|
+
protected _notifyListeners(mentionsResult: MentionsResult, stats?: MentionStats): void;
|
|
30
|
+
protected _notifyAllResultsListeners(mentionsResult: MentionsResult): void;
|
|
31
|
+
protected _notifyErrorListeners(error: Error, query?: string): void;
|
|
32
|
+
protected _notifyInfoListeners(info: string): void;
|
|
33
|
+
protected _notifyAnalyticsListeners(event: string, actionSubject: string, action: string, attributes?: {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}): void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Provides a Javascript API
|
|
39
|
+
*/
|
|
40
|
+
export declare class MentionResource extends AbstractMentionResource implements ResolvingMentionProvider {
|
|
41
|
+
private config;
|
|
42
|
+
private lastReturnedSearch;
|
|
43
|
+
private activeSearches;
|
|
44
|
+
productName?: string;
|
|
45
|
+
shouldEnableInvite: boolean;
|
|
46
|
+
inviteExperimentCohort?: InviteExperimentCohort;
|
|
47
|
+
userRole: UserRole;
|
|
48
|
+
onInviteItemClick?: (flow: InviteFlow) => void;
|
|
49
|
+
constructor(config: MentionResourceConfig);
|
|
50
|
+
shouldHighlightMention(mention: MentionDescription): boolean;
|
|
51
|
+
notify(searchTime: number, mentionResult: MentionsResult, query?: string): void;
|
|
52
|
+
notifyError(error: Error, query?: string): void;
|
|
53
|
+
filter(query?: string, contextIdentifier?: MentionContextIdentifier): Promise<void>;
|
|
54
|
+
recordMentionSelection(mention: MentionDescription, contextIdentifier?: MentionContextIdentifier): Promise<void>;
|
|
55
|
+
isFiltering(query: string): boolean;
|
|
56
|
+
resolveMentionName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
|
|
57
|
+
cacheMentionName(id: string, mentionName: string): void;
|
|
58
|
+
supportsMentionNameResolving(): boolean;
|
|
59
|
+
protected updateActiveSearches(query: string): void;
|
|
60
|
+
protected verifyMentionConfig(config: MentionResourceConfig): void;
|
|
61
|
+
private initialState;
|
|
62
|
+
/**
|
|
63
|
+
* Clear a context object to generate query params by removing empty
|
|
64
|
+
* strings, `undefined` and empty values.
|
|
65
|
+
*
|
|
66
|
+
* @param contextIdentifier the current context identifier
|
|
67
|
+
* @returns a safe context for query encoding
|
|
68
|
+
*/
|
|
69
|
+
private clearContext;
|
|
70
|
+
private getQueryParams;
|
|
71
|
+
/**
|
|
72
|
+
* Returns the initial mention display list before a search is performed for the specified
|
|
73
|
+
* container.
|
|
74
|
+
*
|
|
75
|
+
* @param contextIdentifier
|
|
76
|
+
* @returns Promise
|
|
77
|
+
*/
|
|
78
|
+
protected remoteInitialState(contextIdentifier?: MentionContextIdentifier): Promise<MentionsResult>;
|
|
79
|
+
private search;
|
|
80
|
+
protected remoteSearch(query: string, contextIdentifier?: MentionContextIdentifier): Promise<MentionsResult>;
|
|
81
|
+
private transformServiceResponse;
|
|
82
|
+
recordSelection(mention: MentionDescription, contextIdentifier?: MentionContextIdentifier): Promise<void>;
|
|
83
|
+
}
|
|
84
|
+
export declare class HttpError implements Error {
|
|
85
|
+
name: string;
|
|
86
|
+
message: string;
|
|
87
|
+
statusCode: number;
|
|
88
|
+
stack?: string;
|
|
89
|
+
constructor(statusCode: number, statusMessage: string);
|
|
90
|
+
}
|
|
91
|
+
export declare const isResolvingMentionProvider: (p: any) => p is ResolvingMentionProvider;
|
|
92
|
+
export { AbstractResource, AbstractMentionResource };
|
|
93
|
+
export default MentionResource;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Presence } from '../types';
|
|
2
|
+
import { AbstractResource, ResourceProvider } from './MentionResource';
|
|
3
|
+
export interface PresenceMap {
|
|
4
|
+
[userId: string]: Presence;
|
|
5
|
+
}
|
|
6
|
+
export interface PresenceResourceConfig {
|
|
7
|
+
url: string;
|
|
8
|
+
cloudId: string;
|
|
9
|
+
productId?: string;
|
|
10
|
+
cache?: PresenceCache;
|
|
11
|
+
cacheExpiry?: number;
|
|
12
|
+
parser?: PresenceParser;
|
|
13
|
+
}
|
|
14
|
+
export interface PresenceCache {
|
|
15
|
+
contains(userId: string): boolean;
|
|
16
|
+
get(userId: string): Presence;
|
|
17
|
+
getBulk(userIds: string[]): PresenceMap;
|
|
18
|
+
getMissingUserIds(userIds: string[]): string[];
|
|
19
|
+
update(presUpdate: PresenceMap): void;
|
|
20
|
+
}
|
|
21
|
+
export interface PresenceResponse {
|
|
22
|
+
data: Data;
|
|
23
|
+
}
|
|
24
|
+
export interface Data {
|
|
25
|
+
PresenceBulk: PresenceBulk[];
|
|
26
|
+
}
|
|
27
|
+
export interface PresenceBulk {
|
|
28
|
+
userId: string;
|
|
29
|
+
state: null | string;
|
|
30
|
+
type: null | string;
|
|
31
|
+
date: null | string;
|
|
32
|
+
message: null | string;
|
|
33
|
+
stateMetadata?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface PresenceParser {
|
|
36
|
+
mapState(state: string): string;
|
|
37
|
+
parse(response: PresenceResponse): PresenceMap;
|
|
38
|
+
}
|
|
39
|
+
export interface PresenceProvider extends ResourceProvider<PresenceMap> {
|
|
40
|
+
refreshPresence(userIds: string[]): void;
|
|
41
|
+
}
|
|
42
|
+
declare class AbstractPresenceResource extends AbstractResource<PresenceMap> implements PresenceProvider {
|
|
43
|
+
refreshPresence(userIds: string[]): void;
|
|
44
|
+
protected notifyListeners(presences: PresenceMap): void;
|
|
45
|
+
}
|
|
46
|
+
declare class PresenceResource extends AbstractPresenceResource {
|
|
47
|
+
private config;
|
|
48
|
+
private presenceCache;
|
|
49
|
+
private presenceParser;
|
|
50
|
+
constructor(config: PresenceResourceConfig);
|
|
51
|
+
refreshPresence(userIds: string[]): void;
|
|
52
|
+
private retrievePresence;
|
|
53
|
+
private queryDirectoryForPresences;
|
|
54
|
+
private static cleanUrl;
|
|
55
|
+
}
|
|
56
|
+
export declare class DefaultPresenceCache implements PresenceCache {
|
|
57
|
+
private static readonly defaultTimeout;
|
|
58
|
+
private static readonly defaultFlushTrigger;
|
|
59
|
+
private cache;
|
|
60
|
+
private size;
|
|
61
|
+
private expiryInMillis;
|
|
62
|
+
private flushTrigger;
|
|
63
|
+
constructor(cacheTimeout?: number, cacheTrigger?: number);
|
|
64
|
+
/**
|
|
65
|
+
* Precondition: _delete is only called internally if userId exists in cache
|
|
66
|
+
* Removes cache entry
|
|
67
|
+
* @param userId
|
|
68
|
+
*/
|
|
69
|
+
private _delete;
|
|
70
|
+
/**
|
|
71
|
+
* Checks a cache entry and calls delete if the info has expired
|
|
72
|
+
* @param userId
|
|
73
|
+
*/
|
|
74
|
+
private _deleteIfExpired;
|
|
75
|
+
/**
|
|
76
|
+
* Cleans expired entries from cache
|
|
77
|
+
*/
|
|
78
|
+
private _removeExpired;
|
|
79
|
+
/**
|
|
80
|
+
* Checks if a user exists in the cache
|
|
81
|
+
* @param userId
|
|
82
|
+
*/
|
|
83
|
+
contains(userId: string): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Retrieves a presence from the cache after checking for expired entries
|
|
86
|
+
* @param userId - to index the cache
|
|
87
|
+
* @returns Presence - the presence that matches the userId
|
|
88
|
+
*/
|
|
89
|
+
get(userId: string): Presence;
|
|
90
|
+
/**
|
|
91
|
+
* Retrieve multiple presences at once from the cache
|
|
92
|
+
* @param userIds - to index the cache
|
|
93
|
+
* @returns PresenceMap - A map of userIds to cached Presences
|
|
94
|
+
*/
|
|
95
|
+
getBulk(userIds: string[]): PresenceMap;
|
|
96
|
+
/**
|
|
97
|
+
* For a given list of ids, returns a subset
|
|
98
|
+
* of all the ids with missing cache entries.
|
|
99
|
+
* @param userIds - to index the cache
|
|
100
|
+
* @returns string[] - ids missing from the cache
|
|
101
|
+
*/
|
|
102
|
+
getMissingUserIds(userIds: string[]): string[];
|
|
103
|
+
/**
|
|
104
|
+
* Precondition: presMap only contains ids of users not in cache
|
|
105
|
+
* expired users must first be removed then reinserted with updated presence
|
|
106
|
+
* Updates the cache by adding the new Presence entries and setting the expiry time
|
|
107
|
+
* @param presMap
|
|
108
|
+
*/
|
|
109
|
+
update(presMap: PresenceMap): void;
|
|
110
|
+
}
|
|
111
|
+
export declare class DefaultPresenceParser implements PresenceParser {
|
|
112
|
+
static FOCUS_STATE: string;
|
|
113
|
+
mapState(state: string): string;
|
|
114
|
+
parse(response: PresenceResponse): PresenceMap;
|
|
115
|
+
private static extractState;
|
|
116
|
+
private static isFocusState;
|
|
117
|
+
}
|
|
118
|
+
export { AbstractPresenceResource };
|
|
119
|
+
export default PresenceResource;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MentionsResult } from '../types';
|
|
2
|
+
import MentionResource, { MentionContextIdentifier, MentionResourceConfig, TeamMentionResourceConfig, MentionProvider } from './MentionResource';
|
|
3
|
+
/**
|
|
4
|
+
* Provides a Javascript API to fetch users and teams
|
|
5
|
+
* In future we will have a new endpoint to return both users and teams, we can
|
|
6
|
+
* remove this class at this point
|
|
7
|
+
*/
|
|
8
|
+
export default class TeamMentionResource extends MentionResource implements MentionProvider {
|
|
9
|
+
private readonly teamMentionConfig;
|
|
10
|
+
private lastSearchQuery?;
|
|
11
|
+
private lastReturnedSearchTeam;
|
|
12
|
+
constructor(userMentionConfig: MentionResourceConfig, teamMentionConfig: TeamMentionResourceConfig);
|
|
13
|
+
filter(query?: string, contextIdentifier?: MentionContextIdentifier): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the initial mention display list before a search is performed for the specified
|
|
16
|
+
* container.
|
|
17
|
+
*/
|
|
18
|
+
private remoteInitialStateTeamAndUsers;
|
|
19
|
+
/**
|
|
20
|
+
* Both user and team requests are not blocked together
|
|
21
|
+
* If users request arrives first, show users. Show teams when team request arrives.
|
|
22
|
+
* If team request arrives first, block waiting for user request, then show both
|
|
23
|
+
* If one errors, show the non-erroring one
|
|
24
|
+
* If both error, show error
|
|
25
|
+
*/
|
|
26
|
+
private handleBothRequests;
|
|
27
|
+
notify(searchTime: number, mentionResult: MentionsResult, query?: string): void;
|
|
28
|
+
private getQueryParamsOfTeamMentionConfig;
|
|
29
|
+
private remoteUserSearch;
|
|
30
|
+
private remoteTeamSearch;
|
|
31
|
+
private convertTeamResultToMentionResult;
|
|
32
|
+
private trimTeamARI;
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MentionContextIdentifier } from '../types';
|
|
2
|
+
export declare const SMART_EVENT_TYPE = "smart";
|
|
3
|
+
export declare enum Actions {
|
|
4
|
+
REQUESTED = "requested",
|
|
5
|
+
SUCCESSFUL = "successful",
|
|
6
|
+
SEARCHED = "searched",
|
|
7
|
+
FAILED = "failed",
|
|
8
|
+
SELECTED = "selected"
|
|
9
|
+
}
|
|
10
|
+
export type DefaultAttributes = {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
context: string;
|
|
13
|
+
sessionId: string;
|
|
14
|
+
pickerType: 'mentions';
|
|
15
|
+
source: 'smarts';
|
|
16
|
+
};
|
|
17
|
+
export declare const defaultAttributes: (context?: MentionContextIdentifier) => DefaultAttributes;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MentionType } from '../../types';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
export interface PrimitiveMentionProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
mentionType: MentionType;
|
|
5
|
+
}
|
|
6
|
+
declare const PrimitiveMention: import("react").ForwardRefExoticComponent<PrimitiveMentionProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
export default PrimitiveMention;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MentionProvider } from '../../api/MentionResource';
|
|
3
|
+
import { MentionEventHandler } from '../../types';
|
|
4
|
+
export interface Props {
|
|
5
|
+
id: string;
|
|
6
|
+
text: string;
|
|
7
|
+
accessLevel?: string;
|
|
8
|
+
mentionProvider?: Promise<MentionProvider>;
|
|
9
|
+
onClick?: MentionEventHandler;
|
|
10
|
+
onMouseEnter?: MentionEventHandler;
|
|
11
|
+
onMouseLeave?: MentionEventHandler;
|
|
12
|
+
}
|
|
13
|
+
export interface State {
|
|
14
|
+
isHighlighted: boolean;
|
|
15
|
+
resolvedMentionName?: string;
|
|
16
|
+
}
|
|
17
|
+
export default class ResourcedMention extends React.PureComponent<Props, State> {
|
|
18
|
+
_isMounted: boolean;
|
|
19
|
+
constructor(props: Props);
|
|
20
|
+
componentDidMount(): void;
|
|
21
|
+
componentWillUnmount(): void;
|
|
22
|
+
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
23
|
+
private setStateSafely;
|
|
24
|
+
private processName;
|
|
25
|
+
private handleMentionProvider;
|
|
26
|
+
render(): JSX.Element;
|
|
27
|
+
}
|