@atlaskit/smart-user-picker 11.5.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 +7 -0
- package/dist/cjs/UfoErrorBoundary.js +34 -0
- package/dist/cjs/analytics.js +1 -1
- 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/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/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 +2 -2
- package/smart-user-picker.docs.tsx +0 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
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
|
+
|
|
3
10
|
## 11.5.0
|
|
4
11
|
|
|
5
12
|
### 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
|
|
@@ -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(),
|
|
@@ -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
|
|
@@ -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.5.
|
|
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",
|
|
@@ -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;
|