@atlaskit/smart-card 26.48.6 → 26.48.8
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 +12 -0
- package/analytics.spec.yaml +95 -0
- package/dist/cjs/common/analytics/constants.js +7 -0
- package/dist/cjs/common/analytics/generated/analytics.types.js +5 -0
- package/dist/cjs/common/analytics/generated/create-event-payload.js +45 -0
- package/dist/cjs/common/analytics/generated/use-analytics-events.js +31 -0
- package/dist/cjs/i18n/zh.js +4 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-error-viewed/index.js +17 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/index.js +20 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +10 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/common/analytics/constants.js +1 -0
- package/dist/es2019/common/analytics/generated/analytics.types.js +1 -0
- package/dist/es2019/common/analytics/generated/create-event-payload.js +28 -0
- package/dist/es2019/common/analytics/generated/use-analytics-events.js +24 -0
- package/dist/es2019/i18n/zh.js +4 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-error-viewed/index.js +12 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/index.js +16 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +11 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/common/analytics/constants.js +1 -0
- package/dist/esm/common/analytics/generated/analytics.types.js +1 -0
- package/dist/esm/common/analytics/generated/create-event-payload.js +38 -0
- package/dist/esm/common/analytics/generated/use-analytics-events.js +23 -0
- package/dist/esm/i18n/zh.js +4 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-error-viewed/index.js +11 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/index.js +14 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +10 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/common/analytics/constants.d.ts +1 -0
- package/dist/types/common/analytics/generated/analytics.types.d.ts +41 -0
- package/dist/types/common/analytics/generated/create-event-payload.d.ts +27 -0
- package/dist/types/common/analytics/generated/use-analytics-events.d.ts +3 -0
- package/dist/types/i18n/zh.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-error-viewed/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/types.d.ts +3 -0
- package/dist/types-ts4.5/common/analytics/constants.d.ts +1 -0
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +41 -0
- package/dist/types-ts4.5/common/analytics/generated/create-event-payload.d.ts +31 -0
- package/dist/types-ts4.5/common/analytics/generated/use-analytics-events.d.ts +7 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-error-viewed/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/types.d.ts +3 -0
- package/package.json +12 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.48.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#74079](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/74079) [`22faab8a24e4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/22faab8a24e4) - Adds analytics for ai summary action and ai summary viewing.
|
|
8
|
+
|
|
9
|
+
## 26.48.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 26.48.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
common:
|
|
2
|
+
product: media
|
|
3
|
+
|
|
4
|
+
context:
|
|
5
|
+
PackageMetaData: &PackageMetaDataContext
|
|
6
|
+
packageName:
|
|
7
|
+
type: string
|
|
8
|
+
description: name of the package the event was fired from
|
|
9
|
+
packageVersion:
|
|
10
|
+
type: string
|
|
11
|
+
description: version of the package the event was fired from
|
|
12
|
+
|
|
13
|
+
ResolvedAttributes: &ResolvedAttributes
|
|
14
|
+
status:
|
|
15
|
+
type: ['pending', 'resolving', 'resolved', 'errored', 'fallback', 'unauthorized', 'forbidden', 'not_found']
|
|
16
|
+
description: The status of the link resolution at the time of the event.
|
|
17
|
+
required: false
|
|
18
|
+
statusDetails:
|
|
19
|
+
type: string
|
|
20
|
+
description: Provides further information of the resolved status. May be different for different status values
|
|
21
|
+
required: false
|
|
22
|
+
displayCategory:
|
|
23
|
+
type: ['smartLink', 'link']
|
|
24
|
+
description: |
|
|
25
|
+
The overarching category of what the link is shown as.
|
|
26
|
+
`smartLink` : we are able to resolve the link and is displayed as a smart link
|
|
27
|
+
`link` : we are unable to resolve the link and it is displayed as linked text or a linked URL
|
|
28
|
+
extensionKey:
|
|
29
|
+
type: string
|
|
30
|
+
required: false
|
|
31
|
+
description: The provider identifier of the resolver that was used to resolve the link
|
|
32
|
+
destinationProduct:
|
|
33
|
+
type: string
|
|
34
|
+
required: false
|
|
35
|
+
description: |
|
|
36
|
+
Which product the linked resource will navigate to when clicked.
|
|
37
|
+
destinationSubproduct:
|
|
38
|
+
type: string
|
|
39
|
+
required: false
|
|
40
|
+
description: |
|
|
41
|
+
Which subproduct will the link take you to when clicked.
|
|
42
|
+
destinationCategory:
|
|
43
|
+
type: string
|
|
44
|
+
required: false
|
|
45
|
+
description: |
|
|
46
|
+
The category of the linked object.
|
|
47
|
+
Typically value is either `object` or `comment`
|
|
48
|
+
destinationObjectId:
|
|
49
|
+
type: string
|
|
50
|
+
required: false
|
|
51
|
+
description: |
|
|
52
|
+
The `objectId` of the linked resource.
|
|
53
|
+
destinationObjectType:
|
|
54
|
+
type: string
|
|
55
|
+
required: false
|
|
56
|
+
description: |
|
|
57
|
+
The type of object of the linked resource.
|
|
58
|
+
Typically maps to `resourceType` as defined by resolvers.
|
|
59
|
+
destinationContainerId:
|
|
60
|
+
type: string
|
|
61
|
+
required: false
|
|
62
|
+
description: |
|
|
63
|
+
The `containerId` of the linked resource.
|
|
64
|
+
Eg. if the object is a Confluence page or blog post, then this value would be the ID of the "containing" space
|
|
65
|
+
destinationTenantId:
|
|
66
|
+
type: string
|
|
67
|
+
required: false
|
|
68
|
+
description: |
|
|
69
|
+
The `tenantId` of the linked resource if relevant.
|
|
70
|
+
canBeDatasource:
|
|
71
|
+
type: boolean
|
|
72
|
+
required: false
|
|
73
|
+
description: An indicator that a link can be converted to datasource view
|
|
74
|
+
|
|
75
|
+
events:
|
|
76
|
+
- button clicked (aiSummary):
|
|
77
|
+
type: ui
|
|
78
|
+
description: fired when an ai summary is clicked
|
|
79
|
+
attributes:
|
|
80
|
+
<<: [*PackageMetaDataContext, *ResolvedAttributes]
|
|
81
|
+
|
|
82
|
+
- summary viewed:
|
|
83
|
+
type: ui
|
|
84
|
+
description: fired when a summary is viewed
|
|
85
|
+
attributes:
|
|
86
|
+
<<: [*PackageMetaDataContext, *ResolvedAttributes]
|
|
87
|
+
fromCache:
|
|
88
|
+
type: boolean
|
|
89
|
+
description: if the summary is from a cache
|
|
90
|
+
|
|
91
|
+
- error viewed (aiSummary):
|
|
92
|
+
type: ui
|
|
93
|
+
description: fired when a summary error is viewed
|
|
94
|
+
attributes:
|
|
95
|
+
<<: [*PackageMetaDataContext, *ResolvedAttributes]
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
/**
|
|
10
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
11
|
+
*
|
|
12
|
+
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
13
|
+
*
|
|
14
|
+
* @codegen <<SignedSource::0d08fdca953a1eb1130683499e509165>>
|
|
15
|
+
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
var createEventPayload = function createEventPayload(eventKey) {
|
|
19
|
+
for (var _len = arguments.length, _ref = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
20
|
+
_ref[_key - 1] = arguments[_key];
|
|
21
|
+
}
|
|
22
|
+
var attributes = _ref[0];
|
|
23
|
+
var _eventKey$split = eventKey.split('.'),
|
|
24
|
+
_eventKey$split2 = (0, _slicedToArray2.default)(_eventKey$split, 4),
|
|
25
|
+
eventType = _eventKey$split2[0],
|
|
26
|
+
actionSubject = _eventKey$split2[1],
|
|
27
|
+
action = _eventKey$split2[2],
|
|
28
|
+
actionSubjectId = _eventKey$split2[3];
|
|
29
|
+
if (eventType === 'screen') {
|
|
30
|
+
return {
|
|
31
|
+
eventType: eventType,
|
|
32
|
+
name: actionSubject,
|
|
33
|
+
action: 'viewed',
|
|
34
|
+
attributes: attributes
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
eventType: eventType,
|
|
39
|
+
actionSubject: actionSubject,
|
|
40
|
+
action: action,
|
|
41
|
+
actionSubjectId: actionSubjectId,
|
|
42
|
+
attributes: attributes
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
var _default = exports.default = createEventPayload;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useAnalyticsEvents = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
var _createEventPayload = _interopRequireDefault(require("./create-event-payload"));
|
|
12
|
+
/**
|
|
13
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
14
|
+
*
|
|
15
|
+
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
16
|
+
*
|
|
17
|
+
* @codegen <<SignedSource::5fbe35afe0479810b090b1746dd1ae71>>
|
|
18
|
+
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
var useAnalyticsEvents = exports.useAnalyticsEvents = function useAnalyticsEvents() {
|
|
22
|
+
var _useAnalyticsNextEven = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
23
|
+
createAnalyticsEvent = _useAnalyticsNextEven.createAnalyticsEvent;
|
|
24
|
+
var fireEvent = (0, _react.useCallback)(function () {
|
|
25
|
+
var event = createAnalyticsEvent(_createEventPayload.default.apply(void 0, arguments));
|
|
26
|
+
event.fire(_constants.EVENT_CHANNEL);
|
|
27
|
+
}, [createAnalyticsEvent]);
|
|
28
|
+
return {
|
|
29
|
+
fireEvent: fireEvent
|
|
30
|
+
};
|
|
31
|
+
};
|
package/dist/cjs/i18n/zh.js
CHANGED
|
@@ -17,6 +17,9 @@ var _default = exports.default = {
|
|
|
17
17
|
'fabric.linking.actions': '操作',
|
|
18
18
|
'fabric.linking.add_account': '添加帐户',
|
|
19
19
|
'fabric.linking.ai_summarize': '汇总',
|
|
20
|
+
'fabric.linking.ai_summarized': '由 Atlassian Intelligence 汇总',
|
|
21
|
+
'fabric.linking.ai_summarized_info': '信息质量可能有所不同。<a>了解更多</a>',
|
|
22
|
+
'fabric.linking.ai_summarizing': 'Atlassian Intelligence 正在运行...',
|
|
20
23
|
'fabric.linking.assigned_to': '已分配给 {context}',
|
|
21
24
|
'fabric.linking.cancel': '取消',
|
|
22
25
|
'fabric.linking.cannot_connect': '无法连接,请重试',
|
|
@@ -41,6 +44,7 @@ var _default = exports.default = {
|
|
|
41
44
|
'fabric.linking.create_on_relative': '创建时间:{context}',
|
|
42
45
|
'fabric.linking.created_by': '创建者:{context}',
|
|
43
46
|
'fabric.linking.delete': '删除',
|
|
47
|
+
'fabric.linking.direct_access': '立即加入',
|
|
44
48
|
'fabric.linking.direct_access_description': '您的团队使用 {product} 进行协作,而您可以立即开始使用该产品!',
|
|
45
49
|
'fabric.linking.direct_access_title': '加入 {product} 即可查看此内容',
|
|
46
50
|
'fabric.linking.download': '下载',
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.48.
|
|
25
|
+
packageVersion: "26.48.8"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-error-viewed/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _useAnalyticsEvents2 = require("../../../../../../common/analytics/generated/use-analytics-events");
|
|
9
|
+
var AIEventErrorViewed = function AIEventErrorViewed() {
|
|
10
|
+
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
11
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
12
|
+
(0, _react.useEffect)(function () {
|
|
13
|
+
fireEvent('ui.error.viewed.aiSummary', {});
|
|
14
|
+
}, [fireEvent]);
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
var _default = exports.default = AIEventErrorViewed;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _useAnalyticsEvents2 = require("../../../../../../common/analytics/generated/use-analytics-events");
|
|
9
|
+
var AIEventSummaryViewed = function AIEventSummaryViewed(_ref) {
|
|
10
|
+
var fromCache = _ref.fromCache;
|
|
11
|
+
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
12
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
13
|
+
(0, _react.useEffect)(function () {
|
|
14
|
+
fireEvent('ui.summary.viewed', {
|
|
15
|
+
fromCache: fromCache
|
|
16
|
+
});
|
|
17
|
+
}, [fireEvent, fromCache]);
|
|
18
|
+
return null;
|
|
19
|
+
};
|
|
20
|
+
var _default = exports.default = AIEventSummaryViewed;
|
|
@@ -23,6 +23,9 @@ var _useAiSummary = require("../../../../../../state/hooks/use-ai-summary");
|
|
|
23
23
|
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
24
24
|
var _aiIcon = _interopRequireDefault(require("../../../../../common/ai-icon"));
|
|
25
25
|
var _aiSummary = _interopRequireDefault(require("../../../../../common/ai-summary"));
|
|
26
|
+
var _useAnalyticsEvents2 = require("../../../../../../common/analytics/generated/use-analytics-events");
|
|
27
|
+
var _aiEventSummaryViewed = _interopRequireDefault(require("../ai-event-summary-viewed"));
|
|
28
|
+
var _aiEventErrorViewed = _interopRequireDefault(require("../ai-event-error-viewed"));
|
|
26
29
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
31
|
var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
@@ -38,6 +41,8 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
38
41
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
39
42
|
aiState = _useState2[0],
|
|
40
43
|
setAIState = _useState2[1];
|
|
44
|
+
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
45
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
41
46
|
var metadataElements = (0, _utils.renderElementItems)(metadata);
|
|
42
47
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
43
48
|
var url = (context === null || context === void 0 ? void 0 : context.url) || '';
|
|
@@ -49,11 +54,12 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
49
54
|
status = _aiSummary$state.status,
|
|
50
55
|
isSummarisedOnMount = aiSummary.isSummarisedOnMount;
|
|
51
56
|
var onAIActionClick = (0, _react.useCallback)(function () {
|
|
57
|
+
fireEvent('ui.button.clicked.aiSummary', {});
|
|
52
58
|
setAIState('loading');
|
|
53
59
|
if (onAIActionChange) {
|
|
54
60
|
onAIActionChange('loading');
|
|
55
61
|
}
|
|
56
|
-
}, [onAIActionChange]);
|
|
62
|
+
}, [onAIActionChange, fireEvent]);
|
|
57
63
|
var combinedActions = (0, _react.useMemo)(function () {
|
|
58
64
|
if (aiState === 'ready') {
|
|
59
65
|
var aiAction = {
|
|
@@ -79,6 +85,8 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
79
85
|
return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, props, {
|
|
80
86
|
direction: _constants.SmartLinkDirection.Vertical,
|
|
81
87
|
testId: "".concat(testId, "-resolved-view")
|
|
88
|
+
}), status === 'done' && /*#__PURE__*/_react.default.createElement(_aiEventSummaryViewed.default, {
|
|
89
|
+
fromCache: isSummarisedOnMount
|
|
82
90
|
}), /*#__PURE__*/_react.default.createElement(_aiSummary.default, {
|
|
83
91
|
content: content,
|
|
84
92
|
showIcon: isSummarisedOnMount
|
|
@@ -100,7 +108,7 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
100
108
|
size: size
|
|
101
109
|
}))), status === 'error' && /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
102
110
|
grow: "fill"
|
|
103
|
-
}, /*#__PURE__*/_react.default.createElement(_aiStateIndicator.default, {
|
|
111
|
+
}, /*#__PURE__*/_react.default.createElement(_aiEventErrorViewed.default, null), /*#__PURE__*/_react.default.createElement(_aiStateIndicator.default, {
|
|
104
112
|
state: status,
|
|
105
113
|
testId: testId
|
|
106
114
|
})));
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "26.48.
|
|
20
|
+
packageVersion: "26.48.8",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const EVENT_CHANNEL = 'media';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::0d08fdca953a1eb1130683499e509165>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const createEventPayload = (eventKey, ...[attributes]) => {
|
|
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
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
eventType,
|
|
22
|
+
actionSubject,
|
|
23
|
+
action,
|
|
24
|
+
actionSubjectId,
|
|
25
|
+
attributes: attributes
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export default createEventPayload;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::5fbe35afe0479810b090b1746dd1ae71>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
|
+
*/
|
|
9
|
+
import { useCallback } from 'react';
|
|
10
|
+
import { useAnalyticsEvents as useAnalyticsNextEvents } from '@atlaskit/analytics-next';
|
|
11
|
+
import { EVENT_CHANNEL } from '../constants';
|
|
12
|
+
import createEventPayload from './create-event-payload';
|
|
13
|
+
export const useAnalyticsEvents = () => {
|
|
14
|
+
const {
|
|
15
|
+
createAnalyticsEvent
|
|
16
|
+
} = useAnalyticsNextEvents();
|
|
17
|
+
const fireEvent = useCallback((...params) => {
|
|
18
|
+
const event = createAnalyticsEvent(createEventPayload(...params));
|
|
19
|
+
event.fire(EVENT_CHANNEL);
|
|
20
|
+
}, [createAnalyticsEvent]);
|
|
21
|
+
return {
|
|
22
|
+
fireEvent
|
|
23
|
+
};
|
|
24
|
+
};
|
package/dist/es2019/i18n/zh.js
CHANGED
|
@@ -11,6 +11,9 @@ export default {
|
|
|
11
11
|
'fabric.linking.actions': '操作',
|
|
12
12
|
'fabric.linking.add_account': '添加帐户',
|
|
13
13
|
'fabric.linking.ai_summarize': '汇总',
|
|
14
|
+
'fabric.linking.ai_summarized': '由 Atlassian Intelligence 汇总',
|
|
15
|
+
'fabric.linking.ai_summarized_info': '信息质量可能有所不同。<a>了解更多</a>',
|
|
16
|
+
'fabric.linking.ai_summarizing': 'Atlassian Intelligence 正在运行...',
|
|
14
17
|
'fabric.linking.assigned_to': '已分配给 {context}',
|
|
15
18
|
'fabric.linking.cancel': '取消',
|
|
16
19
|
'fabric.linking.cannot_connect': '无法连接,请重试',
|
|
@@ -35,6 +38,7 @@ export default {
|
|
|
35
38
|
'fabric.linking.create_on_relative': '创建时间:{context}',
|
|
36
39
|
'fabric.linking.created_by': '创建者:{context}',
|
|
37
40
|
'fabric.linking.delete': '删除',
|
|
41
|
+
'fabric.linking.direct_access': '立即加入',
|
|
38
42
|
'fabric.linking.direct_access_description': '您的团队使用 {product} 进行协作,而您可以立即开始使用该产品!',
|
|
39
43
|
'fabric.linking.direct_access_title': '加入 {product} 即可查看此内容',
|
|
40
44
|
'fabric.linking.download': '下载',
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.48.
|
|
7
|
+
packageVersion: "26.48.8"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
3
|
+
const AIEventErrorViewed = () => {
|
|
4
|
+
const {
|
|
5
|
+
fireEvent
|
|
6
|
+
} = useAnalyticsEvents();
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
fireEvent('ui.error.viewed.aiSummary', {});
|
|
9
|
+
}, [fireEvent]);
|
|
10
|
+
return null;
|
|
11
|
+
};
|
|
12
|
+
export default AIEventErrorViewed;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
3
|
+
const AIEventSummaryViewed = ({
|
|
4
|
+
fromCache
|
|
5
|
+
}) => {
|
|
6
|
+
const {
|
|
7
|
+
fireEvent
|
|
8
|
+
} = useAnalyticsEvents();
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
fireEvent('ui.summary.viewed', {
|
|
11
|
+
fromCache
|
|
12
|
+
});
|
|
13
|
+
}, [fireEvent, fromCache]);
|
|
14
|
+
return null;
|
|
15
|
+
};
|
|
16
|
+
export default AIEventSummaryViewed;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,6 +13,9 @@ import { useAISummary } from '../../../../../../state/hooks/use-ai-summary';
|
|
|
13
13
|
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
14
14
|
import AIIcon from '../../../../../common/ai-icon';
|
|
15
15
|
import AISummary from '../../../../../common/ai-summary';
|
|
16
|
+
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
17
|
+
import AIEventSummaryViewed from '../ai-event-summary-viewed';
|
|
18
|
+
import AIEventErrorViewed from '../ai-event-error-viewed';
|
|
16
19
|
const AISummaryBlockResolvedView = props => {
|
|
17
20
|
const {
|
|
18
21
|
actions = [],
|
|
@@ -23,6 +26,9 @@ const AISummaryBlockResolvedView = props => {
|
|
|
23
26
|
testId
|
|
24
27
|
} = props;
|
|
25
28
|
const [aiState, setAIState] = useState('ready');
|
|
29
|
+
const {
|
|
30
|
+
fireEvent
|
|
31
|
+
} = useAnalyticsEvents();
|
|
26
32
|
const metadataElements = renderElementItems(metadata);
|
|
27
33
|
const context = useFlexibleUiContext();
|
|
28
34
|
const url = (context === null || context === void 0 ? void 0 : context.url) || '';
|
|
@@ -37,11 +43,12 @@ const AISummaryBlockResolvedView = props => {
|
|
|
37
43
|
isSummarisedOnMount
|
|
38
44
|
} = aiSummary;
|
|
39
45
|
const onAIActionClick = useCallback(() => {
|
|
46
|
+
fireEvent('ui.button.clicked.aiSummary', {});
|
|
40
47
|
setAIState('loading');
|
|
41
48
|
if (onAIActionChange) {
|
|
42
49
|
onAIActionChange('loading');
|
|
43
50
|
}
|
|
44
|
-
}, [onAIActionChange]);
|
|
51
|
+
}, [onAIActionChange, fireEvent]);
|
|
45
52
|
const combinedActions = useMemo(() => {
|
|
46
53
|
if (aiState === 'ready') {
|
|
47
54
|
const aiAction = {
|
|
@@ -67,6 +74,8 @@ const AISummaryBlockResolvedView = props => {
|
|
|
67
74
|
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
68
75
|
direction: SmartLinkDirection.Vertical,
|
|
69
76
|
testId: `${testId}-resolved-view`
|
|
77
|
+
}), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
|
|
78
|
+
fromCache: isSummarisedOnMount
|
|
70
79
|
}), /*#__PURE__*/React.createElement(AISummary, {
|
|
71
80
|
content: content,
|
|
72
81
|
showIcon: isSummarisedOnMount
|
|
@@ -88,7 +97,7 @@ const AISummaryBlockResolvedView = props => {
|
|
|
88
97
|
size: size
|
|
89
98
|
}))), status === 'error' && /*#__PURE__*/React.createElement(Inline, {
|
|
90
99
|
grow: "fill"
|
|
91
|
-
}, /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
100
|
+
}, /*#__PURE__*/React.createElement(AIEventErrorViewed, null), /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
92
101
|
state: status,
|
|
93
102
|
testId: testId
|
|
94
103
|
})));
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "26.48.
|
|
10
|
+
packageVersion: "26.48.8",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var EVENT_CHANNEL = 'media';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
/**
|
|
3
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
4
|
+
*
|
|
5
|
+
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
6
|
+
*
|
|
7
|
+
* @codegen <<SignedSource::0d08fdca953a1eb1130683499e509165>>
|
|
8
|
+
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
var createEventPayload = function createEventPayload(eventKey) {
|
|
12
|
+
for (var _len = arguments.length, _ref = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
13
|
+
_ref[_key - 1] = arguments[_key];
|
|
14
|
+
}
|
|
15
|
+
var attributes = _ref[0];
|
|
16
|
+
var _eventKey$split = eventKey.split('.'),
|
|
17
|
+
_eventKey$split2 = _slicedToArray(_eventKey$split, 4),
|
|
18
|
+
eventType = _eventKey$split2[0],
|
|
19
|
+
actionSubject = _eventKey$split2[1],
|
|
20
|
+
action = _eventKey$split2[2],
|
|
21
|
+
actionSubjectId = _eventKey$split2[3];
|
|
22
|
+
if (eventType === 'screen') {
|
|
23
|
+
return {
|
|
24
|
+
eventType: eventType,
|
|
25
|
+
name: actionSubject,
|
|
26
|
+
action: 'viewed',
|
|
27
|
+
attributes: attributes
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
eventType: eventType,
|
|
32
|
+
actionSubject: actionSubject,
|
|
33
|
+
action: action,
|
|
34
|
+
actionSubjectId: actionSubjectId,
|
|
35
|
+
attributes: attributes
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export default createEventPayload;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::5fbe35afe0479810b090b1746dd1ae71>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
|
+
*/
|
|
9
|
+
import { useCallback } from 'react';
|
|
10
|
+
import { useAnalyticsEvents as useAnalyticsNextEvents } from '@atlaskit/analytics-next';
|
|
11
|
+
import { EVENT_CHANNEL } from '../constants';
|
|
12
|
+
import createEventPayload from './create-event-payload';
|
|
13
|
+
export var useAnalyticsEvents = function useAnalyticsEvents() {
|
|
14
|
+
var _useAnalyticsNextEven = useAnalyticsNextEvents(),
|
|
15
|
+
createAnalyticsEvent = _useAnalyticsNextEven.createAnalyticsEvent;
|
|
16
|
+
var fireEvent = useCallback(function () {
|
|
17
|
+
var event = createAnalyticsEvent(createEventPayload.apply(void 0, arguments));
|
|
18
|
+
event.fire(EVENT_CHANNEL);
|
|
19
|
+
}, [createAnalyticsEvent]);
|
|
20
|
+
return {
|
|
21
|
+
fireEvent: fireEvent
|
|
22
|
+
};
|
|
23
|
+
};
|
package/dist/esm/i18n/zh.js
CHANGED
|
@@ -11,6 +11,9 @@ export default {
|
|
|
11
11
|
'fabric.linking.actions': '操作',
|
|
12
12
|
'fabric.linking.add_account': '添加帐户',
|
|
13
13
|
'fabric.linking.ai_summarize': '汇总',
|
|
14
|
+
'fabric.linking.ai_summarized': '由 Atlassian Intelligence 汇总',
|
|
15
|
+
'fabric.linking.ai_summarized_info': '信息质量可能有所不同。<a>了解更多</a>',
|
|
16
|
+
'fabric.linking.ai_summarizing': 'Atlassian Intelligence 正在运行...',
|
|
14
17
|
'fabric.linking.assigned_to': '已分配给 {context}',
|
|
15
18
|
'fabric.linking.cancel': '取消',
|
|
16
19
|
'fabric.linking.cannot_connect': '无法连接,请重试',
|
|
@@ -35,6 +38,7 @@ export default {
|
|
|
35
38
|
'fabric.linking.create_on_relative': '创建时间:{context}',
|
|
36
39
|
'fabric.linking.created_by': '创建者:{context}',
|
|
37
40
|
'fabric.linking.delete': '删除',
|
|
41
|
+
'fabric.linking.direct_access': '立即加入',
|
|
38
42
|
'fabric.linking.direct_access_description': '您的团队使用 {product} 进行协作,而您可以立即开始使用该产品!',
|
|
39
43
|
'fabric.linking.direct_access_title': '加入 {product} 即可查看此内容',
|
|
40
44
|
'fabric.linking.download': '下载',
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.48.
|
|
18
|
+
packageVersion: "26.48.8"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-error-viewed/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
3
|
+
var AIEventErrorViewed = function AIEventErrorViewed() {
|
|
4
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
5
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
6
|
+
useEffect(function () {
|
|
7
|
+
fireEvent('ui.error.viewed.aiSummary', {});
|
|
8
|
+
}, [fireEvent]);
|
|
9
|
+
return null;
|
|
10
|
+
};
|
|
11
|
+
export default AIEventErrorViewed;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
3
|
+
var AIEventSummaryViewed = function AIEventSummaryViewed(_ref) {
|
|
4
|
+
var fromCache = _ref.fromCache;
|
|
5
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
6
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
7
|
+
useEffect(function () {
|
|
8
|
+
fireEvent('ui.summary.viewed', {
|
|
9
|
+
fromCache: fromCache
|
|
10
|
+
});
|
|
11
|
+
}, [fireEvent, fromCache]);
|
|
12
|
+
return null;
|
|
13
|
+
};
|
|
14
|
+
export default AIEventSummaryViewed;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,6 +15,9 @@ import { useAISummary } from '../../../../../../state/hooks/use-ai-summary';
|
|
|
15
15
|
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
16
16
|
import AIIcon from '../../../../../common/ai-icon';
|
|
17
17
|
import AISummary from '../../../../../common/ai-summary';
|
|
18
|
+
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
19
|
+
import AIEventSummaryViewed from '../ai-event-summary-viewed';
|
|
20
|
+
import AIEventErrorViewed from '../ai-event-error-viewed';
|
|
18
21
|
var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
19
22
|
var _props$actions = props.actions,
|
|
20
23
|
actions = _props$actions === void 0 ? [] : _props$actions,
|
|
@@ -28,6 +31,8 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
28
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
32
|
aiState = _useState2[0],
|
|
30
33
|
setAIState = _useState2[1];
|
|
34
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
35
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
31
36
|
var metadataElements = renderElementItems(metadata);
|
|
32
37
|
var context = useFlexibleUiContext();
|
|
33
38
|
var url = (context === null || context === void 0 ? void 0 : context.url) || '';
|
|
@@ -39,11 +44,12 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
39
44
|
status = _aiSummary$state.status,
|
|
40
45
|
isSummarisedOnMount = aiSummary.isSummarisedOnMount;
|
|
41
46
|
var onAIActionClick = useCallback(function () {
|
|
47
|
+
fireEvent('ui.button.clicked.aiSummary', {});
|
|
42
48
|
setAIState('loading');
|
|
43
49
|
if (onAIActionChange) {
|
|
44
50
|
onAIActionChange('loading');
|
|
45
51
|
}
|
|
46
|
-
}, [onAIActionChange]);
|
|
52
|
+
}, [onAIActionChange, fireEvent]);
|
|
47
53
|
var combinedActions = useMemo(function () {
|
|
48
54
|
if (aiState === 'ready') {
|
|
49
55
|
var aiAction = {
|
|
@@ -69,6 +75,8 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
69
75
|
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
70
76
|
direction: SmartLinkDirection.Vertical,
|
|
71
77
|
testId: "".concat(testId, "-resolved-view")
|
|
78
|
+
}), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
|
|
79
|
+
fromCache: isSummarisedOnMount
|
|
72
80
|
}), /*#__PURE__*/React.createElement(AISummary, {
|
|
73
81
|
content: content,
|
|
74
82
|
showIcon: isSummarisedOnMount
|
|
@@ -90,7 +98,7 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
90
98
|
size: size
|
|
91
99
|
}))), status === 'error' && /*#__PURE__*/React.createElement(Inline, {
|
|
92
100
|
grow: "fill"
|
|
93
|
-
}, /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
101
|
+
}, /*#__PURE__*/React.createElement(AIEventErrorViewed, null), /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
94
102
|
state: status,
|
|
95
103
|
testId: testId
|
|
96
104
|
})));
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.48.
|
|
13
|
+
packageVersion: "26.48.8",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EVENT_CHANNEL = "media";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::7957a4f104d8499ba8c1d791bc4c61e2>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
|
+
*/
|
|
9
|
+
export type PackageMetaDataType = {
|
|
10
|
+
packageName: string;
|
|
11
|
+
packageVersion: string;
|
|
12
|
+
};
|
|
13
|
+
export type ResolvedAttributesType = {
|
|
14
|
+
status: 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found' | null;
|
|
15
|
+
statusDetails: string | null;
|
|
16
|
+
displayCategory: 'smartLink' | 'link';
|
|
17
|
+
extensionKey: string | null;
|
|
18
|
+
destinationProduct: string | null;
|
|
19
|
+
destinationSubproduct: string | null;
|
|
20
|
+
destinationCategory: string | null;
|
|
21
|
+
destinationObjectId: string | null;
|
|
22
|
+
destinationObjectType: string | null;
|
|
23
|
+
destinationContainerId: string | null;
|
|
24
|
+
destinationTenantId: string | null;
|
|
25
|
+
canBeDatasource: boolean | null;
|
|
26
|
+
};
|
|
27
|
+
export type ButtonClickedAiSummaryAttributesType = {};
|
|
28
|
+
export type SummaryViewedAttributesType = {};
|
|
29
|
+
export type ErrorViewedAiSummaryAttributesType = {};
|
|
30
|
+
export type AnalyticsEventAttributes = {
|
|
31
|
+
/**
|
|
32
|
+
* fired when an ai summary is clicked */
|
|
33
|
+
'ui.button.clicked.aiSummary': ButtonClickedAiSummaryAttributesType;
|
|
34
|
+
/**
|
|
35
|
+
* fired when a summary is viewed */
|
|
36
|
+
'ui.summary.viewed': SummaryViewedAttributesType;
|
|
37
|
+
/**
|
|
38
|
+
* fired when a summary error is viewed */
|
|
39
|
+
'ui.error.viewed.aiSummary': ErrorViewedAiSummaryAttributesType;
|
|
40
|
+
};
|
|
41
|
+
export type EventKey = keyof AnalyticsEventAttributes;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::0d08fdca953a1eb1130683499e509165>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
|
+
*/
|
|
9
|
+
import { AnalyticsEventAttributes, EventKey } from './analytics.types';
|
|
10
|
+
type OptionalIfUndefined<T> = undefined extends T ? [param?: T] : [param: T];
|
|
11
|
+
export type EventPayloadAttributes<K extends EventKey> = OptionalIfUndefined<AnalyticsEventAttributes[K]>;
|
|
12
|
+
type EventTypes = 'ui' | 'track' | 'operational' | 'screen';
|
|
13
|
+
type ScreenEventPayload<K extends EventKey> = {
|
|
14
|
+
eventType: 'screen';
|
|
15
|
+
name: string;
|
|
16
|
+
action: 'viewed';
|
|
17
|
+
attributes?: AnalyticsEventAttributes[K];
|
|
18
|
+
};
|
|
19
|
+
type EventPayload<K extends EventKey> = {
|
|
20
|
+
eventType: Omit<EventTypes, 'screen'>;
|
|
21
|
+
actionSubject: string;
|
|
22
|
+
action: string;
|
|
23
|
+
actionSubjectId?: string;
|
|
24
|
+
attributes?: AnalyticsEventAttributes[K];
|
|
25
|
+
};
|
|
26
|
+
declare const createEventPayload: <K extends keyof AnalyticsEventAttributes>(eventKey: K, ...[attributes]: OptionalIfUndefined<AnalyticsEventAttributes[K]>) => ScreenEventPayload<K> | EventPayload<K>;
|
|
27
|
+
export default createEventPayload;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const useAnalyticsEvents: () => {
|
|
2
|
+
fireEvent: <K extends keyof import("./analytics.types").AnalyticsEventAttributes>(params_0: K, ...params_1: undefined extends import("./analytics.types").AnalyticsEventAttributes[K] ? [param?: import("./analytics.types").AnalyticsEventAttributes[K] | undefined] : [param: import("./analytics.types").AnalyticsEventAttributes[K]]) => void;
|
|
3
|
+
};
|
package/dist/types/i18n/zh.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ declare const _default: {
|
|
|
9
9
|
'fabric.linking.actions': string;
|
|
10
10
|
'fabric.linking.add_account': string;
|
|
11
11
|
'fabric.linking.ai_summarize': string;
|
|
12
|
+
'fabric.linking.ai_summarized': string;
|
|
13
|
+
'fabric.linking.ai_summarized_info': string;
|
|
14
|
+
'fabric.linking.ai_summarizing': string;
|
|
12
15
|
'fabric.linking.assigned_to': string;
|
|
13
16
|
'fabric.linking.cancel': string;
|
|
14
17
|
'fabric.linking.cannot_connect': string;
|
|
@@ -33,6 +36,7 @@ declare const _default: {
|
|
|
33
36
|
'fabric.linking.create_on_relative': string;
|
|
34
37
|
'fabric.linking.created_by': string;
|
|
35
38
|
'fabric.linking.delete': string;
|
|
39
|
+
'fabric.linking.direct_access': string;
|
|
36
40
|
'fabric.linking.direct_access_description': string;
|
|
37
41
|
'fabric.linking.direct_access_title': string;
|
|
38
42
|
'fabric.linking.download': string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EVENT_CHANNEL = "media";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::7957a4f104d8499ba8c1d791bc4c61e2>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
|
+
*/
|
|
9
|
+
export type PackageMetaDataType = {
|
|
10
|
+
packageName: string;
|
|
11
|
+
packageVersion: string;
|
|
12
|
+
};
|
|
13
|
+
export type ResolvedAttributesType = {
|
|
14
|
+
status: 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found' | null;
|
|
15
|
+
statusDetails: string | null;
|
|
16
|
+
displayCategory: 'smartLink' | 'link';
|
|
17
|
+
extensionKey: string | null;
|
|
18
|
+
destinationProduct: string | null;
|
|
19
|
+
destinationSubproduct: string | null;
|
|
20
|
+
destinationCategory: string | null;
|
|
21
|
+
destinationObjectId: string | null;
|
|
22
|
+
destinationObjectType: string | null;
|
|
23
|
+
destinationContainerId: string | null;
|
|
24
|
+
destinationTenantId: string | null;
|
|
25
|
+
canBeDatasource: boolean | null;
|
|
26
|
+
};
|
|
27
|
+
export type ButtonClickedAiSummaryAttributesType = {};
|
|
28
|
+
export type SummaryViewedAttributesType = {};
|
|
29
|
+
export type ErrorViewedAiSummaryAttributesType = {};
|
|
30
|
+
export type AnalyticsEventAttributes = {
|
|
31
|
+
/**
|
|
32
|
+
* fired when an ai summary is clicked */
|
|
33
|
+
'ui.button.clicked.aiSummary': ButtonClickedAiSummaryAttributesType;
|
|
34
|
+
/**
|
|
35
|
+
* fired when a summary is viewed */
|
|
36
|
+
'ui.summary.viewed': SummaryViewedAttributesType;
|
|
37
|
+
/**
|
|
38
|
+
* fired when a summary error is viewed */
|
|
39
|
+
'ui.error.viewed.aiSummary': ErrorViewedAiSummaryAttributesType;
|
|
40
|
+
};
|
|
41
|
+
export type EventKey = keyof AnalyticsEventAttributes;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::0d08fdca953a1eb1130683499e509165>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
|
+
*/
|
|
9
|
+
import { AnalyticsEventAttributes, EventKey } from './analytics.types';
|
|
10
|
+
type OptionalIfUndefined<T> = undefined extends T ? [
|
|
11
|
+
param?: T
|
|
12
|
+
] : [
|
|
13
|
+
param: T
|
|
14
|
+
];
|
|
15
|
+
export type EventPayloadAttributes<K extends EventKey> = OptionalIfUndefined<AnalyticsEventAttributes[K]>;
|
|
16
|
+
type EventTypes = 'ui' | 'track' | 'operational' | 'screen';
|
|
17
|
+
type ScreenEventPayload<K extends EventKey> = {
|
|
18
|
+
eventType: 'screen';
|
|
19
|
+
name: string;
|
|
20
|
+
action: 'viewed';
|
|
21
|
+
attributes?: AnalyticsEventAttributes[K];
|
|
22
|
+
};
|
|
23
|
+
type EventPayload<K extends EventKey> = {
|
|
24
|
+
eventType: Omit<EventTypes, 'screen'>;
|
|
25
|
+
actionSubject: string;
|
|
26
|
+
action: string;
|
|
27
|
+
actionSubjectId?: string;
|
|
28
|
+
attributes?: AnalyticsEventAttributes[K];
|
|
29
|
+
};
|
|
30
|
+
declare const createEventPayload: <K extends keyof AnalyticsEventAttributes>(eventKey: K, ...[attributes]: OptionalIfUndefined<AnalyticsEventAttributes[K]>) => ScreenEventPayload<K> | EventPayload<K>;
|
|
31
|
+
export default createEventPayload;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const useAnalyticsEvents: () => {
|
|
2
|
+
fireEvent: <K extends keyof import("./analytics.types").AnalyticsEventAttributes>(params_0: K, ...params_1: undefined extends import("./analytics.types").AnalyticsEventAttributes[K] ? [
|
|
3
|
+
param?: import("./analytics.types").AnalyticsEventAttributes[K] | undefined
|
|
4
|
+
] : [
|
|
5
|
+
param: import("./analytics.types").AnalyticsEventAttributes[K]
|
|
6
|
+
]) => void;
|
|
7
|
+
};
|
|
@@ -9,6 +9,9 @@ declare const _default: {
|
|
|
9
9
|
'fabric.linking.actions': string;
|
|
10
10
|
'fabric.linking.add_account': string;
|
|
11
11
|
'fabric.linking.ai_summarize': string;
|
|
12
|
+
'fabric.linking.ai_summarized': string;
|
|
13
|
+
'fabric.linking.ai_summarized_info': string;
|
|
14
|
+
'fabric.linking.ai_summarizing': string;
|
|
12
15
|
'fabric.linking.assigned_to': string;
|
|
13
16
|
'fabric.linking.cancel': string;
|
|
14
17
|
'fabric.linking.cannot_connect': string;
|
|
@@ -33,6 +36,7 @@ declare const _default: {
|
|
|
33
36
|
'fabric.linking.create_on_relative': string;
|
|
34
37
|
'fabric.linking.created_by': string;
|
|
35
38
|
'fabric.linking.delete': string;
|
|
39
|
+
'fabric.linking.direct_access': string;
|
|
36
40
|
'fabric.linking.direct_access_description': string;
|
|
37
41
|
'fabric.linking.direct_access_title': string;
|
|
38
42
|
'fabric.linking.download': string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.48.
|
|
3
|
+
"version": "26.48.8",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,14 +24,17 @@
|
|
|
24
24
|
"name": "Smart Card"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"analytics:codegen": "yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card --output ./src/common/analytics/generated"
|
|
29
|
+
},
|
|
27
30
|
"dependencies": {
|
|
28
31
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
29
32
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
30
33
|
"@atlaskit/avatar": "^21.5.0",
|
|
31
34
|
"@atlaskit/avatar-group": "^9.5.0",
|
|
32
35
|
"@atlaskit/badge": "^15.2.0",
|
|
33
|
-
"@atlaskit/button": "^17.
|
|
34
|
-
"@atlaskit/dropdown-menu": "^12.
|
|
36
|
+
"@atlaskit/button": "^17.7.0",
|
|
37
|
+
"@atlaskit/dropdown-menu": "^12.7.0",
|
|
35
38
|
"@atlaskit/icon": "^22.1.0",
|
|
36
39
|
"@atlaskit/icon-file-type": "^6.4.0",
|
|
37
40
|
"@atlaskit/icon-object": "^6.3.0",
|
|
@@ -40,18 +43,18 @@
|
|
|
40
43
|
"@atlaskit/link-analytics": "^8.3.0",
|
|
41
44
|
"@atlaskit/link-client-extension": "^1.8.0",
|
|
42
45
|
"@atlaskit/link-extractors": "^1.2.0",
|
|
43
|
-
"@atlaskit/linking-common": "^5.
|
|
44
|
-
"@atlaskit/linking-types": "^8.
|
|
46
|
+
"@atlaskit/linking-common": "^5.4.0",
|
|
47
|
+
"@atlaskit/linking-types": "^8.7.0",
|
|
45
48
|
"@atlaskit/logo": "^13.15.0",
|
|
46
49
|
"@atlaskit/lozenge": "^11.6.0",
|
|
47
50
|
"@atlaskit/modal-dialog": "^12.10.0",
|
|
48
51
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
49
52
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
50
53
|
"@atlaskit/popup": "^1.13.0",
|
|
51
|
-
"@atlaskit/primitives": "^
|
|
54
|
+
"@atlaskit/primitives": "^4.0.0",
|
|
52
55
|
"@atlaskit/spinner": "^16.0.0",
|
|
53
56
|
"@atlaskit/theme": "^12.6.0",
|
|
54
|
-
"@atlaskit/tokens": "^1.
|
|
57
|
+
"@atlaskit/tokens": "^1.39.0",
|
|
55
58
|
"@atlaskit/tooltip": "^18.1.0",
|
|
56
59
|
"@atlaskit/ufo": "^0.2.0",
|
|
57
60
|
"@babel/runtime": "^7.0.0",
|
|
@@ -71,7 +74,7 @@
|
|
|
71
74
|
"uuid": "^3.1.0"
|
|
72
75
|
},
|
|
73
76
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/link-provider": "^1.
|
|
77
|
+
"@atlaskit/link-provider": "^1.8.0",
|
|
75
78
|
"react": "^16.8.0",
|
|
76
79
|
"react-dom": "^16.8.0",
|
|
77
80
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -85,6 +88,7 @@
|
|
|
85
88
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
86
89
|
"@atlaskit/ssr": "*",
|
|
87
90
|
"@atlaskit/visual-regression": "*",
|
|
91
|
+
"@atlassian/analytics-tooling": "*",
|
|
88
92
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
89
93
|
"@atlassian/feature-flags-test-utils": "^0.2.0",
|
|
90
94
|
"@testing-library/dom": "^8.17.1",
|