@atlaskit/user-picker 10.20.2 → 10.20.4
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 +1110 -1103
- package/afm-cc/tsconfig.json +0 -3
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/BaseUserPicker.js +0 -59
- package/dist/es2019/analytics.js +1 -1
- package/dist/es2019/components/BaseUserPicker.js +0 -50
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/BaseUserPicker.js +0 -59
- package/dist/types/analytics.d.ts +2 -2
- package/dist/types/clients/UserSourceProvider.d.ts +2 -2
- package/dist/types/components/AvatarItemOption.d.ts +2 -2
- package/dist/types/components/BaseUserPicker.d.ts +0 -2
- package/dist/types/components/ClearIndicator.d.ts +1 -1
- package/dist/types/components/CustomOption/main.d.ts +1 -1
- package/dist/types/components/EmailOption/main.d.ts +2 -2
- package/dist/types/components/ExternalUserOption/ExternalAvatarItemOption.d.ts +1 -1
- package/dist/types/components/ExternalUserOption/SourcesTooltipContent.d.ts +1 -1
- package/dist/types/components/ExternalUserOption/main.d.ts +2 -2
- package/dist/types/components/ExternalUserSourcesContainer.d.ts +2 -2
- package/dist/types/components/GroupOption/main.d.ts +1 -1
- package/dist/types/components/HighlightText.d.ts +1 -1
- package/dist/types/components/Input.d.ts +1 -1
- package/dist/types/components/Menu.d.ts +1 -1
- package/dist/types/components/MessagesIntlProvider.d.ts +1 -1
- package/dist/types/components/MultiValue.d.ts +3 -3
- package/dist/types/components/MultiValueContainer.d.ts +2 -2
- package/dist/types/components/Option.d.ts +3 -3
- package/dist/types/components/PopupControl.d.ts +1 -1
- package/dist/types/components/PopupUserPicker.d.ts +1 -1
- package/dist/types/components/SingleValue.d.ts +2 -2
- package/dist/types/components/SingleValueContainer.d.ts +2 -2
- package/dist/types/components/TeamOption/main.d.ts +1 -1
- package/dist/types/components/UserOption.d.ts +1 -1
- package/dist/types/components/UserPicker.d.ts +1 -1
- package/dist/types/components/creatable.d.ts +2 -2
- package/dist/types/components/creatableEmailSuggestion.d.ts +2 -2
- package/dist/types/components/popup.d.ts +2 -2
- package/dist/types/components/styles.d.ts +1 -1
- package/dist/types/components/utils.d.ts +2 -2
- package/dist/types/types.d.ts +8 -6
- package/dist/types-ts4.5/analytics.d.ts +2 -2
- package/dist/types-ts4.5/clients/UserSourceProvider.d.ts +2 -2
- package/dist/types-ts4.5/components/AvatarItemOption.d.ts +2 -2
- package/dist/types-ts4.5/components/BaseUserPicker.d.ts +0 -2
- package/dist/types-ts4.5/components/ClearIndicator.d.ts +1 -1
- package/dist/types-ts4.5/components/CustomOption/main.d.ts +1 -1
- package/dist/types-ts4.5/components/EmailOption/main.d.ts +2 -2
- package/dist/types-ts4.5/components/ExternalUserOption/ExternalAvatarItemOption.d.ts +1 -1
- package/dist/types-ts4.5/components/ExternalUserOption/SourcesTooltipContent.d.ts +1 -1
- package/dist/types-ts4.5/components/ExternalUserOption/main.d.ts +2 -2
- package/dist/types-ts4.5/components/ExternalUserSourcesContainer.d.ts +2 -2
- package/dist/types-ts4.5/components/GroupOption/main.d.ts +1 -1
- package/dist/types-ts4.5/components/HighlightText.d.ts +1 -1
- package/dist/types-ts4.5/components/Input.d.ts +1 -1
- package/dist/types-ts4.5/components/Menu.d.ts +1 -1
- package/dist/types-ts4.5/components/MessagesIntlProvider.d.ts +1 -1
- package/dist/types-ts4.5/components/MultiValue.d.ts +3 -3
- package/dist/types-ts4.5/components/MultiValueContainer.d.ts +2 -2
- package/dist/types-ts4.5/components/Option.d.ts +3 -3
- package/dist/types-ts4.5/components/PopupControl.d.ts +1 -1
- package/dist/types-ts4.5/components/PopupUserPicker.d.ts +1 -1
- package/dist/types-ts4.5/components/SingleValue.d.ts +2 -2
- package/dist/types-ts4.5/components/SingleValueContainer.d.ts +2 -2
- package/dist/types-ts4.5/components/TeamOption/main.d.ts +1 -1
- package/dist/types-ts4.5/components/UserOption.d.ts +1 -1
- package/dist/types-ts4.5/components/UserPicker.d.ts +1 -1
- package/dist/types-ts4.5/components/creatable.d.ts +2 -2
- package/dist/types-ts4.5/components/creatableEmailSuggestion.d.ts +2 -2
- package/dist/types-ts4.5/components/popup.d.ts +2 -2
- package/dist/types-ts4.5/components/styles.d.ts +1 -1
- package/dist/types-ts4.5/components/utils.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +8 -6
- package/package.json +5 -13
package/afm-cc/tsconfig.json
CHANGED
package/dist/cjs/analytics.js
CHANGED
|
@@ -12,7 +12,7 @@ var _utils = require("./components/utils");
|
|
|
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/user-picker";
|
|
15
|
-
var packageVersion = "10.20.
|
|
15
|
+
var packageVersion = "10.20.4";
|
|
16
16
|
var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
17
17
|
var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
18
18
|
var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -24,7 +24,6 @@ var _batch = require("./batch");
|
|
|
24
24
|
var _i18n = require("./i18n");
|
|
25
25
|
var _utils = require("./utils");
|
|
26
26
|
var _ufoExperiences = require("../util/ufoExperiences");
|
|
27
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
28
27
|
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; }
|
|
29
28
|
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; }
|
|
30
29
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
@@ -35,13 +34,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
35
34
|
var loadingMessage = function loadingMessage() {
|
|
36
35
|
return null;
|
|
37
36
|
};
|
|
38
|
-
var observerOptions = {
|
|
39
|
-
subtree: true,
|
|
40
|
-
attributes: true,
|
|
41
|
-
attributeFilter: ['class']
|
|
42
|
-
};
|
|
43
37
|
var classNamePrefix = 'fabric-user-picker';
|
|
44
|
-
var optionFocusedClass = "".concat(classNamePrefix, "__option--is-focused");
|
|
45
38
|
var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
46
39
|
(0, _inherits2.default)(BaseUserPickerWithoutAnalytics, _React$Component);
|
|
47
40
|
var _super = _createSuper(BaseUserPickerWithoutAnalytics);
|
|
@@ -306,31 +299,6 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
306
299
|
_this.journeyId = _this.getSessionId();
|
|
307
300
|
_this.fireEvent(_analytics.focusEvent);
|
|
308
301
|
});
|
|
309
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "focusedOptionObserverCallback", function (mutationList) {
|
|
310
|
-
var _iterator2 = _createForOfIteratorHelper(mutationList),
|
|
311
|
-
_step2;
|
|
312
|
-
try {
|
|
313
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
314
|
-
var mutation = _step2.value;
|
|
315
|
-
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
316
|
-
var target = mutation.target;
|
|
317
|
-
if (target.classList.contains(optionFocusedClass)) {
|
|
318
|
-
var _this$selectRef$selec;
|
|
319
|
-
(_this$selectRef$selec = _this.selectRef.select.inputRef) === null || _this$selectRef$selec === void 0 || _this$selectRef$selec.setAttribute('aria-activedescendant', target.id);
|
|
320
|
-
break;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
} catch (err) {
|
|
325
|
-
_iterator2.e(err);
|
|
326
|
-
} finally {
|
|
327
|
-
_iterator2.f();
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
// Create a MutationObserver which will observe the menu list for changes. In
|
|
331
|
-
// node environments such as SSR, MutationObserver doesn't exist and this
|
|
332
|
-
// variable will be falsy.
|
|
333
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "focusedOptionObserver", typeof MutationObserver === 'function' && new MutationObserver(_this.focusedOptionObserverCallback));
|
|
334
302
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeyDown", function (event) {
|
|
335
303
|
if (!_this.isMenuOpenOnClickForSingleSelect) {
|
|
336
304
|
// Escape
|
|
@@ -463,33 +431,6 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
463
431
|
if (menuIsOpen && !prevState.menuIsOpen && !this.session) {
|
|
464
432
|
this.startSession();
|
|
465
433
|
}
|
|
466
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.select-aria-activedescendant_psxzq')) {
|
|
467
|
-
var _this$selectRef, _this$selectRef2, _this$selectRef3;
|
|
468
|
-
// When the menu is opened, set aria-activedescendant attribute on the
|
|
469
|
-
// input and instrument a mutation observer. On the first opening of the
|
|
470
|
-
// menu, menuIsOpen is true but the menu isn't actually in the DOM yet.
|
|
471
|
-
// For this reason, we the use the existence of the attribute.
|
|
472
|
-
var inputHasAriaActiveDecendant = (_this$selectRef = this.selectRef) === null || _this$selectRef === void 0 || (_this$selectRef = _this$selectRef.select) === null || _this$selectRef === void 0 || (_this$selectRef = _this$selectRef.inputRef) === null || _this$selectRef === void 0 ? void 0 : _this$selectRef.getAttribute('aria-activedescendant');
|
|
473
|
-
var inputRef = (_this$selectRef2 = this.selectRef) === null || _this$selectRef2 === void 0 || (_this$selectRef2 = _this$selectRef2.select) === null || _this$selectRef2 === void 0 ? void 0 : _this$selectRef2.inputRef;
|
|
474
|
-
var menuRef = (_this$selectRef3 = this.selectRef) === null || _this$selectRef3 === void 0 || (_this$selectRef3 = _this$selectRef3.select) === null || _this$selectRef3 === void 0 ? void 0 : _this$selectRef3.menuListRef;
|
|
475
|
-
if (menuIsOpen && menuRef && !inputHasAriaActiveDecendant) {
|
|
476
|
-
var _menuRef$children$;
|
|
477
|
-
// Set the aria-activedescendant attribute on the input element
|
|
478
|
-
// to the first menu item
|
|
479
|
-
((_menuRef$children$ = menuRef.children[0]) === null || _menuRef$children$ === void 0 ? void 0 : _menuRef$children$.classList.contains(optionFocusedClass)) && inputRef && inputRef.setAttribute('aria-activedescendant', menuRef.children[0].id);
|
|
480
|
-
|
|
481
|
-
// Setup MutationObserver so when the selected option changes, update
|
|
482
|
-
// the aria-activedescendant attribute on the input element
|
|
483
|
-
this.focusedOptionObserver && this.focusedOptionObserver.observe(menuRef, observerOptions);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
// Rewmoe the aria-active-descendant attribute and disconnect the observer
|
|
487
|
-
// when the menu is closed
|
|
488
|
-
if (!menuIsOpen && prevState.menuIsOpen) {
|
|
489
|
-
inputRef && inputRef.removeAttribute('aria-activedescendant');
|
|
490
|
-
this.focusedOptionObserver && this.focusedOptionObserver.disconnect();
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
434
|
|
|
494
435
|
// Load options when user picker opens or when input value changes
|
|
495
436
|
if (menuIsOpen && !prevState.menuIsOpen || inputValue !== prevState.inputValue) {
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
3
|
import { isCustom, isExternalUser } from './components/utils';
|
|
4
4
|
const packageName = "@atlaskit/user-picker";
|
|
5
|
-
const packageVersion = "10.20.
|
|
5
|
+
const packageVersion = "10.20.4";
|
|
6
6
|
const UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
7
7
|
const UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
8
8
|
const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -11,15 +11,8 @@ import { batchByKey } from './batch';
|
|
|
11
11
|
import { messages } from './i18n';
|
|
12
12
|
import { callCallback, extractOptionValue, getOptions, isIterable, isPopupUserPickerByComponent, isDefaultValuePopulated, isSingleValue, optionToSelectableOptions } from './utils';
|
|
13
13
|
import { userPickerOptionsShownUfoExperience } from '../util/ufoExperiences';
|
|
14
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
const loadingMessage = () => null;
|
|
16
|
-
const observerOptions = {
|
|
17
|
-
subtree: true,
|
|
18
|
-
attributes: true,
|
|
19
|
-
attributeFilter: ['class']
|
|
20
|
-
};
|
|
21
15
|
const classNamePrefix = 'fabric-user-picker';
|
|
22
|
-
const optionFocusedClass = `${classNamePrefix}__option--is-focused`;
|
|
23
16
|
export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
24
17
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
25
18
|
const derivedState = {};
|
|
@@ -295,22 +288,6 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
295
288
|
this.journeyId = this.getSessionId();
|
|
296
289
|
this.fireEvent(focusEvent);
|
|
297
290
|
});
|
|
298
|
-
_defineProperty(this, "focusedOptionObserverCallback", mutationList => {
|
|
299
|
-
for (const mutation of mutationList) {
|
|
300
|
-
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
301
|
-
const target = mutation.target;
|
|
302
|
-
if (target.classList.contains(optionFocusedClass)) {
|
|
303
|
-
var _this$selectRef$selec;
|
|
304
|
-
(_this$selectRef$selec = this.selectRef.select.inputRef) === null || _this$selectRef$selec === void 0 ? void 0 : _this$selectRef$selec.setAttribute('aria-activedescendant', target.id);
|
|
305
|
-
break;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
// Create a MutationObserver which will observe the menu list for changes. In
|
|
311
|
-
// node environments such as SSR, MutationObserver doesn't exist and this
|
|
312
|
-
// variable will be falsy.
|
|
313
|
-
_defineProperty(this, "focusedOptionObserver", typeof MutationObserver === 'function' && new MutationObserver(this.focusedOptionObserverCallback));
|
|
314
291
|
_defineProperty(this, "handleKeyDown", event => {
|
|
315
292
|
if (!this.isMenuOpenOnClickForSingleSelect) {
|
|
316
293
|
// Escape
|
|
@@ -433,33 +410,6 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
433
410
|
if (menuIsOpen && !prevState.menuIsOpen && !this.session) {
|
|
434
411
|
this.startSession();
|
|
435
412
|
}
|
|
436
|
-
if (getBooleanFF('platform.design-system-team.select-aria-activedescendant_psxzq')) {
|
|
437
|
-
var _this$selectRef, _this$selectRef$selec2, _this$selectRef$selec3, _this$selectRef2, _this$selectRef2$sele, _this$selectRef3, _this$selectRef3$sele;
|
|
438
|
-
// When the menu is opened, set aria-activedescendant attribute on the
|
|
439
|
-
// input and instrument a mutation observer. On the first opening of the
|
|
440
|
-
// menu, menuIsOpen is true but the menu isn't actually in the DOM yet.
|
|
441
|
-
// For this reason, we the use the existence of the attribute.
|
|
442
|
-
const inputHasAriaActiveDecendant = (_this$selectRef = this.selectRef) === null || _this$selectRef === void 0 ? void 0 : (_this$selectRef$selec2 = _this$selectRef.select) === null || _this$selectRef$selec2 === void 0 ? void 0 : (_this$selectRef$selec3 = _this$selectRef$selec2.inputRef) === null || _this$selectRef$selec3 === void 0 ? void 0 : _this$selectRef$selec3.getAttribute('aria-activedescendant');
|
|
443
|
-
const inputRef = (_this$selectRef2 = this.selectRef) === null || _this$selectRef2 === void 0 ? void 0 : (_this$selectRef2$sele = _this$selectRef2.select) === null || _this$selectRef2$sele === void 0 ? void 0 : _this$selectRef2$sele.inputRef;
|
|
444
|
-
const menuRef = (_this$selectRef3 = this.selectRef) === null || _this$selectRef3 === void 0 ? void 0 : (_this$selectRef3$sele = _this$selectRef3.select) === null || _this$selectRef3$sele === void 0 ? void 0 : _this$selectRef3$sele.menuListRef;
|
|
445
|
-
if (menuIsOpen && menuRef && !inputHasAriaActiveDecendant) {
|
|
446
|
-
var _menuRef$children$;
|
|
447
|
-
// Set the aria-activedescendant attribute on the input element
|
|
448
|
-
// to the first menu item
|
|
449
|
-
((_menuRef$children$ = menuRef.children[0]) === null || _menuRef$children$ === void 0 ? void 0 : _menuRef$children$.classList.contains(optionFocusedClass)) && inputRef && inputRef.setAttribute('aria-activedescendant', menuRef.children[0].id);
|
|
450
|
-
|
|
451
|
-
// Setup MutationObserver so when the selected option changes, update
|
|
452
|
-
// the aria-activedescendant attribute on the input element
|
|
453
|
-
this.focusedOptionObserver && this.focusedOptionObserver.observe(menuRef, observerOptions);
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
// Rewmoe the aria-active-descendant attribute and disconnect the observer
|
|
457
|
-
// when the menu is closed
|
|
458
|
-
if (!menuIsOpen && prevState.menuIsOpen) {
|
|
459
|
-
inputRef && inputRef.removeAttribute('aria-activedescendant');
|
|
460
|
-
this.focusedOptionObserver && this.focusedOptionObserver.disconnect();
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
413
|
|
|
464
414
|
// Load options when user picker opens or when input value changes
|
|
465
415
|
if (menuIsOpen && !prevState.menuIsOpen || inputValue !== prevState.inputValue) {
|
package/dist/esm/analytics.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
|
5
5
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
6
|
import { isCustom, isExternalUser } from './components/utils';
|
|
7
7
|
var packageName = "@atlaskit/user-picker";
|
|
8
|
-
var packageVersion = "10.20.
|
|
8
|
+
var packageVersion = "10.20.4";
|
|
9
9
|
var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
10
10
|
var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
11
11
|
var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -24,17 +24,10 @@ import { batchByKey } from './batch';
|
|
|
24
24
|
import { messages } from './i18n';
|
|
25
25
|
import { callCallback, extractOptionValue, getOptions, isIterable, isPopupUserPickerByComponent, isDefaultValuePopulated, isSingleValue, optionToSelectableOptions } from './utils';
|
|
26
26
|
import { userPickerOptionsShownUfoExperience } from '../util/ufoExperiences';
|
|
27
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
28
27
|
var loadingMessage = function loadingMessage() {
|
|
29
28
|
return null;
|
|
30
29
|
};
|
|
31
|
-
var observerOptions = {
|
|
32
|
-
subtree: true,
|
|
33
|
-
attributes: true,
|
|
34
|
-
attributeFilter: ['class']
|
|
35
|
-
};
|
|
36
30
|
var classNamePrefix = 'fabric-user-picker';
|
|
37
|
-
var optionFocusedClass = "".concat(classNamePrefix, "__option--is-focused");
|
|
38
31
|
export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
39
32
|
_inherits(BaseUserPickerWithoutAnalytics, _React$Component);
|
|
40
33
|
var _super = _createSuper(BaseUserPickerWithoutAnalytics);
|
|
@@ -299,31 +292,6 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
299
292
|
_this.journeyId = _this.getSessionId();
|
|
300
293
|
_this.fireEvent(focusEvent);
|
|
301
294
|
});
|
|
302
|
-
_defineProperty(_assertThisInitialized(_this), "focusedOptionObserverCallback", function (mutationList) {
|
|
303
|
-
var _iterator2 = _createForOfIteratorHelper(mutationList),
|
|
304
|
-
_step2;
|
|
305
|
-
try {
|
|
306
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
307
|
-
var mutation = _step2.value;
|
|
308
|
-
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
309
|
-
var target = mutation.target;
|
|
310
|
-
if (target.classList.contains(optionFocusedClass)) {
|
|
311
|
-
var _this$selectRef$selec;
|
|
312
|
-
(_this$selectRef$selec = _this.selectRef.select.inputRef) === null || _this$selectRef$selec === void 0 || _this$selectRef$selec.setAttribute('aria-activedescendant', target.id);
|
|
313
|
-
break;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
} catch (err) {
|
|
318
|
-
_iterator2.e(err);
|
|
319
|
-
} finally {
|
|
320
|
-
_iterator2.f();
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
// Create a MutationObserver which will observe the menu list for changes. In
|
|
324
|
-
// node environments such as SSR, MutationObserver doesn't exist and this
|
|
325
|
-
// variable will be falsy.
|
|
326
|
-
_defineProperty(_assertThisInitialized(_this), "focusedOptionObserver", typeof MutationObserver === 'function' && new MutationObserver(_this.focusedOptionObserverCallback));
|
|
327
295
|
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
|
|
328
296
|
if (!_this.isMenuOpenOnClickForSingleSelect) {
|
|
329
297
|
// Escape
|
|
@@ -456,33 +424,6 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
456
424
|
if (menuIsOpen && !prevState.menuIsOpen && !this.session) {
|
|
457
425
|
this.startSession();
|
|
458
426
|
}
|
|
459
|
-
if (getBooleanFF('platform.design-system-team.select-aria-activedescendant_psxzq')) {
|
|
460
|
-
var _this$selectRef, _this$selectRef2, _this$selectRef3;
|
|
461
|
-
// When the menu is opened, set aria-activedescendant attribute on the
|
|
462
|
-
// input and instrument a mutation observer. On the first opening of the
|
|
463
|
-
// menu, menuIsOpen is true but the menu isn't actually in the DOM yet.
|
|
464
|
-
// For this reason, we the use the existence of the attribute.
|
|
465
|
-
var inputHasAriaActiveDecendant = (_this$selectRef = this.selectRef) === null || _this$selectRef === void 0 || (_this$selectRef = _this$selectRef.select) === null || _this$selectRef === void 0 || (_this$selectRef = _this$selectRef.inputRef) === null || _this$selectRef === void 0 ? void 0 : _this$selectRef.getAttribute('aria-activedescendant');
|
|
466
|
-
var inputRef = (_this$selectRef2 = this.selectRef) === null || _this$selectRef2 === void 0 || (_this$selectRef2 = _this$selectRef2.select) === null || _this$selectRef2 === void 0 ? void 0 : _this$selectRef2.inputRef;
|
|
467
|
-
var menuRef = (_this$selectRef3 = this.selectRef) === null || _this$selectRef3 === void 0 || (_this$selectRef3 = _this$selectRef3.select) === null || _this$selectRef3 === void 0 ? void 0 : _this$selectRef3.menuListRef;
|
|
468
|
-
if (menuIsOpen && menuRef && !inputHasAriaActiveDecendant) {
|
|
469
|
-
var _menuRef$children$;
|
|
470
|
-
// Set the aria-activedescendant attribute on the input element
|
|
471
|
-
// to the first menu item
|
|
472
|
-
((_menuRef$children$ = menuRef.children[0]) === null || _menuRef$children$ === void 0 ? void 0 : _menuRef$children$.classList.contains(optionFocusedClass)) && inputRef && inputRef.setAttribute('aria-activedescendant', menuRef.children[0].id);
|
|
473
|
-
|
|
474
|
-
// Setup MutationObserver so when the selected option changes, update
|
|
475
|
-
// the aria-activedescendant attribute on the input element
|
|
476
|
-
this.focusedOptionObserver && this.focusedOptionObserver.observe(menuRef, observerOptions);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
// Rewmoe the aria-active-descendant attribute and disconnect the observer
|
|
480
|
-
// when the menu is closed
|
|
481
|
-
if (!menuIsOpen && prevState.menuIsOpen) {
|
|
482
|
-
inputRef && inputRef.removeAttribute('aria-activedescendant');
|
|
483
|
-
this.focusedOptionObserver && this.focusedOptionObserver.disconnect();
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
427
|
|
|
487
428
|
// Load options when user picker opens or when input value changes
|
|
488
429
|
if (menuIsOpen && !prevState.menuIsOpen || inputValue !== prevState.inputValue) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
|
-
import { UserPickerProps, UserPickerState } from './types';
|
|
1
|
+
import { type AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
|
+
import { type UserPickerProps, type UserPickerState } from './types';
|
|
3
3
|
export type UserPickerSession = {
|
|
4
4
|
id: string;
|
|
5
5
|
start: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { LoadUserSource, UserSource } from '../types';
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type LoadUserSource, type UserSource } from '../types';
|
|
3
3
|
export interface UserSourceContext {
|
|
4
4
|
fetchUserSource?: LoadUserSource;
|
|
5
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { LozengeProps } from '../types';
|
|
4
|
+
import { type LozengeProps } from '../types';
|
|
5
5
|
export declare const textWrapper: (color?: string) => import("@emotion/react").SerializedStyles;
|
|
6
6
|
export type AvatarItemOptionProps = {
|
|
7
7
|
avatar: ReactNode;
|
|
@@ -55,8 +55,6 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
|
|
|
55
55
|
private fireEvent;
|
|
56
56
|
private startSession;
|
|
57
57
|
componentDidMount(): void;
|
|
58
|
-
private focusedOptionObserverCallback;
|
|
59
|
-
private focusedOptionObserver;
|
|
60
58
|
componentDidUpdate(_: UserPickerProps, prevState: UserPickerState): void;
|
|
61
59
|
private handleKeyDown;
|
|
62
60
|
handleClearIndicatorHover: (hoveringClearIndicator: boolean) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ClearIndicatorProps } from '@atlaskit/select';
|
|
2
|
+
import { type ClearIndicatorProps } from '@atlaskit/select';
|
|
3
3
|
export declare class ClearIndicator extends React.PureComponent<ClearIndicatorProps<any>> {
|
|
4
4
|
private handleMouseDown;
|
|
5
5
|
render(): JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { Email } from '../../types';
|
|
5
|
-
import { EmailValidationResponse } from '../emailValidation';
|
|
4
|
+
import { type Email } from '../../types';
|
|
5
|
+
import { type EmailValidationResponse } from '../emailValidation';
|
|
6
6
|
export type EmailOptionProps = {
|
|
7
7
|
email: Email;
|
|
8
8
|
isSelected: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ExternalUserSourcesData } from '../ExternalUserSourcesContainer';
|
|
2
|
+
import { type ExternalUserSourcesData } from '../ExternalUserSourcesContainer';
|
|
3
3
|
export declare const sourceWrapper: import("@emotion/react").SerializedStyles;
|
|
4
4
|
export declare const SourcesTooltipContent: React.FC<ExternalUserSourcesData>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
-
import { ExternalUser } from '../../types';
|
|
3
|
+
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
+
import { type ExternalUser } from '../../types';
|
|
5
5
|
export declare const imageContainer: import("@emotion/react").SerializedStyles;
|
|
6
6
|
export declare const emailDomainWrapper: import("@emotion/react").SerializedStyles;
|
|
7
7
|
export type ExternalUserOptionProps = WithAnalyticsEventsProps & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { Group } from '../../types';
|
|
4
|
+
import { type Group } from '../../types';
|
|
5
5
|
export declare const groupOptionIconWrapper: import("@emotion/react").SerializedStyles;
|
|
6
6
|
export type GroupOptionProps = {
|
|
7
7
|
group: Group;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type AriaAttributes } from 'react';
|
|
2
2
|
import { type OptionType, type SelectProps } from '@atlaskit/select';
|
|
3
|
-
import { AriaAttributesType } from '../types';
|
|
3
|
+
import { type AriaAttributesType } from '../types';
|
|
4
4
|
export type Props = {
|
|
5
5
|
selectProps?: SelectProps<OptionType, boolean>;
|
|
6
6
|
innerRef: (ref: React.Ref<HTMLInputElement>) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { OptionType } from '@atlaskit/select';
|
|
3
|
+
import { type OptionType } from '@atlaskit/select';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
|
-
import { Option, UserPickerProps } from '../types';
|
|
6
|
-
import { MultiValueProps } from '@atlaskit/select';
|
|
5
|
+
import { type Option, type UserPickerProps } from '../types';
|
|
6
|
+
import { type MultiValueProps } from '@atlaskit/select';
|
|
7
7
|
export declare const scrollToValue: (valueContainer: HTMLDivElement, control: HTMLElement) => void;
|
|
8
8
|
type Props = MultiValueProps<OptionType> & {
|
|
9
9
|
isFocused?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MultiValueProps } from '@atlaskit/select';
|
|
1
|
+
import { type MultiValueProps } from '@atlaskit/select';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Option, User } from '../types';
|
|
3
|
+
import { type Option, type User } from '../types';
|
|
4
4
|
export type State = {
|
|
5
5
|
valueSize: number;
|
|
6
6
|
previousValueSize: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OptionProps as AkOptionProps } from '@atlaskit/select';
|
|
2
|
-
import { FC } from 'react';
|
|
3
|
-
import { Option as OptionType } from '../types';
|
|
1
|
+
import { type OptionProps as AkOptionProps } from '@atlaskit/select';
|
|
2
|
+
import { type FC } from 'react';
|
|
3
|
+
import { type Option as OptionType } from '../types';
|
|
4
4
|
export type OptionProps = AkOptionProps & {
|
|
5
5
|
data: OptionType;
|
|
6
6
|
isSelected: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ControlProps } from '@atlaskit/select';
|
|
3
|
+
import { type ControlProps } from '@atlaskit/select';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
export declare class PopupControl extends React.PureComponent<ControlProps<any>> {
|
|
6
6
|
render(): jsx.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
|
-
import { Option } from '../types';
|
|
3
|
-
import { SingleValueProps } from '@atlaskit/select';
|
|
2
|
+
import { type Option } from '../types';
|
|
3
|
+
import { type SingleValueProps } from '@atlaskit/select';
|
|
4
4
|
export type Props = SingleValueProps<Option>;
|
|
5
5
|
export declare const SingleValue: (props: Props) => jsx.JSX.Element | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ValueContainerProps } from '@atlaskit/select';
|
|
2
|
+
import { type ValueContainerProps } from '@atlaskit/select';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { Option, User } from '../types';
|
|
5
|
+
import { type Option, type User } from '../types';
|
|
6
6
|
export declare class SingleValueContainer extends React.Component<ValueContainerProps<Option<User>>> {
|
|
7
7
|
private renderAvatar;
|
|
8
8
|
onValueContainerClick: any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { UserPickerProps } from '../types';
|
|
2
|
+
import { type UserPickerProps } from '../types';
|
|
3
3
|
export declare class UserPickerWithoutAnalytics extends React.Component<UserPickerProps> {
|
|
4
4
|
ufoId: string;
|
|
5
5
|
constructor(props: UserPickerProps);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Option } from '../types';
|
|
2
|
-
import { EmailValidator } from './emailValidation';
|
|
1
|
+
import { type Option } from '../types';
|
|
2
|
+
import { type EmailValidator } from './emailValidation';
|
|
3
3
|
declare function creatableProps(isValidEmail?: EmailValidator): {
|
|
4
4
|
allowCreateWhileLoading: boolean;
|
|
5
5
|
createOptionPosition: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Option } from '../types';
|
|
2
|
-
import { EmailValidator } from './emailValidation';
|
|
1
|
+
import { type Option } from '../types';
|
|
2
|
+
import { type EmailValidator } from './emailValidation';
|
|
3
3
|
export declare const getCreatableSuggestedEmailProps: import("memoize-one").MemoizedFn<(emailDomain: string, isValidEmail?: EmailValidator) => {
|
|
4
4
|
allowCreateWhileLoading: boolean;
|
|
5
5
|
createOptionPosition: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Placement } from '@atlaskit/popper';
|
|
2
|
-
import { Target, BoundariesElement, RootBoundary } from '../types';
|
|
1
|
+
import { type Placement } from '@atlaskit/popper';
|
|
2
|
+
import { type Target, type BoundariesElement, type RootBoundary } from '../types';
|
|
3
3
|
export declare const getPopupProps: import("memoize-one").MemoizedFn<(width: string | number, target: Target, onFlip: (data: any) => any, boundariesElement?: BoundariesElement, offset?: number[], placement?: Placement, rootBoundary?: RootBoundary, shouldFlip?: boolean, popupTitle?: string) => {
|
|
4
4
|
searchThreshold: number;
|
|
5
5
|
controlShouldRenderValue: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactChild, ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { AtlaskitSelectValue, ExternalUser, Custom, Email, Option, OptionData, Promisable, Team, Group, User, OptionIdentifier, DefaultValue, LozengeProps } from '../types';
|
|
1
|
+
import { type ReactChild, type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { type AtlaskitSelectValue, type ExternalUser, type Custom, type Email, type Option, type OptionData, type Promisable, type Team, type Group, type User, type OptionIdentifier, type DefaultValue, type LozengeProps } from '../types';
|
|
3
3
|
export declare const isExternalUser: (option: OptionData) => option is ExternalUser;
|
|
4
4
|
export declare const isUser: (option: OptionData) => option is User;
|
|
5
5
|
export declare const isTeam: (option: OptionData) => option is Team;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import { type AriaAttributes } from 'react';
|
|
4
|
+
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
|
+
import { type Placement } from '@atlaskit/popper';
|
|
6
|
+
import { type EmailValidator } from './components/emailValidation';
|
|
7
|
+
import { type StylesConfig } from '@atlaskit/select';
|
|
8
|
+
import { type BaseUserPickerWithoutAnalytics } from './components/BaseUserPicker';
|
|
7
9
|
export type UserPickerProps = WithAnalyticsEventsProps & {
|
|
8
10
|
/**
|
|
9
11
|
* Used to configure additional information regarding where the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
|
-
import { UserPickerProps, UserPickerState } from './types';
|
|
1
|
+
import { type AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
|
+
import { type UserPickerProps, type UserPickerState } from './types';
|
|
3
3
|
export type UserPickerSession = {
|
|
4
4
|
id: string;
|
|
5
5
|
start: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { LoadUserSource, UserSource } from '../types';
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type LoadUserSource, type UserSource } from '../types';
|
|
3
3
|
export interface UserSourceContext {
|
|
4
4
|
fetchUserSource?: LoadUserSource;
|
|
5
5
|
}
|