@atlaskit/media-card 77.4.8 → 77.4.10
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 +12 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/titleBox/styles.js +2 -18
- package/dist/cjs/card/ui/titleBox/titleBoxComponents.js +1 -4
- package/dist/cjs/card/ui/wrapper/styles.js +2 -10
- package/dist/cjs/card/ui/wrapper/wrapper.js +1 -4
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/useFilePreview.js +33 -45
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/lightCards/lightCardWrappers.js +1 -4
- package/dist/cjs/utils/lightCards/styles.js +2 -14
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/titleBox/styles.js +3 -19
- package/dist/es2019/card/ui/titleBox/titleBoxComponents.js +1 -4
- package/dist/es2019/card/ui/wrapper/styles.js +2 -10
- package/dist/es2019/card/ui/wrapper/wrapper.js +1 -4
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/card/v2/useFilePreview.js +17 -28
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/lightCards/lightCardWrappers.js +1 -4
- package/dist/es2019/utils/lightCards/styles.js +4 -16
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/titleBox/styles.js +2 -18
- package/dist/esm/card/ui/titleBox/titleBoxComponents.js +1 -4
- package/dist/esm/card/ui/wrapper/styles.js +2 -10
- package/dist/esm/card/ui/wrapper/wrapper.js +1 -4
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/card/v2/useFilePreview.js +33 -45
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/lightCards/lightCardWrappers.js +1 -4
- package/dist/esm/utils/lightCards/styles.js +3 -15
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/ui/titleBox/styles.d.ts +1 -1
- package/dist/types/card/ui/titleBox/types.d.ts +0 -2
- package/dist/types/card/ui/wrapper/styles.d.ts +1 -1
- package/dist/types/card/ui/wrapper/types.d.ts +0 -2
- package/dist/types/utils/lightCards/styles.d.ts +1 -1
- package/dist/types/utils/lightCards/types.d.ts +0 -2
- package/dist/types-ts4.5/card/ui/titleBox/styles.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/titleBox/types.d.ts +0 -2
- package/dist/types-ts4.5/card/ui/wrapper/styles.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/wrapper/types.d.ts +0 -2
- package/dist/types-ts4.5/utils/lightCards/styles.d.ts +1 -1
- package/dist/types-ts4.5/utils/lightCards/types.d.ts +0 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 77.4.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#58827](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58827) [`d0041df63a34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d0041df63a34) - Small code refactor
|
|
8
|
+
|
|
9
|
+
## 77.4.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#57473](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/57473) [`100f90575744`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/100f90575744) - Remove legacy theming logic from @atlaskit/media-avatar-picker, @atlaskit/media-card, @atlaskit/media-ui and @atlaskit/media-viewer.
|
|
14
|
+
|
|
3
15
|
## 77.4.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -49,7 +49,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
49
49
|
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); }; }
|
|
50
50
|
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; } }
|
|
51
51
|
var packageName = "@atlaskit/media-card";
|
|
52
|
-
var packageVersion = "77.4.
|
|
52
|
+
var packageVersion = "77.4.10";
|
|
53
53
|
var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
|
|
54
54
|
(0, _inherits2.default)(CardBase, _Component);
|
|
55
55
|
var _super = _createSuper(CardBase);
|
|
@@ -90,7 +90,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
90
90
|
}(_react.default.Component);
|
|
91
91
|
(0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
92
92
|
var packageName = "@atlaskit/media-card";
|
|
93
|
-
var packageVersion = "77.4.
|
|
93
|
+
var packageVersion = "77.4.10";
|
|
94
94
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
95
95
|
packageVersion: packageVersion,
|
|
96
96
|
packageName: packageName,
|
|
@@ -10,7 +10,6 @@ var _react = require("@emotion/react");
|
|
|
10
10
|
var _common = require("../common");
|
|
11
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
12
|
var _styles = require("../styles");
|
|
13
|
-
var _components = require("@atlaskit/theme/components");
|
|
14
13
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
15
14
|
var generateResponsiveStyles = function generateResponsiveStyles() {
|
|
16
15
|
var breakpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _common.Breakpoint.SMALL;
|
|
@@ -21,25 +20,10 @@ var generateResponsiveStyles = function generateResponsiveStyles() {
|
|
|
21
20
|
return "height: ".concat(height, "px;\n padding: ").concat(verticalPadding, "px ").concat(horizontalPadding, "px;");
|
|
22
21
|
};
|
|
23
22
|
var HEX_REGEX = /^#[0-9A-F]{6}$/i;
|
|
24
|
-
var BACKGROUND_COLOR_DARK = '#161a1d';
|
|
25
|
-
var TEXT_COLOR_DARK = '#C7D1DB';
|
|
26
23
|
var titleBoxWrapperStyles = exports.titleBoxWrapperStyles = function titleBoxWrapperStyles(_ref) {
|
|
27
24
|
var breakpoint = _ref.breakpoint,
|
|
28
|
-
titleBoxBgColor = _ref.titleBoxBgColor
|
|
29
|
-
|
|
30
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n bottom: 0;\n width: 100%;\n background-color: ", ";\n color: ", ";\n cursor: inherit;\n pointer-events: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ", "\n"])), (0, _components.themed)({
|
|
31
|
-
light: "var(--ds-surface, ".concat((0, _styles.rgba)(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : _colors.N0, 1), ")"),
|
|
32
|
-
dark: "var(--ds-surface, ".concat((0, _styles.rgba)(
|
|
33
|
-
// theme does not contain this color, use constant instead
|
|
34
|
-
titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : BACKGROUND_COLOR_DARK, 1), ")")
|
|
35
|
-
})({
|
|
36
|
-
theme: theme
|
|
37
|
-
}), (0, _components.themed)({
|
|
38
|
-
light: "var(--ds-text, ".concat(_colors.N800, ")"),
|
|
39
|
-
dark: "var(--ds-text, ".concat(TEXT_COLOR_DARK, ")")
|
|
40
|
-
})({
|
|
41
|
-
theme: theme
|
|
42
|
-
}), generateResponsiveStyles(breakpoint));
|
|
25
|
+
titleBoxBgColor = _ref.titleBoxBgColor;
|
|
26
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n bottom: 0;\n width: 100%;\n background-color: ", ";\n color: ", ";\n cursor: inherit;\n pointer-events: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ", "\n"])), "var(--ds-surface, ".concat((0, _styles.rgba)(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : _colors.N0, 1), ")"), "var(--ds-text, ".concat(_colors.N800, ")"), generateResponsiveStyles(breakpoint));
|
|
43
27
|
};
|
|
44
28
|
titleBoxWrapperStyles.displayName = 'TitleBoxWrapper';
|
|
45
29
|
var infoStyles = "white-space: nowrap;overflow: hidden;";
|
|
@@ -6,20 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.TitleBoxWrapper = exports.TitleBoxIcon = exports.TitleBoxHeader = exports.TitleBoxFooter = exports.ErrorMessageWrapper = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _styles = require("./styles");
|
|
9
|
-
var _components = require("@atlaskit/theme/components");
|
|
10
9
|
/** @jsx jsx */
|
|
11
10
|
|
|
12
11
|
var TitleBoxWrapper = exports.TitleBoxWrapper = function TitleBoxWrapper(props) {
|
|
13
12
|
var breakpoint = props.breakpoint,
|
|
14
13
|
titleBoxBgColor = props.titleBoxBgColor;
|
|
15
|
-
var theme = (0, _components.useGlobalTheme)();
|
|
16
14
|
return (0, _react.jsx)("div", {
|
|
17
15
|
id: "titleBoxWrapper",
|
|
18
16
|
"data-testid": "media-title-box",
|
|
19
17
|
css: (0, _styles.titleBoxWrapperStyles)({
|
|
20
18
|
breakpoint: breakpoint,
|
|
21
|
-
titleBoxBgColor: titleBoxBgColor
|
|
22
|
-
theme: theme
|
|
19
|
+
titleBoxBgColor: titleBoxBgColor
|
|
23
20
|
})
|
|
24
21
|
}, props.children);
|
|
25
22
|
};
|
|
@@ -11,12 +11,10 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
11
11
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
12
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
13
|
var _selection = require("@atlaskit/editor-shared-styles/selection");
|
|
14
|
-
var _components = require("@atlaskit/theme/components");
|
|
15
14
|
var _styles = require("../styles");
|
|
16
15
|
var _styles2 = require("../blanket/styles");
|
|
17
16
|
var _styles3 = require("../actionsBar/styles");
|
|
18
17
|
var _templateObject;
|
|
19
|
-
var BACKGROUND_COLOR_DARK = '#22272C';
|
|
20
18
|
var wrapperStyles = exports.wrapperStyles = function wrapperStyles(_ref) {
|
|
21
19
|
var breakpoint = _ref.breakpoint,
|
|
22
20
|
dimensions = _ref.dimensions,
|
|
@@ -27,13 +25,7 @@ var wrapperStyles = exports.wrapperStyles = function wrapperStyles(_ref) {
|
|
|
27
25
|
isPlayButtonClickable = _ref.isPlayButtonClickable,
|
|
28
26
|
isTickBoxSelectable = _ref.isTickBoxSelectable,
|
|
29
27
|
shouldDisplayTooltip = _ref.shouldDisplayTooltip,
|
|
30
|
-
mediaCardCursor = _ref.mediaCardCursor
|
|
31
|
-
|
|
32
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n position: relative;\n font-family: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n\n /* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */\n ", "\n ", "\n &:hover .", " {\n ", "\n }\n &:hover .", " {\n ", "\n }\n\n /* Tooltip does not support percentage dimensions. We enforce them here */\n ", "\n"])), (0, _styles.transition)(), (0, _constants.fontFamily)(), (0, _styles.getWrapperDimensions)(dimensions, appearance), displayBackground && "background: ".concat((0, _components.themed)({
|
|
33
|
-
light: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
|
|
34
|
-
dark: "var(--ds-background-neutral, ".concat(BACKGROUND_COLOR_DARK, ")")
|
|
35
|
-
})({
|
|
36
|
-
theme: theme
|
|
37
|
-
}), ";"), _mediaUi.borderRadius, (0, _styles.getCursorStyle)(mediaCardCursor), (0, _styles.getWrapperShadow)(disableOverlay, selected), (0, _styles.generateResponsiveStyles)(breakpoint), _selection.hideNativeBrowserTextSelectionStyles, (0, _styles.getClickablePlayButtonStyles)(isPlayButtonClickable), (0, _styles.getSelectableTickBoxStyles)(isTickBoxSelectable), _styles2.blanketClassName, _styles2.fixedBlanketStyles, _styles3.actionsBarClassName, _styles3.fixedActionBarStyles, shouldDisplayTooltip && "> div { width: 100%; height: 100%; }");
|
|
28
|
+
mediaCardCursor = _ref.mediaCardCursor;
|
|
29
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n position: relative;\n font-family: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n\n /* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */\n ", "\n ", "\n &:hover .", " {\n ", "\n }\n &:hover .", " {\n ", "\n }\n\n /* Tooltip does not support percentage dimensions. We enforce them here */\n ", "\n"])), (0, _styles.transition)(), (0, _constants.fontFamily)(), (0, _styles.getWrapperDimensions)(dimensions, appearance), displayBackground && "background: ".concat("var(--ds-background-neutral, ".concat(_colors.N20, ")"), ";"), _mediaUi.borderRadius, (0, _styles.getCursorStyle)(mediaCardCursor), (0, _styles.getWrapperShadow)(disableOverlay, selected), (0, _styles.generateResponsiveStyles)(breakpoint), _selection.hideNativeBrowserTextSelectionStyles, (0, _styles.getClickablePlayButtonStyles)(isPlayButtonClickable), (0, _styles.getSelectableTickBoxStyles)(isTickBoxSelectable), _styles2.blanketClassName, _styles2.fixedBlanketStyles, _styles3.actionsBarClassName, _styles3.fixedActionBarStyles, shouldDisplayTooltip && "> div { width: 100%; height: 100%; }");
|
|
38
30
|
};
|
|
39
31
|
wrapperStyles.displayName = 'NewFileExperienceWrapper';
|
|
@@ -7,7 +7,6 @@ exports.Wrapper = void 0;
|
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _cardConstants = require("../../cardConstants");
|
|
9
9
|
var _styles = require("./styles");
|
|
10
|
-
var _components = require("@atlaskit/theme/components");
|
|
11
10
|
/**@jsx jsx */
|
|
12
11
|
|
|
13
12
|
var Wrapper = exports.Wrapper = function Wrapper(props) {
|
|
@@ -25,7 +24,6 @@ var Wrapper = exports.Wrapper = function Wrapper(props) {
|
|
|
25
24
|
isPlayButtonClickable = props.isPlayButtonClickable,
|
|
26
25
|
isTickBoxSelectable = props.isTickBoxSelectable,
|
|
27
26
|
shouldDisplayTooltip = props.shouldDisplayTooltip;
|
|
28
|
-
var theme = (0, _components.useGlobalTheme)();
|
|
29
27
|
return (0, _react.jsx)("div", {
|
|
30
28
|
id: "newFileExperienceWrapper",
|
|
31
29
|
className: _cardConstants.newFileExperienceClassName,
|
|
@@ -40,8 +38,7 @@ var Wrapper = exports.Wrapper = function Wrapper(props) {
|
|
|
40
38
|
isPlayButtonClickable: isPlayButtonClickable,
|
|
41
39
|
isTickBoxSelectable: isTickBoxSelectable,
|
|
42
40
|
shouldDisplayTooltip: shouldDisplayTooltip,
|
|
43
|
-
mediaCardCursor: mediaCardCursor
|
|
44
|
-
theme: theme
|
|
41
|
+
mediaCardCursor: mediaCardCursor
|
|
45
42
|
}),
|
|
46
43
|
ref: innerRef,
|
|
47
44
|
onClick: onClick,
|
|
@@ -16,7 +16,7 @@ var _externalImageCard = require("./externalImageCard");
|
|
|
16
16
|
var _fileCard = require("./fileCard");
|
|
17
17
|
var _excluded = ["identifier"];
|
|
18
18
|
var packageName = "@atlaskit/media-card";
|
|
19
|
-
var packageVersion = "77.4.
|
|
19
|
+
var packageVersion = "77.4.10";
|
|
20
20
|
var CardV2Base = exports.CardV2Base = function CardV2Base(_ref) {
|
|
21
21
|
var identifier = _ref.identifier,
|
|
22
22
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -37,31 +37,27 @@ var useFilePreview = exports.useFilePreview = function useFilePreview(_ref) {
|
|
|
37
37
|
skipRemote = _ref.skipRemote,
|
|
38
38
|
mediaBlobUrlAttrs = _ref.mediaBlobUrlAttrs;
|
|
39
39
|
var mediaClient = (0, _mediaClientReact.useMediaClient)();
|
|
40
|
-
var _useState = (0, _react.useState)(),
|
|
40
|
+
var _useState = (0, _react.useState)('loading'),
|
|
41
41
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
status = _useState2[0],
|
|
43
|
+
setStatus = _useState2[1];
|
|
44
44
|
var _useState3 = (0, _react.useState)(),
|
|
45
45
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
error = _useState4[0],
|
|
47
|
+
setError = _useState4[1];
|
|
48
|
+
var _useState5 = (0, _react.useState)(),
|
|
49
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
50
|
+
nonCriticalError = _useState6[0],
|
|
51
|
+
setNonCriticalError = _useState6[1];
|
|
52
|
+
var _useState7 = (0, _react.useState)(false),
|
|
53
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
54
|
+
isBannedLocalPreview = _useState8[0],
|
|
55
|
+
setIsBannedLocalPreview = _useState8[1];
|
|
56
|
+
var wasResolvedUpfrontPreviewRef = (0, _react.useRef)(false);
|
|
57
|
+
var ssrReliabilityRef = (0, _react.useRef)(initialSsrReliability);
|
|
48
58
|
var requestDimensions = (0, _react.useMemo)(function () {
|
|
49
59
|
return dimensions ? createRequestDimensions(dimensions) : undefined;
|
|
50
60
|
}, [dimensions]);
|
|
51
|
-
|
|
52
|
-
//----------------------------------------------------------------//
|
|
53
|
-
//---------------- State Initializer Functions -------------------//
|
|
54
|
-
//----------------------------------------------------------------//
|
|
55
|
-
|
|
56
|
-
var ssrDataRef = (0, _react.useRef)();
|
|
57
|
-
var ssrReliabilityRef = (0, _react.useRef)({
|
|
58
|
-
server: {
|
|
59
|
-
status: 'unknown'
|
|
60
|
-
},
|
|
61
|
-
client: {
|
|
62
|
-
status: 'unknown'
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
61
|
var imageURLParams = (0, _react.useMemo)(function () {
|
|
66
62
|
return _objectSpread(_objectSpread({
|
|
67
63
|
collection: identifier.collectionName,
|
|
@@ -71,14 +67,13 @@ var useFilePreview = exports.useFilePreview = function useFilePreview(_ref) {
|
|
|
71
67
|
});
|
|
72
68
|
}, [requestDimensions, identifier.collectionName, resizeMode]);
|
|
73
69
|
var getSSRPreview = function getSSRPreview(ssr, identifier, mediaClient) {
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
if ((_ssrDataRef$current = ssrDataRef.current) !== null && _ssrDataRef$current !== void 0 && _ssrDataRef$current.error) {
|
|
70
|
+
var ssrData = (0, _globalScope.getSSRData)(identifier);
|
|
71
|
+
if (ssrData !== null && ssrData !== void 0 && ssrData.error) {
|
|
77
72
|
ssrReliabilityRef.current.server = _objectSpread({
|
|
78
73
|
status: 'fail'
|
|
79
|
-
},
|
|
74
|
+
}, ssrData.error);
|
|
80
75
|
}
|
|
81
|
-
if (!(
|
|
76
|
+
if (!(ssrData !== null && ssrData !== void 0 && ssrData.dataURI)) {
|
|
82
77
|
try {
|
|
83
78
|
return (0, _getCardPreview.getSSRCardPreview)(ssr, mediaClient, identifier.id, imageURLParams, mediaBlobUrlAttrs);
|
|
84
79
|
} catch (e) {
|
|
@@ -87,9 +82,8 @@ var useFilePreview = exports.useFilePreview = function useFilePreview(_ref) {
|
|
|
87
82
|
}, (0, _analytics.extractErrorInfo)(e));
|
|
88
83
|
}
|
|
89
84
|
} else {
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
dataURI = _ssrDataRef$current3.dataURI;
|
|
85
|
+
var _dimensions = ssrData.dimensions,
|
|
86
|
+
dataURI = ssrData.dataURI;
|
|
93
87
|
return {
|
|
94
88
|
dataURI: dataURI,
|
|
95
89
|
dimensions: _dimensions,
|
|
@@ -107,33 +101,19 @@ var useFilePreview = exports.useFilePreview = function useFilePreview(_ref) {
|
|
|
107
101
|
}
|
|
108
102
|
return cardPreview;
|
|
109
103
|
};
|
|
110
|
-
var
|
|
111
|
-
|
|
112
|
-
cardPreview =
|
|
113
|
-
setCardPreview =
|
|
104
|
+
var _useState9 = (0, _react.useState)(cardPreviewInitializer),
|
|
105
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
106
|
+
cardPreview = _useState10[0],
|
|
107
|
+
setCardPreview = _useState10[1];
|
|
114
108
|
var _useFileState = (0, _mediaClientReact.useFileState)(identifier.id, {
|
|
115
109
|
skipRemote: skipRemote,
|
|
116
110
|
collectionName: identifier.collectionName,
|
|
117
111
|
occurrenceKey: identifier.occurrenceKey
|
|
118
112
|
}),
|
|
119
113
|
fileState = _useFileState.fileState;
|
|
120
|
-
|
|
121
|
-
//----------------------------------------------------------------//
|
|
122
|
-
//------------ State, Refs & Initial Values ----------------------//
|
|
123
|
-
//----------------------------------------------------------------//
|
|
124
|
-
|
|
125
|
-
var _useState7 = (0, _react.useState)('loading'),
|
|
126
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
127
|
-
status = _useState8[0],
|
|
128
|
-
setStatus = _useState8[1];
|
|
129
114
|
(0, _react.useEffect)(function () {
|
|
130
115
|
setStatus('loading');
|
|
131
116
|
}, [identifier]);
|
|
132
|
-
var _useState9 = (0, _react.useState)(false),
|
|
133
|
-
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
134
|
-
isBannedLocalPreview = _useState10[0],
|
|
135
|
-
setIsBannedLocalPreview = _useState10[1];
|
|
136
|
-
var wasResolvedUpfrontPreviewRef = (0, _react.useRef)(false);
|
|
137
117
|
|
|
138
118
|
//----------------------------------------------------------------//
|
|
139
119
|
//---------------------- Helper Functions -----------------------//
|
|
@@ -606,4 +586,12 @@ var createRequestDimensions = function createRequestDimensions(dimensions) {
|
|
|
606
586
|
result.height = height * retinaFactor;
|
|
607
587
|
}
|
|
608
588
|
return result;
|
|
589
|
+
};
|
|
590
|
+
var initialSsrReliability = {
|
|
591
|
+
server: {
|
|
592
|
+
status: 'unknown'
|
|
593
|
+
},
|
|
594
|
+
client: {
|
|
595
|
+
status: 'unknown'
|
|
596
|
+
}
|
|
609
597
|
};
|
|
@@ -119,7 +119,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
119
119
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
120
120
|
var analyticsContext = {
|
|
121
121
|
packageVersion: "@atlaskit/media-card",
|
|
122
|
-
packageName: "77.4.
|
|
122
|
+
packageName: "77.4.10",
|
|
123
123
|
componentName: 'mediaInlineCard',
|
|
124
124
|
component: 'mediaInlineCard'
|
|
125
125
|
};
|
|
@@ -8,15 +8,12 @@ exports.Wrapper = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _styles = require("./styles");
|
|
11
|
-
var _components = require("@atlaskit/theme/components");
|
|
12
11
|
/**@jsx jsx */
|
|
13
12
|
|
|
14
13
|
var Wrapper = exports.Wrapper = function Wrapper(props) {
|
|
15
|
-
var theme = (0, _components.useGlobalTheme)();
|
|
16
14
|
return (0, _react.jsx)("div", (0, _extends2.default)({
|
|
17
15
|
css: (0, _styles.wrapperStyles)({
|
|
18
|
-
dimensions: props.dimensions
|
|
19
|
-
theme: theme
|
|
16
|
+
dimensions: props.dimensions
|
|
20
17
|
})
|
|
21
18
|
}, props), props.children);
|
|
22
19
|
};
|
|
@@ -8,21 +8,9 @@ exports.wrapperStyles = void 0;
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
11
|
-
var _components = require("@atlaskit/theme/components");
|
|
12
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
12
|
var _templateObject;
|
|
14
13
|
var wrapperStyles = exports.wrapperStyles = function wrapperStyles(_ref) {
|
|
15
|
-
var dimensions = _ref.dimensions
|
|
16
|
-
|
|
17
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n background: ", ";\n color: ", ";\n ", "\n max-height: 100%;\n max-width: 100%;\n width: ", ";\n height: ", ";\n"])), _mediaUi.center, (0, _components.themed)({
|
|
18
|
-
light: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
|
|
19
|
-
dark: "var(--ds-background-neutral, ".concat(_colors.DN50, ")")
|
|
20
|
-
})({
|
|
21
|
-
theme: theme
|
|
22
|
-
}), (0, _components.themed)({
|
|
23
|
-
light: "var(--ds-icon, ".concat(_colors.N50, ")"),
|
|
24
|
-
dark: "var(--ds-icon, ".concat(_colors.DN100, ")")
|
|
25
|
-
})({
|
|
26
|
-
theme: theme
|
|
27
|
-
}), _mediaUi.borderRadius, dimensions.width, dimensions.height);
|
|
14
|
+
var dimensions = _ref.dimensions;
|
|
15
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n background: ", ";\n color: ", ";\n ", "\n max-height: 100%;\n max-width: 100%;\n width: ", ";\n height: ", ";\n"])), _mediaUi.center, "var(--ds-background-neutral, ".concat(_colors.N20, ")"), "var(--ds-icon, ".concat(_colors.N50, ")"), _mediaUi.borderRadius, dimensions.width, dimensions.height);
|
|
28
16
|
};
|
|
@@ -14,7 +14,7 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
16
|
var packageName = "@atlaskit/media-card";
|
|
17
|
-
var packageVersion = "77.4.
|
|
17
|
+
var packageVersion = "77.4.10";
|
|
18
18
|
var concurrentExperience;
|
|
19
19
|
var getExperience = function getExperience(id) {
|
|
20
20
|
if (!concurrentExperience) {
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -27,7 +27,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
27
27
|
import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '../utils/ufoExperiences';
|
|
28
28
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
29
29
|
const packageName = "@atlaskit/media-card";
|
|
30
|
-
const packageVersion = "77.4.
|
|
30
|
+
const packageVersion = "77.4.10";
|
|
31
31
|
export class CardBase extends Component {
|
|
32
32
|
constructor(props) {
|
|
33
33
|
super(props);
|
|
@@ -66,7 +66,7 @@ class WrappedMediaCardAnalyticsErrorBoundary extends React.Component {
|
|
|
66
66
|
}
|
|
67
67
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
68
68
|
const packageName = "@atlaskit/media-card";
|
|
69
|
-
const packageVersion = "77.4.
|
|
69
|
+
const packageVersion = "77.4.10";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -2,7 +2,6 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
import { responsiveSettings, getTitleBoxHeight, Breakpoint } from '../common';
|
|
3
3
|
import { N0, N800 } from '@atlaskit/theme/colors';
|
|
4
4
|
import { rgba } from '../styles';
|
|
5
|
-
import { themed } from '@atlaskit/theme/components';
|
|
6
5
|
const generateResponsiveStyles = (breakpoint = Breakpoint.SMALL) => {
|
|
7
6
|
const setting = responsiveSettings[breakpoint];
|
|
8
7
|
const verticalPadding = setting.titleBox.verticalPadding;
|
|
@@ -12,30 +11,15 @@ const generateResponsiveStyles = (breakpoint = Breakpoint.SMALL) => {
|
|
|
12
11
|
padding: ${verticalPadding}px ${horizontalPadding}px;`;
|
|
13
12
|
};
|
|
14
13
|
const HEX_REGEX = /^#[0-9A-F]{6}$/i;
|
|
15
|
-
const BACKGROUND_COLOR_DARK = '#161a1d';
|
|
16
|
-
const TEXT_COLOR_DARK = '#C7D1DB';
|
|
17
14
|
export const titleBoxWrapperStyles = ({
|
|
18
15
|
breakpoint,
|
|
19
|
-
titleBoxBgColor
|
|
20
|
-
theme
|
|
16
|
+
titleBoxBgColor
|
|
21
17
|
}) => css`
|
|
22
18
|
position: absolute;
|
|
23
19
|
bottom: 0;
|
|
24
20
|
width: 100%;
|
|
25
|
-
background-color: ${
|
|
26
|
-
|
|
27
|
-
dark: `var(--ds-surface, ${rgba(
|
|
28
|
-
// theme does not contain this color, use constant instead
|
|
29
|
-
titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : BACKGROUND_COLOR_DARK, 1)})`
|
|
30
|
-
})({
|
|
31
|
-
theme
|
|
32
|
-
})};
|
|
33
|
-
color: ${themed({
|
|
34
|
-
light: `var(--ds-text, ${N800})`,
|
|
35
|
-
dark: `var(--ds-text, ${TEXT_COLOR_DARK})`
|
|
36
|
-
})({
|
|
37
|
-
theme
|
|
38
|
-
})};
|
|
21
|
+
background-color: ${`var(--ds-surface, ${rgba(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : N0, 1)})`};
|
|
22
|
+
color: ${`var(--ds-text, ${N800})`};
|
|
39
23
|
cursor: inherit;
|
|
40
24
|
pointer-events: none;
|
|
41
25
|
display: flex;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { errorMessageWrapperStyles, titleBoxFooterStyles, titleBoxHeaderStyles, titleBoxIconStyles, titleBoxWrapperStyles } from './styles';
|
|
4
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
5
4
|
export const TitleBoxWrapper = props => {
|
|
6
5
|
const {
|
|
7
6
|
breakpoint,
|
|
8
7
|
titleBoxBgColor
|
|
9
8
|
} = props;
|
|
10
|
-
const theme = useGlobalTheme();
|
|
11
9
|
return jsx("div", {
|
|
12
10
|
id: "titleBoxWrapper",
|
|
13
11
|
"data-testid": "media-title-box",
|
|
14
12
|
css: titleBoxWrapperStyles({
|
|
15
13
|
breakpoint: breakpoint,
|
|
16
|
-
titleBoxBgColor: titleBoxBgColor
|
|
17
|
-
theme
|
|
14
|
+
titleBoxBgColor: titleBoxBgColor
|
|
18
15
|
})
|
|
19
16
|
}, props.children);
|
|
20
17
|
};
|
|
@@ -3,12 +3,10 @@ import { fontFamily } from '@atlaskit/theme/constants';
|
|
|
3
3
|
import { borderRadius } from '@atlaskit/media-ui';
|
|
4
4
|
import { N20 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { hideNativeBrowserTextSelectionStyles } from '@atlaskit/editor-shared-styles/selection';
|
|
6
|
-
import { themed } from '@atlaskit/theme/components';
|
|
7
6
|
import { transition } from '../styles';
|
|
8
7
|
import { fixedBlanketStyles, blanketClassName } from '../blanket/styles';
|
|
9
8
|
import { fixedActionBarStyles, actionsBarClassName } from '../actionsBar/styles';
|
|
10
9
|
import { generateResponsiveStyles, getClickablePlayButtonStyles, getCursorStyle, getSelectableTickBoxStyles, getWrapperDimensions, getWrapperShadow } from '../styles';
|
|
11
|
-
const BACKGROUND_COLOR_DARK = '#22272C';
|
|
12
10
|
export const wrapperStyles = ({
|
|
13
11
|
breakpoint,
|
|
14
12
|
dimensions,
|
|
@@ -19,8 +17,7 @@ export const wrapperStyles = ({
|
|
|
19
17
|
isPlayButtonClickable,
|
|
20
18
|
isTickBoxSelectable,
|
|
21
19
|
shouldDisplayTooltip,
|
|
22
|
-
mediaCardCursor
|
|
23
|
-
theme
|
|
20
|
+
mediaCardCursor
|
|
24
21
|
}) => css`
|
|
25
22
|
${transition()}
|
|
26
23
|
box-sizing: border-box;
|
|
@@ -30,12 +27,7 @@ export const wrapperStyles = ({
|
|
|
30
27
|
position: relative;
|
|
31
28
|
font-family: ${fontFamily()};
|
|
32
29
|
${getWrapperDimensions(dimensions, appearance)}
|
|
33
|
-
${displayBackground && `background: ${
|
|
34
|
-
light: `var(--ds-background-neutral, ${N20})`,
|
|
35
|
-
dark: `var(--ds-background-neutral, ${BACKGROUND_COLOR_DARK})`
|
|
36
|
-
})({
|
|
37
|
-
theme
|
|
38
|
-
})};`}
|
|
30
|
+
${displayBackground && `background: ${`var(--ds-background-neutral, ${N20})`};`}
|
|
39
31
|
${borderRadius}
|
|
40
32
|
${getCursorStyle(mediaCardCursor)}
|
|
41
33
|
${getWrapperShadow(disableOverlay, selected)}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { newFileExperienceClassName } from '../../cardConstants';
|
|
4
4
|
import { wrapperStyles } from './styles';
|
|
5
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
6
5
|
export const Wrapper = props => {
|
|
7
6
|
const {
|
|
8
7
|
testId,
|
|
@@ -20,7 +19,6 @@ export const Wrapper = props => {
|
|
|
20
19
|
isTickBoxSelectable,
|
|
21
20
|
shouldDisplayTooltip
|
|
22
21
|
} = props;
|
|
23
|
-
const theme = useGlobalTheme();
|
|
24
22
|
return jsx("div", {
|
|
25
23
|
id: "newFileExperienceWrapper",
|
|
26
24
|
className: newFileExperienceClassName,
|
|
@@ -35,8 +33,7 @@ export const Wrapper = props => {
|
|
|
35
33
|
isPlayButtonClickable,
|
|
36
34
|
isTickBoxSelectable,
|
|
37
35
|
shouldDisplayTooltip,
|
|
38
|
-
mediaCardCursor
|
|
39
|
-
theme
|
|
36
|
+
mediaCardCursor
|
|
40
37
|
}),
|
|
41
38
|
ref: innerRef,
|
|
42
39
|
onClick: onClick,
|
|
@@ -7,7 +7,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
7
7
|
import { ExternalImageCard } from './externalImageCard';
|
|
8
8
|
import { FileCard } from './fileCard';
|
|
9
9
|
const packageName = "@atlaskit/media-card";
|
|
10
|
-
const packageVersion = "77.4.
|
|
10
|
+
const packageVersion = "77.4.10";
|
|
11
11
|
export const CardV2Base = ({
|
|
12
12
|
identifier,
|
|
13
13
|
...otherProps
|
|
@@ -24,23 +24,13 @@ export const useFilePreview = ({
|
|
|
24
24
|
mediaBlobUrlAttrs
|
|
25
25
|
}) => {
|
|
26
26
|
const mediaClient = useMediaClient();
|
|
27
|
+
const [status, setStatus] = useState('loading');
|
|
27
28
|
const [error, setError] = useState();
|
|
28
29
|
const [nonCriticalError, setNonCriticalError] = useState();
|
|
30
|
+
const [isBannedLocalPreview, setIsBannedLocalPreview] = useState(false);
|
|
31
|
+
const wasResolvedUpfrontPreviewRef = useRef(false);
|
|
32
|
+
const ssrReliabilityRef = useRef(initialSsrReliability);
|
|
29
33
|
const requestDimensions = useMemo(() => dimensions ? createRequestDimensions(dimensions) : undefined, [dimensions]);
|
|
30
|
-
|
|
31
|
-
//----------------------------------------------------------------//
|
|
32
|
-
//---------------- State Initializer Functions -------------------//
|
|
33
|
-
//----------------------------------------------------------------//
|
|
34
|
-
|
|
35
|
-
const ssrDataRef = useRef();
|
|
36
|
-
const ssrReliabilityRef = useRef({
|
|
37
|
-
server: {
|
|
38
|
-
status: 'unknown'
|
|
39
|
-
},
|
|
40
|
-
client: {
|
|
41
|
-
status: 'unknown'
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
34
|
const imageURLParams = useMemo(() => ({
|
|
45
35
|
collection: identifier.collectionName,
|
|
46
36
|
mode: resizeMode === 'stretchy-fit' ? 'full-fit' : resizeMode,
|
|
@@ -48,15 +38,14 @@ export const useFilePreview = ({
|
|
|
48
38
|
allowAnimated: true
|
|
49
39
|
}), [requestDimensions, identifier.collectionName, resizeMode]);
|
|
50
40
|
const getSSRPreview = (ssr, identifier, mediaClient) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if ((_ssrDataRef$current = ssrDataRef.current) !== null && _ssrDataRef$current !== void 0 && _ssrDataRef$current.error) {
|
|
41
|
+
const ssrData = getSSRData(identifier);
|
|
42
|
+
if (ssrData !== null && ssrData !== void 0 && ssrData.error) {
|
|
54
43
|
ssrReliabilityRef.current.server = {
|
|
55
44
|
status: 'fail',
|
|
56
|
-
...
|
|
45
|
+
...ssrData.error
|
|
57
46
|
};
|
|
58
47
|
}
|
|
59
|
-
if (!(
|
|
48
|
+
if (!(ssrData !== null && ssrData !== void 0 && ssrData.dataURI)) {
|
|
60
49
|
try {
|
|
61
50
|
return getSSRCardPreview(ssr, mediaClient, identifier.id, imageURLParams, mediaBlobUrlAttrs);
|
|
62
51
|
} catch (e) {
|
|
@@ -69,7 +58,7 @@ export const useFilePreview = ({
|
|
|
69
58
|
const {
|
|
70
59
|
dimensions,
|
|
71
60
|
dataURI
|
|
72
|
-
} =
|
|
61
|
+
} = ssrData;
|
|
73
62
|
return {
|
|
74
63
|
dataURI,
|
|
75
64
|
dimensions,
|
|
@@ -97,17 +86,9 @@ export const useFilePreview = ({
|
|
|
97
86
|
collectionName: identifier.collectionName,
|
|
98
87
|
occurrenceKey: identifier.occurrenceKey
|
|
99
88
|
});
|
|
100
|
-
|
|
101
|
-
//----------------------------------------------------------------//
|
|
102
|
-
//------------ State, Refs & Initial Values ----------------------//
|
|
103
|
-
//----------------------------------------------------------------//
|
|
104
|
-
|
|
105
|
-
const [status, setStatus] = useState('loading');
|
|
106
89
|
useEffect(() => {
|
|
107
90
|
setStatus('loading');
|
|
108
91
|
}, [identifier]);
|
|
109
|
-
const [isBannedLocalPreview, setIsBannedLocalPreview] = useState(false);
|
|
110
|
-
const wasResolvedUpfrontPreviewRef = useRef(false);
|
|
111
92
|
|
|
112
93
|
//----------------------------------------------------------------//
|
|
113
94
|
//---------------------- Helper Functions -----------------------//
|
|
@@ -515,4 +496,12 @@ const createRequestDimensions = dimensions => {
|
|
|
515
496
|
result.height = height * retinaFactor;
|
|
516
497
|
}
|
|
517
498
|
return result;
|
|
499
|
+
};
|
|
500
|
+
const initialSsrReliability = {
|
|
501
|
+
server: {
|
|
502
|
+
status: 'unknown'
|
|
503
|
+
},
|
|
504
|
+
client: {
|
|
505
|
+
status: 'unknown'
|
|
506
|
+
}
|
|
518
507
|
};
|
|
@@ -37,7 +37,7 @@ export default class MediaInlineCardLoader extends React.PureComponent {
|
|
|
37
37
|
} = this.state;
|
|
38
38
|
const analyticsContext = {
|
|
39
39
|
packageVersion: "@atlaskit/media-card",
|
|
40
|
-
packageName: "77.4.
|
|
40
|
+
packageName: "77.4.10",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -2,13 +2,10 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
/**@jsx jsx */
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { wrapperStyles } from './styles';
|
|
5
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
6
5
|
export const Wrapper = props => {
|
|
7
|
-
const theme = useGlobalTheme();
|
|
8
6
|
return jsx("div", _extends({
|
|
9
7
|
css: wrapperStyles({
|
|
10
|
-
dimensions: props.dimensions
|
|
11
|
-
theme: theme
|
|
8
|
+
dimensions: props.dimensions
|
|
12
9
|
})
|
|
13
10
|
}, props), props.children);
|
|
14
11
|
};
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { center, borderRadius } from '@atlaskit/media-ui';
|
|
3
|
-
import {
|
|
4
|
-
import { N20, DN50, N50, DN100 } from '@atlaskit/theme/colors';
|
|
3
|
+
import { N20, N50 } from '@atlaskit/theme/colors';
|
|
5
4
|
export const wrapperStyles = ({
|
|
6
|
-
dimensions
|
|
7
|
-
theme
|
|
5
|
+
dimensions
|
|
8
6
|
}) => css`
|
|
9
7
|
${center}
|
|
10
|
-
background: ${
|
|
11
|
-
|
|
12
|
-
dark: `var(--ds-background-neutral, ${DN50})`
|
|
13
|
-
})({
|
|
14
|
-
theme
|
|
15
|
-
})};
|
|
16
|
-
color: ${themed({
|
|
17
|
-
light: `var(--ds-icon, ${N50})`,
|
|
18
|
-
dark: `var(--ds-icon, ${DN100})`
|
|
19
|
-
})({
|
|
20
|
-
theme
|
|
21
|
-
})};
|
|
8
|
+
background: ${`var(--ds-background-neutral, ${N20})`};
|
|
9
|
+
color: ${`var(--ds-icon, ${N50})`};
|
|
22
10
|
${borderRadius}
|
|
23
11
|
max-height: 100%;
|
|
24
12
|
max-width: 100%;
|
|
@@ -4,7 +4,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
4
4
|
import { MediaCardError } from '../errors';
|
|
5
5
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
6
6
|
const packageName = "@atlaskit/media-card";
|
|
7
|
-
const packageVersion = "77.4.
|
|
7
|
+
const packageVersion = "77.4.10";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
package/dist/esm/card/card.js
CHANGED
|
@@ -40,7 +40,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
40
40
|
import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '../utils/ufoExperiences';
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
var packageName = "@atlaskit/media-card";
|
|
43
|
-
var packageVersion = "77.4.
|
|
43
|
+
var packageVersion = "77.4.10";
|
|
44
44
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
45
45
|
_inherits(CardBase, _Component);
|
|
46
46
|
var _super = _createSuper(CardBase);
|
|
@@ -83,7 +83,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
83
83
|
}(React.Component);
|
|
84
84
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
85
85
|
var packageName = "@atlaskit/media-card";
|
|
86
|
-
var packageVersion = "77.4.
|
|
86
|
+
var packageVersion = "77.4.10";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -4,7 +4,6 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import { responsiveSettings, getTitleBoxHeight, Breakpoint } from '../common';
|
|
5
5
|
import { N0, N800 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { rgba } from '../styles';
|
|
7
|
-
import { themed } from '@atlaskit/theme/components';
|
|
8
7
|
var generateResponsiveStyles = function generateResponsiveStyles() {
|
|
9
8
|
var breakpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Breakpoint.SMALL;
|
|
10
9
|
var setting = responsiveSettings[breakpoint];
|
|
@@ -14,25 +13,10 @@ var generateResponsiveStyles = function generateResponsiveStyles() {
|
|
|
14
13
|
return "height: ".concat(height, "px;\n padding: ").concat(verticalPadding, "px ").concat(horizontalPadding, "px;");
|
|
15
14
|
};
|
|
16
15
|
var HEX_REGEX = /^#[0-9A-F]{6}$/i;
|
|
17
|
-
var BACKGROUND_COLOR_DARK = '#161a1d';
|
|
18
|
-
var TEXT_COLOR_DARK = '#C7D1DB';
|
|
19
16
|
export var titleBoxWrapperStyles = function titleBoxWrapperStyles(_ref) {
|
|
20
17
|
var breakpoint = _ref.breakpoint,
|
|
21
|
-
titleBoxBgColor = _ref.titleBoxBgColor
|
|
22
|
-
|
|
23
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 0;\n width: 100%;\n background-color: ", ";\n color: ", ";\n cursor: inherit;\n pointer-events: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ", "\n"])), themed({
|
|
24
|
-
light: "var(--ds-surface, ".concat(rgba(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : N0, 1), ")"),
|
|
25
|
-
dark: "var(--ds-surface, ".concat(rgba(
|
|
26
|
-
// theme does not contain this color, use constant instead
|
|
27
|
-
titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : BACKGROUND_COLOR_DARK, 1), ")")
|
|
28
|
-
})({
|
|
29
|
-
theme: theme
|
|
30
|
-
}), themed({
|
|
31
|
-
light: "var(--ds-text, ".concat(N800, ")"),
|
|
32
|
-
dark: "var(--ds-text, ".concat(TEXT_COLOR_DARK, ")")
|
|
33
|
-
})({
|
|
34
|
-
theme: theme
|
|
35
|
-
}), generateResponsiveStyles(breakpoint));
|
|
18
|
+
titleBoxBgColor = _ref.titleBoxBgColor;
|
|
19
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 0;\n width: 100%;\n background-color: ", ";\n color: ", ";\n cursor: inherit;\n pointer-events: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ", "\n"])), "var(--ds-surface, ".concat(rgba(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : N0, 1), ")"), "var(--ds-text, ".concat(N800, ")"), generateResponsiveStyles(breakpoint));
|
|
36
20
|
};
|
|
37
21
|
titleBoxWrapperStyles.displayName = 'TitleBoxWrapper';
|
|
38
22
|
var infoStyles = "white-space: nowrap;overflow: hidden;";
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { errorMessageWrapperStyles, titleBoxFooterStyles, titleBoxHeaderStyles, titleBoxIconStyles, titleBoxWrapperStyles } from './styles';
|
|
4
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
5
4
|
export var TitleBoxWrapper = function TitleBoxWrapper(props) {
|
|
6
5
|
var breakpoint = props.breakpoint,
|
|
7
6
|
titleBoxBgColor = props.titleBoxBgColor;
|
|
8
|
-
var theme = useGlobalTheme();
|
|
9
7
|
return jsx("div", {
|
|
10
8
|
id: "titleBoxWrapper",
|
|
11
9
|
"data-testid": "media-title-box",
|
|
12
10
|
css: titleBoxWrapperStyles({
|
|
13
11
|
breakpoint: breakpoint,
|
|
14
|
-
titleBoxBgColor: titleBoxBgColor
|
|
15
|
-
theme: theme
|
|
12
|
+
titleBoxBgColor: titleBoxBgColor
|
|
16
13
|
})
|
|
17
14
|
}, props.children);
|
|
18
15
|
};
|
|
@@ -5,12 +5,10 @@ import { fontFamily } from '@atlaskit/theme/constants';
|
|
|
5
5
|
import { borderRadius } from '@atlaskit/media-ui';
|
|
6
6
|
import { N20 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { hideNativeBrowserTextSelectionStyles } from '@atlaskit/editor-shared-styles/selection';
|
|
8
|
-
import { themed } from '@atlaskit/theme/components';
|
|
9
8
|
import { transition } from '../styles';
|
|
10
9
|
import { fixedBlanketStyles, blanketClassName } from '../blanket/styles';
|
|
11
10
|
import { fixedActionBarStyles, actionsBarClassName } from '../actionsBar/styles';
|
|
12
11
|
import { generateResponsiveStyles, getClickablePlayButtonStyles, getCursorStyle, getSelectableTickBoxStyles, getWrapperDimensions, getWrapperShadow } from '../styles';
|
|
13
|
-
var BACKGROUND_COLOR_DARK = '#22272C';
|
|
14
12
|
export var wrapperStyles = function wrapperStyles(_ref) {
|
|
15
13
|
var breakpoint = _ref.breakpoint,
|
|
16
14
|
dimensions = _ref.dimensions,
|
|
@@ -21,13 +19,7 @@ export var wrapperStyles = function wrapperStyles(_ref) {
|
|
|
21
19
|
isPlayButtonClickable = _ref.isPlayButtonClickable,
|
|
22
20
|
isTickBoxSelectable = _ref.isTickBoxSelectable,
|
|
23
21
|
shouldDisplayTooltip = _ref.shouldDisplayTooltip,
|
|
24
|
-
mediaCardCursor = _ref.mediaCardCursor
|
|
25
|
-
|
|
26
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n position: relative;\n font-family: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n\n /* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */\n ", "\n ", "\n &:hover .", " {\n ", "\n }\n &:hover .", " {\n ", "\n }\n\n /* Tooltip does not support percentage dimensions. We enforce them here */\n ", "\n"])), transition(), fontFamily(), getWrapperDimensions(dimensions, appearance), displayBackground && "background: ".concat(themed({
|
|
27
|
-
light: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
28
|
-
dark: "var(--ds-background-neutral, ".concat(BACKGROUND_COLOR_DARK, ")")
|
|
29
|
-
})({
|
|
30
|
-
theme: theme
|
|
31
|
-
}), ";"), borderRadius, getCursorStyle(mediaCardCursor), getWrapperShadow(disableOverlay, selected), generateResponsiveStyles(breakpoint), hideNativeBrowserTextSelectionStyles, getClickablePlayButtonStyles(isPlayButtonClickable), getSelectableTickBoxStyles(isTickBoxSelectable), blanketClassName, fixedBlanketStyles, actionsBarClassName, fixedActionBarStyles, shouldDisplayTooltip && "> div { width: 100%; height: 100%; }");
|
|
22
|
+
mediaCardCursor = _ref.mediaCardCursor;
|
|
23
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n position: relative;\n font-family: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n\n /* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */\n ", "\n ", "\n &:hover .", " {\n ", "\n }\n &:hover .", " {\n ", "\n }\n\n /* Tooltip does not support percentage dimensions. We enforce them here */\n ", "\n"])), transition(), fontFamily(), getWrapperDimensions(dimensions, appearance), displayBackground && "background: ".concat("var(--ds-background-neutral, ".concat(N20, ")"), ";"), borderRadius, getCursorStyle(mediaCardCursor), getWrapperShadow(disableOverlay, selected), generateResponsiveStyles(breakpoint), hideNativeBrowserTextSelectionStyles, getClickablePlayButtonStyles(isPlayButtonClickable), getSelectableTickBoxStyles(isTickBoxSelectable), blanketClassName, fixedBlanketStyles, actionsBarClassName, fixedActionBarStyles, shouldDisplayTooltip && "> div { width: 100%; height: 100%; }");
|
|
32
24
|
};
|
|
33
25
|
wrapperStyles.displayName = 'NewFileExperienceWrapper';
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { newFileExperienceClassName } from '../../cardConstants';
|
|
4
4
|
import { wrapperStyles } from './styles';
|
|
5
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
6
5
|
export var Wrapper = function Wrapper(props) {
|
|
7
6
|
var testId = props.testId,
|
|
8
7
|
dimensions = props.dimensions,
|
|
@@ -18,7 +17,6 @@ export var Wrapper = function Wrapper(props) {
|
|
|
18
17
|
isPlayButtonClickable = props.isPlayButtonClickable,
|
|
19
18
|
isTickBoxSelectable = props.isTickBoxSelectable,
|
|
20
19
|
shouldDisplayTooltip = props.shouldDisplayTooltip;
|
|
21
|
-
var theme = useGlobalTheme();
|
|
22
20
|
return jsx("div", {
|
|
23
21
|
id: "newFileExperienceWrapper",
|
|
24
22
|
className: newFileExperienceClassName,
|
|
@@ -33,8 +31,7 @@ export var Wrapper = function Wrapper(props) {
|
|
|
33
31
|
isPlayButtonClickable: isPlayButtonClickable,
|
|
34
32
|
isTickBoxSelectable: isTickBoxSelectable,
|
|
35
33
|
shouldDisplayTooltip: shouldDisplayTooltip,
|
|
36
|
-
mediaCardCursor: mediaCardCursor
|
|
37
|
-
theme: theme
|
|
34
|
+
mediaCardCursor: mediaCardCursor
|
|
38
35
|
}),
|
|
39
36
|
ref: innerRef,
|
|
40
37
|
onClick: onClick,
|
|
@@ -9,7 +9,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
9
9
|
import { ExternalImageCard } from './externalImageCard';
|
|
10
10
|
import { FileCard } from './fileCard';
|
|
11
11
|
var packageName = "@atlaskit/media-card";
|
|
12
|
-
var packageVersion = "77.4.
|
|
12
|
+
var packageVersion = "77.4.10";
|
|
13
13
|
export var CardV2Base = function CardV2Base(_ref) {
|
|
14
14
|
var identifier = _ref.identifier,
|
|
15
15
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -30,31 +30,27 @@ export var useFilePreview = function useFilePreview(_ref) {
|
|
|
30
30
|
skipRemote = _ref.skipRemote,
|
|
31
31
|
mediaBlobUrlAttrs = _ref.mediaBlobUrlAttrs;
|
|
32
32
|
var mediaClient = useMediaClient();
|
|
33
|
-
var _useState = useState(),
|
|
33
|
+
var _useState = useState('loading'),
|
|
34
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
status = _useState2[0],
|
|
36
|
+
setStatus = _useState2[1];
|
|
37
37
|
var _useState3 = useState(),
|
|
38
38
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
error = _useState4[0],
|
|
40
|
+
setError = _useState4[1];
|
|
41
|
+
var _useState5 = useState(),
|
|
42
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
43
|
+
nonCriticalError = _useState6[0],
|
|
44
|
+
setNonCriticalError = _useState6[1];
|
|
45
|
+
var _useState7 = useState(false),
|
|
46
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
47
|
+
isBannedLocalPreview = _useState8[0],
|
|
48
|
+
setIsBannedLocalPreview = _useState8[1];
|
|
49
|
+
var wasResolvedUpfrontPreviewRef = useRef(false);
|
|
50
|
+
var ssrReliabilityRef = useRef(initialSsrReliability);
|
|
41
51
|
var requestDimensions = useMemo(function () {
|
|
42
52
|
return dimensions ? createRequestDimensions(dimensions) : undefined;
|
|
43
53
|
}, [dimensions]);
|
|
44
|
-
|
|
45
|
-
//----------------------------------------------------------------//
|
|
46
|
-
//---------------- State Initializer Functions -------------------//
|
|
47
|
-
//----------------------------------------------------------------//
|
|
48
|
-
|
|
49
|
-
var ssrDataRef = useRef();
|
|
50
|
-
var ssrReliabilityRef = useRef({
|
|
51
|
-
server: {
|
|
52
|
-
status: 'unknown'
|
|
53
|
-
},
|
|
54
|
-
client: {
|
|
55
|
-
status: 'unknown'
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
54
|
var imageURLParams = useMemo(function () {
|
|
59
55
|
return _objectSpread(_objectSpread({
|
|
60
56
|
collection: identifier.collectionName,
|
|
@@ -64,14 +60,13 @@ export var useFilePreview = function useFilePreview(_ref) {
|
|
|
64
60
|
});
|
|
65
61
|
}, [requestDimensions, identifier.collectionName, resizeMode]);
|
|
66
62
|
var getSSRPreview = function getSSRPreview(ssr, identifier, mediaClient) {
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
if ((_ssrDataRef$current = ssrDataRef.current) !== null && _ssrDataRef$current !== void 0 && _ssrDataRef$current.error) {
|
|
63
|
+
var ssrData = getSSRData(identifier);
|
|
64
|
+
if (ssrData !== null && ssrData !== void 0 && ssrData.error) {
|
|
70
65
|
ssrReliabilityRef.current.server = _objectSpread({
|
|
71
66
|
status: 'fail'
|
|
72
|
-
},
|
|
67
|
+
}, ssrData.error);
|
|
73
68
|
}
|
|
74
|
-
if (!(
|
|
69
|
+
if (!(ssrData !== null && ssrData !== void 0 && ssrData.dataURI)) {
|
|
75
70
|
try {
|
|
76
71
|
return getSSRCardPreview(ssr, mediaClient, identifier.id, imageURLParams, mediaBlobUrlAttrs);
|
|
77
72
|
} catch (e) {
|
|
@@ -80,9 +75,8 @@ export var useFilePreview = function useFilePreview(_ref) {
|
|
|
80
75
|
}, extractErrorInfo(e));
|
|
81
76
|
}
|
|
82
77
|
} else {
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
dataURI = _ssrDataRef$current3.dataURI;
|
|
78
|
+
var _dimensions = ssrData.dimensions,
|
|
79
|
+
dataURI = ssrData.dataURI;
|
|
86
80
|
return {
|
|
87
81
|
dataURI: dataURI,
|
|
88
82
|
dimensions: _dimensions,
|
|
@@ -100,33 +94,19 @@ export var useFilePreview = function useFilePreview(_ref) {
|
|
|
100
94
|
}
|
|
101
95
|
return cardPreview;
|
|
102
96
|
};
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
cardPreview =
|
|
106
|
-
setCardPreview =
|
|
97
|
+
var _useState9 = useState(cardPreviewInitializer),
|
|
98
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
99
|
+
cardPreview = _useState10[0],
|
|
100
|
+
setCardPreview = _useState10[1];
|
|
107
101
|
var _useFileState = useFileState(identifier.id, {
|
|
108
102
|
skipRemote: skipRemote,
|
|
109
103
|
collectionName: identifier.collectionName,
|
|
110
104
|
occurrenceKey: identifier.occurrenceKey
|
|
111
105
|
}),
|
|
112
106
|
fileState = _useFileState.fileState;
|
|
113
|
-
|
|
114
|
-
//----------------------------------------------------------------//
|
|
115
|
-
//------------ State, Refs & Initial Values ----------------------//
|
|
116
|
-
//----------------------------------------------------------------//
|
|
117
|
-
|
|
118
|
-
var _useState7 = useState('loading'),
|
|
119
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
120
|
-
status = _useState8[0],
|
|
121
|
-
setStatus = _useState8[1];
|
|
122
107
|
useEffect(function () {
|
|
123
108
|
setStatus('loading');
|
|
124
109
|
}, [identifier]);
|
|
125
|
-
var _useState9 = useState(false),
|
|
126
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
127
|
-
isBannedLocalPreview = _useState10[0],
|
|
128
|
-
setIsBannedLocalPreview = _useState10[1];
|
|
129
|
-
var wasResolvedUpfrontPreviewRef = useRef(false);
|
|
130
110
|
|
|
131
111
|
//----------------------------------------------------------------//
|
|
132
112
|
//---------------------- Helper Functions -----------------------//
|
|
@@ -599,4 +579,12 @@ var createRequestDimensions = function createRequestDimensions(dimensions) {
|
|
|
599
579
|
result.height = height * retinaFactor;
|
|
600
580
|
}
|
|
601
581
|
return result;
|
|
582
|
+
};
|
|
583
|
+
var initialSsrReliability = {
|
|
584
|
+
server: {
|
|
585
|
+
status: 'unknown'
|
|
586
|
+
},
|
|
587
|
+
client: {
|
|
588
|
+
status: 'unknown'
|
|
589
|
+
}
|
|
602
590
|
};
|
|
@@ -103,7 +103,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
103
103
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
104
104
|
var analyticsContext = {
|
|
105
105
|
packageVersion: "@atlaskit/media-card",
|
|
106
|
-
packageName: "77.4.
|
|
106
|
+
packageName: "77.4.10",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -2,13 +2,10 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
/**@jsx jsx */
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { wrapperStyles } from './styles';
|
|
5
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
6
5
|
export var Wrapper = function Wrapper(props) {
|
|
7
|
-
var theme = useGlobalTheme();
|
|
8
6
|
return jsx("div", _extends({
|
|
9
7
|
css: wrapperStyles({
|
|
10
|
-
dimensions: props.dimensions
|
|
11
|
-
theme: theme
|
|
8
|
+
dimensions: props.dimensions
|
|
12
9
|
})
|
|
13
10
|
}, props), props.children);
|
|
14
11
|
};
|
|
@@ -2,20 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { center, borderRadius } from '@atlaskit/media-ui';
|
|
5
|
-
import {
|
|
6
|
-
import { N20, DN50, N50, DN100 } from '@atlaskit/theme/colors';
|
|
5
|
+
import { N20, N50 } from '@atlaskit/theme/colors';
|
|
7
6
|
export var wrapperStyles = function wrapperStyles(_ref) {
|
|
8
|
-
var dimensions = _ref.dimensions
|
|
9
|
-
|
|
10
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n background: ", ";\n color: ", ";\n ", "\n max-height: 100%;\n max-width: 100%;\n width: ", ";\n height: ", ";\n"])), center, themed({
|
|
11
|
-
light: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
12
|
-
dark: "var(--ds-background-neutral, ".concat(DN50, ")")
|
|
13
|
-
})({
|
|
14
|
-
theme: theme
|
|
15
|
-
}), themed({
|
|
16
|
-
light: "var(--ds-icon, ".concat(N50, ")"),
|
|
17
|
-
dark: "var(--ds-icon, ".concat(DN100, ")")
|
|
18
|
-
})({
|
|
19
|
-
theme: theme
|
|
20
|
-
}), borderRadius, dimensions.width, dimensions.height);
|
|
7
|
+
var dimensions = _ref.dimensions;
|
|
8
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n background: ", ";\n color: ", ";\n ", "\n max-height: 100%;\n max-width: 100%;\n width: ", ";\n height: ", ";\n"])), center, "var(--ds-background-neutral, ".concat(N20, ")"), "var(--ds-icon, ".concat(N50, ")"), borderRadius, dimensions.width, dimensions.height);
|
|
21
9
|
};
|
|
@@ -7,7 +7,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
7
7
|
import { MediaCardError } from '../errors';
|
|
8
8
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
9
9
|
var packageName = "@atlaskit/media-card";
|
|
10
|
-
var packageVersion = "77.4.
|
|
10
|
+
var packageVersion = "77.4.10";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TitleBoxFooterProps, TitleBoxHeaderProps, TitleBoxWrapperProps } from './types';
|
|
2
2
|
export declare const titleBoxWrapperStyles: {
|
|
3
|
-
({ breakpoint, titleBoxBgColor,
|
|
3
|
+
({ breakpoint, titleBoxBgColor, }: TitleBoxWrapperProps): import("@emotion/react").SerializedStyles;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export declare const titleBoxHeaderStyles: {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { MessageDescriptor } from 'react-intl-next';
|
|
3
3
|
import { Breakpoint } from '../common';
|
|
4
4
|
import { TitleBoxIcon as TitleBoxIconType } from '../../../types';
|
|
5
|
-
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
6
5
|
export type TitleBoxProps = {
|
|
7
6
|
name: string;
|
|
8
7
|
breakpoint: Breakpoint;
|
|
@@ -17,7 +16,6 @@ export type TitleBoxWrapperProps = {
|
|
|
17
16
|
breakpoint: Breakpoint;
|
|
18
17
|
titleBoxBgColor?: string;
|
|
19
18
|
children?: JSX.Element | JSX.Element[] | any;
|
|
20
|
-
theme?: GlobalThemeTokens;
|
|
21
19
|
};
|
|
22
20
|
export type TitleBoxFooterProps = {
|
|
23
21
|
hasIconOverlap: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WrapperProps } from './types';
|
|
2
2
|
export declare const wrapperStyles: {
|
|
3
|
-
({ breakpoint, dimensions, appearance, disableOverlay, displayBackground, selected, isPlayButtonClickable, isTickBoxSelectable, shouldDisplayTooltip, mediaCardCursor,
|
|
3
|
+
({ breakpoint, dimensions, appearance, disableOverlay, displayBackground, selected, isPlayButtonClickable, isTickBoxSelectable, shouldDisplayTooltip, mediaCardCursor, }: WrapperProps): import("@emotion/react").SerializedStyles;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -3,7 +3,6 @@ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
3
3
|
import { CardDimensions, CardAppearance } from '../../../types';
|
|
4
4
|
import { Breakpoint } from '../common';
|
|
5
5
|
import { MediaCardCursor } from '../../../types';
|
|
6
|
-
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
7
6
|
export interface WrapperProps {
|
|
8
7
|
testId?: string;
|
|
9
8
|
breakpoint: Breakpoint;
|
|
@@ -21,5 +20,4 @@ export interface WrapperProps {
|
|
|
21
20
|
shouldDisplayTooltip: boolean;
|
|
22
21
|
innerRef?: RefObject<HTMLDivElement>;
|
|
23
22
|
children?: JSX.Element;
|
|
24
|
-
theme?: GlobalThemeTokens;
|
|
25
23
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { WrapperProps } from './types';
|
|
2
|
-
export declare const wrapperStyles: ({ dimensions
|
|
2
|
+
export declare const wrapperStyles: ({ dimensions }: WrapperProps) => import("@emotion/react").SerializedStyles;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardDimensions } from '../../types';
|
|
3
3
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
4
|
-
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
5
4
|
export interface StaticCardProps {
|
|
6
5
|
dimensions?: CardDimensions;
|
|
7
6
|
testId?: string;
|
|
@@ -11,5 +10,4 @@ export interface WrapperProps {
|
|
|
11
10
|
dimensions: CardDimensions;
|
|
12
11
|
testId?: string;
|
|
13
12
|
children?: JSX.Element;
|
|
14
|
-
theme?: GlobalThemeTokens;
|
|
15
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TitleBoxFooterProps, TitleBoxHeaderProps, TitleBoxWrapperProps } from './types';
|
|
2
2
|
export declare const titleBoxWrapperStyles: {
|
|
3
|
-
({ breakpoint, titleBoxBgColor,
|
|
3
|
+
({ breakpoint, titleBoxBgColor, }: TitleBoxWrapperProps): import("@emotion/react").SerializedStyles;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export declare const titleBoxHeaderStyles: {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { MessageDescriptor } from 'react-intl-next';
|
|
3
3
|
import { Breakpoint } from '../common';
|
|
4
4
|
import { TitleBoxIcon as TitleBoxIconType } from '../../../types';
|
|
5
|
-
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
6
5
|
export type TitleBoxProps = {
|
|
7
6
|
name: string;
|
|
8
7
|
breakpoint: Breakpoint;
|
|
@@ -17,7 +16,6 @@ export type TitleBoxWrapperProps = {
|
|
|
17
16
|
breakpoint: Breakpoint;
|
|
18
17
|
titleBoxBgColor?: string;
|
|
19
18
|
children?: JSX.Element | JSX.Element[] | any;
|
|
20
|
-
theme?: GlobalThemeTokens;
|
|
21
19
|
};
|
|
22
20
|
export type TitleBoxFooterProps = {
|
|
23
21
|
hasIconOverlap: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WrapperProps } from './types';
|
|
2
2
|
export declare const wrapperStyles: {
|
|
3
|
-
({ breakpoint, dimensions, appearance, disableOverlay, displayBackground, selected, isPlayButtonClickable, isTickBoxSelectable, shouldDisplayTooltip, mediaCardCursor,
|
|
3
|
+
({ breakpoint, dimensions, appearance, disableOverlay, displayBackground, selected, isPlayButtonClickable, isTickBoxSelectable, shouldDisplayTooltip, mediaCardCursor, }: WrapperProps): import("@emotion/react").SerializedStyles;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -3,7 +3,6 @@ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
3
3
|
import { CardDimensions, CardAppearance } from '../../../types';
|
|
4
4
|
import { Breakpoint } from '../common';
|
|
5
5
|
import { MediaCardCursor } from '../../../types';
|
|
6
|
-
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
7
6
|
export interface WrapperProps {
|
|
8
7
|
testId?: string;
|
|
9
8
|
breakpoint: Breakpoint;
|
|
@@ -21,5 +20,4 @@ export interface WrapperProps {
|
|
|
21
20
|
shouldDisplayTooltip: boolean;
|
|
22
21
|
innerRef?: RefObject<HTMLDivElement>;
|
|
23
22
|
children?: JSX.Element;
|
|
24
|
-
theme?: GlobalThemeTokens;
|
|
25
23
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { WrapperProps } from './types';
|
|
2
|
-
export declare const wrapperStyles: ({ dimensions
|
|
2
|
+
export declare const wrapperStyles: ({ dimensions }: WrapperProps) => import("@emotion/react").SerializedStyles;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardDimensions } from '../../types';
|
|
3
3
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
4
|
-
import { GlobalThemeTokens } from '@atlaskit/theme/components';
|
|
5
4
|
export interface StaticCardProps {
|
|
6
5
|
dimensions?: CardDimensions;
|
|
7
6
|
testId?: string;
|
|
@@ -11,5 +10,4 @@ export interface WrapperProps {
|
|
|
11
10
|
dimensions: CardDimensions;
|
|
12
11
|
testId?: string;
|
|
13
12
|
children?: JSX.Element;
|
|
14
|
-
theme?: GlobalThemeTokens;
|
|
15
13
|
}
|
package/package.json
CHANGED