@atlaskit/smart-hooks 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/services/use-user-recommendations/analytics.js +4 -4
- package/dist/cjs/services/use-user-recommendations/index.js +2 -2
- package/dist/cjs/services/use-user-recommendations/ufoExperiences.js +5 -4
- package/dist/cjs/utils/transform-recommendations-to-options/index.js +4 -4
- package/dist/es2019/services/use-user-recommendations/analytics.js +4 -3
- package/dist/es2019/services/use-user-recommendations/index.js +1 -1
- package/dist/es2019/services/use-user-recommendations/ufoExperiences.js +2 -1
- package/dist/es2019/utils/transform-recommendations-to-options/index.js +1 -1
- package/dist/esm/services/use-user-recommendations/analytics.js +4 -3
- package/dist/esm/services/use-user-recommendations/index.js +1 -1
- package/dist/esm/services/use-user-recommendations/ufoExperiences.js +2 -1
- package/dist/esm/utils/transform-recommendations-to-options/index.js +1 -1
- package/dist/types/services/use-user-recommendations/analytics.d.ts +3 -1
- package/dist/types/services/use-user-recommendations/ufoExperiences.d.ts +1 -1
- package/dist/types/utils/transform-recommendations-to-options/index.d.ts +1 -1
- package/package.json +11 -36
- package/report.api.md +0 -85
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/smart-hooks
|
|
2
2
|
|
|
3
|
+
## 2.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`0a39ae0f69a25`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0a39ae0f69a25) -
|
|
8
|
+
Update i18n NPM package versions for linking-platform,smart-experiences (Group 15)
|
|
9
|
+
|
|
10
|
+
## 2.3.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`bd2c5b0112185`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bd2c5b0112185) -
|
|
15
|
+
Remove stale API report artifacts from published Platform packages.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 2.2.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -7,11 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.fireUserSelectedEvent = exports.findUserPosition = exports.createDefaultAttributes = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _analyticsGasTypes = require("@atlaskit/analytics-gas-types");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var _types = require("@atlaskit/analytics-listeners/types");
|
|
11
|
+
var _createAndFireEvents = _interopRequireDefault(require("@atlaskit/analytics-next/createAndFireEvents"));
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
14
|
-
var createAndFireEventInElementsChannel = (0,
|
|
14
|
+
var createAndFireEventInElementsChannel = (0, _createAndFireEvents.default)(_types.FabricChannel.elements);
|
|
15
15
|
var createEvent = function createEvent(eventType, action, actionSubject) {
|
|
16
16
|
var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
17
17
|
return {
|
|
@@ -21,7 +21,7 @@ var createEvent = function createEvent(eventType, action, actionSubject) {
|
|
|
21
21
|
source: '@atlaskit/smart-hooks/use-user-recommendations',
|
|
22
22
|
attributes: _objectSpread({
|
|
23
23
|
packageName: "@atlaskit/smart-hooks",
|
|
24
|
-
packageVersion: "2.
|
|
24
|
+
packageVersion: "2.4.0"
|
|
25
25
|
}, attributes)
|
|
26
26
|
};
|
|
27
27
|
};
|
|
@@ -13,7 +13,7 @@ var _react = require("react");
|
|
|
13
13
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
14
14
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
15
15
|
var _uuid = require("uuid");
|
|
16
|
-
var
|
|
16
|
+
var _useAnalyticsEvents2 = require("@atlaskit/analytics-next/useAnalyticsEvents");
|
|
17
17
|
var _smartCommon = require("@atlaskit/smart-common");
|
|
18
18
|
var _useFunctionUsageTracking = _interopRequireDefault(require("../use-function-usage-tracking"));
|
|
19
19
|
var _analytics = require("./analytics");
|
|
@@ -73,7 +73,7 @@ var useUserRecommendations = function useUserRecommendations(props) {
|
|
|
73
73
|
var sessionId = (0, _react.useRef)('');
|
|
74
74
|
var currentQuery = (0, _react.useRef)('');
|
|
75
75
|
var lastAbortController = (0, _react.useRef)();
|
|
76
|
-
var _useAnalyticsEvents = (0,
|
|
76
|
+
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
77
77
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
78
78
|
var getAnalyticsAttributes = (0, _react.useCallback)(function () {
|
|
79
79
|
return _objectSpread({}, (0, _analytics.createDefaultAttributes)({
|
|
@@ -4,12 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.UsersFetchedUfoExperience = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _concurrentExperience = require("@atlaskit/ufo/concurrent-experience");
|
|
8
|
+
var _experienceTypes = require("@atlaskit/ufo/experience-types");
|
|
8
9
|
var COMPONENT_NAME = 'smart-hooks.use-user-recommendations';
|
|
9
|
-
var UsersFetchedUfoExperience = exports.UsersFetchedUfoExperience = new
|
|
10
|
+
var UsersFetchedUfoExperience = exports.UsersFetchedUfoExperience = new _concurrentExperience.ConcurrentExperience('users-fetched', {
|
|
10
11
|
platform: {
|
|
11
12
|
component: COMPONENT_NAME
|
|
12
13
|
},
|
|
13
|
-
type:
|
|
14
|
-
performanceType:
|
|
14
|
+
type: _experienceTypes.ExperienceTypes.Load,
|
|
15
|
+
performanceType: _experienceTypes.ExperiencePerformanceTypes.InlineResult
|
|
15
16
|
});
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _smartCommon = require("@atlaskit/smart-common");
|
|
8
|
-
var
|
|
8
|
+
var _types = require("@atlaskit/user-picker/types");
|
|
9
9
|
var _messages = require("../../messages");
|
|
10
10
|
var getLozenzeProperties = function getLozenzeProperties(entity, intl) {
|
|
11
11
|
var _entity$attributes, _entity$attributes2;
|
|
@@ -29,7 +29,7 @@ var transformRecommendation = function transformRecommendation(item, intl) {
|
|
|
29
29
|
var lozenge = getLozenzeProperties(user, intl);
|
|
30
30
|
return {
|
|
31
31
|
id: user.id,
|
|
32
|
-
type:
|
|
32
|
+
type: _types.UserType,
|
|
33
33
|
avatarUrl: user.avatarUrl,
|
|
34
34
|
name: user.name,
|
|
35
35
|
email: user.email,
|
|
@@ -40,7 +40,7 @@ var transformRecommendation = function transformRecommendation(item, intl) {
|
|
|
40
40
|
var team = item;
|
|
41
41
|
return {
|
|
42
42
|
id: team.id,
|
|
43
|
-
type:
|
|
43
|
+
type: _types.TeamType,
|
|
44
44
|
description: team.description || '',
|
|
45
45
|
name: team.displayName || '',
|
|
46
46
|
memberCount: team.memberCount,
|
|
@@ -53,7 +53,7 @@ var transformRecommendation = function transformRecommendation(item, intl) {
|
|
|
53
53
|
var _lozenge = getLozenzeProperties(group, intl);
|
|
54
54
|
return {
|
|
55
55
|
id: group.id,
|
|
56
|
-
type:
|
|
56
|
+
type: _types.GroupType,
|
|
57
57
|
name: group.name || '',
|
|
58
58
|
lozenge: _lozenge
|
|
59
59
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TRACK_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
|
|
2
|
-
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
2
|
+
import { FabricChannel } from '@atlaskit/analytics-listeners/types';
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import createAndFireEvent from '@atlaskit/analytics-next/createAndFireEvents';
|
|
5
6
|
const createAndFireEventInElementsChannel = createAndFireEvent(FabricChannel.elements);
|
|
6
7
|
const createEvent = (eventType, action, actionSubject, attributes = {}) => ({
|
|
7
8
|
eventType,
|
|
@@ -10,7 +11,7 @@ const createEvent = (eventType, action, actionSubject, attributes = {}) => ({
|
|
|
10
11
|
source: '@atlaskit/smart-hooks/use-user-recommendations',
|
|
11
12
|
attributes: {
|
|
12
13
|
packageName: "@atlaskit/smart-hooks",
|
|
13
|
-
packageVersion: "2.
|
|
14
|
+
packageVersion: "2.4.0",
|
|
14
15
|
...attributes
|
|
15
16
|
}
|
|
16
17
|
});
|
|
@@ -3,7 +3,7 @@ import debounce from 'lodash/debounce';
|
|
|
3
3
|
import memoizeOne from 'memoize-one';
|
|
4
4
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
5
5
|
import { v4 as uuid } from 'uuid';
|
|
6
|
-
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
7
7
|
import { EntityType, fetchUserRecommendations } from '@atlaskit/smart-common';
|
|
8
8
|
import useFunctionUsageTracking from '../use-function-usage-tracking';
|
|
9
9
|
import { createDefaultAttributes, findUserPosition, fireUserSelectedEvent } from './analytics';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ConcurrentExperience
|
|
1
|
+
import { ConcurrentExperience } from '@atlaskit/ufo/concurrent-experience';
|
|
2
|
+
import { ExperiencePerformanceTypes, ExperienceTypes } from '@atlaskit/ufo/experience-types';
|
|
2
3
|
const COMPONENT_NAME = 'smart-hooks.use-user-recommendations';
|
|
3
4
|
export const UsersFetchedUfoExperience = new ConcurrentExperience('users-fetched', {
|
|
4
5
|
platform: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EntityType } from '@atlaskit/smart-common';
|
|
2
|
-
import { GroupType, TeamType, UserType } from '@atlaskit/user-picker';
|
|
2
|
+
import { GroupType, TeamType, UserType } from '@atlaskit/user-picker/types';
|
|
3
3
|
import { messages } from '../../messages';
|
|
4
4
|
const getLozenzeProperties = (entity, intl) => {
|
|
5
5
|
var _entity$attributes, _entity$attributes2;
|
|
@@ -2,9 +2,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { TRACK_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
|
|
5
|
-
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
5
|
+
import { FabricChannel } from '@atlaskit/analytics-listeners/types';
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import createAndFireEvent from '@atlaskit/analytics-next/createAndFireEvents';
|
|
8
9
|
var createAndFireEventInElementsChannel = createAndFireEvent(FabricChannel.elements);
|
|
9
10
|
var createEvent = function createEvent(eventType, action, actionSubject) {
|
|
10
11
|
var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
@@ -15,7 +16,7 @@ var createEvent = function createEvent(eventType, action, actionSubject) {
|
|
|
15
16
|
source: '@atlaskit/smart-hooks/use-user-recommendations',
|
|
16
17
|
attributes: _objectSpread({
|
|
17
18
|
packageName: "@atlaskit/smart-hooks",
|
|
18
|
-
packageVersion: "2.
|
|
19
|
+
packageVersion: "2.4.0"
|
|
19
20
|
}, attributes)
|
|
20
21
|
};
|
|
21
22
|
};
|
|
@@ -9,7 +9,7 @@ import debounce from 'lodash/debounce';
|
|
|
9
9
|
import memoizeOne from 'memoize-one';
|
|
10
10
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
11
11
|
import { v4 as uuid } from 'uuid';
|
|
12
|
-
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
13
13
|
import { EntityType, fetchUserRecommendations } from '@atlaskit/smart-common';
|
|
14
14
|
import useFunctionUsageTracking from '../use-function-usage-tracking';
|
|
15
15
|
import { createDefaultAttributes, findUserPosition, fireUserSelectedEvent } from './analytics';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ConcurrentExperience
|
|
1
|
+
import { ConcurrentExperience } from '@atlaskit/ufo/concurrent-experience';
|
|
2
|
+
import { ExperiencePerformanceTypes, ExperienceTypes } from '@atlaskit/ufo/experience-types';
|
|
2
3
|
var COMPONENT_NAME = 'smart-hooks.use-user-recommendations';
|
|
3
4
|
export var UsersFetchedUfoExperience = new ConcurrentExperience('users-fetched', {
|
|
4
5
|
platform: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EntityType } from '@atlaskit/smart-common';
|
|
2
|
-
import { GroupType, TeamType, UserType } from '@atlaskit/user-picker';
|
|
2
|
+
import { GroupType, TeamType, UserType } from '@atlaskit/user-picker/types';
|
|
3
3
|
import { messages } from '../../messages';
|
|
4
4
|
var getLozenzeProperties = function getLozenzeProperties(entity, intl) {
|
|
5
5
|
var _entity$attributes, _entity$attributes2;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AnalyticsEventPayload } from '@atlaskit/analytics-next/AnalyticsEvent';
|
|
2
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
3
|
+
import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
2
4
|
import { type UserSearchItem } from '@atlaskit/smart-common';
|
|
3
5
|
import { type UseUserRecommendationsProps } from '../../types';
|
|
4
6
|
export declare const findUserPosition: (loadedUsers: UserSearchItem[], userId: string) => number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ConcurrentExperience } from '@atlaskit/ufo';
|
|
1
|
+
import { ConcurrentExperience } from '@atlaskit/ufo/concurrent-experience';
|
|
2
2
|
export declare const UsersFetchedUfoExperience: ConcurrentExperience;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IntlShape } from 'react-intl';
|
|
2
2
|
import { type UserSearchItem } from '@atlaskit/smart-common';
|
|
3
|
-
import { type OptionData } from '@atlaskit/user-picker';
|
|
3
|
+
import { type OptionData } from '@atlaskit/user-picker/types';
|
|
4
4
|
export default _default;
|
|
5
5
|
declare function _default(recommendations: UserSearchItem[], intl: IntlShape): OptionData[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-hooks",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"team": "Search Platform: Search Experience"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@atlaskit/afm-i18n-platform-smart-experiences-smart-hooks": "2.
|
|
21
|
-
"@atlaskit/analytics-gas-types": "^6.
|
|
22
|
-
"@atlaskit/analytics-listeners": "^11.
|
|
23
|
-
"@atlaskit/analytics-next": "^12.
|
|
24
|
-
"@atlaskit/smart-common": "^3.
|
|
25
|
-
"@atlaskit/ufo": "^1.
|
|
26
|
-
"@atlaskit/user-picker": "^13.
|
|
20
|
+
"@atlaskit/afm-i18n-platform-smart-experiences-smart-hooks": "2.238.0",
|
|
21
|
+
"@atlaskit/analytics-gas-types": "^6.2.0",
|
|
22
|
+
"@atlaskit/analytics-listeners": "^11.3.0",
|
|
23
|
+
"@atlaskit/analytics-next": "^12.5.0",
|
|
24
|
+
"@atlaskit/smart-common": "^3.1.0",
|
|
25
|
+
"@atlaskit/ufo": "^1.2.0",
|
|
26
|
+
"@atlaskit/user-picker": "^13.12.0",
|
|
27
27
|
"@babel/runtime": "^7.0.0",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
29
29
|
"memoize-one": "^6.0.0",
|
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@
|
|
37
|
+
"@atlaskit/textfield": "^10.2.0",
|
|
38
|
+
"@atlassian/a11y-jest-testing": "^0.17.0",
|
|
39
|
+
"@atlassian/ufo": "^0.10.0",
|
|
38
40
|
"@testing-library/react": "^16.3.0",
|
|
39
41
|
"@welldone-software/why-did-you-render": "^6.2.0",
|
|
40
42
|
"enzyme": "^3.10.0",
|
|
@@ -43,32 +45,5 @@
|
|
|
43
45
|
"react-dom": "^18.2.0",
|
|
44
46
|
"react-intl": "^7.0.0",
|
|
45
47
|
"wait-for-expect": "^1.2.0"
|
|
46
|
-
},
|
|
47
|
-
"techstack": {
|
|
48
|
-
"@atlassian/frontend": {
|
|
49
|
-
"import-structure": [
|
|
50
|
-
"atlassian-conventions"
|
|
51
|
-
],
|
|
52
|
-
"circular-dependencies": [
|
|
53
|
-
"file-and-folder-level"
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
"@repo/internal": {
|
|
57
|
-
"analytics": [
|
|
58
|
-
"analytics-next"
|
|
59
|
-
],
|
|
60
|
-
"design-tokens": [
|
|
61
|
-
"color"
|
|
62
|
-
],
|
|
63
|
-
"theming": [
|
|
64
|
-
"react-context"
|
|
65
|
-
],
|
|
66
|
-
"ui-components": [
|
|
67
|
-
"lite-mode"
|
|
68
|
-
],
|
|
69
|
-
"deprecation": [
|
|
70
|
-
"no-deprecated-imports"
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
48
|
}
|
|
74
49
|
}
|
package/report.api.md
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<!-- API Report Version: 2.3 -->
|
|
2
|
-
|
|
3
|
-
## API Report File for "@atlaskit/smart-hooks"
|
|
4
|
-
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
6
|
-
> [API Extractor](https://api-extractor.com/).
|
|
7
|
-
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
8
|
-
|
|
9
|
-
### Table of contents
|
|
10
|
-
|
|
11
|
-
- [Main Entry Types](#main-entry-types)
|
|
12
|
-
- [Peer Dependencies](#peer-dependencies)
|
|
13
|
-
|
|
14
|
-
### Main Entry Types
|
|
15
|
-
|
|
16
|
-
<!--SECTION START: Main Entry Types-->
|
|
17
|
-
|
|
18
|
-
```ts
|
|
19
|
-
import { EntityType } from '@atlaskit/smart-common';
|
|
20
|
-
import { IntlShape } from 'react-intl';
|
|
21
|
-
import { MemoizedFn } from 'memoize-one';
|
|
22
|
-
import { OptionData } from '@atlaskit/user-picker';
|
|
23
|
-
import { UserSearchItem } from '@atlaskit/smart-common';
|
|
24
|
-
import type { UserSearchProductAttributes } from '@atlaskit/smart-common';
|
|
25
|
-
import type { UserSearchQuery } from '@atlaskit/smart-common';
|
|
26
|
-
|
|
27
|
-
// @public (undocumented)
|
|
28
|
-
export const transformRecommendationsToOptions: (
|
|
29
|
-
recommendations: UserSearchItem[],
|
|
30
|
-
intl: IntlShape,
|
|
31
|
-
) => OptionData[];
|
|
32
|
-
|
|
33
|
-
// @public (undocumented)
|
|
34
|
-
export const useUserRecommendations: (props: UseUserRecommendationsProps) => {
|
|
35
|
-
recommendations:
|
|
36
|
-
| UserSearchItem[]
|
|
37
|
-
| {
|
|
38
|
-
id: string;
|
|
39
|
-
name: string;
|
|
40
|
-
entityType: EntityType;
|
|
41
|
-
avatarUrl: string;
|
|
42
|
-
}[];
|
|
43
|
-
triggerSearchFactory: MemoizedFn<() => (query?: string) => void>;
|
|
44
|
-
selectUserFactory: MemoizedFn<() => (userId: string) => void>;
|
|
45
|
-
isLoading: boolean;
|
|
46
|
-
error: any;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
// @public (undocumented)
|
|
50
|
-
type UseUserRecommendationsProps = {
|
|
51
|
-
baseUrl?: string;
|
|
52
|
-
childObjectId?: string;
|
|
53
|
-
containerId?: string;
|
|
54
|
-
debounceTimeMs?: number;
|
|
55
|
-
fieldId: string;
|
|
56
|
-
includeUsers?: boolean;
|
|
57
|
-
includeGroups?: boolean;
|
|
58
|
-
includeTeams?: boolean;
|
|
59
|
-
maxNumberOfResults?: number;
|
|
60
|
-
objectId?: string;
|
|
61
|
-
preload?: boolean;
|
|
62
|
-
principalId?: string;
|
|
63
|
-
productAttributes?: UserSearchProductAttributes;
|
|
64
|
-
productKey: string;
|
|
65
|
-
cpusSearchQuery?: UserSearchQuery;
|
|
66
|
-
tenantId: string;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// (No @packageDocumentation comment for this package)
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
<!--SECTION END: Main Entry Types-->
|
|
73
|
-
|
|
74
|
-
### Peer Dependencies
|
|
75
|
-
|
|
76
|
-
<!--SECTION START: Peer Dependencies-->
|
|
77
|
-
|
|
78
|
-
```json
|
|
79
|
-
{
|
|
80
|
-
"react": "^16.8.0",
|
|
81
|
-
"react-intl": "npm:react-intl@^5.18.1"
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
<!--SECTION END: Peer Dependencies-->
|