@atlaskit/smart-user-picker 11.5.0 → 11.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/UfoErrorBoundary.js +34 -0
  3. package/dist/cjs/analytics.js +3 -3
  4. package/dist/cjs/components/SmartUserPicker.js +9 -9
  5. package/dist/cjs/components/index.js +6 -4
  6. package/dist/cjs/service/users-client.js +1 -1
  7. package/dist/cjs/service/users-transformer.js +2 -2
  8. package/dist/cjs/ufoExperiences.js +10 -62
  9. package/dist/cjs/useUFOConcurrentExperience.js +32 -0
  10. package/dist/es2019/UfoErrorBoundary.js +10 -0
  11. package/dist/es2019/analytics.js +2 -2
  12. package/dist/es2019/components/SmartUserPicker.js +3 -3
  13. package/dist/es2019/components/index.js +4 -2
  14. package/dist/es2019/index.js +1 -0
  15. package/dist/es2019/option.js +1 -0
  16. package/dist/es2019/service/users-client.js +1 -1
  17. package/dist/es2019/service/users-transformer.js +1 -1
  18. package/dist/es2019/ufoExperiences.js +3 -36
  19. package/dist/es2019/useUFOConcurrentExperience.js +26 -0
  20. package/dist/es2019/userPicker.js +1 -0
  21. package/dist/esm/UfoErrorBoundary.js +27 -0
  22. package/dist/esm/analytics.js +2 -2
  23. package/dist/esm/components/SmartUserPicker.js +3 -3
  24. package/dist/esm/components/index.js +4 -2
  25. package/dist/esm/index.js +1 -0
  26. package/dist/esm/option.js +1 -0
  27. package/dist/esm/service/users-client.js +1 -1
  28. package/dist/esm/service/users-transformer.js +1 -1
  29. package/dist/esm/ufoExperiences.js +3 -53
  30. package/dist/esm/useUFOConcurrentExperience.js +26 -0
  31. package/dist/esm/userPicker.js +1 -0
  32. package/dist/types/UfoErrorBoundary.d.ts +7 -0
  33. package/dist/types/analytics.d.ts +3 -1
  34. package/dist/types/components/SmartUserPicker.d.ts +1 -1
  35. package/dist/types/service/graphqlUtils.d.ts +1 -1
  36. package/dist/types/service/users-client.d.ts +1 -1
  37. package/dist/types/types.d.ts +1 -1
  38. package/dist/types/ufoExperiences.d.ts +1 -9
  39. package/dist/types/useUFOConcurrentExperience.d.ts +2 -0
  40. package/package.json +12 -8
  41. package/report.api.md +0 -301
  42. package/smart-user-picker.docs.tsx +0 -41
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlassian/smart-user-picker
2
2
 
3
+ ## 11.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`bd2c5b0112185`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bd2c5b0112185) -
8
+ Remove stale API report artifacts from published Platform packages.
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 11.5.1
15
+
16
+ ### Patch Changes
17
+
18
+ - [`6d704062ca749`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6d704062ca749) -
19
+ Internal refactor to support tree shaking. No consumer changes.
20
+
3
21
  ## 11.5.0
4
22
 
5
23
  ### Minor Changes
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.UfoErrorBoundary = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
11
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
+ var _react = _interopRequireDefault(require("react"));
14
+ var _ufoExperiences = require("./ufoExperiences");
15
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
16
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
17
+ var UfoErrorBoundary = exports.UfoErrorBoundary = /*#__PURE__*/function (_React$Component) {
18
+ function UfoErrorBoundary() {
19
+ (0, _classCallCheck2.default)(this, UfoErrorBoundary);
20
+ return _callSuper(this, UfoErrorBoundary, arguments);
21
+ }
22
+ (0, _inherits2.default)(UfoErrorBoundary, _React$Component);
23
+ return (0, _createClass2.default)(UfoErrorBoundary, [{
24
+ key: "componentDidCatch",
25
+ value: function componentDidCatch() {
26
+ _ufoExperiences.smartUserPickerRenderedUfoExperience.getInstance(this.props.id).failure();
27
+ }
28
+ }, {
29
+ key: "render",
30
+ value: function render() {
31
+ return this.props.children;
32
+ }
33
+ }]);
34
+ }(_react.default.Component);
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.successfulRequestUsersEvent = exports.startSession = exports.requestUsersEvent = exports.preparedUsersLoadedEvent = exports.mountedWithPrefetchEvent = exports.filterUsersEvent = exports.failedUserResolversEvent = exports.failedRequestUsersEvent = exports.createAndFireEventInElementsChannel = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _analyticsNext = require("@atlaskit/analytics-next");
9
+ var _createAndFireEvents = _interopRequireDefault(require("@atlaskit/analytics-next/createAndFireEvents"));
10
10
  var _uuid = require("uuid");
11
11
  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; }
12
12
  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; } // eslint-disable-next-line @typescript-eslint/consistent-type-imports
13
13
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
14
14
  var packageName = "@atlaskit/smart-user-picker";
