@atlaskit/smart-card 26.27.0 → 26.27.2

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 (49) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +6 -2
  3. package/dist/cjs/state/helpers.js +11 -2
  4. package/dist/cjs/utils/analytics/analytics.js +5 -3
  5. package/dist/cjs/utils/mocks.js +53 -71
  6. package/dist/cjs/view/BlockCard/views/flexible/styled.js +1 -1
  7. package/dist/cjs/view/CardWithUrl/component.js +4 -2
  8. package/dist/cjs/view/EmbedCard/components/styled.js +2 -2
  9. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +5 -2
  10. package/dist/cjs/view/LinkUrl/index.js +1 -1
  11. package/dist/cjs/view/RedesignedInlineCard/Frame/styled.js +3 -3
  12. package/dist/cjs/view/RedesignedInlineCard/utils/withFrameStyleControl.js +2 -2
  13. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +5 -2
  14. package/dist/es2019/state/helpers.js +5 -0
  15. package/dist/es2019/utils/analytics/analytics.js +5 -3
  16. package/dist/es2019/utils/mocks.js +51 -71
  17. package/dist/es2019/view/BlockCard/views/flexible/styled.js +1 -1
  18. package/dist/es2019/view/CardWithUrl/component.js +5 -3
  19. package/dist/es2019/view/EmbedCard/components/styled.js +2 -2
  20. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +5 -2
  21. package/dist/es2019/view/LinkUrl/index.js +1 -1
  22. package/dist/es2019/view/RedesignedInlineCard/Frame/styled.js +3 -3
  23. package/dist/es2019/view/RedesignedInlineCard/utils/withFrameStyleControl.js +2 -2
  24. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +6 -2
  25. package/dist/esm/state/helpers.js +7 -0
  26. package/dist/esm/utils/analytics/analytics.js +5 -3
  27. package/dist/esm/utils/mocks.js +53 -71
  28. package/dist/esm/view/BlockCard/views/flexible/styled.js +1 -1
  29. package/dist/esm/view/CardWithUrl/component.js +5 -3
  30. package/dist/esm/view/EmbedCard/components/styled.js +2 -2
  31. package/dist/esm/view/HoverCard/components/views/resolved/index.js +5 -2
  32. package/dist/esm/view/LinkUrl/index.js +1 -1
  33. package/dist/esm/view/RedesignedInlineCard/Frame/styled.js +3 -3
  34. package/dist/esm/view/RedesignedInlineCard/utils/withFrameStyleControl.js +2 -2
  35. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +2 -1
  36. package/dist/types/state/helpers.d.ts +3 -0
  37. package/dist/types/state/hooks/useSmartLink.d.ts +1 -1
  38. package/dist/types/utils/analytics/analytics.d.ts +1 -1
  39. package/dist/types/utils/analytics/types.d.ts +1 -0
  40. package/dist/types/utils/mocks.d.ts +42 -1
  41. package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +2 -1
  42. package/dist/types-ts4.5/state/helpers.d.ts +3 -0
  43. package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +1 -1
  44. package/dist/types-ts4.5/utils/analytics/analytics.d.ts +1 -1
  45. package/dist/types-ts4.5/utils/analytics/types.d.ts +1 -0
  46. package/dist/types-ts4.5/utils/mocks.d.ts +42 -1
  47. package/package.json +5 -5
  48. package/report.api.md +2 -0
  49. package/tmp/api-report-tmp.d.ts +2 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.27.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`cecab8d279d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cecab8d279d) - Added an attribute 'canBeDatasource' to 'smartLink renderSuccess' event to indicate which smart links can be converted to datasources
8
+
9
+ ## 26.27.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`3c60160da56`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3c60160da56) - Update usages of token color.border.input to color.input
14
+
3
15
  ## 26.27.0
4
16
 
5
17
  ### Minor Changes
@@ -353,6 +353,7 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, _dispatchAnalyti
353
353
  * @param id The unique ID for this Smart Link.
354
354
  * @param definitionId The definitionId of the Smart Link resolver invoked.
355
355
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
356
+ * @param canBeDatasource An indicator that shows that a smart link can be converted to a datasource
356
357
  */
357
358
  renderSuccessEvent: function renderSuccessEvent(_ref9) {
358
359
  var display = _ref9.display,
@@ -363,7 +364,9 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, _dispatchAnalyti
363
364
  resourceType = _ref9.resourceType,
364
365
  destinationProduct = _ref9.destinationProduct,
365
366
  destinationSubproduct = _ref9.destinationSubproduct,
366
- location = _ref9.location;
367
+ location = _ref9.location,
368
+ _ref9$canBeDatasource = _ref9.canBeDatasource,
369
+ canBeDatasource = _ref9$canBeDatasource === void 0 ? false : _ref9$canBeDatasource;
367
370
  var experienceId = id ? id : defaultId;
368
371
  (0, _ufoExperiences.succeedUfoExperience)('smart-link-rendered', experienceId, {
369
372
  extensionKey: extensionKey,
@@ -382,7 +385,8 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, _dispatchAnalyti
382
385
  resourceType: resourceType,
383
386
  destinationProduct: destinationProduct,
384
387
  destinationSubproduct: destinationSubproduct,
385
- location: location
388
+ location: location,
389
+ canBeDatasource: canBeDatasource
386
390
  }), commonAttributes));
387
391
  },
388
392
  /**
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isVisible = exports.isFinalState = exports.isAccessible = exports.hasResolved = exports.getSubproduct = exports.getStatusDetails = exports.getServices = exports.getResourceType = exports.getProduct = exports.getExtensionKey = exports.getDefinitionId = exports.getClickUrl = exports.getByDefinitionId = void 0;
6
+ exports.isVisible = exports.isFinalState = exports.isAccessible = exports.hasResolved = exports.getSubproduct = exports.getStatusDetails = exports.getServices = exports.getResourceType = exports.getProduct = exports.getExtensionKey = exports.getDefinitionId = exports.getDatasources = exports.getClickUrl = exports.getCanBeDatasource = exports.getByDefinitionId = void 0;
7
7
  var _extractVisitUrl = require("../extractors/common/primitives/extractVisitUrl");
8
8
  var getByDefinitionId = function getByDefinitionId(definitionId, store) {
9
9
  var urls = Object.keys(store);
@@ -74,4 +74,13 @@ exports.getStatusDetails = getStatusDetails;
74
74
  var isFinalState = function isFinalState(status) {
75
75
  return ['unauthorized', 'forbidden', 'errored', 'resolved', 'not_found'].indexOf(status) > -1;
76
76
  };
77
- exports.isFinalState = isFinalState;
77
+ exports.isFinalState = isFinalState;
78
+ var getDatasources = function getDatasources(details) {
79
+ return details === null || details === void 0 ? void 0 : details.datasources;
80
+ };
81
+ exports.getDatasources = getDatasources;
82
+ var getCanBeDatasource = function getCanBeDatasource(details) {
83
+ var datasources = getDatasources(details);
84
+ return !!datasources && datasources.length > 0;
85
+ };
86
+ exports.getCanBeDatasource = getCanBeDatasource;
@@ -23,7 +23,7 @@ exports.ANALYTICS_CHANNEL = ANALYTICS_CHANNEL;
23
23
  var context = {
24
24
  componentName: 'smart-cards',
25
25
  packageName: "@atlaskit/smart-card",
26
- packageVersion: "26.27.0"
26
+ packageVersion: "26.27.2"
27
27
  };
28
28
  exports.context = context;
29
29
  var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
@@ -522,7 +522,8 @@ var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref20) {
522
522
  definitionId = _ref20.definitionId,
523
523
  destinationProduct = _ref20.destinationProduct,
524
524
  destinationSubproduct = _ref20.destinationSubproduct,
525
- location = _ref20.location;
525
+ location = _ref20.location,
526
+ canBeDatasource = _ref20.canBeDatasource;
526
527
  return {
527
528
  action: 'renderSuccess',
528
529
  actionSubject: 'smartLink',
@@ -534,7 +535,8 @@ var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref20) {
534
535
  destinationProduct: destinationProduct,
535
536
  destinationSubproduct: destinationSubproduct,
536
537
  location: location,
537
- display: display
538
+ display: display,
539
+ canBeDatasource: canBeDatasource
538
540
  })
539
541
  };
540
542
  };
@@ -12,9 +12,12 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
12
12
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
13
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
14
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
16
  var _linkProvider = require("@atlaskit/link-provider");
16
17
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
17
18
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
19
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
21
  var mockContext = {
19
22
  '@vocab': 'https://www.w3.org/ns/activitystreams#',
20
23
  atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
@@ -53,6 +56,29 @@ var mockByUrl = function mockByUrl(url) {
53
56
  };
54
57
  };
55
58
  exports.mockByUrl = mockByUrl;
59
+ var errorResponseData = {
60
+ '@context': {
61
+ '@vocab': 'https://www.w3.org/ns/activitystreams#',
62
+ atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
63
+ schema: 'http://schema.org/'
64
+ },
65
+ '@type': 'Object',
66
+ name: 'I love cheese',
67
+ url: 'https://some.url'
68
+ };
69
+ var successfulResponseData = _objectSpread(_objectSpread({}, errorResponseData), {}, {
70
+ summary: 'Here is your serving of cheese: 🧀',
71
+ 'schema:potentialAction': {
72
+ '@id': 'download',
73
+ '@type': 'DownloadAction',
74
+ identifier: 'object-provider',
75
+ name: 'Download'
76
+ },
77
+ 'atlassian:downloadUrl': 'https://some-download.url',
78
+ preview: {
79
+ href: 'https://www.ilovecheese.com'
80
+ }
81
+ });
56
82
  var mocks = {
57
83
  success: {
58
84
  meta: {
@@ -62,27 +88,7 @@ var mocks = {
62
88
  definitionId: 'd1',
63
89
  key: 'object-provider'
64
90
  },
65
- data: {
66
- '@context': {
67
- '@vocab': 'https://www.w3.org/ns/activitystreams#',
68
- atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
69
- schema: 'http://schema.org/'
70
- },
71
- '@type': 'Object',
72
- name: 'I love cheese',
73
- summary: 'Here is your serving of cheese: 🧀',
74
- 'schema:potentialAction': {
75
- '@id': 'download',
76
- '@type': 'DownloadAction',
77
- identifier: 'object-provider',
78
- name: 'Download'
79
- },
80
- 'atlassian:downloadUrl': 'https://some-download.url',
81
- preview: {
82
- href: 'https://www.ilovecheese.com'
83
- },
84
- url: 'https://some.url'
85
- }
91
+ data: successfulResponseData
86
92
  },
87
93
  notFound: {
88
94
  meta: {
@@ -92,16 +98,7 @@ var mocks = {
92
98
  definitionId: 'd1',
93
99
  key: 'object-provider'
94
100
  },
95
- data: {
96
- '@context': {
97
- '@vocab': 'https://www.w3.org/ns/activitystreams#',
98
- atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
99
- schema: 'http://schema.org/'
100
- },
101
- '@type': 'Object',
102
- name: 'I love cheese',
103
- url: 'https://some.url'
104
- }
101
+ data: errorResponseData
105
102
  },
106
103
  forbidden: {
107
104
  meta: {
@@ -115,16 +112,7 @@ var mocks = {
115
112
  definitionId: 'd1',
116
113
  key: 'object-provider'
117
114
  },
118
- data: {
119
- '@context': {
120
- '@vocab': 'https://www.w3.org/ns/activitystreams#',
121
- atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
122
- schema: 'http://schema.org/'
123
- },
124
- '@type': 'Object',
125
- name: 'I love cheese',
126
- url: 'https://some.url'
127
- }
115
+ data: errorResponseData
128
116
  },
129
117
  forbiddenWithNoAuth: {
130
118
  meta: {
@@ -134,16 +122,7 @@ var mocks = {
134
122
  definitionId: 'd1',
135
123
  key: 'object-provider'
136
124
  },
137
- data: {
138
- '@context': {
139
- '@vocab': 'https://www.w3.org/ns/activitystreams#',
140
- atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
141
- schema: 'http://schema.org/'
142
- },
143
- '@type': 'Object',
144
- name: 'I love cheese',
145
- url: 'https://some.url'
146
- }
125
+ data: errorResponseData
147
126
  },
148
127
  unauthorized: {
149
128
  meta: {
@@ -157,16 +136,7 @@ var mocks = {
157
136
  definitionId: 'd1',
158
137
  key: 'object-provider'
159
138
  },
160
- data: {
161
- '@context': {
162
- '@vocab': 'https://www.w3.org/ns/activitystreams#',
163
- atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
164
- schema: 'http://schema.org/'
165
- },
166
- '@type': 'Object',
167
- name: 'I love cheese',
168
- url: 'https://some.url'
169
- }
139
+ data: errorResponseData
170
140
  },
171
141
  unauthorizedWithNoAuth: {
172
142
  meta: {
@@ -176,16 +146,7 @@ var mocks = {
176
146
  definitionId: 'd1',
177
147
  key: 'object-provider'
178
148
  },
179
- data: {
180
- '@context': {
181
- '@vocab': 'https://www.w3.org/ns/activitystreams#',
182
- atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
183
- schema: 'http://schema.org/'
184
- },
185
- '@type': 'Object',
186
- name: 'I love cheese',
187
- url: 'https://some.url'
188
- }
149
+ data: errorResponseData
189
150
  },
190
151
  actionSuccess: {
191
152
  meta: {
@@ -209,6 +170,27 @@ var mocks = {
209
170
  product: 'spaghetti-product'
210
171
  }
211
172
  }
173
+ },
174
+ withDatasource: {
175
+ meta: {
176
+ visibility: 'public',
177
+ access: 'granted',
178
+ auth: [],
179
+ definitionId: 'd1',
180
+ key: 'object-provider'
181
+ },
182
+ data: successfulResponseData,
183
+ datasources: [{
184
+ key: 'datasource-jira-issues',
185
+ parameters: {
186
+ jql: '(text ~ "test*" OR summary ~ "test*") order by created DESC',
187
+ cloudId: '16f8b71e'
188
+ },
189
+ id: '1234-test-id-321',
190
+ ari: 'ari:cloud:linking-platform::datasource/1234-test-id-321',
191
+ description: 'For extracting a list of Jira issues using JQL',
192
+ name: 'Jira issues'
193
+ }]
212
194
  }
213
195
  };
214
196
  exports.mocks = mocks;
@@ -19,6 +19,6 @@ exports.titleBlockCss = titleBlockCss;
19
19
  var footerBlockCss = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n height: 1.5rem;\n\n .actions-button-group {\n button,\n button:hover,\n button:focus,\n button:active {\n font-size: 0.875rem;\n }\n }\n"])));
20
20
  exports.footerBlockCss = footerBlockCss;
21
21
  var flexibleBlockCardElevationStyle = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 1.5px;\n box-shadow: ", ";\n margin: ", ";\n"])), _token.tokens.elevation, "var(--ds-space-025, 2px)");
22
- var refreshedFlexibleBlockCardStyle = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n & > div {\n border-radius: ", ";\n border: 1px solid ", ";\n }\n"])), "var(--ds-border-radius-200, 8px)", "var(--ds-border-input, ".concat(_colors.N40, ")"));
22
+ var refreshedFlexibleBlockCardStyle = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n & > div {\n border-radius: ", ";\n border: 1px solid ", ";\n }\n"])), "var(--ds-border-radius-200, 8px)", "var(--ds-border, ".concat(_colors.N40, ")"));
23
23
  var flexibleBlockCardStyle = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? refreshedFlexibleBlockCardStyle : flexibleBlockCardElevationStyle;
24
24
  exports.flexibleBlockCardStyle = flexibleBlockCardStyle;
@@ -67,6 +67,7 @@ function Component(_ref) {
67
67
  var product = (0, _helpers.getProduct)(state.details);
68
68
  var subproduct = (0, _helpers.getSubproduct)(state.details);
69
69
  var services = (0, _helpers.getServices)(state.details);
70
+ var canBeDatasource = (0, _helpers.getCanBeDatasource)(state.details);
70
71
  var isFlexibleUi = (0, _react.useMemo)(function () {
71
72
  return (0, _flexible.isFlexibleUiCard)(children);
72
73
  }, [children]);
@@ -144,10 +145,11 @@ function Component(_ref) {
144
145
  status: state.status,
145
146
  id: id,
146
147
  definitionId: definitionId,
147
- extensionKey: extensionKey
148
+ extensionKey: extensionKey,
149
+ canBeDatasource: canBeDatasource
148
150
  });
149
151
  }
150
- }, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id]);
152
+ }, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id, canBeDatasource]);
151
153
  var onIframeDwell = (0, _react.useCallback)(function (dwellTime, dwellPercentVisible) {
152
154
  analytics.ui.iframeDwelledEvent({
153
155
  id: id,
@@ -68,7 +68,7 @@ var height = function height(_ref5) {
68
68
  var wrapperStyles = function wrapperStyles(props) {
69
69
  return "\n ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? wrapperBorderRadius : borderRadius, "\n ").concat(minWidth(props), "\n ").concat(maxWidth(props), "\n ").concat(getInteractiveStyles(props), "\n ").concat(visible(props), "\n display: inline-flex;\n flex-direction: column;\n box-sizing: border-box;\n font-family: ").concat((0, _constants.fontFamily)(), ";\n width: 100%;\n user-select: none;\n line-height: initial;\n transition: background 0.3s;\n position: relative;\n ").concat(height(props), ";\n ").concat(selected(props), "\n\n &:after {\n content: '';\n transition: background 0.3s, box-shadow 0.3s;\n position: absolute;\n width: calc(100% + ", "var(--ds-space-200, 16px)", ");\n height: calc(100% + ", "var(--ds-space-100, 8px)", ");\n left: ", "var(--ds-space-negative-100, -8px)", ";\n ").concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? wrapperBorderRadius : "background: transparent;\n ".concat(borderRadius), "\n }\n");
70
70
  };
71
- var visibleStyles = "\n ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "" : "background-color: ".concat("var(--ds-background-neutral-subtle, ".concat(colors.N30, ")"), ";"), "\n\n &:after {\n ").concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "border: 1px solid ".concat("var(--ds-border-input, ".concat(colors.N40, ")"), ";\n background-color: ", (0, _components.themed)({
71
+ var visibleStyles = "\n ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "" : "background-color: ".concat("var(--ds-background-neutral-subtle, ".concat(colors.N30, ")"), ";"), "\n\n &:after {\n ").concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "border: 1px solid ".concat("var(--ds-border, ".concat(colors.N40, ")"), ";\n background-color: ", (0, _components.themed)({
72
72
  light: "var(--ds-surface-raised, white)",
73
73
  dark: "var(--ds-surface-raised, ".concat(BACKGROUND_COLOR_DARK, ")")
74
74
  })(), ";") : "background: ".concat("var(--ds-background-neutral, ".concat(colors.N30, ")"), " !important;"), "\n }\n .embed-header {\n opacity: 1;\n }");
@@ -111,7 +111,7 @@ exports.TextWrapper = TextWrapper;
111
111
  // NB: `overflow` is kept as `hidden` since
112
112
  // the internal contents of the `iframe` should
113
113
  // manage scrolling behaviour.
114
- var Content = _styled.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n background-color: ", ";\n position: absolute;\n z-index: 1;\n width: 100%;\n transition: box-shadow 0.3s;\n\n > .calc-height > div > div {\n left: unset !important;\n width: unset !important;\n height: unset !important;\n position: initial !important;\n padding-bottom: unset !important;\n }\n > .embed-preview > div {\n margin: 0 auto;\n }\n\n ", ";\n\n ", "\n\n ", "\n"])), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "".concat(contentBorderRadius, ";\n border: 1px solid ", "var(--ds-border-input, ".concat(colors.N40, ")"), ";") : borderRadius, "var(--ds-surface-raised, white)", function (_ref9) {
114
+ var Content = _styled.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n background-color: ", ";\n position: absolute;\n z-index: 1;\n width: 100%;\n transition: box-shadow 0.3s;\n\n > .calc-height > div > div {\n left: unset !important;\n width: unset !important;\n height: unset !important;\n position: initial !important;\n padding-bottom: unset !important;\n }\n > .embed-preview > div {\n margin: 0 auto;\n }\n\n ", ";\n\n ", "\n\n ", "\n"])), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "".concat(contentBorderRadius, ";\n border: 1px solid ", "var(--ds-border, ".concat(colors.N40, ")"), ";") : borderRadius, "var(--ds-surface-raised, white)", function (_ref9) {
115
115
  var isInteractive = _ref9.isInteractive;
116
116
  if (isInteractive && !(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design')) {
117
117
  return "\n .".concat(className, ":hover & {\n box-shadow: ", "var(--ds-shadow-overlay, 0 4px 8px -2px rgba(23, 43, 77, 0.32), 0 0 1px rgba(23, 43, 77, 0.25))", ";\n }\n ");
@@ -19,6 +19,7 @@ var _extractMetadata = require("../../../../../extractors/hover/extractMetadata"
19
19
  var _messages = require("../../../../../messages");
20
20
  var _reactIntlNext = require("react-intl-next");
21
21
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
+ var _helpers = require("../../../../../state/helpers");
22
23
  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); }
23
24
  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; }
24
25
  var toFooterActions = function toFooterActions(cardActions, onActionClick) {
@@ -69,14 +70,16 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
69
70
  cardActions = _ref$cardActions === void 0 ? [] : _ref$cardActions,
70
71
  onActionClick = _ref.onActionClick,
71
72
  extensionKey = _ref.extensionKey;
73
+ var canBeDatasource = (0, _helpers.getCanBeDatasource)(cardState.details);
72
74
  (0, _react.useEffect)(function () {
73
75
  // Since this hover view is only rendered on resolved status,
74
76
  // there is no need to check for statuses.
75
77
  analytics.ui.renderSuccessEvent({
76
78
  display: _constants.CardDisplay.HoverCardPreview,
77
- status: cardState.status
79
+ status: cardState.status,
80
+ canBeDatasource: canBeDatasource
78
81
  });
79
- }, [analytics.ui, cardState.status]);
82
+ }, [analytics.ui, cardState.status, canBeDatasource]);
80
83
  var footerActions = (0, _react.useMemo)(function () {
81
84
  return toFooterActions(cardActions, onActionClick);
82
85
  }, [cardActions, onActionClick]);
@@ -18,7 +18,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
18
18
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
19
19
  var PACKAGE_DATA = {
20
20
  packageName: "@atlaskit/smart-card",
21
- packageVersion: "26.27.0",
21
+ packageVersion: "26.27.2",
22
22
  componentName: 'linkUrl'
23
23
  };
24
24
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -11,7 +11,7 @@ var _colors = require("@atlaskit/theme/colors");
11
11
  var _components = require("@atlaskit/theme/components");
12
12
  var _templateObject, _templateObject2;
13
13
  var BACKGROUND_COLOR_DARK = '#262B31';
14
- var selected = "\n cursor: pointer;\n box-shadow: 0 0 0 2px ".concat("var(--ds-border-selected, ".concat(_colors.B100, ")"), ";\n outline: none;\n user-select: none;\n &, :hover, :focus, :active {\n text-decoration: none;\n }\n &:hover {\n border: 1px solid ", "var(--ds-border-input, ".concat(_colors.N40, ")"), ";\n }\n");
14
+ var selected = "\n cursor: pointer;\n box-shadow: 0 0 0 2px ".concat("var(--ds-border-selected, ".concat(_colors.B100, ")"), ";\n outline: none;\n user-select: none;\n &, :hover, :focus, :active {\n text-decoration: none;\n }\n &:hover {\n border: 1px solid ", "var(--ds-border, ".concat(_colors.N40, ")"), ";\n }\n");
15
15
  var isInteractive = function isInteractive(_ref) {
16
16
  var isInteractive = _ref.isInteractive;
17
17
  if (isInteractive) {
@@ -55,8 +55,8 @@ var baseWrapperStyle = function baseWrapperStyle(props) {
55
55
  light: "var(--ds-surface-raised, white)",
56
56
  dark: "var(--ds-surface-raised, ".concat(BACKGROUND_COLOR_DARK, ")")
57
57
  })(props), ";\n\n ").concat(isSelected(props), ";\n\n ").concat(props.withoutBackground ? '' : (0, _components.themed)({
58
- light: "border: 1px solid ".concat("var(--ds-border-input, ".concat(_colors.N40, ")"), ";"),
59
- dark: "border: 1px solid ".concat("var(--ds-border-input, ".concat(_colors.N500, ")"), ";")
58
+ light: "border: 1px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")"), ";"),
59
+ dark: "border: 1px solid ".concat("var(--ds-border, ".concat(_colors.N500, ")"), ";")
60
60
  })(props), "\n &:hover {\n ").concat((0, _components.themed)({
61
61
  light: "border-color: ".concat("var(--ds-border-accent-blue, ".concat(_colors.B200, ")"), ";"),
62
62
  dark: "border-color: ".concat("var(--ds-border-accent-blue, ".concat(_colors.B200, ")"), ";")
@@ -19,8 +19,8 @@ var _default = function _default(Button, frameRef) {
19
19
  return function (props) {
20
20
  var setBorderStyle = function setBorderStyle() {
21
21
  var borderColor = (0, _components.themed)({
22
- light: "".concat("var(--ds-border-input, ".concat(_colors.N40, ")")),
23
- dark: "".concat("var(--ds-border-input, ".concat(_colors.N500, ")"))
22
+ light: "".concat("var(--ds-border, ".concat(_colors.N40, ")")),
23
+ dark: "".concat("var(--ds-border, ".concat(_colors.N500, ")"))
24
24
  })();
25
25
  var frameNode = frameRef.current;
26
26
  if (frameNode) {
@@ -336,6 +336,7 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
336
336
  * @param id The unique ID for this Smart Link.
337
337
  * @param definitionId The definitionId of the Smart Link resolver invoked.
338
338
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
339
+ * @param canBeDatasource An indicator that shows that a smart link can be converted to a datasource
339
340
  */
340
341
  renderSuccessEvent: ({
341
342
  display,
@@ -346,7 +347,8 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
346
347
  resourceType,
347
348
  destinationProduct,
348
349
  destinationSubproduct,
349
- location
350
+ location,
351
+ canBeDatasource = false
350
352
  }) => {
351
353
  const experienceId = id ? id : defaultId;
352
354
  succeedUfoExperience('smart-link-rendered', experienceId, {
@@ -366,7 +368,8 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
366
368
  resourceType,
367
369
  destinationProduct,
368
370
  destinationSubproduct,
369
- location
371
+ location,
372
+ canBeDatasource
370
373
  }), commonAttributes));
371
374
  },
372
375
  /**
@@ -55,4 +55,9 @@ export const getStatusDetails = details => {
55
55
  };
56
56
  export const isFinalState = status => {
57
57
  return ['unauthorized', 'forbidden', 'errored', 'resolved', 'not_found'].indexOf(status) > -1;
58
+ };
59
+ export const getDatasources = details => details === null || details === void 0 ? void 0 : details.datasources;
60
+ export const getCanBeDatasource = details => {
61
+ const datasources = getDatasources(details);
62
+ return !!datasources && datasources.length > 0;
58
63
  };
@@ -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.27.0"
7
+ packageVersion: "26.27.2"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -496,7 +496,8 @@ export const uiRenderSuccessEvent = ({
496
496
  definitionId,
497
497
  destinationProduct,
498
498
  destinationSubproduct,
499
- location
499
+ location,
500
+ canBeDatasource
500
501
  }) => ({
501
502
  action: 'renderSuccess',
502
503
  actionSubject: 'smartLink',
@@ -509,7 +510,8 @@ export const uiRenderSuccessEvent = ({
509
510
  destinationProduct,
510
511
  destinationSubproduct,
511
512
  location,
512
- display
513
+ display,
514
+ canBeDatasource
513
515
  }
514
516
  });
515
517
  export const uiRenderFailedEvent = ({