@atlaskit/smart-hooks 0.1.2 → 0.1.5

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/smart-hooks
2
2
 
3
+ ## 0.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
8
+
9
+ ## 0.1.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
14
+
15
+ ## 0.1.3
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 0.1.2
4
22
 
5
23
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-hooks",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-hooks",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,7 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
 
6
6
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
7
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-hooks",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-hooks",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/"
6
6
  },
@@ -19,11 +19,11 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@atlaskit/analytics-gas-types": "^5.0.5",
22
- "@atlaskit/analytics-listeners": "^8.1.3",
22
+ "@atlaskit/analytics-listeners": "^8.3.0",
23
23
  "@atlaskit/analytics-next": "^8.0.0",
24
24
  "@atlaskit/smart-common": "^0.1.0",
25
25
  "@atlaskit/ufo": "^0.1.0",
26
- "@atlaskit/user-picker": "^8.5.0",
26
+ "@atlaskit/user-picker": "^9.3.0",
27
27
  "@babel/runtime": "^7.0.0",
28
28
  "lodash": "^4.17.21",
29
29
  "memoize-one": "^6.0.0",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@atlaskit/analytics-viewer": "^0.4.5",
38
- "@atlaskit/button": "^16.0.0",
38
+ "@atlaskit/button": "^16.3.0",
39
39
  "@atlaskit/docs": "*",
40
40
  "@atlaskit/smart-hooks": "*",
41
41
  "@atlaskit/ssr": "*",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/webdriver-runner": "*",
45
45
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
46
46
  "@atlassian/ufo": "^0.1.0",
47
- "@atlassiansox/analytics-web-client": "^4.2.0",
47
+ "@atlassiansox/analytics-web-client": "^4.7.0",
48
48
  "@storybook/addon-knobs": "^5.3.18",
49
49
  "@testing-library/react": "^8.0.1",
50
50
  "@testing-library/react-hooks": "^1.0.4",
@@ -52,7 +52,7 @@
52
52
  "enzyme": "^3.10.0",
53
53
  "fetch-mock": "^8.0.0",
54
54
  "react-dom": "^16.8.0",
55
- "typescript": "3.9.6",
55
+ "typescript": "4.3.5",
56
56
  "wait-for-expect": "^1.2.0"
57
57
  },
