@atlaskit/link-create 0.5.2 → 0.5.3

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/link-create
2
2
 
3
+ ## 0.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ae5ac36af00`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ae5ac36af00) - Updates analytics codegen to support screen events.
8
+
3
9
  ## 0.5.2
4
10
 
5
11
  ### Patch Changes
@@ -1,25 +1,40 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
7
9
  /**
8
10
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
9
11
  *
10
12
  * Generates Typescript types for analytics events from analytics.spec.yaml
11
13
  *
12
- * @codegen <<SignedSource::6d7803f5c035dc3cde1be03caa91eb04>>
14
+ * @codegen <<SignedSource::1c6720e63161d16bb99fc183b17d1944>>
13
15
  * @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
14
16
  */
15
17
 
16
18
  function createEventPayload(eventKey, attributes) {
17
- var event = eventKey.split('.');
19
+ var _eventKey$split = eventKey.split('.'),
20
+ _eventKey$split2 = (0, _slicedToArray2.default)(_eventKey$split, 4),
21
+ eventType = _eventKey$split2[0],
22
+ actionSubject = _eventKey$split2[1],
23
+ action = _eventKey$split2[2],
24
+ actionSubjectId = _eventKey$split2[3];
25
+ if (eventType === 'screen') {
26
+ return {
27
+ eventType: eventType,
28
+ name: actionSubject,
29
+ action: 'viewed',
30
+ attributes: attributes
31
+ };
32
+ }
18
33
  return {
19
- eventType: event[0],
20
- actionSubject: event[1],
21
- action: event[2],
22
- actionSubjectId: event[3],
34
+ eventType: eventType,
35
+ actionSubject: actionSubject,
36
+ actionSubjectId: actionSubjectId,
37
+ action: action,
23
38
  attributes: attributes
24
39
  };
25
40
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -3,17 +3,25 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::6d7803f5c035dc3cde1be03caa91eb04>>
6
+ * @codegen <<SignedSource::1c6720e63161d16bb99fc183b17d1944>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
8
8
  */
9
9
 
10
10
  function createEventPayload(eventKey, attributes) {
11
- const event = eventKey.split('.');
11
+ const [eventType, actionSubject, action, actionSubjectId] = eventKey.split('.');
12
+ if (eventType === 'screen') {
13
+ return {
14
+ eventType,
15
+ name: actionSubject,
16
+ action: 'viewed',
17
+ attributes: attributes
18
+ };
19
+ }
12
20
  return {
13
- eventType: event[0],
14
- actionSubject: event[1],
15
- action: event[2],
16
- actionSubjectId: event[3],
21
+ eventType,
22
+ actionSubject,
23
+ actionSubjectId,
24
+ action,
17
25
  attributes: attributes
18
26
  };
19
27
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,19 +1,33 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
1
2
  /**
2
3
  * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
4
  *
4
5
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
6
  *
6
- * @codegen <<SignedSource::6d7803f5c035dc3cde1be03caa91eb04>>
7
+ * @codegen <<SignedSource::1c6720e63161d16bb99fc183b17d1944>>
7
8
  * @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
8
9
  */
9
10
 
10
11
  function createEventPayload(eventKey, attributes) {
11
- var event = eventKey.split('.');
12
+ var _eventKey$split = eventKey.split('.'),
13
+ _eventKey$split2 = _slicedToArray(_eventKey$split, 4),
14
+ eventType = _eventKey$split2[0],
15
+ actionSubject = _eventKey$split2[1],
16
+ action = _eventKey$split2[2],
17
+ actionSubjectId = _eventKey$split2[3];
18
+ if (eventType === 'screen') {
19
+ return {
20
+ eventType: eventType,
21
+ name: actionSubject,
22
+ action: 'viewed',
23
+ attributes: attributes
24
+ };
25
+ }
12
26
  return {
13
- eventType: event[0],
14
- actionSubject: event[1],
15
- action: event[2],
16
- actionSubjectId: event[3],
27
+ eventType: eventType,
28
+ actionSubject: actionSubject,
29
+ actionSubjectId: actionSubjectId,
30
+ action: action,
17
31
  attributes: attributes
18
32
  };
19
33
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::6d7803f5c035dc3cde1be03caa91eb04>>
6
+ * @codegen <<SignedSource::1c6720e63161d16bb99fc183b17d1944>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -40,9 +40,17 @@ type AnalyticsEventAttributes = {
40
40
  };
41
41
  declare function createEventPayload<K extends keyof AnalyticsEventAttributes>(eventKey: K, attributes: AnalyticsEventAttributes[K]): {
42
42
  eventType: string;
43
- actionSubject: string;
43
+ name: string;
44
44
  action: string;
45
+ attributes: AnalyticsEventAttributes[K];
46
+ actionSubject?: undefined;
47
+ actionSubjectId?: undefined;
48
+ } | {
49
+ eventType: string;
50
+ actionSubject: string;
45
51
  actionSubjectId: string;
52
+ action: string;
46
53
  attributes: AnalyticsEventAttributes[K];
54
+ name?: undefined;
47
55
  };
48
56
  export default createEventPayload;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::6d7803f5c035dc3cde1be03caa91eb04>>
6
+ * @codegen <<SignedSource::1c6720e63161d16bb99fc183b17d1944>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -40,9 +40,17 @@ type AnalyticsEventAttributes = {
40
40
  };
41
41
  declare function createEventPayload<K extends keyof AnalyticsEventAttributes>(eventKey: K, attributes: AnalyticsEventAttributes[K]): {
42
42
  eventType: string;
43
- actionSubject: string;
43
+ name: string;
44
44
  action: string;
45
+ attributes: AnalyticsEventAttributes[K];
46
+ actionSubject?: undefined;
47
+ actionSubjectId?: undefined;
48
+ } | {
49
+ eventType: string;
50
+ actionSubject: string;
45
51
  actionSubjectId: string;
52
+ action: string;
46
53
  attributes: AnalyticsEventAttributes[K];
54
+ name?: undefined;
47
55
  };
48
56
  export default createEventPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "The driver component of meta creation flow",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -40,10 +40,10 @@
40
40
  "@atlaskit/form": "^8.11.0",
41
41
  "@atlaskit/icon": "^21.12.0",
42
42
  "@atlaskit/modal-dialog": "^12.5.0",
43
- "@atlaskit/select": "^16.4.0",
43
+ "@atlaskit/select": "^16.5.0",
44
44
  "@atlaskit/spinner": "^15.4.0",
45
45
  "@atlaskit/textfield": "^5.5.0",
46
- "@atlaskit/tokens": "^1.4.0",
46
+ "@atlaskit/tokens": "^1.5.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "@emotion/react": "^11.7.1"
49
49
  },