@atlaskit/smart-hooks 0.1.5 → 0.1.7

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,17 @@
1
1
  # @atlaskit/smart-hooks
2
2
 
3
+ ## 0.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 0.1.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
14
+
3
15
  ## 0.1.5
4
16
 
5
17
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-hooks",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-hooks",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-hooks",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "sideEffects": false
5
5
  }
@@ -38,8 +38,7 @@ export const mockUserSearchData = [
38
38
  },
39
39
  {
40
40
  id: '12312412',
41
- name:
42
- "Dude with long name and time that doesn't seem to stop and should overflow",
41
+ name: "Dude with long name and time that doesn't seem to stop and should overflow",
43
42
  mentionName:
44
43
  "Dudewithlongnamethatdoesn'tseemtostopandshouldoverflowwithtime",
45
44
  presence: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-hooks",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/"
6
6
  },
@@ -23,7 +23,7 @@
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": "^9.3.0",
26
+ "@atlaskit/user-picker": "^10.0.0",
27
27
  "@babel/runtime": "^7.0.0",
28
28
  "lodash": "^4.17.21",
29
29
  "memoize-one": "^6.0.0",
@@ -35,24 +35,24 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@atlaskit/analytics-viewer": "^0.4.5",
38
- "@atlaskit/button": "^16.3.0",
38
+ "@atlaskit/button": "^16.5.0",
39
39
  "@atlaskit/docs": "*",
40
40
  "@atlaskit/smart-hooks": "*",
41
41
  "@atlaskit/ssr": "*",
42
- "@atlaskit/textfield": "^5.0.5",
42
+ "@atlaskit/textfield": "^5.3.0",
43
43
  "@atlaskit/visual-regression": "*",
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.7.0",
47
+ "@atlassiansox/analytics-web-client": "^4.9.0",
48
48
  "@storybook/addon-knobs": "^5.3.18",
49
- "@testing-library/react": "^8.0.1",
50
- "@testing-library/react-hooks": "^1.0.4",
49
+ "@testing-library/react": "^12.1.5",
50
+ "@testing-library/react-hooks": "^8.0.1",
51
51
  "@welldone-software/why-did-you-render": "^6.2.0",
52
52
  "enzyme": "^3.10.0",
53
53
  "fetch-mock": "^8.0.0",
54
54
  "react-dom": "^16.8.0",
55
- "typescript": "4.3.5",
55
+ "typescript": "4.5.5",
56
56
  "wait-for-expect": "^1.2.0"
57
57
  },
58
58
  "techstack": {
@@ -69,7 +69,8 @@
69
69
  "analytics-next"
70
70
  ],
71
71
  "theming": [
72
- "react-context"
72
+ "react-context",
73
+ "tokens"
73
74
  ],
