@atlaskit/user-picker 9.7.4 → 10.0.1
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/analytics.js +2 -53
- package/dist/cjs/clients/UserSourceProvider.js +11 -33
- package/dist/cjs/components/AddOptionAvatar.js +2 -9
- package/dist/cjs/components/AvatarItemOption.js +4 -29
- package/dist/cjs/components/BaseUserPicker.js +56 -156
- package/dist/cjs/components/ClearIndicator.js +4 -35
- package/dist/cjs/components/CustomOption/index.js +0 -7
- package/dist/cjs/components/CustomOption/main.js +4 -30
- package/dist/cjs/components/EmailOption/index.js +0 -7
- package/dist/cjs/components/EmailOption/main.js +2 -29
- package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +4 -15
- package/dist/cjs/components/ExternalUserOption/InfoIcon.js +4 -13
- package/dist/cjs/components/ExternalUserOption/SourcesTooltipContent.js +4 -20
- package/dist/cjs/components/ExternalUserOption/index.js +0 -7
- package/dist/cjs/components/ExternalUserOption/main.js +10 -48
- package/dist/cjs/components/ExternalUserSourcesContainer.js +5 -13
- package/dist/cjs/components/GroupOption/index.js +0 -7
- package/dist/cjs/components/GroupOption/main.js +4 -31
- package/dist/cjs/components/HighlightText.js +3 -27
- package/dist/cjs/components/Input.js +0 -23
- package/dist/cjs/components/MessagesIntlProvider.js +3 -20
- package/dist/cjs/components/MultiValue.js +21 -57
- package/dist/cjs/components/MultiValueContainer.js +8 -47
- package/dist/cjs/components/Option.js +5 -27
- package/dist/cjs/components/PopupControl.js +0 -22
- package/dist/cjs/components/PopupInput.js +0 -22
- package/dist/cjs/components/PopupUserPicker.js +10 -39
- package/dist/cjs/components/SingleValue.js +6 -17
- package/dist/cjs/components/SingleValueContainer.js +8 -37
- package/dist/cjs/components/SizeableAvatar.js +4 -20
- package/dist/cjs/components/TeamOption/index.js +0 -7
- package/dist/cjs/components/TeamOption/main.js +9 -37
- package/dist/cjs/components/UserOption.js +7 -34
- package/dist/cjs/components/UserPicker.js +14 -50
- package/dist/cjs/components/assets/github.js +0 -4
- package/dist/cjs/components/assets/google.js +0 -4
- package/dist/cjs/components/assets/microsoft.js +0 -4
- package/dist/cjs/components/assets/slack.js +0 -4
- package/dist/cjs/components/batch.js +0 -3
- package/dist/cjs/components/components.js +0 -17
- package/dist/cjs/components/creatable.js +2 -15
- package/dist/cjs/components/creatableEmailSuggestion.js +7 -18
- package/dist/cjs/components/emailValidation.js +0 -4
- package/dist/cjs/components/i18n.js +0 -2
- package/dist/cjs/components/popup.js +0 -3
- package/dist/cjs/components/styles.js +10 -26
- package/dist/cjs/components/utils.js +0 -53
- package/dist/cjs/i18n/cs.js +1 -1
- package/dist/cjs/i18n/da.js +1 -1
- package/dist/cjs/i18n/de.js +1 -1
- package/dist/cjs/i18n/en.js +31 -4
- package/dist/cjs/i18n/en_GB.js +31 -4
- package/dist/cjs/i18n/en_ZZ.js +1 -1
- package/dist/cjs/i18n/es.js +1 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +1 -1
- package/dist/cjs/i18n/fr.js +1 -1
- package/dist/cjs/i18n/hu.js +1 -1
- package/dist/cjs/i18n/index.js +0 -31
- package/dist/cjs/i18n/it.js +1 -1
- package/dist/cjs/i18n/ja.js +1 -1
- package/dist/cjs/i18n/ko.js +1 -1
- package/dist/cjs/i18n/nb.js +1 -1
- package/dist/cjs/i18n/nl.js +1 -1
- package/dist/cjs/i18n/pl.js +1 -1
- package/dist/cjs/i18n/pt_BR.js +1 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +1 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +1 -1
- package/dist/cjs/i18n/th.js +1 -1
- package/dist/cjs/i18n/tr.js +1 -1
- package/dist/cjs/i18n/uk.js +1 -1
- package/dist/cjs/i18n/vi.js +1 -1
- package/dist/cjs/i18n/zh.js +1 -1
- package/dist/cjs/i18n/zh_TW.js +1 -1
- package/dist/cjs/index.js +0 -5
- package/dist/cjs/util/i18n-util.js +0 -43
- package/dist/cjs/util/ufoExperiences.js +0 -17
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics.js +18 -35
- package/dist/es2019/clients/UserSourceProvider.js +0 -6
- package/dist/es2019/components/AddOptionAvatar.js +0 -2
- package/dist/es2019/components/AvatarItemOption.js +1 -10
- package/dist/es2019/components/BaseUserPicker.js +9 -84
- package/dist/es2019/components/ClearIndicator.js +5 -11
- package/dist/es2019/components/CustomOption/index.js +1 -3
- package/dist/es2019/components/CustomOption/main.js +0 -10
- package/dist/es2019/components/EmailOption/index.js +1 -3
- package/dist/es2019/components/EmailOption/main.js +0 -9
- package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -4
- package/dist/es2019/components/ExternalUserOption/index.js +1 -3
- package/dist/es2019/components/ExternalUserOption/main.js +0 -15
- package/dist/es2019/components/ExternalUserSourcesContainer.js +0 -2
- package/dist/es2019/components/GroupOption/index.js +1 -3
- package/dist/es2019/components/GroupOption/main.js +0 -7
- package/dist/es2019/components/HighlightText.js +0 -11
- package/dist/es2019/components/Input.js +0 -5
- package/dist/es2019/components/MessagesIntlProvider.js +2 -4
- package/dist/es2019/components/MultiValue.js +3 -15
- package/dist/es2019/components/MultiValueContainer.js +4 -24
- package/dist/es2019/components/Option.js +0 -9
- package/dist/es2019/components/PopupControl.js +0 -4
- package/dist/es2019/components/PopupInput.js +0 -6
- package/dist/es2019/components/PopupUserPicker.js +0 -8
- package/dist/es2019/components/SingleValue.js +0 -1
- package/dist/es2019/components/SingleValueContainer.js +0 -8
- package/dist/es2019/components/SizeableAvatar.js +0 -1
- package/dist/es2019/components/TeamOption/index.js +1 -3
- package/dist/es2019/components/TeamOption/main.js +2 -12
- package/dist/es2019/components/UserOption.js +0 -9
- package/dist/es2019/components/UserPicker.js +6 -8
- package/dist/es2019/components/batch.js +0 -1
- package/dist/es2019/components/components.js +3 -4
- package/dist/es2019/components/creatable.js +2 -9
- package/dist/es2019/components/creatableEmailSuggestion.js +7 -12
- package/dist/es2019/components/emailValidation.js +0 -2
- package/dist/es2019/components/styles.js +30 -22
- package/dist/es2019/components/utils.js +2 -8
- package/dist/es2019/i18n/cs.js +1 -0
- package/dist/es2019/i18n/da.js +1 -0
- package/dist/es2019/i18n/de.js +1 -0
- package/dist/es2019/i18n/en.js +31 -4
- package/dist/es2019/i18n/en_GB.js +31 -4
- package/dist/es2019/i18n/en_ZZ.js +1 -0
- package/dist/es2019/i18n/es.js +1 -0
- package/dist/es2019/i18n/fi.js +1 -0
- package/dist/es2019/i18n/fr.js +1 -0
- package/dist/es2019/i18n/hu.js +1 -0
- package/dist/es2019/i18n/it.js +1 -0
- package/dist/es2019/i18n/ja.js +1 -0
- package/dist/es2019/i18n/ko.js +1 -0
- package/dist/es2019/i18n/nb.js +1 -0
- package/dist/es2019/i18n/nl.js +1 -0
- package/dist/es2019/i18n/pl.js +1 -0
- package/dist/es2019/i18n/pt_BR.js +1 -0
- package/dist/es2019/i18n/ru.js +1 -0
- package/dist/es2019/i18n/sv.js +1 -0
- package/dist/es2019/i18n/th.js +1 -0
- package/dist/es2019/i18n/tr.js +1 -0
- package/dist/es2019/i18n/uk.js +1 -0
- package/dist/es2019/i18n/vi.js +1 -0
- package/dist/es2019/i18n/zh.js +1 -0
- package/dist/es2019/i18n/zh_TW.js +1 -0
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/util/i18n-util.js +30 -120
- package/dist/es2019/util/ufoExperiences.js +0 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.js +2 -30
- package/dist/esm/clients/UserSourceProvider.js +11 -21
- package/dist/esm/components/AddOptionAvatar.js +1 -3
- package/dist/esm/components/AvatarItemOption.js +5 -18
- package/dist/esm/components/BaseUserPicker.js +56 -167
- package/dist/esm/components/ClearIndicator.js +5 -23
- package/dist/esm/components/CustomOption/index.js +1 -3
- package/dist/esm/components/CustomOption/main.js +4 -22
- package/dist/esm/components/EmailOption/index.js +1 -3
- package/dist/esm/components/EmailOption/main.js +2 -20
- package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +5 -11
- package/dist/esm/components/ExternalUserOption/InfoIcon.js +3 -5
- package/dist/esm/components/ExternalUserOption/SourcesTooltipContent.js +3 -3
- package/dist/esm/components/ExternalUserOption/index.js +1 -3
- package/dist/esm/components/ExternalUserOption/main.js +10 -35
- package/dist/esm/components/ExternalUserSourcesContainer.js +5 -8
- package/dist/esm/components/GroupOption/index.js +1 -3
- package/dist/esm/components/GroupOption/main.js +4 -19
- package/dist/esm/components/HighlightText.js +3 -21
- package/dist/esm/components/Input.js +0 -14
- package/dist/esm/components/MessagesIntlProvider.js +3 -10
- package/dist/esm/components/MultiValue.js +21 -39
- package/dist/esm/components/MultiValueContainer.js +8 -37
- package/dist/esm/components/Option.js +5 -15
- package/dist/esm/components/PopupControl.js +0 -11
- package/dist/esm/components/PopupInput.js +0 -14
- package/dist/esm/components/PopupUserPicker.js +10 -28
- package/dist/esm/components/SingleValue.js +6 -8
- package/dist/esm/components/SingleValueContainer.js +8 -25
- package/dist/esm/components/SizeableAvatar.js +4 -12
- package/dist/esm/components/TeamOption/index.js +1 -3
- package/dist/esm/components/TeamOption/main.js +9 -27
- package/dist/esm/components/UserOption.js +7 -24
- package/dist/esm/components/UserPicker.js +14 -26
- package/dist/esm/components/batch.js +0 -2
- package/dist/esm/components/components.js +1 -6
- package/dist/esm/components/creatable.js +2 -9
- package/dist/esm/components/creatableEmailSuggestion.js +7 -12
- package/dist/esm/components/emailValidation.js +0 -2
- package/dist/esm/components/styles.js +10 -21
- package/dist/esm/components/utils.js +0 -11
- package/dist/esm/i18n/cs.js +1 -0
- package/dist/esm/i18n/da.js +1 -0
- package/dist/esm/i18n/de.js +1 -0
- package/dist/esm/i18n/en.js +31 -4
- package/dist/esm/i18n/en_GB.js +31 -4
- package/dist/esm/i18n/en_ZZ.js +1 -0
- package/dist/esm/i18n/es.js +1 -0
- package/dist/esm/i18n/fi.js +1 -0
- package/dist/esm/i18n/fr.js +1 -0
- package/dist/esm/i18n/hu.js +1 -0
- package/dist/esm/i18n/it.js +1 -0
- package/dist/esm/i18n/ja.js +1 -0
- package/dist/esm/i18n/ko.js +1 -0
- package/dist/esm/i18n/nb.js +1 -0
- package/dist/esm/i18n/nl.js +1 -0
- package/dist/esm/i18n/pl.js +1 -0
- package/dist/esm/i18n/pt_BR.js +1 -0
- package/dist/esm/i18n/ru.js +1 -0
- package/dist/esm/i18n/sv.js +1 -0
- package/dist/esm/i18n/th.js +1 -0
- package/dist/esm/i18n/tr.js +1 -0
- package/dist/esm/i18n/uk.js +1 -0
- package/dist/esm/i18n/vi.js +1 -0
- package/dist/esm/i18n/zh.js +1 -0
- package/dist/esm/i18n/zh_TW.js +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/util/i18n-util.js +30 -126
- package/dist/esm/util/ufoExperiences.js +0 -9
- package/dist/esm/version.json +1 -1
- package/dist/types/i18n/cs.d.ts +1 -0
- package/dist/types/i18n/da.d.ts +1 -0
- package/dist/types/i18n/de.d.ts +1 -0
- package/dist/types/i18n/en.d.ts +28 -1
- package/dist/types/i18n/en_GB.d.ts +28 -1
- package/dist/types/i18n/en_ZZ.d.ts +1 -0
- package/dist/types/i18n/es.d.ts +1 -0
- package/dist/types/i18n/fi.d.ts +1 -0
- package/dist/types/i18n/fr.d.ts +1 -0
- package/dist/types/i18n/hu.d.ts +1 -0
- package/dist/types/i18n/it.d.ts +1 -0
- package/dist/types/i18n/ja.d.ts +1 -0
- package/dist/types/i18n/ko.d.ts +1 -0
- package/dist/types/i18n/nb.d.ts +1 -0
- package/dist/types/i18n/nl.d.ts +1 -0
- package/dist/types/i18n/pl.d.ts +1 -0
- package/dist/types/i18n/pt_BR.d.ts +1 -0
- package/dist/types/i18n/ru.d.ts +1 -0
- package/dist/types/i18n/sv.d.ts +1 -0
- package/dist/types/i18n/th.d.ts +1 -0
- package/dist/types/i18n/tr.d.ts +1 -0
- package/dist/types/i18n/uk.d.ts +1 -0
- package/dist/types/i18n/vi.d.ts +1 -0
- package/dist/types/i18n/zh.d.ts +1 -0
- package/dist/types/i18n/zh_TW.d.ts +1 -0
- package/dist/types/types.d.ts +1 -1
- package/package.json +3 -2
- package/report.api.md +1 -4
- package/tmp/api-report-tmp.d.ts +1 -1
package/dist/esm/analytics.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
8
5
|
import { v4 as uuidv4 } from 'uuid';
|
|
9
6
|
import versionJson from './version.json';
|
|
@@ -24,7 +21,6 @@ export var startSession = function startSession() {
|
|
|
24
21
|
};
|
|
25
22
|
};
|
|
26
23
|
export var createAndFireEventInElementsChannel = createAndFireEvent('fabric-elements');
|
|
27
|
-
|
|
28
24
|
var createEvent = function createEvent(eventType, action, actionSubject) {
|
|
29
25
|
var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
30
26
|
return {
|
|
@@ -37,20 +33,17 @@ var createEvent = function createEvent(eventType, action, actionSubject) {
|
|
|
37
33
|
}, attributes)
|
|
38
34
|
};
|
|
39
35
|
};
|
|
40
|
-
|
|
41
36
|
var checkValidId = function checkValidId(id) {
|
|
42
37
|
return UUID_REGEXP_NEW_AAID.test(id) || UUID_REGEXP_OLD_AAID.test(id) || UUID_REGEXP_TEAMS_GROUPS.test(id);
|
|
43
38
|
};
|
|
44
|
-
|
|
45
39
|
var optionData2Analytics = function optionData2Analytics(option) {
|
|
46
40
|
var id = option.id,
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
type = option.type;
|
|
42
|
+
// id's of email types are emails which is PII
|
|
49
43
|
var validatedData = {
|
|
50
44
|
id: checkValidId(id) ? id : null,
|
|
51
45
|
type: type || null
|
|
52
46
|
};
|
|
53
|
-
|
|
54
47
|
if (isExternalUser(option)) {
|
|
55
48
|
return _objectSpread(_objectSpread({}, validatedData), {}, {
|
|
56
49
|
type: 'external_user',
|
|
@@ -58,16 +51,13 @@ var optionData2Analytics = function optionData2Analytics(option) {
|
|
|
58
51
|
externalUserType: option.externalUserType
|
|
59
52
|
});
|
|
60
53
|
}
|
|
61
|
-
|
|
62
54
|
if (isCustom(option) && option.analyticsType) {
|
|
63
55
|
return _objectSpread(_objectSpread({}, validatedData), {}, {
|
|
64
56
|
type: option.analyticsType
|
|
65
57
|
});
|
|
66
58
|
}
|
|
67
|
-
|
|
68
59
|
return validatedData;
|
|
69
60
|
};
|
|
70
|
-
|
|
71
61
|
var buildValueForAnalytics = function buildValueForAnalytics(value) {
|
|
72
62
|
if (value) {
|
|
73
63
|
var valueToConvert = Array.isArray(value) ? value : [value];
|
|
@@ -76,10 +66,8 @@ var buildValueForAnalytics = function buildValueForAnalytics(value) {
|
|
|
76
66
|
return optionData2Analytics(data);
|
|
77
67
|
});
|
|
78
68
|
}
|
|
79
|
-
|
|
80
69
|
return [];
|
|
81
70
|
};
|
|
82
|
-
|
|
83
71
|
var createDefaultPickerAttributes = function createDefaultPickerAttributes(props, session, journeyId) {
|
|
84
72
|
return {
|
|
85
73
|
context: props.fieldId,
|
|
@@ -88,7 +76,6 @@ var createDefaultPickerAttributes = function createDefaultPickerAttributes(props
|
|
|
88
76
|
journeyId: journeyId
|
|
89
77
|
};
|
|
90
78
|
};
|
|
91
|
-
|
|
92
79
|
export var focusEvent = function focusEvent(props, state, session, journeyId) {
|
|
93
80
|
return createEvent('ui', 'focused', 'userPicker', _objectSpread(_objectSpread({}, createDefaultPickerAttributes(props, session, journeyId)), {}, {
|
|
94
81
|
values: buildValueForAnalytics(state.value)
|
|
@@ -151,67 +138,52 @@ export var userInfoEvent = function userInfoEvent(sources, accountId) {
|
|
|
151
138
|
accountId: checkValidId(accountId) ? accountId : null
|
|
152
139
|
});
|
|
153
140
|
};
|
|
154
|
-
|
|
155
141
|
function queryLength(state) {
|
|
156
142
|
return state.inputValue.length;
|
|
157
143
|
}
|
|
158
|
-
|
|
159
144
|
function selectEventType(session) {
|
|
160
145
|
return session && session.lastKey === 13 ? 'pressed' : 'clicked';
|
|
161
146
|
}
|
|
162
|
-
|
|
163
147
|
function upKeyCount(session) {
|
|
164
148
|
return session ? session.upCount : null;
|
|
165
149
|
}
|
|
166
|
-
|
|
167
150
|
function downKeyCount(session) {
|
|
168
151
|
return session ? session.downCount : null;
|
|
169
152
|
}
|
|
170
|
-
|
|
171
153
|
function spaceInQuery(state) {
|
|
172
154
|
return state.inputValue.indexOf(' ') !== -1;
|
|
173
155
|
}
|
|
174
|
-
|
|
175
156
|
function sessionDuration(session) {
|
|
176
157
|
return session ? Date.now() - session.start : null;
|
|
177
158
|
}
|
|
178
|
-
|
|
179
159
|
function durationSinceInputChange(session) {
|
|
180
160
|
return session ? Date.now() - session.inputChangeTime : null;
|
|
181
161
|
}
|
|
182
|
-
|
|
183
162
|
function sessionId(session) {
|
|
184
163
|
return session && session.id;
|
|
185
164
|
}
|
|
186
|
-
|
|
187
165
|
function position(state, value) {
|
|
188
166
|
return value ? state.options.findIndex(function (option) {
|
|
189
167
|
return option === value.data;
|
|
190
168
|
}) : -1;
|
|
191
169
|
}
|
|
192
|
-
|
|
193
170
|
function pickerType(props) {
|
|
194
171
|
return props.isMulti ? 'multi' : 'single';
|
|
195
172
|
}
|
|
196
|
-
|
|
197
173
|
function result(option) {
|
|
198
174
|
return option ? optionData2Analytics(option.data) : null;
|
|
199
175
|
}
|
|
200
|
-
|
|
201
176
|
function results(state) {
|
|
202
177
|
return (state.options || []).map(optionData2Analytics);
|
|
203
178
|
}
|
|
204
|
-
|
|
205
179
|
function isLoading(props, state) {
|
|
206
180
|
return state.count > 0 || props.isLoading;
|
|
207
181
|
}
|
|
208
|
-
|
|
209
182
|
function values(state) {
|
|
210
183
|
return state.value ? Array.isArray(state.value) ? state.value.map(function (option) {
|
|
211
184
|
return optionData2Analytics(option.data);
|
|
212
185
|
}) : [optionData2Analytics(state.value.data)] : [];
|
|
213
186
|
}
|
|
214
|
-
|
|
215
187
|
function numberOfResults(state) {
|
|
216
188
|
return (state.options || []).length;
|
|
217
189
|
}
|
|
@@ -4,7 +4,7 @@ import React, { createContext, useContext, useEffect, useMemo, useState } from '
|
|
|
4
4
|
var ExusUserSourceContext = /*#__PURE__*/createContext({});
|
|
5
5
|
export var ExusUserSourceProvider = function ExusUserSourceProvider(_ref) {
|
|
6
6
|
var fetchUserSource = _ref.fetchUserSource,
|
|
7
|
-
|
|
7
|
+
children = _ref.children;
|
|
8
8
|
return /*#__PURE__*/React.createElement(ExusUserSourceContext.Provider, {
|
|
9
9
|
value: {
|
|
10
10
|
fetchUserSource: fetchUserSource
|
|
@@ -13,48 +13,39 @@ export var ExusUserSourceProvider = function ExusUserSourceProvider(_ref) {
|
|
|
13
13
|
};
|
|
14
14
|
export var useUserSource = function useUserSource(accountId, shouldFetchSources, existingSources) {
|
|
15
15
|
var _useContext = useContext(ExusUserSourceContext),
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
fetchUserSource = _useContext.fetchUserSource;
|
|
18
17
|
var _useState = useState([]),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
externalSources = _useState2[0],
|
|
20
|
+
setExternalSources = _useState2[1];
|
|
23
21
|
var _useState3 = useState(true),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
|
+
loading = _useState4[0],
|
|
24
|
+
setLoading = _useState4[1];
|
|
28
25
|
var _useState5 = useState(null),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
27
|
+
error = _useState6[0],
|
|
28
|
+
setError = _useState6[1];
|
|
33
29
|
var abortController = useMemo(function () {
|
|
34
30
|
if (typeof AbortController === 'undefined') {
|
|
35
31
|
return;
|
|
36
32
|
}
|
|
37
|
-
|
|
38
33
|
return new AbortController();
|
|
39
34
|
}, []);
|
|
40
35
|
useEffect(function () {
|
|
41
36
|
var isMounted = true;
|
|
42
|
-
|
|
43
37
|
var cleanup = function cleanup() {
|
|
44
38
|
abortController === null || abortController === void 0 ? void 0 : abortController.abort();
|
|
45
39
|
isMounted = false;
|
|
46
40
|
};
|
|
47
|
-
|
|
48
41
|
if (!fetchUserSource || !shouldFetchSources) {
|
|
49
42
|
setLoading(false);
|
|
50
43
|
return cleanup;
|
|
51
44
|
}
|
|
52
|
-
|
|
53
45
|
fetchUserSource(accountId, abortController === null || abortController === void 0 ? void 0 : abortController.signal).then(function (externalSources) {
|
|
54
46
|
if (!isMounted) {
|
|
55
47
|
return;
|
|
56
48
|
}
|
|
57
|
-
|
|
58
49
|
setLoading(false);
|
|
59
50
|
var externalSourceTypes = externalSources.map(function (source) {
|
|
60
51
|
return source.sourceType;
|
|
@@ -64,7 +55,6 @@ export var useUserSource = function useUserSource(accountId, shouldFetchSources,
|
|
|
64
55
|
if (!isMounted) {
|
|
65
56
|
return;
|
|
66
57
|
}
|
|
67
|
-
|
|
68
58
|
setLoading(false);
|
|
69
59
|
setError(error);
|
|
70
60
|
});
|
|
@@ -3,7 +3,6 @@ import EmailIcon from '@atlaskit/icon/glyph/email';
|
|
|
3
3
|
import { N40, N500 } from '@atlaskit/theme/colors';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
|
-
|
|
7
6
|
var getEmailAvatarWrapperStyle = function getEmailAvatarWrapperStyle(isLozenge) {
|
|
8
7
|
var padding = isLozenge ? 0 : 4;
|
|
9
8
|
return css({
|
|
@@ -14,10 +13,9 @@ var getEmailAvatarWrapperStyle = function getEmailAvatarWrapperStyle(isLozenge)
|
|
|
14
13
|
alignItems: 'center'
|
|
15
14
|
});
|
|
16
15
|
};
|
|
17
|
-
|
|
18
16
|
export var AddOptionAvatar = function AddOptionAvatar(_ref) {
|
|
19
17
|
var isLozenge = _ref.isLozenge,
|
|
20
|
-
|
|
18
|
+
label = _ref.label;
|
|
21
19
|
return jsx("div", {
|
|
22
20
|
css: getEmailAvatarWrapperStyle(isLozenge)
|
|
23
21
|
}, jsx(EmailIcon, {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
/** @jsx jsx */
|
|
8
5
|
import React from 'react';
|
|
9
6
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
@@ -11,15 +8,12 @@ import { css, jsx } from '@emotion/react';
|
|
|
11
8
|
import Lozenge from '@atlaskit/lozenge';
|
|
12
9
|
import { isLozengeText } from './utils';
|
|
13
10
|
var AsyncTooltip = /*#__PURE__*/React.lazy(function () {
|
|
14
|
-
return import(
|
|
15
|
-
/* webpackChunkName: "@atlaskit-internal_@atlaskit/tooltip" */
|
|
16
|
-
'@atlaskit/tooltip').then(function (module) {
|
|
11
|
+
return import( /* webpackChunkName: "@atlaskit-internal_@atlaskit/tooltip" */'@atlaskit/tooltip').then(function (module) {
|
|
17
12
|
return {
|
|
18
13
|
default: module.default
|
|
19
14
|
};
|
|
20
15
|
});
|
|
21
16
|
});
|
|
22
|
-
|
|
23
17
|
var wrapper = function wrapper(isDisabled) {
|
|
24
18
|
return css({
|
|
25
19
|
alignItems: 'center',
|
|
@@ -33,7 +27,6 @@ var wrapper = function wrapper(isDisabled) {
|
|
|
33
27
|
opacity: isDisabled ? "var(--ds-opacity-disabled, 0.4)" : undefined
|
|
34
28
|
});
|
|
35
29
|
};
|
|
36
|
-
|
|
37
30
|
var optionWrapper = css({
|
|
38
31
|
maxWidth: '100%',
|
|
39
32
|
minWidth: 0,
|
|
@@ -41,7 +34,6 @@ var optionWrapper = css({
|
|
|
41
34
|
lineHeight: '1.4',
|
|
42
35
|
paddingLeft: "".concat(gridSize(), "px")
|
|
43
36
|
});
|
|
44
|
-
|
|
45
37
|
var getTextStyle = function getTextStyle(isSecondary) {
|
|
46
38
|
var secondaryCssArgs = isSecondary ? {
|
|
47
39
|
fontSize: '0.85em'
|
|
@@ -53,7 +45,6 @@ var getTextStyle = function getTextStyle(isSecondary) {
|
|
|
53
45
|
whiteSpace: 'nowrap'
|
|
54
46
|
}, secondaryCssArgs));
|
|
55
47
|
};
|
|
56
|
-
|
|
57
48
|
var additionalInfo = css({
|
|
58
49
|
float: 'right'
|
|
59
50
|
});
|
|
@@ -67,11 +58,10 @@ export var textWrapper = function textWrapper(color) {
|
|
|
67
58
|
};
|
|
68
59
|
export var AvatarItemOption = function AvatarItemOption(_ref) {
|
|
69
60
|
var avatar = _ref.avatar,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
61
|
+
isDisabled = _ref.isDisabled,
|
|
62
|
+
lozenge = _ref.lozenge,
|
|
63
|
+
primaryText = _ref.primaryText,
|
|
64
|
+
secondaryText = _ref.secondaryText;
|
|
75
65
|
var renderLozenge = function renderLozenge() {
|
|
76
66
|
if (isLozengeText(lozenge)) {
|
|
77
67
|
if (lozenge !== null && lozenge !== void 0 && lozenge.tooltip) {
|
|
@@ -83,13 +73,10 @@ export var AvatarItemOption = function AvatarItemOption(_ref) {
|
|
|
83
73
|
content: lozenge.tooltip
|
|
84
74
|
}, jsx(Lozenge, lozenge, lozenge.text)));
|
|
85
75
|
}
|
|
86
|
-
|
|
87
76
|
return jsx(Lozenge, lozenge, lozenge.text);
|
|
88
77
|
}
|
|
89
|
-
|
|
90
78
|
return lozenge;
|
|
91
79
|
};
|
|
92
|
-
|
|
93
80
|
return jsx("span", {
|
|
94
81
|
css: wrapper(isDisabled)
|
|
95
82
|
}, avatar, jsx("div", {
|