@atlaskit/smart-hooks 0.2.4 → 0.2.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,11 @@
1
1
  # @atlaskit/smart-hooks
2
2
 
3
+ ## 0.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f01deb5e6ab`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f01deb5e6ab) - Use injected env vars instead of version.json
8
+
3
9
  ## 0.2.4
4
10
 
5
11
  ### Patch Changes
@@ -9,7 +9,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _analyticsGasTypes = require("@atlaskit/analytics-gas-types");
10
10
  var _analyticsListeners = require("@atlaskit/analytics-listeners");
11
11
  var _analyticsNext = require("@atlaskit/analytics-next");
12
- var _version = require("../../version.json");
13
12
  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; }
14
13
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
14
  var createAndFireEventInElementsChannel = (0, _analyticsNext.createAndFireEvent)(_analyticsListeners.FabricChannel.elements);
@@ -21,8 +20,8 @@ var createEvent = function createEvent(eventType, action, actionSubject) {
21
20
  actionSubject: actionSubject,
22
21
  source: '@atlaskit/smart-hooks/use-user-recommendations',
23
22
  attributes: _objectSpread({
24
- packageName: _version.name,
25
- packageVersion: _version.version
23
+ packageName: "@atlaskit/smart-hooks",
24
+ packageVersion: "0.2.5"
26
25
  }, attributes)
27
26
  };
28
27
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-hooks",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,6 @@
1
1
  import { TRACK_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
2
2
  import { FabricChannel } from '@atlaskit/analytics-listeners';
3
3
  import { createAndFireEvent } from '@atlaskit/analytics-next';
4
- import { name as packageName, version as packageVersion } from '../../version.json';
5
4
  const createAndFireEventInElementsChannel = createAndFireEvent(FabricChannel.elements);
6
5
  const createEvent = (eventType, action, actionSubject, attributes = {}) => ({
7
6
  eventType,
@@ -9,8 +8,8 @@ const createEvent = (eventType, action, actionSubject, attributes = {}) => ({
9
8
  actionSubject,
10
9
  source: '@atlaskit/smart-hooks/use-user-recommendations',
11
10
  attributes: {
12
- packageName,
13
- packageVersion,
11
+ packageName: "@atlaskit/smart-hooks",
12
+ packageVersion: "0.2.5",
14
13
  ...attributes
15
14
  }
16
15
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-hooks",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "sideEffects": false
5
5
  }
@@ -4,7 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  import { TRACK_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
5
5
  import { FabricChannel } from '@atlaskit/analytics-listeners';
6
6
  import { createAndFireEvent } from '@atlaskit/analytics-next';
7
- import { name as packageName, version as packageVersion } from '../../version.json';
8
7
  var createAndFireEventInElementsChannel = createAndFireEvent(FabricChannel.elements);
9
8
  var createEvent = function createEvent(eventType, action, actionSubject) {
10
9
  var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
@@ -14,8 +13,8 @@ var createEvent = function createEvent(eventType, action, actionSubject) {
14
13
  actionSubject: actionSubject,
15
14
  source: '@atlaskit/smart-hooks/use-user-recommendations',
16
15
  attributes: _objectSpread({
17
- packageName: packageName,
18
- packageVersion: packageVersion
16
+ packageName: "@atlaskit/smart-hooks",
17
+ packageVersion: "0.2.5"
19
18
  }, attributes)
20
19
  };
21
20
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-hooks",
3
- "version": "0.2.4",
3
+ "version": "0.2.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.2.4",
3
+ "version": "0.2.5",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/"
6
6
  },
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/analytics-next": "^9.1.0",
32
32
  "@atlaskit/smart-common": "^0.2.0",
33
33
  "@atlaskit/ufo": "^0.2.0",
34
- "@atlaskit/user-picker": "^10.4.0",
34
+ "@atlaskit/user-picker": "^10.5.0",
35
35
  "@babel/runtime": "^7.0.0",
36
36
  "lodash": "^4.17.21",
37
37
  "memoize-one": "^6.0.0",
@@ -85,4 +85,4 @@
85
85
  ".": "./src/index.ts"
86
86
  },
87
87
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
88
- }
88
+ }
@@ -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) => 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
+ ```