@atlaskit/mention 26.1.0 → 26.3.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 (147) hide show
  1. package/CHANGELOG.md +78 -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/api/ContextMentionResource.js +14 -0
  6. package/dist/cjs/api/MentionResource.js +6 -0
  7. package/dist/cjs/components/DisabledMentionTooltip/index.js +20 -0
  8. package/dist/cjs/components/DisabledMentionTooltip/main.js +24 -0
  9. package/dist/cjs/components/Mention/PrimitiveMention.js +8 -1
  10. package/dist/cjs/components/Mention/index.js +51 -12
  11. package/dist/cjs/components/MentionAvatar/index.js +6 -1
  12. package/dist/cjs/types.js +10 -0
  13. package/dist/cjs/util/analytics.js +1 -1
  14. package/dist/es2019/api/ContextMentionResource.js +12 -0
  15. package/dist/es2019/api/MentionResource.js +4 -0
  16. package/dist/es2019/components/DisabledMentionTooltip/index.js +7 -0
  17. package/dist/es2019/components/DisabledMentionTooltip/main.js +14 -0
  18. package/dist/es2019/components/Mention/PrimitiveMention.js +8 -0
  19. package/dist/es2019/components/Mention/index.js +50 -12
  20. package/dist/es2019/components/MentionAvatar/index.js +7 -2
  21. package/dist/es2019/types.js +12 -0
  22. package/dist/es2019/util/analytics.js +1 -1
  23. package/dist/esm/api/ContextMentionResource.js +14 -0
  24. package/dist/esm/api/MentionResource.js +6 -0
  25. package/dist/esm/components/DisabledMentionTooltip/index.js +9 -0
  26. package/dist/esm/components/DisabledMentionTooltip/main.js +17 -0
  27. package/dist/esm/components/Mention/PrimitiveMention.js +8 -1
  28. package/dist/esm/components/Mention/index.js +51 -12
  29. package/dist/esm/components/MentionAvatar/index.js +7 -2
  30. package/dist/esm/types.js +12 -0
  31. package/dist/esm/util/analytics.js +1 -1
  32. package/dist/types/api/ContextMentionResource.d.ts +6 -1
  33. package/dist/types/api/MentionResource.d.ts +2 -1
  34. package/dist/types/components/DisabledMentionTooltip/index.d.ts +6 -0
  35. package/dist/types/components/DisabledMentionTooltip/main.d.ts +12 -0
  36. package/dist/types/components/Mention/index.d.ts +12 -0
  37. package/dist/types/types.d.ts +67 -1
  38. package/docs/0-intro.tsx +21 -0
  39. package/element/package.json +1 -8
  40. package/item/package.json +1 -8
  41. package/mention/package.json +1 -8
  42. package/mention-item/package.json +1 -8
  43. package/mention-item/styles/package.json +1 -8
  44. package/mention-list/package.json +1 -8
  45. package/mention-name-client/package.json +1 -8
  46. package/mention-name-resolver/package.json +1 -8
  47. package/mention-picker/package.json +1 -8
  48. package/mention-resource/package.json +1 -8
  49. package/package.json +10 -5
  50. package/presence-resource/package.json +1 -8
  51. package/resource/package.json +1 -8
  52. package/resourced-mention/package.json +1 -8
  53. package/resourced-mention-list/package.json +1 -8
  54. package/shared-styles/package.json +1 -8
  55. package/team-mention-resource/package.json +1 -8
  56. package/team-resource/package.json +1 -8
  57. package/typeahead/package.json +1 -8
  58. package/types/package.json +1 -8
  59. package/dist/types-ts4.5/_constants.d.ts +0 -1
  60. package/dist/types-ts4.5/api/ContextMentionResource.d.ts +0 -23
  61. package/dist/types-ts4.5/api/MentionNameClient.d.ts +0 -11
  62. package/dist/types-ts4.5/api/MentionNameResolver.d.ts +0 -38
  63. package/dist/types-ts4.5/api/MentionResource.d.ts +0 -105
  64. package/dist/types-ts4.5/api/PresenceResource.d.ts +0 -158
  65. package/dist/types-ts4.5/api/TeamMentionResource.d.ts +0 -33
  66. package/dist/types-ts4.5/api/analytics.d.ts +0 -17
  67. package/dist/types-ts4.5/components/LockCircleIcon/index.d.ts +0 -7
  68. package/dist/types-ts4.5/components/Mention/PrimitiveMention.d.ts +0 -7
  69. package/dist/types-ts4.5/components/Mention/ResourcedMention.d.ts +0 -29
  70. package/dist/types-ts4.5/components/Mention/index.d.ts +0 -33
  71. package/dist/types-ts4.5/components/Mention/ufoExperiences.d.ts +0 -9
  72. package/dist/types-ts4.5/components/MentionAvatar/index.d.ts +0 -8
  73. package/dist/types-ts4.5/components/MentionDescriptionByline/TeamMentionDescriptionByline.d.ts +0 -7
  74. package/dist/types-ts4.5/components/MentionDescriptionByline/UserMentionDescriptionByline.d.ts +0 -5
  75. package/dist/types-ts4.5/components/MentionDescriptionByline/index.d.ts +0 -5
  76. package/dist/types-ts4.5/components/MentionDescriptionByline/styles.d.ts +0 -7
  77. package/dist/types-ts4.5/components/MentionDescriptionByline/types.d.ts +0 -4
  78. package/dist/types-ts4.5/components/MentionItem/MentionHighlightHelpers.d.ts +0 -3
  79. package/dist/types-ts4.5/components/MentionItem/index.d.ts +0 -19
  80. package/dist/types-ts4.5/components/MentionItem/styles.d.ts +0 -50
  81. package/dist/types-ts4.5/components/MentionList/index.d.ts +0 -43
  82. package/dist/types-ts4.5/components/MentionList/styles.d.ts +0 -10
  83. package/dist/types-ts4.5/components/MentionListError/GenericErrorIllustration.d.ts +0 -7
  84. package/dist/types-ts4.5/components/MentionListError/index.d.ts +0 -13
  85. package/dist/types-ts4.5/components/MentionListError/styles.d.ts +0 -7
  86. package/dist/types-ts4.5/components/MentionPicker/index.d.ts +0 -77
  87. package/dist/types-ts4.5/components/MentionPicker/styles.d.ts +0 -14
  88. package/dist/types-ts4.5/components/MessagesIntlProvider/index.d.ts +0 -3
  89. package/dist/types-ts4.5/components/NoAccessTooltip/index.d.ts +0 -6
  90. package/dist/types-ts4.5/components/NoAccessTooltip/main.d.ts +0 -7
  91. package/dist/types-ts4.5/components/Popup/index.d.ts +0 -25
  92. package/dist/types-ts4.5/components/ResourcedMentionList/index.d.ts +0 -46
  93. package/dist/types-ts4.5/components/Scrollable/index.d.ts +0 -10
  94. package/dist/types-ts4.5/components/Scrollable/styles.d.ts +0 -7
  95. package/dist/types-ts4.5/components/i18n.d.ts +0 -62
  96. package/dist/types-ts4.5/config/index.d.ts +0 -5
  97. package/dist/types-ts4.5/element.d.ts +0 -3
  98. package/dist/types-ts4.5/i18n/cs.d.ts +0 -21
  99. package/dist/types-ts4.5/i18n/da.d.ts +0 -21
  100. package/dist/types-ts4.5/i18n/de.d.ts +0 -21
  101. package/dist/types-ts4.5/i18n/en.d.ts +0 -21
  102. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -21
  103. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -21
  104. package/dist/types-ts4.5/i18n/es.d.ts +0 -21
  105. package/dist/types-ts4.5/i18n/et.d.ts +0 -20
  106. package/dist/types-ts4.5/i18n/fi.d.ts +0 -21
  107. package/dist/types-ts4.5/i18n/fr.d.ts +0 -21
  108. package/dist/types-ts4.5/i18n/hr.d.ts +0 -21
  109. package/dist/types-ts4.5/i18n/hu.d.ts +0 -21
  110. package/dist/types-ts4.5/i18n/index.d.ts +0 -37
  111. package/dist/types-ts4.5/i18n/is.d.ts +0 -24
  112. package/dist/types-ts4.5/i18n/it.d.ts +0 -21
  113. package/dist/types-ts4.5/i18n/ja.d.ts +0 -21
  114. package/dist/types-ts4.5/i18n/ko.d.ts +0 -21
  115. package/dist/types-ts4.5/i18n/languages.d.ts +0 -34
  116. package/dist/types-ts4.5/i18n/nb.d.ts +0 -21
  117. package/dist/types-ts4.5/i18n/nl.d.ts +0 -21
  118. package/dist/types-ts4.5/i18n/pl.d.ts +0 -21
  119. package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -21
  120. package/dist/types-ts4.5/i18n/pt_PT.d.ts +0 -20
  121. package/dist/types-ts4.5/i18n/ro.d.ts +0 -24
  122. package/dist/types-ts4.5/i18n/ru.d.ts +0 -21
  123. package/dist/types-ts4.5/i18n/sk.d.ts +0 -20
  124. package/dist/types-ts4.5/i18n/sl.d.ts +0 -21
  125. package/dist/types-ts4.5/i18n/sr_RS.d.ts +0 -21
  126. package/dist/types-ts4.5/i18n/sr_YR.d.ts +0 -21
  127. package/dist/types-ts4.5/i18n/sv.d.ts +0 -21
  128. package/dist/types-ts4.5/i18n/th.d.ts +0 -21
  129. package/dist/types-ts4.5/i18n/tr.d.ts +0 -21
  130. package/dist/types-ts4.5/i18n/uk.d.ts +0 -21
  131. package/dist/types-ts4.5/i18n/vi.d.ts +0 -21
  132. package/dist/types-ts4.5/i18n/zh.d.ts +0 -21
  133. package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -21
  134. package/dist/types-ts4.5/index.d.ts +0 -17
  135. package/dist/types-ts4.5/item.d.ts +0 -2
  136. package/dist/types-ts4.5/resource.d.ts +0 -10
  137. package/dist/types-ts4.5/shared-styles.d.ts +0 -5
  138. package/dist/types-ts4.5/team-resource.d.ts +0 -8
  139. package/dist/types-ts4.5/typeahead.d.ts +0 -3
  140. package/dist/types-ts4.5/types.d.ts +0 -254
  141. package/dist/types-ts4.5/util/analytics.d.ts +0 -12
  142. package/dist/types-ts4.5/util/atl-attribution.d.ts +0 -8
  143. package/dist/types-ts4.5/util/i18n.d.ts +0 -29
  144. package/dist/types-ts4.5/util/id.d.ts +0 -2
  145. package/dist/types-ts4.5/util/index.d.ts +0 -1
  146. package/dist/types-ts4.5/util/logger.d.ts +0 -4
  147. package/dist/types-ts4.5/util/mouse.d.ts +0 -8
