@atlaskit/media-card 77.12.0 → 77.12.1
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 +8 -0
- package/dist/cjs/card/card.js +5 -5
- package/dist/cjs/card/inlinePlayerWrapperStyles.js +1 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/wrapper/styles.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/fileCard.js +1 -1
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +11 -11
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +5 -5
- package/dist/es2019/card/inlinePlayerWrapperStyles.js +12 -12
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/wrapper/styles.js +21 -21
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/card/v2/fileCard.js +1 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +11 -11
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +5 -5
- package/dist/esm/card/inlinePlayerWrapperStyles.js +1 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/wrapper/styles.js +1 -1
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/card/v2/fileCard.js +1 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +11 -11
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/ui/iconWrapper/styles.d.ts +1 -1
- package/dist/types/card/ui/titleBox/styles.d.ts +1 -1
- package/dist/types/utils/preventClickThrough.d.ts +1 -1
- package/dist/types/utils/viewportDetector.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/iconWrapper/styles.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/titleBox/styles.d.ts +1 -1
- package/dist/types-ts4.5/utils/preventClickThrough.d.ts +1 -1
- package/dist/types-ts4.5/utils/viewportDetector.d.ts +1 -1
- package/example-helpers/DelayedRender.tsx +19 -19
- package/example-helpers/cardViewWrapper.tsx +18 -22
- package/example-helpers/cards.tsx +268 -331
- package/example-helpers/developmentUseMessage.tsx +8 -9
- package/example-helpers/index.tsx +100 -124
- package/example-helpers/selectableCard.tsx +32 -35
- package/example-helpers/ssrHelpers.tsx +19 -29
- package/example-helpers/styles.ts +73 -73
- package/example-helpers/svg-helpers/cardContainer.tsx +15 -21
- package/example-helpers/svg-helpers/controls.tsx +11 -11
- package/example-helpers/svg-helpers/dimensionPicker.tsx +85 -93
- package/example-helpers/svg-helpers/svgContainer.tsx +18 -18
- package/example-helpers/svg-helpers/toggle.tsx +28 -29
- package/example-helpers/svg-helpers/uploader.ts +33 -33
- package/package.json +5 -5
- package/report.api.md +227 -232
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 77.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#109692](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109692)
|
|
8
|
+
[`e947830ffb91c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e947830ffb91c) -
|
|
9
|
+
Updated feature flag key for SVG rendering
|
|
10
|
+
|
|
3
11
|
## 77.12.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -50,7 +50,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
50
50
|
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); }; }
|
|
51
51
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
52
52
|
var packageName = "@atlaskit/media-card";
|
|
53
|
-
var packageVersion = "77.12.
|
|
53
|
+
var packageVersion = "77.12.1";
|
|
54
54
|
var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
|
|
55
55
|
(0, _inherits2.default)(CardBase, _Component);
|
|
56
56
|
var _super = _createSuper(CardBase);
|
|
@@ -290,8 +290,8 @@ var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
/*
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
If the cardPreview failed and it comes from server (global scope / ssrData), it means that we have reused it in client and the error counts for both: server & client.
|
|
294
|
+
*/
|
|
295
295
|
|
|
296
296
|
if ((0, _getCardPreview.isSSRDataPreview)(cardPreview)) {
|
|
297
297
|
_this.ssrReliability.server = failedSSRObject;
|
|
@@ -339,8 +339,8 @@ var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
/*
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
If the image loads successfully and it comes from server (global scope / ssrData), it means that we have reused it in client and the success counts for both: server & client.
|
|
343
|
+
*/
|
|
344
344
|
|
|
345
345
|
if ((0, _getCardPreview.isSSRDataPreview)(cardPreview) && _this.ssrReliability.server.status === 'unknown') {
|
|
346
346
|
_this.ssrReliability.server = {
|
|
@@ -23,6 +23,6 @@ var inlinePlayerClassName = exports.inlinePlayerClassName = 'media-card-inline-p
|
|
|
23
23
|
var inlinePlayerWrapperStyles = exports.inlinePlayerWrapperStyles = function inlinePlayerWrapperStyles(_ref2) {
|
|
24
24
|
var dimensions = _ref2.dimensions,
|
|
25
25
|
selected = _ref2.selected;
|
|
26
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n
|
|
26
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\twidth: ", ";\n\theight: ", ";\n\toverflow: hidden;\n\tborder-radius: ", "px;\n\tposition: relative;\n\tmax-width: 100%;\n\tmax-height: 100%;\n\n\t", "\n\n\tvideo {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n"])), (0, _getDimensionsWithDefault.getDimensionsWithDefault)(dimensions).width || '100%', (0, _getDimensionsWithDefault.getDimensionsWithDefault)(dimensions).height || 'auto', (0, _constants.borderRadius)(), getSelectedBorderStyle(selected));
|
|
27
27
|
};
|
|
28
28
|
inlinePlayerWrapperStyles.displayName = 'InlinePlayerWrapper';
|
|
@@ -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.12.
|
|
93
|
+
var packageVersion = "77.12.1";
|
|
94
94
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
95
95
|
packageVersion: packageVersion,
|
|
96
96
|
packageName: packageName,
|
|
@@ -26,6 +26,6 @@ var wrapperStyles = exports.wrapperStyles = function wrapperStyles(_ref) {
|
|
|
26
26
|
isTickBoxSelectable = _ref.isTickBoxSelectable,
|
|
27
27
|
shouldDisplayTooltip = _ref.shouldDisplayTooltip,
|
|
28
28
|
mediaCardCursor = _ref.mediaCardCursor;
|
|
29
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n
|
|
29
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t", "\n\tbox-sizing: border-box;\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\tposition: relative;\n\tfont-family: ", ";\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\n\t/* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */\n ", "\n ", "\n &:hover .", " {\n\t\t", "\n\t}\n\t&:hover .", ", &:focus-within .", " {\n\t\t", "\n\t}\n\n\t/* Tooltip does not support percentage dimensions. We enforce them here */\n\t", "\n\n\tbutton:focus + & {\n\t\toutline: solid 2px ", ";\n\t}\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.actionsBarClassName, _styles3.fixedActionBarStyles, shouldDisplayTooltip && "> div { width: 100%; height: 100%; }", "var(--ds-border-focused, ".concat(_colors.B100, ")"));
|
|
30
30
|
};
|
|
31
31
|
wrapperStyles.displayName = 'NewFileExperienceWrapper';
|
|
@@ -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.12.
|
|
19
|
+
var packageVersion = "77.12.1";
|
|
20
20
|
var CardV2Base = exports.CardV2Base = function CardV2Base(_ref) {
|
|
21
21
|
var identifier = _ref.identifier,
|
|
22
22
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -449,7 +449,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
449
449
|
//----------------------------------------------------------------//
|
|
450
450
|
|
|
451
451
|
(0, _react.useEffect)(function () {
|
|
452
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.media-svg-
|
|
452
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.media-card-svg-rendering_6tdbv') &&
|
|
453
453
|
/**
|
|
454
454
|
* We need to check that the card is visible before switching to SVG
|
|
455
455
|
* in order to avoid race conditions of the ViewportDector being unmounted before
|
|
@@ -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.12.
|
|
122
|
+
packageName: "77.12.1",
|
|
123
123
|
componentName: 'mediaInlineCard',
|
|
124
124
|
component: 'mediaInlineCard'
|
|
125
125
|
};
|
|
@@ -33,17 +33,17 @@ var ErrorBoundaryComponent = function ErrorBoundaryComponent(_ref) {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
/* Note:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
- styling is borrowed from packages/media/media-ui/src/MediaInlineCard/Frame/styled.ts
|
|
37
|
+
- because we are not using styled components, we are not able to use themed(), here is the "themed" property of color and backgroundColor
|
|
38
|
+
color: `${themed({
|
|
39
|
+
light: token('color.text', N900),
|
|
40
|
+
dark: token('color.text', DN600),
|
|
41
|
+
})}`,
|
|
42
|
+
backgroundColor: `${themed({
|
|
43
|
+
light: token('color.background.neutral', N30A),
|
|
44
|
+
dark: token('color.background.neutral', DN80),
|
|
45
|
+
})}`,
|
|
46
|
+
*/
|
|
47
47
|
|
|
48
48
|
var style = _objectSpread({
|
|
49
49
|
lineHeight: '16px',
|
|
@@ -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.12.
|
|
17
|
+
var packageVersion = "77.12.1";
|
|
18
18
|
var concurrentExperience;
|
|
19
19
|
var getExperience = function getExperience(id) {
|
|
20
20
|
if (!concurrentExperience) {
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -28,7 +28,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
|
|
|
28
28
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
29
29
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
30
30
|
const packageName = "@atlaskit/media-card";
|
|
31
|
-
const packageVersion = "77.12.
|
|
31
|
+
const packageVersion = "77.12.1";
|
|
32
32
|
export class CardBase extends Component {
|
|
33
33
|
constructor(props) {
|
|
34
34
|
super(props);
|
|
@@ -220,8 +220,8 @@ export class CardBase extends Component {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
/*
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
If the cardPreview failed and it comes from server (global scope / ssrData), it means that we have reused it in client and the error counts for both: server & client.
|
|
224
|
+
*/
|
|
225
225
|
|
|
226
226
|
if (isSSRDataPreview(cardPreview)) {
|
|
227
227
|
this.ssrReliability.server = failedSSRObject;
|
|
@@ -272,8 +272,8 @@ export class CardBase extends Component {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
/*
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
If the image loads successfully and it comes from server (global scope / ssrData), it means that we have reused it in client and the success counts for both: server & client.
|
|
276
|
+
*/
|
|
277
277
|
|
|
278
278
|
if (isSSRDataPreview(cardPreview) && this.ssrReliability.server.status === 'unknown') {
|
|
279
279
|
this.ssrReliability.server = {
|
|
@@ -29,19 +29,19 @@ export const inlinePlayerWrapperStyles = ({
|
|
|
29
29
|
dimensions,
|
|
30
30
|
selected
|
|
31
31
|
}) => css`
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
width: ${getDimensionsWithDefault(dimensions).width || '100%'};
|
|
33
|
+
height: ${getDimensionsWithDefault(dimensions).height || 'auto'};
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
border-radius: ${borderRadius()}px;
|
|
36
|
+
position: relative;
|
|
37
|
+
max-width: 100%;
|
|
38
|
+
max-height: 100%;
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
${getSelectedBorderStyle(selected)}
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
video {
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
}
|
|
46
46
|
`;
|
|
47
47
|
inlinePlayerWrapperStyles.displayName = 'InlinePlayerWrapper';
|
|
@@ -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.12.
|
|
69
|
+
const packageVersion = "77.12.1";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -19,36 +19,36 @@ export const wrapperStyles = ({
|
|
|
19
19
|
shouldDisplayTooltip,
|
|
20
20
|
mediaCardCursor
|
|
21
21
|
}) => css`
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
${transition()}
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
* {
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
}
|
|
27
|
+
position: relative;
|
|
28
|
+
font-family: ${fontFamily()};
|
|
29
|
+
${getWrapperDimensions(dimensions, appearance)}
|
|
30
|
+
${displayBackground && `background: ${`var(--ds-background-neutral, ${N20})`};`}
|
|
31
31
|
${borderRadius}
|
|
32
32
|
${getCursorStyle(mediaCardCursor)}
|
|
33
33
|
${getWrapperShadow(disableOverlay, selected)}
|
|
34
34
|
${generateResponsiveStyles(breakpoint)};
|
|
35
|
-
|
|
35
|
+
${hideNativeBrowserTextSelectionStyles}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
/* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */
|
|
38
38
|
${getClickablePlayButtonStyles(isPlayButtonClickable)}
|
|
39
39
|
${getSelectableTickBoxStyles(isTickBoxSelectable)}
|
|
40
40
|
&:hover .${blanketClassName} {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
${fixedBlanketStyles}
|
|
42
|
+
}
|
|
43
|
+
&:hover .${actionsBarClassName}, &:focus-within .${actionsBarClassName} {
|
|
44
|
+
${fixedActionBarStyles}
|
|
45
|
+
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
/* Tooltip does not support percentage dimensions. We enforce them here */
|
|
48
|
+
${shouldDisplayTooltip && `> div { width: 100%; height: 100%; }`}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
button:focus + & {
|
|
51
|
+
outline: solid 2px ${`var(--ds-border-focused, ${B100})`};
|
|
52
|
+
}
|
|
53
53
|
`;
|
|
54
54
|
wrapperStyles.displayName = 'NewFileExperienceWrapper';
|
|
@@ -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.12.
|
|
10
|
+
const packageVersion = "77.12.1";
|
|
11
11
|
export const CardV2Base = ({
|
|
12
12
|
identifier,
|
|
13
13
|
...otherProps
|
|
@@ -400,7 +400,7 @@ export const FileCard = ({
|
|
|
400
400
|
//----------------------------------------------------------------//
|
|
401
401
|
|
|
402
402
|
useEffect(() => {
|
|
403
|
-
if (getBooleanFF('platform.media-svg-
|
|
403
|
+
if (getBooleanFF('platform.media-card-svg-rendering_6tdbv') &&
|
|
404
404
|
/**
|
|
405
405
|
* We need to check that the card is visible before switching to SVG
|
|
406
406
|
* in order to avoid race conditions of the ViewportDector being unmounted before
|
|
@@ -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.12.
|
|
40
|
+
packageName: "77.12.1",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -17,17 +17,17 @@ const ErrorBoundaryComponent = ({
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
/* Note:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
- styling is borrowed from packages/media/media-ui/src/MediaInlineCard/Frame/styled.ts
|
|
21
|
+
- because we are not using styled components, we are not able to use themed(), here is the "themed" property of color and backgroundColor
|
|
22
|
+
color: `${themed({
|
|
23
|
+
light: token('color.text', N900),
|
|
24
|
+
dark: token('color.text', DN600),
|
|
25
|
+
})}`,
|
|
26
|
+
backgroundColor: `${themed({
|
|
27
|
+
light: token('color.background.neutral', N30A),
|
|
28
|
+
dark: token('color.background.neutral', DN80),
|
|
29
|
+
})}`,
|
|
30
|
+
*/
|
|
31
31
|
|
|
32
32
|
const style = {
|
|
33
33
|
lineHeight: '16px',
|
|
@@ -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.12.
|
|
7
|
+
const packageVersion = "77.12.1";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
package/dist/esm/card/card.js
CHANGED
|
@@ -41,7 +41,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
|
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
43
43
|
var packageName = "@atlaskit/media-card";
|
|
44
|
-
var packageVersion = "77.12.
|
|
44
|
+
var packageVersion = "77.12.1";
|
|
45
45
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
46
46
|
_inherits(CardBase, _Component);
|
|
47
47
|
var _super = _createSuper(CardBase);
|
|
@@ -281,8 +281,8 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
/*
|
|
284
|
-
|
|
285
|
-
|
|
284
|
+
If the cardPreview failed and it comes from server (global scope / ssrData), it means that we have reused it in client and the error counts for both: server & client.
|
|
285
|
+
*/
|
|
286
286
|
|
|
287
287
|
if (isSSRDataPreview(cardPreview)) {
|
|
288
288
|
_this.ssrReliability.server = failedSSRObject;
|
|
@@ -330,8 +330,8 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
/*
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
If the image loads successfully and it comes from server (global scope / ssrData), it means that we have reused it in client and the success counts for both: server & client.
|
|
334
|
+
*/
|
|
335
335
|
|
|
336
336
|
if (isSSRDataPreview(cardPreview) && _this.ssrReliability.server.status === 'unknown') {
|
|
337
337
|
_this.ssrReliability.server = {
|
|
@@ -17,6 +17,6 @@ export var inlinePlayerClassName = 'media-card-inline-player';
|
|
|
17
17
|
export var inlinePlayerWrapperStyles = function inlinePlayerWrapperStyles(_ref2) {
|
|
18
18
|
var dimensions = _ref2.dimensions,
|
|
19
19
|
selected = _ref2.selected;
|
|
20
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
20
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\twidth: ", ";\n\theight: ", ";\n\toverflow: hidden;\n\tborder-radius: ", "px;\n\tposition: relative;\n\tmax-width: 100%;\n\tmax-height: 100%;\n\n\t", "\n\n\tvideo {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n"])), getDimensionsWithDefault(dimensions).width || '100%', getDimensionsWithDefault(dimensions).height || 'auto', borderRadius(), getSelectedBorderStyle(selected));
|
|
21
21
|
};
|
|
22
22
|
inlinePlayerWrapperStyles.displayName = 'InlinePlayerWrapper';
|
|
@@ -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.12.
|
|
86
|
+
var packageVersion = "77.12.1";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -20,6 +20,6 @@ export var wrapperStyles = function wrapperStyles(_ref) {
|
|
|
20
20
|
isTickBoxSelectable = _ref.isTickBoxSelectable,
|
|
21
21
|
shouldDisplayTooltip = _ref.shouldDisplayTooltip,
|
|
22
22
|
mediaCardCursor = _ref.mediaCardCursor;
|
|
23
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
23
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t", "\n\tbox-sizing: border-box;\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\tposition: relative;\n\tfont-family: ", ";\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\n\t/* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */\n ", "\n ", "\n &:hover .", " {\n\t\t", "\n\t}\n\t&:hover .", ", &:focus-within .", " {\n\t\t", "\n\t}\n\n\t/* Tooltip does not support percentage dimensions. We enforce them here */\n\t", "\n\n\tbutton:focus + & {\n\t\toutline: solid 2px ", ";\n\t}\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, actionsBarClassName, fixedActionBarStyles, shouldDisplayTooltip && "> div { width: 100%; height: 100%; }", "var(--ds-border-focused, ".concat(B100, ")"));
|
|
24
24
|
};
|
|
25
25
|
wrapperStyles.displayName = 'NewFileExperienceWrapper';
|
|
@@ -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.12.
|
|
12
|
+
var packageVersion = "77.12.1";
|
|
13
13
|
export var CardV2Base = function CardV2Base(_ref) {
|
|
14
14
|
var identifier = _ref.identifier,
|
|
15
15
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -440,7 +440,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
440
440
|
//----------------------------------------------------------------//
|
|
441
441
|
|
|
442
442
|
useEffect(function () {
|
|
443
|
-
if (getBooleanFF('platform.media-svg-
|
|
443
|
+
if (getBooleanFF('platform.media-card-svg-rendering_6tdbv') &&
|
|
444
444
|
/**
|
|
445
445
|
* We need to check that the card is visible before switching to SVG
|
|
446
446
|
* in order to avoid race conditions of the ViewportDector being unmounted before
|
|
@@ -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.12.
|
|
106
|
+
packageName: "77.12.1",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -26,17 +26,17 @@ var ErrorBoundaryComponent = function ErrorBoundaryComponent(_ref) {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
/* Note:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
- styling is borrowed from packages/media/media-ui/src/MediaInlineCard/Frame/styled.ts
|
|
30
|
+
- because we are not using styled components, we are not able to use themed(), here is the "themed" property of color and backgroundColor
|
|
31
|
+
color: `${themed({
|
|
32
|
+
light: token('color.text', N900),
|
|
33
|
+
dark: token('color.text', DN600),
|
|
34
|
+
})}`,
|
|
35
|
+
backgroundColor: `${themed({
|
|
36
|
+
light: token('color.background.neutral', N30A),
|
|
37
|
+
dark: token('color.background.neutral', DN80),
|
|
38
|
+
})}`,
|
|
39
|
+
*/
|
|
40
40
|
|
|
41
41
|
var style = _objectSpread({
|
|
42
42
|
lineHeight: '16px',
|
|
@@ -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.12.
|
|
10
|
+
var packageVersion = "77.12.1";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
|
@@ -2,6 +2,6 @@ import { type Breakpoint } from '../common';
|
|
|
2
2
|
import { type IconWrapperProps } from './types';
|
|
3
3
|
export declare function titleBoxHeight(hasTitleBox: boolean, breakpoint: Breakpoint): string;
|
|
4
4
|
export declare const iconWrapperStyles: {
|
|
5
|
-
({ hasTitleBox, breakpoint
|
|
5
|
+
({ hasTitleBox, breakpoint }: IconWrapperProps): import("@emotion/react").SerializedStyles;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TitleBoxFooterProps, type TitleBoxHeaderProps, type 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: {
|
|
@@ -3,6 +3,6 @@ import { type ReactNode } from 'react';
|
|
|
3
3
|
export type PreventClickThroughProps = {
|
|
4
4
|
readonly children?: ReactNode;
|
|
5
5
|
};
|
|
6
|
-
export declare function PreventClickThrough({ children
|
|
6
|
+
export declare function PreventClickThrough({ children }: PreventClickThroughProps): JSX.Element;
|
|
7
7
|
export type CreatePreventClickThrough = <T>(onClick: () => void) => (event: React.MouseEvent<T, MouseEvent>) => void;
|
|
8
8
|
export declare const createPreventClickThrough: CreatePreventClickThrough;
|
|
@@ -3,4 +3,4 @@ export type ViewportDetectorProps = PropsWithChildren<{
|
|
|
3
3
|
cardEl: HTMLElement | null;
|
|
4
4
|
onVisible: () => void;
|
|
5
5
|
}>;
|
|
6
|
-
export declare const ViewportDetector: ({ cardEl, onVisible, children
|
|
6
|
+
export declare const ViewportDetector: ({ cardEl, onVisible, children }: ViewportDetectorProps) => JSX.Element;
|
|
@@ -2,6 +2,6 @@ import { type Breakpoint } from '../common';
|
|
|
2
2
|
import { type IconWrapperProps } from './types';
|
|
3
3
|
export declare function titleBoxHeight(hasTitleBox: boolean, breakpoint: Breakpoint): string;
|
|
4
4
|
export declare const iconWrapperStyles: {
|
|
5
|
-
({ hasTitleBox, breakpoint
|
|
5
|
+
({ hasTitleBox, breakpoint }: IconWrapperProps): import("@emotion/react").SerializedStyles;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TitleBoxFooterProps, type TitleBoxHeaderProps, type 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: {
|
|
@@ -3,6 +3,6 @@ import { type ReactNode } from 'react';
|
|
|
3
3
|
export type PreventClickThroughProps = {
|
|
4
4
|
readonly children?: ReactNode;
|
|
5
5
|
};
|
|
6
|
-
export declare function PreventClickThrough({ children
|
|
6
|
+
export declare function PreventClickThrough({ children }: PreventClickThroughProps): JSX.Element;
|
|
7
7
|
export type CreatePreventClickThrough = <T>(onClick: () => void) => (event: React.MouseEvent<T, MouseEvent>) => void;
|
|
8
8
|
export declare const createPreventClickThrough: CreatePreventClickThrough;
|
|
@@ -3,4 +3,4 @@ export type ViewportDetectorProps = PropsWithChildren<{
|
|
|
3
3
|
cardEl: HTMLElement | null;
|
|
4
4
|
onVisible: () => void;
|
|
5
5
|
}>;
|
|
6
|
-
export declare const ViewportDetector: ({ cardEl, onVisible, children
|
|
6
|
+
export declare const ViewportDetector: ({ cardEl, onVisible, children }: ViewportDetectorProps) => JSX.Element;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
|
|
3
3
|
interface Props {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
timeout: number;
|
|
5
|
+
component: React.ElementType;
|
|
6
|
+
componentProps: { [key: string]: any };
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
interface State {
|
|
10
|
-
|
|
10
|
+
hidden: boolean;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export class DelayedRender extends Component<Props, State> {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
state: State = {
|
|
15
|
+
hidden: true,
|
|
16
|
+
};
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
componentDidMount() {
|
|
19
|
+
window.setTimeout(() => {
|
|
20
|
+
this.setState({ hidden: false });
|
|
21
|
+
}, this.props.timeout);
|
|
22
|
+
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
render() {
|
|
25
|
+
if (this.state.hidden) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const { component: Component, componentProps } = this.props;
|
|
29
|
+
return <Component {...componentProps} />;
|
|
30
|
+
}
|
|
31
31
|
}
|