@atlaskit/mention 26.2.0 → 27.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.
Files changed (121) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/analytics/package.json +1 -8
  3. package/constants/package.json +1 -8
  4. package/context-mention-resource/package.json +1 -8
  5. package/dist/cjs/components/MentionAvatar/index.js +6 -1
  6. package/dist/cjs/util/analytics.js +1 -1
  7. package/dist/es2019/components/MentionAvatar/index.js +7 -2
  8. package/dist/es2019/util/analytics.js +1 -1
  9. package/dist/esm/components/MentionAvatar/index.js +7 -2
  10. package/dist/esm/util/analytics.js +1 -1
  11. package/element/package.json +1 -8
  12. package/item/package.json +1 -8
  13. package/mention/package.json +1 -8
  14. package/mention-item/package.json +1 -8
  15. package/mention-item/styles/package.json +1 -8
  16. package/mention-list/package.json +1 -8
  17. package/mention-name-client/package.json +1 -8
  18. package/mention-name-resolver/package.json +1 -8
  19. package/mention-picker/package.json +1 -8
  20. package/mention-resource/package.json +1 -8
  21. package/package.json +22 -25
  22. package/presence-resource/package.json +1 -8
  23. package/resource/package.json +1 -8
  24. package/resourced-mention/package.json +1 -8
  25. package/resourced-mention-list/package.json +1 -8
  26. package/shared-styles/package.json +1 -8
  27. package/team-mention-resource/package.json +1 -8
  28. package/team-resource/package.json +1 -8
  29. package/typeahead/package.json +1 -8
  30. package/types/package.json +1 -8
  31. package/dist/types-ts4.5/_constants.d.ts +0 -1
  32. package/dist/types-ts4.5/api/ContextMentionResource.d.ts +0 -28
  33. package/dist/types-ts4.5/api/MentionNameClient.d.ts +0 -11
  34. package/dist/types-ts4.5/api/MentionNameResolver.d.ts +0 -38
  35. package/dist/types-ts4.5/api/MentionResource.d.ts +0 -106
  36. package/dist/types-ts4.5/api/PresenceResource.d.ts +0 -158
  37. package/dist/types-ts4.5/api/TeamMentionResource.d.ts +0 -33
  38. package/dist/types-ts4.5/api/analytics.d.ts +0 -17
  39. package/dist/types-ts4.5/components/DisabledMentionTooltip/index.d.ts +0 -6
  40. package/dist/types-ts4.5/components/DisabledMentionTooltip/main.d.ts +0 -12
  41. package/dist/types-ts4.5/components/LockCircleIcon/index.d.ts +0 -7
  42. package/dist/types-ts4.5/components/Mention/PrimitiveMention.d.ts +0 -7
  43. package/dist/types-ts4.5/components/Mention/ResourcedMention.d.ts +0 -29
  44. package/dist/types-ts4.5/components/Mention/index.d.ts +0 -45
  45. package/dist/types-ts4.5/components/Mention/ufoExperiences.d.ts +0 -9
  46. package/dist/types-ts4.5/components/MentionAvatar/index.d.ts +0 -8
  47. package/dist/types-ts4.5/components/MentionDescriptionByline/TeamMentionDescriptionByline.d.ts +0 -7
  48. package/dist/types-ts4.5/components/MentionDescriptionByline/UserMentionDescriptionByline.d.ts +0 -5
  49. package/dist/types-ts4.5/components/MentionDescriptionByline/index.d.ts +0 -5
  50. package/dist/types-ts4.5/components/MentionDescriptionByline/styles.d.ts +0 -7
  51. package/dist/types-ts4.5/components/MentionDescriptionByline/types.d.ts +0 -4
  52. package/dist/types-ts4.5/components/MentionItem/MentionHighlightHelpers.d.ts +0 -3
  53. package/dist/types-ts4.5/components/MentionItem/index.d.ts +0 -19
  54. package/dist/types-ts4.5/components/MentionItem/styles.d.ts +0 -50
  55. package/dist/types-ts4.5/components/MentionList/index.d.ts +0 -43
  56. package/dist/types-ts4.5/components/MentionList/styles.d.ts +0 -10
  57. package/dist/types-ts4.5/components/MentionListError/GenericErrorIllustration.d.ts +0 -7
  58. package/dist/types-ts4.5/components/MentionListError/index.d.ts +0 -13
  59. package/dist/types-ts4.5/components/MentionListError/styles.d.ts +0 -7
  60. package/dist/types-ts4.5/components/MentionPicker/index.d.ts +0 -77
  61. package/dist/types-ts4.5/components/MentionPicker/styles.d.ts +0 -14
  62. package/dist/types-ts4.5/components/MessagesIntlProvider/index.d.ts +0 -3
  63. package/dist/types-ts4.5/components/NoAccessTooltip/index.d.ts +0 -6
  64. package/dist/types-ts4.5/components/NoAccessTooltip/main.d.ts +0 -7
  65. package/dist/types-ts4.5/components/Popup/index.d.ts +0 -25
  66. package/dist/types-ts4.5/components/ResourcedMentionList/index.d.ts +0 -46
  67. package/dist/types-ts4.5/components/Scrollable/index.d.ts +0 -10
  68. package/dist/types-ts4.5/components/Scrollable/styles.d.ts +0 -7
  69. package/dist/types-ts4.5/components/i18n.d.ts +0 -62
  70. package/dist/types-ts4.5/config/index.d.ts +0 -5
  71. package/dist/types-ts4.5/element.d.ts +0 -3
  72. package/dist/types-ts4.5/i18n/cs.d.ts +0 -21
  73. package/dist/types-ts4.5/i18n/da.d.ts +0 -21
  74. package/dist/types-ts4.5/i18n/de.d.ts +0 -21
  75. package/dist/types-ts4.5/i18n/en.d.ts +0 -21
  76. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -21
  77. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -21
  78. package/dist/types-ts4.5/i18n/es.d.ts +0 -21
  79. package/dist/types-ts4.5/i18n/et.d.ts +0 -20
  80. package/dist/types-ts4.5/i18n/fi.d.ts +0 -21
  81. package/dist/types-ts4.5/i18n/fr.d.ts +0 -21
  82. package/dist/types-ts4.5/i18n/hr.d.ts +0 -21
  83. package/dist/types-ts4.5/i18n/hu.d.ts +0 -21
  84. package/dist/types-ts4.5/i18n/index.d.ts +0 -37
  85. package/dist/types-ts4.5/i18n/is.d.ts +0 -24
  86. package/dist/types-ts4.5/i18n/it.d.ts +0 -21
  87. package/dist/types-ts4.5/i18n/ja.d.ts +0 -21
  88. package/dist/types-ts4.5/i18n/ko.d.ts +0 -21
  89. package/dist/types-ts4.5/i18n/languages.d.ts +0 -34
  90. package/dist/types-ts4.5/i18n/nb.d.ts +0 -21
  91. package/dist/types-ts4.5/i18n/nl.d.ts +0 -21
  92. package/dist/types-ts4.5/i18n/pl.d.ts +0 -21
  93. package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -21
  94. package/dist/types-ts4.5/i18n/pt_PT.d.ts +0 -20
  95. package/dist/types-ts4.5/i18n/ro.d.ts +0 -24
  96. package/dist/types-ts4.5/i18n/ru.d.ts +0 -21
  97. package/dist/types-ts4.5/i18n/sk.d.ts +0 -20
  98. package/dist/types-ts4.5/i18n/sl.d.ts +0 -21
  99. package/dist/types-ts4.5/i18n/sr_RS.d.ts +0 -21
  100. package/dist/types-ts4.5/i18n/sr_YR.d.ts +0 -21
  101. package/dist/types-ts4.5/i18n/sv.d.ts +0 -21
  102. package/dist/types-ts4.5/i18n/th.d.ts +0 -21
  103. package/dist/types-ts4.5/i18n/tr.d.ts +0 -21
  104. package/dist/types-ts4.5/i18n/uk.d.ts +0 -21
  105. package/dist/types-ts4.5/i18n/vi.d.ts +0 -21
  106. package/dist/types-ts4.5/i18n/zh.d.ts +0 -21
  107. package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -21
  108. package/dist/types-ts4.5/index.d.ts +0 -17
  109. package/dist/types-ts4.5/item.d.ts +0 -2
  110. package/dist/types-ts4.5/resource.d.ts +0 -10
  111. package/dist/types-ts4.5/shared-styles.d.ts +0 -5
  112. package/dist/types-ts4.5/team-resource.d.ts +0 -8
  113. package/dist/types-ts4.5/typeahead.d.ts +0 -3
  114. package/dist/types-ts4.5/types.d.ts +0 -320
  115. package/dist/types-ts4.5/util/analytics.d.ts +0 -12
  116. package/dist/types-ts4.5/util/atl-attribution.d.ts +0 -8
  117. package/dist/types-ts4.5/util/i18n.d.ts +0 -29
  118. package/dist/types-ts4.5/util/id.d.ts +0 -2
  119. package/dist/types-ts4.5/util/index.d.ts +0 -1
  120. package/dist/types-ts4.5/util/logger.d.ts +0 -4
  121. package/dist/types-ts4.5/util/mouse.d.ts +0 -8