15
- var packageVersion = "11.4.0";
15
+ var packageVersion = "11.5.1";
16
16
  var startSession = exports.startSession = function startSession() {
17
17
  return {
18
18
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
@@ -24,7 +24,7 @@ var startSession = exports.startSession = function startSession() {
24
24
  lastKey: undefined
25
25
  };
26
26
  };
27
- var createAndFireEventInElementsChannel = exports.createAndFireEventInElementsChannel = (0, _analyticsNext.createAndFireEvent)('fabric-elements');
27
+ var createAndFireEventInElementsChannel = exports.createAndFireEventInElementsChannel = (0, _createAndFireEvents.default)('fabric-elements');
28
28
  var createEvent = function createEvent(eventType, action, actionSubject) {
29
29
  var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
30
30
  return {
@@ -21,12 +21,12 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
21
21
  var _react = _interopRequireDefault(require("react"));
22
22
  var _debounce = _interopRequireDefault(require("lodash/debounce"));
23
23
  var _uuid = require("uuid");
24
- var _analyticsNext = require("@atlaskit/analytics-next");
24
+ var _withAnalyticsEvents = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsEvents"));
25
25
  var _memoizeOne = _interopRequireDefault(require("memoize-one"));
26
26
  var _reactIntl = require("react-intl");
27
- var _ufo = require("@atlaskit/ufo");
27
+ var _experienceState = require("@atlaskit/ufo/experience-state");
28
28
  var _userPicker = _interopRequireWildcard(require("@atlaskit/user-picker"));
29
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
29
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
30
30
  var _analytics = require("../analytics");
31
31
  var _MessagesIntlProvider = _interopRequireDefault(require("./MessagesIntlProvider"));
32
32
  var _types = require("../types");
@@ -97,7 +97,7 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
97
97
  // query already belongs to a returned user, in which case the suggestion is redundant
98
98
  (0, _defineProperty2.default)(_this, "lastDomainSuggestionMatchedUser", false);
99
99
  (0, _defineProperty2.default)(_this, "abortOptionsShownUfoExperience", function () {
100
- if (_this.optionsShownUfoExperienceInstance.state.id === _ufo.UFOExperienceState.STARTED.id) {
100
+ if (_this.optionsShownUfoExperienceInstance.state.id === _experienceState.UFOExperienceState.STARTED.id) {
101
101
  // There may be an existing UFO timing running from previous key entry or focus,
102
102
  // so abort it and restart it just in case.
103
103
  _this.optionsShownUfoExperienceInstance.abort();
@@ -171,7 +171,7 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
171
171
  _context.prev = 1;
172
172
  _query = _this.state.query;
173
173
  _this.fireEvent(_analytics.requestUsersEvent);
174
- if (!(fetchOptions && (0, _platformFeatureFlags.fg)('smart-user-picker-load-options-gate'))) {
174
+ if (!(fetchOptions && (0, _fg.fg)('smart-user-picker-load-options-gate'))) {
175
175
  _context.next = 3;
176
176
  break;
177
177
  }
@@ -348,7 +348,7 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
348
348
  case 15:
349
349
  _context.prev = 15;
350
350
  _t6 = _context["catch"](1);
351
- if (!(_this.state.query !== query && (0, _platformFeatureFlags.fg)('smart-user-picker-fetch-error-fix'))) {
351
+ if (!(_this.state.query !== query && (0, _fg.fg)('smart-user-picker-fetch-error-fix'))) {
352
352
  _context.next = 16;
353
353
  break;
354
354
  }
@@ -584,7 +584,7 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
584
584
  } else if (!this.state.closed && !this.state.loading) {
585
585
  // If the component has rendered (including its dropdown list) and it
586
586
  // is not loading anything further, send the success UFO event
587
- if (![_ufo.UFOExperienceState.FAILED.id, _ufo.UFOExperienceState.SUCCEEDED.id, _ufo.UFOExperienceState.ABORTED.id].includes(this.optionsShownUfoExperienceInstance.state.id)) {
587
+ if (![_experienceState.UFOExperienceState.FAILED.id, _experienceState.UFOExperienceState.SUCCEEDED.id, _experienceState.UFOExperienceState.ABORTED.id].includes(this.optionsShownUfoExperienceInstance.state.id)) {
588
588
  this.optionsShownUfoExperienceInstance.success(ufoEndStateConfig(this.props.fieldId));
589
589
  }
590
590
  }
@@ -605,7 +605,7 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
605
605
  // When suggestEmailsForDomain is active, partial (non-email) input must still reach the base
606
606
  // picker's domain-suggestion creatable logic, so the isEmailQuery restriction is relaxed for
607
607
  // those queries only. Full email queries that matched an existing user remain suppressed.
608
- var isDomainSuggestionEnabled = (0, _platformFeatureFlags.fg)('smart_user_picker_suggest_emails_for_domain') && !!suggestEmailsForDomain;
608
+ var isDomainSuggestionEnabled = (0, _fg.fg)('smart_user_picker_suggest_emails_for_domain') && !!suggestEmailsForDomain;
609
609
  if (allowEmail && enableEmailSearch && !allowEmailSelectionWhenEmailMatched) {
610
610
  var isCurrentQueryEmail = isEmailQuery(this.state.query);
611
611
  if (isDomainSuggestionEnabled) {
@@ -651,4 +651,4 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
651
651
  allowEmailSelectionWhenEmailMatched: true,
652
652
  verifiedTeams: false
653
653
  });
654
- var SmartUserPicker = exports.SmartUserPicker = (0, _analyticsNext.withAnalyticsEvents)()((0, _reactIntl.injectIntl)(SmartUserPickerWithoutAnalytics));
654
+ var SmartUserPicker = exports.SmartUserPicker = (0, _withAnalyticsEvents.default)()((0, _reactIntl.injectIntl)(SmartUserPickerWithoutAnalytics));
@@ -6,13 +6,15 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _SmartUserPicker = require("./SmartUserPicker");
10
- var _MessagesIntlProvider = _interopRequireDefault(require("./MessagesIntlProvider"));
9
+ var _UfoErrorBoundary = require("../UfoErrorBoundary");
11
10
  var _ufoExperiences = require("../ufoExperiences");
11
+ var _useUFOConcurrentExperience = require("../useUFOConcurrentExperience");
12
+ var _MessagesIntlProvider = _interopRequireDefault(require("./MessagesIntlProvider"));
13
+ var _SmartUserPicker = require("./SmartUserPicker");
12
14
  var SmartUserPickerWithIntlProvider = function SmartUserPickerWithIntlProvider(props) {
13
15
  var ufoId = props.inputId || props.fieldId;
14
- (0, _ufoExperiences.useUFOConcurrentExperience)(_ufoExperiences.smartUserPickerRenderedUfoExperience, ufoId);
15
- return /*#__PURE__*/_react.default.createElement(_ufoExperiences.UfoErrorBoundary, {
16
+ (0, _useUFOConcurrentExperience.useUFOConcurrentExperience)(_ufoExperiences.smartUserPickerRenderedUfoExperience, ufoId);
17
+ return /*#__PURE__*/_react.default.createElement(_UfoErrorBoundary.UfoErrorBoundary, {
16
18
  id: ufoId
17
19
  }, /*#__PURE__*/_react.default.createElement(_MessagesIntlProvider.default, null, /*#__PURE__*/_react.default.createElement(_SmartUserPicker.SmartUserPicker, props)));
18
20
  };
@@ -8,9 +8,9 @@ exports.default = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
+ var _config = require("../config");
11
12
  var _constants = require("./constants");
12
13
  var _graphqlUtils = require("./graphqlUtils");
13
- var _config = require("../config");
14
14
  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; }
15
15
  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; }
16
16
  /**
@@ -7,7 +7,7 @@ exports.transformUsers = void 0;
7
7
  var _userPicker = require("@atlaskit/user-picker");
8
8
  var _i18n = require("../i18n");
9
9
  var _types = require("../types");
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
11
11
  var getLozenzeProperties = function getLozenzeProperties(entity, intl) {
12
12
  var _entity$attributes, _entity$attributes2, _entity$attributes3;
13
13
  if ((_entity$attributes = entity.attributes) !== null && _entity$attributes !== void 0 && _entity$attributes.workspaceMember) {
@@ -21,7 +21,7 @@ var getLozenzeProperties = function getLozenzeProperties(entity, intl) {
21
21
  appearance: 'default'
22
22
  };
23
23
  }
24
- var isJiraGuestUser = (0, _platformFeatureFlags.fg)('user_picker_guest_lozenges') && ((_entity$attributes3 = entity.attributes) === null || _entity$attributes3 === void 0 ? void 0 : _entity$attributes3.isJiraGuest);
24
+ var isJiraGuestUser = (0, _fg.fg)('user_picker_guest_lozenges') && ((_entity$attributes3 = entity.attributes) === null || _entity$attributes3 === void 0 ? void 0 : _entity$attributes3.isJiraGuest);
25
25
  if (isJiraGuestUser) {
26
26
  return intl.formatMessage(_i18n.messages.guestLozengeText);
27
27
  }
@@ -1,75 +1,23 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports.useUFOConcurrentExperience = exports.smartUserPickerRenderedUfoExperience = exports.smartUserPickerOptionsShownUfoExperience = exports.UfoErrorBoundary = void 0;
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
- var _react = _interopRequireWildcard(require("react"));
15
- var _ufo = require("@atlaskit/ufo");
16
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
18
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
6
+ exports.smartUserPickerRenderedUfoExperience = exports.smartUserPickerOptionsShownUfoExperience = void 0;
7
+ var _experienceTypes = require("@atlaskit/ufo/experience-types");
8
+ var _concurrentExperience = require("@atlaskit/ufo/concurrent-experience");
19
9
  var COMPONENT_NAME = 'smart-user-picker';
20
- var smartUserPickerRenderedUfoExperience = exports.smartUserPickerRenderedUfoExperience = new _ufo.ConcurrentExperience('smart-user-picker-rendered', {
10
+ var smartUserPickerRenderedUfoExperience = exports.smartUserPickerRenderedUfoExperience = new _concurrentExperience.ConcurrentExperience('smart-user-picker-rendered', {
21
11
  platform: {
22
12
  component: COMPONENT_NAME
23
13
  },
24
- type: _ufo.ExperienceTypes.Load,
25
- performanceType: _ufo.ExperiencePerformanceTypes.PageSegmentLoad
14
+ type: _experienceTypes.ExperienceTypes.Load,
15
+ performanceType: _experienceTypes.ExperiencePerformanceTypes.PageSegmentLoad
26
16
  });
27
- var smartUserPickerOptionsShownUfoExperience = exports.smartUserPickerOptionsShownUfoExperience = new _ufo.ConcurrentExperience('smart-user-picker-options-shown', {
17
+ var smartUserPickerOptionsShownUfoExperience = exports.smartUserPickerOptionsShownUfoExperience = new _concurrentExperience.ConcurrentExperience('smart-user-picker-options-shown', {
28
18
  platform: {
29
19
  component: COMPONENT_NAME
30
20
  },
31
- type: _ufo.ExperienceTypes.Operation,
32
- performanceType: _ufo.ExperiencePerformanceTypes.InlineResult
33
- });
34
- var useUFOConcurrentExperience = exports.useUFOConcurrentExperience = function useUFOConcurrentExperience(experience, id) {
35
- var experienceForId = experience.getInstance(id);
36
-
37
- // Equivalent to componentWillMount - replace with @atlaskit/ufo's
38
- // useUFOComponentExperience when it supports ConcurrentExperience.
39
- (0, _react.useState)(function () {
40
- experienceForId.start();
41
- });
42
-
43
- // Replace with @atlaskit/ufo's <ExperienceSuccess> when it supports ConcurrentExperience
44
- (0, _react.useEffect)(function () {
45
- if (experienceForId.state !== _ufo.UFOExperienceState['FAILED']) {
46
- experienceForId.success();
47
- }
48
- return function () {
49
- if ([_ufo.UFOExperienceState['STARTED'], _ufo.UFOExperienceState['IN_PROGRESS']].includes(experienceForId.state)) {
50
- experienceForId.abort();
51
- }
52
- };
53
-
54
- // We only want this useEffect to run once after component mount, so no deps are needed.
55
- // eslint-disable-next-line react-hooks/exhaustive-deps
56
- }, []);
57
- };
58
- var UfoErrorBoundary = exports.UfoErrorBoundary = /*#__PURE__*/function (_React$Component) {
59
- function UfoErrorBoundary() {
60
- (0, _classCallCheck2.default)(this, UfoErrorBoundary);
61
- return _callSuper(this, UfoErrorBoundary, arguments);
62
- }
63
- (0, _inherits2.default)(UfoErrorBoundary, _React$Component);
64
- return (0, _createClass2.default)(UfoErrorBoundary, [{
65
- key: "componentDidCatch",
66
- value: function componentDidCatch() {
67
- smartUserPickerRenderedUfoExperience.getInstance(this.props.id).failure();
68
- }
69
- }, {
70
- key: "render",
71
- value: function render() {
72
- return this.props.children;
73
- }
74
- }]);
75
- }(_react.default.Component);
21
+ type: _experienceTypes.ExperienceTypes.Operation,
22
+ performanceType: _experienceTypes.ExperiencePerformanceTypes.InlineResult
23
+ });
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useUFOConcurrentExperience = void 0;
7
+ var _react = require("react");
8
+ var _experienceState = require("@atlaskit/ufo/experience-state");
9
+ var useUFOConcurrentExperience = exports.useUFOConcurrentExperience = function useUFOConcurrentExperience(experience, id) {
10
+ var experienceForId = experience.getInstance(id);
11
+
12
+ // Equivalent to pre-mount initialization - replace with @atlaskit/ufo's
13
+ // useUFOComponentExperience when it supports ConcurrentExperience.
14
+ (0, _react.useState)(function () {
15
+ experienceForId.start();
16
+ });
17
+
18
+ // Replace with @atlaskit/ufo's <ExperienceSuccess> when it supports ConcurrentExperience
19
+ (0, _react.useEffect)(function () {
20
+ if (experienceForId.state !== _experienceState.UFOExperienceState['FAILED']) {
21
+ experienceForId.success();
22
+ }
23
+ return function () {
24
+ if ([_experienceState.UFOExperienceState['STARTED'], _experienceState.UFOExperienceState['IN_PROGRESS']].includes(experienceForId.state)) {
25
+ experienceForId.abort();
26
+ }
27
+ };
28
+
29
+ // We only want this useEffect to run once after component mount, so no deps are needed.
30
+ // eslint-disable-next-line react-hooks/exhaustive-deps
31
+ }, []);
32
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { smartUserPickerRenderedUfoExperience } from './ufoExperiences';
3
+ export class UfoErrorBoundary extends React.Component {
4
+ componentDidCatch() {
5
+ smartUserPickerRenderedUfoExperience.getInstance(this.props.id).failure();
6
+ }
7
+ render() {
8
+ return this.props.children;
9
+ }
10
+ }
@@ -1,9 +1,9 @@
1
1
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports
2
- import { createAndFireEvent } from '@atlaskit/analytics-next';
2
+ import createAndFireEvent from '@atlaskit/analytics-next/createAndFireEvents';
3
3
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
4
4
  import { v4 as uuid } from 'uuid';
5
5
  const packageName = "@atlaskit/smart-user-picker";
6
- const packageVersion = "11.4.0";
6
+ const packageVersion = "11.5.1";
7
7
  export const startSession = () => ({
8
8
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
9
9
  id: uuid(),
@@ -4,12 +4,12 @@ import React from 'react';
4
4
  import debounce from 'lodash/debounce';
5
5
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
6
6
  import { v4 as uuidV4 } from 'uuid';
7
- import { withAnalyticsEvents } from '@atlaskit/analytics-next';
7
+ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
8
8
  import memoizeOne from 'memoize-one';
9
9
  import { injectIntl } from 'react-intl';
10
- import { UFOExperienceState } from '@atlaskit/ufo';
10
+ import { UFOExperienceState } from '@atlaskit/ufo/experience-state';
11
11
  import UserPicker, { isExternalUser, isTeam, isGroup, isUser, isValidEmail } from '@atlaskit/user-picker';
12
- import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
13
13
  import { requestUsersEvent, filterUsersEvent, preparedUsersLoadedEvent, successfulRequestUsersEvent, failedRequestUsersEvent, mountedWithPrefetchEvent, createAndFireEventInElementsChannel, failedUserResolversEvent } from '../analytics';
14
14
  import MessagesIntlProvider from './MessagesIntlProvider';
15
15
  import { UserEntityType } from '../types';
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
- import { SmartUserPicker } from './SmartUserPicker';
2
+ import { UfoErrorBoundary } from '../UfoErrorBoundary';
3
+ import { smartUserPickerRenderedUfoExperience } from '../ufoExperiences';
4
+ import { useUFOConcurrentExperience } from '../useUFOConcurrentExperience';
3
5
  import MessagesIntlProvider from './MessagesIntlProvider';
4
- import { useUFOConcurrentExperience, smartUserPickerRenderedUfoExperience, UfoErrorBoundary } from '../ufoExperiences';
6
+ import { SmartUserPicker } from './SmartUserPicker';
5
7
  const SmartUserPickerWithIntlProvider = props => {
6
8
  const ufoId = props.inputId || props.fieldId;
7
9
  useUFOConcurrentExperience(smartUserPickerRenderedUfoExperience, ufoId);
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required, @atlaskit/volt-strict-mode/no-re-exports, @atlaskit/editor/no-re-export -- VOLTC-139 tracks removal of these deprecated re-export shims. */
1
2
  export { default } from './components';
2
3
  export { getUserRecommendations, hydrateDefaultValues } from './service';
3
4
  export {
@@ -1 +1,2 @@
1
+ /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required, @atlaskit/volt-strict-mode/no-re-exports, @atlaskit/editor/no-re-export -- VOLTC-139 tracks removal of these deprecated re-export shims. */
1
2
  export { Option, CustomOption, EmailOption, GroupOption, UserOption, TeamOption } from '@atlaskit/user-picker/option';
@@ -1,6 +1,6 @@
1
+ import { config } from '../config';
1
2
  import { UNKNOWN_USER } from './constants';
2
3
  import { graphqlQuery } from './graphqlUtils';
3
- import { config } from '../config';
4
4
  /**
5
5
  * @param {string} accountIds ids to hydrate
6
6
  * @return GraphQL Query
@@ -1,7 +1,7 @@
1
1
  import { ExternalUserType, GroupType, TeamType, UserType } from '@atlaskit/user-picker';
2
2
  import { messages } from '../i18n';
3
3
  import { EntityType } from '../types';
4
- import { fg } from '@atlaskit/platform-feature-flags';
4
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
5
5
  const getLozenzeProperties = (entity, intl) => {
6
6
  var _entity$attributes, _entity$attributes2, _entity$attributes3;
7
7
  if ((_entity$attributes = entity.attributes) !== null && _entity$attributes !== void 0 && _entity$attributes.workspaceMember) {
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { ExperiencePerformanceTypes, ExperienceTypes, ConcurrentExperience, UFOExperienceState } from '@atlaskit/ufo';
3
- import { useEffect, useState } from 'react';
1
+ import { ExperiencePerformanceTypes, ExperienceTypes } from '@atlaskit/ufo/experience-types';
2
+ import { ConcurrentExperience } from '@atlaskit/ufo/concurrent-experience';
4
3
  const COMPONENT_NAME = 'smart-user-picker';
5
4
  export const smartUserPickerRenderedUfoExperience = new ConcurrentExperience('smart-user-picker-rendered', {
6
5
  platform: {
@@ -15,36 +14,4 @@ export const smartUserPickerOptionsShownUfoExperience = new ConcurrentExperience
15
14
  },
16
15
  type: ExperienceTypes.Operation,
17
16
  performanceType: ExperiencePerformanceTypes.InlineResult
18
- });
19
- export const useUFOConcurrentExperience = (experience, id) => {
20
- const experienceForId = experience.getInstance(id);
21
-
22
- // Equivalent to componentWillMount - replace with @atlaskit/ufo's
23
- // useUFOComponentExperience when it supports ConcurrentExperience.
24
- useState(() => {
25
- experienceForId.start();
26
- });
27
-
28
- // Replace with @atlaskit/ufo's <ExperienceSuccess> when it supports ConcurrentExperience
29
- useEffect(() => {
30
- if (experienceForId.state !== UFOExperienceState['FAILED']) {
31
- experienceForId.success();
32
- }
33
- return () => {
34
- if ([UFOExperienceState['STARTED'], UFOExperienceState['IN_PROGRESS']].includes(experienceForId.state)) {
35
- experienceForId.abort();
36
- }
37
- };
38
-
39
- // We only want this useEffect to run once after component mount, so no deps are needed.
40
- // eslint-disable-next-line react-hooks/exhaustive-deps
41
- }, []);
42
- };
43
- export class UfoErrorBoundary extends React.Component {
44
- componentDidCatch() {
45
- smartUserPickerRenderedUfoExperience.getInstance(this.props.id).failure();
46
- }
47
- render() {
48
- return this.props.children;
49
- }
50
- }
17
+ });
@@ -0,0 +1,26 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { UFOExperienceState } from '@atlaskit/ufo/experience-state';
3
+ export const useUFOConcurrentExperience = (experience, id) => {
4
+ const experienceForId = experience.getInstance(id);
5
+
6
+ // Equivalent to pre-mount initialization - replace with @atlaskit/ufo's
7
+ // useUFOComponentExperience when it supports ConcurrentExperience.
8
+ useState(() => {
9
+ experienceForId.start();
10
+ });
11
+
12
+ // Replace with @atlaskit/ufo's <ExperienceSuccess> when it supports ConcurrentExperience
13
+ useEffect(() => {
14
+ if (experienceForId.state !== UFOExperienceState['FAILED']) {
15
+ experienceForId.success();
16
+ }
17
+ return () => {
18
+ if ([UFOExperienceState['STARTED'], UFOExperienceState['IN_PROGRESS']].includes(experienceForId.state)) {
19
+ experienceForId.abort();
20
+ }
21
+ };
22
+
23
+ // We only want this useEffect to run once after component mount, so no deps are needed.
24
+ // eslint-disable-next-line react-hooks/exhaustive-deps
25
+ }, []);
26
+ };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required, @atlaskit/volt-strict-mode/no-re-exports, @atlaskit/editor/no-re-export -- VOLTC-139 tracks removal of these deprecated re-export shims. */
1
2
  export {
2
3
  //Utils
3
4
  isEmail, isTeam, isUser, isExternalUser, isValidEmail, isGroup,
@@ -0,0 +1,27 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
+ import React from 'react';
9
+ import { smartUserPickerRenderedUfoExperience } from './ufoExperiences';
10
+ export var UfoErrorBoundary = /*#__PURE__*/function (_React$Component) {
11
+ function UfoErrorBoundary() {
12
+ _classCallCheck(this, UfoErrorBoundary);
13
+ return _callSuper(this, UfoErrorBoundary, arguments);
14
+ }
15
+ _inherits(UfoErrorBoundary, _React$Component);
16
+ return _createClass(UfoErrorBoundary, [{
17
+ key: "componentDidCatch",
18
+ value: function componentDidCatch() {
19
+ smartUserPickerRenderedUfoExperience.getInstance(this.props.id).failure();
20
+ }
21
+ }, {
22
+ key: "render",
23
+ value: function render() {
24
+ return this.props.children;
25
+ }
26
+ }]);
27
+ }(React.Component);
@@ -2,11 +2,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  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; }
3
3
  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) { _defineProperty(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; }
4
4
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports
5
- import { createAndFireEvent } from '@atlaskit/analytics-next';
5
+ import createAndFireEvent from '@atlaskit/analytics-next/createAndFireEvents';
6
6
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
7
7
  import { v4 as uuid } from 'uuid';
8
8
  var packageName = "@atlaskit/smart-user-picker";
9
- var packageVersion = "11.4.0";
9
+ var packageVersion = "11.5.1";
10
10
  export var startSession = function startSession() {
11
11
  return {
12
12
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
@@ -22,12 +22,12 @@ import React from 'react';
22
22
  import debounce from 'lodash/debounce';
23
23
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
24
24
  import { v4 as uuidV4 } from 'uuid';
25
- import { withAnalyticsEvents } from '@atlaskit/analytics-next';
25
+ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
26
26
  import memoizeOne from 'memoize-one';
27
27
  import { injectIntl } from 'react-intl';
28
- import { UFOExperienceState } from '@atlaskit/ufo';
28
+ import { UFOExperienceState } from '@atlaskit/ufo/experience-state';
29
29
  import UserPicker, { isExternalUser, isTeam, isGroup, isUser, isValidEmail } from '@atlaskit/user-picker';
30
- import { fg } from '@atlaskit/platform-feature-flags';
30
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
31
31
  import { requestUsersEvent, filterUsersEvent, preparedUsersLoadedEvent, successfulRequestUsersEvent, failedRequestUsersEvent, mountedWithPrefetchEvent, createAndFireEventInElementsChannel, failedUserResolversEvent } from '../analytics';
32
32
  import MessagesIntlProvider from './MessagesIntlProvider';
33
33
  import { UserEntityType } from '../types';
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
- import { SmartUserPicker } from './SmartUserPicker';
2
+ import { UfoErrorBoundary } from '../UfoErrorBoundary';
3
+ import { smartUserPickerRenderedUfoExperience } from '../ufoExperiences';
4
+ import { useUFOConcurrentExperience } from '../useUFOConcurrentExperience';
3
5
  import MessagesIntlProvider from './MessagesIntlProvider';
4
- import { useUFOConcurrentExperience, smartUserPickerRenderedUfoExperience, UfoErrorBoundary } from '../ufoExperiences';
6
+ import { SmartUserPicker } from './SmartUserPicker';
5
7
  var SmartUserPickerWithIntlProvider = function SmartUserPickerWithIntlProvider(props) {
6
8
  var ufoId = props.inputId || props.fieldId;
7
9
  useUFOConcurrentExperience(smartUserPickerRenderedUfoExperience, ufoId);
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required, @atlaskit/volt-strict-mode/no-re-exports, @atlaskit/editor/no-re-export -- VOLTC-139 tracks removal of these deprecated re-export shims. */
1
2
  export { default } from './components';
2
3
  export { getUserRecommendations, hydrateDefaultValues } from './service';
3
4
  export {
@@ -1 +1,2 @@
1
+ /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required, @atlaskit/volt-strict-mode/no-re-exports, @atlaskit/editor/no-re-export -- VOLTC-139 tracks removal of these deprecated re-export shims. */
1
2
  export { Option, CustomOption, EmailOption, GroupOption, UserOption, TeamOption } from '@atlaskit/user-picker/option';
@@ -3,9 +3,9 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  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; }
4
4
  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) { _defineProperty(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; }
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
+ import { config } from '../config';
6
7
  import { UNKNOWN_USER } from './constants';
7
8
  import { graphqlQuery } from './graphqlUtils';
8
- import { config } from '../config';
9
9
  /**
10
10
  * @param {string} accountIds ids to hydrate
11
11
  * @return GraphQL Query
@@ -1,7 +1,7 @@
1
1
  import { ExternalUserType, GroupType, TeamType, UserType } from '@atlaskit/user-picker';
2
2
  import { messages } from '../i18n';
3
3
  import { EntityType } from '../types';
4
- import { fg } from '@atlaskit/platform-feature-flags';
4
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
5
5
  var getLozenzeProperties = function getLozenzeProperties(entity, intl) {
6
6
  var _entity$attributes, _entity$attributes2, _entity$attributes3;
7
7
  if ((_entity$attributes = entity.attributes) !== null && _entity$attributes !== void 0 && _entity$attributes.workspaceMember) {
@@ -1,13 +1,5 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
- import React from 'react';
9
- import { ExperiencePerformanceTypes, ExperienceTypes, ConcurrentExperience, UFOExperienceState } from '@atlaskit/ufo';
10
- import { useEffect, useState } from 'react';
1
+ import { ExperiencePerformanceTypes, ExperienceTypes } from '@atlaskit/ufo/experience-types';
2
+ import { ConcurrentExperience } from '@atlaskit/ufo/concurrent-experience';
11
3
  var COMPONENT_NAME = 'smart-user-picker';
12
4
  export var smartUserPickerRenderedUfoExperience = new ConcurrentExperience('smart-user-picker-rendered', {
13
5
  platform: {
@@ -22,46 +14,4 @@ export var smartUserPickerOptionsShownUfoExperience = new ConcurrentExperience('
22
14
  },
23
15
  type: ExperienceTypes.Operation,
24
16
  performanceType: ExperiencePerformanceTypes.InlineResult
25
- });
26
- export var useUFOConcurrentExperience = function useUFOConcurrentExperience(experience, id) {
27
- var experienceForId = experience.getInstance(id);
28
-
29
- // Equivalent to componentWillMount - replace with @atlaskit/ufo's
30
- // useUFOComponentExperience when it supports ConcurrentExperience.
31
- useState(function () {
32
- experienceForId.start();
33
- });
34
-
35
- // Replace with @atlaskit/ufo's <ExperienceSuccess> when it supports ConcurrentExperience
36
- useEffect(function () {
37
- if (experienceForId.state !== UFOExperienceState['FAILED']) {
38
- experienceForId.success();
39
- }
40
- return function () {
41
- if ([UFOExperienceState['STARTED'], UFOExperienceState['IN_PROGRESS']].includes(experienceForId.state)) {
42
- experienceForId.abort();
43
- }
44
- };
45
-
46
- // We only want this useEffect to run once after component mount, so no deps are needed.
47
- // eslint-disable-next-line react-hooks/exhaustive-deps
48
- }, []);
49
- };
50
- export var UfoErrorBoundary = /*#__PURE__*/function (_React$Component) {
51
- function UfoErrorBoundary() {
52
- _classCallCheck(this, UfoErrorBoundary);
53
- return _callSuper(this, UfoErrorBoundary, arguments);
54
- }
55
- _inherits(UfoErrorBoundary, _React$Component);
56
- return _createClass(UfoErrorBoundary, [{
57
- key: "componentDidCatch",
58
- value: function componentDidCatch() {
59
- smartUserPickerRenderedUfoExperience.getInstance(this.props.id).failure();
60
- }
61
- }, {
62
- key: "render",
63
- value: function render() {
64
- return this.props.children;
65
- }
66
- }]);
67
- }(React.Component);
17
+ });
@@ -0,0 +1,26 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { UFOExperienceState } from '@atlaskit/ufo/experience-state';
3
+ export var useUFOConcurrentExperience = function useUFOConcurrentExperience(experience, id) {
4
+ var experienceForId = experience.getInstance(id);
5
+
6
+ // Equivalent to pre-mount initialization - replace with @atlaskit/ufo's
7
+ // useUFOComponentExperience when it supports ConcurrentExperience.
8
+ useState(function () {
9
+ experienceForId.start();
10
+ });
11
+
12
+ // Replace with @atlaskit/ufo's <ExperienceSuccess> when it supports ConcurrentExperience
13
+ useEffect(function () {
14
+ if (experienceForId.state !== UFOExperienceState['FAILED']) {
15
+ experienceForId.success();
16
+ }
17
+ return function () {
18
+ if ([UFOExperienceState['STARTED'], UFOExperienceState['IN_PROGRESS']].includes(experienceForId.state)) {
19
+ experienceForId.abort();
20
+ }
21
+ };
22
+
23
+ // We only want this useEffect to run once after component mount, so no deps are needed.
24
+ // eslint-disable-next-line react-hooks/exhaustive-deps
25
+ }, []);
26
+ };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required, @atlaskit/volt-strict-mode/no-re-exports, @atlaskit/editor/no-re-export -- VOLTC-139 tracks removal of these deprecated re-export shims. */
1
2
  export {
2
3
  //Utils
3
4
  isEmail, isTeam, isUser, isExternalUser, isValidEmail, isGroup,
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export declare class UfoErrorBoundary extends React.Component<React.PropsWithChildren<{
3
+ id: string;
4
+ }>> {
5
+ componentDidCatch(): void;
6
+ render(): React.ReactNode;
7
+ }
@@ -1,4 +1,6 @@
1
- import { UIAnalyticsEvent, type AnalyticsEventPayload, type CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
1
+ import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
2
+ import type { AnalyticsEventPayload } from '@atlaskit/analytics-next/AnalyticsEvent';
3
+ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
2
4
  import { type Props } from './types';
3
5
  export type UserPickerSession = {
4
6
  id: string;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type MemoizedFn } from 'memoize-one';
3
3
  import { type WrappedComponentProps } from 'react-intl';
4
- import { type UFOExperience } from '@atlaskit/ufo';
4
+ import type { UFOExperience } from '@atlaskit/ufo/experience';
5
5
  import { type OptionData } from '@atlaskit/user-picker';
6
6
  import { type Props, type State, type FilterOptions } from '../types';
7
7
  import type { DebouncedFunc } from 'lodash';
@@ -1,5 +1,4 @@
1
1
  import { type AtlAttributionHeaderData } from './atl-attribution';
2
- export type { AtlAttributionHeaderData } from './atl-attribution';
3
2
  interface Query {
4
3
  query: string;
5
4
  variables: Record<string, string> | Record<string, string[]>;
@@ -14,3 +13,4 @@ export interface GraphQLError {
14
13
  * @param {Partial<AtlAttributionHeaderData>} attributionData - Optional attribution data for the atl-attribution header
15
14
  */
16
15
  export declare function graphqlQuery<D>(serviceUrl: string, query: Query, attributionData?: Partial<AtlAttributionHeaderData>): Promise<D>;
16
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { type User } from '@atlaskit/user-picker';
2
- import { type AtlAttributionHeaderData } from './graphqlUtils';
2
+ import type { AtlAttributionHeaderData } from './atl-attribution';
3
3
  interface UserData {
4
4
  accountId: string;
5
5
  name: string;
@@ -1,4 +1,4 @@
1
- import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
1
+ import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';
2
2
  import { type DefaultValue, type ExternalUser, type OptionData, type Team, type User, type UserPickerProps } from '@atlaskit/user-picker';
3
3
  export interface Context {
4
4
  containerId?: string;
@@ -1,11 +1,3 @@
1
- import React from 'react';
2
- import { ConcurrentExperience } from '@atlaskit/ufo';
1
+ import { ConcurrentExperience } from '@atlaskit/ufo/concurrent-experience';
3
2
  export declare const smartUserPickerRenderedUfoExperience: ConcurrentExperience;
4
3
  export declare const smartUserPickerOptionsShownUfoExperience: ConcurrentExperience;
5
- export declare const useUFOConcurrentExperience: (experience: ConcurrentExperience, id: string) => void;
6
- export declare class UfoErrorBoundary extends React.Component<React.PropsWithChildren<{
7
- id: string;
8
- }>> {
9
- componentDidCatch(): void;
10
- render(): React.ReactNode;
11
- }
@@ -0,0 +1,2 @@
1
+ import type { ConcurrentExperience } from '@atlaskit/ufo/concurrent-experience';
2
+ export declare const useUFOConcurrentExperience: (experience: ConcurrentExperience, id: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-user-picker",
3
- "version": "11.5.0",
3
+ "version": "11.6.0",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,10 +27,10 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@atlaskit/afm-i18n-platform-smart-experiences-smart-user-picker": "2.202.0",
30
- "@atlaskit/analytics-next": "^12.3.0",
31
- "@atlaskit/platform-feature-flags": "^2.1.0",
32
- "@atlaskit/ufo": "^1.0.0",
33
- "@atlaskit/user-picker": "^13.8.0",
30
+ "@atlaskit/analytics-next": "^12.5.0",
31
+ "@atlaskit/platform-feature-flags": "^2.2.0",
32
+ "@atlaskit/ufo": "^1.1.0",
33
+ "@atlaskit/user-picker": "^13.12.0",
34
34
  "@babel/runtime": "^7.0.0",
35
35
  "lodash": "^4.17.21",
36
36
  "memoize-one": "^6.0.0",
@@ -42,13 +42,17 @@
42
42
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@atlaskit/select": "^22.6.0",
45
+ "@atlaskit/button": "^25.3.0",
46
+ "@atlaskit/select": "^22.11.0",
47
+ "@atlaskit/textfield": "^10.2.0",
46
48
  "@atlaskit/util-data-test": "^19.1.0",
47
- "@atlassian/a11y-jest-testing": "^0.15.0",
48
- "@atlassian/feature-flags-test-utils": "^1.2.0",
49
+ "@atlassian/a11y-jest-testing": "^0.17.0",
50
+ "@atlassian/feature-flags-test-utils": "^1.3.0",
51
+ "@atlassian/integrations": "^33.7.0",
49
52
  "@testing-library/dom": "^10.1.0",
50
53
  "@testing-library/react": "^16.3.0",
51
54
  "@testing-library/user-event": "^14.4.3",
55
+ "@types/enzyme": "3.1.15",
52
56
  "enzyme": "^3.10.0",
53
57
  "fetch-mock": "^8.0.0",
54
58
  "graphql-tag": "^2.10.1",
package/report.api.md DELETED
@@ -1,301 +0,0 @@
1
- <!-- API Report Version: 2.3 -->
2
-
3
- ## API Report File for "@atlaskit/smart-user-picker"
4
-
5
- > Do not edit this file. This report is auto-generated using
6
- > [API Extractor](https://api-extractor.com/).
7
- > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
8
-
9
- ### Table of contents
10
-
11
- - [Main Entry Types](#main-entry-types)
12
- - [Peer Dependencies](#peer-dependencies)
13
-
14
- ### Main Entry Types
15
-
16
- <!--SECTION START: Main Entry Types-->
17
-
18
- ```ts
19
- import { ActionTypes } from '@atlaskit/user-picker';
20
- import { Appearance } from '@atlaskit/user-picker';
21
- import { AtlasKitSelectChange } from '@atlaskit/user-picker';
22
- import { AtlaskitSelectValue } from '@atlaskit/user-picker';
23
- import { DefaultValue } from '@atlaskit/user-picker';
24
- import { Email } from '@atlaskit/user-picker';
25
- import { EmailType } from '@atlaskit/user-picker';
26
- import { EmailValidationResponse } from '@atlaskit/user-picker';
27
- import { EmailValidator } from '@atlaskit/user-picker';
28
- import { ExternalUser } from '@atlaskit/user-picker';
29
- import { Group } from '@atlaskit/user-picker';
30
- import { GroupHighlight } from '@atlaskit/user-picker';
31
- import { GroupType } from '@atlaskit/user-picker';
32
- import { HighlightRange } from '@atlaskit/user-picker';
33
- import { InputActionTypes } from '@atlaskit/user-picker';
34
- import { IntlShape } from 'react-intl';
35
- import { isEmail } from '@atlaskit/user-picker';
36
- import { isTeam } from '@atlaskit/user-picker';
37
- import { isUser } from '@atlaskit/user-picker';
38
- import { isValidEmail } from '@atlaskit/user-picker';
39
- import { LoadOptions } from '@atlaskit/user-picker';
40
- import { LozengeProps } from '@atlaskit/user-picker';
41
- import { OnChange } from '@atlaskit/user-picker';
42
- import { OnInputChange } from '@atlaskit/user-picker';
43
- import { OnOption } from '@atlaskit/user-picker';
44
- import { OnPicker } from '@atlaskit/user-picker';
45
- import { Option as Option_2 } from '@atlaskit/user-picker';
46
- import { OptionData } from '@atlaskit/user-picker';
47
- import { OptionIdentifier } from '@atlaskit/user-picker';
48
- import { PopupUserPickerProps } from '@atlaskit/user-picker';
49
- import { Promisable } from '@atlaskit/user-picker';
50
- import { default as React_2 } from 'react';
51
- import { Target } from '@atlaskit/user-picker';
52
- import { Team } from '@atlaskit/user-picker';
53
- import { TeamHighlight } from '@atlaskit/user-picker';
54
- import { TeamMember } from '@atlaskit/user-picker';
55
- import { TeamType } from '@atlaskit/user-picker';
56
- import { User } from '@atlaskit/user-picker';
57
- import { UserHighlight } from '@atlaskit/user-picker';
58
- import { UserPickerProps } from '@atlaskit/user-picker';
59
- import { UserPickerState } from '@atlaskit/user-picker';
60
- import { UserSource } from '@atlaskit/user-picker';
61
- import { UserType } from '@atlaskit/user-picker';
62
- import { Value } from '@atlaskit/user-picker';
63
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
64
-
65
- export { ActionTypes };
66
-
67
- export { Appearance };
68
-
69
- export { AtlasKitSelectChange };
70
-
71
- export { AtlaskitSelectValue };
72
-
73
- // @public (undocumented)
74
- interface BitbucketAttributes {
75
- emailDomain?: string;
76
- isPublicRepo?: boolean;
77
- workspaceIds?: string[];
78
- }
79
-
80
- // @public (undocumented)
81
- interface ConfluenceAttributes {
82
- isEntitledConfluenceExternalCollaborator?: boolean;
83
- }
84
-
85
- // @public (undocumented)
86
- interface Context {
87
- // (undocumented)
88
- childObjectId?: string;
89
- // (undocumented)
90
- containerId?: string;
91
- // (undocumented)
92
- contextType: string;
93
- // (undocumented)
94
- objectId?: string;
95
- // (undocumented)
96
- organizationId?: string;
97
- // (undocumented)
98
- principalId?: string;
99
- // (undocumented)
100
- productAttributes?: ProductAttributes;
101
- // (undocumented)
102
- productKey: string;
103
- // (undocumented)
104
- sessionId?: string;
105
- // (undocumented)
106
- siteId: string;
107
- }
108
-
109
- export { DefaultValue };
110
-
111
- export { Email };
112
-
113
- export { EmailType };
114
-
115
- export { EmailValidationResponse };
116
-
117
- export { EmailValidator };
118
-
119
- export { ExternalUser };
120
-
121
- // @public (undocumented)
122
- type FilterOptions = (options: OptionData[], query: string) => OptionData[];
123
-
124
- // @public (undocumented)
125
- export const getUserRecommendations: (
126
- request: RecommendationRequest,
127
- intl: IntlShape,
128
- ) => Promise<OptionData[]>;
129
-
130
- export { Group };
131
-
132
- export { GroupHighlight };
133
-
134
- export { GroupType };
135
-
136
- export { HighlightRange };
137
-
138
- // @public (undocumented)
139
- export function hydrateDefaultValues(
140
- baseUrl: string | undefined,
141
- value: DefaultValue,
142
- productKey: string,
143
- ): Promise<DefaultValue>;
144
-
145
- export { InputActionTypes };
146
-
147
- export { isEmail };
148
-
149
- export { isTeam };
150
-
151
- export { isUser };
152
-
153
- export { isValidEmail };
154
-
155
- export { LoadOptions };
156
-
157
- export { LozengeProps };
158
-
159
- export { OnChange };
160
-
161
- // @public (undocumented)
162
- type OnEmpty = (query: string) => Promise<OptionData[]>;
163
-
164
- // @public (undocumented)
165
- type OnError = (error: any, request: RecommendationRequest) => Promise<OptionData[]> | void;
166
-
167
- export { OnInputChange };
168
-
169
- export { OnOption };
170
-
171
- export { OnPicker };
172
-
173
- // @public (undocumented)
174
- type OnValueError = (error: any, defaultValue: DefaultValue) => Promise<OptionData[]> | void;
175
-
176
- export { Option_2 as Option };
177
-
178
- export { OptionData };
179
-
180
- export { OptionIdentifier };
181
-
182
- export { PopupUserPickerProps };
183
-
184
- // @public (undocumented)
185
- type ProductAttributes = BitbucketAttributes | ConfluenceAttributes;
186
-
187
- export { Promisable };
188
-
189
- // @public (undocumented)
190
- export interface Props extends SmartProps, UserPickerProps, WithAnalyticsEventsProps {
191
- defaultValue?: DefaultValue;
192
- fieldId: string;
193
- }
194
-
195
- // @public (undocumented)
196
- export interface RecommendationRequest {
197
- // (undocumented)
198
- baseUrl?: string;
199
- // (undocumented)
200
- context: Context;
201
- // (undocumented)
202
- includeGroups?: boolean;
203
- // (undocumented)
204
- includeTeams?: boolean;
205
- // (undocumented)
206
- includeUsers?: boolean;
207
- // (undocumented)
208
- maxNumberOfResults: number;
209
- // (undocumented)
210
- query?: string;
211
- // (undocumented)
212
- searchQueryFilter?: string;
213
- }
214
-
215
- // @public (undocumented)
216
- interface SmartProps {
217
- baseUrl?: string;
218
- bootstrapOptions?: OptionData[];
219
- childObjectId?: string;
220
- containerId?: string;
221
- debounceTime?: number;
222
- filterOptions?: FilterOptions;
223
- includeGroups?: boolean;
224
- includeTeams?: boolean;
225
- includeUsers?: boolean;
226
- objectId?: string;
227
- onEmpty?: OnEmpty;
228
- onError?: OnError;
229
- onValueError?: OnValueError;
230
- orgId?: string;
231
- prefetch?: boolean;
232
- principalId?: string;
233
- productAttributes?: ProductAttributes;
234
- productKey: string;
235
- searchQueryFilter?: string;
236
- siteId: string;
237
- }
238
-
239
- // @public (undocumented)
240
- const SmartUserPickerWithIntlProvider: React_2.FunctionComponent<Props>;
241
- export default SmartUserPickerWithIntlProvider;
242
-
243
- // @public (undocumented)
244
- export interface State {
245
- // (undocumented)
246
- bootstrapOptions: OptionData[];
247
- // (undocumented)
248
- closed: boolean;
249
- // (undocumented)
250
- defaultValue?: DefaultValue;
251
- // (undocumented)
252
- loading: boolean;
253
- // (undocumented)
254
- query: string;
255
- // (undocumented)
256
- sessionId?: string;
257
- // (undocumented)
258
- users: OptionData[];
259
- }
260
-
261
- export { Target };
262
-
263
- export { Team };
264
-
265
- export { TeamHighlight };
266
-
267
- export { TeamMember };
268
-
269
- export { TeamType };
270
-
271
- export { User };
272
-
273
- export { UserHighlight };
274
-
275
- export { UserPickerProps };
276
-
277
- export { UserPickerState };
278
-
279
- export { UserSource };
280
-
281
- export { UserType };
282
-
283
- export { Value };
284
-
285
- // (No @packageDocumentation comment for this package)
286
- ```
287
-
288
- <!--SECTION END: Main Entry Types-->
289
-
290
- ### Peer Dependencies
291
-
292
- <!--SECTION START: Peer Dependencies-->
293
-
294
- ```json
295
- {
296
- "react": "^16.8.0",
297
- "react-dom": "^16.8.0"
298
- }
299
- ```
300
-
301
- <!--SECTION END: Peer Dependencies-->
@@ -1,41 +0,0 @@
1
- import path from 'path';
2
-
3
- import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
4
-
5
- import packageJson from './package.json';
6
-
7
- const packagePath = path.resolve(__dirname);
8
-
9
- const documentation: StructuredContentSource = {
10
- components: [
11
- {
12
- name: 'SmartUserPicker',
13
- description:
14
- 'A user picker component that provides ranked recommendations based on the current context.',
15
- status: 'general-availability',
16
- import: {
17
- name: 'default',
18
- package: '@atlaskit/smart-user-picker',
19
- type: 'default',
20
- packagePath,
21
- packageJson,
22
- },
23
- usageGuidelines: [
24
- 'Use SmartUserPicker to allow users to select other users or teams.',
25
- 'Provides intelligent recommendations to help users find the right person quickly.',
26
- 'Supports searching by name, email, and other criteria.',
27
- ],
28
- examples: [
29
- {
30
- name: 'Basic',
31
- description: 'Standard smart user picker display.',
32
- source: path.resolve(packagePath, './examples/00-smart-user-picker.tsx'),
33
- },
34
- ],
35
- keywords: ['user', 'picker', 'recommendations', 'search', 'teams'],
36
- categories: ['interaction'],
37
- },
38
- ],
39
- };
40
-
41
- export default documentation;