@atlaskit/smart-user-picker 6.11.2 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/SmartUserPicker.js +16 -19
- package/dist/cjs/ufoExperiences.js +5 -7
- package/dist/cjs/util/i18n-util.js +2 -2
- package/dist/es2019/analytics.js +1 -1
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/SmartUserPicker.js +16 -19
- package/dist/esm/ufoExperiences.js +5 -7
- package/dist/esm/util/i18n-util.js +4 -3
- package/dist/types/components/MessagesIntlProvider.d.ts +2 -6
- package/dist/types/components/SmartUserPicker.d.ts +1 -1
- package/dist/types-ts4.5/components/MessagesIntlProvider.d.ts +2 -6
- package/dist/types-ts4.5/components/SmartUserPicker.d.ts +1 -1
- package/package.json +11 -7
- package/tsconfig.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlassian/smart-user-picker
|
|
2
2
|
|
|
3
|
+
## 7.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#115319](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115319)
|
|
8
|
+
[`d3a55e50e9513`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d3a55e50e9513) -
|
|
9
|
+
QS-5272 migrate atlassian smart user picker to r18 concurrent
|
|
10
|
+
- [#115319](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115319)
|
|
11
|
+
[`b0c914f8d10d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b0c914f8d10d7) -
|
|
12
|
+
QS-5272 runReact18 true
|
|
13
|
+
|
|
14
|
+
## 7.0.0
|
|
15
|
+
|
|
16
|
+
### Major Changes
|
|
17
|
+
|
|
18
|
+
- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)
|
|
19
|
+
[`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -
|
|
20
|
+
Update `React` from v16 to v18
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 6.11.2
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/cjs/analytics.js
CHANGED
|
@@ -11,7 +11,7 @@ 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; }
|
|
13
13
|
var packageName = "@atlaskit/smart-user-picker";
|
|
14
|
-
var packageVersion = "
|
|
14
|
+
var packageVersion = "7.0.1";
|
|
15
15
|
var startSession = exports.startSession = function startSession() {
|
|
16
16
|
return {
|
|
17
17
|
id: (0, _uuid.v4)(),
|
|
@@ -11,10 +11,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
18
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
18
|
var _react = _interopRequireDefault(require("react"));
|
|
20
19
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
@@ -35,7 +34,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
35
34
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
36
35
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
37
36
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
38
|
-
function
|
|
37
|
+
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)); }
|
|
39
38
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
40
39
|
var DEFAULT_DEBOUNCE_TIME_MS = 150;
|
|
41
40
|
var ufoEndStateConfig = function ufoEndStateConfig(fieldId) {
|
|
@@ -71,14 +70,12 @@ var checkIf500Event = function checkIf500Event(statusCode) {
|
|
|
71
70
|
return 500 <= statusCode && statusCode < 600;
|
|
72
71
|
};
|
|
73
72
|
var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
74
|
-
(0, _inherits2.default)(SmartUserPickerWithoutAnalytics, _React$Component);
|
|
75
|
-
var _super = _createSuper(SmartUserPickerWithoutAnalytics);
|
|
76
73
|
function SmartUserPickerWithoutAnalytics(props) {
|
|
77
74
|
var _this$props$debounceT;
|
|
78
75
|
var _this;
|
|
79
76
|
(0, _classCallCheck2.default)(this, SmartUserPickerWithoutAnalytics);
|
|
80
|
-
_this =
|
|
81
|
-
(0, _defineProperty2.default)(
|
|
77
|
+
_this = _callSuper(this, SmartUserPickerWithoutAnalytics, [props]);
|
|
78
|
+
(0, _defineProperty2.default)(_this, "state", {
|
|
82
79
|
users: [],
|
|
83
80
|
loading: false,
|
|
84
81
|
closed: true,
|
|
@@ -86,18 +83,18 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
86
83
|
defaultValue: [],
|
|
87
84
|
bootstrapOptions: []
|
|
88
85
|
});
|
|
89
|
-
(0, _defineProperty2.default)(
|
|
86
|
+
(0, _defineProperty2.default)(_this, "abortOptionsShownUfoExperience", function () {
|
|
90
87
|
if (_this.optionsShownUfoExperienceInstance.state.id === _ufo.UFOExperienceState.STARTED.id) {
|
|
91
88
|
// There may be an existing UFO timing running from previous key entry or focus,
|
|
92
89
|
// so abort it and restart it just in case.
|
|
93
90
|
_this.optionsShownUfoExperienceInstance.abort();
|
|
94
91
|
}
|
|
95
92
|
});
|
|
96
|
-
(0, _defineProperty2.default)(
|
|
93
|
+
(0, _defineProperty2.default)(_this, "startOptionsShownUfoExperience", function () {
|
|
97
94
|
_this.abortOptionsShownUfoExperience();
|
|
98
95
|
_this.optionsShownUfoExperienceInstance.start();
|
|
99
96
|
});
|
|
100
|
-
(0, _defineProperty2.default)(
|
|
97
|
+
(0, _defineProperty2.default)(_this, "fireEvent", function (eventCreator) {
|
|
101
98
|
var createAnalyticsEvent = _this.props.createAnalyticsEvent;
|
|
102
99
|
if (createAnalyticsEvent) {
|
|
103
100
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -106,11 +103,11 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
106
103
|
(0, _analytics.createAndFireEventInElementsChannel)(eventCreator.apply(void 0, [_this.props, _this.state].concat(args)))(createAnalyticsEvent);
|
|
107
104
|
}
|
|
108
105
|
});
|
|
109
|
-
(0, _defineProperty2.default)(
|
|
106
|
+
(0, _defineProperty2.default)(_this, "filterOptions", function (users, query, propFilterOptions) {
|
|
110
107
|
return propFilterOptions ? propFilterOptions(users, query) : users;
|
|
111
108
|
});
|
|
112
|
-
(0, _defineProperty2.default)(
|
|
113
|
-
(0, _defineProperty2.default)(
|
|
109
|
+
(0, _defineProperty2.default)(_this, "memoizedFilterOptions", (0, _memoizeOne.default)(_this.filterOptions));
|
|
110
|
+
(0, _defineProperty2.default)(_this, "getUsers", (0, _debounce.default)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
114
111
|
var _this$state, query, sessionId, closed, _this$props, baseUrl, childObjectId, containerId, fieldId, includeGroups, includeTeams, includeUsers, includeNonLicensedUsers, intl, maxOptions, objectId, onEmpty, onError, overrideByline, orgId, principalId, productAttributes, productKey, searchQueryFilter, siteId, maxNumberOfResults, startTime, recommendationsRequest, _yield$onEmpty, recommendedUsers, _iterator, _step, option, elapsedTimeMilli, displayedUsers, is5xxEvent, onErrorProducedError, defaultUsers, _elapsedTimeMilli;
|
|
115
112
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
116
113
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -278,7 +275,7 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
278
275
|
}
|
|
279
276
|
}, _callee, null, [[5, 32], [39, 53]]);
|
|
280
277
|
})), (_this$props$debounceT = _this.props.debounceTime) !== null && _this$props$debounceT !== void 0 ? _this$props$debounceT : 0));
|
|
281
|
-
(0, _defineProperty2.default)(
|
|
278
|
+
(0, _defineProperty2.default)(_this, "onInputChange", function (newQuery, sessionId) {
|
|
282
279
|
var query = newQuery || '';
|
|
283
280
|
var closed = _this.state.closed;
|
|
284
281
|
if (query === _this.state.query) {
|
|
@@ -300,7 +297,7 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
300
297
|
}
|
|
301
298
|
}
|
|
302
299
|
});
|
|
303
|
-
(0, _defineProperty2.default)(
|
|
300
|
+
(0, _defineProperty2.default)(_this, "filterUsers", function () {
|
|
304
301
|
var _this$state2 = _this.state,
|
|
305
302
|
loading = _this$state2.loading,
|
|
306
303
|
users = _this$state2.users,
|
|
@@ -330,7 +327,7 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
330
327
|
// when loading filter previous result.
|
|
331
328
|
return filteredUsers;
|
|
332
329
|
});
|
|
333
|
-
(0, _defineProperty2.default)(
|
|
330
|
+
(0, _defineProperty2.default)(_this, "onFocus", function (sessionId) {
|
|
334
331
|
var state = {
|
|
335
332
|
query: '',
|
|
336
333
|
closed: false
|
|
@@ -353,7 +350,7 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
353
350
|
_this.props.onFocus(sessionId);
|
|
354
351
|
}
|
|
355
352
|
});
|
|
356
|
-
(0, _defineProperty2.default)(
|
|
353
|
+
(0, _defineProperty2.default)(_this, "onBlur", function (sessionId) {
|
|
357
354
|
_this.getUsers.cancel();
|
|
358
355
|
_this.abortOptionsShownUfoExperience();
|
|
359
356
|
|
|
@@ -372,7 +369,8 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
372
369
|
_this.optionsShownUfoExperienceInstance = _ufoExperiences.smartUserPickerOptionsShownUfoExperience.getInstance(props.inputId || props.fieldId);
|
|
373
370
|
return _this;
|
|
374
371
|
}
|
|
375
|
-
(0,
|
|
372
|
+
(0, _inherits2.default)(SmartUserPickerWithoutAnalytics, _React$Component);
|
|
373
|
+
return (0, _createClass2.default)(SmartUserPickerWithoutAnalytics, [{
|
|
376
374
|
key: "componentDidMount",
|
|
377
375
|
value: function () {
|
|
378
376
|
var _componentDidMount = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
@@ -453,7 +451,6 @@ var SmartUserPickerWithoutAnalytics = exports.SmartUserPickerWithoutAnalytics =
|
|
|
453
451
|
})));
|
|
454
452
|
}
|
|
455
453
|
}]);
|
|
456
|
-
return SmartUserPickerWithoutAnalytics;
|
|
457
454
|
}(_react.default.Component); // TODO: Smart User picker team will have to add a type annotation here
|
|
458
455
|
(0, _defineProperty2.default)(SmartUserPickerWithoutAnalytics, "defaultProps", {
|
|
459
456
|
baseUrl: '',
|
|
@@ -8,14 +8,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.useUFOConcurrentExperience = exports.smartUserPickerRenderedUfoExperience = exports.smartUserPickerOptionsShownUfoExperience = exports.UfoErrorBoundary = void 0;
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _ufo = require("@atlaskit/ufo");
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
function
|
|
18
|
+
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)); }
|
|
19
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
20
|
var COMPONENT_NAME = 'smart-user-picker';
|
|
21
21
|
var smartUserPickerRenderedUfoExperience = exports.smartUserPickerRenderedUfoExperience = new _ufo.ConcurrentExperience('smart-user-picker-rendered', {
|
|
@@ -57,13 +57,12 @@ var useUFOConcurrentExperience = exports.useUFOConcurrentExperience = function u
|
|
|
57
57
|
}, []);
|
|
58
58
|
};
|
|
59
59
|
var UfoErrorBoundary = exports.UfoErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
60
|
-
(0, _inherits2.default)(UfoErrorBoundary, _React$Component);
|
|
61
|
-
var _super = _createSuper(UfoErrorBoundary);
|
|
62
60
|
function UfoErrorBoundary() {
|
|
63
61
|
(0, _classCallCheck2.default)(this, UfoErrorBoundary);
|
|
64
|
-
return
|
|
62
|
+
return _callSuper(this, UfoErrorBoundary, arguments);
|
|
65
63
|
}
|
|
66
|
-
(0,
|
|
64
|
+
(0, _inherits2.default)(UfoErrorBoundary, _React$Component);
|
|
65
|
+
return (0, _createClass2.default)(UfoErrorBoundary, [{
|
|
67
66
|
key: "componentDidCatch",
|
|
68
67
|
value: function componentDidCatch() {
|
|
69
68
|
smartUserPickerRenderedUfoExperience.getInstance(this.props.id).failure();
|
|
@@ -74,5 +73,4 @@ var UfoErrorBoundary = exports.UfoErrorBoundary = /*#__PURE__*/function (_React$
|
|
|
74
73
|
return this.props.children;
|
|
75
74
|
}
|
|
76
75
|
}]);
|
|
77
|
-
return UfoErrorBoundary;
|
|
78
76
|
}(_react.default.Component);
|
|
@@ -20,7 +20,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
20
20
|
*
|
|
21
21
|
* @param locale string specifying the locale like 'en_GB', or 'fr'.
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _getMessagesForLocale = exports.getMessagesForLocale = /*#__PURE__*/function () {
|
|
24
24
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(locale) {
|
|
25
25
|
var fragments;
|
|
26
26
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
@@ -209,7 +209,7 @@ var getMessagesForLocale = exports.getMessagesForLocale = /*#__PURE__*/function
|
|
|
209
209
|
_context.next = 37;
|
|
210
210
|
break;
|
|
211
211
|
}
|
|
212
|
-
return _context.abrupt("return",
|
|
212
|
+
return _context.abrupt("return", _getMessagesForLocale(fragments[0]));
|
|
213
213
|
case 37:
|
|
214
214
|
return _context.abrupt("return", Promise.resolve().then(function () {
|
|
215
215
|
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-en" */'../i18n/en'));
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import { v4 as uuid } from 'uuid';
|
|
3
3
|
const packageName = "@atlaskit/smart-user-picker";
|
|
4
|
-
const packageVersion = "
|
|
4
|
+
const packageVersion = "7.0.1";
|
|
5
5
|
export const startSession = () => ({
|
|
6
6
|
id: uuid(),
|
|
7
7
|
start: Date.now(),
|
package/dist/esm/analytics.js
CHANGED
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
import { v4 as uuid } from 'uuid';
|
|
6
6
|
var packageName = "@atlaskit/smart-user-picker";
|
|
7
|
-
var packageVersion = "
|
|
7
|
+
var packageVersion = "7.0.1";
|
|
8
8
|
export var startSession = function startSession() {
|
|
9
9
|
return {
|
|
10
10
|
id: uuid(),
|
|
@@ -2,10 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
9
|
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; }
|
|
11
10
|
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; }
|
|
@@ -13,7 +12,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
13
12
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
14
13
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
15
14
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
|
-
function
|
|
15
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
16
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
17
|
import React from 'react';
|
|
19
18
|
import debounce from 'lodash/debounce';
|
|
@@ -61,14 +60,12 @@ var checkIf500Event = function checkIf500Event(statusCode) {
|
|
|
61
60
|
return 500 <= statusCode && statusCode < 600;
|
|
62
61
|
};
|
|
63
62
|
export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
64
|
-
_inherits(SmartUserPickerWithoutAnalytics, _React$Component);
|
|
65
|
-
var _super = _createSuper(SmartUserPickerWithoutAnalytics);
|
|
66
63
|
function SmartUserPickerWithoutAnalytics(props) {
|
|
67
64
|
var _this$props$debounceT;
|
|
68
65
|
var _this;
|
|
69
66
|
_classCallCheck(this, SmartUserPickerWithoutAnalytics);
|
|
70
|
-
_this =
|
|
71
|
-
_defineProperty(
|
|
67
|
+
_this = _callSuper(this, SmartUserPickerWithoutAnalytics, [props]);
|
|
68
|
+
_defineProperty(_this, "state", {
|
|
72
69
|
users: [],
|
|
73
70
|
loading: false,
|
|
74
71
|
closed: true,
|
|
@@ -76,18 +73,18 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
76
73
|
defaultValue: [],
|
|
77
74
|
bootstrapOptions: []
|
|
78
75
|
});
|
|
79
|
-
_defineProperty(
|
|
76
|
+
_defineProperty(_this, "abortOptionsShownUfoExperience", function () {
|
|
80
77
|
if (_this.optionsShownUfoExperienceInstance.state.id === UFOExperienceState.STARTED.id) {
|
|
81
78
|
// There may be an existing UFO timing running from previous key entry or focus,
|
|
82
79
|
// so abort it and restart it just in case.
|
|
83
80
|
_this.optionsShownUfoExperienceInstance.abort();
|
|
84
81
|
}
|
|
85
82
|
});
|
|
86
|
-
_defineProperty(
|
|
83
|
+
_defineProperty(_this, "startOptionsShownUfoExperience", function () {
|
|
87
84
|
_this.abortOptionsShownUfoExperience();
|
|
88
85
|
_this.optionsShownUfoExperienceInstance.start();
|
|
89
86
|
});
|
|
90
|
-
_defineProperty(
|
|
87
|
+
_defineProperty(_this, "fireEvent", function (eventCreator) {
|
|
91
88
|
var createAnalyticsEvent = _this.props.createAnalyticsEvent;
|
|
92
89
|
if (createAnalyticsEvent) {
|
|
93
90
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -96,11 +93,11 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
96
93
|
createAndFireEventInElementsChannel(eventCreator.apply(void 0, [_this.props, _this.state].concat(args)))(createAnalyticsEvent);
|
|
97
94
|
}
|
|
98
95
|
});
|
|
99
|
-
_defineProperty(
|
|
96
|
+
_defineProperty(_this, "filterOptions", function (users, query, propFilterOptions) {
|
|
100
97
|
return propFilterOptions ? propFilterOptions(users, query) : users;
|
|
101
98
|
});
|
|
102
|
-
_defineProperty(
|
|
103
|
-
_defineProperty(
|
|
99
|
+
_defineProperty(_this, "memoizedFilterOptions", memoizeOne(_this.filterOptions));
|
|
100
|
+
_defineProperty(_this, "getUsers", debounce( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
104
101
|
var _this$state, query, sessionId, closed, _this$props, baseUrl, childObjectId, containerId, fieldId, includeGroups, includeTeams, includeUsers, includeNonLicensedUsers, intl, maxOptions, objectId, onEmpty, onError, overrideByline, orgId, principalId, productAttributes, productKey, searchQueryFilter, siteId, maxNumberOfResults, startTime, recommendationsRequest, _yield$onEmpty, recommendedUsers, _iterator, _step, option, elapsedTimeMilli, displayedUsers, is5xxEvent, onErrorProducedError, defaultUsers, _elapsedTimeMilli;
|
|
105
102
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
106
103
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -268,7 +265,7 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
268
265
|
}
|
|
269
266
|
}, _callee, null, [[5, 32], [39, 53]]);
|
|
270
267
|
})), (_this$props$debounceT = _this.props.debounceTime) !== null && _this$props$debounceT !== void 0 ? _this$props$debounceT : 0));
|
|
271
|
-
_defineProperty(
|
|
268
|
+
_defineProperty(_this, "onInputChange", function (newQuery, sessionId) {
|
|
272
269
|
var query = newQuery || '';
|
|
273
270
|
var closed = _this.state.closed;
|
|
274
271
|
if (query === _this.state.query) {
|
|
@@ -290,7 +287,7 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
290
287
|
}
|
|
291
288
|
}
|
|
292
289
|
});
|
|
293
|
-
_defineProperty(
|
|
290
|
+
_defineProperty(_this, "filterUsers", function () {
|
|
294
291
|
var _this$state2 = _this.state,
|
|
295
292
|
loading = _this$state2.loading,
|
|
296
293
|
users = _this$state2.users,
|
|
@@ -320,7 +317,7 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
320
317
|
// when loading filter previous result.
|
|
321
318
|
return filteredUsers;
|
|
322
319
|
});
|
|
323
|
-
_defineProperty(
|
|
320
|
+
_defineProperty(_this, "onFocus", function (sessionId) {
|
|
324
321
|
var state = {
|
|
325
322
|
query: '',
|
|
326
323
|
closed: false
|
|
@@ -343,7 +340,7 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
343
340
|
_this.props.onFocus(sessionId);
|
|
344
341
|
}
|
|
345
342
|
});
|
|
346
|
-
_defineProperty(
|
|
343
|
+
_defineProperty(_this, "onBlur", function (sessionId) {
|
|
347
344
|
_this.getUsers.cancel();
|
|
348
345
|
_this.abortOptionsShownUfoExperience();
|
|
349
346
|
|
|
@@ -362,7 +359,8 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
362
359
|
_this.optionsShownUfoExperienceInstance = smartUserPickerOptionsShownUfoExperience.getInstance(props.inputId || props.fieldId);
|
|
363
360
|
return _this;
|
|
364
361
|
}
|
|
365
|
-
|
|
362
|
+
_inherits(SmartUserPickerWithoutAnalytics, _React$Component);
|
|
363
|
+
return _createClass(SmartUserPickerWithoutAnalytics, [{
|
|
366
364
|
key: "componentDidMount",
|
|
367
365
|
value: function () {
|
|
368
366
|
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
@@ -443,7 +441,6 @@ export var SmartUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
443
441
|
})));
|
|
444
442
|
}
|
|
445
443
|
}]);
|
|
446
|
-
return SmartUserPickerWithoutAnalytics;
|
|
447
444
|
}(React.Component);
|
|
448
445
|
|
|
449
446
|
// TODO: Smart User picker team will have to add a type annotation here
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
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
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { ExperiencePerformanceTypes, ExperienceTypes, ConcurrentExperience, UFOExperienceState } from '@atlaskit/ufo';
|
|
@@ -48,13 +48,12 @@ export var useUFOConcurrentExperience = function useUFOConcurrentExperience(expe
|
|
|
48
48
|
}, []);
|
|
49
49
|
};
|
|
50
50
|
export var UfoErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
51
|
-
_inherits(UfoErrorBoundary, _React$Component);
|
|
52
|
-
var _super = _createSuper(UfoErrorBoundary);
|
|
53
51
|
function UfoErrorBoundary() {
|
|
54
52
|
_classCallCheck(this, UfoErrorBoundary);
|
|
55
|
-
return
|
|
53
|
+
return _callSuper(this, UfoErrorBoundary, arguments);
|
|
56
54
|
}
|
|
57
|
-
|
|
55
|
+
_inherits(UfoErrorBoundary, _React$Component);
|
|
56
|
+
return _createClass(UfoErrorBoundary, [{
|
|
58
57
|
key: "componentDidCatch",
|
|
59
58
|
value: function componentDidCatch() {
|
|
60
59
|
smartUserPickerRenderedUfoExperience.getInstance(this.props.id).failure();
|
|
@@ -65,5 +64,4 @@ export var UfoErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
65
64
|
return this.props.children;
|
|
66
65
|
}
|
|
67
66
|
}]);
|
|
68
|
-
return UfoErrorBoundary;
|
|
69
67
|
}(React.Component);
|
|
@@ -10,7 +10,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
10
10
|
*
|
|
11
11
|
* @param locale string specifying the locale like 'en_GB', or 'fr'.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
var _getMessagesForLocale = /*#__PURE__*/function () {
|
|
14
14
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(locale) {
|
|
15
15
|
var fragments;
|
|
16
16
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -141,7 +141,7 @@ export var getMessagesForLocale = /*#__PURE__*/function () {
|
|
|
141
141
|
_context.next = 37;
|
|
142
142
|
break;
|
|
143
143
|
}
|
|
144
|
-
return _context.abrupt("return",
|
|
144
|
+
return _context.abrupt("return", _getMessagesForLocale(fragments[0]));
|
|
145
145
|
case 37:
|
|
146
146
|
return _context.abrupt("return", import( /* webpackChunkName: "@atlaskit-internal_user-picker-i18n-en" */'../i18n/en').then(function (mod) {
|
|
147
147
|
return mod.default;
|
|
@@ -155,4 +155,5 @@ export var getMessagesForLocale = /*#__PURE__*/function () {
|
|
|
155
155
|
return function getMessagesForLocale(_x) {
|
|
156
156
|
return _ref.apply(this, arguments);
|
|
157
157
|
};
|
|
158
|
-
}();
|
|
158
|
+
}();
|
|
159
|
+
export { _getMessagesForLocale as getMessagesForLocale };
|
|
@@ -3,11 +3,7 @@ import { type IntlShape } from 'react-intl-next';
|
|
|
3
3
|
export type MessagesIntlProviderProps = PropsWithChildren<{
|
|
4
4
|
intl: IntlShape;
|
|
5
5
|
}>;
|
|
6
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
|
|
7
|
-
|
|
8
|
-
}>> & {
|
|
9
|
-
WrappedComponent: React.ComponentType<{
|
|
10
|
-
intl: IntlShape;
|
|
11
|
-
}>;
|
|
6
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MessagesIntlProviderProps>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<MessagesIntlProviderProps>;
|
|
12
8
|
};
|
|
13
9
|
export default _default;
|
|
@@ -29,6 +29,6 @@ export declare class SmartUserPickerWithoutAnalytics extends React.Component<Pro
|
|
|
29
29
|
filterUsers: () => OptionData[];
|
|
30
30
|
onFocus: (sessionId?: string) => void;
|
|
31
31
|
onBlur: (sessionId?: string) => void;
|
|
32
|
-
render(): JSX.Element;
|
|
32
|
+
render(): React.JSX.Element;
|
|
33
33
|
}
|
|
34
34
|
export declare const SmartUserPicker: any;
|
|
@@ -3,11 +3,7 @@ import { type IntlShape } from 'react-intl-next';
|
|
|
3
3
|
export type MessagesIntlProviderProps = PropsWithChildren<{
|
|
4
4
|
intl: IntlShape;
|
|
5
5
|
}>;
|
|
6
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
|
|
7
|
-
|
|
8
|
-
}>> & {
|
|
9
|
-
WrappedComponent: React.ComponentType<{
|
|
10
|
-
intl: IntlShape;
|
|
11
|
-
}>;
|
|
6
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MessagesIntlProviderProps>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<MessagesIntlProviderProps>;
|
|
12
8
|
};
|
|
13
9
|
export default _default;
|
|
@@ -29,6 +29,6 @@ export declare class SmartUserPickerWithoutAnalytics extends React.Component<Pro
|
|
|
29
29
|
filterUsers: () => OptionData[];
|
|
30
30
|
onFocus: (sessionId?: string) => void;
|
|
31
31
|
onBlur: (sessionId?: string) => void;
|
|
32
|
-
render(): JSX.Element;
|
|
32
|
+
render(): React.JSX.Element;
|
|
33
33
|
}
|
|
34
34
|
export declare const SmartUserPicker: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-user-picker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"atlassian": {
|
|
30
30
|
"team": "Search Platform: Search Experience",
|
|
31
|
+
"runReact18": true,
|
|
31
32
|
"slack": {
|
|
32
33
|
"channel": "#search-plex-prs",
|
|
33
34
|
"notifications": {
|
|
@@ -38,9 +39,9 @@
|
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
|
-
"@atlaskit/analytics-next": "^10.
|
|
42
|
+
"@atlaskit/analytics-next": "^10.3.0",
|
|
42
43
|
"@atlaskit/ufo": "^0.3.0",
|
|
43
|
-
"@atlaskit/user-picker": "^10.
|
|
44
|
+
"@atlaskit/user-picker": "^10.31.0",
|
|
44
45
|
"@babel/runtime": "^7.0.0",
|
|
45
46
|
"lodash": "^4.17.21",
|
|
46
47
|
"memoize-one": "^6.0.0",
|
|
@@ -48,12 +49,15 @@
|
|
|
48
49
|
"uuid": "^3.1.0"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"react": "^16.8.0",
|
|
52
|
-
"react-dom": "^16.8.0"
|
|
52
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.2.0",
|
|
53
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.2.0"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"@atlaskit/select": "^18.
|
|
56
|
-
"@atlaskit/util-data-test": "^
|
|
56
|
+
"@atlaskit/select": "^18.10.0",
|
|
57
|
+
"@atlaskit/util-data-test": "^18.0.0",
|
|
58
|
+
"@testing-library/dom": "^10.1.0",
|
|
59
|
+
"@testing-library/react": "^13.4.0",
|
|
60
|
+
"@testing-library/user-event": "^14.4.3",
|
|
57
61
|
"enzyme": "^3.10.0",
|
|
58
62
|
"fetch-mock": "^8.0.0",
|
|
59
63
|
"graphql-tag": "^2.10.1",
|