74
75
  "ui-components": [
75
76
  "lite-mode"
package/report.api.md CHANGED
@@ -1,8 +1,18 @@
1
- ## API Report File for "@atlaskit/smart-hooks".
1
+ <!-- API Report Version: 2.3 -->
2
2
 
3
- > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
3
+ ## API Report File for "@atlaskit/smart-hooks"
4
4
 
5
- [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
5
+ > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
6
+ > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
+
8
+ ### Table of contents
9
+
10
+ - [Main Entry Types](#main-entry-types)
11
+ - [Peer Dependencies](#peer-dependencies)
12
+
13
+ ### Main Entry Types
14
+
15
+ <!--SECTION START: Main Entry Types-->
6
16
 
7
17
  ```ts
8
18
  import { EntityType } from '@atlaskit/smart-common';
@@ -13,14 +23,14 @@ import { UserSearchItem } from '@atlaskit/smart-common';
13
23
  import type { UserSearchProductAttributes } from '@atlaskit/smart-common';
14
24
  import type { UserSearchQuery } from '@atlaskit/smart-common';
15
25
 
16
- export declare const transformRecommendationsToOptions: (
26
+ // @public (undocumented)
27
+ export const transformRecommendationsToOptions: (
17
28
  recommendations: UserSearchItem[],
18
29
  intl: IntlShape,
19
30
  ) => OptionData[];
20
31
 
21
- export declare const useUserRecommendations: (
22
- props: UseUserRecommendationsProps,
23
- ) => {
32
+ // @public (undocumented)
33
+ export const useUserRecommendations: (props: UseUserRecommendationsProps) => {
24
34
  recommendations:
25
35
  | UserSearchItem[]
26
36
  | {
@@ -35,96 +45,40 @@ export declare const useUserRecommendations: (
35
45
  error: any;
36
46
  };
37
47
 
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
- */
48
+ // @public (undocumented)
49
+ type UseUserRecommendationsProps = {
45
50
  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
51
  childObjectId?: string;
51
- /**
52
- * The container Id to identify context. e.g. Jira: projectId. Confluence: spaceId. Bitbucket: repositoryId.
53
- */
54
52
  containerId?: string;
55
- /**
56
- * Time to debounce the suggestions fetching (in milliseconds). Defaults to 150ms.
57
- */
58
53
  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
54
  fieldId: string;
68
- /**
69
- * Whether to include users in the result set (@default: true).
70
- */
71
55
  includeUsers?: boolean;
72
- /**
73
- * Whether to include groups in the resultset (@default: false).
74
- */
75
56
  includeGroups?: boolean;
76
- /**
77
- * Whether to include teams in the resultset (@default: false).
78
- */
79
57
  includeTeams?: boolean;
80
- /**
81
- * (@default: 25)
82
- */
83
58
  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
59
  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
60
  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
61
  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
62
  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
63
  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
64
  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
65
  tenantId: string;
127
66
  };
128
67
 
129
- export {};
68
+ // (No @packageDocumentation comment for this package)
69
+ ```
70
+
71
+ <!--SECTION END: Main Entry Types-->
72
+
73
+ ### Peer Dependencies
74
+
75
+ <!--SECTION START: Peer Dependencies-->
76
+
77
+ ```json
78
+ {
79
+ "react": "^16.8.0",
80
+ "react-intl-next": "npm:react-intl@^5.18.1"
81
+ }
130
82
  ```
83
+
84
+ <!--SECTION END: Peer Dependencies-->
@@ -0,0 +1,54 @@
1
+ ## API Report File for "@atlaskit/smart-hooks"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { EntityType } from '@atlaskit/smart-common';
8
+ import { IntlShape } from 'react-intl-next';
9
+ import { MemoizedFn } from 'memoize-one';
10
+ import { OptionData } from '@atlaskit/user-picker';
11
+ import { UserSearchItem } from '@atlaskit/smart-common';
12
+ import type { UserSearchProductAttributes } from '@atlaskit/smart-common';
13
+ import type { UserSearchQuery } from '@atlaskit/smart-common';
14
+
15
+ // @public (undocumented)
16
+ export const transformRecommendationsToOptions: (recommendations: UserSearchItem[], intl: IntlShape) => OptionData[];
17
+
18
+ // @public (undocumented)
19
+ export const useUserRecommendations: (props: UseUserRecommendationsProps) => {
20
+ recommendations: UserSearchItem[] | {
21
+ id: string;
22
+ name: string;
23
+ entityType: EntityType;
24
+ avatarUrl: string;
25
+ }[];
26
+ triggerSearchFactory: MemoizedFn<() => (query?: string | undefined) => void>;
27
+ selectUserFactory: MemoizedFn<() => (userId: string) => void>;
28
+ isLoading: boolean;
29
+ error: any;
30
+ };
31
+
32
+ // @public (undocumented)
33
+ type UseUserRecommendationsProps = {
34
+ baseUrl?: string;
35
+ childObjectId?: string;
36
+ containerId?: string;
37
+ debounceTimeMs?: number;
38
+ fieldId: string;
39
+ includeUsers?: boolean;
40
+ includeGroups?: boolean;
41
+ includeTeams?: boolean;
42
+ maxNumberOfResults?: number;
43
+ objectId?: string;
44
+ preload?: boolean;
45
+ principalId?: string;
46
+ productAttributes?: UserSearchProductAttributes;
47
+ productKey: string;
48
+ cpusSearchQuery?: UserSearchQuery;
49
+ tenantId: string;
50
+ };
51
+
52
+ // (No @packageDocumentation comment for this package)
53
+
54
+ ```