@atlaskit/smart-card 17.7.9 → 17.7.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/constants.js +7 -0
- package/dist/cjs/extractors/flexible/index.js +3 -0
- package/dist/cjs/extractors/flexible/utils.js +19 -1
- package/dist/cjs/messages.js +5 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/EmbedCard/components/styled.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/actions/utils.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +12 -0
- package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/elements/index.js +7 -1
- package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +18 -0
- package/dist/cjs/view/InlineCard/styled.js +1 -1
- package/dist/es2019/constants.js +7 -0
- package/dist/es2019/extractors/flexible/index.js +4 -1
- package/dist/es2019/extractors/flexible/utils.js +3 -0
- package/dist/es2019/messages.js +5 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/EmbedCard/components/styled.js +0 -2
- package/dist/es2019/view/FlexibleCard/components/actions/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/utils.js +12 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +5 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +3 -0
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +9 -0
- package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/index.js +3 -0
- package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +21 -0
- package/dist/es2019/view/InlineCard/styled.js +1 -1
- package/dist/esm/constants.js +7 -0
- package/dist/esm/extractors/flexible/index.js +4 -1
- package/dist/esm/extractors/flexible/utils.js +9 -0
- package/dist/esm/messages.js +5 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/EmbedCard/components/styled.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/utils.js +11 -0
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +12 -0
- package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/index.js +3 -0
- package/dist/esm/view/FlexibleCard/components/elements/text/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +18 -0
- package/dist/esm/view/InlineCard/styled.js +1 -1
- package/dist/types/constants.d.ts +7 -0
- package/dist/types/extractors/common/__mocks__/jsonld.d.ts +8 -0
- package/dist/types/extractors/flexible/utils.d.ts +3 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/elements/index.d.ts +3 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 17.7.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f9bbe6d0a56`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f9bbe6d0a56) - Add View, Vote and React badge elements
|
|
8
|
+
|
|
9
|
+
## 17.7.11
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`ca8c8db1440`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ca8c8db1440) - Flexible UI: Add separator between text/date-time elements
|
|
14
|
+
|
|
15
|
+
## 17.7.10
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`e04b58c623e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e04b58c623e) - Add EditAction
|
|
20
|
+
|
|
3
21
|
## 17.7.9
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cjs/constants.js
CHANGED
|
@@ -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";
|
|
@@ -156,6 +159,7 @@ exports.ActionName = ActionName;
|
|
|
156
159
|
|
|
157
160
|
(function (ActionName) {
|
|
158
161
|
ActionName["DeleteAction"] = "DeleteAction";
|
|
162
|
+
ActionName["EditAction"] = "EditAction";
|
|
159
163
|
ActionName["CustomAction"] = "CustomAction";
|
|
160
164
|
})(ActionName || (exports.ActionName = ActionName = {}));
|
|
161
165
|
|
|
@@ -211,6 +215,9 @@ exports.IconType = IconType;
|
|
|
211
215
|
IconType["Error"] = "Default:Error";
|
|
212
216
|
IconType["Forbidden"] = "Default:Forbidden";
|
|
213
217
|
IconType["Comment"] = "Badge:Comment";
|
|
218
|
+
IconType["View"] = "Badge:View";
|
|
219
|
+
IconType["React"] = "Badge:React";
|
|
220
|
+
IconType["Vote"] = "Badge:Vote";
|
|
214
221
|
IconType["PriorityBlocker"] = "Badge:PriorityBlocker";
|
|
215
222
|
IconType["PriorityCritical"] = "Badge:PriorityCritical";
|
|
216
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
|
|
package/dist/cjs/messages.js
CHANGED
|
@@ -43,6 +43,11 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
43
43
|
defaultMessage: 'Delete',
|
|
44
44
|
description: 'Allow a user to delete a link'
|
|
45
45
|
},
|
|
46
|
+
edit: {
|
|
47
|
+
id: 'fabric.linking.edit',
|
|
48
|
+
defaultMessage: 'Edit',
|
|
49
|
+
description: 'Allow a user to edit a link'
|
|
50
|
+
},
|
|
46
51
|
modified_by: {
|
|
47
52
|
id: 'fabric.linking.updated_by',
|
|
48
53
|
defaultMessage: 'Modified by {context}',
|
package/dist/cjs/version.json
CHANGED
|
@@ -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
|
|
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) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.DeleteAction = exports.CustomAction = void 0;
|
|
6
|
+
exports.EditAction = exports.DeleteAction = exports.CustomAction = void 0;
|
|
7
7
|
|
|
8
8
|
var _constants = require("../../../../constants");
|
|
9
9
|
|
|
@@ -16,5 +16,7 @@ var _utils = require("./utils");
|
|
|
16
16
|
// DataActions infer that the action depends on the data from the context.
|
|
17
17
|
var DeleteAction = (0, _utils.createUIAction)(_constants.ActionName.DeleteAction);
|
|
18
18
|
exports.DeleteAction = DeleteAction;
|
|
19
|
+
var EditAction = (0, _utils.createUIAction)(_constants.ActionName.EditAction);
|
|
20
|
+
exports.EditAction = EditAction;
|
|
19
21
|
var CustomAction = (0, _utils.createUIAction)(_constants.ActionName.CustomAction);
|
|
20
22
|
exports.CustomAction = CustomAction;
|
|
@@ -27,6 +27,8 @@ var _messages = require("../../../../messages");
|
|
|
27
27
|
|
|
28
28
|
var _cross = _interopRequireDefault(require("@atlaskit/icon/glyph/cross"));
|
|
29
29
|
|
|
30
|
+
var _edit = _interopRequireDefault(require("@atlaskit/icon/glyph/edit"));
|
|
31
|
+
|
|
30
32
|
var _actionMappings;
|
|
31
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); }
|
|
@@ -50,6 +52,16 @@ var actionMappings = (_actionMappings = {}, (0, _defineProperty2.default)(_actio
|
|
|
50
52
|
}),
|
|
51
53
|
toolTipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.delete)
|
|
52
54
|
}
|
|
55
|
+
}), (0, _defineProperty2.default)(_actionMappings, _constants.ActionName.EditAction, {
|
|
56
|
+
component: _action.default,
|
|
57
|
+
props: {
|
|
58
|
+
testId: 'smart-action-edit-action',
|
|
59
|
+
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.edit),
|
|
60
|
+
icon: /*#__PURE__*/_react.default.createElement(_edit.default, {
|
|
61
|
+
label: "Edit"
|
|
62
|
+
}),
|
|
63
|
+
toolTipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.edit)
|
|
64
|
+
}
|
|
53
65
|
}), _actionMappings);
|
|
54
66
|
|
|
55
67
|
var getContextKey = function getContextKey(name) {
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -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
|
|
package/dist/es2019/constants.js
CHANGED
|
@@ -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";
|
|
@@ -131,6 +134,7 @@ export let ActionName;
|
|
|
131
134
|
|
|
132
135
|
(function (ActionName) {
|
|
133
136
|
ActionName["DeleteAction"] = "DeleteAction";
|
|
137
|
+
ActionName["EditAction"] = "EditAction";
|
|
134
138
|
ActionName["CustomAction"] = "CustomAction";
|
|
135
139
|
})(ActionName || (ActionName = {}));
|
|
136
140
|
|
|
@@ -184,6 +188,9 @@ export let IconType;
|
|
|
184
188
|
IconType["Error"] = "Default:Error";
|
|
185
189
|
IconType["Forbidden"] = "Default:Forbidden";
|
|
186
190
|
IconType["Comment"] = "Badge:Comment";
|
|
191
|
+
IconType["View"] = "Badge:View";
|
|
192
|
+
IconType["React"] = "Badge:React";
|
|
193
|
+
IconType["Vote"] = "Badge:Vote";
|
|
187
194
|
IconType["PriorityBlocker"] = "Badge:PriorityBlocker";
|
|
188
195
|
IconType["PriorityCritical"] = "Badge:PriorityCritical";
|
|
189
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
|
|
package/dist/es2019/messages.js
CHANGED
|
@@ -35,6 +35,11 @@ export const messages = defineMessages({
|
|
|
35
35
|
defaultMessage: 'Delete',
|
|
36
36
|
description: 'Allow a user to delete a link'
|
|
37
37
|
},
|
|
38
|
+
edit: {
|
|
39
|
+
id: 'fabric.linking.edit',
|
|
40
|
+
defaultMessage: 'Edit',
|
|
41
|
+
description: 'Allow a user to edit a link'
|
|
42
|
+
},
|
|
38
43
|
modified_by: {
|
|
39
44
|
id: 'fabric.linking.updated_by',
|
|
40
45
|
defaultMessage: 'Modified by {context}',
|
package/dist/es2019/version.json
CHANGED
|
@@ -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;
|
|
@@ -6,4 +6,5 @@ import { createUIAction } from './utils'; // Attention: Keep the export name and
|
|
|
6
6
|
// DataActions infer that the action depends on the data from the context.
|
|
7
7
|
|
|
8
8
|
export const DeleteAction = createUIAction(ActionName.DeleteAction);
|
|
9
|
+
export const EditAction = createUIAction(ActionName.EditAction);
|
|
9
10
|
export const CustomAction = createUIAction(ActionName.CustomAction);
|
|
@@ -6,6 +6,7 @@ import Action from './action';
|
|
|
6
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
7
7
|
import { messages } from '../../../../messages';
|
|
8
8
|
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
9
|
+
import EditIcon from '@atlaskit/icon/glyph/edit';
|
|
9
10
|
const actionMappings = {
|
|
10
11
|
[ActionName.CustomAction]: {
|
|
11
12
|
component: Action,
|
|
@@ -21,6 +22,17 @@ const actionMappings = {
|
|
|
21
22
|
}),
|
|
22
23
|
toolTipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.delete)
|
|
23
24
|
}
|
|
25
|
+
},
|
|
26
|
+
[ActionName.EditAction]: {
|
|
27
|
+
component: Action,
|
|
28
|
+
props: {
|
|
29
|
+
testId: 'smart-action-edit-action',
|
|
30
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.edit),
|
|
31
|
+
icon: /*#__PURE__*/React.createElement(EditIcon, {
|
|
32
|
+
label: "Edit"
|
|
33
|
+
}),
|
|
34
|
+
toolTipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.edit)
|
|
35
|
+
}
|
|
24
36
|
}
|
|
25
37
|
};
|
|
26
38
|
|
|
@@ -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'),
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -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
|
|
package/dist/esm/constants.js
CHANGED
|
@@ -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";
|
|
@@ -131,6 +134,7 @@ export var ActionName;
|
|
|
131
134
|
|
|
132
135
|
(function (ActionName) {
|
|
133
136
|
ActionName["DeleteAction"] = "DeleteAction";
|
|
137
|
+
ActionName["EditAction"] = "EditAction";
|
|
134
138
|
ActionName["CustomAction"] = "CustomAction";
|
|
135
139
|
})(ActionName || (ActionName = {}));
|
|
136
140
|
|
|
@@ -184,6 +188,9 @@ export var IconType;
|
|
|
184
188
|
IconType["Error"] = "Default:Error";
|
|
185
189
|
IconType["Forbidden"] = "Default:Forbidden";
|
|
186
190
|
IconType["Comment"] = "Badge:Comment";
|
|
191
|
+
IconType["View"] = "Badge:View";
|
|
192
|
+
IconType["React"] = "Badge:React";
|
|
193
|
+
IconType["Vote"] = "Badge:Vote";
|
|
187
194
|
IconType["PriorityBlocker"] = "Badge:PriorityBlocker";
|
|
188
195
|
IconType["PriorityCritical"] = "Badge:PriorityCritical";
|
|
189
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
|
|
package/dist/esm/messages.js
CHANGED
|
@@ -35,6 +35,11 @@ export var messages = defineMessages({
|
|
|
35
35
|
defaultMessage: 'Delete',
|
|
36
36
|
description: 'Allow a user to delete a link'
|
|
37
37
|
},
|
|
38
|
+
edit: {
|
|
39
|
+
id: 'fabric.linking.edit',
|
|
40
|
+
defaultMessage: 'Edit',
|
|
41
|
+
description: 'Allow a user to edit a link'
|
|
42
|
+
},
|
|
38
43
|
modified_by: {
|
|
39
44
|
id: 'fabric.linking.updated_by',
|
|
40
45
|
defaultMessage: 'Modified by {context}',
|
package/dist/esm/version.json
CHANGED
|
@@ -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
|
|
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,4 +6,5 @@ import { createUIAction } from './utils'; // Attention: Keep the export name and
|
|
|
6
6
|
// DataActions infer that the action depends on the data from the context.
|
|
7
7
|
|
|
8
8
|
export var DeleteAction = createUIAction(ActionName.DeleteAction);
|
|
9
|
+
export var EditAction = createUIAction(ActionName.EditAction);
|
|
9
10
|
export var CustomAction = createUIAction(ActionName.CustomAction);
|
|
@@ -14,6 +14,7 @@ import Action from './action';
|
|
|
14
14
|
import { FormattedMessage } from 'react-intl-next';
|
|
15
15
|
import { messages } from '../../../../messages';
|
|
16
16
|
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
17
|
+
import EditIcon from '@atlaskit/icon/glyph/edit';
|
|
17
18
|
var actionMappings = (_actionMappings = {}, _defineProperty(_actionMappings, ActionName.CustomAction, {
|
|
18
19
|
component: Action,
|
|
19
20
|
props: {}
|
|
@@ -27,6 +28,16 @@ var actionMappings = (_actionMappings = {}, _defineProperty(_actionMappings, Act
|
|
|
27
28
|
}),
|
|
28
29
|
toolTipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.delete)
|
|
29
30
|
}
|
|
31
|
+
}), _defineProperty(_actionMappings, ActionName.EditAction, {
|
|
32
|
+
component: Action,
|
|
33
|
+
props: {
|
|
34
|
+
testId: 'smart-action-edit-action',
|
|
35
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.edit),
|
|
36
|
+
icon: /*#__PURE__*/React.createElement(EditIcon, {
|
|
37
|
+
label: "Edit"
|
|
38
|
+
}),
|
|
39
|
+
toolTipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.edit)
|
|
40
|
+
}
|
|
30
41
|
}), _actionMappings);
|
|
31
42
|
|
|
32
43
|
var getContextKey = function getContextKey(name) {
|
|
@@ -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" */
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -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",
|
|
@@ -102,6 +105,7 @@ export declare enum ElementName {
|
|
|
102
105
|
*/
|
|
103
106
|
export declare enum ActionName {
|
|
104
107
|
DeleteAction = "DeleteAction",
|
|
108
|
+
EditAction = "EditAction",
|
|
105
109
|
CustomAction = "CustomAction"
|
|
106
110
|
}
|
|
107
111
|
/**
|
|
@@ -152,6 +156,9 @@ export declare enum IconType {
|
|
|
152
156
|
Error = "Default:Error",
|
|
153
157
|
Forbidden = "Default:Forbidden",
|
|
154
158
|
Comment = "Badge:Comment",
|
|
159
|
+
View = "Badge:View",
|
|
160
|
+
React = "Badge:React",
|
|
161
|
+
Vote = "Badge:Vote",
|
|
155
162
|
PriorityBlocker = "Badge:PriorityBlocker",
|
|
156
163
|
PriorityCritical = "Badge:PriorityCritical",
|
|
157
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;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
|
-
export declare type MessageKey = 'cannot_find_link' | 'click_to_join' | 'connect_link_account' | 'created_by' | 'created_on' | 'delete' | 'modified_by' | 'modified_on' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access' | 'request_denied';
|
|
2
|
+
export declare type MessageKey = 'cannot_find_link' | 'click_to_join' | 'connect_link_account' | 'created_by' | 'created_on' | 'delete' | 'edit' | 'modified_by' | 'modified_on' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access' | 'request_denied';
|
|
3
3
|
declare type Messages = {
|
|
4
4
|
[K in MessageKey]: MessageDescriptor;
|
|
5
5
|
};
|
|
@@ -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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ActionProps } from './action/types';
|
|
3
3
|
export declare const DeleteAction: import("react").FC<ActionProps>;
|
|
4
|
+
export declare const EditAction: import("react").FC<ActionProps>;
|
|
4
5
|
export declare const CustomAction: import("react").FC<ActionProps>;
|
|
@@ -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.
|
|
3
|
+
"version": "17.7.12",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,7 +36,7 @@
|
|
|
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.
|
|
39
|
+
"@atlaskit/media-ui": "^20.1.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",
|
|
@@ -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.
|
|
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",
|