package/package.json CHANGED
@@ -33,12 +33,12 @@
33
33
  "@atlaskit/focus-ring": "^3.1.0",
34
34
  "@atlaskit/heading": "^5.4.0",
35
35
  "@atlaskit/icon": "^35.4.0",
36
- "@atlaskit/lozenge": "^13.8.0",
36
+ "@atlaskit/lozenge": "^13.9.0",
37
37
  "@atlaskit/platform-feature-flags": "^1.1.0",
38
38
  "@atlaskit/primitives": "^19.0.0",
39
- "@atlaskit/tag": "^14.15.0",
39
+ "@atlaskit/tag": "^14.16.0",
40
40
  "@atlaskit/teams-avatar": "^2.7.0",
41
- "@atlaskit/tokens": "^13.1.0",
41
+ "@atlaskit/tokens": "^13.4.0",
42
42
  "@atlaskit/tooltip": "^22.6.0",
43
43
  "@atlaskit/ufo": "^0.5.0",
44
44
  "@atlaskit/util-service-support": "^6.4.0",
@@ -53,10 +53,11 @@
53
53
  "@af/integration-testing": "workspace:^",
54
54
  "@af/search-test-utils": "workspace:^",
55
55
  "@af/visual-regression": "workspace:^",
56
- "@atlassian/a11y-jest-testing": "^0.11.0",
56
+ "@atlassian/a11y-jest-testing": "^0.12.0",
57
57
  "@atlassian/a11y-playwright-testing": "^0.10.0",
