@atlaskit/smart-card 19.1.24 → 19.1.27

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 (33) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +2 -1
  3. package/dist/cjs/utils/analytics/analytics.js +2 -2
  4. package/dist/cjs/version.json +1 -1
  5. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +2 -1
  6. package/dist/cjs/view/FlexibleCard/components/elements/index.js +30 -30
  7. package/dist/cjs/view/HoverCard/components/hover-card-content.js +16 -6
  8. package/dist/cjs/view/HoverCard/styled.js +10 -4
  9. package/dist/cjs/view/HoverCard/utils.js +2 -2
  10. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +1 -1
  11. package/dist/es2019/utils/analytics/analytics.js +2 -2
  12. package/dist/es2019/version.json +1 -1
  13. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +2 -1
  14. package/dist/es2019/view/FlexibleCard/components/elements/index.js +23 -23
  15. package/dist/es2019/view/HoverCard/components/hover-card-content.js +16 -7
  16. package/dist/es2019/view/HoverCard/styled.js +29 -2
  17. package/dist/es2019/view/HoverCard/utils.js +2 -2
  18. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +2 -1
  19. package/dist/esm/utils/analytics/analytics.js +2 -2
  20. package/dist/esm/version.json +1 -1
  21. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +2 -1
  22. package/dist/esm/view/FlexibleCard/components/elements/index.js +23 -23
  23. package/dist/esm/view/HoverCard/components/hover-card-content.js +16 -7
  24. package/dist/esm/view/HoverCard/styled.js +5 -2
  25. package/dist/esm/view/HoverCard/utils.js +2 -2
  26. package/dist/types/index.d.ts +1 -0
  27. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +1 -1
  28. package/dist/types/state/hooks/useSmartLink.d.ts +1 -1
  29. package/dist/types/utils/analytics/analytics.d.ts +1 -1
  30. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +156 -6
  31. package/dist/types/view/FlexibleCard/components/elements/index.d.ts +20 -20
  32. package/dist/types/view/HoverCard/styled.d.ts +3 -0
  33. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 19.1.27
