@atlaskit/smart-user-picker 11.4.0 → 11.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/UfoErrorBoundary.js +34 -0
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/SmartUserPicker.js +30 -17
- package/dist/cjs/components/index.js +6 -4
- package/dist/cjs/service/users-client.js +1 -1
- package/dist/cjs/ufoExperiences.js +2 -55
- package/dist/cjs/useUFOConcurrentExperience.js +32 -0
- package/dist/es2019/UfoErrorBoundary.js +10 -0
- package/dist/es2019/analytics.js +1 -1
- package/dist/es2019/components/SmartUserPicker.js +10 -0
- package/dist/es2019/components/index.js +4 -2
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/option.js +1 -0
- package/dist/es2019/service/users-client.js +1 -1
- package/dist/es2019/ufoExperiences.js +2 -36
- package/dist/es2019/useUFOConcurrentExperience.js +26 -0
- package/dist/es2019/userPicker.js +1 -0
- package/dist/esm/UfoErrorBoundary.js +27 -0
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/SmartUserPicker.js +30 -17
- package/dist/esm/components/index.js +4 -2
- package/dist/esm/index.js +1 -0
- package/dist/esm/option.js +1 -0
- package/dist/esm/service/users-client.js +1 -1
- package/dist/esm/ufoExperiences.js +2 -53
- package/dist/esm/useUFOConcurrentExperience.js +26 -0
- package/dist/esm/userPicker.js +1 -0
- package/dist/types/UfoErrorBoundary.d.ts +7 -0
- package/dist/types/service/graphqlUtils.d.ts +1 -1
- package/dist/types/service/users-client.d.ts +1 -1
- package/dist/types/ufoExperiences.d.ts +0 -8
- package/dist/types/useUFOConcurrentExperience.d.ts +2 -0
- package/package.json +5 -2
- package/smart-user-picker.docs.tsx +0 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlassian/smart-user-picker
|
|
2
2
|
|
|
3
|
+
## 11.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6d704062ca749`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6d704062ca749) -
|
|
8
|
+
Internal refactor to support tree shaking. No consumer changes.
|
|
9
|
+
|
|
10
|
+
## 11.5.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`30c27895b9040`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/30c27895b9040) -
|
|
15
|
+
Behind the smart-user-picker-fetch-error-fix gate, a failed user lookup no longer clears the
|
|
16
|
+
suggestions or fails the UFO experience when the query has already moved on, so a slow or failing
|
|
17
|
+
request for an earlier keystroke cannot wipe the results of the current one.
|
|
18
|
+
|
|
3
19
|
## 11.4.0
|
|
4
20
|
|
|
5
21
|
### 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);
|
package/dist/cjs/analytics.js
CHANGED
|
@@ -12,7 +12,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
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.
|
|
15
|
+
var packageVersion = "11.5.0";
|
|
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
|
|
@@ -343,11 +343,24 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
343
343
|
loading: loading
|
|
344
344
|
};
|
|
345
345
|
});
|
|
346
|
-
_context.next =
|
|
346
|
+
_context.next = 24;
|
|
347
347
|
break;
|
|
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'))) {
|
|
352
|
+
_context.next = 16;
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
// The query has moved on since this request was sent, so its results are not the ones
|
|
356
|
+
// on screen. Applying the failure here would clear the options and fail the UFO
|
|
357
|
+
// experience that belong to the newer query.
|
|
358
|
+
_this.fireEvent(_analytics.failedRequestUsersEvent, {
|
|
359
|
+
elapsedTimeMilli: window.performance.now() - startTime,
|
|
360
|
+
productAttributes: productAttributes
|
|
361
|
+
});
|
|
362
|
+
return _context.abrupt("return");
|
|
363
|
+
case 16:
|
|
351
364
|
is5xxEvent = checkIf500Event(_t6.statusCode);
|
|
352
365
|
if (!closed && !onError && is5xxEvent) {
|
|
353
366
|
// If the user lookup fails while the menu is open, and the consumer is not providing a
|
|
@@ -359,35 +372,35 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
359
372
|
});
|
|
360
373
|
onErrorProducedError = false;
|
|
361
374
|
defaultUsers = [];
|
|
362
|
-
_context.prev =
|
|
375
|
+
_context.prev = 17;
|
|
363
376
|
if (!onError) {
|
|
364
|
-
_context.next =
|
|
377
|
+
_context.next = 20;
|
|
365
378
|
break;
|
|
366
379
|
}
|
|
367
|
-
_context.next =
|
|
380
|
+
_context.next = 18;
|
|
368
381
|
return onError(_t6, recommendationsRequest);
|
|
369
|
-
case
|
|
382
|
+
case 18:
|
|
370
383
|
_t8 = _context.sent;
|
|
371
384
|
if (_t8) {
|
|
372
|
-
_context.next =
|
|
385
|
+
_context.next = 19;
|
|
373
386
|
break;
|
|
374
387
|
}
|
|
375
388
|
_t8 = [];
|
|
376
|
-
case
|
|
389
|
+
case 19:
|
|
377
390
|
_t7 = _t8;
|
|
378
|
-
_context.next =
|
|
391
|
+
_context.next = 21;
|
|
379
392
|
break;
|
|
380
|
-
case 19:
|
|
381
|
-
_t7 = [];
|
|
382
393
|
case 20:
|
|
394
|
+
_t7 = [];
|
|
395
|
+
case 21:
|
|
383
396
|
defaultUsers = _t7;
|
|
384
|
-
_context.next =
|
|
397
|
+
_context.next = 23;
|
|
385
398
|
break;
|
|
386
|
-
case 21:
|
|
387
|
-
_context.prev = 21;
|
|
388
|
-
_t9 = _context["catch"](16);
|
|
389
|
-
onErrorProducedError = true;
|
|
390
399
|
case 22:
|
|
400
|
+
_context.prev = 22;
|
|
401
|
+
_t9 = _context["catch"](17);
|
|
402
|
+
onErrorProducedError = true;
|
|
403
|
+
case 23:
|
|
391
404
|
if (onErrorProducedError && is5xxEvent) {
|
|
392
405
|
// Log error from fallback data source `onError` to UFO
|
|
393
406
|
_this.optionsShownUfoExperienceInstance.failure(ufoEndStateConfig(_this.props.fieldId));
|
|
@@ -404,11 +417,11 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
404
417
|
elapsedTimeMilli: _elapsedTimeMilli,
|
|
405
418
|
productAttributes: productAttributes
|
|
406
419
|
});
|
|
407
|
-
case
|
|
420
|
+
case 24:
|
|
408
421
|
case "end":
|
|
409
422
|
return _context.stop();
|
|
410
423
|
}
|
|
411
|
-
}, _callee, null, [[1, 15], [
|
|
424
|
+
}, _callee, null, [[1, 15], [17, 22]]);
|
|
412
425
|
})), (_this$props$debounceT = _this.props.debounceTime) !== null && _this$props$debounceT !== void 0 ? _this$props$debounceT : 0));
|
|
413
426
|
(0, _defineProperty2.default)(_this, "onInputChange", function (newQuery, sessionId) {
|
|
414
427
|
var query = newQuery || '';
|
|
@@ -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
|
|
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,
|
|
15
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
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
|
/**
|
|
@@ -1,21 +1,10 @@
|
|
|
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.
|
|
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"));
|
|
6
|
+
exports.smartUserPickerRenderedUfoExperience = exports.smartUserPickerOptionsShownUfoExperience = void 0;
|
|
15
7
|
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; })(); }
|
|
19
8
|
var COMPONENT_NAME = 'smart-user-picker';
|
|
20
9
|
var smartUserPickerRenderedUfoExperience = exports.smartUserPickerRenderedUfoExperience = new _ufo.ConcurrentExperience('smart-user-picker-rendered', {
|
|
21
10
|
platform: {
|
|
@@ -30,46 +19,4 @@ var smartUserPickerOptionsShownUfoExperience = exports.smartUserPickerOptionsSho
|
|
|
30
19
|
},
|
|
31
20
|
type: _ufo.ExperienceTypes.Operation,
|
|
32
21
|
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);
|
|
22
|
+
});
|
|
@@ -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 _ufo = require("@atlaskit/ufo");
|
|
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 !== _ufo.UFOExperienceState['FAILED']) {
|
|
21
|
+
experienceForId.success();
|
|
22
|
+
}
|
|
23
|
+
return function () {
|
|
24
|
+
if ([_ufo.UFOExperienceState['STARTED'], _ufo.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
|
+
}
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
|
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.
|
|
6
|
+
const packageVersion = "11.5.0";
|
|
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(),
|
|
@@ -260,6 +260,16 @@ export class SmartUserPickerWithoutAnalytics extends React.Component {
|
|
|
260
260
|
};
|
|
261
261
|
});
|
|
262
262
|
} catch (e) {
|
|
263
|
+
if (this.state.query !== query && fg('smart-user-picker-fetch-error-fix')) {
|
|
264
|
+
// The query has moved on since this request was sent, so its results are not the ones
|
|
265
|
+
// on screen. Applying the failure here would clear the options and fail the UFO
|
|
266
|
+
// experience that belong to the newer query.
|
|
267
|
+
this.fireEvent(failedRequestUsersEvent, {
|
|
268
|
+
elapsedTimeMilli: window.performance.now() - startTime,
|
|
269
|
+
productAttributes
|
|
270
|
+
});
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
263
273
|
const is5xxEvent = checkIf500Event(e.statusCode);
|
|
264
274
|
if (!closed && !onError && is5xxEvent) {
|
|
265
275
|
// If the user lookup fails while the menu is open, and the consumer is not providing a
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { UfoErrorBoundary } from '../UfoErrorBoundary';
|
|
3
|
+
import { smartUserPickerRenderedUfoExperience } from '../ufoExperiences';
|
|
4
|
+
import { useUFOConcurrentExperience } from '../useUFOConcurrentExperience';
|
|
3
5
|
import MessagesIntlProvider from './MessagesIntlProvider';
|
|
4
|
-
import {
|
|
6
|
+
import { SmartUserPicker } from './SmartUserPicker';
|
|
5
7
|
const SmartUserPickerWithIntlProvider = props => {
|
|
6
8
|
const ufoId = props.inputId || props.fieldId;
|
|
7
9
|
useUFOConcurrentExperience(smartUserPickerRenderedUfoExperience, ufoId);
|
package/dist/es2019/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 {
|
package/dist/es2019/option.js
CHANGED
|
@@ -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,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ExperiencePerformanceTypes, ExperienceTypes, ConcurrentExperience, UFOExperienceState } from '@atlaskit/ufo';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
1
|
+
import { ExperiencePerformanceTypes, ExperienceTypes, ConcurrentExperience } from '@atlaskit/ufo';
|
|
4
2
|
const COMPONENT_NAME = 'smart-user-picker';
|
|
5
3
|
export const smartUserPickerRenderedUfoExperience = new ConcurrentExperience('smart-user-picker-rendered', {
|
|
6
4
|
platform: {
|
|
@@ -15,36 +13,4 @@ export const smartUserPickerOptionsShownUfoExperience = new ConcurrentExperience
|
|
|
15
13
|
},
|
|
16
14
|
type: ExperienceTypes.Operation,
|
|
17
15
|
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
|
-
}
|
|
16
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { UFOExperienceState } from '@atlaskit/ufo';
|
|
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);
|
package/dist/esm/analytics.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
|
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.
|
|
9
|
+
var packageVersion = "11.5.0";
|
|
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
|
|
@@ -335,11 +335,24 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
335
335
|
loading: loading
|
|
336
336
|
};
|
|
337
337
|
});
|
|
338
|
-
_context.next =
|
|
338
|
+
_context.next = 24;
|
|
339
339
|
break;
|
|
340
340
|
case 15:
|
|
341
341
|
_context.prev = 15;
|
|
342
342
|
_t6 = _context["catch"](1);
|
|
343
|
+
if (!(_this.state.query !== query && fg('smart-user-picker-fetch-error-fix'))) {
|
|
344
|
+
_context.next = 16;
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
// The query has moved on since this request was sent, so its results are not the ones
|
|
348
|
+
// on screen. Applying the failure here would clear the options and fail the UFO
|
|
349
|
+
// experience that belong to the newer query.
|
|
350
|
+
_this.fireEvent(failedRequestUsersEvent, {
|
|
351
|
+
elapsedTimeMilli: window.performance.now() - startTime,
|
|
352
|
+
productAttributes: productAttributes
|
|
353
|
+
});
|
|
354
|
+
return _context.abrupt("return");
|
|
355
|
+
case 16:
|
|
343
356
|
is5xxEvent = checkIf500Event(_t6.statusCode);
|
|
344
357
|
if (!closed && !onError && is5xxEvent) {
|
|
345
358
|
// If the user lookup fails while the menu is open, and the consumer is not providing a
|
|
@@ -351,35 +364,35 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
351
364
|
});
|
|
352
365
|
onErrorProducedError = false;
|
|
353
366
|
defaultUsers = [];
|
|
354
|
-
_context.prev =
|
|
367
|
+
_context.prev = 17;
|
|
355
368
|
if (!onError) {
|
|
356
|
-
_context.next =
|
|
369
|
+
_context.next = 20;
|
|
357
370
|
break;
|
|
358
371
|
}
|
|
359
|
-
_context.next =
|
|
372
|
+
_context.next = 18;
|
|
360
373
|
return onError(_t6, recommendationsRequest);
|
|
361
|
-
case
|
|
374
|
+
case 18:
|
|
362
375
|
_t8 = _context.sent;
|
|
363
376
|
if (_t8) {
|
|
364
|
-
_context.next =
|
|
377
|
+
_context.next = 19;
|
|
365
378
|
break;
|
|
366
379
|
}
|
|
367
380
|
_t8 = [];
|
|
368
|
-
case
|
|
381
|
+
case 19:
|
|
369
382
|
_t7 = _t8;
|
|
370
|
-
_context.next =
|
|
383
|
+
_context.next = 21;
|
|
371
384
|
break;
|
|
372
|
-
case 19:
|
|
373
|
-
_t7 = [];
|
|
374
385
|
case 20:
|
|
386
|
+
_t7 = [];
|
|
387
|
+
case 21:
|
|
375
388
|
defaultUsers = _t7;
|
|
376
|
-
_context.next =
|
|
389
|
+
_context.next = 23;
|
|
377
390
|
break;
|
|
378
|
-
case 21:
|
|
379
|
-
_context.prev = 21;
|
|
380
|
-
_t9 = _context["catch"](16);
|
|
381
|
-
onErrorProducedError = true;
|
|
382
391
|
case 22:
|
|
392
|
+
_context.prev = 22;
|
|
393
|
+
_t9 = _context["catch"](17);
|
|
394
|
+
onErrorProducedError = true;
|
|
395
|
+
case 23:
|
|
383
396
|
if (onErrorProducedError && is5xxEvent) {
|
|
384
397
|
// Log error from fallback data source `onError` to UFO
|
|
385
398
|
_this.optionsShownUfoExperienceInstance.failure(ufoEndStateConfig(_this.props.fieldId));
|
|
@@ -396,11 +409,11 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
396
409
|
elapsedTimeMilli: _elapsedTimeMilli,
|
|
397
410
|
productAttributes: productAttributes
|
|
398
411
|
});
|
|
399
|
-
case
|
|
412
|
+
case 24:
|
|
400
413
|
case "end":
|
|
401
414
|
return _context.stop();
|
|
402
415
|
}
|
|
403
|
-
}, _callee, null, [[1, 15], [
|
|
416
|
+
}, _callee, null, [[1, 15], [17, 22]]);
|
|
404
417
|
})), (_this$props$debounceT = _this.props.debounceTime) !== null && _this$props$debounceT !== void 0 ? _this$props$debounceT : 0));
|
|
405
418
|
_defineProperty(_this, "onInputChange", function (newQuery, sessionId) {
|
|
406
419
|
var query = newQuery || '';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { UfoErrorBoundary } from '../UfoErrorBoundary';
|
|
3
|
+
import { smartUserPickerRenderedUfoExperience } from '../ufoExperiences';
|
|
4
|
+
import { useUFOConcurrentExperience } from '../useUFOConcurrentExperience';
|
|
3
5
|
import MessagesIntlProvider from './MessagesIntlProvider';
|
|
4
|
-
import {
|
|
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 {
|
package/dist/esm/option.js
CHANGED
|
@@ -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,13 +1,4 @@
|
|
|
1
|
-
import
|
|
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, ConcurrentExperience } from '@atlaskit/ufo';
|
|
11
2
|
var COMPONENT_NAME = 'smart-user-picker';
|
|
12
3
|
export var smartUserPickerRenderedUfoExperience = new ConcurrentExperience('smart-user-picker-rendered', {
|
|
13
4
|
platform: {
|
|
@@ -22,46 +13,4 @@ export var smartUserPickerOptionsShownUfoExperience = new ConcurrentExperience('
|
|
|
22
13
|
},
|
|
23
14
|
type: ExperienceTypes.Operation,
|
|
24
15
|
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);
|
|
16
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { UFOExperienceState } from '@atlaskit/ufo';
|
|
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
|
+
};
|
package/dist/esm/userPicker.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 {
|
|
2
3
|
//Utils
|
|
3
4
|
isEmail, isTeam, isUser, isExternalUser, isValidEmail, isGroup,
|
|
@@ -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,11 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ConcurrentExperience } from '@atlaskit/ufo';
|
|
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
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-user-picker",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.5.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@atlaskit/analytics-next": "^12.3.0",
|
|
31
31
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
32
32
|
"@atlaskit/ufo": "^1.0.0",
|
|
33
|
-
"@atlaskit/user-picker": "^13.
|
|
33
|
+
"@atlaskit/user-picker": "^13.9.0",
|
|
34
34
|
"@babel/runtime": "^7.0.0",
|
|
35
35
|
"lodash": "^4.17.21",
|
|
36
36
|
"memoize-one": "^6.0.0",
|
|
@@ -61,6 +61,9 @@
|
|
|
61
61
|
"smart_user_picker_suggest_emails_for_domain": {
|
|
62
62
|
"type": "boolean"
|
|
63
63
|
},
|
|
64
|
+
"smart-user-picker-fetch-error-fix": {
|
|
65
|
+
"type": "boolean"
|
|
66
|
+
},
|
|
64
67
|
"smart-user-picker-load-options-gate": {
|
|
65
68
|
"type": "boolean"
|
|
66
69
|
},
|
|
@@ -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;
|