@atlaskit/smart-hooks 1.2.0 → 2.1.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 +33 -0
- package/compass.yml +38 -0
- package/dist/cjs/services/use-user-recommendations/analytics.js +1 -1
- package/dist/es2019/services/use-user-recommendations/analytics.js +1 -1
- package/dist/esm/services/use-user-recommendations/analytics.js +1 -1
- package/package.json +10 -18
- package/transform-recommendations-to-options/package.json +1 -8
- package/use-user-recommendations/package.json +1 -8
- package/dist/types-ts4.5/entry-points/transform-recommendations-to-options.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/use-user-recommendations.d.ts +0 -1
- package/dist/types-ts4.5/i18n/cs.d.ts +0 -8
- package/dist/types-ts4.5/i18n/da.d.ts +0 -8
- package/dist/types-ts4.5/i18n/de.d.ts +0 -8
- package/dist/types-ts4.5/i18n/en.d.ts +0 -8
- package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -8
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -8
- package/dist/types-ts4.5/i18n/es.d.ts +0 -8
- package/dist/types-ts4.5/i18n/et.d.ts +0 -8
- package/dist/types-ts4.5/i18n/fi.d.ts +0 -8
- package/dist/types-ts4.5/i18n/fr.d.ts +0 -8
- package/dist/types-ts4.5/i18n/hu.d.ts +0 -8
- package/dist/types-ts4.5/i18n/index.d.ts +0 -36
- package/dist/types-ts4.5/i18n/is.d.ts +0 -7
- package/dist/types-ts4.5/i18n/it.d.ts +0 -8
- package/dist/types-ts4.5/i18n/ja.d.ts +0 -8
- package/dist/types-ts4.5/i18n/ko.d.ts +0 -8
- package/dist/types-ts4.5/i18n/languages.d.ts +0 -27
- package/dist/types-ts4.5/i18n/nb.d.ts +0 -8
- package/dist/types-ts4.5/i18n/nl.d.ts +0 -8
- package/dist/types-ts4.5/i18n/pl.d.ts +0 -8
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -8
- package/dist/types-ts4.5/i18n/pt_PT.d.ts +0 -8
- package/dist/types-ts4.5/i18n/ro.d.ts +0 -7
- package/dist/types-ts4.5/i18n/ru.d.ts +0 -8
- package/dist/types-ts4.5/i18n/sk.d.ts +0 -8
- package/dist/types-ts4.5/i18n/sv.d.ts +0 -8
- package/dist/types-ts4.5/i18n/th.d.ts +0 -8
- package/dist/types-ts4.5/i18n/tr.d.ts +0 -8
- package/dist/types-ts4.5/i18n/uk.d.ts +0 -8
- package/dist/types-ts4.5/i18n/vi.d.ts +0 -8
- package/dist/types-ts4.5/i18n/zh.d.ts +0 -8
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -8
- package/dist/types-ts4.5/index.d.ts +0 -3
- package/dist/types-ts4.5/messages.d.ts +0 -47
- package/dist/types-ts4.5/services/use-function-usage-tracking/index.d.ts +0 -6
- package/dist/types-ts4.5/services/use-user-recommendations/analytics.d.ts +0 -20
- package/dist/types-ts4.5/services/use-user-recommendations/index.d.ts +0 -22
- package/dist/types-ts4.5/services/use-user-recommendations/ufoExperiences.d.ts +0 -2
- package/dist/types-ts4.5/types.d.ts +0 -91
- package/dist/types-ts4.5/utils/transform-recommendations-to-options/index.d.ts +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @atlaskit/smart-hooks
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`7f2eb99bad9b3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f2eb99bad9b3) -
|
|
8
|
+
Update i18n NPM package versions for linking-platform,smart-experiences (Group 15)
|
|
9
|
+
|
|
10
|
+
## 2.0.0
|
|
11
|
+
|
|
12
|
+
### Major Changes
|
|
13
|
+
|
|
14
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
15
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
16
|
+
|
|
17
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
18
|
+
|
|
19
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
20
|
+
|
|
21
|
+
```diff
|
|
22
|
+
- "typesVersions": {
|
|
23
|
+
- ">=4.5 <4.9": {
|
|
24
|
+
- "*": [
|
|
25
|
+
- "dist/types-ts4.5/*",
|
|
26
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
27
|
+
- ]
|
|
28
|
+
- }
|
|
29
|
+
- },
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
|
|
3
36
|
## 1.2.0
|
|
4
37
|
|
|
5
38
|
### Minor Changes
|
package/compass.yml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
configVersion: 1
|
|
2
|
+
id: ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/b1173e00-f1c9-458d-82d8-19f3d47676e7
|
|
3
|
+
name: '@atlaskit/smart-hooks'
|
|
4
|
+
ownerId: ari:cloud:identity::team/8c518cea-39e4-4a9e-976b-2eec1db07eb2 # Search PlEx
|
|
5
|
+
labels:
|
|
6
|
+
- platform-code
|
|
7
|
+
- platform-afm
|
|
8
|
+
typeId: OTHER
|
|
9
|
+
fields:
|
|
10
|
+
tier: 4
|
|
11
|
+
lifecycle: Active
|
|
12
|
+
isMonorepoProject: true
|
|
13
|
+
links:
|
|
14
|
+
- name: Root Repository
|
|
15
|
+
type: REPOSITORY
|
|
16
|
+
url: https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master
|
|
17
|
+
- name: Slack Channel
|
|
18
|
+
type: CHAT_CHANNEL
|
|
19
|
+
url: https://atlassian.enterprise.slack.com/archives/CFG8QANL9 # #help-search-plex
|
|
20
|
+
- name: Smart Hooks
|
|
21
|
+
type: REPOSITORY
|
|
22
|
+
url: https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/smart-experiences/smart-hooks
|
|
23
|
+
customFields:
|
|
24
|
+
- name: Department
|
|
25
|
+
type: text
|
|
26
|
+
value: Eng - Search PLEX
|
|
27
|
+
- name: Technical Owner
|
|
28
|
+
type: user
|
|
29
|
+
value: ari:cloud:identity::user/712020:bc050a72-a59d-487f-8b54-73358ba67dd0 # David Lyon
|
|
30
|
+
- name: Required Reviewers Opt In
|
|
31
|
+
type: boolean
|
|
32
|
+
value: true
|
|
33
|
+
- name: Reviewer Selection Mechanism
|
|
34
|
+
type: text
|
|
35
|
+
value: random(2)
|
|
36
|
+
- name: Required Reviewer Approvals
|
|
37
|
+
type: number
|
|
38
|
+
value: 1
|
|
@@ -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: "
|
|
24
|
+
packageVersion: "2.0.0"
|
|
25
25
|
}, attributes)
|
|
26
26
|
};
|
|
27
27
|
};
|
|
@@ -10,7 +10,7 @@ const createEvent = (eventType, action, actionSubject, attributes = {}) => ({
|
|
|
10
10
|
source: '@atlaskit/smart-hooks/use-user-recommendations',
|
|
11
11
|
attributes: {
|
|
12
12
|
packageName: "@atlaskit/smart-hooks",
|
|
13
|
-
packageVersion: "
|
|
13
|
+
packageVersion: "2.0.0",
|
|
14
14
|
...attributes
|
|
15
15
|
}
|
|
16
16
|
});
|
|
@@ -15,7 +15,7 @@ var createEvent = function createEvent(eventType, action, actionSubject) {
|
|
|
15
15
|
source: '@atlaskit/smart-hooks/use-user-recommendations',
|
|
16
16
|
attributes: _objectSpread({
|
|
17
17
|
packageName: "@atlaskit/smart-hooks",
|
|
18
|
-
packageVersion: "
|
|
18
|
+
packageVersion: "2.0.0"
|
|
19
19
|
}, attributes)
|
|
20
20
|
};
|
|
21
21
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-hooks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -11,27 +11,19 @@
|
|
|
11
11
|
"module": "dist/esm/index.js",
|
|
12
12
|
"module:es2019": "dist/es2019/index.js",
|
|
13
13
|
"types": "dist/types/index.d.ts",
|
|
14
|
-
"typesVersions": {
|
|
15
|
-
">=4.5 <4.9": {
|
|
16
|
-
"*": [
|
|
17
|
-
"dist/types-ts4.5/*",
|
|
18
|
-
"dist/types-ts4.5/index.d.ts"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
14
|
"sideEffects": false,
|
|
23
15
|
"atlaskit:src": "src/index.ts",
|
|
24
16
|
"atlassian": {
|
|
25
17
|
"team": "Search Platform: Search Experience"
|
|
26
18
|
},
|
|
27
19
|
"dependencies": {
|
|
28
|
-
"@atlaskit/afm-i18n-platform-smart-experiences-smart-hooks": "2.
|
|
29
|
-
"@atlaskit/analytics-gas-types": "^
|
|
30
|
-
"@atlaskit/analytics-listeners": "^
|
|
31
|
-
"@atlaskit/analytics-next": "^
|
|
32
|
-
"@atlaskit/smart-common": "^
|
|
33
|
-
"@atlaskit/ufo": "^0.
|
|
34
|
-
"@atlaskit/user-picker": "^
|
|
20
|
+
"@atlaskit/afm-i18n-platform-smart-experiences-smart-hooks": "2.7.0",
|
|
21
|
+
"@atlaskit/analytics-gas-types": "^6.0.0",
|
|
22
|
+
"@atlaskit/analytics-listeners": "^11.1.0",
|
|
23
|
+
"@atlaskit/analytics-next": "^12.3.0",
|
|
24
|
+
"@atlaskit/smart-common": "^3.0.0",
|
|
25
|
+
"@atlaskit/ufo": "^1.0.0",
|
|
26
|
+
"@atlaskit/user-picker": "^13.7.0",
|
|
35
27
|
"@babel/runtime": "^7.0.0",
|
|
36
28
|
"lodash": "^4.17.21",
|
|
37
29
|
"memoize-one": "^6.0.0",
|
|
@@ -42,14 +34,14 @@
|
|
|
42
34
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
43
35
|
},
|
|
44
36
|
"devDependencies": {
|
|
45
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
37
|
+
"@atlassian/a11y-jest-testing": "^0.13.0",
|
|
46
38
|
"@testing-library/react": "^16.3.0",
|
|
47
39
|
"@welldone-software/why-did-you-render": "^6.2.0",
|
|
48
40
|
"enzyme": "^3.10.0",
|
|
49
41
|
"fetch-mock": "^8.0.0",
|
|
50
42
|
"react": "^18.2.0",
|
|
51
43
|
"react-dom": "^18.2.0",
|
|
52
|
-
"react-intl": "^
|
|
44
|
+
"react-intl": "^7.0.0",
|
|
53
45
|
"wait-for-expect": "^1.2.0"
|
|
54
46
|
},
|
|
55
47
|
"techstack": {
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/transform-recommendations-to-options.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/transform-recommendations-to-options.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/transform-recommendations-to-options.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/transform-recommendations-to-options.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/transform-recommendations-to-options.d.ts"
|
|
15
8
|
}
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/use-user-recommendations.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/use-user-recommendations.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/use-user-recommendations.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/use-user-recommendations.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/use-user-recommendations.d.ts"
|
|
15
8
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as transformRecommendationsToOptions } from '../utils/transform-recommendations-to-options/index';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useUserRecommendations } from '../services/use-user-recommendations/index';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE:
|
|
3
|
-
*
|
|
4
|
-
* This file is automatically generated by Traduki 2.0.
|
|
5
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
-
*/
|
|
7
|
-
import translations from '@atlaskit/afm-i18n-platform-smart-experiences-smart-hooks/i18n/en_GB';
|
|
8
|
-
export default translations;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE:
|
|
3
|
-
*
|
|
4
|
-
* This file is automatically generated by Traduki 2.0.
|
|
5
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
-
*/
|
|
7
|
-
import translations from '@atlaskit/afm-i18n-platform-smart-experiences-smart-hooks/i18n/en_ZZ';
|
|
8
|
-
export default translations;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE:
|
|
3
|
-
*
|
|
4
|
-
* This file is automatically generated by i18n-tools.
|
|
5
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
-
*/
|
|
7
|
-
export { default as zh } from './zh';
|
|
8
|
-
export { default as zh_TW } from './zh_TW';
|
|
9
|
-
export { default as cs } from './cs';
|
|
10
|
-
export { default as da } from './da';
|
|
11
|
-
export { default as nl } from './nl';
|
|
12
|
-
export { default as et } from './et';
|
|
13
|
-
export { default as fi } from './fi';
|
|
14
|
-
export { default as fr } from './fr';
|
|
15
|
-
export { default as de } from './de';
|
|
16
|
-
export { default as hu } from './hu';
|
|
17
|
-
export { default as it } from './it';
|
|
18
|
-
export { default as ja } from './ja';
|
|
19
|
-
export { default as ko } from './ko';
|
|
20
|
-
export { default as nb } from './nb';
|
|
21
|
-
export { default as pl } from './pl';
|
|
22
|
-
export { default as pt_BR } from './pt_BR';
|
|
23
|
-
export { default as pt_PT } from './pt_PT';
|
|
24
|
-
export { default as ru } from './ru';
|
|
25
|
-
export { default as sk } from './sk';
|
|
26
|
-
export { default as es } from './es';
|
|
27
|
-
export { default as sv } from './sv';
|
|
28
|
-
export { default as th } from './th';
|
|
29
|
-
export { default as tr } from './tr';
|
|
30
|
-
export { default as uk } from './uk';
|
|
31
|
-
export { default as vi } from './vi';
|
|
32
|
-
export { default as en_ZZ } from './en_ZZ';
|
|
33
|
-
export { default as en } from './en';
|
|
34
|
-
export { default as en_GB } from './en_GB';
|
|
35
|
-
export { default as is } from './is';
|
|
36
|
-
export { default as ro } from './ro';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'smart-experiences.smart-hooks.placeholder': string;
|
|
3
|
-
'smart-experiences.smart-hooks.placeholder.add-more': string;
|
|
4
|
-
'smart-experiences.smart-hooks.multi.remove-item': string;
|
|
5
|
-
'smart-experiences.smart-hooks.single.clear': string;
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
zh: string;
|
|
3
|
-
cs: string;
|
|
4
|
-
da: string;
|
|
5
|
-
nl: string;
|
|
6
|
-
en: string;
|
|
7
|
-
en_GB: string;
|
|
8
|
-
et: string;
|
|
9
|
-
fi: string;
|
|
10
|
-
fr: string;
|
|
11
|
-
de: string;
|
|
12
|
-
hu: string;
|
|
13
|
-
is: string;
|
|
14
|
-
it: string;
|
|
15
|
-
ja: string;
|
|
16
|
-
ko: string;
|
|
17
|
-
nb: string;
|
|
18
|
-
pl: string;
|
|
19
|
-
pt_BR: string;
|
|
20
|
-
pt_PT: string;
|
|
21
|
-
ro: string;
|
|
22
|
-
ru: string;
|
|
23
|
-
sk: string;
|
|
24
|
-
es: string;
|
|
25
|
-
sv: string;
|
|
26
|
-
};
|
|
27
|
-
export default _default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE:
|
|
3
|
-
*
|
|
4
|
-
* This file is automatically generated by Traduki 2.0.
|
|
5
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
-
*/
|
|
7
|
-
import translations from '@atlaskit/afm-i18n-platform-smart-experiences-smart-hooks/i18n/pt_BR';
|
|
8
|
-
export default translations;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'smart-experiences.smart-hooks.placeholder': string;
|
|
3
|
-
'smart-experiences.smart-hooks.placeholder.add-more': string;
|
|
4
|
-
'smart-experiences.smart-hooks.multi.remove-item': string;
|
|
5
|
-
'smart-experiences.smart-hooks.single.clear': string;
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NOTE:
|
|
3
|
-
*
|
|
4
|
-
* This file is automatically generated by Traduki 2.0.
|
|
5
|
-
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
-
*/
|
|
7
|
-
import translations from '@atlaskit/afm-i18n-platform-smart-experiences-smart-hooks/i18n/zh_TW';
|
|
8
|
-
export default translations;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export declare const messages: {
|
|
2
|
-
externalUserSourcesHeading: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
slackProvider: {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
googleProvider: {
|
|
13
|
-
id: string;
|
|
14
|
-
defaultMessage: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
microsoftProvider: {
|
|
18
|
-
id: string;
|
|
19
|
-
defaultMessage: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
gitHubProvider: {
|
|
23
|
-
id: string;
|
|
24
|
-
defaultMessage: string;
|
|
25
|
-
description: string;
|
|
26
|
-
};
|
|
27
|
-
memberLozengeText: {
|
|
28
|
-
id: string;
|
|
29
|
-
defaultMessage: string;
|
|
30
|
-
description: string;
|
|
31
|
-
};
|
|
32
|
-
guestLozengeText: {
|
|
33
|
-
id: string;
|
|
34
|
-
defaultMessage: string;
|
|
35
|
-
description: string;
|
|
36
|
-
};
|
|
37
|
-
guestUserLozengeTooltip: {
|
|
38
|
-
id: string;
|
|
39
|
-
defaultMessage: string;
|
|
40
|
-
description: string;
|
|
41
|
-
};
|
|
42
|
-
guestGroupLozengeTooltip: {
|
|
43
|
-
id: string;
|
|
44
|
-
defaultMessage: string;
|
|
45
|
-
description: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type MemoizedFn } from 'memoize-one';
|
|
2
|
-
declare function useFunctionUsageTracking<InputFunctionType extends (...any: any) => any>(trackedFunction: InputFunctionType): {
|
|
3
|
-
isUsed: boolean;
|
|
4
|
-
trackingFunction: MemoizedFn<() => InputFunctionType>;
|
|
5
|
-
};
|
|
6
|
-
export default useFunctionUsageTracking;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type AnalyticsEventPayload, type CreateUIAnalyticsEvent, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import { type UserSearchItem } from '@atlaskit/smart-common';
|
|
3
|
-
import { type UseUserRecommendationsProps } from '../../types';
|
|
4
|
-
export declare const findUserPosition: (loadedUsers: UserSearchItem[], userId: string) => number;
|
|
5
|
-
export declare const createDefaultAttributes: (props: UseUserRecommendationsProps, renderId: string, sessionId: string, query: string) => {
|
|
6
|
-
context: string;
|
|
7
|
-
childObjectId: string | undefined;
|
|
8
|
-
containerId: string | undefined;
|
|
9
|
-
includeTeams: boolean | undefined;
|
|
10
|
-
maxNumberOfResults: number | undefined;
|
|
11
|
-
objectId: string | undefined;
|
|
12
|
-
preload: boolean | undefined;
|
|
13
|
-
principalId: string | undefined;
|
|
14
|
-
productKey: string;
|
|
15
|
-
queryLength: number;
|
|
16
|
-
renderId: string;
|
|
17
|
-
sessionId: string;
|
|
18
|
-
tenantId: string;
|
|
19
|
-
};
|
|
20
|
-
export declare const fireUserSelectedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, payloadAttributes: AnalyticsEventPayload) => UIAnalyticsEvent;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type MemoizedFn } from 'memoize-one';
|
|
2
|
-
import { EntityType, type UserSearchItem } from '@atlaskit/smart-common';
|
|
3
|
-
import type { UseUserRecommendationsProps } from '../../types';
|
|
4
|
-
export declare const instrumentFailureOption: {
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
entityType: EntityType;
|
|
8
|
-
avatarUrl: string;
|
|
9
|
-
}[];
|
|
10
|
-
declare const useUserRecommendations: (props: UseUserRecommendationsProps) => {
|
|
11
|
-
recommendations: {
|
|
12
|
-
id: string;
|
|
13
|
-
name: string;
|
|
14
|
-
entityType: EntityType;
|
|
15
|
-
avatarUrl: string;
|
|
16
|
-
}[] | UserSearchItem[];
|
|
17
|
-
triggerSearchFactory: MemoizedFn<() => (query?: string) => void>;
|
|
18
|
-
selectUserFactory: MemoizedFn<() => (userId: string) => void>;
|
|
19
|
-
isLoading: boolean;
|
|
20
|
-
error: any;
|
|
21
|
-
};
|
|
22
|
-
export default useUserRecommendations;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { UserSearchProductAttributes, UserSearchQuery } from '@atlaskit/smart-common';
|
|
2
|
-
export type UseUserRecommendationsProps = {
|
|
3
|
-
/**
|
|
4
|
-
* Base url override for downstream APIs.
|
|
5
|
-
* Note: there is a trend for browsers blocking cookies for cross-site resources.
|
|
6
|
-
* This prop is added for legacy reasons and will likely be removed in the future.
|
|
7
|
-
* https://webkit.org/blog/10218/full-third-party-cookie-blocking-and-more/
|
|
8
|
-
*/
|
|
9
|
-
baseUrl?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Context information for analytics. Eg: if the hook was consumed inside a ticket's comment, the childObjectId would be
|
|
12
|
-
* the ID of the comment and the ticket would be the objectId. Optional, but please provide if available.
|
|
13
|
-
*/
|
|
14
|
-
childObjectId?: string;
|
|
15
|
-
/**
|
|
16
|
-
* The container Id to identify context. e.g. Jira: projectId. Confluence: spaceId. Bitbucket: repositoryId.
|
|
17
|
-
*/
|
|
18
|
-
containerId?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Time to debounce the suggestions fetching (in milliseconds). Defaults to 150ms.
|
|
21
|
-
*/
|
|
22
|
-
debounceTimeMs?: number;
|
|
23
|
-
/**
|
|
24
|
-
* Identifier for informing the server on what experience the hook is powering.
|
|
25
|
-
* The server uses the fieldId to determine which model to utilize when
|
|
26
|
-
* generating suggestions.
|
|
27
|
-
* All fieldId's will be bucketed into a model that provides generic smart results,
|
|
28
|
-
* except "assignee", "mentions" which are specifically trained for Jira Assignee and
|
|
29
|
-
* @Mentions. For specifically trained models, please contact #help-search-plex.
|
|
30
|
-
*/
|
|
31
|
-
fieldId: string;
|
|
32
|
-
/**
|
|
33
|
-
* Whether to include users in the result set (@default: true).
|
|
34
|
-
*/
|
|
35
|
-
includeUsers?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Whether to include groups in the resultset (@default: false).
|
|
38
|
-
*/
|
|
39
|
-
includeGroups?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Whether to include teams in the resultset (@default: false).
|
|
42
|
-
*/
|
|
43
|
-
includeTeams?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* (@default: 25)
|
|
46
|
-
*/
|
|
47
|
-
maxNumberOfResults?: number;
|
|
48
|
-
/**
|
|
49
|
-
* An identifier of the closest context object, e.g. issueId, pageId, pullRequestId.
|
|
50
|
-
* Used for analytics. Optional, but please include if available.
|
|
51
|
-
*/
|
|
52
|
-
objectId?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Preload the list of suggested users with an empty-query ('') search as soon as
|
|
55
|
-
* the hook is used.
|
|
56
|
-
* WARNING: please consider carefully before deciding to preload your suggestions
|
|
57
|
-
* as this will increase the load on the recommendations services (has caused HOTs).
|
|
58
|
-
* Please give #help-search-plex a ballpark on the expected request volume.
|
|
59
|
-
* (@default: false)
|
|
60
|
-
*/
|
|
61
|
-
preload?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* AAID of the user interacting with the component.
|
|
64
|
-
* If not provided, server will extract principalId from the context header, assuming that the user is logged in
|
|
65
|
-
* when making the request. (@default: “context”)
|
|
66
|
-
*/
|
|
67
|
-
principalId?: string;
|
|
68
|
-
/**
|
|
69
|
-
* Product-specific Attributes - you should pass in the attribute type that matches your current SupportedProduct.
|
|
70
|
-
* Currently we support additional attributes (BitbucketAttributes) for bitbucket and (ConfluenceAttributes) for Confluence.
|
|
71
|
-
*/
|
|
72
|
-
productAttributes?: UserSearchProductAttributes;
|
|
73
|
-
/**
|
|
74
|
-
* Product identifier. If you are an NPF, please ensure your product has been onboarded with
|
|
75
|
-
* Cross-product user-search @see https://developer.atlassian.com/cloud/cross-product-user-search/
|
|
76
|
-
* If you are still waiting for CPUS, you can use the `people` productKey in the interim.
|
|
77
|
-
*/
|
|
78
|
-
productKey: string;
|
|
79
|
-
/**
|
|
80
|
-
* Pass-through for CPUS. Refer to @see https://developer.atlassian.com/cloud/cross-product-user-search/rest/api-group-search/#api-group-search
|
|
81
|
-
* for detailed docs on parameters.
|
|
82
|
-
*/
|
|
83
|
-
cpusSearchQuery?: UserSearchQuery;
|
|
84
|
-
/**
|
|
85
|
-
* Identifier for the product's tenant, also known as siteId or cloudId.
|
|
86
|
-
* If product is not tenanted, the convention is to provide the productKey
|
|
87
|
-
* as the tenantId (e.g. "bitbucket") but this may vary across products.
|
|
88
|
-
* Check with #help-search-plex.
|
|
89
|
-
*/
|
|
90
|
-
tenantId: string;
|
|
91
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type IntlShape } from 'react-intl';
|
|
2
|
-
import { type UserSearchItem } from '@atlaskit/smart-common';
|
|
3
|
-
import { type OptionData } from '@atlaskit/user-picker';
|
|
4
|
-
declare const _default: (recommendations: UserSearchItem[], intl: IntlShape) => OptionData[];
|
|
5
|
-
export default _default;
|