58
58
  "@atlassian/feature-flags-test-utils": "^1.1.0",
59
59
  "@atlassian/react-compiler-gating": "workspace:^",
60
+ "@atlassian/testing-library": "^0.6.0",
60
61
  "@testing-library/react": "^16.3.0",
61
62
  "@testing-library/user-event": "^14.4.3",
62
63
  "@types/query-string": "^4.3.1",
@@ -88,6 +89,10 @@
88
89
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
89
90
  },
90
91
  "platform-feature-flags": {
92
+ "rovo_chat_agent_selection": {
93
+ "type": "boolean",
94
+ "referenceOnly": true
95
+ },
91
96
  "jira_ai_agent_avatar_issue_view_comment_mentions": {
92
97
  "type": "boolean"
93
98
  },
@@ -120,5 +125,5 @@
120
125
  ]
121
126
  }
122
127
  },
123
- "version": "26.1.0"
128
+ "version": "26.3.0"
124
129
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/api/PresenceResource.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/api/PresenceResource.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/api/PresenceResource.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/resource.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/resource.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/resource.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/components/Mention/ResourcedMention.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/components/Mention/ResourcedMention.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/components/Mention/ResourcedMention.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/components/ResourcedMentionList/index.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/components/ResourcedMentionList/index.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/components/ResourcedMentionList/index.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/shared-styles.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/shared-styles.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/shared-styles.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/api/TeamMentionResource.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/api/TeamMentionResource.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/api/TeamMentionResource.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/team-resource.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/team-resource.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/team-resource.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/typeahead.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/typeahead.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/typeahead.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/types.d.ts"
17
10
  }
