@atlaskit/smart-card 26.49.2 → 26.50.0

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/analytics.spec.yaml +17 -0
  3. package/dist/cjs/common/analytics/generated/analytics.types.js +1 -5
  4. package/dist/cjs/extractors/common/detail/types.js +1 -5
  5. package/dist/cjs/state/analytics/ufoExperiences.js +9 -1
  6. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +46 -34
  7. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -5
  8. package/dist/cjs/state/hooks/use-ai-summary/index.js +23 -1
  9. package/dist/cjs/state/types.js +1 -5
  10. package/dist/cjs/utils/analytics/analytics.js +1 -1
  11. package/dist/cjs/view/EmbedModal/components/embed-content/types.js +1 -5
  12. package/dist/cjs/view/EmbedModal/components/link-info/link-info-button/types.js +1 -5
  13. package/dist/cjs/view/FlexibleCard/components/actions/action/action-dropdown-item/types.js +1 -5
  14. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/index.js +2 -1
  15. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +1 -2
  16. package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +3 -2
  17. package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/types.js +1 -5
  18. package/dist/cjs/view/FlexibleCard/components/common/image-icon/types.js +1 -5
  19. package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/types.js +1 -5
  20. package/dist/cjs/view/FlexibleCard/components/container/layered-link/types.js +1 -5
  21. package/dist/cjs/view/LinkUrl/index.js +1 -1
  22. package/dist/cjs/view/LinkUrl/types.js +1 -5
  23. package/dist/cjs/view/common/ai-summary/index.js +1 -1
  24. package/dist/es2019/common/analytics/generated/analytics.types.js +0 -1
  25. package/dist/es2019/extractors/common/detail/types.js +0 -1
  26. package/dist/es2019/state/analytics/ufoExperiences.js +9 -1
  27. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +10 -0
  28. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/types.js +0 -1
  29. package/dist/es2019/state/hooks/use-ai-summary/index.js +24 -2
  30. package/dist/es2019/state/types.js +0 -1
  31. package/dist/es2019/utils/analytics/analytics.js +1 -1
  32. package/dist/es2019/view/EmbedModal/components/embed-content/types.js +0 -1
  33. package/dist/es2019/view/EmbedModal/components/link-info/link-info-button/types.js +0 -1
  34. package/dist/es2019/view/FlexibleCard/components/actions/action/action-dropdown-item/types.js +0 -1
  35. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/index.js +1 -1
  36. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +1 -2
  37. package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +3 -2
  38. package/dist/es2019/view/FlexibleCard/components/blocks/related-urls-block/types.js +0 -1
  39. package/dist/es2019/view/FlexibleCard/components/common/image-icon/types.js +0 -1
  40. package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/types.js +0 -1
  41. package/dist/es2019/view/FlexibleCard/components/container/layered-link/types.js +0 -1
  42. package/dist/es2019/view/LinkUrl/index.js +1 -1
  43. package/dist/es2019/view/LinkUrl/types.js +0 -1
  44. package/dist/es2019/view/common/ai-summary/index.js +1 -1
  45. package/dist/esm/common/analytics/generated/analytics.types.js +0 -1
  46. package/dist/esm/extractors/common/detail/types.js +0 -1
  47. package/dist/esm/state/analytics/ufoExperiences.js +9 -1
  48. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +46 -34
  49. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/types.js +0 -1
  50. package/dist/esm/state/hooks/use-ai-summary/index.js +24 -2
  51. package/dist/esm/state/types.js +0 -1
  52. package/dist/esm/utils/analytics/analytics.js +1 -1
  53. package/dist/esm/view/EmbedModal/components/embed-content/types.js +0 -1
  54. package/dist/esm/view/EmbedModal/components/link-info/link-info-button/types.js +0 -1
  55. package/dist/esm/view/FlexibleCard/components/actions/action/action-dropdown-item/types.js +0 -1
  56. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/index.js +2 -1
  57. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +1 -2
  58. package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +3 -2
  59. package/dist/esm/view/FlexibleCard/components/blocks/related-urls-block/types.js +0 -1
  60. package/dist/esm/view/FlexibleCard/components/common/image-icon/types.js +0 -1
  61. package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/types.js +0 -1
  62. package/dist/esm/view/FlexibleCard/components/container/layered-link/types.js +0 -1
  63. package/dist/esm/view/LinkUrl/index.js +1 -1
  64. package/dist/esm/view/LinkUrl/types.js +0 -1
  65. package/dist/esm/view/common/ai-summary/index.js +1 -1
  66. package/dist/types/common/analytics/generated/analytics.types.d.ts +14 -2
  67. package/dist/types/state/analytics/ufoExperiences.d.ts +1 -1
  68. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +3 -0
  69. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +3 -0
  70. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/types.d.ts +2 -1
  71. package/dist/types/view/FlexibleCard/components/blocks/footer-block/types.d.ts +4 -0
  72. package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +14 -2
  73. package/dist/types-ts4.5/state/analytics/ufoExperiences.d.ts +1 -1
  74. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +3 -0
  75. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +3 -0
  76. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-event-summary-viewed/types.d.ts +2 -1
  77. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/footer-block/types.d.ts +4 -0
  78. package/package.json +1 -1
