@atlaskit/mention 24.2.9 → 24.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/afm-cc/tsconfig.json +2 -2
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/api/MentionResource.d.ts +1 -1
- package/dist/types/api/PresenceResource.d.ts +6 -6
- package/dist/types/api/analytics.d.ts +1 -1
- package/dist/types/components/Mention/ResourcedMention.d.ts +2 -2
- package/dist/types/components/Mention/index.d.ts +3 -3
- package/dist/types/components/MentionAvatar/index.d.ts +1 -1
- package/dist/types/components/MentionItem/index.d.ts +2 -2
- package/dist/types/components/MentionList/index.d.ts +3 -3
- package/dist/types/components/MentionPicker/index.d.ts +8 -8
- package/dist/types/components/NoAccessTooltip/index.d.ts +1 -1
- package/dist/types/components/NoAccessTooltip/main.d.ts +1 -1
- package/dist/types/components/Popup/index.d.ts +3 -3
- package/dist/types/components/ResourcedMentionList/index.d.ts +3 -3
- package/dist/types/types.d.ts +28 -28
- package/dist/types/util/i18n.d.ts +1 -1
- package/dist/types-ts4.5/api/MentionResource.d.ts +1 -1
- package/dist/types-ts4.5/api/PresenceResource.d.ts +6 -6
- package/dist/types-ts4.5/api/analytics.d.ts +1 -1
- package/dist/types-ts4.5/components/Mention/ResourcedMention.d.ts +2 -2
- package/dist/types-ts4.5/components/Mention/index.d.ts +3 -3
- package/dist/types-ts4.5/components/MentionAvatar/index.d.ts +1 -1
- package/dist/types-ts4.5/components/MentionItem/index.d.ts +2 -2
- package/dist/types-ts4.5/components/MentionList/index.d.ts +3 -3
- package/dist/types-ts4.5/components/MentionPicker/index.d.ts +8 -8
- package/dist/types-ts4.5/components/NoAccessTooltip/index.d.ts +1 -1
- package/dist/types-ts4.5/components/NoAccessTooltip/main.d.ts +1 -1
- package/dist/types-ts4.5/components/Popup/index.d.ts +3 -3
- package/dist/types-ts4.5/components/ResourcedMentionList/index.d.ts +3 -3
- package/dist/types-ts4.5/types.d.ts +28 -28
- package/dist/types-ts4.5/util/i18n.d.ts +1 -1
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/mention
|
|
2
2
|
|
|
3
|
+
## 24.2.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0fdcb6f2f96fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fdcb6f2f96fd) -
|
|
8
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 24.2.10
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 24.2.9
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -12,7 +12,7 @@ var _types = require("../types");
|
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
var packageName = "@atlaskit/mention";
|
|
15
|
-
var packageVersion = "24.2.
|
|
15
|
+
var packageVersion = "24.2.10";
|
|
16
16
|
var SLI_EVENT_TYPE = exports.SLI_EVENT_TYPE = 'sli';
|
|
17
17
|
var SMART_EVENT_TYPE = exports.SMART_EVENT_TYPE = 'smart';
|
|
18
18
|
var fireAnalyticsMentionTypeaheadEvent = exports.fireAnalyticsMentionTypeaheadEvent = function fireAnalyticsMentionTypeaheadEvent(props) {
|
|
@@ -2,7 +2,7 @@ import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-t
|
|
|
2
2
|
import { ELEMENTS_CHANNEL } from '../_constants';
|
|
3
3
|
import { ComponentNames, isSpecialMentionText } from '../types';
|
|
4
4
|
const packageName = "@atlaskit/mention";
|
|
5
|
-
const packageVersion = "24.2.
|
|
5
|
+
const packageVersion = "24.2.10";
|
|
6
6
|
export const SLI_EVENT_TYPE = 'sli';
|
|
7
7
|
export const SMART_EVENT_TYPE = 'smart';
|
|
8
8
|
export const fireAnalyticsMentionTypeaheadEvent = props => (action, duration, userIds = [], query) => {
|
|
@@ -5,7 +5,7 @@ import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-t
|
|
|
5
5
|
import { ELEMENTS_CHANNEL } from '../_constants';
|
|
6
6
|
import { ComponentNames, isSpecialMentionText } from '../types';
|
|
7
7
|
var packageName = "@atlaskit/mention";
|
|
8
|
-
var packageVersion = "24.2.
|
|
8
|
+
var packageVersion = "24.2.10";
|
|
9
9
|
export var SLI_EVENT_TYPE = 'sli';
|
|
10
10
|
export var SMART_EVENT_TYPE = 'smart';
|
|
11
11
|
export var fireAnalyticsMentionTypeaheadEvent = function fireAnalyticsMentionTypeaheadEvent(props) {
|
|
@@ -7,8 +7,8 @@ export interface TeamMentionResourceConfig extends MentionResourceConfig {
|
|
|
7
7
|
* Support
|
|
8
8
|
*/
|
|
9
9
|
export interface ResolvingMentionProvider extends MentionProvider {
|
|
10
|
-
resolveMentionName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
|
|
11
10
|
cacheMentionName(id: string, mentionName: string): void;
|
|
11
|
+
resolveMentionName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
|
|
12
12
|
supportsMentionNameResolving(): boolean;
|
|
13
13
|
}
|
|
14
14
|
declare class AbstractResource<Result> implements ResourceProvider<Result> {
|
|
@@ -4,12 +4,12 @@ export interface PresenceMap {
|
|
|
4
4
|
[userId: string]: Presence;
|
|
5
5
|
}
|
|
6
6
|
export interface PresenceResourceConfig {
|
|
7
|
-
url: string;
|
|
8
|
-
cloudId: string;
|
|
9
|
-
productId?: string;
|
|
10
7
|
cache?: PresenceCache;
|
|
11
8
|
cacheExpiry?: number;
|
|
9
|
+
cloudId: string;
|
|
12
10
|
parser?: PresenceParser;
|
|
11
|
+
productId?: string;
|
|
12
|
+
url: string;
|
|
13
13
|
}
|
|
14
14
|
export interface PresenceCache {
|
|
15
15
|
contains(userId: string): boolean;
|
|
@@ -25,12 +25,12 @@ export interface Data {
|
|
|
25
25
|
PresenceBulk: PresenceBulk[];
|
|
26
26
|
}
|
|
27
27
|
export interface PresenceBulk {
|
|
28
|
-
userId: string;
|
|
29
|
-
state: null | string;
|
|
30
|
-
type: null | string;
|
|
31
28
|
date: null | string;
|
|
32
29
|
message: null | string;
|
|
30
|
+
state: null | string;
|
|
33
31
|
stateMetadata?: string;
|
|
32
|
+
type: null | string;
|
|
33
|
+
userId: string;
|
|
34
34
|
}
|
|
35
35
|
export interface PresenceParser {
|
|
36
36
|
mapState(state: string): string;
|
|
@@ -10,8 +10,8 @@ export declare enum Actions {
|
|
|
10
10
|
export type DefaultAttributes = {
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
context: string;
|
|
13
|
-
sessionId: string;
|
|
14
13
|
pickerType: 'mentions';
|
|
14
|
+
sessionId: string;
|
|
15
15
|
source: 'smarts';
|
|
16
16
|
};
|
|
17
17
|
export declare const defaultAttributes: (context?: MentionContextIdentifier) => DefaultAttributes;
|
|
@@ -2,15 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import { type MentionProvider } from '../../api/MentionResource';
|
|
3
3
|
import { type MentionEventHandler } from '../../types';
|
|
4
4
|
export interface Props {
|
|
5
|
-
id: string;
|
|
6
|
-
text: string;
|
|
7
5
|
accessLevel?: string;
|
|
6
|
+
id: string;
|
|
8
7
|
localId?: string;
|
|
9
8
|
mentionProvider?: Promise<MentionProvider>;
|
|
10
9
|
onClick?: MentionEventHandler;
|
|
11
10
|
onMouseEnter?: MentionEventHandler;
|
|
12
11
|
onMouseLeave?: MentionEventHandler;
|
|
13
12
|
ssrPlaceholderId?: string;
|
|
13
|
+
text: string;
|
|
14
14
|
}
|
|
15
15
|
export interface State {
|
|
16
16
|
isHighlighted: boolean;
|
|
@@ -4,16 +4,16 @@ import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnal
|
|
|
4
4
|
export declare const ANALYTICS_HOVER_DELAY = 1000;
|
|
5
5
|
export declare const UNKNOWN_USER_ID = "_|unknown|_";
|
|
6
6
|
export type OwnProps = {
|
|
7
|
+
accessLevel?: string;
|
|
7
8
|
id: string;
|
|
8
|
-
text: string;
|
|
9
9
|
isHighlighted?: boolean;
|
|
10
|
-
accessLevel?: string;
|
|
11
10
|
localId?: string;
|
|
12
11
|
onClick?: MentionEventHandler;
|
|
12
|
+
onHover?: () => void;
|
|
13
13
|
onMouseEnter?: MentionEventHandler;
|
|
14
14
|
onMouseLeave?: MentionEventHandler;
|
|
15
|
-
onHover?: () => void;
|
|
16
15
|
ssrPlaceholderId?: string;
|
|
16
|
+
text: string;
|
|
17
17
|
};
|
|
18
18
|
export type Props = OwnProps & WithAnalyticsEventsProps;
|
|
19
19
|
export declare class MentionInternal extends React.PureComponent<Props, {}> {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type MentionDescription } from '../../types';
|
|
3
3
|
type MentionAvatarProps = {
|
|
4
|
-
selected?: boolean;
|
|
5
4
|
mention: MentionDescription;
|
|
5
|
+
selected?: boolean;
|
|
6
6
|
};
|
|
7
7
|
export declare const MentionAvatar: ({ mention, selected }: MentionAvatarProps) => React.JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -3,10 +3,10 @@ import { type MentionDescription, type OnMentionEvent } from '../../types';
|
|
|
3
3
|
export { MENTION_ITEM_HEIGHT } from './styles';
|
|
4
4
|
export interface Props {
|
|
5
5
|
mention: MentionDescription;
|
|
6
|
-
selected?: boolean;
|
|
7
|
-
onMouseMove?: OnMentionEvent;
|
|
8
6
|
onMouseEnter?: OnMentionEvent;
|
|
7
|
+
onMouseMove?: OnMentionEvent;
|
|
9
8
|
onSelection?: OnMentionEvent;
|
|
9
|
+
selected?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export default class MentionItem extends React.PureComponent<Props, {}> {
|
|
12
12
|
private onMentionSelected;
|
|
@@ -2,14 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { type MentionDescription, type OnMentionEvent } from '../../types';
|
|
3
3
|
import MentionItem from '../MentionItem';
|
|
4
4
|
export interface Props {
|
|
5
|
+
initialHighlightElement?: React.ReactElement | null;
|
|
5
6
|
mentions: MentionDescription[];
|
|
6
|
-
resourceError?: Error;
|
|
7
7
|
onSelection?: OnMentionEvent;
|
|
8
|
-
|
|
8
|
+
resourceError?: Error;
|
|
9
9
|
}
|
|
10
10
|
export interface State {
|
|
11
|
-
selectedKey?: string;
|
|
12
11
|
selectedIndex: number;
|
|
12
|
+
selectedKey?: string;
|
|
13
13
|
}
|
|
14
14
|
export interface Items {
|
|
15
15
|
[index: string]: MentionItem;
|
|
@@ -12,21 +12,21 @@ export interface OnClose {
|
|
|
12
12
|
}
|
|
13
13
|
export type Position = 'above' | 'below' | 'auto';
|
|
14
14
|
export interface Props {
|
|
15
|
-
|
|
15
|
+
offsetX?: number;
|
|
16
|
+
offsetY?: number;
|
|
17
|
+
onClose?: OnClose;
|
|
18
|
+
onOpen?: OnOpen;
|
|
19
|
+
onSelection?: OnMentionEvent;
|
|
20
|
+
position?: Position;
|
|
16
21
|
presenceProvider?: PresenceProvider;
|
|
17
22
|
query?: string;
|
|
18
|
-
|
|
19
|
-
onOpen?: OnOpen;
|
|
20
|
-
onClose?: OnClose;
|
|
23
|
+
resourceProvider: MentionProvider;
|
|
21
24
|
target?: string;
|
|
22
|
-
position?: Position;
|
|
23
25
|
zIndex?: number | string;
|
|
24
|
-
offsetX?: number;
|
|
25
|
-
offsetY?: number;
|
|
26
26
|
}
|
|
27
27
|
export interface State {
|
|
28
|
-
visible: boolean;
|
|
29
28
|
info?: string;
|
|
29
|
+
visible: boolean;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* @class MentionPicker
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface Props {
|
|
3
|
-
|
|
4
|
-
relativePosition?: 'above' | 'below' | 'auto';
|
|
3
|
+
children?: any;
|
|
5
4
|
offsetX?: number;
|
|
6
5
|
offsetY?: number;
|
|
6
|
+
relativePosition?: 'above' | 'below' | 'auto';
|
|
7
|
+
target?: string;
|
|
7
8
|
zIndex?: number | string;
|
|
8
|
-
children?: any;
|
|
9
9
|
}
|
|
10
10
|
export default class Popup extends React.PureComponent<Props, {}> {
|
|
11
11
|
private popup?;
|
|
@@ -4,15 +4,15 @@ import { type MentionProvider } from '../../api/MentionResource';
|
|
|
4
4
|
import { type PresenceProvider } from '../../api/PresenceResource';
|
|
5
5
|
import { type MentionDescription, type OnMentionEvent } from '../../types';
|
|
6
6
|
export interface Props {
|
|
7
|
-
|
|
7
|
+
onSelection?: OnMentionEvent;
|
|
8
8
|
presenceProvider?: PresenceProvider;
|
|
9
9
|
query?: string;
|
|
10
|
-
onSelection?: OnMentionEvent;
|
|
11
10
|
resourceError?: Error;
|
|
11
|
+
resourceProvider: MentionProvider;
|
|
12
12
|
}
|
|
13
13
|
export interface State {
|
|
14
|
-
resourceError?: Error;
|
|
15
14
|
mentions: MentionDescription[];
|
|
15
|
+
resourceError?: Error;
|
|
16
16
|
}
|
|
17
17
|
export declare class ResourcedMentionListWithoutAnalytics extends React.PureComponent<Props & WithAnalyticsEventsProps, State> {
|
|
18
18
|
private subscriberKey;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type SyntheticEvent } from 'react';
|
|
2
2
|
import { type ServiceConfig } from '@atlaskit/util-service-support/types';
|
|
3
3
|
export interface MentionNameResolver {
|
|
4
|
-
lookupName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
|
|
5
4
|
cacheName(id: string, name: string): void;
|
|
5
|
+
lookupName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
|
|
6
6
|
}
|
|
7
7
|
export type MentionStats = {
|
|
8
8
|
[key: string]: any;
|
|
@@ -23,15 +23,15 @@ export interface AnalyticsCallback {
|
|
|
23
23
|
}
|
|
24
24
|
export interface MentionResourceConfig extends ServiceConfig {
|
|
25
25
|
containerId?: string;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
debounceTime?: number;
|
|
27
|
+
inviteXProductUser?: (userId: string, mentionName: string) => Promise<void>;
|
|
28
28
|
mentionNameResolver?: MentionNameResolver;
|
|
29
|
-
shouldEnableInvite?: boolean;
|
|
30
29
|
onInviteItemClick?: (flow: InviteFlow) => void;
|
|
31
|
-
|
|
30
|
+
productId?: string;
|
|
32
31
|
productName?: string;
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
shouldEnableInvite?: boolean;
|
|
33
|
+
shouldHighlightMention?: (mention: MentionDescription) => boolean;
|
|
34
|
+
userRole?: UserRole;
|
|
35
35
|
}
|
|
36
36
|
export interface ResourceProvider<Result> {
|
|
37
37
|
/**
|
|
@@ -51,55 +51,55 @@ export interface ResourceProvider<Result> {
|
|
|
51
51
|
unsubscribe(key: string): void;
|
|
52
52
|
}
|
|
53
53
|
export type MentionContextIdentifier = {
|
|
54
|
+
childObjectId?: string;
|
|
54
55
|
containerId?: string;
|
|
55
56
|
objectId?: string;
|
|
56
|
-
childObjectId?: string;
|
|
57
57
|
sessionId?: string;
|
|
58
58
|
};
|
|
59
59
|
export interface MentionProvider extends ResourceProvider<MentionDescription[]>, InviteFromMentionProvider, XProductInviteMentionProvider {
|
|
60
60
|
filter(query?: string, contextIdentifier?: MentionContextIdentifier): void;
|
|
61
|
+
isFiltering(query: string): boolean;
|
|
61
62
|
recordMentionSelection(mention: MentionDescription, contextIdentifier?: MentionContextIdentifier): void;
|
|
62
63
|
shouldHighlightMention(mention: MentionDescription): boolean;
|
|
63
|
-
isFiltering(query: string): boolean;
|
|
64
64
|
}
|
|
65
65
|
export interface HighlightDetail {
|
|
66
|
-
start: number;
|
|
67
66
|
end: number;
|
|
67
|
+
start: number;
|
|
68
68
|
}
|
|
69
69
|
export interface Highlight {
|
|
70
|
-
name: HighlightDetail[];
|
|
71
70
|
mentionName: HighlightDetail[];
|
|
71
|
+
name: HighlightDetail[];
|
|
72
72
|
nickname: HighlightDetail[];
|
|
73
73
|
}
|
|
74
74
|
export interface Presence {
|
|
75
|
-
time?: string;
|
|
76
75
|
status?: string;
|
|
76
|
+
time?: string;
|
|
77
77
|
}
|
|
78
78
|
export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
|
|
79
79
|
export interface LozengeProps {
|
|
80
|
-
text: React.ReactNode;
|
|
81
80
|
appearance?: LozengeColor;
|
|
81
|
+
text: React.ReactNode;
|
|
82
82
|
}
|
|
83
83
|
export interface MentionDescription {
|
|
84
|
-
|
|
84
|
+
accessLevel?: string;
|
|
85
85
|
avatarUrl?: string;
|
|
86
|
-
|
|
87
|
-
mentionName?: string;
|
|
88
|
-
nickname?: string;
|
|
86
|
+
context?: MentionDescContext;
|
|
89
87
|
highlight?: Highlight;
|
|
88
|
+
id: string;
|
|
89
|
+
inContext?: boolean;
|
|
90
|
+
isXProductUser?: boolean;
|
|
90
91
|
lozenge?: string | LozengeProps;
|
|
92
|
+
mentionName?: string;
|
|
93
|
+
name?: string;
|
|
94
|
+
nickname?: string;
|
|
91
95
|
presence?: Presence;
|
|
92
|
-
accessLevel?: string;
|
|
93
|
-
inContext?: boolean;
|
|
94
|
-
userType?: string;
|
|
95
|
-
context?: MentionDescContext;
|
|
96
96
|
source?: string;
|
|
97
|
-
|
|
97
|
+
userType?: string;
|
|
98
98
|
}
|
|
99
99
|
export interface MentionDescContext {
|
|
100
|
-
members: TeamMember[];
|
|
101
100
|
includesYou: boolean;
|
|
102
101
|
memberCount: number;
|
|
102
|
+
members: TeamMember[];
|
|
103
103
|
teamLink: string;
|
|
104
104
|
}
|
|
105
105
|
export interface MentionsResult {
|
|
@@ -111,13 +111,13 @@ export interface TeamMember {
|
|
|
111
111
|
name: string;
|
|
112
112
|
}
|
|
113
113
|
export interface Team {
|
|
114
|
-
id: string;
|
|
115
|
-
smallAvatarImageUrl: string;
|
|
116
114
|
displayName: string;
|
|
117
|
-
|
|
115
|
+
highlight?: Highlight;
|
|
116
|
+
id: string;
|
|
118
117
|
includesYou: boolean;
|
|
119
118
|
memberCount: number;
|
|
120
|
-
|
|
119
|
+
members: TeamMember[];
|
|
120
|
+
smallAvatarImageUrl: string;
|
|
121
121
|
}
|
|
122
122
|
export type MentionEventHandler = (mentionId: string, text: string, event?: SyntheticEvent<HTMLSpanElement>) => void;
|
|
123
123
|
export interface OnMentionEvent {
|
|
@@ -178,9 +178,9 @@ export declare const isPromise: <T>(p: any) => p is Promise<T>;
|
|
|
178
178
|
export type InviteFlow = 'mention' | 'assign';
|
|
179
179
|
export type UserRole = 'admin' | 'trusted' | 'basic';
|
|
180
180
|
export interface InviteFromMentionProvider {
|
|
181
|
+
onInviteItemClick?(flow: InviteFlow): void;
|
|
181
182
|
productName?: string;
|
|
182
183
|
shouldEnableInvite?: boolean;
|
|
183
|
-
onInviteItemClick?(flow: InviteFlow): void;
|
|
184
184
|
userRole?: UserRole;
|
|
185
185
|
}
|
|
186
186
|
export interface XProductInviteMentionProvider {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type MessageDescriptor } from 'react-intl-next';
|
|
3
3
|
export type Formatter = (props: {
|
|
4
|
+
children?(props: string): React.ReactElement;
|
|
4
5
|
values?: {
|
|
5
6
|
[k: string]: string;
|
|
6
7
|
};
|
|
7
|
-
children?(props: string): React.ReactElement;
|
|
8
8
|
}) => React.ReactElement | null;
|
|
9
9
|
type FormatterFactory = (messageDescriptor: MessageDescriptor) => Formatter;
|
|
10
10
|
export declare const propFormatter: FormatterFactory;
|
|
@@ -7,8 +7,8 @@ export interface TeamMentionResourceConfig extends MentionResourceConfig {
|
|
|
7
7
|
* Support
|
|
8
8
|
*/
|
|
9
9
|
export interface ResolvingMentionProvider extends MentionProvider {
|
|
10
|
-
resolveMentionName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
|
|
11
10
|
cacheMentionName(id: string, mentionName: string): void;
|
|
11
|
+
resolveMentionName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
|
|
12
12
|
supportsMentionNameResolving(): boolean;
|
|
13
13
|
}
|
|
14
14
|
declare class AbstractResource<Result> implements ResourceProvider<Result> {
|
|
@@ -4,12 +4,12 @@ export interface PresenceMap {
|
|
|
4
4
|
[userId: string]: Presence;
|
|
5
5
|
}
|
|
6
6
|
export interface PresenceResourceConfig {
|
|
7
|
-
url: string;
|
|
8
|
-
cloudId: string;
|
|
9
|
-
productId?: string;
|
|
10
7
|
cache?: PresenceCache;
|
|
11
8
|
cacheExpiry?: number;
|
|
9
|
+
cloudId: string;
|
|
12
10
|
parser?: PresenceParser;
|
|
11
|
+
productId?: string;
|
|
12
|
+
url: string;
|
|
13
13
|
}
|
|
14
14
|
export interface PresenceCache {
|
|
15
15
|
contains(userId: string): boolean;
|
|
@@ -25,12 +25,12 @@ export interface Data {
|
|
|
25
25
|
PresenceBulk: PresenceBulk[];
|
|
26
26
|
}
|
|
27
27
|
export interface PresenceBulk {
|
|
28
|
-
userId: string;
|
|
29
|
-
state: null | string;
|
|
30
|
-
type: null | string;
|
|
31
28
|
date: null | string;
|
|
32
29
|
message: null | string;
|
|
30
|
+
state: null | string;
|
|
33
31
|
stateMetadata?: string;
|
|
32
|
+
type: null | string;
|
|
33
|
+
userId: string;
|
|
34
34
|
}
|
|
35
35
|
export interface PresenceParser {
|
|
36
36
|
mapState(state: string): string;
|
|
@@ -10,8 +10,8 @@ export declare enum Actions {
|
|
|
10
10
|
export type DefaultAttributes = {
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
context: string;
|
|
13
|
-
sessionId: string;
|
|
14
13
|
pickerType: 'mentions';
|
|
14
|
+
sessionId: string;
|
|
15
15
|
source: 'smarts';
|
|
16
16
|
};
|
|
17
17
|
export declare const defaultAttributes: (context?: MentionContextIdentifier) => DefaultAttributes;
|
|
@@ -2,15 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import { type MentionProvider } from '../../api/MentionResource';
|
|
3
3
|
import { type MentionEventHandler } from '../../types';
|
|
4
4
|
export interface Props {
|
|
5
|
-
id: string;
|
|
6
|
-
text: string;
|
|
7
5
|
accessLevel?: string;
|
|
6
|
+
id: string;
|
|
8
7
|
localId?: string;
|
|
9
8
|
mentionProvider?: Promise<MentionProvider>;
|
|
10
9
|
onClick?: MentionEventHandler;
|
|
11
10
|
onMouseEnter?: MentionEventHandler;
|
|
12
11
|
onMouseLeave?: MentionEventHandler;
|
|
13
12
|
ssrPlaceholderId?: string;
|
|
13
|
+
text: string;
|
|
14
14
|
}
|
|
15
15
|
export interface State {
|
|
16
16
|
isHighlighted: boolean;
|
|
@@ -4,16 +4,16 @@ import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnal
|
|
|
4
4
|
export declare const ANALYTICS_HOVER_DELAY = 1000;
|
|
5
5
|
export declare const UNKNOWN_USER_ID = "_|unknown|_";
|
|
6
6
|
export type OwnProps = {
|
|
7
|
+
accessLevel?: string;
|
|
7
8
|
id: string;
|
|
8
|
-
text: string;
|
|
9
9
|
isHighlighted?: boolean;
|
|
10
|
-
accessLevel?: string;
|
|
11
10
|
localId?: string;
|
|
12
11
|
onClick?: MentionEventHandler;
|
|
12
|
+
onHover?: () => void;
|
|
13
13
|
onMouseEnter?: MentionEventHandler;
|
|
14
14
|
onMouseLeave?: MentionEventHandler;
|
|
15
|
-
onHover?: () => void;
|
|
16
15
|
ssrPlaceholderId?: string;
|
|
16
|
+
text: string;
|
|
17
17
|
};
|
|
18
18
|
export type Props = OwnProps & WithAnalyticsEventsProps;
|
|
19
19
|
export declare class MentionInternal extends React.PureComponent<Props, {}> {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type MentionDescription } from '../../types';
|
|
3
3
|
type MentionAvatarProps = {
|
|
4
|
-
selected?: boolean;
|
|
5
4
|
mention: MentionDescription;
|
|
5
|
+
selected?: boolean;
|
|
6
6
|
};
|
|
7
7
|
export declare const MentionAvatar: ({ mention, selected }: MentionAvatarProps) => React.JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -3,10 +3,10 @@ import { type MentionDescription, type OnMentionEvent } from '../../types';
|
|
|
3
3
|
export { MENTION_ITEM_HEIGHT } from './styles';
|
|
4
4
|
export interface Props {
|
|
5
5
|
mention: MentionDescription;
|
|
6
|
-
selected?: boolean;
|
|
7
|
-
onMouseMove?: OnMentionEvent;
|
|
8
6
|
onMouseEnter?: OnMentionEvent;
|
|
7
|
+
onMouseMove?: OnMentionEvent;
|
|
9
8
|
onSelection?: OnMentionEvent;
|
|
9
|
+
selected?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export default class MentionItem extends React.PureComponent<Props, {}> {
|
|
12
12
|
private onMentionSelected;
|
|
@@ -2,14 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { type MentionDescription, type OnMentionEvent } from '../../types';
|
|
3
3
|
import MentionItem from '../MentionItem';
|
|
4
4
|
export interface Props {
|
|
5
|
+
initialHighlightElement?: React.ReactElement | null;
|
|
5
6
|
mentions: MentionDescription[];
|
|
6
|
-
resourceError?: Error;
|
|
7
7
|
onSelection?: OnMentionEvent;
|
|
8
|
-
|
|
8
|
+
resourceError?: Error;
|
|
9
9
|
}
|
|
10
10
|
export interface State {
|
|
11
|
-
selectedKey?: string;
|
|
12
11
|
selectedIndex: number;
|
|
12
|
+
selectedKey?: string;
|
|
13
13
|
}
|
|
14
14
|
export interface Items {
|
|
15
15
|
[index: string]: MentionItem;
|
|
@@ -12,21 +12,21 @@ export interface OnClose {
|
|
|
12
12
|
}
|
|
13
13
|
export type Position = 'above' | 'below' | 'auto';
|
|
14
14
|
export interface Props {
|
|
15
|
-
|
|
15
|
+
offsetX?: number;
|
|
16
|
+
offsetY?: number;
|
|
17
|
+
onClose?: OnClose;
|
|
18
|
+
onOpen?: OnOpen;
|
|
19
|
+
onSelection?: OnMentionEvent;
|
|
20
|
+
position?: Position;
|
|
16
21
|
presenceProvider?: PresenceProvider;
|
|
17
22
|
query?: string;
|
|
18
|
-
|
|
19
|
-
onOpen?: OnOpen;
|
|
20
|
-
onClose?: OnClose;
|
|
23
|
+
resourceProvider: MentionProvider;
|
|
21
24
|
target?: string;
|
|
22
|
-
position?: Position;
|
|
23
25
|
zIndex?: number | string;
|
|
24
|
-
offsetX?: number;
|
|
25
|
-
offsetY?: number;
|
|
26
26
|
}
|
|
27
27
|
export interface State {
|
|
28
|
-
visible: boolean;
|
|
29
28
|
info?: string;
|
|
29
|
+
visible: boolean;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* @class MentionPicker
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface Props {
|
|
3
|
-
|
|
4
|
-
relativePosition?: 'above' | 'below' | 'auto';
|
|
3
|
+
children?: any;
|
|
5
4
|
offsetX?: number;
|
|
6
5
|
offsetY?: number;
|
|
6
|
+
relativePosition?: 'above' | 'below' | 'auto';
|
|
7
|
+
target?: string;
|
|
7
8
|
zIndex?: number | string;
|
|
8
|
-
children?: any;
|
|
9
9
|
}
|
|
10
10
|
export default class Popup extends React.PureComponent<Props, {}> {
|
|
11
11
|
private popup?;
|
|
@@ -4,15 +4,15 @@ import { type MentionProvider } from '../../api/MentionResource';
|
|
|
4
4
|
import { type PresenceProvider } from '../../api/PresenceResource';
|
|
5
5
|
import { type MentionDescription, type OnMentionEvent } from '../../types';
|
|
6
6
|
export interface Props {
|
|
7
|
-
|
|
7
|
+
onSelection?: OnMentionEvent;
|
|
8
8
|
presenceProvider?: PresenceProvider;
|
|
9
9
|
query?: string;
|
|
10
|
-
onSelection?: OnMentionEvent;
|
|
11
10
|
resourceError?: Error;
|
|
11
|
+
resourceProvider: MentionProvider;
|
|
12
12
|
}
|
|
13
13
|
export interface State {
|
|
14
|
-
resourceError?: Error;
|
|
15
14
|
mentions: MentionDescription[];
|
|
15
|
+
resourceError?: Error;
|
|
16
16
|
}
|
|
17
17
|
export declare class ResourcedMentionListWithoutAnalytics extends React.PureComponent<Props & WithAnalyticsEventsProps, State> {
|
|
18
18
|
private subscriberKey;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type SyntheticEvent } from 'react';
|
|
2
2
|
import { type ServiceConfig } from '@atlaskit/util-service-support/types';
|
|
3
3
|
export interface MentionNameResolver {
|
|
4
|
-
lookupName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
|
|
5
4
|
cacheName(id: string, name: string): void;
|
|
5
|
+
lookupName(id: string): Promise<MentionNameDetails> | MentionNameDetails;
|
|
6
6
|
}
|
|
7
7
|
export type MentionStats = {
|
|
8
8
|
[key: string]: any;
|
|
@@ -23,15 +23,15 @@ export interface AnalyticsCallback {
|
|
|
23
23
|
}
|
|
24
24
|
export interface MentionResourceConfig extends ServiceConfig {
|
|
25
25
|
containerId?: string;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
debounceTime?: number;
|
|
27
|
+
inviteXProductUser?: (userId: string, mentionName: string) => Promise<void>;
|
|
28
28
|
mentionNameResolver?: MentionNameResolver;
|
|
29
|
-
shouldEnableInvite?: boolean;
|
|
30
29
|
onInviteItemClick?: (flow: InviteFlow) => void;
|
|
31
|
-
|
|
30
|
+
productId?: string;
|
|
32
31
|
productName?: string;
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
shouldEnableInvite?: boolean;
|
|
33
|
+
shouldHighlightMention?: (mention: MentionDescription) => boolean;
|
|
34
|
+
userRole?: UserRole;
|
|
35
35
|
}
|
|
36
36
|
export interface ResourceProvider<Result> {
|
|
37
37
|
/**
|
|
@@ -51,55 +51,55 @@ export interface ResourceProvider<Result> {
|
|
|
51
51
|
unsubscribe(key: string): void;
|
|
52
52
|
}
|
|
53
53
|
export type MentionContextIdentifier = {
|
|
54
|
+
childObjectId?: string;
|
|
54
55
|
containerId?: string;
|
|
55
56
|
objectId?: string;
|
|
56
|
-
childObjectId?: string;
|
|
57
57
|
sessionId?: string;
|
|
58
58
|
};
|
|
59
59
|
export interface MentionProvider extends ResourceProvider<MentionDescription[]>, InviteFromMentionProvider, XProductInviteMentionProvider {
|
|
60
60
|
filter(query?: string, contextIdentifier?: MentionContextIdentifier): void;
|
|
61
|
+
isFiltering(query: string): boolean;
|
|
61
62
|
recordMentionSelection(mention: MentionDescription, contextIdentifier?: MentionContextIdentifier): void;
|
|
62
63
|
shouldHighlightMention(mention: MentionDescription): boolean;
|
|
63
|
-
isFiltering(query: string): boolean;
|
|
64
64
|
}
|
|
65
65
|
export interface HighlightDetail {
|
|
66
|
-
start: number;
|
|
67
66
|
end: number;
|
|
67
|
+
start: number;
|
|
68
68
|
}
|
|
69
69
|
export interface Highlight {
|
|
70
|
-
name: HighlightDetail[];
|
|
71
70
|
mentionName: HighlightDetail[];
|
|
71
|
+
name: HighlightDetail[];
|
|
72
72
|
nickname: HighlightDetail[];
|
|
73
73
|
}
|
|
74
74
|
export interface Presence {
|
|
75
|
-
time?: string;
|
|
76
75
|
status?: string;
|
|
76
|
+
time?: string;
|
|
77
77
|
}
|
|
78
78
|
export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
|
|
79
79
|
export interface LozengeProps {
|
|
80
|
-
text: React.ReactNode;
|
|
81
80
|
appearance?: LozengeColor;
|
|
81
|
+
text: React.ReactNode;
|
|
82
82
|
}
|
|
83
83
|
export interface MentionDescription {
|
|
84
|
-
|
|
84
|
+
accessLevel?: string;
|
|
85
85
|
avatarUrl?: string;
|
|
86
|
-
|
|
87
|
-
mentionName?: string;
|
|
88
|
-
nickname?: string;
|
|
86
|
+
context?: MentionDescContext;
|
|
89
87
|
highlight?: Highlight;
|
|
88
|
+
id: string;
|
|
89
|
+
inContext?: boolean;
|
|
90
|
+
isXProductUser?: boolean;
|
|
90
91
|
lozenge?: string | LozengeProps;
|
|
92
|
+
mentionName?: string;
|
|
93
|
+
name?: string;
|
|
94
|
+
nickname?: string;
|
|
91
95
|
presence?: Presence;
|
|
92
|
-
accessLevel?: string;
|
|
93
|
-
inContext?: boolean;
|
|
94
|
-
userType?: string;
|
|
95
|
-
context?: MentionDescContext;
|
|
96
96
|
source?: string;
|
|
97
|
-
|
|
97
|
+
userType?: string;
|
|
98
98
|
}
|
|
99
99
|
export interface MentionDescContext {
|
|
100
|
-
members: TeamMember[];
|
|
101
100
|
includesYou: boolean;
|
|
102
101
|
memberCount: number;
|
|
102
|
+
members: TeamMember[];
|
|
103
103
|
teamLink: string;
|
|
104
104
|
}
|
|
105
105
|
export interface MentionsResult {
|
|
@@ -111,13 +111,13 @@ export interface TeamMember {
|
|
|
111
111
|
name: string;
|
|
112
112
|
}
|
|
113
113
|
export interface Team {
|
|
114
|
-
id: string;
|
|
115
|
-
smallAvatarImageUrl: string;
|
|
116
114
|
displayName: string;
|
|
117
|
-
|
|
115
|
+
highlight?: Highlight;
|
|
116
|
+
id: string;
|
|
118
117
|
includesYou: boolean;
|
|
119
118
|
memberCount: number;
|
|
120
|
-
|
|
119
|
+
members: TeamMember[];
|
|
120
|
+
smallAvatarImageUrl: string;
|
|
121
121
|
}
|
|
122
122
|
export type MentionEventHandler = (mentionId: string, text: string, event?: SyntheticEvent<HTMLSpanElement>) => void;
|
|
123
123
|
export interface OnMentionEvent {
|
|
@@ -178,9 +178,9 @@ export declare const isPromise: <T>(p: any) => p is Promise<T>;
|
|
|
178
178
|
export type InviteFlow = 'mention' | 'assign';
|
|
179
179
|
export type UserRole = 'admin' | 'trusted' | 'basic';
|
|
180
180
|
export interface InviteFromMentionProvider {
|
|
181
|
+
onInviteItemClick?(flow: InviteFlow): void;
|
|
181
182
|
productName?: string;
|
|
182
183
|
shouldEnableInvite?: boolean;
|
|
183
|
-
onInviteItemClick?(flow: InviteFlow): void;
|
|
184
184
|
userRole?: UserRole;
|
|
185
185
|
}
|
|
186
186
|
export interface XProductInviteMentionProvider {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type MessageDescriptor } from 'react-intl-next';
|
|
3
3
|
export type Formatter = (props: {
|
|
4
|
+
children?(props: string): React.ReactElement;
|
|
4
5
|
values?: {
|
|
5
6
|
[k: string]: string;
|
|
6
7
|
};
|
|
7
|
-
children?(props: string): React.ReactElement;
|
|
8
8
|
}) => React.ReactElement | null;
|
|
9
9
|
type FormatterFactory = (messageDescriptor: MessageDescriptor) => Formatter;
|
|
10
10
|
export declare const propFormatter: FormatterFactory;
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@atlaskit/avatar": "^25.1.0",
|
|
36
36
|
"@atlaskit/focus-ring": "^3.0.0",
|
|
37
37
|
"@atlaskit/heading": "^5.2.0",
|
|
38
|
-
"@atlaskit/icon": "^
|
|
38
|
+
"@atlaskit/icon": "^28.0.0",
|
|
39
39
|
"@atlaskit/lozenge": "^13.0.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
41
41
|
"@atlaskit/primitives": "^14.11.0",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"description": "A React component used to display user profiles in a list for 'Mention' functionality",
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@atlaskit/elements-test-helpers": "workspace:^",
|
|
57
|
-
"@atlaskit/visual-regression": "workspace:^",
|
|
58
57
|
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
59
58
|
"@testing-library/react": "^13.4.0",
|
|
60
59
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -119,5 +118,5 @@
|
|
|
119
118
|
]
|
|
120
119
|
}
|
|
121
120
|
},
|
|
122
|
-
"version": "24.2.
|
|
121
|
+
"version": "24.2.11"
|
|
123
122
|
}
|