@atlaskit/smart-hooks 1.1.0 → 2.0.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/dist/cjs/services/use-user-recommendations/analytics.js +1 -1
- package/dist/cjs/services/use-user-recommendations/index.js +16 -16
- package/dist/es2019/services/use-user-recommendations/analytics.js +1 -1
- package/dist/esm/services/use-user-recommendations/analytics.js +1 -1
- package/dist/esm/services/use-user-recommendations/index.js +16 -16
- package/package.json +9 -16
- 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.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
8
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
9
|
+
|
|
10
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
11
|
+
|
|
12
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- "typesVersions": {
|
|
16
|
+
- ">=4.5 <4.9": {
|
|
17
|
+
- "*": [
|
|
18
|
+
- "dist/types-ts4.5/*",
|
|
19
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
20
|
+
- ]
|
|
21
|
+
- }
|
|
22
|
+
- },
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
29
|
+
## 1.2.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- [`fbb51c73ed426`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fbb51c73ed426) -
|
|
34
|
+
Update i18n NPM package versions for linking-platform,smart-experiences (Group 15)
|
|
35
|
+
|
|
3
36
|
## 1.1.0
|
|
4
37
|
|
|
5
38
|
### Minor Changes
|
|
@@ -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: "1.2.0"
|
|
25
25
|
}, attributes)
|
|
26
26
|
};
|
|
27
27
|
};
|
|
@@ -91,8 +91,8 @@ var useUserRecommendations = function useUserRecommendations(props) {
|
|
|
91
91
|
}, [childObjectId, containerId, fieldId, includeTeams, maxNumberOfResults, objectId, preload, principalId, productKey, renderId, tenantId]);
|
|
92
92
|
var fetchRecommendations = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
93
93
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(query) {
|
|
94
|
-
var _lastAbortController$, currentController, recommendedUsersResult;
|
|
95
|
-
return _regenerator.default.wrap(function
|
|
94
|
+
var _lastAbortController$, currentController, recommendedUsersResult, _t;
|
|
95
|
+
return _regenerator.default.wrap(function (_context) {
|
|
96
96
|
while (1) switch (_context.prev = _context.next) {
|
|
97
97
|
case 0:
|
|
98
98
|
setIsLoading(true);
|
|
@@ -100,7 +100,7 @@ var useUserRecommendations = function useUserRecommendations(props) {
|
|
|
100
100
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
101
101
|
sessionId.current = (0, _uuid.v4)();
|
|
102
102
|
_ufoExperiences.UsersFetchedUfoExperience.getInstance(fieldId).start();
|
|
103
|
-
_context.prev =
|
|
103
|
+
_context.prev = 1;
|
|
104
104
|
if (lastAbortController.current) {
|
|
105
105
|
(_lastAbortController$ = lastAbortController.current) === null || _lastAbortController$ === void 0 || _lastAbortController$.abort();
|
|
106
106
|
}
|
|
@@ -108,7 +108,7 @@ var useUserRecommendations = function useUserRecommendations(props) {
|
|
|
108
108
|
// IE has no timeout applied on fetch since AbortController isn't available
|
|
109
109
|
currentController = typeof AbortController !== 'undefined' ? new AbortController() : null;
|
|
110
110
|
lastAbortController.current = currentController;
|
|
111
|
-
_context.next =
|
|
111
|
+
_context.next = 2;
|
|
112
112
|
return (0, _smartCommon.fetchUserRecommendations)({
|
|
113
113
|
baseUrl: baseUrl,
|
|
114
114
|
context: {
|
|
@@ -129,7 +129,7 @@ var useUserRecommendations = function useUserRecommendations(props) {
|
|
|
129
129
|
searchQuery: cpusSearchQuery,
|
|
130
130
|
query: query
|
|
131
131
|
}, currentController === null || currentController === void 0 ? void 0 : currentController.signal);
|
|
132
|
-
case
|
|
132
|
+
case 2:
|
|
133
133
|
recommendedUsersResult = _context.sent;
|
|
134
134
|
currentQuery.current = query !== null && query !== void 0 ? query : '';
|
|
135
135
|
_ufoExperiences.UsersFetchedUfoExperience.getInstance(fieldId).success({
|
|
@@ -138,33 +138,33 @@ var useUserRecommendations = function useUserRecommendations(props) {
|
|
|
138
138
|
})
|
|
139
139
|
});
|
|
140
140
|
setRecommendations(recommendedUsersResult);
|
|
141
|
-
_context.next =
|
|
141
|
+
_context.next = 5;
|
|
142
142
|
break;
|
|
143
|
-
case
|
|
144
|
-
_context.prev =
|
|
145
|
-
|
|
146
|
-
if (!(
|
|
147
|
-
_context.next =
|
|
143
|
+
case 3:
|
|
144
|
+
_context.prev = 3;
|
|
145
|
+
_t = _context["catch"](1);
|
|
146
|
+
if (!(_t instanceof Error && _t.name === 'AbortError')) {
|
|
147
|
+
_context.next = 4;
|
|
148
148
|
break;
|
|
149
149
|
}
|
|
150
150
|
// Request aborted client-side
|
|
151
151
|
_ufoExperiences.UsersFetchedUfoExperience.getInstance(fieldId).abort();
|
|
152
152
|
// return early to prevent disabling isLoading
|
|
153
153
|
return _context.abrupt("return");
|
|
154
|
-
case
|
|
154
|
+
case 4:
|
|
155
155
|
_ufoExperiences.UsersFetchedUfoExperience.getInstance(fieldId).failure({
|
|
156
156
|
metadata: getAnalyticsAttributes()
|
|
157
157
|
});
|
|
158
|
-
setError(
|
|
159
|
-
case
|
|
158
|
+
setError(_t);
|
|
159
|
+
case 5:
|
|
160
160
|
setIsLoading(false);
|
|
161
161
|
// clear abort controller
|
|
162
162
|
lastAbortController.current = undefined;
|
|
163
|
-
case
|
|
163
|
+
case 6:
|
|
164
164
|
case "end":
|
|
165
165
|
return _context.stop();
|
|
166
166
|
}
|
|
167
|
-
}, _callee, null, [[
|
|
167
|
+
}, _callee, null, [[1, 3]]);
|
|
168
168
|
}));
|
|
169
169
|
return function (_x) {
|
|
170
170
|
return _ref.apply(this, arguments);
|
|
@@ -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: "1.2.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: "1.2.0"
|
|
19
19
|
}, attributes)
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -85,8 +85,8 @@ var useUserRecommendations = function useUserRecommendations(props) {
|
|
|
85
85
|
}, [childObjectId, containerId, fieldId, includeTeams, maxNumberOfResults, objectId, preload, principalId, productKey, renderId, tenantId]);
|
|
86
86
|
var fetchRecommendations = useCallback( /*#__PURE__*/function () {
|
|
87
87
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(query) {
|
|
88
|
-
var _lastAbortController$, currentController, recommendedUsersResult;
|
|
89
|
-
return _regeneratorRuntime.wrap(function
|
|
88
|
+
var _lastAbortController$, currentController, recommendedUsersResult, _t;
|
|
89
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
90
90
|
while (1) switch (_context.prev = _context.next) {
|
|
91
91
|
case 0:
|
|
92
92
|
setIsLoading(true);
|
|
@@ -94,7 +94,7 @@ var useUserRecommendations = function useUserRecommendations(props) {
|
|
|
94
94
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
95
95
|
sessionId.current = uuid();
|
|
96
96
|
UsersFetchedUfoExperience.getInstance(fieldId).start();
|
|
97
|
-
_context.prev =
|
|
97
|
+
_context.prev = 1;
|
|
98
98
|
if (lastAbortController.current) {
|
|
99
99
|
(_lastAbortController$ = lastAbortController.current) === null || _lastAbortController$ === void 0 || _lastAbortController$.abort();
|
|
100
100
|
}
|
|
@@ -102,7 +102,7 @@ var useUserRecommendations = function useUserRecommendations(props) {
|
|
|
102
102
|
// IE has no timeout applied on fetch since AbortController isn't available
|
|
103
103
|
currentController = typeof AbortController !== 'undefined' ? new AbortController() : null;
|
|
104
104
|
lastAbortController.current = currentController;
|
|
105
|
-
_context.next =
|
|
105
|
+
_context.next = 2;
|
|
106
106
|
return fetchUserRecommendations({
|
|
107
107
|
baseUrl: baseUrl,
|
|
108
108
|
context: {
|
|
@@ -123,7 +123,7 @@ var useUserRecommendations = function useUserRecommendations(props) {
|
|
|
123
123
|
searchQuery: cpusSearchQuery,
|
|
124
124
|
query: query
|
|
125
125
|
}, currentController === null || currentController === void 0 ? void 0 : currentController.signal);
|
|
126
|
-
case
|
|
126
|
+
case 2:
|
|
127
127
|
recommendedUsersResult = _context.sent;
|
|
128
128
|
currentQuery.current = query !== null && query !== void 0 ? query : '';
|
|
129
129
|
UsersFetchedUfoExperience.getInstance(fieldId).success({
|
|
@@ -132,33 +132,33 @@ var useUserRecommendations = function useUserRecommendations(props) {
|
|
|
132
132
|
})
|
|
133
133
|
});
|
|
134
134
|
setRecommendations(recommendedUsersResult);
|
|
135
|
-
_context.next =
|
|
135
|
+
_context.next = 5;
|
|
136
136
|
break;
|
|
137
|
-
case
|
|
138
|
-
_context.prev =
|
|
139
|
-
|
|
140
|
-
if (!(
|
|
141
|
-
_context.next =
|
|
137
|
+
case 3:
|
|
138
|
+
_context.prev = 3;
|
|
139
|
+
_t = _context["catch"](1);
|
|
140
|
+
if (!(_t instanceof Error && _t.name === 'AbortError')) {
|
|
141
|
+
_context.next = 4;
|
|
142
142
|
break;
|
|
143
143
|
}
|
|
144
144
|
// Request aborted client-side
|
|
145
145
|
UsersFetchedUfoExperience.getInstance(fieldId).abort();
|
|
146
146
|
// return early to prevent disabling isLoading
|
|
147
147
|
return _context.abrupt("return");
|
|
148
|
-
case
|
|
148
|
+
case 4:
|
|
149
149
|
UsersFetchedUfoExperience.getInstance(fieldId).failure({
|
|
150
150
|
metadata: getAnalyticsAttributes()
|
|
151
151
|
});
|
|
152
|
-
setError(
|
|
153
|
-
case
|
|
152
|
+
setError(_t);
|
|
153
|
+
case 5:
|
|
154
154
|
setIsLoading(false);
|
|
155
155
|
// clear abort controller
|
|
156
156
|
lastAbortController.current = undefined;
|
|
157
|
-
case
|
|
157
|
+
case 6:
|
|
158
158
|
case "end":
|
|
159
159
|
return _context.stop();
|
|
160
160
|
}
|
|
161
|
-
}, _callee, null, [[
|
|
161
|
+
}, _callee, null, [[1, 3]]);
|
|
162
162
|
}));
|
|
163
163
|
return function (_x) {
|
|
164
164
|
return _ref.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-hooks",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -11,14 +11,6 @@
|
|
|
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": {
|
|
@@ -26,12 +18,12 @@
|
|
|
26
18
|
},
|
|
27
19
|
"dependencies": {
|
|
28
20
|
"@atlaskit/afm-i18n-platform-smart-experiences-smart-hooks": "2.7.0",
|
|
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": "^
|
|
21
|
+
"@atlaskit/analytics-gas-types": "^6.0.0",
|
|
22
|
+
"@atlaskit/analytics-listeners": "^11.0.0",
|
|
23
|
+
"@atlaskit/analytics-next": "^12.0.0",
|
|
24
|
+
"@atlaskit/smart-common": "^3.0.0",
|
|
25
|
+
"@atlaskit/ufo": "^1.0.0",
|
|
26
|
+
"@atlaskit/user-picker": "^13.0.0",
|
|
35
27
|
"@babel/runtime": "^7.0.0",
|
|
36
28
|
"lodash": "^4.17.21",
|
|
37
29
|
"memoize-one": "^6.0.0",
|
|
@@ -42,11 +34,12 @@
|
|
|
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.12.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",
|
|
42
|
+
"react": "^18.2.0",
|
|
50
43
|
"react-dom": "^18.2.0",
|
|
51
44
|
"react-intl": "^6.6.2",
|
|
52
45
|
"wait-for-expect": "^1.2.0"
|
|
@@ -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;
|