@atlaskit/smart-card 17.7.10 → 18.0.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 (49) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/constants.js +6 -0
  3. package/dist/cjs/extractors/flexible/index.js +3 -0
  4. package/dist/cjs/extractors/flexible/utils.js +19 -1
  5. package/dist/cjs/version.json +1 -1
  6. package/dist/cjs/view/EmbedCard/components/styled.js +1 -1
  7. package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +1 -1
  8. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
  9. package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +12 -0
  10. package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +1 -0
  11. package/dist/cjs/view/FlexibleCard/components/elements/index.js +7 -1
  12. package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +1 -0
  13. package/dist/cjs/view/FlexibleCard/components/elements/utils.js +18 -0
  14. package/dist/cjs/view/InlineCard/IconAndTitleLayout/styled.js +2 -2
  15. package/dist/cjs/view/InlineCard/styled.js +1 -1
  16. package/dist/es2019/constants.js +6 -0
  17. package/dist/es2019/extractors/flexible/index.js +4 -1
  18. package/dist/es2019/extractors/flexible/utils.js +3 -0
  19. package/dist/es2019/version.json +1 -1
  20. package/dist/es2019/view/EmbedCard/components/styled.js +0 -2
  21. package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +5 -1
  22. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +3 -0
  23. package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +9 -0
  24. package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +1 -0
  25. package/dist/es2019/view/FlexibleCard/components/elements/index.js +3 -0
  26. package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +1 -0
  27. package/dist/es2019/view/FlexibleCard/components/elements/utils.js +21 -0
  28. package/dist/es2019/view/InlineCard/IconAndTitleLayout/styled.js +2 -4
  29. package/dist/es2019/view/InlineCard/styled.js +1 -1
  30. package/dist/esm/constants.js +6 -0
  31. package/dist/esm/extractors/flexible/index.js +4 -1
  32. package/dist/esm/extractors/flexible/utils.js +9 -0
  33. package/dist/esm/version.json +1 -1
  34. package/dist/esm/view/EmbedCard/components/styled.js +1 -1
  35. package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +2 -2
  36. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
  37. package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +12 -0
  38. package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +1 -0
  39. package/dist/esm/view/FlexibleCard/components/elements/index.js +3 -0
  40. package/dist/esm/view/FlexibleCard/components/elements/text/index.js +1 -0
  41. package/dist/esm/view/FlexibleCard/components/elements/utils.js +18 -0
  42. package/dist/esm/view/InlineCard/IconAndTitleLayout/styled.js +2 -2
  43. package/dist/esm/view/InlineCard/styled.js +1 -1
  44. package/dist/types/constants.d.ts +6 -0
  45. package/dist/types/extractors/common/__mocks__/jsonld.d.ts +8 -0
  46. package/dist/types/extractors/flexible/utils.d.ts +3 -0
  47. package/dist/types/state/flexible-ui-context/types.d.ts +3 -0
  48. package/dist/types/view/FlexibleCard/components/elements/index.d.ts +3 -0
  49. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 18.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`dd429d9fdca`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dd429d9fdca) - [ux] EDM-2822: Fix smart link wraps just after the icon
8
+
9
+ ### Patch Changes
10
+
11
+ - [`fb1cf506701`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fb1cf506701) - [ux] ED-14487: polyfill ResizeObserver and IntersectionObserver for unit tests, but mock isIntersectionObserverSupported() for tests related to smart-cards
12
+ - Updated dependencies
13
+
14
+ ## 17.7.12
15
+
16
+ ### Patch Changes
17
+
18
+ - [`f9bbe6d0a56`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f9bbe6d0a56) - Add View, Vote and React badge elements
19
+
20
+ ## 17.7.11
21
+
22
+ ### Patch Changes
23
+
24
+ - [`ca8c8db1440`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ca8c8db1440) - Flexible UI: Add separator between text/date-time elements
25
+
3
26
  ## 17.7.10
4
27
 
5
28
  ### Patch Changes
@@ -132,6 +132,9 @@ exports.ElementName = ElementName;
132
132
  ElementName["AuthorGroup"] = "AuthorGroup";
133
133
  ElementName["CollaboratorGroup"] = "CollaboratorGroup";
134
134
  ElementName["CommentCount"] = "CommentCount";
135
+ ElementName["ViewCount"] = "ViewCount";
136
+ ElementName["ReactCount"] = "ReactCount";
137
+ ElementName["VoteCount"] = "VoteCount";
135
138
  ElementName["CreatedBy"] = "CreatedBy";
136
139
  ElementName["CreatedOn"] = "CreatedOn";
137
140
  ElementName["LinkIcon"] = "LinkIcon";
@@ -212,6 +215,9 @@ exports.IconType = IconType;
212
215
  IconType["Error"] = "Default:Error";
213
216
  IconType["Forbidden"] = "Default:Forbidden";
214
217
  IconType["Comment"] = "Badge:Comment";
218
+ IconType["View"] = "Badge:View";
219
+ IconType["React"] = "Badge:React";
220
+ IconType["Vote"] = "Badge:Vote";
215
221
  IconType["PriorityBlocker"] = "Badge:PriorityBlocker";
216
222
  IconType["PriorityCritical"] = "Badge:PriorityCritical";
217
223
  IconType["PriorityHigh"] = "Badge:PriorityHigh";
