@atlaskit/media-ui 19.0.0 → 21.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.
- package/CHANGELOG.md +35 -0
- package/dist/cjs/MediaInlineCard/IconAndTitleLayout/styled.js +2 -2
- package/dist/cjs/classNames.js +0 -101
- package/dist/cjs/customMediaPlayer/analytics/utils/playbackAttributes.js +3 -7
- package/dist/cjs/index.js +0 -112
- package/dist/cjs/mime-type-icon.js +5 -3
- package/dist/cjs/util.js +1 -8
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/MediaInlineCard/IconAndTitleLayout/styled.js +2 -4
- package/dist/es2019/classNames.js +1 -12
- package/dist/es2019/customMediaPlayer/analytics/utils/playbackAttributes.js +1 -2
- package/dist/es2019/index.js +0 -5
- package/dist/es2019/mime-type-icon.js +4 -3
- package/dist/es2019/util.js +1 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/MediaInlineCard/IconAndTitleLayout/styled.js +2 -2
- package/dist/esm/classNames.js +1 -12
- package/dist/esm/customMediaPlayer/analytics/utils/playbackAttributes.js +1 -2
- package/dist/esm/index.js +0 -5
- package/dist/esm/mime-type-icon.js +5 -3
- package/dist/esm/util.js +1 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/MediaInlineCard/Icon.d.ts +2 -2
- package/dist/types/MediaInlineCard/IconAndTitleLayout/styled.d.ts +9 -9
- package/dist/types/MediaInlineCard/LoadingView/styled.d.ts +3 -3
- package/dist/types/classNames.d.ts +0 -11
- package/dist/types/customMediaPlayer/getControlsWrapperClassName.d.ts +1 -1
- package/dist/types/customMediaPlayer/playPauseBlanket.d.ts +1 -1
- package/dist/types/customMediaPlayer/styled.d.ts +14 -14
- package/dist/types/index.d.ts +1 -10
- package/dist/types/mime-type-icon.d.ts +2 -1
- package/dist/types/modalSpinner.d.ts +2 -2
- package/dist/types/types.d.ts +0 -7
- package/dist/types/util.d.ts +0 -1
- package/package.json +7 -17
- package/dist/cjs/BlockCard/actions/AuthorizeAction.js +0 -29
- package/dist/cjs/BlockCard/actions/DownloadAction.js +0 -69
- package/dist/cjs/BlockCard/actions/ForbiddenAction.js +0 -38
- package/dist/cjs/BlockCard/actions/PreviewAction.js +0 -134
- package/dist/cjs/BlockCard/actions/RetryAction.js +0 -49
- package/dist/cjs/BlockCard/actions/ViewAction.js +0 -67
- package/dist/cjs/BlockCard/components/Action.js +0 -70
- package/dist/cjs/BlockCard/components/ActionIcon.js +0 -57
- package/dist/cjs/BlockCard/components/ActionList.js +0 -75
- package/dist/cjs/BlockCard/components/Byline.js +0 -46
- package/dist/cjs/BlockCard/components/CollaboratorList.js +0 -53
- package/dist/cjs/BlockCard/components/Content.js +0 -33
- package/dist/cjs/BlockCard/components/ContentFooter.js +0 -33
- package/dist/cjs/BlockCard/components/ContentHeader.js +0 -34
- package/dist/cjs/BlockCard/components/Emoji.js +0 -31
- package/dist/cjs/BlockCard/components/Frame.js +0 -95
- package/dist/cjs/BlockCard/components/Icon.js +0 -60
- package/dist/cjs/BlockCard/components/Link.js +0 -28
- package/dist/cjs/BlockCard/components/Metadata.js +0 -60
- package/dist/cjs/BlockCard/components/MetadataList.js +0 -43
- package/dist/cjs/BlockCard/components/Modal.js +0 -132
- package/dist/cjs/BlockCard/components/ModalHeader.js +0 -111
- package/dist/cjs/BlockCard/components/Name.js +0 -47
- package/dist/cjs/BlockCard/components/Provider.js +0 -49
- package/dist/cjs/BlockCard/components/Thumbnail.js +0 -71
- package/dist/cjs/BlockCard/components/UnresolvedText.js +0 -22
- package/dist/cjs/BlockCard/index.js +0 -79
- package/dist/cjs/BlockCard/utils/constants.js +0 -13
- package/dist/cjs/BlockCard/utils/handlers.js +0 -16
- package/dist/cjs/BlockCard/utils/index.js +0 -27
- package/dist/cjs/BlockCard/views/ErroredView.js +0 -100
- package/dist/cjs/BlockCard/views/ForbiddenView.js +0 -112
- package/dist/cjs/BlockCard/views/NotFoundView.js +0 -96
- package/dist/cjs/BlockCard/views/ResolvedView.js +0 -144
- package/dist/cjs/BlockCard/views/ResolvingView.js +0 -55
- package/dist/cjs/BlockCard/views/UnauthorizedView.js +0 -93
- package/dist/cjs/EmbedCard/components/ExpandedFrame.js +0 -93
- package/dist/cjs/EmbedCard/components/Frame.js +0 -65
- package/dist/cjs/EmbedCard/components/ImageIcon.js +0 -44
- package/dist/cjs/EmbedCard/components/styled.js +0 -187
- package/dist/cjs/EmbedCard/views/ErroredView.js +0 -66
- package/dist/cjs/EmbedCard/views/ForbiddenView.js +0 -85
- package/dist/cjs/EmbedCard/views/NotFoundView.js +0 -51
- package/dist/cjs/EmbedCard/views/ResolvedView.js +0 -75
- package/dist/cjs/EmbedCard/views/UnauthorisedView.js +0 -58
- package/dist/cjs/EmbedCard/views/UnresolvedView.js +0 -83
- package/dist/cjs/InlineCard/ErroredView/index.js +0 -122
- package/dist/cjs/InlineCard/ForbiddenView/index.js +0 -148
- package/dist/cjs/InlineCard/Frame/index.js +0 -71
- package/dist/cjs/InlineCard/Frame/styled.js +0 -96
- package/dist/cjs/InlineCard/Icon.js +0 -37
- package/dist/cjs/InlineCard/IconAndTitleLayout/index.js +0 -140
- package/dist/cjs/InlineCard/IconAndTitleLayout/styled.js +0 -76
- package/dist/cjs/InlineCard/ResolvedView/index.js +0 -88
- package/dist/cjs/InlineCard/ResolvingView/index.js +0 -91
- package/dist/cjs/InlineCard/ResolvingView/styled.js +0 -19
- package/dist/cjs/InlineCard/UnauthorisedView/index.js +0 -118
- package/dist/cjs/InlineCard/index.js +0 -45
- package/dist/cjs/InlineCard/styled.js +0 -43
- package/dist/cjs/LinkView/index.js +0 -51
- package/dist/cjs/common.js +0 -5
- package/dist/cjs/embeds.js +0 -61
- package/dist/es2019/BlockCard/actions/AuthorizeAction.js +0 -9
- package/dist/es2019/BlockCard/actions/DownloadAction.js +0 -22
- package/dist/es2019/BlockCard/actions/ForbiddenAction.js +0 -14
- package/dist/es2019/BlockCard/actions/PreviewAction.js +0 -70
- package/dist/es2019/BlockCard/actions/RetryAction.js +0 -8
- package/dist/es2019/BlockCard/actions/ViewAction.js +0 -21
- package/dist/es2019/BlockCard/components/Action.js +0 -42
- package/dist/es2019/BlockCard/components/ActionIcon.js +0 -42
- package/dist/es2019/BlockCard/components/ActionList.js +0 -42
- package/dist/es2019/BlockCard/components/Byline.js +0 -33
- package/dist/es2019/BlockCard/components/CollaboratorList.js +0 -36
- package/dist/es2019/BlockCard/components/Content.js +0 -18
- package/dist/es2019/BlockCard/components/ContentFooter.js +0 -18
- package/dist/es2019/BlockCard/components/ContentHeader.js +0 -21
- package/dist/es2019/BlockCard/components/Emoji.js +0 -18
- package/dist/es2019/BlockCard/components/Frame.js +0 -68
- package/dist/es2019/BlockCard/components/Icon.js +0 -42
- package/dist/es2019/BlockCard/components/Link.js +0 -17
- package/dist/es2019/BlockCard/components/Metadata.js +0 -46
- package/dist/es2019/BlockCard/components/MetadataList.js +0 -26
- package/dist/es2019/BlockCard/components/Modal.js +0 -94
- package/dist/es2019/BlockCard/components/ModalHeader.js +0 -86
- package/dist/es2019/BlockCard/components/Name.js +0 -31
- package/dist/es2019/BlockCard/components/Provider.js +0 -38
- package/dist/es2019/BlockCard/components/Thumbnail.js +0 -49
- package/dist/es2019/BlockCard/components/UnresolvedText.js +0 -13
- package/dist/es2019/BlockCard/index.js +0 -9
- package/dist/es2019/BlockCard/utils/constants.js +0 -4
- package/dist/es2019/BlockCard/utils/handlers.js +0 -7
- package/dist/es2019/BlockCard/utils/index.js +0 -9
- package/dist/es2019/BlockCard/views/ErroredView.js +0 -57
- package/dist/es2019/BlockCard/views/ForbiddenView.js +0 -72
- package/dist/es2019/BlockCard/views/NotFoundView.js +0 -56
- package/dist/es2019/BlockCard/views/ResolvedView.js +0 -97
- package/dist/es2019/BlockCard/views/ResolvingView.js +0 -31
- package/dist/es2019/BlockCard/views/UnauthorizedView.js +0 -56
- package/dist/es2019/EmbedCard/components/ExpandedFrame.js +0 -69
- package/dist/es2019/EmbedCard/components/Frame.js +0 -37
- package/dist/es2019/EmbedCard/components/ImageIcon.js +0 -28
- package/dist/es2019/EmbedCard/components/styled.js +0 -293
- package/dist/es2019/EmbedCard/views/ErroredView.js +0 -43
- package/dist/es2019/EmbedCard/views/ForbiddenView.js +0 -68
- package/dist/es2019/EmbedCard/views/NotFoundView.js +0 -33
- package/dist/es2019/EmbedCard/views/ResolvedView.js +0 -53
- package/dist/es2019/EmbedCard/views/UnauthorisedView.js +0 -40
- package/dist/es2019/EmbedCard/views/UnresolvedView.js +0 -67
- package/dist/es2019/InlineCard/ErroredView/index.js +0 -70
- package/dist/es2019/InlineCard/ForbiddenView/index.js +0 -98
- package/dist/es2019/InlineCard/Frame/index.js +0 -55
- package/dist/es2019/InlineCard/Frame/styled.js +0 -108
- package/dist/es2019/InlineCard/Icon.js +0 -62
- package/dist/es2019/InlineCard/IconAndTitleLayout/index.js +0 -99
- package/dist/es2019/InlineCard/IconAndTitleLayout/styled.js +0 -102
- package/dist/es2019/InlineCard/ResolvedView/index.js +0 -46
- package/dist/es2019/InlineCard/ResolvingView/index.js +0 -48
- package/dist/es2019/InlineCard/ResolvingView/styled.js +0 -6
- package/dist/es2019/InlineCard/UnauthorisedView/index.js +0 -66
- package/dist/es2019/InlineCard/index.js +0 -5
- package/dist/es2019/InlineCard/styled.js +0 -39
- package/dist/es2019/LinkView/index.js +0 -11
- package/dist/es2019/common.js +0 -1
- package/dist/es2019/embeds.js +0 -7
- package/dist/esm/BlockCard/actions/AuthorizeAction.js +0 -15
- package/dist/esm/BlockCard/actions/DownloadAction.js +0 -51
- package/dist/esm/BlockCard/actions/ForbiddenAction.js +0 -23
- package/dist/esm/BlockCard/actions/PreviewAction.js +0 -105
- package/dist/esm/BlockCard/actions/RetryAction.js +0 -33
- package/dist/esm/BlockCard/actions/ViewAction.js +0 -50
- package/dist/esm/BlockCard/components/Action.js +0 -53
- package/dist/esm/BlockCard/components/ActionIcon.js +0 -42
- package/dist/esm/BlockCard/components/ActionList.js +0 -55
- package/dist/esm/BlockCard/components/Byline.js +0 -34
- package/dist/esm/BlockCard/components/CollaboratorList.js +0 -39
- package/dist/esm/BlockCard/components/Content.js +0 -20
- package/dist/esm/BlockCard/components/ContentFooter.js +0 -20
- package/dist/esm/BlockCard/components/ContentHeader.js +0 -22
- package/dist/esm/BlockCard/components/Emoji.js +0 -17
- package/dist/esm/BlockCard/components/Frame.js +0 -75
- package/dist/esm/BlockCard/components/Icon.js +0 -42
- package/dist/esm/BlockCard/components/Link.js +0 -17
- package/dist/esm/BlockCard/components/Metadata.js +0 -45
- package/dist/esm/BlockCard/components/MetadataList.js +0 -27
- package/dist/esm/BlockCard/components/Modal.js +0 -125
- package/dist/esm/BlockCard/components/ModalHeader.js +0 -87
- package/dist/esm/BlockCard/components/Name.js +0 -33
- package/dist/esm/BlockCard/components/Provider.js +0 -37
- package/dist/esm/BlockCard/components/Thumbnail.js +0 -53
- package/dist/esm/BlockCard/components/UnresolvedText.js +0 -12
- package/dist/esm/BlockCard/index.js +0 -9
- package/dist/esm/BlockCard/utils/constants.js +0 -4
- package/dist/esm/BlockCard/utils/handlers.js +0 -7
- package/dist/esm/BlockCard/utils/index.js +0 -14
- package/dist/esm/BlockCard/views/ErroredView.js +0 -73
- package/dist/esm/BlockCard/views/ForbiddenView.js +0 -82
- package/dist/esm/BlockCard/views/NotFoundView.js +0 -70
- package/dist/esm/BlockCard/views/ResolvedView.js +0 -112
- package/dist/esm/BlockCard/views/ResolvingView.js +0 -34
- package/dist/esm/BlockCard/views/UnauthorizedView.js +0 -71
- package/dist/esm/EmbedCard/components/ExpandedFrame.js +0 -79
- package/dist/esm/EmbedCard/components/Frame.js +0 -45
- package/dist/esm/EmbedCard/components/ImageIcon.js +0 -30
- package/dist/esm/EmbedCard/components/styled.js +0 -117
- package/dist/esm/EmbedCard/views/ErroredView.js +0 -46
- package/dist/esm/EmbedCard/views/ForbiddenView.js +0 -67
- package/dist/esm/EmbedCard/views/NotFoundView.js +0 -33
- package/dist/esm/EmbedCard/views/ResolvedView.js +0 -55
- package/dist/esm/EmbedCard/views/UnauthorisedView.js +0 -40
- package/dist/esm/EmbedCard/views/UnresolvedView.js +0 -66
- package/dist/esm/InlineCard/ErroredView/index.js +0 -96
- package/dist/esm/InlineCard/ForbiddenView/index.js +0 -122
- package/dist/esm/InlineCard/Frame/index.js +0 -53
- package/dist/esm/InlineCard/Frame/styled.js +0 -79
- package/dist/esm/InlineCard/Icon.js +0 -18
- package/dist/esm/InlineCard/IconAndTitleLayout/index.js +0 -122
- package/dist/esm/InlineCard/IconAndTitleLayout/styled.js +0 -36
- package/dist/esm/InlineCard/ResolvedView/index.js +0 -70
- package/dist/esm/InlineCard/ResolvingView/index.js +0 -72
- package/dist/esm/InlineCard/ResolvingView/styled.js +0 -7
- package/dist/esm/InlineCard/UnauthorisedView/index.js +0 -92
- package/dist/esm/InlineCard/index.js +0 -5
- package/dist/esm/InlineCard/styled.js +0 -20
- package/dist/esm/LinkView/index.js +0 -35
- package/dist/esm/common.js +0 -1
- package/dist/esm/embeds.js +0 -7
- package/dist/types/BlockCard/actions/AuthorizeAction.d.ts +0 -2
- package/dist/types/BlockCard/actions/DownloadAction.d.ts +0 -8
- package/dist/types/BlockCard/actions/ForbiddenAction.d.ts +0 -2
- package/dist/types/BlockCard/actions/PreviewAction.d.ts +0 -26
- package/dist/types/BlockCard/actions/RetryAction.d.ts +0 -2
- package/dist/types/BlockCard/actions/ViewAction.d.ts +0 -8
- package/dist/types/BlockCard/components/Action.d.ts +0 -11
- package/dist/types/BlockCard/components/ActionIcon.d.ts +0 -12
- package/dist/types/BlockCard/components/ActionList.d.ts +0 -6
- package/dist/types/BlockCard/components/Byline.d.ts +0 -8
- package/dist/types/BlockCard/components/CollaboratorList.d.ts +0 -13
- package/dist/types/BlockCard/components/Content.d.ts +0 -7
- package/dist/types/BlockCard/components/ContentFooter.d.ts +0 -7
- package/dist/types/BlockCard/components/ContentHeader.d.ts +0 -8
- package/dist/types/BlockCard/components/Emoji.d.ts +0 -5
- package/dist/types/BlockCard/components/Frame.d.ts +0 -14
- package/dist/types/BlockCard/components/Icon.d.ts +0 -9
- package/dist/types/BlockCard/components/Link.d.ts +0 -7
- package/dist/types/BlockCard/components/Metadata.d.ts +0 -8
- package/dist/types/BlockCard/components/MetadataList.d.ts +0 -8
- package/dist/types/BlockCard/components/Modal.d.ts +0 -28
- package/dist/types/BlockCard/components/ModalHeader.d.ts +0 -17
- package/dist/types/BlockCard/components/Name.d.ts +0 -10
- package/dist/types/BlockCard/components/Provider.d.ts +0 -6
- package/dist/types/BlockCard/components/Thumbnail.d.ts +0 -9
- package/dist/types/BlockCard/components/UnresolvedText.d.ts +0 -6
- package/dist/types/BlockCard/index.d.ts +0 -10
- package/dist/types/BlockCard/utils/constants.d.ts +0 -3
- package/dist/types/BlockCard/utils/handlers.d.ts +0 -2
- package/dist/types/BlockCard/utils/index.d.ts +0 -5
- package/dist/types/BlockCard/views/ErroredView.d.ts +0 -12
- package/dist/types/BlockCard/views/ForbiddenView.d.ts +0 -21
- package/dist/types/BlockCard/views/NotFoundView.d.ts +0 -15
- package/dist/types/BlockCard/views/ResolvedView.d.ts +0 -32
- package/dist/types/BlockCard/views/ResolvingView.d.ts +0 -8
- package/dist/types/BlockCard/views/UnauthorizedView.d.ts +0 -17
- package/dist/types/EmbedCard/components/ExpandedFrame.d.ts +0 -23
- package/dist/types/EmbedCard/components/Frame.d.ts +0 -7
- package/dist/types/EmbedCard/components/ImageIcon.d.ts +0 -9
- package/dist/types/EmbedCard/components/styled.d.ts +0 -42
- package/dist/types/EmbedCard/views/ErroredView.d.ts +0 -8
- package/dist/types/EmbedCard/views/ForbiddenView.d.ts +0 -13
- package/dist/types/EmbedCard/views/NotFoundView.d.ts +0 -11
- package/dist/types/EmbedCard/views/ResolvedView.d.ts +0 -27
- package/dist/types/EmbedCard/views/UnauthorisedView.d.ts +0 -12
- package/dist/types/EmbedCard/views/UnresolvedView.d.ts +0 -18
- package/dist/types/InlineCard/ErroredView/index.d.ts +0 -21
- package/dist/types/InlineCard/ForbiddenView/index.d.ts +0 -25
- package/dist/types/InlineCard/Frame/index.d.ts +0 -16
- package/dist/types/InlineCard/Frame/styled.d.ts +0 -8
- package/dist/types/InlineCard/Icon.d.ts +0 -4
- package/dist/types/InlineCard/IconAndTitleLayout/index.d.ts +0 -19
- package/dist/types/InlineCard/IconAndTitleLayout/styled.d.ts +0 -13
- package/dist/types/InlineCard/ResolvedView/index.d.ts +0 -26
- package/dist/types/InlineCard/ResolvingView/index.d.ts +0 -18
- package/dist/types/InlineCard/ResolvingView/styled.d.ts +0 -6
- package/dist/types/InlineCard/UnauthorisedView/index.d.ts +0 -20
- package/dist/types/InlineCard/index.d.ts +0 -10
- package/dist/types/InlineCard/styled.d.ts +0 -5
- package/dist/types/LinkView/index.d.ts +0 -5
- package/dist/types/common.d.ts +0 -6
- package/dist/types/embeds.d.ts +0 -13
- package/embeds/package.json +0 -7
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import { N300 } from '@atlaskit/theme/colors';
|
|
4
|
-
import { gs, mq } from '../utils';
|
|
5
|
-
export var Byline = function Byline(_ref) {
|
|
6
|
-
var text = _ref.text,
|
|
7
|
-
children = _ref.children,
|
|
8
|
-
testId = _ref.testId,
|
|
9
|
-
className = _ref.className;
|
|
10
|
-
return jsx("span", {
|
|
11
|
-
css: mq({
|
|
12
|
-
fontSize: gs(1.5),
|
|
13
|
-
lineHeight: gs(2.5),
|
|
14
|
-
color: "".concat(N300),
|
|
15
|
-
fontWeight: 'normal',
|
|
16
|
-
marginTop: gs(0.5),
|
|
17
|
-
// Spec: only allow two lines MAX to be shown.
|
|
18
|
-
display: '-webkit-box',
|
|
19
|
-
overflow: 'hidden',
|
|
20
|
-
textOverflow: 'ellipsis',
|
|
21
|
-
WebkitLineClamp: 2,
|
|
22
|
-
WebkitBoxOrient: 'vertical',
|
|
23
|
-
wordBreak: 'break-word',
|
|
24
|
-
// Fallback options.
|
|
25
|
-
maxHeight: gs(5),
|
|
26
|
-
whiteSpace: 'pre-line',
|
|
27
|
-
// EDM-713: fixes copy-paste from renderer to editor for Firefox
|
|
28
|
-
// due to HTML its unwrapping behaviour on paste.
|
|
29
|
-
MozUserSelect: 'none'
|
|
30
|
-
}),
|
|
31
|
-
"data-testid": testId,
|
|
32
|
-
className: className
|
|
33
|
-
}, text || children);
|
|
34
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import AvatarGroup from '@atlaskit/avatar-group';
|
|
4
|
-
import { mq } from '../utils';
|
|
5
|
-
export var CollaboratorList = function CollaboratorList(_ref) {
|
|
6
|
-
var items = _ref.items,
|
|
7
|
-
_ref$handleAvatarClic = _ref.handleAvatarClick,
|
|
8
|
-
handleAvatarClick = _ref$handleAvatarClic === void 0 ? function () {} : _ref$handleAvatarClic,
|
|
9
|
-
_ref$handleMoreAvatar = _ref.handleMoreAvatarsClick,
|
|
10
|
-
handleMoreAvatarsClick = _ref$handleMoreAvatar === void 0 ? function () {} : _ref$handleMoreAvatar,
|
|
11
|
-
_ref$testId = _ref.testId,
|
|
12
|
-
testId = _ref$testId === void 0 ? 'collaborator-list' : _ref$testId;
|
|
13
|
-
|
|
14
|
-
if (items.length === 0) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return jsx("span", {
|
|
19
|
-
css: mq({
|
|
20
|
-
display: ['none', 'inherit']
|
|
21
|
-
})
|
|
22
|
-
}, jsx(AvatarGroup, {
|
|
23
|
-
maxCount: 4,
|
|
24
|
-
appearance: "stack",
|
|
25
|
-
size: "small",
|
|
26
|
-
data: items,
|
|
27
|
-
onAvatarClick: function onAvatarClick(event) {
|
|
28
|
-
event.stopPropagation();
|
|
29
|
-
event.preventDefault();
|
|
30
|
-
handleAvatarClick(event);
|
|
31
|
-
},
|
|
32
|
-
onMoreClick: function onMoreClick(event) {
|
|
33
|
-
event.stopPropagation();
|
|
34
|
-
event.preventDefault();
|
|
35
|
-
handleMoreAvatarsClick(event);
|
|
36
|
-
},
|
|
37
|
-
testId: testId
|
|
38
|
-
}));
|
|
39
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import { gs, mq } from '../utils';
|
|
4
|
-
export var blockCardContentClassName = 'block-card-content';
|
|
5
|
-
export var Content = function Content(_ref) {
|
|
6
|
-
var children = _ref.children,
|
|
7
|
-
_ref$isCompact = _ref.isCompact,
|
|
8
|
-
isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact;
|
|
9
|
-
return jsx("div", {
|
|
10
|
-
css: mq({
|
|
11
|
-
padding: isCompact ? gs(1) : gs(2),
|
|
12
|
-
display: 'flex',
|
|
13
|
-
flexDirection: 'column',
|
|
14
|
-
justifyContent: isCompact ? 'unset' : ['unset', 'space-between'],
|
|
15
|
-
flexGrow: 1
|
|
16
|
-
}),
|
|
17
|
-
"data-trello-do-not-use-override": "block-card-content",
|
|
18
|
-
className: blockCardContentClassName
|
|
19
|
-
}, children);
|
|
20
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import { gs, mq } from '../utils';
|
|
4
|
-
export var contentFooterClassName = 'smart-link-content-footer';
|
|
5
|
-
export var ContentFooter = function ContentFooter(_ref) {
|
|
6
|
-
var children = _ref.children,
|
|
7
|
-
_ref$hasSpaceBetween = _ref.hasSpaceBetween,
|
|
8
|
-
hasSpaceBetween = _ref$hasSpaceBetween === void 0 ? false : _ref$hasSpaceBetween;
|
|
9
|
-
return jsx("div", {
|
|
10
|
-
css: mq({
|
|
11
|
-
display: 'flex',
|
|
12
|
-
flexDirection: ['column', 'row'],
|
|
13
|
-
flexGrow: [1, 'unset'],
|
|
14
|
-
justifyContent: [hasSpaceBetween ? 'space-between' : 'flex-end', 'space-between'],
|
|
15
|
-
alignItems: ['unset', 'center'],
|
|
16
|
-
marginTop: [gs(1), gs(1.5)]
|
|
17
|
-
}),
|
|
18
|
-
className: contentFooterClassName
|
|
19
|
-
}, children);
|
|
20
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
export var blockCardContentHeaderClassName = 'block-card-content-header';
|
|
4
|
-
export var ContentHeader = function ContentHeader(_ref) {
|
|
5
|
-
var onClick = _ref.onClick,
|
|
6
|
-
link = _ref.link,
|
|
7
|
-
children = _ref.children;
|
|
8
|
-
return jsx("a", {
|
|
9
|
-
onClick: onClick,
|
|
10
|
-
href: link,
|
|
11
|
-
target: "_blank",
|
|
12
|
-
css: {
|
|
13
|
-
display: 'flex',
|
|
14
|
-
alignItems: 'flex-start',
|
|
15
|
-
// EDM-713: fixes copy-paste from renderer to editor for Firefox
|
|
16
|
-
// due to HTML its unwrapping behaviour on paste.
|
|
17
|
-
MozUserSelect: 'none'
|
|
18
|
-
},
|
|
19
|
-
"data-trello-do-not-use-override": "block-card-content-header",
|
|
20
|
-
className: blockCardContentHeaderClassName
|
|
21
|
-
}, children);
|
|
22
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { gs } from '../utils';
|
|
5
|
-
export var Emoji = function Emoji(_ref) {
|
|
6
|
-
var emoji = _ref.emoji;
|
|
7
|
-
return jsx("span", {
|
|
8
|
-
css: {
|
|
9
|
-
height: gs(2.5),
|
|
10
|
-
width: gs(2),
|
|
11
|
-
display: 'flex',
|
|
12
|
-
alignItems: 'center',
|
|
13
|
-
justifyContent: 'center',
|
|
14
|
-
marginTop: '-2px'
|
|
15
|
-
}
|
|
16
|
-
}, emoji);
|
|
17
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
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) { _defineProperty(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; }
|
|
6
|
-
|
|
7
|
-
/** @jsx jsx */
|
|
8
|
-
import { jsx } from '@emotion/core';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { N20A, N30A, B200, N40A, N50A } from '@atlaskit/theme/colors';
|
|
11
|
-
import { gs, br, mq } from '../utils';
|
|
12
|
-
export var Frame = function Frame() {
|
|
13
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
14
|
-
isSelected: false,
|
|
15
|
-
isHoverable: false,
|
|
16
|
-
isFluidHeight: false
|
|
17
|
-
};
|
|
18
|
-
return props.compact ? jsx(CompactFrame, props) : jsx(ExpandedFrame, props);
|
|
19
|
-
};
|
|
20
|
-
var sharedFrameStyles = {
|
|
21
|
-
maxWidth: gs(95),
|
|
22
|
-
width: '100%',
|
|
23
|
-
display: 'flex',
|
|
24
|
-
backgroundColor: 'white'
|
|
25
|
-
};
|
|
26
|
-
export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
27
|
-
var children = _ref.children,
|
|
28
|
-
isSelected = _ref.isSelected,
|
|
29
|
-
isHoverable = _ref.isHoverable,
|
|
30
|
-
testId = _ref.testId,
|
|
31
|
-
className = _ref.className,
|
|
32
|
-
isFluidHeight = _ref.isFluidHeight;
|
|
33
|
-
return jsx("div", {
|
|
34
|
-
css: mq(_objectSpread(_objectSpread({}, sharedFrameStyles), {}, {
|
|
35
|
-
'&:hover': isHoverable ? {
|
|
36
|
-
backgroundColor: N20A,
|
|
37
|
-
cursor: 'pointer'
|
|
38
|
-
} : undefined,
|
|
39
|
-
minHeight: isFluidHeight ? 0 : [gs(21), gs(15)],
|
|
40
|
-
borderRadius: isSelected ? br() : br(0.5),
|
|
41
|
-
border: "2px solid ".concat(isSelected ? B200 : 'transparent'),
|
|
42
|
-
justifyContent: 'space-between',
|
|
43
|
-
overflow: 'hidden',
|
|
44
|
-
boxShadow: "0 1px 1px ".concat(N50A, ", 0 0 1px 1px ").concat(N40A, ";")
|
|
45
|
-
})),
|
|
46
|
-
"data-testid": testId,
|
|
47
|
-
className: className,
|
|
48
|
-
"data-trello-do-not-use-override": testId
|
|
49
|
-
}, children);
|
|
50
|
-
};
|
|
51
|
-
export var CompactFrame = function CompactFrame(_ref2) {
|
|
52
|
-
var children = _ref2.children,
|
|
53
|
-
isHoverable = _ref2.isHoverable,
|
|
54
|
-
isSelected = _ref2.isSelected,
|
|
55
|
-
testId = _ref2.testId,
|
|
56
|
-
className = _ref2.className,
|
|
57
|
-
inheritDimensions = _ref2.inheritDimensions;
|
|
58
|
-
return jsx("div", {
|
|
59
|
-
css: mq(_objectSpread(_objectSpread({}, sharedFrameStyles), {}, {
|
|
60
|
-
'&:hover': isHoverable ? {
|
|
61
|
-
backgroundColor: N30A
|
|
62
|
-
} : undefined,
|
|
63
|
-
borderRadius: isSelected ? br() : br(0.5),
|
|
64
|
-
border: isSelected ? "2px solid ".concat(B200) : '',
|
|
65
|
-
justifyContent: 'center',
|
|
66
|
-
alignItems: 'center',
|
|
67
|
-
height: inheritDimensions ? '100%' : gs(5),
|
|
68
|
-
backgroundColor: N20A,
|
|
69
|
-
width: ['calc(100% - 16px)', '100%'],
|
|
70
|
-
padding: ["0px ".concat(gs(1)), '0']
|
|
71
|
-
})),
|
|
72
|
-
"data-testid": testId,
|
|
73
|
-
className: className
|
|
74
|
-
}, children);
|
|
75
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import ImageLoader from 'react-render-image';
|
|
5
|
-
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
6
|
-
import { gs } from '../utils';
|
|
7
|
-
export var blockCardIconImageClassName = 'block-card-icon-image';
|
|
8
|
-
export var Icon = function Icon(_ref) {
|
|
9
|
-
var url = _ref.url,
|
|
10
|
-
icon = _ref.icon,
|
|
11
|
-
defaultIcon = _ref.defaultIcon,
|
|
12
|
-
_ref$testId = _ref.testId,
|
|
13
|
-
testId = _ref$testId === void 0 ? 'block-card-icon' : _ref$testId;
|
|
14
|
-
var placeholder = defaultIcon || jsx(LinkIcon, {
|
|
15
|
-
label: "link",
|
|
16
|
-
size: "small",
|
|
17
|
-
testId: "".concat(testId, "-default")
|
|
18
|
-
});
|
|
19
|
-
var image = url && jsx(ImageLoader, {
|
|
20
|
-
src: url,
|
|
21
|
-
loaded: jsx("img", {
|
|
22
|
-
css: {
|
|
23
|
-
height: gs(2),
|
|
24
|
-
width: gs(2)
|
|
25
|
-
},
|
|
26
|
-
src: url,
|
|
27
|
-
"data-testid": "".concat(testId, "-image")
|
|
28
|
-
}),
|
|
29
|
-
errored: placeholder
|
|
30
|
-
});
|
|
31
|
-
return jsx("span", {
|
|
32
|
-
css: {
|
|
33
|
-
height: gs(2.5),
|
|
34
|
-
width: gs(2),
|
|
35
|
-
display: 'flex',
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
justifyContent: 'center'
|
|
38
|
-
},
|
|
39
|
-
"data-testid": testId,
|
|
40
|
-
className: blockCardIconImageClassName
|
|
41
|
-
}, icon || image || placeholder);
|
|
42
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import { B400 } from '@atlaskit/theme/colors';
|
|
4
|
-
export var Link = function Link(_ref) {
|
|
5
|
-
var url = _ref.url,
|
|
6
|
-
_ref$testId = _ref.testId,
|
|
7
|
-
testId = _ref$testId === void 0 ? 'block-card' : _ref$testId,
|
|
8
|
-
className = _ref.className;
|
|
9
|
-
return jsx("span", {
|
|
10
|
-
"data-testid": "".concat(testId, "-link"),
|
|
11
|
-
className: className,
|
|
12
|
-
css: {
|
|
13
|
-
color: B400,
|
|
14
|
-
wordBreak: 'break-all'
|
|
15
|
-
}
|
|
16
|
-
}, url);
|
|
17
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
4
|
-
import { gs } from '../utils';
|
|
5
|
-
import { N300 } from '@atlaskit/theme/colors';
|
|
6
|
-
export var Metadata = function Metadata(_ref) {
|
|
7
|
-
var text = _ref.text,
|
|
8
|
-
icon = _ref.icon,
|
|
9
|
-
iconUrl = _ref.iconUrl,
|
|
10
|
-
tooltip = _ref.tooltip;
|
|
11
|
-
var metadataIcon = icon || null;
|
|
12
|
-
|
|
13
|
-
if (!metadataIcon && iconUrl) {
|
|
14
|
-
metadataIcon = jsx("img", {
|
|
15
|
-
src: iconUrl,
|
|
16
|
-
css: {
|
|
17
|
-
width: gs(1),
|
|
18
|
-
height: gs(1)
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
var metadata = jsx("div", {
|
|
24
|
-
css: {
|
|
25
|
-
display: 'flex',
|
|
26
|
-
alignItems: 'center',
|
|
27
|
-
marginRight: gs(0.5)
|
|
28
|
-
}
|
|
29
|
-
}, metadataIcon, jsx("span", {
|
|
30
|
-
css: {
|
|
31
|
-
fontSize: gs(1.5),
|
|
32
|
-
color: "".concat(N300),
|
|
33
|
-
marginRight: gs(0.5),
|
|
34
|
-
marginLeft: '2px'
|
|
35
|
-
}
|
|
36
|
-
}, text));
|
|
37
|
-
|
|
38
|
-
if (tooltip) {
|
|
39
|
-
return jsx(Tooltip, {
|
|
40
|
-
content: tooltip
|
|
41
|
-
}, metadata);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return metadata;
|
|
45
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
/** @jsx jsx */
|
|
4
|
-
import { jsx } from '@emotion/core';
|
|
5
|
-
import { Metadata } from './Metadata';
|
|
6
|
-
import { gs } from '../utils';
|
|
7
|
-
export var metadataListClassName = 'smart-link-metadata-list';
|
|
8
|
-
export var MetadataList = function MetadataList(_ref) {
|
|
9
|
-
var items = _ref.items,
|
|
10
|
-
testId = _ref.testId;
|
|
11
|
-
return jsx("div", {
|
|
12
|
-
css: {
|
|
13
|
-
display: 'flex',
|
|
14
|
-
marginTop: gs(0.5),
|
|
15
|
-
alignItems: 'center',
|
|
16
|
-
'&:last-child': {
|
|
17
|
-
marginRight: '0px'
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"data-testid": testId,
|
|
21
|
-
className: metadataListClassName
|
|
22
|
-
}, items.map(function (item) {
|
|
23
|
-
return jsx(Metadata, _extends({
|
|
24
|
-
key: item.text
|
|
25
|
-
}, item));
|
|
26
|
-
}));
|
|
27
|
-
};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
|
|
8
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
|
|
10
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
|
|
12
|
-
/* TODO: (from codemod)
|
|
13
|
-
We have converted this file as best we could but you might still need
|
|
14
|
-
to manually complete migrating this usage of ModalDialog.
|
|
15
|
-
|
|
16
|
-
This file uses one or more of the following ModalDialog props: 'components', 'header',
|
|
17
|
-
'footer', 'body'. These props have been removed as part of moving to
|
|
18
|
-
a compositional API.
|
|
19
|
-
|
|
20
|
-
The render props that used to be exposed by the custom component APIs are
|
|
21
|
-
now accessible using the 'useModal' hook instead: 'testId', 'titleId', and 'onClose'.
|
|
22
|
-
|
|
23
|
-
We are also no longer exposing 'appearance' as render prop, so this needs to be
|
|
24
|
-
manually passed to your custom components.
|
|
25
|
-
|
|
26
|
-
For a complete guide on customization using the new compositional API, refer to the docs at
|
|
27
|
-
https://atlassian.design/components/modal-dialog/examples#customizing-modal-dialog. */
|
|
28
|
-
import React, { useState } from 'react';
|
|
29
|
-
import ModalDialog, { ModalTransition, ModalBody } from '@atlaskit/modal-dialog';
|
|
30
|
-
import { Header } from './ModalHeader';
|
|
31
|
-
import { getIframeSandboxAttribute } from '../../util';
|
|
32
|
-
var iframeStyles = {
|
|
33
|
-
width: "100%",
|
|
34
|
-
height: 'calc(100vh - 248px)'
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
var ModalWithErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
38
|
-
_inherits(ModalWithErrorBoundary, _React$Component);
|
|
39
|
-
|
|
40
|
-
var _super = _createSuper(ModalWithErrorBoundary);
|
|
41
|
-
|
|
42
|
-
function ModalWithErrorBoundary() {
|
|
43
|
-
_classCallCheck(this, ModalWithErrorBoundary);
|
|
44
|
-
|
|
45
|
-
return _super.apply(this, arguments);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
_createClass(ModalWithErrorBoundary, [{
|
|
49
|
-
key: "componentDidCatch",
|
|
50
|
-
value: function componentDidCatch(error, errorInfo) {
|
|
51
|
-
if (this.props.onOpenFailed) {
|
|
52
|
-
this.props.onOpenFailed(error, errorInfo);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}, {
|
|
56
|
-
key: "render",
|
|
57
|
-
value: function render() {
|
|
58
|
-
return /*#__PURE__*/React.createElement(Modal, this.props);
|
|
59
|
-
}
|
|
60
|
-
}]);
|
|
61
|
-
|
|
62
|
-
return ModalWithErrorBoundary;
|
|
63
|
-
}(React.Component);
|
|
64
|
-
|
|
65
|
-
var Modal = function Modal(_ref) {
|
|
66
|
-
var onClose = _ref.onClose,
|
|
67
|
-
onOpen = _ref.onOpen,
|
|
68
|
-
src = _ref.src,
|
|
69
|
-
testId = _ref.testId,
|
|
70
|
-
showModal = _ref.showModal,
|
|
71
|
-
providerName = _ref.providerName,
|
|
72
|
-
metadata = _ref.metadata,
|
|
73
|
-
icon = _ref.icon,
|
|
74
|
-
closeLabel = _ref.closeLabel,
|
|
75
|
-
iframeName = _ref.iframeName,
|
|
76
|
-
title = _ref.title,
|
|
77
|
-
url = _ref.url,
|
|
78
|
-
download = _ref.download,
|
|
79
|
-
byline = _ref.byline,
|
|
80
|
-
_ref$isTrusted = _ref.isTrusted,
|
|
81
|
-
isTrusted = _ref$isTrusted === void 0 ? false : _ref$isTrusted,
|
|
82
|
-
onViewActionClick = _ref.onViewActionClick,
|
|
83
|
-
onDownloadActionClick = _ref.onDownloadActionClick;
|
|
84
|
-
|
|
85
|
-
var _useState = useState(showModal),
|
|
86
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
87
|
-
isOpen = _useState2[0],
|
|
88
|
-
setIsOpen = _useState2[1];
|
|
89
|
-
|
|
90
|
-
var sandbox = getIframeSandboxAttribute(isTrusted);
|
|
91
|
-
return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
|
|
92
|
-
height: "100%",
|
|
93
|
-
width: "large",
|
|
94
|
-
testId: testId,
|
|
95
|
-
onOpenComplete: onOpen,
|
|
96
|
-
onClose: function onClose() {
|
|
97
|
-
setIsOpen(false);
|
|
98
|
-
},
|
|
99
|
-
onCloseComplete: onClose
|
|
100
|
-
}, /*#__PURE__*/React.createElement(Header, {
|
|
101
|
-
providerName: providerName,
|
|
102
|
-
icon: icon,
|
|
103
|
-
metadata: metadata,
|
|
104
|
-
url: url,
|
|
105
|
-
title: title,
|
|
106
|
-
label: closeLabel,
|
|
107
|
-
download: download,
|
|
108
|
-
byline: byline,
|
|
109
|
-
onViewActionClick: onViewActionClick,
|
|
110
|
-
onDownloadActionClick: onDownloadActionClick
|
|
111
|
-
}), /*#__PURE__*/React.createElement(ModalBody, null, src ? /*#__PURE__*/React.createElement("iframe", {
|
|
112
|
-
style: iframeStyles,
|
|
113
|
-
name: iframeName,
|
|
114
|
-
frameBorder: 0,
|
|
115
|
-
src: src,
|
|
116
|
-
sandbox: sandbox
|
|
117
|
-
}) : /*#__PURE__*/React.createElement("iframe", {
|
|
118
|
-
style: iframeStyles,
|
|
119
|
-
name: iframeName,
|
|
120
|
-
frameBorder: 0,
|
|
121
|
-
sandbox: sandbox
|
|
122
|
-
}))));
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export default ModalWithErrorBoundary;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import { Fragment as F } from 'react';
|
|
4
|
-
import { useModal } from '@atlaskit/modal-dialog';
|
|
5
|
-
import EditorCloseIcon from '@atlaskit/icon/glyph/editor/close';
|
|
6
|
-
import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
7
|
-
import Button from '@atlaskit/button/custom-theme-button';
|
|
8
|
-
import { N100, N30A } from '@atlaskit/theme/colors';
|
|
9
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
10
|
-
import { gs } from '../utils';
|
|
11
|
-
import { Icon } from './Icon';
|
|
12
|
-
import { MetadataList } from './MetadataList';
|
|
13
|
-
import { Byline } from './Byline';
|
|
14
|
-
import { messages } from '../../messages';
|
|
15
|
-
export var Header = function Header(_ref) {
|
|
16
|
-
var title = _ref.title,
|
|
17
|
-
label = _ref.label,
|
|
18
|
-
_ref$metadata = _ref.metadata,
|
|
19
|
-
metadata = _ref$metadata === void 0 ? {
|
|
20
|
-
items: []
|
|
21
|
-
} : _ref$metadata,
|
|
22
|
-
icon = _ref.icon,
|
|
23
|
-
providerName = _ref.providerName,
|
|
24
|
-
url = _ref.url,
|
|
25
|
-
download = _ref.download,
|
|
26
|
-
byline = _ref.byline,
|
|
27
|
-
onViewActionClick = _ref.onViewActionClick,
|
|
28
|
-
onDownloadActionClick = _ref.onDownloadActionClick;
|
|
29
|
-
|
|
30
|
-
var _useModal = useModal(),
|
|
31
|
-
onClose = _useModal.onClose;
|
|
32
|
-
|
|
33
|
-
return jsx("div", {
|
|
34
|
-
style: {
|
|
35
|
-
paddingLeft: gs(3),
|
|
36
|
-
paddingRight: gs(3),
|
|
37
|
-
paddingBottom: gs(2),
|
|
38
|
-
paddingTop: gs(2)
|
|
39
|
-
}
|
|
40
|
-
}, jsx("div", {
|
|
41
|
-
style: {
|
|
42
|
-
display: 'flex',
|
|
43
|
-
justifyContent: 'space-between',
|
|
44
|
-
alignItems: 'baseline',
|
|
45
|
-
borderBottom: "1px solid ".concat(N30A)
|
|
46
|
-
}
|
|
47
|
-
}, jsx("div", {
|
|
48
|
-
css: {
|
|
49
|
-
flex: 1
|
|
50
|
-
}
|
|
51
|
-
}, jsx("div", {
|
|
52
|
-
css: {
|
|
53
|
-
display: 'flex'
|
|
54
|
-
}
|
|
55
|
-
}, icon && jsx(Icon, icon), jsx("div", {
|
|
56
|
-
css: {
|
|
57
|
-
paddingLeft: gs(2),
|
|
58
|
-
paddingBottom: gs(2)
|
|
59
|
-
}
|
|
60
|
-
}, jsx("h3", null, title), jsx("div", {
|
|
61
|
-
css: {
|
|
62
|
-
color: N100
|
|
63
|
-
}
|
|
64
|
-
}, metadata.items.length && jsx(MetadataList, {
|
|
65
|
-
items: metadata.items
|
|
66
|
-
}) || jsx(Byline, null, byline))))), jsx("div", null, download && jsx(Button, {
|
|
67
|
-
appearance: "primary",
|
|
68
|
-
href: download,
|
|
69
|
-
onClick: onDownloadActionClick
|
|
70
|
-
}, jsx(FormattedMessage, messages.download)), url && jsx(Button, {
|
|
71
|
-
href: url,
|
|
72
|
-
target: "_blank",
|
|
73
|
-
appearance: "link",
|
|
74
|
-
testId: "preview-view-action",
|
|
75
|
-
iconAfter: jsx(ShortcutIcon, {
|
|
76
|
-
size: "small",
|
|
77
|
-
label: "go to source"
|
|
78
|
-
}),
|
|
79
|
-
onClick: onViewActionClick
|
|
80
|
-
}, providerName ? jsx(F, null, jsx(FormattedMessage, messages.viewIn), " ", providerName) : jsx(FormattedMessage, messages.viewOriginal)), jsx(Button, {
|
|
81
|
-
appearance: "subtle",
|
|
82
|
-
iconBefore: jsx(EditorCloseIcon, {
|
|
83
|
-
label: label
|
|
84
|
-
}),
|
|
85
|
-
onClick: onClose
|
|
86
|
-
}))));
|
|
87
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import { fontSize } from '@atlaskit/theme/constants';
|
|
4
|
-
import { gs } from '../utils';
|
|
5
|
-
export var blockCardContentHeaderNameClassName = 'block-card-content-header-name';
|
|
6
|
-
export var Name = function Name(_ref) {
|
|
7
|
-
var name = _ref.name,
|
|
8
|
-
_ref$isLeftPadded = _ref.isLeftPadded,
|
|
9
|
-
isLeftPadded = _ref$isLeftPadded === void 0 ? true : _ref$isLeftPadded,
|
|
10
|
-
testId = _ref.testId,
|
|
11
|
-
textColor = _ref.textColor;
|
|
12
|
-
return jsx("span", {
|
|
13
|
-
css: {
|
|
14
|
-
fontSize: "".concat(fontSize(), "px"),
|
|
15
|
-
fontWeight: 500,
|
|
16
|
-
marginLeft: isLeftPadded ? gs(1) : '0',
|
|
17
|
-
lineHeight: gs(2.5),
|
|
18
|
-
// Spec: show max two lines.
|
|
19
|
-
display: '-webkit-box',
|
|
20
|
-
overflow: 'hidden',
|
|
21
|
-
textOverflow: 'ellipsis',
|
|
22
|
-
wordBreak: 'break-word',
|
|
23
|
-
WebkitLineClamp: 2,
|
|
24
|
-
WebkitBoxOrient: 'vertical',
|
|
25
|
-
color: textColor ? textColor : 'inherit',
|
|
26
|
-
// Fallback options.
|
|
27
|
-
maxHeight: gs(6)
|
|
28
|
-
},
|
|
29
|
-
"data-testid": testId,
|
|
30
|
-
"data-trello-do-not-use-override": "block-card-content-header-name",
|
|
31
|
-
className: blockCardContentHeaderNameClassName
|
|
32
|
-
}, name);
|
|
33
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import { N300 } from '@atlaskit/theme/colors';
|
|
4
|
-
import { gs } from '../utils';
|
|
5
|
-
export var Provider = function Provider(_ref) {
|
|
6
|
-
var name = _ref.name,
|
|
7
|
-
icon = _ref.icon;
|
|
8
|
-
var iconToRender = icon || null;
|
|
9
|
-
|
|
10
|
-
if (typeof icon === 'string') {
|
|
11
|
-
iconToRender = jsx("img", {
|
|
12
|
-
className: "smart-link-icon",
|
|
13
|
-
css: {
|
|
14
|
-
height: gs(1.5),
|
|
15
|
-
width: gs(1.5)
|
|
16
|
-
},
|
|
17
|
-
src: icon
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return jsx("div", {
|
|
22
|
-
css: {
|
|
23
|
-
display: 'flex',
|
|
24
|
-
alignItems: 'center'
|
|
25
|
-
}
|
|
26
|
-
}, iconToRender, jsx("span", {
|
|
27
|
-
css: {
|
|
28
|
-
fontSize: gs(1.5),
|
|
29
|
-
color: N300,
|
|
30
|
-
margin: 0,
|
|
31
|
-
marginLeft: gs(0.5),
|
|
32
|
-
// EDM-713: fixes copy-paste from renderer to editor for Firefox
|
|
33
|
-
// due to HTML its unwrapping behaviour on paste.
|
|
34
|
-
MozUserSelect: 'none'
|
|
35
|
-
}
|
|
36
|
-
}, name));
|
|
37
|
-
};
|