@atlaskit/smart-user-picker 6.1.0 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics.d.ts +1 -1
- package/dist/types/components/SmartUserPicker.d.ts +5 -5
- package/dist/types/config/index.d.ts +2 -2
- package/dist/types/i18n/cs.d.ts +6 -6
- package/dist/types/i18n/da.d.ts +6 -6
- package/dist/types/i18n/de.d.ts +6 -6
- package/dist/types/i18n/en.d.ts +6 -6
- package/dist/types/i18n/en_GB.d.ts +6 -6
- package/dist/types/i18n/en_ZZ.d.ts +6 -6
- package/dist/types/i18n/es.d.ts +6 -6
- package/dist/types/i18n/et.d.ts +1 -1
- package/dist/types/i18n/fi.d.ts +6 -6
- package/dist/types/i18n/fr.d.ts +6 -6
- package/dist/types/i18n/hu.d.ts +6 -6
- package/dist/types/i18n/it.d.ts +6 -6
- package/dist/types/i18n/ja.d.ts +6 -6
- package/dist/types/i18n/ko.d.ts +6 -6
- package/dist/types/i18n/nb.d.ts +6 -6
- package/dist/types/i18n/nl.d.ts +6 -6
- package/dist/types/i18n/pl.d.ts +6 -6
- package/dist/types/i18n/pt_BR.d.ts +6 -6
- package/dist/types/i18n/pt_PT.d.ts +1 -1
- package/dist/types/i18n/ru.d.ts +6 -6
- package/dist/types/i18n/sk.d.ts +1 -1
- package/dist/types/i18n/sv.d.ts +6 -6
- package/dist/types/i18n/th.d.ts +6 -6
- package/dist/types/i18n/tr.d.ts +6 -6
- package/dist/types/i18n/uk.d.ts +6 -6
- package/dist/types/i18n/vi.d.ts +6 -6
- package/dist/types/i18n/zh.d.ts +6 -6
- package/dist/types/i18n/zh_TW.d.ts +6 -6
- package/dist/types/service/teams-client.d.ts +2 -2
- package/dist/types/types.d.ts +5 -5
- package/dist/types-ts4.5/analytics.d.ts +21 -0
- package/dist/types-ts4.5/components/MessagesIntlProvider.d.ts +9 -0
- package/dist/types-ts4.5/components/SmartUserPicker.d.ts +34 -0
- package/dist/types-ts4.5/components/index.d.ts +4 -0
- package/dist/types-ts4.5/config/index.d.ts +6 -0
- package/dist/types-ts4.5/i18n/cs.d.ts +18 -0
- package/dist/types-ts4.5/i18n/da.d.ts +18 -0
- package/dist/types-ts4.5/i18n/de.d.ts +18 -0
- package/dist/types-ts4.5/i18n/en.d.ts +18 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +18 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +18 -0
- package/dist/types-ts4.5/i18n/es.d.ts +18 -0
- package/dist/types-ts4.5/i18n/et.d.ts +8 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +18 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +18 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +18 -0
- package/dist/types-ts4.5/i18n/index.d.ts +36 -0
- package/dist/types-ts4.5/i18n/is.d.ts +7 -0
- package/dist/types-ts4.5/i18n/it.d.ts +18 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +18 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +18 -0
- package/dist/types-ts4.5/i18n/languages.d.ts +27 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +18 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +18 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +18 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +18 -0
- package/dist/types-ts4.5/i18n/pt_PT.d.ts +8 -0
- package/dist/types-ts4.5/i18n/ro.d.ts +7 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +18 -0
- package/dist/types-ts4.5/i18n/sk.d.ts +8 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +18 -0
- package/dist/types-ts4.5/i18n/th.d.ts +18 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +18 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +18 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +18 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +18 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +18 -0
- package/dist/types-ts4.5/i18n.d.ts +47 -0
- package/dist/types-ts4.5/index.d.ts +5 -0
- package/dist/types-ts4.5/service/constants.d.ts +4 -0
- package/dist/types-ts4.5/service/default-value-hydration-client.d.ts +8 -0
- package/dist/types-ts4.5/service/graphqlUtils.d.ts +14 -0
- package/dist/types-ts4.5/service/index.d.ts +2 -0
- package/dist/types-ts4.5/service/recommendation-client.d.ts +9 -0
- package/dist/types-ts4.5/service/teams-client.d.ts +12 -0
- package/dist/types-ts4.5/service/users-client.d.ts +11 -0
- package/dist/types-ts4.5/service/users-transformer.d.ts +22 -0
- package/dist/types-ts4.5/types.d.ts +207 -0
- package/dist/types-ts4.5/ufoExperiences.d.ts +11 -0
- package/dist/types-ts4.5/util/i18n-util.d.ts +11 -0
- package/package.json +10 -2
- package/tmp/api-report-tmp.d.ts +268 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by Traduki 2.0.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: {
|
|
8
|
+
'fabric.elements.user-picker.external.sourced.from': string;
|
|
9
|
+
'fabric.elements.user-picker.github.provider': string;
|
|
10
|
+
'fabric.elements.user-picker.google.provider': string;
|
|
11
|
+
'fabric.elements.user-picker.guest.lozenge.text': string;
|
|
12
|
+
'fabric.elements.user-picker.guest.lozenge.tooltip.group': string;
|
|
13
|
+
'fabric.elements.user-picker.guest.lozenge.tooltip.user': string;
|
|
14
|
+
'fabric.elements.user-picker.member.lozenge.text': string;
|
|
15
|
+
'fabric.elements.user-picker.microsoft.provider': string;
|
|
16
|
+
'fabric.elements.user-picker.slack.provider': string;
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by Traduki 2.0.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: {
|
|
8
|
+
'fabric.elements.user-picker.external.sourced.from': string;
|
|
9
|
+
'fabric.elements.user-picker.github.provider': string;
|
|
10
|
+
'fabric.elements.user-picker.google.provider': string;
|
|
11
|
+
'fabric.elements.user-picker.guest.lozenge.text': string;
|
|
12
|
+
'fabric.elements.user-picker.guest.lozenge.tooltip.group': string;
|
|
13
|
+
'fabric.elements.user-picker.guest.lozenge.tooltip.user': string;
|
|
14
|
+
'fabric.elements.user-picker.member.lozenge.text': string;
|
|
15
|
+
'fabric.elements.user-picker.microsoft.provider': string;
|
|
16
|
+
'fabric.elements.user-picker.slack.provider': string;
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by Traduki 2.0.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: {
|
|
8
|
+
'fabric.elements.user-picker.external.sourced.from': string;
|
|
9
|
+
'fabric.elements.user-picker.github.provider': string;
|
|
10
|
+
'fabric.elements.user-picker.google.provider': string;
|
|
11
|
+
'fabric.elements.user-picker.guest.lozenge.text': string;
|
|
12
|
+
'fabric.elements.user-picker.guest.lozenge.tooltip.group': string;
|
|
13
|
+
'fabric.elements.user-picker.guest.lozenge.tooltip.user': string;
|
|
14
|
+
'fabric.elements.user-picker.member.lozenge.text': string;
|
|
15
|
+
'fabric.elements.user-picker.microsoft.provider': string;
|
|
16
|
+
'fabric.elements.user-picker.slack.provider': string;
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
externalUserSourcesHeading: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
slackProvider: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
googleProvider: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
microsoftProvider: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
gitHubProvider: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
memberLozengeText: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
guestLozengeText: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
guestUserLozengeTooltip: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
guestGroupLozengeTooltip: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default } from './components';
|
|
2
|
+
export { getUserRecommendations, hydrateDefaultValues } from './service';
|
|
3
|
+
export type { RecommendationRequest, Props, State } from './types';
|
|
4
|
+
export { isEmail, isTeam, isUser, isValidEmail, EmailType, GroupType, TeamType, UserType, } from '@atlaskit/user-picker';
|
|
5
|
+
export type { ActionTypes, Appearance, AtlasKitSelectChange, AtlaskitSelectValue, DefaultValue, EmailValidationResponse, EmailValidator, InputActionTypes, LozengeProps, OnChange, OnInputChange, OnOption, OnPicker, Option, OptionData, OptionIdentifier, PopupUserPickerProps, Promisable, Target, UserPickerProps, UserPickerState, Value, Email, Group, GroupHighlight, HighlightRange, LoadOptions, Team, TeamHighlight, TeamMember, User, UserHighlight, ExternalUser, UserSource, } from '@atlaskit/user-picker';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DefaultValue } from '@atlaskit/user-picker';
|
|
2
|
+
export interface UsersRequest {
|
|
3
|
+
baseUrl: string | undefined;
|
|
4
|
+
accountIds: string[];
|
|
5
|
+
productKey: 'jira' | 'confluence';
|
|
6
|
+
}
|
|
7
|
+
declare function hydrateDefaultValues(baseUrl: string | undefined, value: DefaultValue, productKey: string): Promise<DefaultValue>;
|
|
8
|
+
export default hydrateDefaultValues;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Query {
|
|
2
|
+
query: string;
|
|
3
|
+
variables: Record<string, string> | Record<string, string[]>;
|
|
4
|
+
}
|
|
5
|
+
export interface GraphQLError {
|
|
6
|
+
code?: number;
|
|
7
|
+
reason: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @param {string} serviceUrl - GraphQL service endpoint
|
|
11
|
+
* @param {Query} query - GraphQL query
|
|
12
|
+
*/
|
|
13
|
+
export declare function graphqlQuery<D>(serviceUrl: string, query: Query): Promise<D>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OptionData } from '@atlaskit/user-picker';
|
|
2
|
+
import { RecommendationRequest } from '../types';
|
|
3
|
+
import { IntlShape } from 'react-intl-next';
|
|
4
|
+
export interface SUPError extends Error {
|
|
5
|
+
message: string;
|
|
6
|
+
statusCode: number;
|
|
7
|
+
}
|
|
8
|
+
declare const getUserRecommendations: (request: RecommendationRequest, intl: IntlShape) => Promise<OptionData[]>;
|
|
9
|
+
export default getUserRecommendations;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Team } from '@atlaskit/user-picker';
|
|
2
|
+
type LegionRequest = {
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
export type LegionResponse = {
|
|
7
|
+
id: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
smallAvatarImageUrl: string;
|
|
10
|
+
};
|
|
11
|
+
declare const hydrateTeamFromLegion: (request: LegionRequest) => Promise<Team>;
|
|
12
|
+
export default hydrateTeamFromLegion;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { User } from '@atlaskit/user-picker';
|
|
2
|
+
interface UserData {
|
|
3
|
+
accountId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
picture: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ApiClientResponse {
|
|
8
|
+
users: UserData[];
|
|
9
|
+
}
|
|
10
|
+
declare const getHydratedUsers: (baseUrl: string | undefined, userIds: string[]) => Promise<User[]>;
|
|
11
|
+
export default getHydratedUsers;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OptionData } from '@atlaskit/user-picker';
|
|
2
|
+
import { IntlShape } from 'react-intl-next';
|
|
3
|
+
interface ServerItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
entityType: EntityType;
|
|
7
|
+
avatarUrl: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
teamAri?: string;
|
|
10
|
+
displayName?: string;
|
|
11
|
+
}
|
|
12
|
+
interface ServerResponse {
|
|
13
|
+
recommendedUsers: ServerItem[];
|
|
14
|
+
intl: IntlShape;
|
|
15
|
+
}
|
|
16
|
+
declare enum EntityType {
|
|
17
|
+
USER = "USER",
|
|
18
|
+
TEAM = "TEAM",
|
|
19
|
+
GROUP = "GROUP"
|
|
20
|
+
}
|
|
21
|
+
export declare const transformUsers: (serverResponse: ServerResponse, intl: IntlShape) => OptionData[];
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
2
|
+
import { DefaultValue, OptionData, UserPickerProps } from '@atlaskit/user-picker';
|
|
3
|
+
export interface Context {
|
|
4
|
+
containerId?: string;
|
|
5
|
+
contextType: string;
|
|
6
|
+
objectId?: string;
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
principalId?: string;
|
|
9
|
+
childObjectId?: string;
|
|
10
|
+
productKey: string;
|
|
11
|
+
siteId: string;
|
|
12
|
+
organizationId?: string;
|
|
13
|
+
productAttributes?: ProductAttributes;
|
|
14
|
+
}
|
|
15
|
+
export interface RecommendationRequest {
|
|
16
|
+
baseUrl?: string;
|
|
17
|
+
context: Context;
|
|
18
|
+
maxNumberOfResults: number;
|
|
19
|
+
query?: string;
|
|
20
|
+
searchQueryFilter?: string;
|
|
21
|
+
includeUsers?: boolean;
|
|
22
|
+
includeGroups?: boolean;
|
|
23
|
+
includeTeams?: boolean;
|
|
24
|
+
}
|
|
25
|
+
type OnError = (error: any, request: RecommendationRequest) => Promise<OptionData[]> | void;
|
|
26
|
+
type OnValueError = (error: any, defaultValue: DefaultValue) => Promise<OptionData[]> | void;
|
|
27
|
+
type OnEmpty = (query: string) => Promise<OptionData[]>;
|
|
28
|
+
export interface State {
|
|
29
|
+
users: OptionData[];
|
|
30
|
+
loading: boolean;
|
|
31
|
+
closed: boolean;
|
|
32
|
+
query: string;
|
|
33
|
+
sessionId?: string;
|
|
34
|
+
defaultValue?: DefaultValue;
|
|
35
|
+
bootstrapOptions: OptionData[];
|
|
36
|
+
}
|
|
37
|
+
export type ProductAttributes = BitbucketAttributes | ConfluenceAttributes;
|
|
38
|
+
export type FilterOptions = (options: OptionData[], query: string) => OptionData[];
|
|
39
|
+
export interface BitbucketAttributes {
|
|
40
|
+
/**
|
|
41
|
+
* Identifies whether this is a public repository or not.
|
|
42
|
+
*/
|
|
43
|
+
isPublicRepo?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* A list of bitbucket workspace Ids used within container result set and noted in analytics.
|
|
46
|
+
*/
|
|
47
|
+
workspaceIds?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* The users current email domain which may be used to boost the results for relevant users.
|
|
50
|
+
*/
|
|
51
|
+
emailDomain?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ConfluenceAttributes {
|
|
54
|
+
/**
|
|
55
|
+
* Identifies whether this user is a confluence guest
|
|
56
|
+
*/
|
|
57
|
+
isEntitledConfluenceExternalCollaborator?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare enum EntityType {
|
|
60
|
+
USER = "USER",
|
|
61
|
+
TEAM = "TEAM",
|
|
62
|
+
GROUP = "GROUP"
|
|
63
|
+
}
|
|
64
|
+
export interface RecommendationItem {
|
|
65
|
+
id: string;
|
|
66
|
+
name?: string;
|
|
67
|
+
entityType: EntityType;
|
|
68
|
+
avatarUrl: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
teamAri?: string;
|
|
71
|
+
displayName?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface RecommendationResponse {
|
|
74
|
+
errors?: any[];
|
|
75
|
+
recommendedUsers: RecommendationItem[];
|
|
76
|
+
}
|
|
77
|
+
export interface SmartProps {
|
|
78
|
+
/**
|
|
79
|
+
* The base URL of the site eg: hello.atlassian.net
|
|
80
|
+
*/
|
|
81
|
+
baseUrl?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Hydrated user suggestions to show when the query is blank. If not provided, smart user picker
|
|
84
|
+
* will still provide a smart-ranked list of suggestions for blank queries. Please refer to @atlaskit/user-picker
|
|
85
|
+
* for OptionData type.
|
|
86
|
+
*/
|
|
87
|
+
bootstrapOptions?: OptionData[];
|
|
88
|
+
/**
|
|
89
|
+
* Context information for analytics. Eg: if a user picker was put inside a comment, the childObjectId would be
|
|
90
|
+
* the ID of the comment. Optional, but please provide if available.
|
|
91
|
+
*/
|
|
92
|
+
childObjectId?: string;
|
|
93
|
+
/**
|
|
94
|
+
* The container Id to identify context.
|
|
95
|
+
*
|
|
96
|
+
* e.g. Jira: projectId. Confluence: spaceId. Bitbucket: repositoryId.
|
|
97
|
+
*/
|
|
98
|
+
containerId?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Time to debounce the suggestions fetching (in milliseconds). Defaults to 150ms.
|
|
101
|
+
*/
|
|
102
|
+
debounceTime?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Function to transform options suggested by the server before showing to the user. Can be used to filter out suggestions.
|
|
105
|
+
* The results of filterOptions are the results displayed in the suggestions UI.
|
|
106
|
+
*/
|
|
107
|
+
filterOptions?: FilterOptions;
|
|
108
|
+
/**
|
|
109
|
+
* Whether to include groups in the resultset. Only supported for Confluence. @default false
|
|
110
|
+
*/
|
|
111
|
+
includeGroups?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Whether to include teams in the resultset. @default false
|
|
114
|
+
*/
|
|
115
|
+
includeTeams?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Whether to include users in the resultset. @default true
|
|
118
|
+
*/
|
|
119
|
+
includeUsers?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* An identifier of the closest context object, e.g. issueId, pageId, pullRequestId.
|
|
122
|
+
* Used for analytics. Optional, but please include if available.
|
|
123
|
+
*/
|
|
124
|
+
objectId?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Custom handler to give opportunity for caller to return list of options when server returns empty list.
|
|
127
|
+
* this is called if server returns empty list. This will NOT be called if props.filterOptions returns empty list.
|
|
128
|
+
*/
|
|
129
|
+
onEmpty?: OnEmpty;
|
|
130
|
+
/**
|
|
131
|
+
* Error handler for when the server fails to suggest users and returns with an error response.
|
|
132
|
+
* `error`: the error.
|
|
133
|
+
* `RecommendationRequest`: the original recommendationRequest containing the query and other search parameters.
|
|
134
|
+
* This may be used to provide a fail over search direct to the product backend.
|
|
135
|
+
* Helper fail over clients exist under /helpers.
|
|
136
|
+
* Note that OnError results are filtered.
|
|
137
|
+
*/
|
|
138
|
+
onError?: OnError;
|
|
139
|
+
/**
|
|
140
|
+
* Error handler used to provide OptionData[] values when the server fails to hydrate the `defaultValue` prop's values.
|
|
141
|
+
*/
|
|
142
|
+
onValueError?: OnValueError;
|
|
143
|
+
/**
|
|
144
|
+
* Prefetch the list of suggested assignees before the user picker is focused.
|
|
145
|
+
* WARNING: please consider carefully before deciding to prefetch your suggestions
|
|
146
|
+
* as this will increase the load on the recommendations services (has caused HOTs).
|
|
147
|
+
* Please give #help-smart-experiences a ballpark on the expected request volume.
|
|
148
|
+
*/
|
|
149
|
+
prefetch?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Id of the user interacting with the component.
|
|
152
|
+
* If principalId is not provided, server will extract principalId from the context header, assuming that the user is logged in
|
|
153
|
+
* when making the request. @default “context”
|
|
154
|
+
*/
|
|
155
|
+
principalId?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Product-specific Attributes - you should pass in the attribute type that matches your current SupportedProduct.
|
|
158
|
+
* Currently we support additional attributes (BitbucketAttributes) for bitbucket and (ConfluenceAttributes) for Confluence.
|
|
159
|
+
*/
|
|
160
|
+
productAttributes?: ProductAttributes;
|
|
161
|
+
/**
|
|
162
|
+
* Product identifier. If you are an NPF, please ensure your product has been onboarded with
|
|
163
|
+
* Cross-product user-search @see https://developer.atlassian.com/cloud/cross-product-user-search/
|
|
164
|
+
* If you are still waiting for CPUS, you can use the `people` productKey in the interim.
|
|
165
|
+
*/
|
|
166
|
+
productKey: string;
|
|
167
|
+
/**
|
|
168
|
+
* Filter to be applied to the eventual query to CPUS for user suggestions.
|
|
169
|
+
* Example:`account_status:"active" AND (NOT email_domain:"connect.atlassian.com")`
|
|
170
|
+
* will remove inactive users from the list of suggestions.
|
|
171
|
+
*/
|
|
172
|
+
searchQueryFilter?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Identifier for the product's tenant, also known as tenantId or cloudId
|
|
175
|
+
*/
|
|
176
|
+
siteId: string;
|
|
177
|
+
/**
|
|
178
|
+
* Identifier for the organization in which to search for teams.
|
|
179
|
+
*/
|
|
180
|
+
orgId?: string;
|
|
181
|
+
}
|
|
182
|
+
export interface Props extends SmartProps, UserPickerProps, WithAnalyticsEventsProps {
|
|
183
|
+
/**
|
|
184
|
+
* The pre-selected values for the smart user picker. Supports only Users and Teams default value hydration.
|
|
185
|
+
* If the `DefaultValue` contains only an `id` and `type` (it conforms to an `OptionIdentifier`)
|
|
186
|
+
* then the values will be automatically hydrated.
|
|
187
|
+
* If the value has a `name` then it is considered hydrated and will be ignored.
|
|
188
|
+
* Uses Confluence and Jira if called from there, else uses Identity or Legion for teams. If a value could not be found, or there was
|
|
189
|
+
* a network failure during the hydration, the value will be rendered with the label 'Unknown'. Else, if there were any other error
|
|
190
|
+
* during default value hydration, no default values will be rendered, use `onValueError` to handle this.
|
|
191
|
+
* `defaultValue` differs from `value` in that it sets the initial value then leaves the component 'uncontrolled'
|
|
192
|
+
* whereas setting the `value` prop delegates responsibility for maintaining the value to the caller
|
|
193
|
+
* (i.e. listen to `onChange`)
|
|
194
|
+
*/
|
|
195
|
+
defaultValue?: DefaultValue;
|
|
196
|
+
/**
|
|
197
|
+
* Identifier for informing the server on where the user picker has been mounted.
|
|
198
|
+
* Unlike User Picker, the fieldId in Smart User Picker is mandatory.
|
|
199
|
+
* The server uses the fieldId to determine which model to utilize when
|
|
200
|
+
* generating suggestions.
|
|
201
|
+
* All fieldId's will be bucketed into a model that provides generic smart results,
|
|
202
|
+
* except "assignee", "mentions" which are specifically trained for Jira Assignee and
|
|
203
|
+
* @Mentions. For specifically trained models, please contact #help-smart-experiences.
|
|
204
|
+
*/
|
|
205
|
+
fieldId: string;
|
|
206
|
+
}
|
|
207
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConcurrentExperience } from '@atlaskit/ufo';
|
|
3
|
+
export declare const smartUserPickerRenderedUfoExperience: ConcurrentExperience;
|
|
4
|
+
export declare const smartUserPickerOptionsShownUfoExperience: ConcurrentExperience;
|
|
5
|
+
export declare const useUFOConcurrentExperience: (experience: ConcurrentExperience, id: string) => void;
|
|
6
|
+
export declare class UfoErrorBoundary extends React.Component<{
|
|
7
|
+
id: string;
|
|
8
|
+
}> {
|
|
9
|
+
componentDidCatch(): void;
|
|
10
|
+
render(): React.ReactNode;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tries to get the most specific messages bundle for a given locale.
|
|
3
|
+
*
|
|
4
|
+
* Strategy:
|
|
5
|
+
* 1. Try to find messages with the exact string (i.e. 'fr_FR')
|
|
6
|
+
* 2. If that doesn't work, try to find messages for the country locale (i.e. 'fr')
|
|
7
|
+
* 3. If that doesn't work, return english messages as a fallback.
|
|
8
|
+
*
|
|
9
|
+
* @param locale string specifying the locale like 'en_GB', or 'fr'.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getMessagesForLocale: (locale: string) => Promise<Record<string, string>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-user-picker",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/"
|
|
6
6
|
},
|
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
"module": "dist/esm/index.js",
|
|
12
12
|
"module:es2019": "dist/es2019/index.js",
|
|
13
13
|
"types": "dist/types/index.d.ts",
|
|
14
|
+
"typesVersions": {
|
|
15
|
+
">=4.5 <4.9": {
|
|
16
|
+
"*": [
|
|
17
|
+
"dist/types-ts4.5/*",
|
|
18
|
+
"dist/types-ts4.5/index.d.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
14
22
|
"sideEffects": false,
|
|
15
23
|
"atlaskit:src": "src/index.ts",
|
|
16
24
|
"af:exports": {
|
|
@@ -50,7 +58,7 @@
|
|
|
50
58
|
"fetch-mock": "^8.0.0",
|
|
51
59
|
"graphql-tag": "^2.10.1",
|
|
52
60
|
"mock-apollo-client": "^0.1.0",
|
|
53
|
-
"typescript": "4.
|
|
61
|
+
"typescript": "~4.9.5"
|
|
54
62
|
},
|
|
55
63
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
56
64
|
}
|