@@ -40,6 +40,9 @@ var extractFlexibleUiContext = function extractFlexibleUiContext(response, rende
40
40
  authorGroup: (0, _person.extractPersonCreatedBy)(data),
41
41
  collaboratorGroup: (0, _collaboratorGroup.extractPersonsUpdatedBy)(data),
42
42
  commentCount: (0, _utils.extractCommentCount)(data),
43
+ viewCount: (0, _utils.extractViewCount)(data),
44
+ reactCount: (0, _utils.extractReactCount)(data),
45
+ voteCount: (0, _utils.extractVoteCount)(data),
43
46
  createdBy: (0, _utils.extractCreatedBy)(data),
44
47
  createdOn: (0, _extractDateCreated.extractDateCreated)(data),
45
48
  linkIcon: (0, _icon.extractLinkIcon)(response, renderers),
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.extractSubscriberCount = exports.extractProgrammingLanguage = exports.extractModifiedBy = exports.extractCreatedBy = exports.extractCommentCount = void 0;
6
+ exports.extractVoteCount = exports.extractViewCount = exports.extractSubscriberCount = exports.extractReactCount = exports.extractProgrammingLanguage = exports.extractModifiedBy = exports.extractCreatedBy = exports.extractCommentCount = void 0;
7
7
 
8
8
  var _person = require("../common/person");
9
9
 
@@ -17,6 +17,24 @@ var extractCommentCount = function extractCommentCount(data) {
17
17
 
18
18
  exports.extractCommentCount = extractCommentCount;
19
19
 
20
+ var extractViewCount = function extractViewCount(data) {
21
+ return extractValue(data, 'atlassian:viewCount');
22
+ };
23
+
24
+ exports.extractViewCount = extractViewCount;
25
+
26
+ var extractReactCount = function extractReactCount(data) {
27
+ return extractValue(data, 'atlassian:reactCount');
28
+ };
29
+
30
+ exports.extractReactCount = extractReactCount;
31
+
32
+ var extractVoteCount = function extractVoteCount(data) {
33
+ return extractValue(data, 'atlassian:voteCount');
34
+ };
35
+
36
+ exports.extractVoteCount = extractVoteCount;
37
+
20
38
  var extractCreatedBy = function extractCreatedBy(data) {
21
39
  var persons = (0, _person.extractPersonCreatedBy)(data);
22
40
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.7.10",
3
+ "version": "18.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -126,7 +126,7 @@ exports.TextWrapper = TextWrapper;
126
126
  // NB: `overflow` is kept as `hidden` since
127
127
  // the internal contents of the `iframe` should
128
128
  // manage scrolling behaviour.
129
- var Content = _styled.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n\n ", "\n ", "\n background-color: white;\n position: absolute;\n z-index: 1;\n width: 100%;\n top: ", ";\n overflow: hidden;\n height: calc(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"])), _mediaUi.borderRadius, cardShadow, (0, _utils.gs)(4), (0, _utils.gs)(4), function (_ref9) {
129
+ var Content = _styled.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n background-color: white;\n position: absolute;\n z-index: 1;\n width: 100%;\n top: ", ";\n overflow: hidden;\n height: calc(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"])), _mediaUi.borderRadius, cardShadow, (0, _utils.gs)(4), (0, _utils.gs)(4), function (_ref9) {
130
130
  var isInteractive = _ref9.isInteractive;
131
131
 
132
132
  if (isInteractive) {
@@ -20,7 +20,7 @@ var _utils = require("../utils");
20
20
  var _templateObject;
21
21
 
22
22
  var getBlockStyles = function getBlockStyles(direction, size) {
23
- return (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n justify-content: flex-start;\n"])), (0, _utils.getBaseStyles)(direction, size));
23
+ return (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n justify-content: flex-start;\n [data-separator] + [data-separator]:before {\n content: '\u2022';\n margin-right: ", "rem;\n }\n"])), (0, _utils.getBaseStyles)(direction, size), (0, _utils.getGapSize)(size));
24
24
  };
25
25
 
26
26
  var Block = function Block(_ref) {
@@ -48,7 +48,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
48
48
 
49
49
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
50
50
 
51
- var ElementDisplaySchema = (_ElementDisplaySchema = {}, (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AuthorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CollaboratorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CommentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LinkIcon, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Preview, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Priority, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ProgrammingLanguage, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Snippet, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.State, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SubscriberCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Title, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Provider, ['inline']), _ElementDisplaySchema);
51
+ var ElementDisplaySchema = (_ElementDisplaySchema = {}, (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AuthorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CollaboratorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CommentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ViewCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ReactCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.VoteCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LinkIcon, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Preview, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Priority, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ProgrammingLanguage, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Snippet, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.State, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SubscriberCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Title, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Provider, ['inline']), _ElementDisplaySchema);
52
52
  exports.ElementDisplaySchema = ElementDisplaySchema;
53
53
 
54
54
  var getDirectionStyles = function getDirectionStyles(direction) {
@@ -212,6 +212,18 @@ var importIconMapper = (_importIconMapper = {}, (0, _defineProperty2.default)(_i
212
212
  return Promise.resolve().then(function () {
213
213
  return _interopRequireWildcard(require('@atlaskit/icon/glyph/comment'));
214
214
  });
215
+ }), (0, _defineProperty2.default)(_importIconMapper, _constants.IconType.View, function () {
216
+ return Promise.resolve().then(function () {
217
+ return _interopRequireWildcard(require('@atlaskit/icon/glyph/watch'));
218
+ });
219
+ }), (0, _defineProperty2.default)(_importIconMapper, _constants.IconType.React, function () {
220
+ return Promise.resolve().then(function () {
221
+ return _interopRequireWildcard(require('@atlaskit/icon/glyph/like'));
222
+ });
223
+ }), (0, _defineProperty2.default)(_importIconMapper, _constants.IconType.Vote, function () {
224
+ return Promise.resolve().then(function () {
225
+ return _interopRequireWildcard(require('@atlaskit/icon/glyph/arrow-up'));
226
+ });
215
227
  }), (0, _defineProperty2.default)(_importIconMapper, _constants.IconType.PriorityBlocker, function () {
216
228
  return Promise.resolve().then(function () {
217
229
  return _interopRequireWildcard(require('@atlaskit/icon-priority/glyph/priority-blocker'));
@@ -55,6 +55,7 @@ var DateTime = function DateTime(_ref) {
55
55
  });
56
56
  return (0, _core.jsx)("span", {
57
57
  css: styles,
58
+ "data-separator": true,
58
59
  "data-smart-element-date-time": true,
59
60
  "data-testid": testId
60
61
  }, (0, _core.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, typeToDescriptorMap[type], {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Title = exports.SubscriberCount = exports.State = exports.Snippet = exports.Provider = exports.ProgrammingLanguage = exports.Priority = exports.Preview = exports.ModifiedOn = exports.ModifiedBy = exports.LinkIcon = exports.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.AuthorGroup = void 0;
6
+ exports.VoteCount = exports.ViewCount = exports.Title = exports.SubscriberCount = exports.State = exports.Snippet = exports.ReactCount = exports.Provider = exports.ProgrammingLanguage = exports.Priority = exports.Preview = exports.ModifiedOn = exports.ModifiedBy = exports.LinkIcon = exports.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.AuthorGroup = void 0;
7
7
 
8
8
  var _utils = require("./utils");
9
9
 
@@ -18,6 +18,12 @@ var CollaboratorGroup = (0, _utils.createElement)(_constants.ElementName.Collabo
18
18
  exports.CollaboratorGroup = CollaboratorGroup;
19
19
  var CommentCount = (0, _utils.createElement)(_constants.ElementName.CommentCount);
20
20
  exports.CommentCount = CommentCount;
21
+ var ViewCount = (0, _utils.createElement)(_constants.ElementName.ViewCount);
22
+ exports.ViewCount = ViewCount;
23
+ var ReactCount = (0, _utils.createElement)(_constants.ElementName.ReactCount);
24
+ exports.ReactCount = ReactCount;
25
+ var VoteCount = (0, _utils.createElement)(_constants.ElementName.VoteCount);
26
+ exports.VoteCount = VoteCount;
21
27
  var CreatedBy = (0, _utils.createElement)(_constants.ElementName.CreatedBy);
22
28
  exports.CreatedBy = CreatedBy;
23
29
  var CreatedOn = (0, _utils.createElement)(_constants.ElementName.CreatedOn);
@@ -39,6 +39,7 @@ var Text = function Text(_ref) {
39
39
 
40
40
  return (0, _core.jsx)("span", {
41
41
  css: getStyles(maxLines, color),
42
+ "data-separator": true,
42
43
  "data-smart-element-text": true,
43
44
  "data-testid": testId
44
45
  }, (0, _utils.getFormattedMessage)(message) || content);
@@ -55,6 +55,21 @@ var elementMappings = (_elementMappings = {}, (0, _defineProperty2.default)(_ele
55
55
  props: {
56
56
  icon: _constants.IconType.Comment
57
57
  }
58
+ }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.ViewCount, {
59
+ component: _badge.default,
60
+ props: {
61
+ icon: _constants.IconType.View
62
+ }
63
+ }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.ReactCount, {
64
+ component: _badge.default,
65
+ props: {
66
+ icon: _constants.IconType.React
67
+ }
68
+ }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.VoteCount, {
69
+ component: _badge.default,
70
+ props: {
71
+ icon: _constants.IconType.Vote
72
+ }
58
73
  }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.CreatedBy, {
59
74
  component: _text.default
60
75
  }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.LinkIcon, {
@@ -112,6 +127,9 @@ var getData = function getData(elementName, contextKey, context) {
112
127
  return toAvatarGroupProps(data);
113
128
 
114
129
  case _constants.ElementName.CommentCount:
130
+ case _constants.ElementName.ViewCount:
131
+ case _constants.ElementName.ReactCount:
132
+ case _constants.ElementName.VoteCount:
115
133
  case _constants.ElementName.ProgrammingLanguage:
116
134
  case _constants.ElementName.SubscriberCount:
117
135
  return toBadgeProps(data);
@@ -33,12 +33,12 @@ exports.IconWrapper = IconWrapper;
33
33
 
34
34
  var EmojiWrapper = _styled.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n margin-right: 2px;\n user-select: none;\n ", "\n ", "\n"])), IconOverrides, IconObjectOverrides); // The main 'wrapping' element, title of the content.
35
35
  // NB: `white-space` adds little whitespace before wrapping.
36
- // NB: `hyphens` enables hyphenation on word break.
36
+ // NB: `word-break` line breaks as soon as an overflow takes place.
37
37
 
38
38
 
39
39
  exports.EmojiWrapper = EmojiWrapper;
40
40
 
41
- var IconTitleWrapper = _styled.default.span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n hyphens: auto;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n word-break: break-word;\n"]))); // TODO: Replace overrides with proper AtlasKit solution.
41
+ var IconTitleWrapper = _styled.default.span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n white-space: pre-wrap;\n word-break: break-all;\n"]))); // TODO: Replace overrides with proper AtlasKit solution.
42
42
 
43
43
 
44
44
  exports.IconTitleWrapper = IconTitleWrapper;
@@ -20,7 +20,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
20
20
  var LINK_COLOR_DARK = '#4794FF'; // By default buttons will hide overflow and ellipsis content instead of wrapping.
21
21
  // This basically turns the button back into inline content
22
22
 
23
- var IconStyledButton = _styled.default.span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n text-align: initial !important;\n display: inline !important;\n\n &:hover {\n /* Remove the text-decoration to match other inline card hover states*/\n text-decoration: none !important;\n }\n\n > span {\n display: inline;\n > span {\n overflow: initial;\n text-overflow: initial;\n white-space: initial;\n }\n }\n"])));
23
+ var IconStyledButton = _styled.default.span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n text-align: initial !important;\n display: inline !important;\n\n &:hover {\n /* Remove the text-decoration to match other inline card hover states */\n text-decoration: none !important;\n }\n\n > span {\n display: inline;\n > span {\n overflow: initial;\n text-overflow: initial;\n white-space: initial;\n }\n }\n"])));
24
24
 
25
25
  exports.IconStyledButton = IconStyledButton;
26
26
 
@@ -109,6 +109,9 @@ export let ElementName;
109
109
  ElementName["AuthorGroup"] = "AuthorGroup";
110
110
  ElementName["CollaboratorGroup"] = "CollaboratorGroup";
111
111
  ElementName["CommentCount"] = "CommentCount";
112
+ ElementName["ViewCount"] = "ViewCount";
113
+ ElementName["ReactCount"] = "ReactCount";
114
+ ElementName["VoteCount"] = "VoteCount";
112
115
  ElementName["CreatedBy"] = "CreatedBy";
113
116
  ElementName["CreatedOn"] = "CreatedOn";
114
117
  ElementName["LinkIcon"] = "LinkIcon";
@@ -185,6 +188,9 @@ export let IconType;
185
188
  IconType["Error"] = "Default:Error";
186
189
  IconType["Forbidden"] = "Default:Forbidden";
187
190
  IconType["Comment"] = "Badge:Comment";
191
+ IconType["View"] = "Badge:View";
192
+ IconType["React"] = "Badge:React";
193
+ IconType["Vote"] = "Badge:Vote";
188
194
  IconType["PriorityBlocker"] = "Badge:PriorityBlocker";
189
195
  IconType["PriorityCritical"] = "Badge:PriorityCritical";
190
196
  IconType["PriorityHigh"] = "Badge:PriorityHigh";
@@ -1,7 +1,7 @@
1
1
  import { extractLink, extractSummary, extractTitle } from '../common/primitives';
2
2
  import { extractLozenge } from '../common/lozenge';
3
3
  import { extractLinkIcon } from './icon';
4
- import { extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount } from './utils';
4
+ import { extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount } from './utils';
5
5
  import { extractPersonCreatedBy } from '../common/person';
6
6
  import { extractPersonsUpdatedBy } from './collaboratorGroup';
7
7
  import { extractDateUpdated } from '../common/date/extractDateUpdated';
@@ -21,6 +21,9 @@ const extractFlexibleUiContext = (response, renderers) => {
21
21
  authorGroup: extractPersonCreatedBy(data),
22
22
  collaboratorGroup: extractPersonsUpdatedBy(data),
23
23
  commentCount: extractCommentCount(data),
24
+ viewCount: extractViewCount(data),
25
+ reactCount: extractReactCount(data),
26
+ voteCount: extractVoteCount(data),
24
27
  createdBy: extractCreatedBy(data),
25
28
  createdOn: extractDateCreated(data),
26
29
  linkIcon: extractLinkIcon(response, renderers),
@@ -5,6 +5,9 @@ const extractValue = (data, key) => {
5
5
  };
6
6
 
7
7
  export const extractCommentCount = data => extractValue(data, 'schema:commentCount');
8
+ export const extractViewCount = data => extractValue(data, 'atlassian:viewCount');
9
+ export const extractReactCount = data => extractValue(data, 'atlassian:reactCount');
10
+ export const extractVoteCount = data => extractValue(data, 'atlassian:voteCount');
8
11
  export const extractCreatedBy = data => {
9
12
  const persons = extractPersonCreatedBy(data);
10
13
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.7.10",
3
+ "version": "18.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -170,8 +170,6 @@ export const TextWrapper = styled.div`
170
170
  // the internal contents of the `iframe` should
171
171
  // manage scrolling behaviour.
172
172
  export const Content = styled.div`
173
- position: relative;
174
-
175
173
  ${borderRadius}
176
174
  ${cardShadow}
177
175
  background-color: white;
@@ -2,11 +2,15 @@
2
2
  import React from 'react';
3
3
  import { css, jsx } from '@emotion/core';
4
4
  import { SmartLinkDirection, SmartLinkSize } from '../../../../../constants';
5
- import { getBaseStyles, renderChildren } from '../utils';
5
+ import { getBaseStyles, getGapSize, renderChildren } from '../utils';
6
6
 
7
7
  const getBlockStyles = (direction, size) => css`
8
8
  ${getBaseStyles(direction, size)}
9
9
  justify-content: flex-start;
10
+ [data-separator] + [data-separator]:before {
11
+ content: '•';
12
+ margin-right: ${getGapSize(size)}rem;
13
+ }
10
14
  `;
11
15
 
12
16
  const Block = ({
@@ -11,6 +11,9 @@ export const ElementDisplaySchema = {
11
11
  [ElementName.AuthorGroup]: ['inline'],
12
12
  [ElementName.CollaboratorGroup]: ['inline'],
13
13
  [ElementName.CommentCount]: ['inline'],
14
+ [ElementName.ViewCount]: ['inline'],
15
+ [ElementName.ReactCount]: ['inline'],
16
+ [ElementName.VoteCount]: ['inline'],
14
17
  [ElementName.CreatedBy]: ['inline'],
15
18
  [ElementName.CreatedOn]: ['inline'],
16
19
  [ElementName.LinkIcon]: ['inline'],
@@ -149,6 +149,15 @@ const importIconMapper = {
149
149
  [IconType.Comment]: () => import(
150
150
  /* webpackChunkName: "glyphComment" */
151
151
  '@atlaskit/icon/glyph/comment'),
152
+ [IconType.View]: () => import(
153
+ /* webpackChunkName: "glyphComment" */
154
+ '@atlaskit/icon/glyph/watch'),
155
+ [IconType.React]: () => import(
156
+ /* webpackChunkName: "glyphComment" */
157
+ '@atlaskit/icon/glyph/like'),
158
+ [IconType.Vote]: () => import(
159
+ /* webpackChunkName: "glyphComment" */
160
+ '@atlaskit/icon/glyph/arrow-up'),
152
161
  [IconType.PriorityBlocker]: () => import(
153
162
  /* webpackChunkName: "glyphBlocker" */
154
163
  '@atlaskit/icon-priority/glyph/priority-blocker'),
@@ -41,6 +41,7 @@ const DateTime = ({
41
41
  });
42
42
  return jsx("span", {
43
43
  css: styles,
44
+ "data-separator": true,
44
45
  "data-smart-element-date-time": true,
45
46
  "data-testid": testId
46
47
  }, jsx(FormattedMessage, _extends({}, typeToDescriptorMap[type], {
@@ -6,6 +6,9 @@ import { ElementName } from '../../../../constants';
6
6
  export const AuthorGroup = createElement(ElementName.AuthorGroup);
7
7
  export const CollaboratorGroup = createElement(ElementName.CollaboratorGroup);
8
8
  export const CommentCount = createElement(ElementName.CommentCount);
9
+ export const ViewCount = createElement(ElementName.ViewCount);
10
+ export const ReactCount = createElement(ElementName.ReactCount);
11
+ export const VoteCount = createElement(ElementName.VoteCount);
9
12
  export const CreatedBy = createElement(ElementName.CreatedBy);
10
13
  export const CreatedOn = createElement(ElementName.CreatedOn);
11
14
  export const LinkIcon = createElement(ElementName.LinkIcon);
@@ -24,6 +24,7 @@ const Text = ({
24
24
 
25
25
  return jsx("span", {
26
26
  css: getStyles(maxLines, color),
27
+ "data-separator": true,
27
28
  "data-smart-element-text": true,
28
29
  "data-testid": testId
29
30
  }, getFormattedMessage(message) || content);
@@ -26,6 +26,24 @@ const elementMappings = {
26
26
  icon: IconType.Comment
27
27
  }
28
28
  },
29
+ [ElementName.ViewCount]: {
30
+ component: Badge,
31
+ props: {
32
+ icon: IconType.View
33
+ }
34
+ },
35
+ [ElementName.ReactCount]: {
36
+ component: Badge,
37
+ props: {
38
+ icon: IconType.React
39
+ }
40
+ },
41
+ [ElementName.VoteCount]: {
42
+ component: Badge,
43
+ props: {
44
+ icon: IconType.Vote
45
+ }
46
+ },
29
47
  [ElementName.CreatedBy]: {
30
48
  component: Text
31
49
  },
@@ -96,6 +114,9 @@ const getData = (elementName, contextKey, context) => {
96
114
  return toAvatarGroupProps(data);
97
115
 
98
116
  case ElementName.CommentCount:
117
+ case ElementName.ViewCount:
118
+ case ElementName.ReactCount:
119
+ case ElementName.VoteCount:
99
120
  case ElementName.ProgrammingLanguage:
100
121
  case ElementName.SubscriberCount:
101
122
  return toBadgeProps(data);
@@ -52,13 +52,11 @@ export const EmojiWrapper = styled.span`
52
52
  ${IconObjectOverrides}
53
53
  `; // The main 'wrapping' element, title of the content.
54
54
  // NB: `white-space` adds little whitespace before wrapping.
55
- // NB: `hyphens` enables hyphenation on word break.
55
+ // NB: `word-break` line breaks as soon as an overflow takes place.
56
56
 
57
57
  export const IconTitleWrapper = styled.span`
58
- hyphens: auto;
59
58
  white-space: pre-wrap;
60
- overflow-wrap: break-word;
61
- word-break: break-word;
59
+ word-break: break-all;
62
60
  `; // TODO: Replace overrides with proper AtlasKit solution.
63
61
 
64
62
  export const LozengeWrapper = styled.span`
@@ -9,7 +9,7 @@ export const IconStyledButton = styled.span`
9
9
  display: inline !important;
10
10
 
11
11
  &:hover {
12
- /* Remove the text-decoration to match other inline card hover states*/
12
+ /* Remove the text-decoration to match other inline card hover states */
13
13
  text-decoration: none !important;
14
14
  }
15
15
 
@@ -109,6 +109,9 @@ export var ElementName;
109
109
  ElementName["AuthorGroup"] = "AuthorGroup";
110
110
  ElementName["CollaboratorGroup"] = "CollaboratorGroup";
111
111
  ElementName["CommentCount"] = "CommentCount";
112
+ ElementName["ViewCount"] = "ViewCount";
113
+ ElementName["ReactCount"] = "ReactCount";
114
+ ElementName["VoteCount"] = "VoteCount";
112
115
  ElementName["CreatedBy"] = "CreatedBy";
113
116
  ElementName["CreatedOn"] = "CreatedOn";
114
117
  ElementName["LinkIcon"] = "LinkIcon";
@@ -185,6 +188,9 @@ export var IconType;
185
188
  IconType["Error"] = "Default:Error";
186
189
  IconType["Forbidden"] = "Default:Forbidden";
187
190
  IconType["Comment"] = "Badge:Comment";
191
+ IconType["View"] = "Badge:View";
192
+ IconType["React"] = "Badge:React";
193
+ IconType["Vote"] = "Badge:Vote";
188
194
  IconType["PriorityBlocker"] = "Badge:PriorityBlocker";
189
195
  IconType["PriorityCritical"] = "Badge:PriorityCritical";
190
196
  IconType["PriorityHigh"] = "Badge:PriorityHigh";
@@ -1,7 +1,7 @@
1
1
  import { extractLink, extractSummary, extractTitle } from '../common/primitives';
2
2
  import { extractLozenge } from '../common/lozenge';
3
3
  import { extractLinkIcon } from './icon';
4
- import { extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount } from './utils';
4
+ import { extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount } from './utils';
5
5
  import { extractPersonCreatedBy } from '../common/person';
6
6
  import { extractPersonsUpdatedBy } from './collaboratorGroup';
7
7
  import { extractDateUpdated } from '../common/date/extractDateUpdated';
@@ -21,6 +21,9 @@ var extractFlexibleUiContext = function extractFlexibleUiContext(response, rende
21
21
  authorGroup: extractPersonCreatedBy(data),
22
22
  collaboratorGroup: extractPersonsUpdatedBy(data),
23
23
  commentCount: extractCommentCount(data),
24
+ viewCount: extractViewCount(data),
25
+ reactCount: extractReactCount(data),
26
+ voteCount: extractVoteCount(data),
24
27
  createdBy: extractCreatedBy(data),
25
28
  createdOn: extractDateCreated(data),
26
29
  linkIcon: extractLinkIcon(response, renderers),
@@ -7,6 +7,15 @@ var extractValue = function extractValue(data, key) {
7
7
  export var extractCommentCount = function extractCommentCount(data) {
8
8
  return extractValue(data, 'schema:commentCount');
9
9
  };
10
+ export var extractViewCount = function extractViewCount(data) {
11
+ return extractValue(data, 'atlassian:viewCount');
12
+ };
13
+ export var extractReactCount = function extractReactCount(data) {
14
+ return extractValue(data, 'atlassian:reactCount');
15
+ };
16
+ export var extractVoteCount = function extractVoteCount(data) {
17
+ return extractValue(data, 'atlassian:voteCount');
18
+ };
10
19
  export var extractCreatedBy = function extractCreatedBy(data) {
11
20
  var persons = extractPersonCreatedBy(data);
12
21
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.7.10",
3
+ "version": "18.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -88,7 +88,7 @@ export var TextWrapper = styled.div(_templateObject5 || (_templateObject5 = _tag
88
88
  // NB: `overflow` is kept as `hidden` since
89
89
  // the internal contents of the `iframe` should
90
90
  // manage scrolling behaviour.
91
- export var Content = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n\n ", "\n ", "\n background-color: white;\n position: absolute;\n z-index: 1;\n width: 100%;\n top: ", ";\n overflow: hidden;\n height: calc(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"])), borderRadius, cardShadow, gridSize(4), gridSize(4), function (_ref9) {
91
+ export var Content = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n ", "\n background-color: white;\n position: absolute;\n z-index: 1;\n width: 100%;\n top: ", ";\n overflow: hidden;\n height: calc(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"])), borderRadius, cardShadow, gridSize(4), gridSize(4), function (_ref9) {
92
92
  var isInteractive = _ref9.isInteractive;
93
93
 
94
94
  if (isInteractive) {
@@ -6,10 +6,10 @@ var _templateObject;
6
6
  import React from 'react';
7
7
  import { css, jsx } from '@emotion/core';
8
8
  import { SmartLinkDirection, SmartLinkSize } from '../../../../../constants';
9
- import { getBaseStyles, renderChildren } from '../utils';
9
+ import { getBaseStyles, getGapSize, renderChildren } from '../utils';
10
10
 
11
11
  var getBlockStyles = function getBlockStyles(direction, size) {
12
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n justify-content: flex-start;\n"])), getBaseStyles(direction, size));
12
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n justify-content: flex-start;\n [data-separator] + [data-separator]:before {\n content: '\u2022';\n margin-right: ", "rem;\n }\n"])), getBaseStyles(direction, size), getGapSize(size));
13
13
  };
14
14
 
15
15
  var Block = function Block(_ref) {
@@ -20,7 +20,7 @@ import * as Actions from '../actions';
20
20
  import { isFlexibleUiElement } from '../../../../utils/flexible';
21
21
  import ActionGroup from './action-group';
22
22
  import ElementGroup from './element-group';
23
- export var ElementDisplaySchema = (_ElementDisplaySchema = {}, _defineProperty(_ElementDisplaySchema, ElementName.AuthorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CollaboratorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CommentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LinkIcon, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Preview, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.Priority, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ProgrammingLanguage, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Snippet, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.State, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.SubscriberCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Title, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Provider, ['inline']), _ElementDisplaySchema);
23
+ export var ElementDisplaySchema = (_ElementDisplaySchema = {}, _defineProperty(_ElementDisplaySchema, ElementName.AuthorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CollaboratorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CommentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ViewCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ReactCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.VoteCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LinkIcon, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Preview, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.Priority, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ProgrammingLanguage, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Snippet, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.State, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.SubscriberCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Title, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Provider, ['inline']), _ElementDisplaySchema);
24
24
 
25
25
  var getDirectionStyles = function getDirectionStyles(direction) {
26
26
  switch (direction) {
@@ -193,6 +193,18 @@ var importIconMapper = (_importIconMapper = {}, _defineProperty(_importIconMappe
193
193
  return import(
194
194
  /* webpackChunkName: "glyphComment" */
195
195
  '@atlaskit/icon/glyph/comment');
196
+ }), _defineProperty(_importIconMapper, IconType.View, function () {
197
+ return import(
198
+ /* webpackChunkName: "glyphComment" */
199
+ '@atlaskit/icon/glyph/watch');
200
+ }), _defineProperty(_importIconMapper, IconType.React, function () {
201
+ return import(
202
+ /* webpackChunkName: "glyphComment" */
203
+ '@atlaskit/icon/glyph/like');
204
+ }), _defineProperty(_importIconMapper, IconType.Vote, function () {
205
+ return import(
206
+ /* webpackChunkName: "glyphComment" */
207
+ '@atlaskit/icon/glyph/arrow-up');
196
208
  }), _defineProperty(_importIconMapper, IconType.PriorityBlocker, function () {
197
209
  return import(
198
210
  /* webpackChunkName: "glyphBlocker" */
@@ -39,6 +39,7 @@ var DateTime = function DateTime(_ref) {
39
39
  });
40
40
  return jsx("span", {
41
41
  css: styles,
42
+ "data-separator": true,
42
43
  "data-smart-element-date-time": true,
43
44
  "data-testid": testId
44
45
  }, jsx(FormattedMessage, _extends({}, typeToDescriptorMap[type], {
@@ -6,6 +6,9 @@ import { ElementName } from '../../../../constants';
6
6
  export var AuthorGroup = createElement(ElementName.AuthorGroup);
7
7
  export var CollaboratorGroup = createElement(ElementName.CollaboratorGroup);
8
8
  export var CommentCount = createElement(ElementName.CommentCount);
9
+ export var ViewCount = createElement(ElementName.ViewCount);
10
+ export var ReactCount = createElement(ElementName.ReactCount);
11
+ export var VoteCount = createElement(ElementName.VoteCount);
9
12
  export var CreatedBy = createElement(ElementName.CreatedBy);
10
13
  export var CreatedOn = createElement(ElementName.CreatedOn);
11
14
  export var LinkIcon = createElement(ElementName.LinkIcon);
@@ -28,6 +28,7 @@ var Text = function Text(_ref) {
28
28
 
29
29
  return jsx("span", {
30
30
  css: getStyles(maxLines, color),
31
+ "data-separator": true,
31
32
  "data-smart-element-text": true,
32
33
  "data-testid": testId
33
34
  }, getFormattedMessage(message) || content);
@@ -26,6 +26,21 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
26
26
  props: {
27
27
  icon: IconType.Comment
28
28
  }
29
+ }), _defineProperty(_elementMappings, ElementName.ViewCount, {
30
+ component: Badge,
31
+ props: {
32
+ icon: IconType.View
33
+ }
34
+ }), _defineProperty(_elementMappings, ElementName.ReactCount, {
35
+ component: Badge,
36
+ props: {
37
+ icon: IconType.React
38
+ }
39
+ }), _defineProperty(_elementMappings, ElementName.VoteCount, {
40
+ component: Badge,
41
+ props: {
42
+ icon: IconType.Vote
43
+ }
29
44
  }), _defineProperty(_elementMappings, ElementName.CreatedBy, {
30
45
  component: Text
31
46
  }), _defineProperty(_elementMappings, ElementName.LinkIcon, {
@@ -83,6 +98,9 @@ var getData = function getData(elementName, contextKey, context) {
83
98
  return toAvatarGroupProps(data);
84
99
 
85
100
  case ElementName.CommentCount:
101
+ case ElementName.ViewCount:
102
+ case ElementName.ReactCount:
103
+ case ElementName.VoteCount:
86
104
  case ElementName.ProgrammingLanguage:
87
105
  case ElementName.SubscriberCount:
88
106
  return toBadgeProps(data);
@@ -17,9 +17,9 @@ export var IconWrapper = styled.span(_templateObject || (_templateObject = _tagg
17
17
 
18
18
  export var EmojiWrapper = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n margin-right: 2px;\n user-select: none;\n ", "\n ", "\n"])), IconOverrides, IconObjectOverrides); // The main 'wrapping' element, title of the content.
19
19
  // NB: `white-space` adds little whitespace before wrapping.
20
- // NB: `hyphens` enables hyphenation on word break.
20
+ // NB: `word-break` line breaks as soon as an overflow takes place.
21
21
 
22
- export var IconTitleWrapper = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n hyphens: auto;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n word-break: break-word;\n"]))); // TODO: Replace overrides with proper AtlasKit solution.
22
+ export var IconTitleWrapper = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n white-space: pre-wrap;\n word-break: break-all;\n"]))); // TODO: Replace overrides with proper AtlasKit solution.
23
23
 
24
24
  export var LozengeWrapper = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: 1px;\n & > span {\n margin-left: 4px;\n padding: 2px 0 2px 0;\n }\n"]))); // TODO: Replace overrides with proper AtlasKit solution.
25
25
 
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
8
8
  var LINK_COLOR_DARK = '#4794FF'; // By default buttons will hide overflow and ellipsis content instead of wrapping.
9
9
  // This basically turns the button back into inline content
10
10
 
11
- export var IconStyledButton = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: initial !important;\n display: inline !important;\n\n &:hover {\n /* Remove the text-decoration to match other inline card hover states*/\n text-decoration: none !important;\n }\n\n > span {\n display: inline;\n > span {\n overflow: initial;\n text-overflow: initial;\n white-space: initial;\n }\n }\n"])));
11
+ export var IconStyledButton = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: initial !important;\n display: inline !important;\n\n &:hover {\n /* Remove the text-decoration to match other inline card hover states */\n text-decoration: none !important;\n }\n\n > span {\n display: inline;\n > span {\n overflow: initial;\n text-overflow: initial;\n white-space: initial;\n }\n }\n"])));
12
12
  export var NoLinkAppearance = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n"])), themed({
13
13
  light: N200,
14
14
  dark: LINK_COLOR_DARK
@@ -83,6 +83,9 @@ export declare enum ElementName {
83
83
  AuthorGroup = "AuthorGroup",
84
84
  CollaboratorGroup = "CollaboratorGroup",
85
85
  CommentCount = "CommentCount",
86
+ ViewCount = "ViewCount",
87
+ ReactCount = "ReactCount",
88
+ VoteCount = "VoteCount",
86
89
  CreatedBy = "CreatedBy",
87
90
  CreatedOn = "CreatedOn",
88
91
  LinkIcon = "LinkIcon",
@@ -153,6 +156,9 @@ export declare enum IconType {
153
156
  Error = "Default:Error",
154
157
  Forbidden = "Default:Forbidden",
155
158
  Comment = "Badge:Comment",
159
+ View = "Badge:View",
160
+ React = "Badge:React",
161
+ Vote = "Badge:Vote",
156
162
  PriorityBlocker = "Badge:PriorityBlocker",
157
163
  PriorityCritical = "Badge:PriorityCritical",
158
164
  PriorityHigh = "Badge:PriorityHigh",
@@ -34,7 +34,11 @@ export declare const TEST_DOCUMENT_WITH_ACTIONS: {
34
34
  'atlassian:updatedBy'?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Person<any> | undefined;
35
35
  'schema:commentCount'?: number | undefined;
36
36
  'atlassian:isDeleted'?: boolean | undefined;
37
+ 'atlassian:dateViewed'?: string | undefined;
38
+ 'atlassian:reactCount'?: number | undefined;
37
39
  'atlassian:state'?: string | undefined;
40
+ 'atlassian:viewCount'?: number | undefined;
41
+ 'atlassian:voteCount'?: number | undefined;
38
42
  '@context': JsonLd.Primitives.Context;
39
43
  'atlassian:downloadUrl'?: string | undefined;
40
44
  'atlassian:visitUrl'?: string | undefined;
@@ -96,7 +100,11 @@ export declare const TEST_DOCUMENT_WITH_PREVIEW: {
96
100
  'schema:commentCount'?: number | undefined;
97
101
  'atlassian:isDeleted'?: boolean | undefined;
98
102
  'schema:potentialAction'?: import("schema-dts").DeleteAction | import("schema-dts").ViewAction | import("schema-dts").DownloadAction | import("schema-dts").WatchAction | import("schema-dts").CommentAction | import("schema-dts").ShareAction | JsonLd.Data.DocumentAction[] | undefined;
103
+ 'atlassian:dateViewed'?: string | undefined;
104
+ 'atlassian:reactCount'?: number | undefined;
99
105
  'atlassian:state'?: string | undefined;
106
+ 'atlassian:viewCount'?: number | undefined;
107
+ 'atlassian:voteCount'?: number | undefined;
100
108
  '@context': JsonLd.Primitives.Context;
101
109
  'atlassian:downloadUrl'?: string | undefined;
102
110
  'atlassian:visitUrl'?: string | undefined;
@@ -1,5 +1,8 @@
1
1
  import { JsonLd } from 'json-ld-types';
2
2
  export declare const extractCommentCount: (data: JsonLd.Data.BaseData) => number | undefined;
3
+ export declare const extractViewCount: (data: JsonLd.Data.BaseData) => number | undefined;
4
+ export declare const extractReactCount: (data: JsonLd.Data.BaseData) => number | undefined;
5
+ export declare const extractVoteCount: (data: JsonLd.Data.BaseData) => number | undefined;
3
6
  export declare const extractCreatedBy: (data: JsonLd.Data.BaseData) => string | undefined;
4
7
  export declare const extractModifiedBy: (data: JsonLd.Data.BaseData) => string | undefined;
5
8
  export declare const extractProgrammingLanguage: (data: JsonLd.Data.BaseData) => string | undefined;
@@ -5,6 +5,9 @@ export declare type FlexibleUiDataContext = {
5
5
  authorGroup?: LinkPerson[];
6
6
  collaboratorGroup?: LinkPerson[];
7
7
  commentCount?: number;
8
+ viewCount?: number;
9
+ reactCount?: number;
10
+ voteCount?: number;
8
11
  createdBy?: string;
9
12
  createdOn?: string;
10
13
  linkIcon?: Icon;
@@ -10,6 +10,9 @@ import { MediaProps } from './media/types';
10
10
  export declare const AuthorGroup: import("react").FC<AvatarGroupProps>;
11
11
  export declare const CollaboratorGroup: import("react").FC<AvatarGroupProps>;
12
12
  export declare const CommentCount: import("react").FC<BadgeProps>;
13
+ export declare const ViewCount: import("react").FC<BadgeProps>;
14
+ export declare const ReactCount: import("react").FC<BadgeProps>;
15
+ export declare const VoteCount: import("react").FC<BadgeProps>;
13
16
  export declare const CreatedBy: import("react").FC<TextProps>;
14
17
  export declare const CreatedOn: import("react").FC<DateTimeProps>;
15
18
  export declare const LinkIcon: import("react").FC<IconProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.7.10",
3
+ "version": "18.0.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,12 +36,12 @@
36
36
  "@atlaskit/logo": "^13.5.0",
37
37
  "@atlaskit/lozenge": "^11.1.0",
38
38
  "@atlaskit/media-common": "^2.11.0",
39
- "@atlaskit/media-ui": "^20.0.0",
39
+ "@atlaskit/media-ui": "^21.0.0",
40
40
  "@atlaskit/modal-dialog": "^12.2.0",
41
41
  "@atlaskit/outbound-auth-flow-client": "^3.3.0",
42
42
  "@atlaskit/spinner": "^15.1.0",
43
43
  "@atlaskit/theme": "^12.1.0",
44
- "@atlaskit/tokens": "^0.7.0",
44
+ "@atlaskit/tokens": "^0.8.0",
45
45
  "@atlaskit/tooltip": "^17.5.2",
46
46
  "@atlaskit/ufo": "^0.1.0",
47
47
  "@babel/runtime": "^7.0.0",
@@ -51,7 +51,7 @@
51
51
  "async-retry": "^1.2.3",
52
52
  "dataloader": "^2.0.0",
53
53
  "facepaint": "^1.2.1",
54
- "json-ld-types": "2.4.0",
54
+ "json-ld-types": "2.4.1",
55
55
  "p-throttle": "^4.1.1",
56
56
  "react-error-boundary": "^3.1.3",
57
57
  "react-lazily-render": "^1.2.0",
@@ -76,7 +76,7 @@
76
76
  "@atlaskit/inline-message": "^11.2.0",
77
77
  "@atlaskit/lozenge": "^11.1.0",
78
78
  "@atlaskit/media-integration-test-helpers": "^2.5.0",
79
- "@atlaskit/media-test-helpers": "^29.2.0",
79
+ "@atlaskit/media-test-helpers": "^29.3.0",
80
80
  "@atlaskit/page": "^12.1.0",
81
81
  "@atlaskit/radio": "^5.3.0",
82
82
  "@atlaskit/range": "^6.0.0",