58
58
  "techstack": {
package/report.api.md ADDED
@@ -0,0 +1,130 @@
1
+ ## API Report File for "@atlaskit/smart-hooks".
2
+
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
6
+
7
+ ```ts
8
+ import { EntityType } from '@atlaskit/smart-common';
9
+ import { IntlShape } from 'react-intl-next';
10
+ import { MemoizedFn } from 'memoize-one';
11
+ import { OptionData } from '@atlaskit/user-picker';
12
+ import { UserSearchItem } from '@atlaskit/smart-common';
13
+ import type { UserSearchProductAttributes } from '@atlaskit/smart-common';
14
+ import type { UserSearchQuery } from '@atlaskit/smart-common';
15
+
16
+ export declare const transformRecommendationsToOptions: (
17
+ recommendations: UserSearchItem[],
18
+ intl: IntlShape,
19
+ ) => OptionData[];
20
+
21
+ export declare const useUserRecommendations: (
22
+ props: UseUserRecommendationsProps,
23
+ ) => {
24
+ recommendations:
25
+ | UserSearchItem[]
26
+ | {
27
+ id: string;
28
+ name: string;
29
+ entityType: EntityType;
30
+ avatarUrl: string;
31
+ }[];
32
+ triggerSearchFactory: MemoizedFn<() => (query?: string | undefined) => void>;
33
+ selectUserFactory: MemoizedFn<() => (userId: string) => void>;
34
+ isLoading: boolean;
35
+ error: any;
36
+ };
37
+
38
+ declare type UseUserRecommendationsProps = {
39
+ /**
40
+ * Base url override for downstream APIs.
41
+ * Note: there is a trend for browsers blocking cookies for cross-site resources.
42
+ * This prop is added for legacy reasons and will likely be removed in the future.
43
+ * https://webkit.org/blog/10218/full-third-party-cookie-blocking-and-more/
44
+ */
45
+ baseUrl?: string;
46
+ /**
47
+ * Context information for analytics. Eg: if the hook was consumed inside a ticket's comment, the childObjectId would be
48
+ * the ID of the comment and the ticket would be the objectId. Optional, but please provide if available.
49
+ */
50
+ childObjectId?: string;
51
+ /**
52
+ * The container Id to identify context. e.g. Jira: projectId. Confluence: spaceId. Bitbucket: repositoryId.
53
+ */
54
+ containerId?: string;
55
+ /**
56
+ * Time to debounce the suggestions fetching (in milliseconds). Defaults to 150ms.
57
+ */
58
+ debounceTimeMs?: number;
59
+ /**
60
+ * Identifier for informing the server on what experience the hook is powering.
61
+ * The server uses the fieldId to determine which model to utilize when
62
+ * generating suggestions.
63
+ * All fieldId's will be bucketed into a model that provides generic smart results,
64
+ * except "assignee", "mentions" which are specifically trained for Jira Assignee and
65
+ * @Mentions. For specifically trained models, please contact #help-smart-experiences.
66
+ */
67
+ fieldId: string;
68
+ /**
69
+ * Whether to include users in the result set (@default: true).
70
+ */
71
+ includeUsers?: boolean;
72
+ /**
73
+ * Whether to include groups in the resultset (@default: false).
74
+ */
75
+ includeGroups?: boolean;
76
+ /**
77
+ * Whether to include teams in the resultset (@default: false).
78
+ */
79
+ includeTeams?: boolean;
80
+ /**
81
+ * (@default: 25)
82
+ */
83
+ maxNumberOfResults?: number;
84
+ /**
85
+ * An identifier of the closest context object, e.g. issueId, pageId, pullRequestId.
86
+ * Used for analytics. Optional, but please include if available.
87
+ */
88
+ objectId?: string;
89
+ /**
90
+ * Preload the list of suggested users with an empty-query ('') search as soon as
91
+ * the hook is used.
92
+ * WARNING: please consider carefully before deciding to preload your suggestions
93
+ * as this will increase the load on the recommendations services (has caused HOTs).
94
+ * Please give #help-smart-experiences a ballpark on the expected request volume.
95
+ * (@default: false)
96
+ */
97
+ preload?: boolean;
98
+ /**
99
+ * AAID of the user interacting with the component.
100
+ * If not provided, server will extract principalId from the context header, assuming that the user is logged in
101
+ * when making the request. (@default: “context”)
102
+ */
103
+ principalId?: string;
104
+ /**
105
+ * Product-specific Attributes - you should pass in the attribute type that matches your current SupportedProduct.
106
+ * Currently we support additional attributes (BitbucketAttributes) for bitbucket and (ConfluenceAttributes) for Confluence.
107
+ */
108
+ productAttributes?: UserSearchProductAttributes;
109
+ /**
110
+ * Product identifier. If you are an NPF, please ensure your product has been onboarded with
111
+ * Cross-product user-search @see https://developer.atlassian.com/cloud/cross-product-user-search/
112
+ * If you are still waiting for CPUS, you can use the `people` productKey in the interim.
113
+ */
114
+ productKey: string;
115
+ /**
116
+ * Pass-through for CPUS. Refer to @see https://developer.atlassian.com/cloud/cross-product-user-search/rest/api-group-search/#api-group-search
117
+ * for detailed docs on parameters.
118
+ */
119
+ cpusSearchQuery?: UserSearchQuery;
120
+ /**
121
+ * Identifier for the product's tenant, also known as siteId or cloudId.
122
+ * If product is not tenanted, the convention is to provide the productKey
123
+ * as the tenantId (e.g. "bitbucket") but this may vary across products.
124
+ * Check with #help-smart-experiences.
125
+ */
126
+ tenantId: string;
127
+ };
128
+
129
+ export {};
130
+ ```