@@ -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.49.2",
10
+ packageVersion: "26.50.0",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -1 +0,0 @@
1
- export {};
@@ -34,7 +34,7 @@ const AISummary = ({
34
34
  return jsx(Markdown, {
35
35
  "data-testid": testId,
36
36
  css: [AISummaryCSS, overrideCss],
37
- children: showIcon ? `${content} <Icon />` : content,
37
+ children: showIcon ? `${content}&nbsp;<Icon />` : content,
38
38
  options: {
39
39
  forceWrapper: true,
40
40
  overrides: {
@@ -1 +0,0 @@
1
- export {};
@@ -13,10 +13,18 @@ var renderExperience = {
13
13
  type: ExperienceTypes.Load,
14
14
  performanceType: ExperiencePerformanceTypes.PageSegmentLoad
15
15
  };
16
+ var aiExperience = {
17
+ platform: {
18
+ component: 'smart-links'
19
+ },
20
+ type: ExperienceTypes.Experience,
21
+ performanceType: ExperiencePerformanceTypes.PageSegmentLoad
22
+ };
16
23
  var ufoExperiences = {
17
24
  'smart-link-rendered': new ConcurrentExperience('smart-link-rendered', renderExperience),
18
25
  'smart-link-authenticated': new ConcurrentExperience('smart-link-authenticated', inlineExperience),
19
- 'smart-link-action-invocation': new ConcurrentExperience('smart-link-action-invocation', inlineExperience)
26
+ 'smart-link-action-invocation': new ConcurrentExperience('smart-link-action-invocation', inlineExperience),
27
+ 'smart-link-ai-summary': new ConcurrentExperience('smart-link-ai-summary', aiExperience)
20
28
  };
21
29
  export var startUfoExperience = function startUfoExperience(experienceName, id, properties) {
22
30
  var experience = ufoExperiences[experienceName].getInstance(id);
@@ -10,6 +10,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
10
10
  import _regeneratorRuntime from "@babel/runtime/regenerator";
11
11
  function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
12
12
  function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(r) { var n = this.s.return; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, throw: function _throw(r) { var n = this.s.return; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
13
+ import uuid from 'uuid';
13
14
  import { readStream, addPath } from './utils';
14
15
  export var AISummaryService = /*#__PURE__*/function () {
15
16
  function AISummaryService(props) {
@@ -75,6 +76,9 @@ export var AISummaryService = /*#__PURE__*/function () {
75
76
  headers: _objectSpread({}, props.headers || defaultConfig.headers)
76
77
  };
77
78
  this.url = props.url;
79
+ this.onStart = props.onStart;
80
+ this.onSuccess = props.onSuccess;
81
+ this.onError = props.onError;
78
82
  }
79
83
  _createClass(AISummaryService, [{
80
84
  key: "summariseUrl",
@@ -84,6 +88,9 @@ export var AISummaryService = /*#__PURE__*/function () {
84
88
  _iterator2,
85
89
  _step2,
86
90
  _subscriber,
91
+ id,
92
+ _this$onStart,
93
+ _this$onSuccess,
87
94
  stream,
88
95
  bufferContent,
89
96
  _iteratorAbruptCompletion,
@@ -95,6 +102,7 @@ export var AISummaryService = /*#__PURE__*/function () {
95
102
  _iterator3,
96
103
  _step3,
97
104
  subscriber,
105
+ _this$onError,
98
106
  _iterator4,
99
107
  _step4,
100
108
  _subscriber2,
@@ -118,22 +126,24 @@ export var AISummaryService = /*#__PURE__*/function () {
118
126
  } finally {
119
127
  _iterator2.f();
120
128
  }
121
- _context2.prev = 4;
122
- _context2.next = 7;
129
+ id = uuid();
130
+ _context2.prev = 5;
131
+ (_this$onStart = this.onStart) === null || _this$onStart === void 0 || _this$onStart.call(this, id);
132
+ _context2.next = 9;
123
133
  return this.fetchStream(summaryStyle);
124
- case 7:
134
+ case 9:
125
135
  stream = _context2.sent;
126
136
  bufferContent = '';
127
137
  _iteratorAbruptCompletion = false;
128
138
  _didIteratorError = false;
129
- _context2.prev = 11;
139
+ _context2.prev = 13;
130
140
  _iterator = _asyncIterator(stream);
131
- case 13:
132
- _context2.next = 15;
133
- return _iterator.next();
134
141
  case 15:
142
+ _context2.next = 17;
143
+ return _iterator.next();
144
+ case 17:
135
145
  if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
136
- _context2.next = 22;
146
+ _context2.next = 24;
137
147
  break;
138
148
  }
139
149
  chunk = _step.value;
@@ -158,53 +168,55 @@ export var AISummaryService = /*#__PURE__*/function () {
158
168
  if (chunk.type === 'FINAL_RESPONSE') {
159
169
  bufferContent = chunk.message.message.content;
160
170
  }
161
- case 19:
171
+ case 21:
162
172
  _iteratorAbruptCompletion = false;
163
- _context2.next = 13;
164
- break;
165
- case 22:
166
- _context2.next = 28;
173
+ _context2.next = 15;
167
174
  break;
168
175
  case 24:
169
- _context2.prev = 24;
170
- _context2.t0 = _context2["catch"](11);
176
+ _context2.next = 30;
177
+ break;
178
+ case 26:
179
+ _context2.prev = 26;
180
+ _context2.t0 = _context2["catch"](13);
171
181
  _didIteratorError = true;
172
182
  _iteratorError = _context2.t0;
173
- case 28:
174
- _context2.prev = 28;
175
- _context2.prev = 29;
183
+ case 30:
184
+ _context2.prev = 30;
185
+ _context2.prev = 31;
176
186
  if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
177
- _context2.next = 33;
187
+ _context2.next = 35;
178
188
  break;
179
189
  }
180
- _context2.next = 33;
190
+ _context2.next = 35;
181
191
  return _iterator.return();
182
- case 33:
183
- _context2.prev = 33;
192
+ case 35:
193
+ _context2.prev = 35;
184
194
  if (!_didIteratorError) {
185
- _context2.next = 36;
195
+ _context2.next = 38;
186
196
  break;
187
197
  }
188
198
  throw _iteratorError;
189
- case 36:
190
- return _context2.finish(33);
191
- case 37:
192
- return _context2.finish(28);
193
199
  case 38:
200
+ return _context2.finish(35);
201
+ case 39:
202
+ return _context2.finish(30);
203
+ case 40:
204
+ (_this$onSuccess = this.onSuccess) === null || _this$onSuccess === void 0 || _this$onSuccess.call(this, id);
194
205
  this.state = {
195
206
  status: 'done',
196
207
  content: bufferContent
197
208
  };
198
- _context2.next = 44;
209
+ _context2.next = 48;
199
210
  break;
200
- case 41:
201
- _context2.prev = 41;
202
- _context2.t1 = _context2["catch"](4);
211
+ case 44:
212
+ _context2.prev = 44;
213
+ _context2.t1 = _context2["catch"](5);
214
+ (_this$onError = this.onError) === null || _this$onError === void 0 || _this$onError.call(this, id, 'generic');
203
215
  this.state = {
204
216
  status: 'error',
205
217
  content: ''
206
218
  };
207
- case 44:
219
+ case 48:
208
220
  _iterator4 = _createForOfIteratorHelper(this.subscribedStateSetters);
209
221
  try {
210
222
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
@@ -216,11 +228,11 @@ export var AISummaryService = /*#__PURE__*/function () {
216
228
  } finally {
217
229
  _iterator4.f();
218
230
  }
219
- case 46:
231
+ case 50:
220
232
  case "end":
221
233
  return _context2.stop();
222
234
  }
223
- }, _callee2, this, [[4, 41], [11, 24, 28, 38], [29,, 33, 37]]);
235
+ }, _callee2, this, [[5, 44], [13, 26, 30, 40], [31,, 35, 39]]);
224
236
  }));
225
237
  function summariseUrl() {
226
238
  return _summariseUrl.apply(this, arguments);
@@ -1,7 +1,10 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import { useState, useEffect } from 'react';
2
+ import { useCallback, useState, useEffect } from 'react';
3
3
  import { AISummariesStore } from './ai-summary-service/store';
4
4
  import { AISummaryService } from './ai-summary-service';
5
+ import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
6
+ import { failUfoExperience, startUfoExperience, succeedUfoExperience } from '../../analytics';
7
+ var EXPERIENCE_NAME = 'smart-link-ai-summary';
5
8
  export var useAISummary = function useAISummary(props) {
6
9
  var _AISummariesStore$get;
7
10
  var url = props.url,
@@ -15,6 +18,22 @@ export var useAISummary = function useAISummary(props) {
15
18
  _useState2 = _slicedToArray(_useState, 2),
16
19
  state = _useState2[0],
17
20
  setState = _useState2[1];
21
+ var _useAnalyticsEvents = useAnalyticsEvents(),
22
+ fireEvent = _useAnalyticsEvents.fireEvent;
23
+ var onStart = useCallback(function (id) {
24
+ startUfoExperience(EXPERIENCE_NAME, id);
25
+ }, []);
26
+ var onSuccess = useCallback(function (id) {
27
+ fireEvent('operational.summary.success', {});
28
+ succeedUfoExperience(EXPERIENCE_NAME, id);
29
+ }, [fireEvent]);
30
+ var onError = useCallback(function (id) {
31
+ var reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
32
+ fireEvent('operational.summary.failed', {
33
+ reason: reason
34
+ });
35
+ failUfoExperience(EXPERIENCE_NAME, id);
36
+ }, [fireEvent]);
18
37
  useEffect(function () {
19
38
  var _AISummariesStore$get2;
20
39
  if (!AISummariesStore.get(url)) {
@@ -22,13 +41,16 @@ export var useAISummary = function useAISummary(props) {
22
41
  url: url,
23
42
  baseUrl: baseUrl,
24
43
  headers: headers,
44
+ onError: onError,
45
+ onStart: onStart,
46
+ onSuccess: onSuccess,
25
47
  product: product
26
48
  }));
27
49
  }
28
50
 
29
51
  //returns function that calls unsubscribe method
30
52
  return (_AISummariesStore$get2 = AISummariesStore.get(url)) === null || _AISummariesStore$get2 === void 0 ? void 0 : _AISummariesStore$get2.subscribe(setState);
31
- }, [url, baseUrl, headers, product]);
53
+ }, [url, baseUrl, headers, onError, onStart, onSuccess, product]);
32
54
  var summariseUrl = function summariseUrl() {
33
55
  var _AISummariesStore$get3;
34
56
  return (_AISummariesStore$get3 = AISummariesStore.get(url)) === null || _AISummariesStore$get3 === void 0 ? void 0 : _AISummariesStore$get3.summariseUrl();
@@ -1 +0,0 @@
1
- export {};
@@ -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.49.2"
18
+ packageVersion: "26.50.0"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,7 +1,8 @@
1
1
  import { useEffect } from 'react';
2
2
  import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
3
3
  var AIEventSummaryViewed = function AIEventSummaryViewed(_ref) {
4
- var fromCache = _ref.fromCache;
4
+ var _ref$fromCache = _ref.fromCache,
5
+ fromCache = _ref$fromCache === void 0 ? null : _ref$fromCache;
5
6
  var _useAnalyticsEvents = useAnalyticsEvents(),
6
7
  fireEvent = _useAnalyticsEvents.fireEvent;
7
8
  useEffect(function () {
@@ -42,8 +42,7 @@ var iconTooltipDescStyles = xcss({
42
42
  lineHeight: '14px'
43
43
  });
44
44
  var iconTooltipTriggerStyles = xcss({
45
- position: 'relative',
46
- bottom: 'space.negative.050'
45
+ verticalAlign: 'bottom'
47
46
  });
48
47
  var AIStateDone = function AIStateDone(_ref) {
49
48
  var appearance = _ref.appearance,
@@ -12,7 +12,8 @@ var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
12
12
  testId = props.testId,
13
13
  onActionMenuOpenChange = props.onActionMenuOpenChange,
14
14
  _props$size = props.size,
15
- size = _props$size === void 0 ? SmartLinkSize.Medium : _props$size;
15
+ size = _props$size === void 0 ? SmartLinkSize.Medium : _props$size,
16
+ hideProvider = props.hideProvider;
16
17
  var context = useFlexibleUiContext();
17
18
  var hasActions = useMemo(function () {
18
19
  var _filterActionItems;
@@ -27,7 +28,7 @@ var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
27
28
  }, [onActionMenuOpenChange]);
28
29
  return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
29
30
  testId: "".concat(testId, "-resolved-view")
30
- }), /*#__PURE__*/React.createElement(Provider, {
31
+ }), !hideProvider && /*#__PURE__*/React.createElement(Provider, {
31
32
  testId: "".concat(testId, "-provider")
32
33
  }), actions && hasActions ? /*#__PURE__*/React.createElement(ElementGroup, {
33
34
  testId: "smart-element-group-actions",
@@ -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.49.2",
13
+ packageVersion: "26.50.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -1 +0,0 @@
1
- export {};
@@ -39,7 +39,7 @@ var AISummary = function AISummary(_ref) {
39
39
  return jsx(Markdown, {
40
40
  "data-testid": testId,
41
41
  css: [AISummaryCSS, overrideCss],
42
- children: showIcon ? "".concat(content, " <Icon />") : content,
42
+ children: showIcon ? "".concat(content, "&nbsp;<Icon />") : content,
43
43
  options: {
44
44
  forceWrapper: true,
45
45
  overrides: {
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::7957a4f104d8499ba8c1d791bc4c61e2>>
6
+ * @codegen <<SignedSource::81a232dd81b5db01399e6f7e28181c20>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -25,8 +25,14 @@ export type ResolvedAttributesType = {
25
25
  canBeDatasource: boolean | null;
26
26
  };
27
27
  export type ButtonClickedAiSummaryAttributesType = {};
28
- export type SummaryViewedAttributesType = {};
28
+ export type SummaryViewedAttributesType = {
29
+ fromCache: boolean | null;
30
+ };
29
31
  export type ErrorViewedAiSummaryAttributesType = {};
32
+ export type SummarySuccessAttributesType = {};
33
+ export type SummaryFailedAttributesType = {
34
+ reason: string | null;
35
+ };
30
36
  export type AnalyticsEventAttributes = {
31
37
  /**
32
38
  * fired when an ai summary is clicked */
@@ -37,5 +43,11 @@ export type AnalyticsEventAttributes = {
37
43
  /**
38
44
  * fired when a summary error is viewed */
39
45
  'ui.error.viewed.aiSummary': ErrorViewedAiSummaryAttributesType;
46
+ /**
47
+ * fired when a summary request finishes with a successful response */
48
+ 'operational.summary.success': SummarySuccessAttributesType;
49
+ /**
50
+ * fired when a summary request finishes with a failed response */
51
+ 'operational.summary.failed': SummaryFailedAttributesType;
40
52
  };
41
53
  export type EventKey = keyof AnalyticsEventAttributes;
@@ -1,5 +1,5 @@
1
1
  import { CustomData } from '@atlaskit/ufo';
2
- type UfoExperienceName = 'smart-link-rendered' | 'smart-link-authenticated' | 'smart-link-action-invocation';
2
+ type UfoExperienceName = 'smart-link-rendered' | 'smart-link-authenticated' | 'smart-link-action-invocation' | 'smart-link-ai-summary';
3
3
  export declare const startUfoExperience: (experienceName: UfoExperienceName, id: string, properties?: CustomData) => void;
4
4
  export declare const succeedUfoExperience: (experienceName: UfoExperienceName, id: string, properties?: CustomData) => void;
5
5
  export declare const failUfoExperience: (experienceName: UfoExperienceName, id: string, properties?: CustomData) => void;
@@ -4,6 +4,9 @@ export declare class AISummaryService implements AISummaryServiceInt {
4
4
  private config;
5
5
  private url;
6
6
  private subscribedStateSetters;
7
+ private onStart?;
8
+ private onSuccess?;
9
+ private onError?;
7
10
  constructor(props: AISummaryServiceProps);
8
11
  private fetchStream;
9
12
  summariseUrl(summaryStyle?: SummaryStyle): Promise<void>;
@@ -7,6 +7,9 @@ export interface AISummaryServiceInt {
7
7
  export type AISummaryServiceProps = {
8
8
  baseUrl?: string;
9
9
  headers?: Record<string, string>;
10
+ onError?: (id: string, reason?: string) => void;
11
+ onStart?: (id: string) => void;
12
+ onSuccess?: (id: string) => void;
10
13
  product?: ProductType;
11
14
  url: string;
12
15
  };
@@ -1,3 +1,4 @@
1
+ import type { SummaryViewedAttributesType } from '../../../../../../common/analytics/generated/analytics.types';
1
2
  export type AIEventSummaryViewedProps = {
2
- fromCache?: boolean;
3
+ fromCache?: SummaryViewedAttributesType['fromCache'];
3
4
  };
@@ -12,4 +12,8 @@ export type FooterBlockProps = {
12
12
  * Function to be called when footer action dropdown open state is changed.
13
13
  */
14
14
  onActionMenuOpenChange?: (options: OnActionMenuOpenChangeOptions) => void;
15
+ /**
16
+ * Allows hiding of the resources provider
17
+ */
18
+ hideProvider?: boolean;
15
19
  } & BlockProps;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::7957a4f104d8499ba8c1d791bc4c61e2>>
6
+ * @codegen <<SignedSource::81a232dd81b5db01399e6f7e28181c20>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -25,8 +25,14 @@ export type ResolvedAttributesType = {
25
25
  canBeDatasource: boolean | null;
26
26
  };
27
27
  export type ButtonClickedAiSummaryAttributesType = {};
28
- export type SummaryViewedAttributesType = {};
28
+ export type SummaryViewedAttributesType = {
29
+ fromCache: boolean | null;
30
+ };
29
31
  export type ErrorViewedAiSummaryAttributesType = {};
32
+ export type SummarySuccessAttributesType = {};
33
+ export type SummaryFailedAttributesType = {
34
+ reason: string | null;
35
+ };
30
36
  export type AnalyticsEventAttributes = {
31
37
  /**
32
38
  * fired when an ai summary is clicked */
@@ -37,5 +43,11 @@ export type AnalyticsEventAttributes = {
37
43
  /**
38
44
  * fired when a summary error is viewed */
39
45
  'ui.error.viewed.aiSummary': ErrorViewedAiSummaryAttributesType;
46
+ /**
47
+ * fired when a summary request finishes with a successful response */
48
+ 'operational.summary.success': SummarySuccessAttributesType;
49
+ /**
50
+ * fired when a summary request finishes with a failed response */
51
+ 'operational.summary.failed': SummaryFailedAttributesType;
40
52
  };
41
53
  export type EventKey = keyof AnalyticsEventAttributes;
@@ -1,5 +1,5 @@
1
1
  import { CustomData } from '@atlaskit/ufo';
2
- type UfoExperienceName = 'smart-link-rendered' | 'smart-link-authenticated' | 'smart-link-action-invocation';
2
+ type UfoExperienceName = 'smart-link-rendered' | 'smart-link-authenticated' | 'smart-link-action-invocation' | 'smart-link-ai-summary';
3
3
  export declare const startUfoExperience: (experienceName: UfoExperienceName, id: string, properties?: CustomData) => void;
4
4
  export declare const succeedUfoExperience: (experienceName: UfoExperienceName, id: string, properties?: CustomData) => void;
5
5
  export declare const failUfoExperience: (experienceName: UfoExperienceName, id: string, properties?: CustomData) => void;
@@ -4,6 +4,9 @@ export declare class AISummaryService implements AISummaryServiceInt {
4
4
  private config;
5
5
  private url;
6
6
  private subscribedStateSetters;
7
+ private onStart?;
8
+ private onSuccess?;
9
+ private onError?;
7
10
  constructor(props: AISummaryServiceProps);
8
11
  private fetchStream;
9
12
  summariseUrl(summaryStyle?: SummaryStyle): Promise<void>;
@@ -7,6 +7,9 @@ export interface AISummaryServiceInt {
7
7
  export type AISummaryServiceProps = {
8
8
  baseUrl?: string;
9
9
  headers?: Record<string, string>;
10
+ onError?: (id: string, reason?: string) => void;
11
+ onStart?: (id: string) => void;
12
+ onSuccess?: (id: string) => void;
10
13
  product?: ProductType;
11
14
  url: string;
12
15
  };
@@ -1,3 +1,4 @@
1
+ import type { SummaryViewedAttributesType } from '../../../../../../common/analytics/generated/analytics.types';
1
2
  export type AIEventSummaryViewedProps = {
2
- fromCache?: boolean;
3
+ fromCache?: SummaryViewedAttributesType['fromCache'];
3
4
  };
@@ -12,4 +12,8 @@ export type FooterBlockProps = {
12
12
  * Function to be called when footer action dropdown open state is changed.
13
13
  */
14
14
  onActionMenuOpenChange?: (options: OnActionMenuOpenChangeOptions) => void;
15
+ /**
16
+ * Allows hiding of the resources provider
17
+ */
18
+ hideProvider?: boolean;
15
19
  } & BlockProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.49.2",
3
+ "version": "26.50.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"