@@ -1,106 +0,0 @@
1
- import { type AnalyticsCallback, type ErrorCallback, type InfoCallback, type InviteFlow, type MentionContextIdentifier, type MentionDescription, type MentionDisabledState, type MentionDisabledStateInput, type MentionNameDetails, type MentionProvider, type MentionResourceConfig, type MentionsResult, type MentionStats, type ResourceProvider, type ResultCallback, type UserRole } from '../types';
2
- export type { MentionStats, ResultCallback, ErrorCallback, InfoCallback, MentionResourceConfig, ResourceProvider, MentionContextIdentifier, MentionProvider, } from '../types';
3
- /**
4
- * Configuration for the TeamMentionResource, which extends {@link MentionResourceConfig}
5
- * to support fetching team mentions from a separate team search service endpoint.
6
- *
7
- * Used as the second argument when constructing a {@link TeamMentionResource}, alongside
8
- * a standard `MentionResourceConfig` for user mentions.
9
- */
10
- export interface TeamMentionResourceConfig extends MentionResourceConfig {
11
- /**
12
- * A custom resolver function to generate the URL for a team's profile page.
13
- * If not provided, a default link of `{window.location.origin}/people/team/{teamId}` is used.
14
- *
15
- * @param teamId - The ID of the team (with any ARI prefix already trimmed).
16
- * @returns The full URL to the team's profile page.
17
- */
18
- teamLinkResolver?: (teamId: string) => string;
19
- }
20
- /**
21
- * Support
22
- */
23
- export interface ResolvingMentionProvider extends MentionProvider {
24
- cacheMentionName(id: string, mentionName: string): void;
25
- resolveMentionName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
26
- supportsMentionNameResolving(): boolean;
27
- }
28
- declare class AbstractResource<Result> implements ResourceProvider<Result> {
29
- protected changeListeners: Map<string, ResultCallback<Result>>;
30
- protected errListeners: Map<string, ErrorCallback>;
31
- protected infoListeners: Map<string, InfoCallback>;
32
- protected allResultsListeners: Map<string, ResultCallback<Result>>;
33
- protected analyticsListeners: Map<string, AnalyticsCallback>;
34
- constructor();
35
- subscribe(key: string, callback?: ResultCallback<Result>, errCallback?: ErrorCallback, infoCallback?: InfoCallback, allResultsCallback?: ResultCallback<Result>, analyticsListeners?: AnalyticsCallback): void;
36
- unsubscribe(key: string): void;
37
- }
38
- declare class AbstractMentionResource extends AbstractResource<MentionDescription[]> implements MentionProvider {
39
- shouldHighlightMention(_mention: MentionDescription): boolean;
40
- filter(query?: string): void;
41
- recordMentionSelection(_mention: MentionDescription): void;
42
- isFiltering(_query: string): boolean;
43
- protected _notifyListeners(mentionsResult: MentionsResult, stats?: MentionStats): void;
44
- protected _notifyAllResultsListeners(mentionsResult: MentionsResult): void;
45
- protected _notifyErrorListeners(error: Error, query?: string): void;
46
- protected _notifyInfoListeners(info: string): void;
47
- protected _notifyAnalyticsListeners(event: string, actionSubject: string, action: string, attributes?: {
48
- [key: string]: any;
49
- }): void;
50
- }
51
- /**
52
- * Provides a Javascript API
53
- */
54
- export declare class MentionResource extends AbstractMentionResource implements ResolvingMentionProvider {
55
- private config;
56
- private lastReturnedSearch;
57
- private activeSearches;
58
- productName?: string;
59
- shouldEnableInvite: boolean;
60
- userRole: UserRole;
61
- onInviteItemClick?: (flow: InviteFlow) => void;
62
- inviteXProductUser?: (userId: string, mentionName: string) => Promise<void>;
63
- constructor(config: MentionResourceConfig);
64
- shouldHighlightMention(mention: MentionDescription): boolean;
65
- getMentionDisabledState(mention: MentionDisabledStateInput): MentionDisabledState | undefined;
66
- notify(searchTime: number, mentionResult: MentionsResult, query?: string): void;
67
- notifyError(error: Error, query?: string): void;
68
- filter(query?: string, contextIdentifier?: MentionContextIdentifier): Promise<void>;
69
- isFiltering(query: string): boolean;
70
- resolveMentionName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
71
- cacheMentionName(id: string, mentionName: string): void;
72
- supportsMentionNameResolving(): boolean;
73
- protected updateActiveSearches(query: string): void;
74
- protected verifyMentionConfig(config: MentionResourceConfig): void;
75
- private initialState;
76
- /**
77
- * Clear a context object to generate query params by removing empty
78
- * strings, `undefined` and empty values.
79
- *
80
- * @param contextIdentifier the current context identifier
81
- * @returns a safe context for query encoding
82
- */
83
- private clearContext;
84
- private getQueryParams;
85
- /**
86
- * Returns the initial mention display list before a search is performed for the specified
87
- * container.
88
- *
89
- * @param contextIdentifier
90
- * @returns Promise
91
- */
92
- protected remoteInitialState(contextIdentifier?: MentionContextIdentifier): Promise<MentionsResult>;
93
- private search;
94
- protected remoteSearch(query: string, contextIdentifier?: MentionContextIdentifier): Promise<MentionsResult>;
95
- private transformServiceResponse;
96
- }
97
- export declare class HttpError implements Error {
98
- name: string;
99
- message: string;
100
- statusCode: number;
101
- stack?: string;
102
- constructor(statusCode: number, statusMessage: string);
103
- }
104
- export declare const isResolvingMentionProvider: (p: any) => p is ResolvingMentionProvider;
105
- export { AbstractResource, AbstractMentionResource };
106
- export default MentionResource;
@@ -1,158 +0,0 @@
1
- import { type Presence } from '../types';
2
- import { AbstractResource, type ResourceProvider } from './MentionResource';
3
- export interface PresenceMap {
4
- [userId: string]: Presence;
5
- }
6
- /**
7
- * Configuration for the PresenceResource, which manages real-time user
8
- * presence (online/offline/busy/focus status) by querying a GraphQL-based
9
- * presence service.
10
- */
11
- export interface PresenceResourceConfig {
12
- /**
13
- * The activation ID for the current product instance, used to build
14
- * the `atl-attribution` header for presence service requests.
15
- */
16
- activationId?: string;
17
- /**
18
- * A custom cache implementation for storing presence data. If not provided,
19
- * a {@link DefaultPresenceCache} is used with the specified `cacheExpiry`.
20
- */
21
- cache?: PresenceCache;
22
- /**
23
- * The expiry time in milliseconds for cached presence entries.
24
- * Defaults to 20,000ms (20 seconds) when using the default cache.
25
- */
26
- cacheExpiry?: number;
27
- /**
28
- * The cloud ID (organization ID) of the Atlassian site. Required.
29
- * Used as the `organizationId` variable in the presence GraphQL query.
30
- */
31
- cloudId: string;
32
- /**
33
- * Custom HTTP headers to include in presence service requests.
34
- */
35
- headers?: Record<string, string>;
36
- /**
37
- * A custom parser for transforming raw presence service responses into
38
- * a {@link PresenceMap}. If not provided, a {@link DefaultPresenceParser} is used,
39
- * which maps `'available'` → `'online'` and `'unavailable'` → `'offline'`.
40
- */
41
- parser?: PresenceParser;
42
- /**
43
- * The product identifier (e.g. `'confluence'`, `'jira'`) passed as the
44
- * `product` variable in the presence GraphQL query to scope results.
45
- */
46
- productId?: string;
47
- /**
48
- * The base URL of the presence service endpoint. Required.
49
- * A trailing slash will be appended automatically if not present.
50
- */
51
- url: string;
52
- }
53
- export interface PresenceCache {
54
- contains(userId: string): boolean;
55
- get(userId: string): Presence;
56
- getBulk(userIds: string[]): PresenceMap;
57
- getMissingUserIds(userIds: string[]): string[];
58
- update(presUpdate: PresenceMap): void;
59
- }
60
- export interface PresenceResponse {
61
- data: Data;
62
- }
63
- export interface Data {
64
- PresenceBulk: PresenceBulk[];
65
- }
66
- export interface PresenceBulk {
67
- date: null | string;
68
- message: null | string;
69
- state: null | string;
70
- stateMetadata?: string;
71
- type: null | string;
72
- userId: string;
73
- }
74
- export interface PresenceParser {
75
- mapState(state: string): string;
76
- parse(response: PresenceResponse): PresenceMap;
77
- }
78
- export interface PresenceProvider extends ResourceProvider<PresenceMap> {
79
- refreshPresence(userIds: string[]): void;
80
- }
81
- declare class AbstractPresenceResource extends AbstractResource<PresenceMap> implements PresenceProvider {
82
- refreshPresence(userIds: string[]): void;
83
- protected notifyListeners(presences: PresenceMap): void;
84
- }
85
- declare class PresenceResource extends AbstractPresenceResource {
86
- private config;
87
- private presenceCache;
88
- private presenceParser;
89
- constructor(config: PresenceResourceConfig);
90
- refreshPresence(userIds: string[]): void;
91
- private retrievePresence;
92
- private queryDirectoryForPresences;
93
- private static cleanUrl;
94
- }
95
- export declare class DefaultPresenceCache implements PresenceCache {
96
- private static readonly defaultTimeout;
97
- private static readonly defaultFlushTrigger;
98
- private cache;
99
- private size;
100
- private expiryInMillis;
101
- private flushTrigger;
102
- constructor(cacheTimeout?: number, cacheTrigger?: number);
103
- /**
104
- * Precondition: _delete is only called internally if userId exists in cache
105
- * Removes cache entry
106
- * @param userId
107
- */
108
- private _delete;
109
- /**
110
- * Checks a cache entry and calls delete if the info has expired
111
- * @param userId
112
- */
113
- private _deleteIfExpired;
114
- /**
115
- * Cleans expired entries from cache
116
- */
117
- private _removeExpired;
118
- /**
119
- * Checks if a user exists in the cache
120
- * @param userId
121
- */
122
- contains(userId: string): boolean;
123
- /**
124
- * Retrieves a presence from the cache after checking for expired entries
125
- * @param userId - to index the cache
126
- * @returns Presence - the presence that matches the userId
127
- */
128
- get(userId: string): Presence;
129
- /**
130
- * Retrieve multiple presences at once from the cache
131
- * @param userIds - to index the cache
132
- * @returns PresenceMap - A map of userIds to cached Presences
133
- */
134
- getBulk(userIds: string[]): PresenceMap;
135
- /**
136
- * For a given list of ids, returns a subset
137
- * of all the ids with missing cache entries.
138
- * @param userIds - to index the cache
139
- * @returns string[] - ids missing from the cache
140
- */
141
- getMissingUserIds(userIds: string[]): string[];
142
- /**
143
- * Precondition: presMap only contains ids of users not in cache
144
- * expired users must first be removed then reinserted with updated presence
145
- * Updates the cache by adding the new Presence entries and setting the expiry time
146
- * @param presMap
147
- */
148
- update(presMap: PresenceMap): void;
149
- }
150
- export declare class DefaultPresenceParser implements PresenceParser {
151
- static FOCUS_STATE: string;
152
- mapState(state: string): string;
153
- parse(response: PresenceResponse): PresenceMap;
154
- private static extractState;
155
- private static isFocusState;
156
- }
157
- export { AbstractPresenceResource };
158
- export default PresenceResource;
@@ -1,33 +0,0 @@
1
- import { type MentionsResult } from '../types';
2
- import MentionResource, { type MentionContextIdentifier, type MentionResourceConfig, type TeamMentionResourceConfig, type 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
- }
@@ -1,17 +0,0 @@
1
- import { type 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
- pickerType: 'mentions';
14
- sessionId: string;
15
- source: 'smarts';
16
- };
17
- export declare const defaultAttributes: (context?: MentionContextIdentifier) => DefaultAttributes;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- declare const AsyncDisabledMentionTooltip: React.LazyExoticComponent<({ tooltip, children }: {
3
- children: React.ReactNode;
4
- tooltip: string;
5
- }) => React.JSX.Element>;
6
- export default AsyncDisabledMentionTooltip;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- type Props = {
3
- children: React.ReactNode;
4
- tooltip: string;
5
- };
6
- /**
7
- * Wraps a disabled `<Mention>` chip with a tooltip explaining why the chip
8
- * is disabled. The chip itself remains non-interactive; the tooltip is the
9
- * sole hover affordance.
10
- */
11
- export declare const DisabledMentionTooltip: ({ tooltip, children }: Props) => React.JSX.Element;
12
- export {};
@@ -1,7 +0,0 @@
1
- import type { NewCoreIconProps } from '@atlaskit/icon';
2
- import { type LazyExoticComponent } from 'react';
3
- declare const AsyncLockCircleIcon: LazyExoticComponent<{
4
- (props: NewCoreIconProps): JSX.Element;
5
- displayName: string;
6
- }>;
7
- export default AsyncLockCircleIcon;
@@ -1,7 +0,0 @@
1
- import { MentionType } from '../../types';
2
- import { type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';
3
- export interface PrimitiveMentionProps extends HTMLAttributes<HTMLSpanElement> {
4
- mentionType: MentionType;
5
- }
6
- declare const PrimitiveMention: ForwardRefExoticComponent<PrimitiveMentionProps & RefAttributes<HTMLSpanElement>>;
7
- export default PrimitiveMention;
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import { type MentionProvider } from '../../api/MentionResource';
3
- import { type MentionEventHandler } from '../../types';
4
- export interface Props {
5
- accessLevel?: string;
6
- id: string;
7
- localId?: string;
8
- mentionProvider?: Promise<MentionProvider>;
9
- onClick?: MentionEventHandler;
10
- onMouseEnter?: MentionEventHandler;
11
- onMouseLeave?: MentionEventHandler;
12
- ssrPlaceholderId?: string;
13
- text: string;
14
- }
15
- export interface State {
16
- isHighlighted: boolean;
17
- resolvedMentionName?: string;
18
- }
19
- export default class ResourcedMention extends React.PureComponent<Props, State> {
20
- _isMounted: boolean;
21
- constructor(props: Props);
22
- componentDidMount(): void;
23
- componentWillUnmount(): void;
24
- UNSAFE_componentWillReceiveProps(nextProps: Props): void;
25
- private setStateSafely;
26
- private processName;
27
- private handleMentionProvider;
28
- render(): React.JSX.Element;
29
- }
@@ -1,45 +0,0 @@
1
- import React from 'react';
2
- import { type MentionEventHandler } from '../../types';
3
- import { type 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
- accessLevel?: string;
8
- /**
9
- * Tooltip text shown on hover when the chip is disabled. Ignored when
10
- * `isDisabled` is false. When omitted, no tooltip is rendered even if
11
- * `isDisabled` is true.
12
- */
13
- disabledTooltip?: string;
14
- id: string;
15
- /**
16
- * When true, the mention chip is rendered in its disabled visual state
17
- * (`MentionType.DISABLED`) and click handlers are not invoked. Takes
18
- * precedence over `isHighlighted` and the restricted state.
19
- */
20
- isDisabled?: boolean;
21
- isHighlighted?: boolean;
22
- localId?: string;
23
- onClick?: MentionEventHandler;
24
- onHover?: () => void;
25
- onMouseEnter?: MentionEventHandler;
26
- onMouseLeave?: MentionEventHandler;
27
- ssrPlaceholderId?: string;
28
- text: string;
29
- };
30
- export type Props = OwnProps & WithAnalyticsEventsProps;
31
- export declare class MentionInternal extends React.PureComponent<Props, {}> {
32
- private hoverTimeout?;
33
- constructor(props: Props);
34
- componentDidMount(): void;
35
- private handleOnClick;
36
- private handleOnMouseEnter;
37
- private handleOnMouseLeave;
38
- private getMentionType;
39
- componentWillUnmount(): void;
40
- renderUnknownUserError(id: string): React.JSX.Element;
41
- render(): React.JSX.Element;
42
- }
43
- declare const Mention: React.ForwardRefExoticComponent<Omit<OwnProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
44
- type Mention = MentionInternal;
45
- export default Mention;
@@ -1,9 +0,0 @@
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<React.PropsWithChildren<{
5
- id: string;
6
- }>> {
7
- componentDidCatch(): void;
8
- render(): React.ReactNode;
9
- }
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { type MentionDescription } from '../../types';
3
- type MentionAvatarProps = {
4
- mention: MentionDescription;
5
- selected?: boolean;
6
- };
7
- export declare const MentionAvatar: ({ mention, selected }: MentionAvatarProps) => React.JSX.Element;
8
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { type DescriptionBylineProps } from './types';
3
- export default class TeamMentionDescriptionByline extends React.PureComponent<DescriptionBylineProps> {
4
- private renderByline;
5
- private getBylineComponent;
6
- render(): React.JSX.Element | null;
7
- }
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { type DescriptionBylineProps } from './types';
3
- export default class UserMentionDescriptionByline extends React.PureComponent<DescriptionBylineProps, {}> {
4
- render(): React.JSX.Element | null;
5
- }
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { type DescriptionBylineProps } from './types';
3
- export default class MentionDescriptionByline extends React.PureComponent<DescriptionBylineProps, {}> {
4
- render(): React.JSX.Element;
5
- }
@@ -1,7 +0,0 @@
1
- import { type StyledComponent } from '@emotion/styled';
2
- import type { Theme } from '@emotion/react';
3
- import type { DetailedHTMLProps, HTMLAttributes } from 'react';
4
- export declare const DescriptionBylineStyle: StyledComponent<{
5
- theme?: Theme;
6
- as?: React.ElementType;
7
- }, DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,4 +0,0 @@
1
- import { type MentionDescription } from '../../types';
2
- export interface DescriptionBylineProps {
3
- mention: MentionDescription;
4
- }
@@ -1,3 +0,0 @@
1
- import React, { type ComponentType } from 'react';
2
- import { type HighlightDetail } from '../../types';
3
- export declare function renderHighlight(ReactComponent: ComponentType<any>, value?: string, highlights?: HighlightDetail[], prefix?: string): React.JSX.Element | null;
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { type MentionDescription, type OnMentionEvent } from '../../types';
3
- export { MENTION_ITEM_HEIGHT, MENTION_ITEM_HEIGHT_REFRESHED } from './styles';
4
- export interface Props {
5
- forwardedRef?: React.Ref<HTMLDivElement>;
6
- height?: number;
7
- mention: MentionDescription;
8
- onMouseEnter?: OnMentionEvent;
9
- onMouseMove?: OnMentionEvent;
10
- onSelection?: OnMentionEvent;
11
- selected?: boolean;
12
- }
13
- export default class MentionItem extends React.PureComponent<Props, {}> {
14
- private onMentionSelected;
15
- private onMentionMenuItemMouseMove;
16
- private onMentionMenuItemMouseEnter;
17
- render(): React.JSX.Element;
18
- }
19
- export declare const MentionItemWithRef: React.ForwardRefExoticComponent<Omit<Props, 'forwardedRef'> & React.RefAttributes<HTMLDivElement>>;
@@ -1,50 +0,0 @@
1
- import { type StyledComponent } from '@emotion/styled';
2
- import type { Theme } from '@emotion/react';
3
- import type { DetailedHTMLProps, HTMLAttributes } from 'react';
4
- export interface MentionItemStyleProps {
5
- height?: number;
6
- selected?: boolean;
7
- }
8
- export interface AvatarSectionStyleProps {
9
- restricted?: boolean;
10
- }
11
- export interface NameSectionStyleProps {
12
- restricted?: boolean;
13
- }
14
- export interface InfoSectionStyleProps {
15
- restricted?: boolean;
16
- }
17
- export declare const RowStyle: StyledComponent<{
18
- as?: React.ElementType;
19
- theme?: Theme;
20
- }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
21
- export declare const AvatarStyle: StyledComponent<{
22
- as?: React.ElementType;
23
- theme?: Theme;
24
- } & AvatarSectionStyleProps, DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
25
- export declare const NameSectionStyle: StyledComponent<{
26
- as?: React.ElementType;
27
- theme?: Theme;
28
- } & NameSectionStyleProps, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
29
- export declare const FullNameStyle: StyledComponent<{
30
- as?: React.ElementType;
31
- theme?: Theme;
32
- }, DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
33
- export declare const InfoSectionStyle: StyledComponent<{
34
- as?: React.ElementType;
35
- theme?: Theme;
36
- } & InfoSectionStyleProps, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
37
- export declare const TimeStyle: StyledComponent<{
38
- as?: React.ElementType;
39
- theme?: Theme;
40
- }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
41
- export declare const MENTION_ITEM_HEIGHT = 48;
42
- export declare const MENTION_ITEM_HEIGHT_REFRESHED = 44;
43
- export declare const MentionItemStyle: StyledComponent<{
44
- as?: React.ElementType;
45
- theme?: Theme;
46
- } & MentionItemStyleProps, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
47
- export declare const AccessSectionStyle: StyledComponent<{
48
- as?: React.ElementType;
49
- theme?: Theme;
50
- }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,43 +0,0 @@
1
- import React from 'react';
2
- import { type MentionDescription, type OnMentionEvent } from '../../types';
3
- import type MentionItem from '../MentionItem';
4
- export interface Props {
5
- initialHighlightElement?: React.ReactElement | null;
6
- mentions: MentionDescription[];
7
- onSelection?: OnMentionEvent;
8
- resourceError?: Error;
9
- }
10
- export interface State {
11
- selectedIndex: number;
12
- selectedKey?: string;
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 itemsRefs;
21
- constructor(props: Props);
22
- createItemRef(key: string): React.RefObject<HTMLDivElement>;
23
- getItemRef(key: string): React.RefObject<HTMLDivElement> | undefined;
24
- UNSAFE_componentWillReceiveProps(nextProps: Props): void;
25
- componentDidUpdate(): void;
26
- selectNext: () => void;
27
- selectPrevious: () => void;
28
- selectIndex: (index: number, callback?: () => any) => void;
29
- selectId: (id: string, callback?: () => any) => void;
30
- chooseCurrentSelection: () => void;
31
- mentionsCount: () => number;
32
- private revealItem;
33
- /**
34
- * The default selection state is to chose index 0 and not have any particular key selected
35
- */
36
- private setDefaultSelectionState;
37
- private selectIndexOnHover;
38
- private itemSelected;
39
- private renderItems;
40
- private isSelectedMention;
41
- private handleScrollableRef;
42
- render(): React.JSX.Element;
43
- }
@@ -1,10 +0,0 @@
1
- import { type StyledComponent } from '@emotion/styled';
2
- import type { Theme } from '@emotion/react';
3
- import type { DetailedHTMLProps, HTMLAttributes } from 'react';
4
- export interface MentionListStyleProps {
5
- empty?: boolean;
6
- }
7
- export declare const MentionListStyle: StyledComponent<{
8
- theme?: Theme;
9
- as?: React.ElementType;
10
- } & MentionListStyleProps, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- export interface Props {
3
- title?: string;
4
- }
5
- export declare class GenericErrorIllustration extends React.PureComponent<Props, {}> {
6
- render(): React.JSX.Element;
7
- }
@@ -1,13 +0,0 @@
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(): React.JSX.Element;
13
- }
@@ -1,7 +0,0 @@
1
- import { type StyledComponent } from '@emotion/styled';
2
- import type { Theme } from '@emotion/react';
3
- import type { DetailedHTMLProps, HTMLAttributes } from 'react';
4
- export declare const GenericErrorVisualStyle: StyledComponent<{
5
- theme?: Theme;
6
- as?: React.ElementType;
7
- }, DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;