@atlaskit/mention 22.1.0 → 22.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/_constants/package.json +2 -2
  3. package/dist/cjs/i18n/cs.js +11 -15
  4. package/dist/cjs/i18n/da.js +11 -15
  5. package/dist/cjs/i18n/de.js +11 -15
  6. package/dist/cjs/i18n/en.js +11 -15
  7. package/dist/cjs/i18n/en_GB.js +11 -15
  8. package/dist/cjs/i18n/es.js +11 -15
  9. package/dist/cjs/i18n/fi.js +11 -15
  10. package/dist/cjs/i18n/fr.js +11 -15
  11. package/dist/cjs/i18n/hu.js +11 -15
  12. package/dist/cjs/i18n/it.js +11 -15
  13. package/dist/cjs/i18n/ja.js +11 -15
  14. package/dist/cjs/i18n/ko.js +11 -15
  15. package/dist/cjs/i18n/nb.js +11 -15
  16. package/dist/cjs/i18n/nl.js +11 -15
  17. package/dist/cjs/i18n/pl.js +11 -15
  18. package/dist/cjs/i18n/pt_BR.js +11 -15
  19. package/dist/cjs/i18n/ru.js +11 -15
  20. package/dist/cjs/i18n/sv.js +11 -15
  21. package/dist/cjs/i18n/th.js +11 -15
  22. package/dist/cjs/i18n/tr.js +11 -15
  23. package/dist/cjs/i18n/uk.js +11 -15
  24. package/dist/cjs/i18n/vi.js +11 -15
  25. package/dist/cjs/i18n/zh.js +11 -15
  26. package/dist/cjs/i18n/zh_TW.js +11 -15
  27. package/dist/cjs/version.json +1 -1
  28. package/dist/es2019/i18n/cs.js +11 -15
  29. package/dist/es2019/i18n/da.js +11 -15
  30. package/dist/es2019/i18n/de.js +11 -15
  31. package/dist/es2019/i18n/en.js +11 -15
  32. package/dist/es2019/i18n/en_GB.js +11 -15
  33. package/dist/es2019/i18n/es.js +11 -15
  34. package/dist/es2019/i18n/fi.js +11 -15
  35. package/dist/es2019/i18n/fr.js +11 -15
  36. package/dist/es2019/i18n/hu.js +11 -15
  37. package/dist/es2019/i18n/it.js +11 -15
  38. package/dist/es2019/i18n/ja.js +11 -15
  39. package/dist/es2019/i18n/ko.js +11 -15
  40. package/dist/es2019/i18n/nb.js +11 -15
  41. package/dist/es2019/i18n/nl.js +11 -15
  42. package/dist/es2019/i18n/pl.js +11 -15
  43. package/dist/es2019/i18n/pt_BR.js +11 -15
  44. package/dist/es2019/i18n/ru.js +11 -15
  45. package/dist/es2019/i18n/sv.js +11 -15
  46. package/dist/es2019/i18n/th.js +11 -15
  47. package/dist/es2019/i18n/tr.js +11 -15
  48. package/dist/es2019/i18n/uk.js +11 -15
  49. package/dist/es2019/i18n/vi.js +11 -15
  50. package/dist/es2019/i18n/zh.js +11 -15
  51. package/dist/es2019/i18n/zh_TW.js +11 -15
  52. package/dist/es2019/version.json +1 -1
  53. package/dist/esm/i18n/cs.js +11 -15
  54. package/dist/esm/i18n/da.js +11 -15
  55. package/dist/esm/i18n/de.js +11 -15
  56. package/dist/esm/i18n/en.js +11 -15
  57. package/dist/esm/i18n/en_GB.js +11 -15
  58. package/dist/esm/i18n/es.js +11 -15
  59. package/dist/esm/i18n/fi.js +11 -15
  60. package/dist/esm/i18n/fr.js +11 -15
  61. package/dist/esm/i18n/hu.js +11 -15
  62. package/dist/esm/i18n/it.js +11 -15
  63. package/dist/esm/i18n/ja.js +11 -15
  64. package/dist/esm/i18n/ko.js +11 -15
  65. package/dist/esm/i18n/nb.js +11 -15
  66. package/dist/esm/i18n/nl.js +11 -15
  67. package/dist/esm/i18n/pl.js +11 -15
  68. package/dist/esm/i18n/pt_BR.js +11 -15
  69. package/dist/esm/i18n/ru.js +11 -15
  70. package/dist/esm/i18n/sv.js +11 -15
  71. package/dist/esm/i18n/th.js +11 -15
  72. package/dist/esm/i18n/tr.js +11 -15
  73. package/dist/esm/i18n/uk.js +11 -15
  74. package/dist/esm/i18n/vi.js +11 -15
  75. package/dist/esm/i18n/zh.js +11 -15
  76. package/dist/esm/i18n/zh_TW.js +11 -15
  77. package/dist/esm/version.json +1 -1
  78. package/dist/types/api/ContextMentionResource.d.ts +1 -1
  79. package/dist/types/api/analytics.d.ts +2 -2
  80. package/dist/types/components/Mention/index.d.ts +3 -3
  81. package/dist/types/components/MentionList/index.d.ts +2 -2
  82. package/dist/types/components/MentionPicker/index.d.ts +4 -4
  83. package/dist/types/components/NoAccessTooltip/main.d.ts +1 -1
  84. package/dist/types/components/ResourcedMentionList/index.d.ts +3 -3
  85. package/dist/types/config/index.d.ts +2 -2
  86. package/dist/types/i18n/cs.d.ts +13 -17
  87. package/dist/types/i18n/da.d.ts +13 -17
  88. package/dist/types/i18n/de.d.ts +13 -17
  89. package/dist/types/i18n/en.d.ts +13 -17
  90. package/dist/types/i18n/en_GB.d.ts +13 -17
  91. package/dist/types/i18n/en_ZZ.d.ts +6 -6
  92. package/dist/types/i18n/es.d.ts +13 -17
  93. package/dist/types/i18n/et.d.ts +6 -6
  94. package/dist/types/i18n/fi.d.ts +13 -17
  95. package/dist/types/i18n/fr.d.ts +13 -17
  96. package/dist/types/i18n/hu.d.ts +13 -17
  97. package/dist/types/i18n/is.d.ts +6 -6
  98. package/dist/types/i18n/it.d.ts +13 -17
  99. package/dist/types/i18n/ja.d.ts +13 -17
  100. package/dist/types/i18n/ko.d.ts +13 -17
  101. package/dist/types/i18n/languages.d.ts +6 -6
  102. package/dist/types/i18n/nb.d.ts +13 -17
  103. package/dist/types/i18n/nl.d.ts +13 -17
  104. package/dist/types/i18n/pl.d.ts +13 -17
  105. package/dist/types/i18n/pt_BR.d.ts +13 -17
  106. package/dist/types/i18n/pt_PT.d.ts +6 -6
  107. package/dist/types/i18n/ro.d.ts +6 -6
  108. package/dist/types/i18n/ru.d.ts +13 -17
  109. package/dist/types/i18n/sk.d.ts +6 -6
  110. package/dist/types/i18n/sv.d.ts +13 -17
  111. package/dist/types/i18n/th.d.ts +13 -17
  112. package/dist/types/i18n/tr.d.ts +13 -17
  113. package/dist/types/i18n/uk.d.ts +13 -17
  114. package/dist/types/i18n/vi.d.ts +13 -17
  115. package/dist/types/i18n/zh.d.ts +13 -17
  116. package/dist/types/i18n/zh_TW.d.ts +13 -17
  117. package/dist/types/types.d.ts +7 -7
  118. package/dist/types/util/analytics.d.ts +3 -3
  119. package/dist/types/util/i18n.d.ts +2 -2
  120. package/dist/types-ts4.5/_constants.d.ts +1 -0
  121. package/dist/types-ts4.5/api/ContextMentionResource.d.ts +23 -0
  122. package/dist/types-ts4.5/api/MentionNameClient.d.ts +11 -0
  123. package/dist/types-ts4.5/api/MentionNameResolver.d.ts +23 -0
  124. package/dist/types-ts4.5/api/MentionResource.d.ts +93 -0
  125. package/dist/types-ts4.5/api/PresenceResource.d.ts +119 -0
  126. package/dist/types-ts4.5/api/TeamMentionResource.d.ts +33 -0
  127. package/dist/types-ts4.5/api/analytics.d.ts +17 -0
  128. package/dist/types-ts4.5/components/LockCircleIcon/index.d.ts +3 -0
  129. package/dist/types-ts4.5/components/Mention/PrimitiveMention.d.ts +7 -0
  130. package/dist/types-ts4.5/components/Mention/ResourcedMention.d.ts +27 -0
  131. package/dist/types-ts4.5/components/Mention/index.d.ts +31 -0
  132. package/dist/types-ts4.5/components/Mention/ufoExperiences.d.ts +9 -0
  133. package/dist/types-ts4.5/components/MentionDescriptionByline/TeamMentionDescriptionByline.d.ts +7 -0
  134. package/dist/types-ts4.5/components/MentionDescriptionByline/UserMentionDescriptionByline.d.ts +5 -0
  135. package/dist/types-ts4.5/components/MentionDescriptionByline/index.d.ts +5 -0
  136. package/dist/types-ts4.5/components/MentionDescriptionByline/styles.d.ts +5 -0
  137. package/dist/types-ts4.5/components/MentionDescriptionByline/types.d.ts +4 -0
  138. package/dist/types-ts4.5/components/MentionItem/MentionHighlightHelpers.d.ts +3 -0
  139. package/dist/types-ts4.5/components/MentionItem/index.d.ts +16 -0
  140. package/dist/types-ts4.5/components/MentionItem/styles.d.ts +46 -0
  141. package/dist/types-ts4.5/components/MentionList/index.d.ts +41 -0
  142. package/dist/types-ts4.5/components/MentionList/styles.d.ts +8 -0
  143. package/dist/types-ts4.5/components/MentionListError/GenericErrorIllustration.d.ts +7 -0
  144. package/dist/types-ts4.5/components/MentionListError/index.d.ts +13 -0
  145. package/dist/types-ts4.5/components/MentionListError/styles.d.ts +17 -0
  146. package/dist/types-ts4.5/components/MentionPicker/index.d.ts +77 -0
  147. package/dist/types-ts4.5/components/MentionPicker/styles.d.ts +12 -0
  148. package/dist/types-ts4.5/components/MessagesIntlProvider/index.d.ts +3 -0
  149. package/dist/types-ts4.5/components/NoAccessTooltip/index.d.ts +6 -0
  150. package/dist/types-ts4.5/components/NoAccessTooltip/main.d.ts +7 -0
  151. package/dist/types-ts4.5/components/Popup/index.d.ts +26 -0
  152. package/dist/types-ts4.5/components/ResourcedMentionList/index.d.ts +46 -0
  153. package/dist/types-ts4.5/components/Scrollable/index.d.ts +11 -0
  154. package/dist/types-ts4.5/components/Scrollable/styles.d.ts +5 -0
  155. package/dist/types-ts4.5/components/i18n.d.ts +57 -0
  156. package/dist/types-ts4.5/config/index.d.ts +5 -0
  157. package/dist/types-ts4.5/element.d.ts +3 -0
  158. package/dist/types-ts4.5/i18n/cs.d.ts +20 -0
  159. package/dist/types-ts4.5/i18n/da.d.ts +20 -0
  160. package/dist/types-ts4.5/i18n/de.d.ts +20 -0
  161. package/dist/types-ts4.5/i18n/en.d.ts +20 -0
  162. package/dist/types-ts4.5/i18n/en_GB.d.ts +20 -0
  163. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +24 -0
  164. package/dist/types-ts4.5/i18n/es.d.ts +20 -0
  165. package/dist/types-ts4.5/i18n/et.d.ts +20 -0
  166. package/dist/types-ts4.5/i18n/fi.d.ts +20 -0
  167. package/dist/types-ts4.5/i18n/fr.d.ts +20 -0
  168. package/dist/types-ts4.5/i18n/hu.d.ts +20 -0
  169. package/dist/types-ts4.5/i18n/index.d.ts +35 -0
  170. package/dist/types-ts4.5/i18n/is.d.ts +24 -0
  171. package/dist/types-ts4.5/i18n/it.d.ts +20 -0
  172. package/dist/types-ts4.5/i18n/ja.d.ts +20 -0
  173. package/dist/types-ts4.5/i18n/ko.d.ts +20 -0
  174. package/dist/types-ts4.5/i18n/languages.d.ts +33 -0
  175. package/dist/types-ts4.5/i18n/nb.d.ts +20 -0
  176. package/dist/types-ts4.5/i18n/nl.d.ts +20 -0
  177. package/dist/types-ts4.5/i18n/pl.d.ts +20 -0
  178. package/dist/types-ts4.5/i18n/pt_BR.d.ts +20 -0
  179. package/dist/types-ts4.5/i18n/pt_PT.d.ts +20 -0
  180. package/dist/types-ts4.5/i18n/ro.d.ts +24 -0
  181. package/dist/types-ts4.5/i18n/ru.d.ts +20 -0
  182. package/dist/types-ts4.5/i18n/sk.d.ts +20 -0
  183. package/dist/types-ts4.5/i18n/sv.d.ts +20 -0
  184. package/dist/types-ts4.5/i18n/th.d.ts +20 -0
  185. package/dist/types-ts4.5/i18n/tr.d.ts +20 -0
  186. package/dist/types-ts4.5/i18n/uk.d.ts +20 -0
  187. package/dist/types-ts4.5/i18n/vi.d.ts +20 -0
  188. package/dist/types-ts4.5/i18n/zh.d.ts +20 -0
  189. package/dist/types-ts4.5/i18n/zh_TW.d.ts +20 -0
  190. package/dist/types-ts4.5/i18n.d.ts +1 -0
  191. package/dist/types-ts4.5/index.d.ts +17 -0
  192. package/dist/types-ts4.5/item.d.ts +2 -0
  193. package/dist/types-ts4.5/resource.d.ts +10 -0
  194. package/dist/types-ts4.5/shared-styles.d.ts +5 -0
  195. package/dist/types-ts4.5/team-resource.d.ts +8 -0
  196. package/dist/types-ts4.5/typeahead.d.ts +3 -0
  197. package/dist/types-ts4.5/types.d.ts +168 -0
  198. package/dist/types-ts4.5/util/analytics.d.ts +30 -0
  199. package/dist/types-ts4.5/util/i18n.d.ts +29 -0
  200. package/dist/types-ts4.5/util/id.d.ts +2 -0
  201. package/dist/types-ts4.5/util/index.d.ts +1 -0
  202. package/dist/types-ts4.5/util/logger.d.ts +4 -0
  203. package/dist/types-ts4.5/util/mouse.d.ts +8 -0
  204. package/element/package.json +2 -2
  205. package/i18n/package.json +2 -2
  206. package/item/package.json +2 -2
  207. package/package.json +13 -5
  208. package/resource/package.json +2 -2
  209. package/shared-styles/package.json +2 -2
  210. package/team-resource/package.json +2 -2
  211. package/typeahead/package.json +2 -2
  212. package/types/package.json +2 -2