4
+
5
+ ### Patch Changes
6
+
7
+ - [`98d3f88e428`](https://bitbucket.org/atlassian/atlassian-frontend/commits/98d3f88e428) - This PR adds external element typings for Flexible UI metadata.
8
+ This means code completion will now be available when an element has a prop that can be overridden.
9
+ As of this PR, these are the `CreatedOn` and `ModifiedOn` elements, which now accept some `text` which will override the existing text.
10
+
11
+ This PR also exposes the overrideCss prop, allowing integrators to supply any CSS for their elements.
12
+
13
+ ## 19.1.26
14
+
15
+ ### Patch Changes
16
+
17
+ - [`00c79cca5b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/00c79cca5b0) - hover card white space changes
18
+
19
+ ## 19.1.25
20
+
21
+ ### Patch Changes
22
+
23
+ - [`de8de71a806`](https://bitbucket.org/atlassian/atlassian-frontend/commits/de8de71a806) - Hover Preview: Fix Hover Preview analytics event details get applied to other Smart Links analytics
24
+ - [`ae023956743`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ae023956743) - Smart Links Analytics types are exported to allow their usage from outside of the package
25
+
3
26
  ## 19.1.24
4
27
 
5
28
  ### Patch Changes
@@ -92,7 +92,8 @@ var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchAnalytic
92
92
  var location = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : defaultLocation;
93
93
  var destinationProduct = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : extractedProduct;
94
94
  var destinationSubproduct = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : extractedSubproduct;
95
- return dispatchAnalytics((0, _analytics.uiCardClickedEvent)(id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct));
95
+ var actionSubjectId = arguments.length > 9 ? arguments[9] : undefined;
96
+ return dispatchAnalytics((0, _analytics.uiCardClickedEvent)(id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId));
96
97
  },
97
98
 
98
99
  /**
@@ -235,11 +235,11 @@ var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(display,
235
235
 
236
236
  exports.uiAuthAlternateAccountEvent = uiAuthAlternateAccountEvent;
237
237
 
238
- var uiCardClickedEvent = function uiCardClickedEvent(id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct) {
238
+ var uiCardClickedEvent = function uiCardClickedEvent(id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId) {
239
239
  return {
240
240
  action: 'clicked',
241
241
  actionSubject: 'smartLink',
242
- actionSubjectId: 'titleGoToLink',
242
+ actionSubjectId: actionSubjectId,
243
243
  eventType: 'ui',
244
244
  attributes: _objectSpread(_objectSpread({}, context), {}, {
245
245
  id: id,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "19.1.24",
3
+ "version": "19.1.27",
4
4
  "sideEffects": false
5
5
  }
@@ -128,11 +128,12 @@ var renderElementItems = function renderElementItems() {
128
128
  var name = curr.name,
129
129
  props = (0, _objectWithoutProperties2.default)(curr, _excluded);
130
130
  var Element = Elements[name];
131
+ var typedProps = props;
131
132
 
132
133
  if (Element && isElementDisplayValid(name, display)) {
133
134
  var element = /*#__PURE__*/_react.default.createElement(Element, (0, _extends2.default)({
134
135
  key: idx
135
- }, props));
136
+ }, typedProps));
136
137
 
137
138
  if (!isElementNull(element)) {
138
139
  return [].concat((0, _toConsumableArray2.default)(acc), [element]);
@@ -33,45 +33,24 @@ var CollaboratorGroup = (0, _utils.createElement)(_constants.ElementName.Collabo
33
33
  exports.CollaboratorGroup = CollaboratorGroup;
34
34
  var CommentCount = (0, _utils.createElement)(_constants.ElementName.CommentCount);
35
35
  /**
36
- * Creates a ViewCount Badge element using the data from ViewCount in the Flexible UI Context.
37
- * @see Badge
36
+ * Creates a CreatedOn DateTime element using the data from CreatedOn in the Flexible UI Context.
37
+ * @see DateTime
38
38
  */
39
39
 
40
40
  exports.CommentCount = CommentCount;
41
- var ViewCount = (0, _utils.createElement)(_constants.ElementName.ViewCount);
42
- /**
43
- * Creates a ReactCount Badge element using the data from ReactCount in the Flexible UI Context.
44
- * @see Badge
45
- */
46
-
47
- exports.ViewCount = ViewCount;
48
- var ReactCount = (0, _utils.createElement)(_constants.ElementName.ReactCount);
49
- /**
50
- * Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
51
- * @see Badge
52
- */
53
-
54
- exports.ReactCount = ReactCount;
55
- var VoteCount = (0, _utils.createElement)(_constants.ElementName.VoteCount);
41
+ var CreatedOn = (0, _utils.createElement)(_constants.ElementName.CreatedOn);
56
42
  /**
57
43
  * Creates a CreatedBy text element using the data from CreatedBy in the Flexible UI Context.
58
44
  * @see Text
59
45
  */
60
46
 
61
- exports.VoteCount = VoteCount;
47
+ exports.CreatedOn = CreatedOn;
62
48
  var CreatedBy = (0, _utils.createElement)(_constants.ElementName.CreatedBy);
63
- /**
64
- * Creates a CreatedOn DateTime element using the data from CreatedOn in the Flexible UI Context.
65
- * @see DateTime
66
- */
67
-
68
- exports.CreatedBy = CreatedBy;
69
- var CreatedOn = (0, _utils.createElement)(_constants.ElementName.CreatedOn);
70
49
  /**
71
50
  * Creates an element that contains Last Commit hash
72
51
  */
73
52
 
74
- exports.CreatedOn = CreatedOn;
53
+ exports.CreatedBy = CreatedBy;
75
54
  var LatestCommit = (0, _utils.createElement)(_constants.ElementName.LatestCommit);
76
55
  /**
77
56
  * Creates a LinkIcon Icon element using the data from LinkIcon in the Flexible UI Context.
@@ -115,12 +94,26 @@ var Priority = (0, _utils.createElement)(_constants.ElementName.Priority);
115
94
 
116
95
  exports.Priority = Priority;
117
96
  var ProgrammingLanguage = (0, _utils.createElement)(_constants.ElementName.ProgrammingLanguage);
97
+ /**
98
+ * Creates a Provider Badge element using the data from Provider in the Flexible UI Context.
99
+ * @see Badge
100
+ */
101
+
102
+ exports.ProgrammingLanguage = ProgrammingLanguage;
103
+ var Provider = (0, _utils.createElement)(_constants.ElementName.Provider);
104
+ /**
105
+ * Creates a ReactCount Badge element using the data from ReactCount in the Flexible UI Context.
106
+ * @see Badge
107
+ */
108
+
109
+ exports.Provider = Provider;
110
+ var ReactCount = (0, _utils.createElement)(_constants.ElementName.ReactCount);
118
111
  /**
119
112
  * Creates a Snippet element using the data from Snippet in the Flexible UI Context.
120
113
  * @see Text
121
114
  */
122
115
 
123
- exports.ProgrammingLanguage = ProgrammingLanguage;
116
+ exports.ReactCount = ReactCount;
124
117
  var Snippet = (0, _utils.createElement)(_constants.ElementName.Snippet);
125
118
  /**
126
119
  * Creates a State Lozenge element using the data from State in the Flexible UI Context.
@@ -145,10 +138,17 @@ var SubscriberCount = (0, _utils.createElement)(_constants.ElementName.Subscribe
145
138
  exports.SubscriberCount = SubscriberCount;
146
139
  var Title = (0, _utils.createElement)(_constants.ElementName.Title);
147
140
  /**
148
- * Creates a Provider Badge element using the data from Provider in the Flexible UI Context.
141
+ * Creates a ViewCount Badge element using the data from ViewCount in the Flexible UI Context.
149
142
  * @see Badge
150
143
  */
151
144
 
152
145
  exports.Title = Title;
153
- var Provider = (0, _utils.createElement)(_constants.ElementName.Provider);
154
- exports.Provider = Provider;
146
+ var ViewCount = (0, _utils.createElement)(_constants.ElementName.ViewCount);
147
+ /**
148
+ * Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
149
+ * @see Badge
150
+ */
151
+
152
+ exports.ViewCount = ViewCount;
153
+ var VoteCount = (0, _utils.createElement)(_constants.ElementName.VoteCount);
154
+ exports.VoteCount = VoteCount;
@@ -29,15 +29,18 @@ var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"))
29
29
 
30
30
  var _helpers = require("../../../state/helpers");
31
31
 
32
+ var _styled = require("../styled");
33
+
32
34
  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); }
33
35
 
34
36
  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; }
35
37
 
36
38
  var flexibleUiOptions = {
37
39
  hideElevation: true,
38
- size: _constants.SmartLinkSize.Large,
40
+ size: _constants.SmartLinkSize.Medium,
39
41
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
40
- theme: _constants.SmartLinkTheme.Black
42
+ theme: _constants.SmartLinkTheme.Black,
43
+ hidePadding: true
41
44
  };
42
45
 
43
46
  var getOpenAction = function getOpenAction(url, analytics) {
@@ -89,7 +92,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
89
92
  }, [cardState.details]);
90
93
  var onClick = (0, _react.useCallback)(function (event) {
91
94
  var isModifierKeyPressed = (0, _utils2.isSpecialEvent)(event);
92
- analytics.ui.cardClickedEvent(undefined, _utils.HOVER_CARD_ANALYTICS_DISPLAY, cardState.status, undefined, undefined, isModifierKeyPressed);
95
+ analytics.ui.cardClickedEvent(undefined, _utils.HOVER_CARD_ANALYTICS_DISPLAY, cardState.status, undefined, undefined, isModifierKeyPressed, undefined, undefined, undefined, 'titleGoToLink');
93
96
  }, [cardState.status, analytics.ui]);
94
97
  var titleActions = (0, _react.useMemo)(function () {
95
98
  return [getOpenAction(url, analytics)];
@@ -112,13 +115,20 @@ var HoverCardContent = function HoverCardContent(_ref) {
112
115
  ui: flexibleUiOptions,
113
116
  url: url
114
117
  }, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, {
115
- actions: titleActions
118
+ actions: titleActions,
119
+ overrideCss: _styled.titleBlockCss,
120
+ size: _constants.SmartLinkSize.Large,
121
+ position: _constants.SmartLinkPosition.Center
116
122
  }), /*#__PURE__*/_react.default.createElement(_blocks.MetadataBlock, {
117
123
  primary: primary,
118
124
  secondary: secondary,
119
- size: _constants.SmartLinkSize.Small
125
+ size: _constants.SmartLinkSize.Large,
126
+ overrideCss: _styled.metadataBlockCss,
127
+ maxLines: 1
120
128
  }), body, /*#__PURE__*/_react.default.createElement(_blocks.FooterBlock, {
121
- actions: footerActions
129
+ actions: footerActions,
130
+ size: _constants.SmartLinkSize.Large,
131
+ overrideCss: _styled.footerBlockCss
122
132
  }));
123
133
  };
124
134
 
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.HoverCardContainer = void 0;
8
+ exports.titleBlockCss = exports.metadataBlockCss = exports.footerBlockCss = exports.HoverCardContainer = void 0;
9
9
 
10
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
11
 
@@ -13,7 +13,13 @@ var _core = require("@emotion/core");
13
13
 
14
14
  var _index = require("../../index");
15
15
 
16
- var _templateObject;
16
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
17
17
 
18
- var HoverCardContainer = (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: none;\n border-width: 0;\n max-width: 350px;\n padding: 0;\n\n .", " {\n display: none;\n }\n"])), _index.loadingPlaceholderClassName);
19
- exports.HoverCardContainer = HoverCardContainer;
18
+ var HoverCardContainer = (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: 24rem;\n padding: 1rem;\n\n .", " {\n display: none;\n }\n"])), _index.loadingPlaceholderClassName);
19
+ exports.HoverCardContainer = HoverCardContainer;
20
+ var titleBlockCss = (0, _core.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n gap: 0.5rem;\n"])));
21
+ exports.titleBlockCss = titleBlockCss;
22
+ var metadataBlockCss = (0, _core.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n gap: 0px;\n\n /* primary element group */\n [data-smart-element-group]:first-of-type {\n flex-grow: 7;\n /* horizontal spacing between elements in group */\n > span {\n margin-right: 0.5rem;\n }\n }\n /* secondary element group */\n [data-smart-element-group]:last-of-type {\n flex-grow: 3;\n /* horizontal spacing between elements in group */\n > span {\n margin-left: 0.5rem;\n }\n }\n"])));
23
+ exports.metadataBlockCss = metadataBlockCss;
24
+ var footerBlockCss = (0, _core.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding-top: 0.25rem;\n"])));
25
+ exports.footerBlockCss = footerBlockCss;
@@ -17,8 +17,8 @@ var getSimulatedMetadata = function getSimulatedMetadata() {
17
17
  case 'confluence-object-provider':
18
18
  return {
19
19
  metadata: {
20
- primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.CreatedBy, _constants.ElementName.CommentCount, _constants.ElementName.ReactCount],
21
- secondary: []
20
+ primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.CreatedBy],
21
+ secondary: [_constants.ElementName.CommentCount, _constants.ElementName.ReactCount]
22
22
  }
23
23
  };
24
24
 
@@ -61,7 +61,7 @@ export const useSmartLinkAnalytics = (url, dispatchAnalytics, id, defaultLocatio
61
61
  * @param destinationProduct The product the Smart Link is linked to.
62
62
  * @returns
63
63
  */
64
- cardClickedEvent: (id = defaultId, display, status, definitionId = extractedDefinitionId, extensionKey = extractedExtensionKey, isModifierKeyPressed, location = defaultLocation, destinationProduct = extractedProduct, destinationSubproduct = extractedSubproduct) => dispatchAnalytics(uiCardClickedEvent(id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct)),
64
+ cardClickedEvent: (id = defaultId, display, status, definitionId = extractedDefinitionId, extensionKey = extractedExtensionKey, isModifierKeyPressed, location = defaultLocation, destinationProduct = extractedProduct, destinationSubproduct = extractedSubproduct, actionSubjectId) => dispatchAnalytics(uiCardClickedEvent(id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId)),
65
65
 
66
66
  /**
67
67
  * This fires an event that represents when a user clicks on a Smart Link action.
@@ -174,10 +174,10 @@ export const uiAuthAlternateAccountEvent = (display, definitionId, extensionKey)
174
174
  display
175
175
  }
176
176
  });
177
- export const uiCardClickedEvent = (id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct) => ({
177
+ export const uiCardClickedEvent = (id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId) => ({
178
178
  action: 'clicked',
179
179
  actionSubject: 'smartLink',
180
- actionSubjectId: 'titleGoToLink',
180
+ actionSubjectId,
181
181
  eventType: 'ui',
182
182
  attributes: { ...context,
183
183
  id,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "19.1.24",
3
+ "version": "19.1.27",
4
4
  "sideEffects": false
5
5
  }
@@ -116,11 +116,12 @@ export const renderElementItems = (items = [], display = 'inline') => {
116
116
  ...props
117
117
  } = curr;
118
118
  const Element = Elements[name];
119
+ const typedProps = props;
119
120
 
120
121
  if (Element && isElementDisplayValid(name, display)) {
121
122
  const element = /*#__PURE__*/React.createElement(Element, _extends({
122
123
  key: idx
123
- }, props));
124
+ }, typedProps));
124
125
 
125
126
  if (!isElementNull(element)) {
126
127
  return [...acc, element];
@@ -22,35 +22,17 @@ export const CollaboratorGroup = createElement(ElementName.CollaboratorGroup);
22
22
 
23
23
  export const CommentCount = createElement(ElementName.CommentCount);
24
24
  /**
25
- * Creates a ViewCount Badge element using the data from ViewCount in the Flexible UI Context.
26
- * @see Badge
27
- */
28
-
29
- export const ViewCount = createElement(ElementName.ViewCount);
30
- /**
31
- * Creates a ReactCount Badge element using the data from ReactCount in the Flexible UI Context.
32
- * @see Badge
33
- */
34
-
35
- export const ReactCount = createElement(ElementName.ReactCount);
36
- /**
37
- * Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
38
- * @see Badge
25
+ * Creates a CreatedOn DateTime element using the data from CreatedOn in the Flexible UI Context.
26
+ * @see DateTime
39
27
  */
40
28
 
41
- export const VoteCount = createElement(ElementName.VoteCount);
29
+ export const CreatedOn = createElement(ElementName.CreatedOn);
42
30
  /**
43
31
  * Creates a CreatedBy text element using the data from CreatedBy in the Flexible UI Context.
44
32
  * @see Text
45
33
  */
46
34
 
47
35
  export const CreatedBy = createElement(ElementName.CreatedBy);
48
- /**
49
- * Creates a CreatedOn DateTime element using the data from CreatedOn in the Flexible UI Context.
50
- * @see DateTime
51
- */
52
-
53
- export const CreatedOn = createElement(ElementName.CreatedOn);
54
36
  /**
55
37
  * Creates an element that contains Last Commit hash
56
38
  */
@@ -92,6 +74,18 @@ export const Priority = createElement(ElementName.Priority);
92
74
  */
93
75
 
94
76
  export const ProgrammingLanguage = createElement(ElementName.ProgrammingLanguage);
77
+ /**
78
+ * Creates a Provider Badge element using the data from Provider in the Flexible UI Context.
79
+ * @see Badge
80
+ */
81
+
82
+ export const Provider = createElement(ElementName.Provider);
83
+ /**
84
+ * Creates a ReactCount Badge element using the data from ReactCount in the Flexible UI Context.
85
+ * @see Badge
86
+ */
87
+
88
+ export const ReactCount = createElement(ElementName.ReactCount);
95
89
  /**
96
90
  * Creates a Snippet element using the data from Snippet in the Flexible UI Context.
97
91
  * @see Text
@@ -118,8 +112,14 @@ export const SubscriberCount = createElement(ElementName.SubscriberCount);
118
112
 
119
113
  export const Title = createElement(ElementName.Title);
120
114
  /**
121
- * Creates a Provider Badge element using the data from Provider in the Flexible UI Context.
115
+ * Creates a ViewCount Badge element using the data from ViewCount in the Flexible UI Context.
116
+ * @see Badge
117
+ */
118
+
119
+ export const ViewCount = createElement(ElementName.ViewCount);
120
+ /**
121
+ * Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
122
122
  * @see Badge
123
123
  */
124
124
 
125
- export const Provider = createElement(ElementName.Provider);
125
+ export const VoteCount = createElement(ElementName.VoteCount);
@@ -2,17 +2,19 @@ import React, { useCallback, useEffect, useMemo } from 'react';
2
2
  import { extractMetadata } from '../../../extractors/hover/extractMetadata';
3
3
  import { getSimulatedMetadata, HOVER_CARD_ANALYTICS_DISPLAY } from '../utils';
4
4
  import extractPreview from '../../../extractors/flexible/extract-preview';
5
- import { ActionName, SmartLinkSize, SmartLinkTheme } from '../../../constants';
5
+ import { ActionName, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from '../../../constants';
6
6
  import FlexibleCard from '../../FlexibleCard';
7
7
  import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../FlexibleCard/components/blocks';
8
8
  import { isSpecialEvent } from '../../../utils';
9
9
  import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
10
10
  import { getExtensionKey } from '../../../state/helpers';
11
+ import { titleBlockCss, metadataBlockCss, footerBlockCss } from '../styled';
11
12
  const flexibleUiOptions = {
12
13
  hideElevation: true,
13
- size: SmartLinkSize.Large,
14
+ size: SmartLinkSize.Medium,
14
15
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
15
- theme: SmartLinkTheme.Black
16
+ theme: SmartLinkTheme.Black,
17
+ hidePadding: true
16
18
  };
17
19
 
18
20
  const getOpenAction = (url, analytics) => ({
@@ -54,7 +56,7 @@ const HoverCardContent = ({
54
56
  const extensionKey = useMemo(() => getExtensionKey(cardState.details), [cardState.details]);
55
57
  const onClick = useCallback(event => {
56
58
  const isModifierKeyPressed = isSpecialEvent(event);
57
- analytics.ui.cardClickedEvent(undefined, HOVER_CARD_ANALYTICS_DISPLAY, cardState.status, undefined, undefined, isModifierKeyPressed);
59
+ analytics.ui.cardClickedEvent(undefined, HOVER_CARD_ANALYTICS_DISPLAY, cardState.status, undefined, undefined, isModifierKeyPressed, undefined, undefined, undefined, 'titleGoToLink');
58
60
  }, [cardState.status, analytics.ui]);
59
61
  const titleActions = useMemo(() => [getOpenAction(url, analytics)], [url, analytics]);
60
62
  const footerActions = useMemo(() => toFooterActions(cardActions), [cardActions]); //TODO: EDM-3224 deleted simulated and use real JsonLd
@@ -73,13 +75,20 @@ const HoverCardContent = ({
73
75
  ui: flexibleUiOptions,
74
76
  url: url
75
77
  }, /*#__PURE__*/React.createElement(TitleBlock, {
76
- actions: titleActions
78
+ actions: titleActions,
79
+ overrideCss: titleBlockCss,
80
+ size: SmartLinkSize.Large,
81
+ position: SmartLinkPosition.Center
77
82
  }), /*#__PURE__*/React.createElement(MetadataBlock, {
78
83
  primary: primary,
79
84
  secondary: secondary,
80
- size: SmartLinkSize.Small
85
+ size: SmartLinkSize.Large,
86
+ overrideCss: metadataBlockCss,
87
+ maxLines: 1
81
88
  }), body, /*#__PURE__*/React.createElement(FooterBlock, {
82
- actions: footerActions
89
+ actions: footerActions,
90
+ size: SmartLinkSize.Large,
91
+ overrideCss: footerBlockCss
83
92
  }));
84
93
  };
85
94
 
@@ -3,10 +3,37 @@ import { loadingPlaceholderClassName } from '../../index';
3
3
  export const HoverCardContainer = css`
4
4
  background: none;
5
5
  border-width: 0;
6
- max-width: 350px;
7
- padding: 0;
6
+ box-sizing: border-box;
7
+ width: 24rem;
8
+ padding: 1rem;
8
9
 
9
10
  .${loadingPlaceholderClassName} {
10
11
  display: none;
11
12
  }
13
+ `;
14
+ export const titleBlockCss = css`
15
+ gap: 0.5rem;
16
+ `;
17
+ export const metadataBlockCss = css`
18
+ gap: 0px;
19
+
20
+ /* primary element group */
21
+ [data-smart-element-group]:first-of-type {
22
+ flex-grow: 7;
23
+ /* horizontal spacing between elements in group */
24
+ > span {
25
+ margin-right: 0.5rem;
26
+ }
27
+ }
28
+ /* secondary element group */
29
+ [data-smart-element-group]:last-of-type {
30
+ flex-grow: 3;
31
+ /* horizontal spacing between elements in group */
32
+ > span {
33
+ margin-left: 0.5rem;
34
+ }
35
+ }
36
+ `;
37
+ export const footerBlockCss = css`
38
+ padding-top: 0.25rem;
12
39
  `;
@@ -5,8 +5,8 @@ export const getSimulatedMetadata = (extensionKey = '') => {
5
5
  case 'confluence-object-provider':
6
6
  return {
7
7
  metadata: {
8
- primary: [ElementName.AuthorGroup, ElementName.CreatedBy, ElementName.CommentCount, ElementName.ReactCount],
9
- secondary: []
8
+ primary: [ElementName.AuthorGroup, ElementName.CreatedBy],
9
+ secondary: [ElementName.CommentCount, ElementName.ReactCount]
10
10
  }
11
11
  };
12
12
 
@@ -80,7 +80,8 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, dispatchA
80
80
  var location = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : defaultLocation;
81
81
  var destinationProduct = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : extractedProduct;
82
82
  var destinationSubproduct = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : extractedSubproduct;
83
- return dispatchAnalytics(uiCardClickedEvent(id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct));
83
+ var actionSubjectId = arguments.length > 9 ? arguments[9] : undefined;
84
+ return dispatchAnalytics(uiCardClickedEvent(id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId));
84
85
  },
85
86
 
86
87
  /**
@@ -187,11 +187,11 @@ export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(di
187
187
  })
188
188
  };
189
189
  };
190
- export var uiCardClickedEvent = function uiCardClickedEvent(id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct) {
190
+ export var uiCardClickedEvent = function uiCardClickedEvent(id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId) {
191
191
  return {
192
192
  action: 'clicked',
193
193
  actionSubject: 'smartLink',
194
- actionSubjectId: 'titleGoToLink',
194
+ actionSubjectId: actionSubjectId,
195
195
  eventType: 'ui',
196
196
  attributes: _objectSpread(_objectSpread({}, context), {}, {
197
197
  id: id,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "19.1.24",
3
+ "version": "19.1.27",
4
4
  "sideEffects": false
5
5
  }
@@ -92,11 +92,12 @@ export var renderElementItems = function renderElementItems() {
92
92
  props = _objectWithoutProperties(curr, _excluded);
93
93
 
94
94
  var Element = Elements[name];
95
+ var typedProps = props;
95
96
 
96
97
  if (Element && isElementDisplayValid(name, display)) {
97
98
  var element = /*#__PURE__*/React.createElement(Element, _extends({
98
99
  key: idx
99
- }, props));
100
+ }, typedProps));
100
101
 
101
102
  if (!isElementNull(element)) {
102
103
  return [].concat(_toConsumableArray(acc), [element]);
@@ -22,35 +22,17 @@ export var CollaboratorGroup = createElement(ElementName.CollaboratorGroup);
22
22
 
23
23
  export var CommentCount = createElement(ElementName.CommentCount);
24
24
  /**
25
- * Creates a ViewCount Badge element using the data from ViewCount in the Flexible UI Context.
26
- * @see Badge
27
- */
28
-
29
- export var ViewCount = createElement(ElementName.ViewCount);
30
- /**
31
- * Creates a ReactCount Badge element using the data from ReactCount in the Flexible UI Context.
32
- * @see Badge
33
- */
34
-
35
- export var ReactCount = createElement(ElementName.ReactCount);
36
- /**
37
- * Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
38
- * @see Badge
25
+ * Creates a CreatedOn DateTime element using the data from CreatedOn in the Flexible UI Context.
26
+ * @see DateTime
39
27
  */
40
28
 
41
- export var VoteCount = createElement(ElementName.VoteCount);
29
+ export var CreatedOn = createElement(ElementName.CreatedOn);
42
30
  /**
43
31
  * Creates a CreatedBy text element using the data from CreatedBy in the Flexible UI Context.
44
32
  * @see Text
45
33
  */
46
34
 
47
35
  export var CreatedBy = createElement(ElementName.CreatedBy);
48
- /**
49
- * Creates a CreatedOn DateTime element using the data from CreatedOn in the Flexible UI Context.
50
- * @see DateTime
51
- */
52
-
53
- export var CreatedOn = createElement(ElementName.CreatedOn);
54
36
  /**
55
37
  * Creates an element that contains Last Commit hash
56
38
  */
@@ -92,6 +74,18 @@ export var Priority = createElement(ElementName.Priority);
92
74
  */
93
75
 
94
76
  export var ProgrammingLanguage = createElement(ElementName.ProgrammingLanguage);
77
+ /**
78
+ * Creates a Provider Badge element using the data from Provider in the Flexible UI Context.
79
+ * @see Badge
80
+ */
81
+
82
+ export var Provider = createElement(ElementName.Provider);
83
+ /**
84
+ * Creates a ReactCount Badge element using the data from ReactCount in the Flexible UI Context.
85
+ * @see Badge
86
+ */
87
+
88
+ export var ReactCount = createElement(ElementName.ReactCount);
95
89
  /**
96
90
  * Creates a Snippet element using the data from Snippet in the Flexible UI Context.
97
91
  * @see Text
@@ -118,8 +112,14 @@ export var SubscriberCount = createElement(ElementName.SubscriberCount);
118
112
 
119
113
  export var Title = createElement(ElementName.Title);
120
114
  /**
121
- * Creates a Provider Badge element using the data from Provider in the Flexible UI Context.
115
+ * Creates a ViewCount Badge element using the data from ViewCount in the Flexible UI Context.
116
+ * @see Badge
117
+ */
118
+
119
+ export var ViewCount = createElement(ElementName.ViewCount);
120
+ /**
121
+ * Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
122
122
  * @see Badge
123
123
  */
124
124
 
125
- export var Provider = createElement(ElementName.Provider);
125
+ export var VoteCount = createElement(ElementName.VoteCount);
@@ -2,17 +2,19 @@ import React, { useCallback, useEffect, useMemo } from 'react';
2
2
  import { extractMetadata } from '../../../extractors/hover/extractMetadata';
3
3
  import { getSimulatedMetadata, HOVER_CARD_ANALYTICS_DISPLAY } from '../utils';
4
4
  import extractPreview from '../../../extractors/flexible/extract-preview';
5
- import { ActionName, SmartLinkSize, SmartLinkTheme } from '../../../constants';
5
+ import { ActionName, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from '../../../constants';
6
6
  import FlexibleCard from '../../FlexibleCard';
7
7
  import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../FlexibleCard/components/blocks';
8
8
  import { isSpecialEvent } from '../../../utils';
9
9
  import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
10
10
  import { getExtensionKey } from '../../../state/helpers';
11
+ import { titleBlockCss, metadataBlockCss, footerBlockCss } from '../styled';
11
12
  var flexibleUiOptions = {
12
13
  hideElevation: true,
13
- size: SmartLinkSize.Large,
14
+ size: SmartLinkSize.Medium,
14
15
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
15
- theme: SmartLinkTheme.Black
16
+ theme: SmartLinkTheme.Black,
17
+ hidePadding: true
16
18
  };
17
19
 
18
20
  var getOpenAction = function getOpenAction(url, analytics) {
@@ -64,7 +66,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
64
66
  }, [cardState.details]);
65
67
  var onClick = useCallback(function (event) {
66
68
  var isModifierKeyPressed = isSpecialEvent(event);
67
- analytics.ui.cardClickedEvent(undefined, HOVER_CARD_ANALYTICS_DISPLAY, cardState.status, undefined, undefined, isModifierKeyPressed);
69
+ analytics.ui.cardClickedEvent(undefined, HOVER_CARD_ANALYTICS_DISPLAY, cardState.status, undefined, undefined, isModifierKeyPressed, undefined, undefined, undefined, 'titleGoToLink');
68
70
  }, [cardState.status, analytics.ui]);
69
71
  var titleActions = useMemo(function () {
70
72
  return [getOpenAction(url, analytics)];
@@ -87,13 +89,20 @@ var HoverCardContent = function HoverCardContent(_ref) {
87
89
  ui: flexibleUiOptions,
88
90
  url: url
89
91
  }, /*#__PURE__*/React.createElement(TitleBlock, {
90
- actions: titleActions
92
+ actions: titleActions,
93
+ overrideCss: titleBlockCss,
94
+ size: SmartLinkSize.Large,
95
+ position: SmartLinkPosition.Center
91
96
  }), /*#__PURE__*/React.createElement(MetadataBlock, {
92
97
  primary: primary,
93
98
  secondary: secondary,
94
- size: SmartLinkSize.Small
99
+ size: SmartLinkSize.Large,
100
+ overrideCss: metadataBlockCss,
101
+ maxLines: 1
95
102
  }), body, /*#__PURE__*/React.createElement(FooterBlock, {
96
- actions: footerActions
103
+ actions: footerActions,
104
+ size: SmartLinkSize.Large,
105
+ overrideCss: footerBlockCss
97
106
  }));
98
107
  };
99
108
 
@@ -1,7 +1,10 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
 
3
- var _templateObject;
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
4
4
 
5
5
  import { css } from '@emotion/core';
6
6
  import { loadingPlaceholderClassName } from '../../index';
7
- export var HoverCardContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n max-width: 350px;\n padding: 0;\n\n .", " {\n display: none;\n }\n"])), loadingPlaceholderClassName);
7
+ export var HoverCardContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: 24rem;\n padding: 1rem;\n\n .", " {\n display: none;\n }\n"])), loadingPlaceholderClassName);
8
+ export var titleBlockCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n gap: 0.5rem;\n"])));
9
+ export var metadataBlockCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n gap: 0px;\n\n /* primary element group */\n [data-smart-element-group]:first-of-type {\n flex-grow: 7;\n /* horizontal spacing between elements in group */\n > span {\n margin-right: 0.5rem;\n }\n }\n /* secondary element group */\n [data-smart-element-group]:last-of-type {\n flex-grow: 3;\n /* horizontal spacing between elements in group */\n > span {\n margin-left: 0.5rem;\n }\n }\n"])));
10
+ export var footerBlockCss = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding-top: 0.25rem;\n"])));
@@ -7,8 +7,8 @@ export var getSimulatedMetadata = function getSimulatedMetadata() {
7
7
  case 'confluence-object-provider':
8
8
  return {
9
9
  metadata: {
10
- primary: [ElementName.AuthorGroup, ElementName.CreatedBy, ElementName.CommentCount, ElementName.ReactCount],
11
- secondary: []
10
+ primary: [ElementName.AuthorGroup, ElementName.CreatedBy],
11
+ secondary: [ElementName.CommentCount, ElementName.ReactCount]
12
12
  }
13
13
  };
14
14
 
@@ -19,3 +19,4 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
19
19
  export { ActionName, ElementName, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, } from './constants';
20
20
  export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, } from './view/FlexibleCard/components/blocks';
21
21
  export type { ActionItem, ElementItem, } from './view/FlexibleCard/components/blocks/types';
22
+ export type { AnalyticsAction, AnalyticsActionSubject, AnalyticsPayload, AnalyticsHandler, } from './utils/types';
@@ -45,7 +45,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
45
45
  * @param destinationProduct The product the Smart Link is linked to.
46
46
  * @returns
47
47
  */
48
- cardClickedEvent: (id: string | undefined, display: CardInnerAppearance, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: DestinationProduct | string | undefined, destinationSubproduct?: DestinationSubproduct | string | undefined) => void;
48
+ cardClickedEvent: (id: string | undefined, display: CardInnerAppearance, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: DestinationProduct | string | undefined, destinationSubproduct?: DestinationSubproduct | string | undefined, actionSubjectId?: string | undefined) => void;
49
49
  /**
50
50
  * This fires an event that represents when a user clicks on a Smart Link action.
51
51
  * Note: This also starts the UFO smart-link-action-invocation experience.
@@ -12,7 +12,7 @@ export declare function useSmartLink(id: string, url: string, dispatchAnalytics:
12
12
  ui: {
13
13
  authEvent: (display: import("../../view/Card/types").CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
14
14
  authAlternateAccountEvent: (display: import("../../view/Card/types").CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
15
- cardClickedEvent: (id: string | undefined, display: import("../../view/Card/types").CardInnerAppearance, status: import("@atlaskit/linking-common/types").CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: string | undefined, destinationSubproduct?: string | undefined) => void;
15
+ cardClickedEvent: (id: string | undefined, display: import("../../view/Card/types").CardInnerAppearance, status: import("@atlaskit/linking-common/types").CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: string | undefined, destinationSubproduct?: string | undefined, actionSubjectId?: string | undefined) => void;
16
16
  actionClickedEvent: (id: string | undefined, extensionKey: string | undefined, actionType: string, display: import("../../view/Card/types").CardInnerAppearance, invokeType: import("../../model/invoke-opts").InvokeType) => void;
17
17
  hoverCardOpenLinkClickedEvent: (previewDisplay: import("../../view/HoverCard/types").PreviewDisplay, definitionId?: string | undefined, extensionKey?: string | undefined, previewInvokeMethod?: import("../../view/HoverCard/types").PreviewInvokeMethod | undefined) => void;
18
18
  closedAuthEvent: (display: import("../../view/Card/types").CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
@@ -23,7 +23,7 @@ export declare const connectFailedEvent: (definitionId?: string | undefined, ext
23
23
  export declare const trackAppAccountConnected: (definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
24
24
  export declare const uiAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
25
25
  export declare const uiAuthAlternateAccountEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
26
- export declare const uiCardClickedEvent: (id: string, display: CardInnerAppearance, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: string | undefined, destinationSubproduct?: string | undefined) => AnalyticsPayload;
26
+ export declare const uiCardClickedEvent: (id: string, display: CardInnerAppearance, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: string | undefined, destinationSubproduct?: string | undefined, actionSubjectId?: string | undefined) => AnalyticsPayload;
27
27
  export declare const uiActionClickedEvent: (id: string, actionType: string, extensionKey?: string | undefined, display?: CardInnerAppearance | undefined) => AnalyticsPayload;
28
28
  export declare const uiClosedAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
29
29
  export declare const screenAuthPopupEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
@@ -35,13 +35,11 @@ export declare type BlockProps = {
35
35
  */
36
36
  export declare type ElementItem = {
37
37
  /**
38
- * The name of the metadata element, used by Flexible UI to determine which
39
- * element to render.
38
+ * Any additional CSS properties to apply to the element.
40
39
  */
41
- name: ElementName.AuthorGroup | ElementName.CollaboratorGroup | ElementName.CommentCount | ElementName.CreatedBy | ElementName.CreatedOn | ElementName.ModifiedBy | ElementName.ModifiedOn | ElementName.Priority | ElementName.ProgrammingLanguage | ElementName.Provider | ElementName.ReactCount | ElementName.State | ElementName.SubscriberCount | ElementName.ViewCount | ElementName.VoteCount | ElementName.LatestCommit;
40
+ overrideCss?: SerializedStyles;
42
41
  /**
43
- * The size of the element to render.
44
- * The elements that support sizing are AuthorGroup and CollaboratorGroup.
42
+ * The size of the element to display.
45
43
  */
46
44
  size?: SmartLinkSize;
47
45
  /**
@@ -50,7 +48,7 @@ export declare type ElementItem = {
50
48
  * serving as a hook for automated tests
51
49
  */
52
50
  testId?: string;
53
- };
51
+ } & ElementItemProps;
54
52
  /**
55
53
  * Used to represent an Action when passing props into Flexible UI.
56
54
  */
@@ -102,3 +100,155 @@ export declare type CustomActionItem = BaseActionItem & {
102
100
  name: ActionName.CustomAction;
103
101
  } & ((Required<Pick<ActionProps, 'icon' | 'iconPosition'>> & Pick<ActionProps, 'content'>) | ((Required<Pick<ActionProps, 'content'>> & Pick<ActionProps, 'icon' | 'iconPosition'>) & Pick<ActionProps, 'tooltipMessage'>));
104
102
  export declare type ActionItem = NamedActionItem | CustomActionItem;
103
+ /**
104
+ * A type that contains all the possible combinations of elements with their corresponding props.
105
+ */
106
+ export declare type ElementItemProps = AuthorGroup | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | LatestCommit | LinkIcon | ModifiedBy | ModifiedOn | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | Snippet | State | SubscriberCount | Title | ViewCount | VoteCount;
107
+ /**
108
+ * Represents the props available for an AuthorGroup element.
109
+ * @see AuthorGroup
110
+ */
111
+ export declare type AuthorGroup = {
112
+ name: ElementName.AuthorGroup;
113
+ };
114
+ /**
115
+ * Represents the props available for an CollaboratorGroup element.
116
+ * @see CollaboratorGroup
117
+ */
118
+ export declare type CollaboratorGroup = {
119
+ name: ElementName.CollaboratorGroup;
120
+ };
121
+ /**
122
+ * Represents the props available for an CommentCount element.
123
+ * @see CommentCount
124
+ */
125
+ export declare type CommentCount = {
126
+ name: ElementName.CommentCount;
127
+ };
128
+ /**
129
+ * Represents the props available for an CreatedBy element.
130
+ * @see CreatedBy
131
+ */
132
+ export declare type CreatedBy = {
133
+ name: ElementName.CreatedBy;
134
+ };
135
+ /**
136
+ * Represents the props available for an CreatedOn element.
137
+ * @see CreatedOn
138
+ */
139
+ export declare type CreatedOn = {
140
+ name: ElementName.CreatedOn;
141
+ /**
142
+ * A string which will be displayed before the specified element.
143
+ */
144
+ text?: string;
145
+ };
146
+ /**
147
+ * Represents the props available for an LastCommit element.
148
+ * @see BadgeProps
149
+ */
150
+ export declare type LatestCommit = {
151
+ name: ElementName.LatestCommit;
152
+ };
153
+ /**
154
+ * Represents the props available for an LinkIcon element.
155
+ * @see LinkIcon
156
+ */
157
+ export declare type LinkIcon = {
158
+ name: ElementName.LinkIcon;
159
+ };
160
+ /**
161
+ * Represents the props available for an ModifiedBy element.
162
+ * @see ModifiedBy
163
+ */
164
+ export declare type ModifiedBy = {
165
+ name: ElementName.ModifiedBy;
166
+ };
167
+ /**
168
+ * Represents the props available for an ModifiedOn element.
169
+ * @see ModifiedOn
170
+ */
171
+ export declare type ModifiedOn = {
172
+ name: ElementName.ModifiedOn;
173
+ /**
174
+ * A string which will be displayed before the specified element.
175
+ */
176
+ text?: string;
177
+ };
178
+ /**
179
+ * Represents the props available for an Preview element.
180
+ * @see Preview
181
+ */
182
+ export declare type Preview = {
183
+ name: ElementName.Preview;
184
+ };
185
+ /**
186
+ * Represents the props available for an Priority element.
187
+ * @see Priority
188
+ */
189
+ export declare type Priority = {
190
+ name: ElementName.Priority;
191
+ };
192
+ /**
193
+ * Represents the props available for an ProgrammingLanguage element.
194
+ * @see ProgrammingLanguage
195
+ */
196
+ export declare type ProgrammingLanguage = {
197
+ name: ElementName.ProgrammingLanguage;
198
+ };
199
+ /**
200
+ * Represents the props available for an Provider element.
201
+ * @see Provider
202
+ */
203
+ export declare type Provider = {
204
+ name: ElementName.Provider;
205
+ };
206
+ /**
207
+ * Represents the props available for an ReactCount element.
208
+ * @see ReactCount
209
+ */
210
+ export declare type ReactCount = {
211
+ name: ElementName.ReactCount;
212
+ };
213
+ /**
214
+ * Represents the props available for an Snippet element.
215
+ * @see Snippet
216
+ */
217
+ export declare type Snippet = {
218
+ name: ElementName.Snippet;
219
+ };
220
+ /**
221
+ * Represents the props available for an State element.
222
+ * @see State
223
+ */
224
+ export declare type State = {
225
+ name: ElementName.State;
226
+ };
227
+ /**
228
+ * Represents the props available for an SubscriberCount element.
229
+ * @see SubscriberCount
230
+ */
231
+ export declare type SubscriberCount = {
232
+ name: ElementName.SubscriberCount;
233
+ };
234
+ /**
235
+ * Represents the props available for an Title element.
236
+ * @see Title
237
+ */
238
+ export declare type Title = {
239
+ name: ElementName.Title;
240
+ };
241
+ /**
242
+ * Represents the props available for an ViewCount element.
243
+ * @see ViewCount
244
+ */
245
+ export declare type ViewCount = {
246
+ name: ElementName.ViewCount;
247
+ };
248
+ /**
249
+ * Represents the props available for an VoteCount element.
250
+ * @see VoteCount
251
+ */
252
+ export declare type VoteCount = {
253
+ name: ElementName.VoteCount;
254
+ };
@@ -23,30 +23,15 @@ export declare const CollaboratorGroup: import("react").FC<AvatarGroupProps>;
23
23
  */
24
24
  export declare const CommentCount: import("react").FC<BadgeProps>;
25
25
  /**
26
- * Creates a ViewCount Badge element using the data from ViewCount in the Flexible UI Context.
27
- * @see Badge
28
- */
29
- export declare const ViewCount: import("react").FC<BadgeProps>;
30
- /**
31
- * Creates a ReactCount Badge element using the data from ReactCount in the Flexible UI Context.
32
- * @see Badge
33
- */
34
- export declare const ReactCount: import("react").FC<BadgeProps>;
35
- /**
36
- * Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
37
- * @see Badge
26
+ * Creates a CreatedOn DateTime element using the data from CreatedOn in the Flexible UI Context.
27
+ * @see DateTime
38
28
  */
39
- export declare const VoteCount: import("react").FC<BadgeProps>;
29
+ export declare const CreatedOn: import("react").FC<DateTimeProps>;
40
30
  /**
41
31
  * Creates a CreatedBy text element using the data from CreatedBy in the Flexible UI Context.
42
32
  * @see Text
43
33
  */
44
34
  export declare const CreatedBy: import("react").FC<TextProps>;
45
- /**
46
- * Creates a CreatedOn DateTime element using the data from CreatedOn in the Flexible UI Context.
47
- * @see DateTime
48
- */
49
- export declare const CreatedOn: import("react").FC<DateTimeProps>;
50
35
  /**
51
36
  * Creates an element that contains Last Commit hash
52
37
  */
@@ -81,6 +66,16 @@ export declare const Priority: import("react").FC<BadgeProps>;
81
66
  * @see Badge
82
67
  */
83
68
  export declare const ProgrammingLanguage: import("react").FC<BadgeProps>;
69
+ /**
70
+ * Creates a Provider Badge element using the data from Provider in the Flexible UI Context.
71
+ * @see Badge
72
+ */
73
+ export declare const Provider: import("react").FC<BadgeProps>;
74
+ /**
75
+ * Creates a ReactCount Badge element using the data from ReactCount in the Flexible UI Context.
76
+ * @see Badge
77
+ */
78
+ export declare const ReactCount: import("react").FC<BadgeProps>;
84
79
  /**
85
80
  * Creates a Snippet element using the data from Snippet in the Flexible UI Context.
86
81
  * @see Text
@@ -103,7 +98,12 @@ export declare const SubscriberCount: import("react").FC<BadgeProps>;
103
98
  */
104
99
  export declare const Title: import("react").FC<LinkProps>;
105
100
  /**
106
- * Creates a Provider Badge element using the data from Provider in the Flexible UI Context.
101
+ * Creates a ViewCount Badge element using the data from ViewCount in the Flexible UI Context.
107
102
  * @see Badge
108
103
  */
109
- export declare const Provider: import("react").FC<BadgeProps>;
104
+ export declare const ViewCount: import("react").FC<BadgeProps>;
105
+ /**
106
+ * Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
107
+ * @see Badge
108
+ */
109
+ export declare const VoteCount: import("react").FC<BadgeProps>;
@@ -1 +1,4 @@
1
1
  export declare const HoverCardContainer: import("@emotion/utils").SerializedStyles;
2
+ export declare const titleBlockCss: import("@emotion/utils").SerializedStyles;
3
+ export declare const metadataBlockCss: import("@emotion/utils").SerializedStyles;
4
+ export declare const footerBlockCss: import("@emotion/utils").SerializedStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "19.1.24",
3
+ "version": "19.1.27",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"