@@ -1 +0,0 @@
1
- export declare const ELEMENTS_CHANNEL = "fabric-elements";
@@ -1,23 +0,0 @@
1
- import { type MentionProvider, type MentionContextIdentifier, ErrorCallback, InfoCallback, ResultCallback } from './MentionResource';
2
- import { type MentionDescription, type InviteFromMentionProvider, type XProductInviteMentionProvider, type AnalyticsCallback } 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 | keyof XProductInviteMentionProvider>;
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 keyof MentionProviderFunctions>(f: K, declaredArgs: number) => MentionProvider[K];
16
- callDefault: <K extends keyof MentionProviderFunctions>(f: K) => MentionProvider[K];
17
- subscribe: (key: string, callback?: ResultCallback<MentionDescription[]> | undefined, errCallback?: ErrorCallback, infoCallback?: InfoCallback, allResultsCallback?: ResultCallback<MentionDescription[]> | undefined, analyticsCallback?: AnalyticsCallback) => void;
18
- unsubscribe: (key: string) => void;
19
- filter: (query?: string, contextIdentifier?: MentionContextIdentifier) => void;
20
- recordMentionSelection: (mention: MentionDescription, contextIdentifier?: MentionContextIdentifier) => void;
21
- shouldHighlightMention: (mention: MentionDescription) => boolean;
22
- isFiltering: (query: string) => boolean;
23
- }
@@ -1,11 +0,0 @@
1
- import { type 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
- */
@@ -1,38 +0,0 @@
1
- import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
2
- import { type MentionNameDetails, type MentionNameResolver } from '../types';
3
- import { type MentionNameClient } from './MentionNameClient';
4
- interface Callback {
5
- (value: MentionNameDetails): void;
6
- }
7
- export type { MentionNameResolver } from '../types';
8
- /** A queue for user ids */
9
- type Queue = Map<string, Callback[]>;
10
- export declare class DefaultMentionNameResolver implements MentionNameResolver {
11
- static waitForBatch: number;
12
- private static waitForResolveAll;
13
- private client;
14
- private nameCache;
15
- private nameQueue;
16
- private nameStartTime;
17
- private processingQueue;
18
- private debounce;
19
- private debounceOnResolve;
20
- private onResolvedAll;
21
- private isOnResolvedAllCalled;
22
- private fireHydrationEvent;
23
- constructor(client: MentionNameClient, analyticsProps?: WithAnalyticsEventsProps, onResolvedAll?: () => void);
24
- lookupName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
25
- cacheName(id: string, name: string): void;
26
- private scheduleProcessQueue;
27
- private scheduleOnAllResolved;
28
- private isQueueAtLimit;
29
- private splitQueueAtLimit;
30
- private resolveQueueItem;
31
- private processQueue;
32
- private fireAnalytics;
33
- }
34
- /**
35
- * Merge the two queues making sure to merge callback arrays for items in queueB already in queueA.
36
- * This addresses [this ticket](https://product-fabric.atlassian.net/browse/QS-3789).
37
- */
38
- export declare function mergeNameResolverQueues(queueA: Queue, queueB: Queue): Queue;
@@ -1,105 +0,0 @@
1
- import { type AnalyticsCallback, type ErrorCallback, type InfoCallback, type InviteFlow, type MentionContextIdentifier, type MentionDescription, 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
- notify(searchTime: number, mentionResult: MentionsResult, query?: string): void;
66
- notifyError(error: Error, query?: string): void;
67
- filter(query?: string, contextIdentifier?: MentionContextIdentifier): Promise<void>;
68
- isFiltering(query: string): boolean;
69
- resolveMentionName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
70
- cacheMentionName(id: string, mentionName: string): void;
71
- supportsMentionNameResolving(): boolean;
72
- protected updateActiveSearches(query: string): void;
73
- protected verifyMentionConfig(config: MentionResourceConfig): void;
74
- private initialState;
75
- /**
76
- * Clear a context object to generate query params by removing empty
77
- * strings, `undefined` and empty values.
78
- *
79
- * @param contextIdentifier the current context identifier
80
- * @returns a safe context for query encoding
81
- */
82
- private clearContext;
83
- private getQueryParams;
84
- /**
85
- * Returns the initial mention display list before a search is performed for the specified
86
- * container.
87
- *
88
- * @param contextIdentifier
89
- * @returns Promise
90
- */
91
- protected remoteInitialState(contextIdentifier?: MentionContextIdentifier): Promise<MentionsResult>;
92
- private search;
93
- protected remoteSearch(query: string, contextIdentifier?: MentionContextIdentifier): Promise<MentionsResult>;
94
- private transformServiceResponse;
95
- }
96
- export declare class HttpError implements Error {
97
- name: string;
98
- message: string;
99
- statusCode: number;
100
- stack?: string;
101
- constructor(statusCode: number, statusMessage: string);
102
- }
103
- export declare const isResolvingMentionProvider: (p: any) => p is ResolvingMentionProvider;
104
- export { AbstractResource, AbstractMentionResource };
105
- 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,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,33 +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
- id: string;
9
- isHighlighted?: boolean;
10
- localId?: string;
11
- onClick?: MentionEventHandler;
12
- onHover?: () => void;
13
- onMouseEnter?: MentionEventHandler;
14
- onMouseLeave?: MentionEventHandler;
15
- ssrPlaceholderId?: string;
16
- text: string;
17
- };
18
- export type Props = OwnProps & WithAnalyticsEventsProps;
19
- export declare class MentionInternal extends React.PureComponent<Props, {}> {
20
- private hoverTimeout?;
21
- constructor(props: Props);
22
- componentDidMount(): void;
23
- private handleOnClick;
24
- private handleOnMouseEnter;
25
- private handleOnMouseLeave;
26
- private getMentionType;
27
- componentWillUnmount(): void;
28
- renderUnknownUserError(id: string): React.JSX.Element;
29
- render(): React.JSX.Element;
30
- }
31
- declare const Mention: React.ForwardRefExoticComponent<Omit<OwnProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
32
- type Mention = MentionInternal;
33
- 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
- }