@@ -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,3 @@
1
+ /// <reference types="react" />
2
+ declare const AsyncLockCircleIcon: import("react").LazyExoticComponent<typeof import("@atlaskit/icon/glyph/lock-circle").default>;
3
+ export default AsyncLockCircleIcon;
@@ -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
+ }
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { MentionEventHandler } from '../../types';
3
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
4
+ export declare const ANALYTICS_HOVER_DELAY = 1000;
5
+ export declare const UNKNOWN_USER_ID = "_|unknown|_";
6
+ export type OwnProps = {
7
+ id: string;
8
+ text: string;
9
+ isHighlighted?: boolean;
10
+ accessLevel?: string;
11
+ onClick?: MentionEventHandler;
12
+ onMouseEnter?: MentionEventHandler;
13
+ onMouseLeave?: MentionEventHandler;
14
+ onHover?: () => void;
15
+ };
16
+ export type Props = OwnProps & WithAnalyticsEventsProps;
17
+ export declare class MentionInternal extends React.PureComponent<Props, {}> {
18
+ private hoverTimeout?;
19
+ constructor(props: Props);
20
+ componentDidMount(): void;
21
+ private handleOnClick;
22
+ private handleOnMouseEnter;
23
+ private handleOnMouseLeave;
24
+ private getMentionType;
25
+ componentWillUnmount(): void;
26
+ renderUnknownUserError(id: string): JSX.Element;
27
+ render(): JSX.Element;
28
+ }
29
+ declare const Mention: React.ForwardRefExoticComponent<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
30
+ type Mention = MentionInternal;
31
+ export default Mention;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ConcurrentExperience } from '@atlaskit/ufo';
3
+ export declare const mentionRenderedUfoExperience: ConcurrentExperience;
4
+ export declare class UfoErrorBoundary extends React.Component<{
5
+ id: string;
6
+ }> {
7
+ componentDidCatch(): void;
8
+ render(): React.ReactNode;
9
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { DescriptionBylineProps } from './types';
3
+ export default class TeamMentionDescriptionByline extends React.PureComponent<DescriptionBylineProps> {
4
+ private renderByline;
5
+ private getBylineComponent;
6
+ render(): JSX.Element | null;
7
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { DescriptionBylineProps } from './types';
3
+ export default class UserMentionDescriptionByline extends React.PureComponent<DescriptionBylineProps, {}> {
4
+ render(): JSX.Element | null;
5
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { DescriptionBylineProps } from './types';
3
+ export default class MentionDescriptionByline extends React.PureComponent<DescriptionBylineProps, {}> {
4
+ render(): JSX.Element;
5
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const DescriptionBylineStyle: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -0,0 +1,4 @@
1
+ import { MentionDescription } from '../../types';
2
+ export interface DescriptionBylineProps {
3
+ mention: MentionDescription;
4
+ }
@@ -0,0 +1,3 @@
1
+ import { ComponentType } from 'react';
2
+ import { HighlightDetail } from '../../types';
3
+ export declare function renderHighlight(ReactComponent: ComponentType<any>, value?: string, highlights?: HighlightDetail[], prefix?: string): JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { MentionDescription, OnMentionEvent } from '../../types';
3
+ export { MENTION_ITEM_HEIGHT } from './styles';
4
+ export interface Props {
5
+ mention: MentionDescription;
6
+ selected?: boolean;
7
+ onMouseMove?: OnMentionEvent;
8
+ onMouseEnter?: OnMentionEvent;
9
+ onSelection?: OnMentionEvent;
10
+ }
11
+ export default class MentionItem extends React.PureComponent<Props, {}> {
12
+ private onMentionSelected;
13
+ private onMentionMenuItemMouseMove;
14
+ private onMentionMenuItemMouseEnter;
15
+ render(): JSX.Element;
16
+ }
@@ -0,0 +1,46 @@
1
+ /// <reference types="react" />
2
+ export interface MentionItemStyleProps {
3
+ selected?: boolean;
4
+ }
5
+ export interface AvatarSectionStyleProps {
6
+ restricted?: boolean;
7
+ }
8
+ export interface NameSectionStyleProps {
9
+ restricted?: boolean;
10
+ }
11
+ export interface InfoSectionStyleProps {
12
+ restricted?: boolean;
13
+ }
14
+ export declare const RowStyle: import("@emotion/styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any> | undefined;
17
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
18
+ export declare const AvatarStyle: import("@emotion/styled").StyledComponent<{
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ as?: import("react").ElementType<any> | undefined;
21
+ } & AvatarSectionStyleProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
22
+ export declare const NameSectionStyle: import("@emotion/styled").StyledComponent<{
23
+ theme?: import("@emotion/react").Theme | undefined;
24
+ as?: import("react").ElementType<any> | undefined;
25
+ } & NameSectionStyleProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
+ export declare const FullNameStyle: import("@emotion/styled").StyledComponent<{
27
+ theme?: import("@emotion/react").Theme | undefined;
28
+ as?: import("react").ElementType<any> | undefined;
29
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
30
+ export declare const InfoSectionStyle: import("@emotion/styled").StyledComponent<{
31
+ theme?: import("@emotion/react").Theme | undefined;
32
+ as?: import("react").ElementType<any> | undefined;
33
+ } & InfoSectionStyleProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
34
+ export declare const TimeStyle: import("@emotion/styled").StyledComponent<{
35
+ theme?: import("@emotion/react").Theme | undefined;
36
+ as?: import("react").ElementType<any> | undefined;
37
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
38
+ export declare const MENTION_ITEM_HEIGHT = 48;
39
+ export declare const MentionItemStyle: import("@emotion/styled").StyledComponent<{
40
+ theme?: import("@emotion/react").Theme | undefined;
41
+ as?: import("react").ElementType<any> | undefined;
42
+ } & MentionItemStyleProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
43
+ export declare const AccessSectionStyle: import("@emotion/styled").StyledComponent<{
44
+ theme?: import("@emotion/react").Theme | undefined;
45
+ as?: import("react").ElementType<any> | undefined;
46
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { MentionDescription, OnMentionEvent } from '../../types';
3
+ import MentionItem from '../MentionItem';
4
+ export interface Props {
5
+ mentions: MentionDescription[];
6
+ resourceError?: Error;
7
+ onSelection?: OnMentionEvent;
8
+ initialHighlightElement?: React.ReactElement | null;
9
+ }
10
+ export interface State {
11
+ selectedKey?: string;
12
+ selectedIndex: number;
13
+ }
14
+ export interface Items {
15
+ [index: string]: MentionItem;
16
+ }
17
+ export default class MentionList extends React.PureComponent<Props, State> {
18
+ private lastMousePosition;
19
+ private scrollable?;
20
+ private items;
21
+ constructor(props: Props);
22
+ UNSAFE_componentWillReceiveProps(nextProps: Props): void;
23
+ componentDidUpdate(): void;
24
+ selectNext: () => void;
25
+ selectPrevious: () => void;
26
+ selectIndex: (index: number, callback?: () => any) => void;
27
+ selectId: (id: string, callback?: () => any) => void;
28
+ chooseCurrentSelection: () => void;
29
+ mentionsCount: () => number;
30
+ private revealItem;
31
+ /**
32
+ * The default selection state is to chose index 0 and not have any particular key selected
33
+ */
34
+ private setDefaultSelectionState;
35
+ private selectIndexOnHover;
36
+ private itemSelected;
37
+ private renderItems;
38
+ private isSelectedMention;
39
+ private handleScrollableRef;
40
+ render(): JSX.Element;
41
+ }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export interface MentionListStyleProps {
3
+ empty?: boolean;
4
+ }
5
+ export declare const MentionListStyle: import("@emotion/styled").StyledComponent<{
6
+ theme?: import("@emotion/react").Theme | undefined;
7
+ as?: import("react").ElementType<any> | undefined;
8
+ } & MentionListStyleProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface Props {
3
+ title?: string;
4
+ }
5
+ export declare class GenericErrorIllustration extends React.PureComponent<Props, {}> {
6
+ render(): JSX.Element;
7
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export interface Props {
3
+ error?: Error;
4
+ }
5
+ export default class MentionListError extends React.PureComponent<Props, {}> {
6
+ /**
7
+ * Translate the supplied Error into a message suitable for display in the MentionList.
8
+ *
9
+ * @param error the error to be displayed
10
+ */
11
+ private static getAdvisedActionMessage;
12
+ render(): JSX.Element;
13
+ }
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ export declare const MentionListErrorStyle: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const GenericErrorVisualStyle: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const MentionListErrorHeadlineStyle: import("@emotion/styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
14
+ export declare const MentionListAdviceStyle: import("@emotion/styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any> | undefined;
17
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,77 @@
1
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
2
+ import React from 'react';
3
+ import { IntlShape } from 'react-intl-next';
4
+ import { MentionProvider } from '../../api/MentionResource';
5
+ import { PresenceProvider } from '../../api/PresenceResource';
6
+ import { OnMentionEvent } from '../../types';
7
+ export interface OnOpen {
8
+ (): void;
9
+ }
10
+ export interface OnClose {
11
+ (): void;
12
+ }
13
+ export type Position = 'above' | 'below' | 'auto';
14
+ export interface Props {
15
+ resourceProvider: MentionProvider;
16
+ presenceProvider?: PresenceProvider;
17
+ query?: string;
18
+ onSelection?: OnMentionEvent;
19
+ onOpen?: OnOpen;
20
+ onClose?: OnClose;
21
+ target?: string;
22
+ position?: Position;
23
+ zIndex?: number | string;
24
+ offsetX?: number;
25
+ offsetY?: number;
26
+ }
27
+ export interface State {
28
+ visible: boolean;
29
+ info?: string;
30
+ }
31
+ /**
32
+ * @class MentionPicker
33
+ */
34
+ export declare class MentionPicker extends React.PureComponent<Props & WithAnalyticsEventsProps & {
35
+ intl: IntlShape;
36
+ }, State> {
37
+ private subscriberKey;
38
+ private mentionListRef?;
39
+ static defaultProps: {
40
+ onSelection: () => void;
41
+ onOpen: () => void;
42
+ onClose: () => void;
43
+ };
44
+ constructor(props: Props & WithAnalyticsEventsProps & {
45
+ intl: IntlShape;
46
+ });
47
+ componentDidMount(): void;
48
+ UNSAFE_componentWillReceiveProps(nextProps: Props & WithAnalyticsEventsProps): void;
49
+ componentWillUnmount(): void;
50
+ selectNext: () => void;
51
+ selectPrevious: () => void;
52
+ selectIndex: (index: number, callback?: () => any) => void;
53
+ selectId: (id: string, callback?: () => any) => void;
54
+ chooseCurrentSelection: () => void;
55
+ mentionsCount: () => number;
56
+ private applyPropChanges;
57
+ private subscribeResourceProvider;
58
+ private unsubscribeResourceProvider;
59
+ /**
60
+ * Called after the 'visible' state is changed to decide whether the onOpen or onClose
61
+ * handlers should be called.
62
+ *
63
+ * It should be noted that the visible state of the component is not considered in
64
+ * this function. Instead the old state and new state should be passed as parameters.
65
+ */
66
+ private onFilterVisibilityChange;
67
+ private filterChange;
68
+ private filterError;
69
+ private filterInfo;
70
+ private handleMentionListRef;
71
+ render(): JSX.Element;
72
+ }
73
+ export declare const MentionPickerWithAnalytics: React.ForwardRefExoticComponent<Omit<Pick<import("react-intl-next").WithIntlProps<React.PropsWithChildren<Props & WithAnalyticsEventsProps & {
74
+ intl: IntlShape;
75
+ }>>, "children" | "createAnalyticsEvent" | keyof Props | "forwardedRef"> & React.RefAttributes<any>, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
76
+ export type MentionPickerWithAnalytics = MentionPicker;
77
+ export default MentionPickerWithAnalytics;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ export interface MentionPickerStyleProps {
3
+ visible?: boolean | string;
4
+ }
5
+ export declare const MentionPickerStyle: import("@emotion/styled").StyledComponent<{
6
+ theme?: import("@emotion/react").Theme | undefined;
7
+ as?: import("react").ElementType<any> | undefined;
8
+ } & MentionPickerStyleProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
9
+ export declare const MentionPickerInfoStyle: import("@emotion/styled").StyledComponent<{
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ as?: import("react").ElementType<any> | undefined;
12
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const MessagesIntlProvider: React.FC;
3
+ export default MessagesIntlProvider;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const AsyncNoAccessTooltip: React.LazyExoticComponent<({ name, children }: {
3
+ name: string;
4
+ children: React.ReactNode;
5
+ }) => JSX.Element>;
6
+ export default AsyncNoAccessTooltip;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ name: string;
4
+ children: React.ReactNode;
5
+ };
6
+ export declare const NoAccessTooltip: ({ name, children }: Props) => JSX.Element;
7
+ export {};
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ export interface Props {
3
+ target?: string;
4
+ relativePosition?: 'above' | 'below' | 'auto';
5
+ offsetX?: number;
6
+ offsetY?: number;
7
+ zIndex?: number | string;
8
+ children?: any;
9
+ }
10
+ export default class Popup extends React.PureComponent<Props, {}> {
11
+ private popup?;
12
+ static defaultProps: {
13
+ relativePosition: string;
14
+ offsetX: number;
15
+ offsetY: number;
16
+ zIndex: number;
17
+ };
18
+ componentDidMount(): void;
19
+ componentDidUpdate(): void;
20
+ componentWillUnmount(): void;
21
+ _applyBelowPosition(): void;
22
+ _applyAbovePosition(): void;
23
+ _applyAbsolutePosition(): void;
24
+ _renderContent(): void;
25
+ render(): JSX.Element;
26
+ }
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ import { MentionProvider } from '../../api/MentionResource';
4
+ import { PresenceProvider } from '../../api/PresenceResource';
5
+ import { MentionDescription, OnMentionEvent } from '../../types';
6
+ export interface Props {
7
+ resourceProvider: MentionProvider;
8
+ presenceProvider?: PresenceProvider;
9
+ query?: string;
10
+ onSelection?: OnMentionEvent;
11
+ resourceError?: Error;
12
+ }
13
+ export interface State {
14
+ resourceError?: Error;
15
+ mentions: MentionDescription[];
16
+ }
17
+ export declare class ResourcedMentionListWithoutAnalytics extends React.PureComponent<Props & WithAnalyticsEventsProps, State> {
18
+ private subscriberKey;
19
+ private mentionListRef?;
20
+ constructor(props: Props & WithAnalyticsEventsProps);
21
+ componentDidMount(): void;
22
+ UNSAFE_componentWillReceiveProps(nextProps: Props): void;
23
+ componentWillUnmount(): void;
24
+ selectNext: () => void;
25
+ selectPrevious: () => void;
26
+ selectIndex: (index: number, callback?: () => any) => void;
27
+ selectId: (id: string, callback?: () => any) => void;
28
+ chooseCurrentSelection: () => void;
29
+ mentionsCount: () => number;
30
+ private subscribeMentionProvider;
31
+ private subscribePresenceProvider;
32
+ private unsubscribeMentionProvider;
33
+ private unsubscribePresenceProvider;
34
+ private applyPropChanges;
35
+ private refreshPresences;
36
+ private filterChange;
37
+ private sendAnalytics;
38
+ private filterError;
39
+ private presenceUpdate;
40
+ private notifySelection;
41
+ private handleMentionListRef;
42
+ render(): JSX.Element;
43
+ }
44
+ declare const ResourcedMentionList: React.ForwardRefExoticComponent<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
45
+ type ResourcedMentionList = ResourcedMentionListWithoutAnalytics;
46
+ export default ResourcedMentionList;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import MentionItem from '../MentionItem';
3
+ export interface Props {
4
+ children?: React.ReactNode | React.ReactNode[];
5
+ }
6
+ export default class Scrollable extends React.PureComponent<Props, {}> {
7
+ private scrollableDiv?;
8
+ reveal: (child: MentionItem) => void;
9
+ private handleRef;
10
+ render(): JSX.Element;
11
+ }