@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,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.InlineCardErroredView = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
|
-
var _react = _interopRequireDefault(require("react"));
|
|
25
|
-
|
|
26
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
27
|
-
|
|
28
|
-
var _error = _interopRequireDefault(require("@atlaskit/icon/glyph/error"));
|
|
29
|
-
|
|
30
|
-
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
31
|
-
|
|
32
|
-
var _Frame = require("../Frame");
|
|
33
|
-
|
|
34
|
-
var _IconAndTitleLayout = require("../IconAndTitleLayout");
|
|
35
|
-
|
|
36
|
-
var _Icon = require("../Icon");
|
|
37
|
-
|
|
38
|
-
var _messages = require("../../messages");
|
|
39
|
-
|
|
40
|
-
var _reactIntlNext = require("react-intl-next");
|
|
41
|
-
|
|
42
|
-
var _styled = require("../styled");
|
|
43
|
-
|
|
44
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
45
|
-
|
|
46
|
-
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; } }
|
|
47
|
-
|
|
48
|
-
var InlineCardErroredView = /*#__PURE__*/function (_React$Component) {
|
|
49
|
-
(0, _inherits2.default)(InlineCardErroredView, _React$Component);
|
|
50
|
-
|
|
51
|
-
var _super = _createSuper(InlineCardErroredView);
|
|
52
|
-
|
|
53
|
-
function InlineCardErroredView() {
|
|
54
|
-
var _this;
|
|
55
|
-
|
|
56
|
-
(0, _classCallCheck2.default)(this, InlineCardErroredView);
|
|
57
|
-
|
|
58
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
59
|
-
args[_key] = arguments[_key];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
63
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleRetry", function (event) {
|
|
64
|
-
var onRetry = _this.props.onRetry;
|
|
65
|
-
|
|
66
|
-
if (onRetry) {
|
|
67
|
-
event.preventDefault();
|
|
68
|
-
event.stopPropagation();
|
|
69
|
-
onRetry();
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderMessage", function () {
|
|
73
|
-
var _this$props = _this.props,
|
|
74
|
-
onRetry = _this$props.onRetry,
|
|
75
|
-
url = _this$props.url,
|
|
76
|
-
message = _this$props.message;
|
|
77
|
-
|
|
78
|
-
var link = /*#__PURE__*/_react.default.createElement(_styled.LinkAppearance, null, url);
|
|
79
|
-
|
|
80
|
-
var errorMessage = /*#__PURE__*/_react.default.createElement(_styled.NoLinkAppearance, null, message);
|
|
81
|
-
|
|
82
|
-
return !onRetry ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, link, " - ", errorMessage) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, link, " - ", errorMessage, ",\xA0", /*#__PURE__*/_react.default.createElement(_customThemeButton.default, {
|
|
83
|
-
spacing: "none",
|
|
84
|
-
appearance: "subtle-link",
|
|
85
|
-
component: _styled.IconStyledButton,
|
|
86
|
-
onClick: _this.handleRetry
|
|
87
|
-
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.try_again, function (formattedMessage) {
|
|
88
|
-
return /*#__PURE__*/_react.default.createElement(_styled.LowercaseAppearance, null, formattedMessage);
|
|
89
|
-
})));
|
|
90
|
-
});
|
|
91
|
-
return _this;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
(0, _createClass2.default)(InlineCardErroredView, [{
|
|
95
|
-
key: "render",
|
|
96
|
-
value: function render() {
|
|
97
|
-
var _this$props2 = this.props,
|
|
98
|
-
url = _this$props2.url,
|
|
99
|
-
onClick = _this$props2.onClick,
|
|
100
|
-
isSelected = _this$props2.isSelected,
|
|
101
|
-
_this$props2$testId = _this$props2.testId,
|
|
102
|
-
testId = _this$props2$testId === void 0 ? 'inline-card-errored-view' : _this$props2$testId,
|
|
103
|
-
icon = _this$props2.icon;
|
|
104
|
-
return /*#__PURE__*/_react.default.createElement(_Frame.Frame, {
|
|
105
|
-
testId: testId,
|
|
106
|
-
link: url,
|
|
107
|
-
onClick: onClick,
|
|
108
|
-
isSelected: isSelected
|
|
109
|
-
}, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconAndTitleLayout, {
|
|
110
|
-
icon: icon || /*#__PURE__*/_react.default.createElement(_Icon.AKIconWrapper, null, /*#__PURE__*/_react.default.createElement(_error.default, {
|
|
111
|
-
label: "error",
|
|
112
|
-
size: "small",
|
|
113
|
-
primaryColor: _colors.R300
|
|
114
|
-
})),
|
|
115
|
-
title: this.renderMessage()
|
|
116
|
-
}));
|
|
117
|
-
}
|
|
118
|
-
}]);
|
|
119
|
-
return InlineCardErroredView;
|
|
120
|
-
}(_react.default.Component);
|
|
121
|
-
|
|
122
|
-
exports.InlineCardErroredView = InlineCardErroredView;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.InlineCardForbiddenView = void 0;
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
|
-
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
|
|
28
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
29
|
-
|
|
30
|
-
var _lockFilled = _interopRequireDefault(require("@atlaskit/icon/glyph/lock-filled"));
|
|
31
|
-
|
|
32
|
-
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
33
|
-
|
|
34
|
-
var _Frame = require("../Frame");
|
|
35
|
-
|
|
36
|
-
var _IconAndTitleLayout = require("../IconAndTitleLayout");
|
|
37
|
-
|
|
38
|
-
var _Icon = require("../Icon");
|
|
39
|
-
|
|
40
|
-
var _messages = require("../../messages");
|
|
41
|
-
|
|
42
|
-
var _reactIntlNext = require("react-intl-next");
|
|
43
|
-
|
|
44
|
-
var _styled = require("../styled");
|
|
45
|
-
|
|
46
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
47
|
-
|
|
48
|
-
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; } }
|
|
49
|
-
|
|
50
|
-
var FallbackForbiddenIcon = /*#__PURE__*/_react.default.createElement(_Icon.AKIconWrapper, null, /*#__PURE__*/_react.default.createElement(_lockFilled.default, {
|
|
51
|
-
label: "error",
|
|
52
|
-
size: "small",
|
|
53
|
-
primaryColor: _colors.R400
|
|
54
|
-
}));
|
|
55
|
-
|
|
56
|
-
var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
|
|
57
|
-
(0, _inherits2.default)(InlineCardForbiddenView, _React$Component);
|
|
58
|
-
|
|
59
|
-
var _super = _createSuper(InlineCardForbiddenView);
|
|
60
|
-
|
|
61
|
-
function InlineCardForbiddenView() {
|
|
62
|
-
var _this;
|
|
63
|
-
|
|
64
|
-
(0, _classCallCheck2.default)(this, InlineCardForbiddenView);
|
|
65
|
-
|
|
66
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
67
|
-
args[_key] = arguments[_key];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
71
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleRetry", function (event) {
|
|
72
|
-
var onAuthorise = _this.props.onAuthorise;
|
|
73
|
-
event.preventDefault();
|
|
74
|
-
event.stopPropagation();
|
|
75
|
-
|
|
76
|
-
if (onAuthorise) {
|
|
77
|
-
onAuthorise();
|
|
78
|
-
} else {
|
|
79
|
-
var _this$props, _this$props$requestAc, _this$props$requestAc2;
|
|
80
|
-
|
|
81
|
-
(_this$props = _this.props) === null || _this$props === void 0 ? void 0 : (_this$props$requestAc = _this$props.requestAccessContext) === null || _this$props$requestAc === void 0 ? void 0 : (_this$props$requestAc2 = _this$props$requestAc.action) === null || _this$props$requestAc2 === void 0 ? void 0 : _this$props$requestAc2.promise();
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderForbiddenAccessMessage", function () {
|
|
85
|
-
var _this$props2, _this$props2$requestA;
|
|
86
|
-
|
|
87
|
-
if ((_this$props2 = _this.props) !== null && _this$props2 !== void 0 && (_this$props2$requestA = _this$props2.requestAccessContext) !== null && _this$props2$requestA !== void 0 && _this$props2$requestA.callToActionMessageKey) {
|
|
88
|
-
var callToActionMessageKey = _this.props.requestAccessContext.callToActionMessageKey;
|
|
89
|
-
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages[callToActionMessageKey], {
|
|
90
|
-
values: {
|
|
91
|
-
context: _this.props.context
|
|
92
|
-
}
|
|
93
|
-
}));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.invalid_permissions, function (formattedMessage) {
|
|
97
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, formattedMessage, ", ");
|
|
98
|
-
}), /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.try_another_account, function (formattedMessage) {
|
|
99
|
-
return /*#__PURE__*/_react.default.createElement(_styled.LowercaseAppearance, null, formattedMessage);
|
|
100
|
-
}));
|
|
101
|
-
});
|
|
102
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderMessage", function () {
|
|
103
|
-
var _this$props4, _this$props4$requestA;
|
|
104
|
-
|
|
105
|
-
var _this$props3 = _this.props,
|
|
106
|
-
url = _this$props3.url,
|
|
107
|
-
onAuthorise = _this$props3.onAuthorise;
|
|
108
|
-
|
|
109
|
-
var link = /*#__PURE__*/_react.default.createElement(_styled.LinkAppearance, null, url);
|
|
110
|
-
|
|
111
|
-
var hasRequestAccessContextMessage = (_this$props4 = _this.props) === null || _this$props4 === void 0 ? void 0 : (_this$props4$requestA = _this$props4.requestAccessContext) === null || _this$props4$requestA === void 0 ? void 0 : _this$props4$requestA.callToActionMessageKey;
|
|
112
|
-
return !onAuthorise && !hasRequestAccessContextMessage ? link : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, link, ' - ', /*#__PURE__*/_react.default.createElement(_customThemeButton.default, {
|
|
113
|
-
spacing: "none",
|
|
114
|
-
appearance: "subtle-link",
|
|
115
|
-
onClick: _this.handleRetry,
|
|
116
|
-
component: _styled.IconStyledButton,
|
|
117
|
-
testId: "button-connect-other-account"
|
|
118
|
-
}, _this.renderForbiddenAccessMessage()));
|
|
119
|
-
});
|
|
120
|
-
return _this;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
(0, _createClass2.default)(InlineCardForbiddenView, [{
|
|
124
|
-
key: "render",
|
|
125
|
-
value: function render() {
|
|
126
|
-
var _this$props5 = this.props,
|
|
127
|
-
url = _this$props5.url,
|
|
128
|
-
icon = _this$props5.icon,
|
|
129
|
-
onClick = _this$props5.onClick,
|
|
130
|
-
isSelected = _this$props5.isSelected,
|
|
131
|
-
_this$props5$testId = _this$props5.testId,
|
|
132
|
-
testId = _this$props5$testId === void 0 ? 'inline-card-forbidden-view' : _this$props5$testId;
|
|
133
|
-
return /*#__PURE__*/_react.default.createElement(_Frame.Frame, {
|
|
134
|
-
testId: testId,
|
|
135
|
-
link: url,
|
|
136
|
-
onClick: onClick,
|
|
137
|
-
isSelected: isSelected
|
|
138
|
-
}, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconAndTitleLayout, {
|
|
139
|
-
icon: icon ? icon : FallbackForbiddenIcon,
|
|
140
|
-
title: this.renderMessage(),
|
|
141
|
-
titleColor: _colors.N500
|
|
142
|
-
}));
|
|
143
|
-
}
|
|
144
|
-
}]);
|
|
145
|
-
return InlineCardForbiddenView;
|
|
146
|
-
}(_react.default.Component);
|
|
147
|
-
|
|
148
|
-
exports.InlineCardForbiddenView = InlineCardForbiddenView;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Frame = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _components = require("@atlaskit/theme/components");
|
|
13
|
-
|
|
14
|
-
var _styled = require("./styled");
|
|
15
|
-
|
|
16
|
-
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); }
|
|
17
|
-
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
|
|
20
|
-
var Frame = function Frame(props) {
|
|
21
|
-
var isSelected = props.isSelected,
|
|
22
|
-
children = props.children,
|
|
23
|
-
onClick = props.onClick,
|
|
24
|
-
link = props.link,
|
|
25
|
-
withoutBackground = props.withoutBackground,
|
|
26
|
-
withoutHover = props.withoutHover,
|
|
27
|
-
testId = props.testId,
|
|
28
|
-
className = props.className;
|
|
29
|
-
var handleClick = (0, _react.useCallback)(function (event) {
|
|
30
|
-
if (onClick) {
|
|
31
|
-
event.preventDefault();
|
|
32
|
-
event.stopPropagation();
|
|
33
|
-
onClick(event);
|
|
34
|
-
}
|
|
35
|
-
}, [onClick]);
|
|
36
|
-
var handleKeyPress = (0, _react.useCallback)(function (event) {
|
|
37
|
-
if (event.key !== ' ' && event.key !== 'Enter') {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (onClick) {
|
|
42
|
-
event.preventDefault();
|
|
43
|
-
event.stopPropagation();
|
|
44
|
-
onClick(event);
|
|
45
|
-
}
|
|
46
|
-
}, [onClick]); // prevent default on mousedown to avoid inline card losing focus
|
|
47
|
-
|
|
48
|
-
var handleMouseDown = (0, _react.useCallback)(function (e) {
|
|
49
|
-
e.preventDefault();
|
|
50
|
-
}, []);
|
|
51
|
-
var isInteractive = Boolean(onClick); // TODO Theming doesn't work right now in editor. Required React context does not trickle down atm.
|
|
52
|
-
// It will be worked as part of https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-154
|
|
53
|
-
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement(_styled.Wrapper, {
|
|
55
|
-
theme: (0, _components.useGlobalTheme)(),
|
|
56
|
-
href: link,
|
|
57
|
-
withoutBackground: withoutBackground,
|
|
58
|
-
withoutHover: withoutHover,
|
|
59
|
-
isSelected: isSelected,
|
|
60
|
-
isInteractive: isInteractive,
|
|
61
|
-
tabIndex: isInteractive ? 0 : undefined,
|
|
62
|
-
role: isInteractive ? 'button' : undefined,
|
|
63
|
-
onClick: handleClick,
|
|
64
|
-
onMouseDown: handleMouseDown,
|
|
65
|
-
onKeyPress: handleKeyPress,
|
|
66
|
-
"data-testid": testId,
|
|
67
|
-
className: className
|
|
68
|
-
}, children);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
exports.Frame = Frame;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Wrapper = void 0;
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
13
|
-
|
|
14
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
15
|
-
|
|
16
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
17
|
-
|
|
18
|
-
var _elevation = require("@atlaskit/theme/elevation");
|
|
19
|
-
|
|
20
|
-
var _components = require("@atlaskit/theme/components");
|
|
21
|
-
|
|
22
|
-
var _styled2 = require("../IconAndTitleLayout/styled");
|
|
23
|
-
|
|
24
|
-
var _templateObject;
|
|
25
|
-
|
|
26
|
-
var BACKGROUND_COLOR_DARK = '#262B31';
|
|
27
|
-
var selected = "\n cursor: pointer;\n box-shadow: 0 0 0 2px ".concat(_colors.B100, ";\n outline: none;\n user-select: none;\n &, :hover, :focus, :active {\n text-decoration: none;\n }\n");
|
|
28
|
-
|
|
29
|
-
var isInteractive = function isInteractive(_ref) {
|
|
30
|
-
var isInteractive = _ref.isInteractive;
|
|
31
|
-
|
|
32
|
-
if (isInteractive) {
|
|
33
|
-
return "\n cursor: pointer;\n :hover {\n background-color: ".concat((0, _components.themed)({
|
|
34
|
-
light: _colors.N20,
|
|
35
|
-
dark: BACKGROUND_COLOR_DARK
|
|
36
|
-
}), ";\n text-decoration: none;\n }\n :active {\n background-color: ").concat((0, _components.themed)({
|
|
37
|
-
light: _colors.B50,
|
|
38
|
-
dark: BACKGROUND_COLOR_DARK
|
|
39
|
-
}), ";\n text-decoration: none;\n }\n :focus {\n ").concat(selected, "\n text-decoration: none;\n }\n ");
|
|
40
|
-
} else {
|
|
41
|
-
return '';
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var isSelected = function isSelected(_ref2) {
|
|
46
|
-
var isSelected = _ref2.isSelected;
|
|
47
|
-
|
|
48
|
-
if (isSelected) {
|
|
49
|
-
return selected;
|
|
50
|
-
} else {
|
|
51
|
-
return 'user-select: text';
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
var withoutHover = function withoutHover(_ref3) {
|
|
56
|
-
var withoutHover = _ref3.withoutHover;
|
|
57
|
-
return withoutHover ? "\n &:hover {\n text-decoration: none;\n }\n " : '';
|
|
58
|
-
};
|
|
59
|
-
/*
|
|
60
|
-
Inline smart cards should have the following layout:
|
|
61
|
-
------------------------------------
|
|
62
|
-
| icon | title | action OR lozenge |
|
|
63
|
-
------------------------------------
|
|
64
|
-
The aim is to ensure (1) all children are
|
|
65
|
-
in line with each other, (2) are vertically
|
|
66
|
-
centered.
|
|
67
|
-
*/
|
|
68
|
-
// NB: `padding` consistent with @mentions.
|
|
69
|
-
// NB: `display: inline` required for `box-decoration-break` to work.
|
|
70
|
-
// NB: `box-decoration-break` required for retaining properties (border-radius) on wrap.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var Wrapper = _styled.default.a(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n line-height: 16px;\n padding: 1px 0.24em 2px 0.24em;\n ", "\n display: inline;\n box-decoration-break: clone;\n border-radius: ", "px;\n color: ", ";\n background-color: ", ";\n ", ";\n ", "\n ", ";\n ", "\n transition: 0.1s all ease-in-out;\n -moz-user-select: none;\n\n &:hover span.", " {\n text-decoration: ", ";\n }\n"])), function (props) {
|
|
74
|
-
return props.withoutBackground ? "padding-left: 0; margin-left:-2px;" : '';
|
|
75
|
-
}, (0, _constants.borderRadius)(), (0, _components.themed)({
|
|
76
|
-
light: _colors.B400,
|
|
77
|
-
dark: '#4794FF'
|
|
78
|
-
}), function (props) {
|
|
79
|
-
return props.withoutBackground ? '' : (0, _components.themed)({
|
|
80
|
-
light: 'white',
|
|
81
|
-
dark: BACKGROUND_COLOR_DARK
|
|
82
|
-
});
|
|
83
|
-
}, function (props) {
|
|
84
|
-
return props.withoutBackground ? '' : (0, _elevation.e100)();
|
|
85
|
-
}, function (props) {
|
|
86
|
-
return isInteractive(props);
|
|
87
|
-
}, function (props) {
|
|
88
|
-
return isSelected(props);
|
|
89
|
-
}, function (props) {
|
|
90
|
-
return withoutHover(props);
|
|
91
|
-
}, _styled2.TitleWrapperClassName, function (_ref4) {
|
|
92
|
-
var withoutHover = _ref4.withoutHover;
|
|
93
|
-
return withoutHover ? 'none' : 'underline';
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
exports.Wrapper = Wrapper;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Shimmer = exports.Icon = exports.AKIconWrapper = void 0;
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
13
|
-
|
|
14
|
-
var _core = require("@emotion/core");
|
|
15
|
-
|
|
16
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
17
|
-
|
|
18
|
-
var placeholderShimmer = (0, _core.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n background-position: -20px 0;\n }\n\n 100% {\n background-position: 20px 0;\n }\n"]))); // TODO: Figure out a more scalable/responsive solution
|
|
19
|
-
// for vertical alignment.
|
|
20
|
-
// Current rationale: vertically positioned at the top of
|
|
21
|
-
// the smart card container (when set to 0). Offset this
|
|
22
|
-
// to position it with appropriate whitespace from the top.
|
|
23
|
-
|
|
24
|
-
var Icon = _styled.default.img(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: 14px;\n width: 14px;\n margin-right: 4px;\n border-radius: 2px;\n user-select: none;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"]))); // Used for 'untrue' icons which claim to be 16x16 but
|
|
25
|
-
// are less than that in height/width.
|
|
26
|
-
// TODO: Replace this override with proper AtlasKit solution.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exports.Icon = Icon;
|
|
30
|
-
|
|
31
|
-
var AKIconWrapper = _styled.default.span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n margin-right: -2px;\n"])));
|
|
32
|
-
|
|
33
|
-
exports.AKIconWrapper = AKIconWrapper;
|
|
34
|
-
|
|
35
|
-
var Shimmer = _styled.default.span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n height: 14px;\n width: 14px;\n margin-right: 4px;\n border-radius: 2px;\n user-select: none;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n background: #f6f7f8;\n background-image: linear-gradient(\n to right,\n #f6f7f8 0%,\n #edeef1 20%,\n #f6f7f8 40%,\n #f6f7f8 100%\n );\n background-repeat: no-repeat;\n background-size: 40px 14px;\n display: inline-block;\n\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: ", ";\n animation-timing-function: linear;\n"])), placeholderShimmer);
|
|
36
|
-
|
|
37
|
-
exports.Shimmer = Shimmer;
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.IconAndTitleLayout = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireDefault(require("react"));
|
|
21
|
-
|
|
22
|
-
var _reactRenderImage = _interopRequireDefault(require("react-render-image"));
|
|
23
|
-
|
|
24
|
-
var _Icon = require("../Icon");
|
|
25
|
-
|
|
26
|
-
var _styled = require("./styled");
|
|
27
|
-
|
|
28
|
-
var _link = _interopRequireDefault(require("@atlaskit/icon/glyph/link"));
|
|
29
|
-
|
|
30
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
31
|
-
|
|
32
|
-
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; } }
|
|
33
|
-
|
|
34
|
-
var IconAndTitleLayout = /*#__PURE__*/function (_React$Component) {
|
|
35
|
-
(0, _inherits2.default)(IconAndTitleLayout, _React$Component);
|
|
36
|
-
|
|
37
|
-
var _super = _createSuper(IconAndTitleLayout);
|
|
38
|
-
|
|
39
|
-
function IconAndTitleLayout() {
|
|
40
|
-
(0, _classCallCheck2.default)(this, IconAndTitleLayout);
|
|
41
|
-
return _super.apply(this, arguments);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
(0, _createClass2.default)(IconAndTitleLayout, [{
|
|
45
|
-
key: "renderAtlaskitIcon",
|
|
46
|
-
value: function renderAtlaskitIcon() {
|
|
47
|
-
var _this$props = this.props,
|
|
48
|
-
icon = _this$props.icon,
|
|
49
|
-
emoji = _this$props.emoji;
|
|
50
|
-
|
|
51
|
-
if (emoji) {
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement(_styled.EmojiWrapper, null, emoji);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (!icon || typeof icon === 'string') {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return /*#__PURE__*/_react.default.createElement(_styled.IconWrapper, null, icon);
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
key: "renderImageIcon",
|
|
63
|
-
value: function renderImageIcon(errored, testId) {
|
|
64
|
-
var url = this.props.icon;
|
|
65
|
-
|
|
66
|
-
if (!url || typeof url !== 'string') {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return /*#__PURE__*/_react.default.createElement(_reactRenderImage.default, {
|
|
71
|
-
src: url,
|
|
72
|
-
loaded: /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
|
|
73
|
-
className: "smart-link-icon",
|
|
74
|
-
src: url,
|
|
75
|
-
"data-testid": "".concat(testId, "-image")
|
|
76
|
-
}),
|
|
77
|
-
errored: errored,
|
|
78
|
-
loading: /*#__PURE__*/_react.default.createElement(_Icon.Shimmer, {
|
|
79
|
-
"data-testid": "".concat(testId, "-loading")
|
|
80
|
-
})
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}, {
|
|
84
|
-
key: "renderIconPlaceholder",
|
|
85
|
-
value: function renderIconPlaceholder(testId) {
|
|
86
|
-
var defaultIcon = this.props.defaultIcon;
|
|
87
|
-
|
|
88
|
-
if (defaultIcon) {
|
|
89
|
-
return /*#__PURE__*/_react.default.createElement(_styled.IconWrapper, null, defaultIcon);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return /*#__PURE__*/_react.default.createElement(_styled.IconWrapper, null, /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
93
|
-
label: "link",
|
|
94
|
-
size: "small",
|
|
95
|
-
testId: "".concat(testId, "-default")
|
|
96
|
-
}));
|
|
97
|
-
}
|
|
98
|
-
}, {
|
|
99
|
-
key: "renderIcon",
|
|
100
|
-
value: function renderIcon(testId) {
|
|
101
|
-
// We render two kinds of icons here:
|
|
102
|
-
// - Image: acquired from either DAC or Teamwork Platform Apps;
|
|
103
|
-
// - Atlaskit Icon: an Atlaskit SVG;
|
|
104
|
-
// Each of these are scaled down to 12x12.
|
|
105
|
-
var icon = this.renderAtlaskitIcon();
|
|
106
|
-
|
|
107
|
-
if (icon) {
|
|
108
|
-
return icon;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
var placeholder = this.renderIconPlaceholder(testId);
|
|
112
|
-
var image = this.renderImageIcon(placeholder, testId);
|
|
113
|
-
return image || placeholder;
|
|
114
|
-
}
|
|
115
|
-
}, {
|
|
116
|
-
key: "render",
|
|
117
|
-
value: function render() {
|
|
118
|
-
var _this$props2 = this.props,
|
|
119
|
-
children = _this$props2.children,
|
|
120
|
-
title = _this$props2.title,
|
|
121
|
-
titleColor = _this$props2.titleColor,
|
|
122
|
-
titleTextColor = _this$props2.titleTextColor,
|
|
123
|
-
_this$props2$testId = _this$props2.testId,
|
|
124
|
-
testId = _this$props2$testId === void 0 ? 'inline-card-icon-and-title' : _this$props2$testId;
|
|
125
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styled.IconTitleWrapper, {
|
|
126
|
-
style: {
|
|
127
|
-
color: titleColor
|
|
128
|
-
}
|
|
129
|
-
}, /*#__PURE__*/_react.default.createElement(_styled.IconPositionWrapper, null, children || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styled.IconEmptyWrapper, null), this.renderIcon(testId))), /*#__PURE__*/_react.default.createElement(_styled.TitleWrapper, {
|
|
130
|
-
style: {
|
|
131
|
-
color: titleTextColor
|
|
132
|
-
},
|
|
133
|
-
className: _styled.TitleWrapperClassName
|
|
134
|
-
}, title)));
|
|
135
|
-
}
|
|
136
|
-
}]);
|
|
137
|
-
return IconAndTitleLayout;
|
|
138
|
-
}(_react.default.Component);
|
|
139
|
-
|
|
140
|
-
exports.IconAndTitleLayout = IconAndTitleLayout;
|