@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,70 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
4
|
-
import { IntlProvider, FormattedMessage } from 'react-intl-next';
|
|
5
|
-
import { messages } from '../../messages';
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
Explanatory note:
|
|
9
|
-
Actions don't have access to the react tree of whatever is rendered them
|
|
10
|
-
(and this concept is fraught inside editor anyway) so we want to ensure
|
|
11
|
-
it is mounting to a new unique place. This function manages that, including
|
|
12
|
-
creating an element if it doesn't exist, as well as tidying up the react tree
|
|
13
|
-
(but not the element) upon closing the modal.
|
|
14
|
-
|
|
15
|
-
This may strike you as really uncomfortable as you read it, so I wanted to note
|
|
16
|
-
that a) this was discussed and agreed upon, and b) it's definitely odd, and if
|
|
17
|
-
you find an elegant solution around this, you should definitely feel free to
|
|
18
|
-
refactor it.
|
|
19
|
-
*/
|
|
20
|
-
export async function previewFunction({
|
|
21
|
-
popupMountPointId,
|
|
22
|
-
onClose,
|
|
23
|
-
...rest
|
|
24
|
-
}) {
|
|
25
|
-
let popupMountPoint;
|
|
26
|
-
popupMountPoint = document.getElementById(popupMountPointId);
|
|
27
|
-
|
|
28
|
-
if (!popupMountPoint) {
|
|
29
|
-
popupMountPoint = document.createElement('div');
|
|
30
|
-
popupMountPoint.id = popupMountPointId;
|
|
31
|
-
popupMountPoint.setAttribute('data-testid', 'preview-modal');
|
|
32
|
-
document.body.appendChild(popupMountPoint);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
let Modal = await import('../components/Modal');
|
|
36
|
-
ReactDOM.render( /*#__PURE__*/React.createElement(IntlProvider, {
|
|
37
|
-
locale: "en"
|
|
38
|
-
}, /*#__PURE__*/React.createElement(Modal.default, _extends({}, rest, {
|
|
39
|
-
onClose: () => {
|
|
40
|
-
if (popupMountPoint) {
|
|
41
|
-
onClose();
|
|
42
|
-
ReactDOM.unmountComponentAtNode(popupMountPoint);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}))), popupMountPoint);
|
|
46
|
-
}
|
|
47
|
-
/*
|
|
48
|
-
Most of these are optional as we are being fault-tolerant
|
|
49
|
-
However src, details, icon, title, and providerName are STRONGLY encouraged
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
export default (({
|
|
53
|
-
details,
|
|
54
|
-
...rest
|
|
55
|
-
}) => ({
|
|
56
|
-
id: 'preview-content',
|
|
57
|
-
text: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview),
|
|
58
|
-
promise: () => previewFunction({
|
|
59
|
-
popupMountPointId: 'twp-editor-preview-iframe',
|
|
60
|
-
providerName: 'Preview',
|
|
61
|
-
closeLabel: 'Close Preview',
|
|
62
|
-
showModal: true,
|
|
63
|
-
iframeName: 'twp-editor-preview-iframe',
|
|
64
|
-
onClose: () => {},
|
|
65
|
-
metadata: {
|
|
66
|
-
items: details || []
|
|
67
|
-
},
|
|
68
|
-
...rest
|
|
69
|
-
})
|
|
70
|
-
}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
-
import { messages } from '../../messages';
|
|
4
|
-
export const RetryAction = handler => ({
|
|
5
|
-
id: 'try-again',
|
|
6
|
-
promise: async () => handler(),
|
|
7
|
-
text: /*#__PURE__*/React.createElement(FormattedMessage, messages.try_again)
|
|
8
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
-
import { messages } from '../../messages';
|
|
4
|
-
export async function viewFunction({
|
|
5
|
-
url
|
|
6
|
-
}) {
|
|
7
|
-
if (!url) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
window.open(url, '_blank', 'noopener=yes');
|
|
12
|
-
}
|
|
13
|
-
export const ViewAction = ({
|
|
14
|
-
url
|
|
15
|
-
}) => ({
|
|
16
|
-
id: 'view-content',
|
|
17
|
-
text: /*#__PURE__*/React.createElement(FormattedMessage, messages.view),
|
|
18
|
-
promise: () => viewFunction({
|
|
19
|
-
url
|
|
20
|
-
})
|
|
21
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import Button from '@atlaskit/button/custom-theme-button';
|
|
5
|
-
import { ActionIcon } from './ActionIcon';
|
|
6
|
-
export const spinnerDelay = 1000;
|
|
7
|
-
export const Action = ({
|
|
8
|
-
promise,
|
|
9
|
-
text,
|
|
10
|
-
buttonAppearance = 'default',
|
|
11
|
-
id
|
|
12
|
-
}) => {
|
|
13
|
-
const [state, setState] = useState('init');
|
|
14
|
-
return jsx(Button, {
|
|
15
|
-
spacing: "compact",
|
|
16
|
-
appearance: buttonAppearance,
|
|
17
|
-
isLoading: state === 'loading',
|
|
18
|
-
testId: `button-${id}`,
|
|
19
|
-
onClick: event => {
|
|
20
|
-
event.stopPropagation();
|
|
21
|
-
event.preventDefault();
|
|
22
|
-
|
|
23
|
-
if (state !== 'loading') {
|
|
24
|
-
setState('loading');
|
|
25
|
-
promise().then(() => {
|
|
26
|
-
setState('success');
|
|
27
|
-
setTimeout(() => setState('init'), spinnerDelay);
|
|
28
|
-
}).catch(() => {
|
|
29
|
-
setState('failure');
|
|
30
|
-
setTimeout(() => setState('init'), spinnerDelay);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}, jsx("div", {
|
|
35
|
-
css: {
|
|
36
|
-
transition: 'opacity 0.3s',
|
|
37
|
-
opacity: state !== 'init' ? 0 : 1
|
|
38
|
-
}
|
|
39
|
-
}, text), jsx(ActionIcon, {
|
|
40
|
-
state: state
|
|
41
|
-
}));
|
|
42
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import CheckIcon from '@atlaskit/icon/glyph/check';
|
|
3
|
-
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
These styles are taken fro the spinner style for button. There was not an
|
|
7
|
-
easy way to share tehm between the two components.
|
|
8
|
-
*/
|
|
9
|
-
export const spinnerStyles = {
|
|
10
|
-
display: 'flex',
|
|
11
|
-
position: 'absolute',
|
|
12
|
-
left: '50%',
|
|
13
|
-
top: '50%',
|
|
14
|
-
transform: 'translate(-50%, -50%)'
|
|
15
|
-
};
|
|
16
|
-
export const ActionIcon = ({
|
|
17
|
-
state
|
|
18
|
-
}) => {
|
|
19
|
-
switch (state) {
|
|
20
|
-
case 'init':
|
|
21
|
-
case 'loading':
|
|
22
|
-
return null;
|
|
23
|
-
|
|
24
|
-
case 'success':
|
|
25
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
-
"data-testid": "check-icon",
|
|
27
|
-
style: spinnerStyles
|
|
28
|
-
}, /*#__PURE__*/React.createElement(CheckIcon, {
|
|
29
|
-
size: "small",
|
|
30
|
-
label: "check"
|
|
31
|
-
}));
|
|
32
|
-
|
|
33
|
-
case 'failure':
|
|
34
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
"data-testid": "cross-icon",
|
|
36
|
-
style: spinnerStyles
|
|
37
|
-
}, /*#__PURE__*/React.createElement(CrossIcon, {
|
|
38
|
-
size: "small",
|
|
39
|
-
label: "check"
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
/** @jsx jsx */
|
|
4
|
-
import { jsx } from '@emotion/core';
|
|
5
|
-
import { useState } from 'react';
|
|
6
|
-
import Item from '@atlaskit/item';
|
|
7
|
-
import DropList from '@atlaskit/droplist';
|
|
8
|
-
import ButtonGroup from '@atlaskit/button/button-group';
|
|
9
|
-
import Button from '@atlaskit/button/custom-theme-button';
|
|
10
|
-
import { Action } from './Action';
|
|
11
|
-
import { gs, mq } from '../utils';
|
|
12
|
-
export const ActionList = ({
|
|
13
|
-
items
|
|
14
|
-
}) => {
|
|
15
|
-
const [isOpen, setOpen] = useState(false);
|
|
16
|
-
const actionsToShow = items.slice(0, 2);
|
|
17
|
-
const actionsToList = items.slice(2, items.length);
|
|
18
|
-
return jsx("div", {
|
|
19
|
-
css: mq({
|
|
20
|
-
display: 'flex',
|
|
21
|
-
marginTop: [gs(2), 0]
|
|
22
|
-
})
|
|
23
|
-
}, jsx(ButtonGroup, null, actionsToShow.map(action => jsx(Action, _extends({
|
|
24
|
-
key: action.id
|
|
25
|
-
}, action)))), actionsToList.length ? jsx("div", {
|
|
26
|
-
css: {
|
|
27
|
-
marginLeft: gs(0.5)
|
|
28
|
-
}
|
|
29
|
-
}, jsx(DropList, {
|
|
30
|
-
appearance: "default",
|
|
31
|
-
position: "right top",
|
|
32
|
-
isTriggerNotTabbable: true,
|
|
33
|
-
onOpenChange: () => setOpen(true),
|
|
34
|
-
onClick: () => setOpen(!isOpen),
|
|
35
|
-
isOpen: isOpen,
|
|
36
|
-
trigger: jsx(Button, {
|
|
37
|
-
spacing: "compact"
|
|
38
|
-
}, "...")
|
|
39
|
-
}, actionsToList.map(actionToList => jsx(Item, {
|
|
40
|
-
key: actionToList.id
|
|
41
|
-
}, actionToList.text)))) : null);
|
|
42
|
-
};
|
|
@@ -1,33 +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 const Byline = ({
|
|
6
|
-
text,
|
|
7
|
-
children,
|
|
8
|
-
testId,
|
|
9
|
-
className
|
|
10
|
-
}) => jsx("span", {
|
|
11
|
-
css: mq({
|
|
12
|
-
fontSize: gs(1.5),
|
|
13
|
-
lineHeight: gs(2.5),
|
|
14
|
-
color: `${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);
|
|
@@ -1,36 +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 const CollaboratorList = ({
|
|
6
|
-
items,
|
|
7
|
-
handleAvatarClick = () => {},
|
|
8
|
-
handleMoreAvatarsClick = () => {},
|
|
9
|
-
testId = 'collaborator-list'
|
|
10
|
-
}) => {
|
|
11
|
-
if (items.length === 0) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return jsx("span", {
|
|
16
|
-
css: mq({
|
|
17
|
-
display: ['none', 'inherit']
|
|
18
|
-
})
|
|
19
|
-
}, jsx(AvatarGroup, {
|
|
20
|
-
maxCount: 4,
|
|
21
|
-
appearance: "stack",
|
|
22
|
-
size: "small",
|
|
23
|
-
data: items,
|
|
24
|
-
onAvatarClick: event => {
|
|
25
|
-
event.stopPropagation();
|
|
26
|
-
event.preventDefault();
|
|
27
|
-
handleAvatarClick(event);
|
|
28
|
-
},
|
|
29
|
-
onMoreClick: event => {
|
|
30
|
-
event.stopPropagation();
|
|
31
|
-
event.preventDefault();
|
|
32
|
-
handleMoreAvatarsClick(event);
|
|
33
|
-
},
|
|
34
|
-
testId: testId
|
|
35
|
-
}));
|
|
36
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import { gs, mq } from '../utils';
|
|
4
|
-
export const blockCardContentClassName = 'block-card-content';
|
|
5
|
-
export const Content = ({
|
|
6
|
-
children,
|
|
7
|
-
isCompact = false
|
|
8
|
-
}) => jsx("div", {
|
|
9
|
-
css: mq({
|
|
10
|
-
padding: isCompact ? gs(1) : gs(2),
|
|
11
|
-
display: 'flex',
|
|
12
|
-
flexDirection: 'column',
|
|
13
|
-
justifyContent: isCompact ? 'unset' : ['unset', 'space-between'],
|
|
14
|
-
flexGrow: 1
|
|
15
|
-
}),
|
|
16
|
-
"data-trello-do-not-use-override": "block-card-content",
|
|
17
|
-
className: blockCardContentClassName
|
|
18
|
-
}, children);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import { gs, mq } from '../utils';
|
|
4
|
-
export const contentFooterClassName = 'smart-link-content-footer';
|
|
5
|
-
export const ContentFooter = ({
|
|
6
|
-
children,
|
|
7
|
-
hasSpaceBetween = false
|
|
8
|
-
}) => jsx("div", {
|
|
9
|
-
css: mq({
|
|
10
|
-
display: 'flex',
|
|
11
|
-
flexDirection: ['column', 'row'],
|
|
12
|
-
flexGrow: [1, 'unset'],
|
|
13
|
-
justifyContent: [hasSpaceBetween ? 'space-between' : 'flex-end', 'space-between'],
|
|
14
|
-
alignItems: ['unset', 'center'],
|
|
15
|
-
marginTop: [gs(1), gs(1.5)]
|
|
16
|
-
}),
|
|
17
|
-
className: contentFooterClassName
|
|
18
|
-
}, children);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
export const blockCardContentHeaderClassName = 'block-card-content-header';
|
|
4
|
-
export const ContentHeader = ({
|
|
5
|
-
onClick,
|
|
6
|
-
link,
|
|
7
|
-
children
|
|
8
|
-
}) => 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);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { gs } from '../utils';
|
|
5
|
-
export const Emoji = ({
|
|
6
|
-
emoji
|
|
7
|
-
}) => {
|
|
8
|
-
return jsx("span", {
|
|
9
|
-
css: {
|
|
10
|
-
height: gs(2.5),
|
|
11
|
-
width: gs(2),
|
|
12
|
-
display: 'flex',
|
|
13
|
-
alignItems: 'center',
|
|
14
|
-
justifyContent: 'center',
|
|
15
|
-
marginTop: '-2px'
|
|
16
|
-
}
|
|
17
|
-
}, emoji);
|
|
18
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { N20A, N30A, B200, N40A, N50A } from '@atlaskit/theme/colors';
|
|
5
|
-
import { gs, br, mq } from '../utils';
|
|
6
|
-
export const Frame = (props = {
|
|
7
|
-
isSelected: false,
|
|
8
|
-
isHoverable: false,
|
|
9
|
-
isFluidHeight: false
|
|
10
|
-
}) => props.compact ? jsx(CompactFrame, props) : jsx(ExpandedFrame, props);
|
|
11
|
-
const sharedFrameStyles = {
|
|
12
|
-
maxWidth: gs(95),
|
|
13
|
-
width: '100%',
|
|
14
|
-
display: 'flex',
|
|
15
|
-
backgroundColor: 'white'
|
|
16
|
-
};
|
|
17
|
-
export const ExpandedFrame = ({
|
|
18
|
-
children,
|
|
19
|
-
isSelected,
|
|
20
|
-
isHoverable,
|
|
21
|
-
testId,
|
|
22
|
-
className,
|
|
23
|
-
isFluidHeight
|
|
24
|
-
}) => {
|
|
25
|
-
return jsx("div", {
|
|
26
|
-
css: mq({ ...sharedFrameStyles,
|
|
27
|
-
'&:hover': isHoverable ? {
|
|
28
|
-
backgroundColor: N20A,
|
|
29
|
-
cursor: 'pointer'
|
|
30
|
-
} : undefined,
|
|
31
|
-
minHeight: isFluidHeight ? 0 : [gs(21), gs(15)],
|
|
32
|
-
borderRadius: isSelected ? br() : br(0.5),
|
|
33
|
-
border: `2px solid ${isSelected ? B200 : 'transparent'}`,
|
|
34
|
-
justifyContent: 'space-between',
|
|
35
|
-
overflow: 'hidden',
|
|
36
|
-
boxShadow: `0 1px 1px ${N50A}, 0 0 1px 1px ${N40A};`
|
|
37
|
-
}),
|
|
38
|
-
"data-testid": testId,
|
|
39
|
-
className: className,
|
|
40
|
-
"data-trello-do-not-use-override": testId
|
|
41
|
-
}, children);
|
|
42
|
-
};
|
|
43
|
-
export const CompactFrame = ({
|
|
44
|
-
children,
|
|
45
|
-
isHoverable,
|
|
46
|
-
isSelected,
|
|
47
|
-
testId,
|
|
48
|
-
className,
|
|
49
|
-
inheritDimensions
|
|
50
|
-
}) => {
|
|
51
|
-
return jsx("div", {
|
|
52
|
-
css: mq({ ...sharedFrameStyles,
|
|
53
|
-
'&:hover': isHoverable ? {
|
|
54
|
-
backgroundColor: N30A
|
|
55
|
-
} : undefined,
|
|
56
|
-
borderRadius: isSelected ? br() : br(0.5),
|
|
57
|
-
border: isSelected ? `2px solid ${B200}` : '',
|
|
58
|
-
justifyContent: 'center',
|
|
59
|
-
alignItems: 'center',
|
|
60
|
-
height: inheritDimensions ? '100%' : gs(5),
|
|
61
|
-
backgroundColor: N20A,
|
|
62
|
-
width: ['calc(100% - 16px)', '100%'],
|
|
63
|
-
padding: [`0px ${gs(1)}`, '0']
|
|
64
|
-
}),
|
|
65
|
-
"data-testid": testId,
|
|
66
|
-
className: className
|
|
67
|
-
}, children);
|
|
68
|
-
};
|
|
@@ -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 const blockCardIconImageClassName = 'block-card-icon-image';
|
|
8
|
-
export const Icon = ({
|
|
9
|
-
url,
|
|
10
|
-
icon,
|
|
11
|
-
defaultIcon,
|
|
12
|
-
testId = 'block-card-icon'
|
|
13
|
-
}) => {
|
|
14
|
-
const placeholder = defaultIcon || jsx(LinkIcon, {
|
|
15
|
-
label: "link",
|
|
16
|
-
size: "small",
|
|
17
|
-
testId: `${testId}-default`
|
|
18
|
-
});
|
|
19
|
-
const 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": `${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 const Link = ({
|
|
5
|
-
url,
|
|
6
|
-
testId = 'block-card',
|
|
7
|
-
className
|
|
8
|
-
}) => {
|
|
9
|
-
return jsx("span", {
|
|
10
|
-
"data-testid": `${testId}-link`,
|
|
11
|
-
className: className,
|
|
12
|
-
css: {
|
|
13
|
-
color: B400,
|
|
14
|
-
wordBreak: 'break-all'
|
|
15
|
-
}
|
|
16
|
-
}, url);
|
|
17
|
-
};
|
|
@@ -1,46 +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 const Metadata = ({
|
|
7
|
-
text,
|
|
8
|
-
icon,
|
|
9
|
-
iconUrl,
|
|
10
|
-
tooltip
|
|
11
|
-
}) => {
|
|
12
|
-
let metadataIcon = icon || null;
|
|
13
|
-
|
|
14
|
-
if (!metadataIcon && iconUrl) {
|
|
15
|
-
metadataIcon = jsx("img", {
|
|
16
|
-
src: iconUrl,
|
|
17
|
-
css: {
|
|
18
|
-
width: gs(1),
|
|
19
|
-
height: gs(1)
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const metadata = jsx("div", {
|
|
25
|
-
css: {
|
|
26
|
-
display: 'flex',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
marginRight: gs(0.5)
|
|
29
|
-
}
|
|
30
|
-
}, metadataIcon, jsx("span", {
|
|
31
|
-
css: {
|
|
32
|
-
fontSize: gs(1.5),
|
|
33
|
-
color: `${N300}`,
|
|
34
|
-
marginRight: gs(0.5),
|
|
35
|
-
marginLeft: '2px'
|
|
36
|
-
}
|
|
37
|
-
}, text));
|
|
38
|
-
|
|
39
|
-
if (tooltip) {
|
|
40
|
-
return jsx(Tooltip, {
|
|
41
|
-
content: tooltip
|
|
42
|
-
}, metadata);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return metadata;
|
|
46
|
-
};
|
|
@@ -1,26 +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 const metadataListClassName = 'smart-link-metadata-list';
|
|
8
|
-
export const MetadataList = ({
|
|
9
|
-
items,
|
|
10
|
-
testId
|
|
11
|
-
}) => {
|
|
12
|
-
return jsx("div", {
|
|
13
|
-
css: {
|
|
14
|
-
display: 'flex',
|
|
15
|
-
marginTop: gs(0.5),
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
'&:last-child': {
|
|
18
|
-
marginRight: '0px'
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"data-testid": testId,
|
|
22
|
-
className: metadataListClassName
|
|
23
|
-
}, items.map(item => jsx(Metadata, _extends({
|
|
24
|
-
key: item.text
|
|
25
|
-
}, item))));
|
|
26
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/* TODO: (from codemod)
|
|
2
|
-
We have converted this file as best we could but you might still need
|
|
3
|
-
to manually complete migrating this usage of ModalDialog.
|
|
4
|
-
|
|
5
|
-
This file uses one or more of the following ModalDialog props: 'components', 'header',
|
|
6
|
-
'footer', 'body'. These props have been removed as part of moving to
|
|
7
|
-
a compositional API.
|
|
8
|
-
|
|
9
|
-
The render props that used to be exposed by the custom component APIs are
|
|
10
|
-
now accessible using the 'useModal' hook instead: 'testId', 'titleId', and 'onClose'.
|
|
11
|
-
|
|
12
|
-
We are also no longer exposing 'appearance' as render prop, so this needs to be
|
|
13
|
-
manually passed to your custom components.
|
|
14
|
-
|
|
15
|
-
For a complete guide on customization using the new compositional API, refer to the docs at
|
|
16
|
-
https://atlassian.design/components/modal-dialog/examples#customizing-modal-dialog. */
|
|
17
|
-
import React, { useState } from 'react';
|
|
18
|
-
import ModalDialog, { ModalTransition, ModalBody } from '@atlaskit/modal-dialog';
|
|
19
|
-
import { Header } from './ModalHeader';
|
|
20
|
-
import { getIframeSandboxAttribute } from '../../util';
|
|
21
|
-
const iframeStyles = {
|
|
22
|
-
width: `100%`,
|
|
23
|
-
height: 'calc(100vh - 248px)'
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
class ModalWithErrorBoundary extends React.Component {
|
|
27
|
-
componentDidCatch(error, errorInfo) {
|
|
28
|
-
if (this.props.onOpenFailed) {
|
|
29
|
-
this.props.onOpenFailed(error, errorInfo);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
render() {
|
|
34
|
-
return /*#__PURE__*/React.createElement(Modal, this.props);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const Modal = ({
|
|
40
|
-
onClose,
|
|
41
|
-
onOpen,
|
|
42
|
-
src,
|
|
43
|
-
testId,
|
|
44
|
-
showModal,
|
|
45
|
-
providerName,
|
|
46
|
-
metadata,
|
|
47
|
-
icon,
|
|
48
|
-
closeLabel,
|
|
49
|
-
iframeName,
|
|
50
|
-
title,
|
|
51
|
-
url,
|
|
52
|
-
download,
|
|
53
|
-
byline,
|
|
54
|
-
isTrusted = false,
|
|
55
|
-
onViewActionClick,
|
|
56
|
-
onDownloadActionClick
|
|
57
|
-
}) => {
|
|
58
|
-
let [isOpen, setIsOpen] = useState(showModal);
|
|
59
|
-
const sandbox = getIframeSandboxAttribute(isTrusted);
|
|
60
|
-
return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
|
|
61
|
-
height: "100%",
|
|
62
|
-
width: "large",
|
|
63
|
-
testId: testId,
|
|
64
|
-
onOpenComplete: onOpen,
|
|
65
|
-
onClose: () => {
|
|
66
|
-
setIsOpen(false);
|
|
67
|
-
},
|
|
68
|
-
onCloseComplete: onClose
|
|
69
|
-
}, /*#__PURE__*/React.createElement(Header, {
|
|
70
|
-
providerName: providerName,
|
|
71
|
-
icon: icon,
|
|
72
|
-
metadata: metadata,
|
|
73
|
-
url: url,
|
|
74
|
-
title: title,
|
|
75
|
-
label: closeLabel,
|
|
76
|
-
download: download,
|
|
77
|
-
byline: byline,
|
|
78
|
-
onViewActionClick: onViewActionClick,
|
|
79
|
-
onDownloadActionClick: onDownloadActionClick
|
|
80
|
-
}), /*#__PURE__*/React.createElement(ModalBody, null, src ? /*#__PURE__*/React.createElement("iframe", {
|
|
81
|
-
style: iframeStyles,
|
|
82
|
-
name: iframeName,
|
|
83
|
-
frameBorder: 0,
|
|
84
|
-
src: src,
|
|
85
|
-
sandbox: sandbox
|
|
86
|
-
}) : /*#__PURE__*/React.createElement("iframe", {
|
|
87
|
-
style: iframeStyles,
|
|
88
|
-
name: iframeName,
|
|
89
|
-
frameBorder: 0,
|
|
90
|
-
sandbox: sandbox
|
|
91
|
-
}))));
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export default ModalWithErrorBoundary;
|