@atlaskit/media-card 78.4.0 → 78.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/cardView.js +4 -4
- package/dist/cjs/card/fileCard.js +3 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/svgView/svgView.js +1 -1
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.js +4 -2
- package/dist/cjs/card/ui/cardSpinner/cardSpinner.js +159 -0
- package/dist/cjs/card/ui/cardSpinner/constants.js +13 -0
- package/dist/cjs/card/ui/cardSpinner/types.js +1 -0
- package/dist/cjs/card/ui/imageRenderer/imageRenderer.js +4 -4
- package/dist/cjs/card/ui/playButton/playButton.js +5 -2
- package/dist/cjs/card/ui/tickBox/tickBox.js +3 -2
- package/dist/cjs/card/ui/tickBox/tickBoxWrapper.js +3 -1
- package/dist/cjs/card/ui/titleBox/failedTitleBox.js +5 -4
- package/dist/cjs/card/ui/titleBox/styles.js +10 -1
- package/dist/cjs/card/ui/titleBox/titleBox.js +4 -3
- package/dist/cjs/card/ui/titleBox/titleBoxComponents.js +6 -3
- package/dist/cjs/card/ui/unhandledErrorCard/index.js +5 -4
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +7 -4
- package/dist/cjs/utils/lightCards/errorIcon/index.js +4 -3
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/cardView.js +4 -4
- package/dist/es2019/card/fileCard.js +3 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/svgView/svgView.js +1 -1
- package/dist/es2019/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.js +3 -1
- package/dist/es2019/card/ui/cardSpinner/cardSpinner.js +150 -0
- package/dist/es2019/card/ui/cardSpinner/constants.js +7 -0
- package/dist/es2019/card/ui/cardSpinner/types.js +0 -0
- package/dist/es2019/card/ui/imageRenderer/imageRenderer.js +4 -4
- package/dist/es2019/card/ui/playButton/playButton.js +5 -2
- package/dist/es2019/card/ui/tickBox/tickBox.js +2 -1
- package/dist/es2019/card/ui/tickBox/tickBoxWrapper.js +3 -1
- package/dist/es2019/card/ui/titleBox/failedTitleBox.js +4 -3
- package/dist/es2019/card/ui/titleBox/styles.js +9 -0
- package/dist/es2019/card/ui/titleBox/titleBox.js +3 -2
- package/dist/es2019/card/ui/titleBox/titleBoxComponents.js +7 -4
- package/dist/es2019/card/ui/unhandledErrorCard/index.js +4 -3
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +7 -4
- package/dist/es2019/utils/lightCards/errorIcon/index.js +3 -2
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/cardView.js +4 -4
- package/dist/esm/card/fileCard.js +3 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/svgView/svgView.js +1 -1
- package/dist/esm/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.js +3 -1
- package/dist/esm/card/ui/cardSpinner/cardSpinner.js +152 -0
- package/dist/esm/card/ui/cardSpinner/constants.js +7 -0
- package/dist/esm/card/ui/cardSpinner/types.js +0 -0
- package/dist/esm/card/ui/imageRenderer/imageRenderer.js +4 -4
- package/dist/esm/card/ui/playButton/playButton.js +5 -2
- package/dist/esm/card/ui/tickBox/tickBox.js +2 -1
- package/dist/esm/card/ui/tickBox/tickBoxWrapper.js +3 -1
- package/dist/esm/card/ui/titleBox/failedTitleBox.js +4 -3
- package/dist/esm/card/ui/titleBox/styles.js +9 -0
- package/dist/esm/card/ui/titleBox/titleBox.js +3 -2
- package/dist/esm/card/ui/titleBox/titleBoxComponents.js +7 -4
- package/dist/esm/card/ui/unhandledErrorCard/index.js +4 -3
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +7 -4
- package/dist/esm/utils/lightCards/errorIcon/index.js +3 -2
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/ui/cardSpinner/cardSpinner.d.ts +22 -0
- package/dist/types/card/ui/cardSpinner/constants.d.ts +4 -0
- package/dist/types/card/ui/cardSpinner/types.d.ts +36 -0
- package/dist/types/card/ui/imageRenderer/imageRenderer.d.ts +1 -1
- package/dist/types/card/ui/titleBox/styles.d.ts +1 -0
- package/dist/types-ts4.5/card/ui/cardSpinner/cardSpinner.d.ts +22 -0
- package/dist/types-ts4.5/card/ui/cardSpinner/constants.d.ts +4 -0
- package/dist/types-ts4.5/card/ui/cardSpinner/types.d.ts +36 -0
- package/dist/types-ts4.5/card/ui/imageRenderer/imageRenderer.d.ts +1 -1
- package/dist/types-ts4.5/card/ui/titleBox/styles.d.ts +1 -0
- package/example-helpers/index.tsx +4 -3
- package/package.json +8 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
2
|
-
import DownloadIcon from '@atlaskit/icon/
|
|
2
|
+
import DownloadIcon from '@atlaskit/icon/core/migration/download';
|
|
3
3
|
import { globalMediaEventEmitter, RECENTS_COLLECTION, imageResizeModeToFileImageMode, isProcessedFileState } from '@atlaskit/media-client';
|
|
4
4
|
import { MediaFileStateError, useFileState, useMediaClient } from '@atlaskit/media-client-react';
|
|
5
5
|
import { getRandomHex, isMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
|
|
@@ -202,6 +202,8 @@ export const FileCard = ({
|
|
|
202
202
|
const downloadAction = {
|
|
203
203
|
label: 'Download',
|
|
204
204
|
icon: /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
205
|
+
color: "currentColor",
|
|
206
|
+
spacing: "spacious",
|
|
205
207
|
label: "Download"
|
|
206
208
|
}),
|
|
207
209
|
handler: () => mediaClient.file.downloadBinary(identifier.id, metadata.name, identifier.collectionName)
|
|
@@ -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 = "78.
|
|
69
|
+
const packageVersion = "78.5.0";
|
|
70
70
|
|
|
71
71
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
72
72
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
@@ -104,7 +104,7 @@ export const SvgViewBase = ({
|
|
|
104
104
|
...svgDimensions
|
|
105
105
|
},
|
|
106
106
|
ref: imgRef
|
|
107
|
-
}),
|
|
107
|
+
}), !didSvgRender && jsx(ImageRenderer, {
|
|
108
108
|
cardPreview: cardPreview,
|
|
109
109
|
onImageLoad: onPreviewLoad,
|
|
110
110
|
mediaType: 'image',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Component } from 'react';
|
|
4
|
-
import MoreIcon from '@atlaskit/icon/
|
|
4
|
+
import MoreIcon from '@atlaskit/icon/core/migration/show-more-horizontal--more';
|
|
5
5
|
import DropdownMenu, { DropdownItemGroup, DropdownItem } from '@atlaskit/dropdown-menu';
|
|
6
6
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
7
|
import { createAndFireMediaCardEvent } from '../../../../utils/analytics';
|
|
@@ -68,6 +68,8 @@ export class CardActionsDropdownMenu extends Component {
|
|
|
68
68
|
},
|
|
69
69
|
ref: triggerRef
|
|
70
70
|
}, providedProps), /*#__PURE__*/React.createElement(MoreIcon, {
|
|
71
|
+
color: "currentColor",
|
|
72
|
+
spacing: "spacious",
|
|
71
73
|
label: "more"
|
|
72
74
|
}))
|
|
73
75
|
}, /*#__PURE__*/React.createElement(DropdownItemGroup, null, actions.map(createDropdownItemWithAnalytics)));
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Note: CardSpinner is almost a direct copy of Spinner from '@atlaskit/spinner', the only difference
|
|
8
|
+
* being the removal of interaction tracing.
|
|
9
|
+
* Removing interaction tracing ensures that Media Card is not contributing to Jira's TTAI and TTVC metrics.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import React from 'react';
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
|
+
import { css, jsx, keyframes } from '@emotion/react';
|
|
16
|
+
import { N0, N500 } from '@atlaskit/theme/colors';
|
|
17
|
+
import { presetSizes } from './constants';
|
|
18
|
+
/**
|
|
19
|
+
* Returns the appropriate circle stroke color.
|
|
20
|
+
*/
|
|
21
|
+
function getStrokeColor(appearance) {
|
|
22
|
+
return appearance === 'inherit' ? `var(--ds-icon-subtle, ${N500})` : `var(--ds-icon-inverse, ${N0})`;
|
|
23
|
+
}
|
|
24
|
+
const rotate = keyframes({
|
|
25
|
+
to: {
|
|
26
|
+
transform: 'rotate(360deg)'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const rotateStyles = css({
|
|
30
|
+
animation: `${rotate} 0.86s infinite`,
|
|
31
|
+
animationTimingFunction: 'cubic-bezier(0.4, 0.15, 0.6, 0.85)',
|
|
32
|
+
transformOrigin: 'center'
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* There are three parts to the load in animation:
|
|
37
|
+
* 1. Fade in
|
|
38
|
+
* 2. Accelerated spin
|
|
39
|
+
* 3. Stretch the spinner line
|
|
40
|
+
*/
|
|
41
|
+
const loadIn = keyframes({
|
|
42
|
+
from: {
|
|
43
|
+
transform: 'rotate(50deg)',
|
|
44
|
+
opacity: 0,
|
|
45
|
+
strokeDashoffset: 60
|
|
46
|
+
},
|
|
47
|
+
to: {
|
|
48
|
+
transform: 'rotate(230deg)',
|
|
49
|
+
opacity: 1,
|
|
50
|
+
strokeDashoffset: 50
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const loadInStyles = css({
|
|
54
|
+
animation: `${loadIn} 1s ease-in-out`,
|
|
55
|
+
/**
|
|
56
|
+
* When the animation completes, stay at the last frame of the animation.
|
|
57
|
+
*/
|
|
58
|
+
animationFillMode: 'forwards',
|
|
59
|
+
/**
|
|
60
|
+
* We are going to animate this in.
|
|
61
|
+
*/
|
|
62
|
+
opacity: 0
|
|
63
|
+
});
|
|
64
|
+
const wrapperStyles = css({
|
|
65
|
+
display: 'inline-flex',
|
|
66
|
+
/**
|
|
67
|
+
* Align better inline with text.
|
|
68
|
+
*/
|
|
69
|
+
verticalAlign: 'middle'
|
|
70
|
+
});
|
|
71
|
+
const circleStyles = css({
|
|
72
|
+
fill: 'none',
|
|
73
|
+
strokeDasharray: 60,
|
|
74
|
+
strokeDashoffset: 'inherit',
|
|
75
|
+
strokeLinecap: 'round',
|
|
76
|
+
strokeWidth: 1.5,
|
|
77
|
+
'@media screen and (forced-colors: active)': {
|
|
78
|
+
filter: 'grayscale(100%)',
|
|
79
|
+
stroke: 'CanvasText'
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* __Spinner__
|
|
85
|
+
*
|
|
86
|
+
* A spinner is an animated spinning icon that lets users know content is being loaded.
|
|
87
|
+
*
|
|
88
|
+
* - [Examples](https://atlassian.design/components/spinner/examples)
|
|
89
|
+
* - [Code](https://atlassian.design/components/spinner/code)
|
|
90
|
+
* - [Usage](https://atlassian.design/components/spinner/usage)
|
|
91
|
+
*/
|
|
92
|
+
const CardSpinner = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Spinner({
|
|
93
|
+
appearance = 'inherit',
|
|
94
|
+
delay = 0,
|
|
95
|
+
label,
|
|
96
|
+
size: providedSize = 'medium',
|
|
97
|
+
testId
|
|
98
|
+
}, ref) {
|
|
99
|
+
const size = typeof providedSize === 'number' ? providedSize : presetSizes[providedSize];
|
|
100
|
+
const animationDelay = `${delay}ms`;
|
|
101
|
+
const stroke = getStrokeColor(appearance);
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The Spinner animation uses a combination of two
|
|
105
|
+
* css animations on two separate elements.
|
|
106
|
+
*/
|
|
107
|
+
return jsx("span", {
|
|
108
|
+
/**
|
|
109
|
+
* This span exists to off-load animations from the circle element,
|
|
110
|
+
* which were causing performance issues (style recalculations)
|
|
111
|
+
* on Safari and older versions of Chrome.
|
|
112
|
+
*
|
|
113
|
+
* This can be removed and styles placed back on the circle element once
|
|
114
|
+
* Safari fixes this bug and off-loads rendering to the GPU from the CPU.
|
|
115
|
+
*/
|
|
116
|
+
css: [wrapperStyles, rotateStyles],
|
|
117
|
+
"data-testid": testId && `${testId}-wrapper`
|
|
118
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
119
|
+
,
|
|
120
|
+
style: {
|
|
121
|
+
animationDelay,
|
|
122
|
+
width: size,
|
|
123
|
+
height: size
|
|
124
|
+
}
|
|
125
|
+
}, jsx("svg", {
|
|
126
|
+
height: size,
|
|
127
|
+
width: size,
|
|
128
|
+
viewBox: "0 0 16 16",
|
|
129
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
130
|
+
"data-testid": testId,
|
|
131
|
+
ref: ref,
|
|
132
|
+
"aria-label": label || undefined,
|
|
133
|
+
css: loadInStyles
|
|
134
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
135
|
+
,
|
|
136
|
+
style: {
|
|
137
|
+
animationDelay
|
|
138
|
+
},
|
|
139
|
+
role: label ? 'img' : 'none'
|
|
140
|
+
}, jsx("circle", {
|
|
141
|
+
cx: "8",
|
|
142
|
+
cy: "8",
|
|
143
|
+
r: "7",
|
|
144
|
+
css: circleStyles,
|
|
145
|
+
style: {
|
|
146
|
+
stroke
|
|
147
|
+
}
|
|
148
|
+
})));
|
|
149
|
+
}));
|
|
150
|
+
export default CardSpinner;
|
|
File without changes
|
|
@@ -23,15 +23,15 @@ export const ImageRenderer = ({
|
|
|
23
23
|
}
|
|
24
24
|
}, [mediaType, onDisplayImageRef]);
|
|
25
25
|
const onLoad = () => {
|
|
26
|
-
onImageLoad && onImageLoad(cardPreview);
|
|
26
|
+
onImageLoad && cardPreview && onImageLoad(cardPreview);
|
|
27
27
|
};
|
|
28
28
|
const onError = () => {
|
|
29
|
-
onImageError && onImageError(cardPreview);
|
|
29
|
+
onImageError && cardPreview && onImageError(cardPreview);
|
|
30
30
|
};
|
|
31
31
|
return /*#__PURE__*/React.createElement(MediaImage, _extends({
|
|
32
|
-
dataURI: cardPreview.dataURI,
|
|
32
|
+
dataURI: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI,
|
|
33
33
|
alt: alt,
|
|
34
|
-
previewOrientation: cardPreview.orientation,
|
|
34
|
+
previewOrientation: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.orientation,
|
|
35
35
|
onImageLoad: onLoad,
|
|
36
36
|
onImageError: onError,
|
|
37
37
|
loading: nativeLazyLoad ? 'lazy' : undefined,
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import LegacyVidPlayIcon from '@atlaskit/icon/glyph/vid-play';
|
|
3
|
+
import VidPlayIcon from '@atlaskit/icon/core/video-play-overlay';
|
|
3
4
|
import { PlayButtonWrapper } from './playButtonWrapper';
|
|
4
5
|
import { PlayButtonBackground } from './playButtonBackground';
|
|
5
6
|
export const PlayButton = () => {
|
|
6
7
|
return /*#__PURE__*/React.createElement(PlayButtonWrapper, null, /*#__PURE__*/React.createElement(PlayButtonBackground, null), /*#__PURE__*/React.createElement(VidPlayIcon, {
|
|
8
|
+
color: "currentColor",
|
|
7
9
|
label: "play",
|
|
8
|
-
|
|
10
|
+
LEGACY_size: "large",
|
|
11
|
+
LEGACY_fallbackIcon: LegacyVidPlayIcon
|
|
9
12
|
}));
|
|
10
13
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import TickIcon from '@atlaskit/icon/
|
|
2
|
+
import TickIcon from '@atlaskit/icon/utility/migration/check-mark--check';
|
|
3
3
|
import { TickBoxWrapper } from './tickBoxWrapper';
|
|
4
4
|
export const TickBox = ({
|
|
5
5
|
selected
|
|
6
6
|
}) => /*#__PURE__*/React.createElement(TickBoxWrapper, {
|
|
7
7
|
selected: selected
|
|
8
8
|
}, /*#__PURE__*/React.createElement(TickIcon, {
|
|
9
|
+
color: "currentColor",
|
|
9
10
|
label: "tick"
|
|
10
11
|
}));
|
|
@@ -29,7 +29,9 @@ transition && transition(), {
|
|
|
29
29
|
svg: {
|
|
30
30
|
height: '14px'
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
},
|
|
33
|
+
display: 'grid',
|
|
34
|
+
placeItems: 'center'
|
|
33
35
|
},
|
|
34
36
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
35
37
|
getSelectedStyles(selected));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
-
import EditorWarningIcon from '@atlaskit/icon/
|
|
3
|
+
import EditorWarningIcon from '@atlaskit/icon/utility/migration/warning--editor-warning';
|
|
4
4
|
import { messages } from '@atlaskit/media-ui';
|
|
5
5
|
import { R300 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { ErrorMessageWrapper, TitleBoxWrapper } from './titleBoxComponents';
|
|
@@ -12,7 +12,8 @@ export const FailedTitleBox = ({
|
|
|
12
12
|
breakpoint: breakpoint
|
|
13
13
|
}, /*#__PURE__*/React.createElement(ErrorMessageWrapper, null, /*#__PURE__*/React.createElement(EditorWarningIcon, {
|
|
14
14
|
label: 'Warning',
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
LEGACY_size: 'small',
|
|
16
|
+
LEGACY_margin: `0 ${"var(--ds-space-negative-025, -2px)"}`,
|
|
17
|
+
color: `var(--ds-text-danger, ${R300})`
|
|
17
18
|
}), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, customMessage))));
|
|
18
19
|
};
|
|
@@ -64,11 +64,20 @@ export const titleBoxIconStyles = css({
|
|
|
64
64
|
bottom: '0px'
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
68
|
+
export const newTitleBoxIconStyles = css({
|
|
69
|
+
position: 'absolute',
|
|
70
|
+
right: "var(--ds-space-050, 4px)",
|
|
71
|
+
bottom: "var(--ds-space-050, 4px)"
|
|
72
|
+
});
|
|
73
|
+
|
|
67
74
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
68
75
|
export const errorMessageWrapperStyles = css({
|
|
69
76
|
display: 'flex',
|
|
70
77
|
alignItems: 'center',
|
|
71
78
|
justifyContent: 'flex-start',
|
|
79
|
+
paddingInlineStart: "var(--ds-space-025, 2px)",
|
|
80
|
+
gap: "var(--ds-space-025, 2px)",
|
|
72
81
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
73
82
|
span: {
|
|
74
83
|
verticalAlign: 'middle',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
-
import LockFilledIcon from '@atlaskit/icon/
|
|
3
|
+
import LockFilledIcon from '@atlaskit/icon/utility/migration/lock-locked--lock-filled';
|
|
4
4
|
import { Truncate } from '@atlaskit/media-ui/truncateText';
|
|
5
5
|
import { formatDate } from '@atlaskit/media-ui/formatDate';
|
|
6
6
|
import { TitleBoxWrapper, TitleBoxFooter, TitleBoxHeader, TitleBoxIcon } from './titleBoxComponents';
|
|
@@ -27,8 +27,9 @@ export const TitleBox = injectIntl(({
|
|
|
27
27
|
})), /*#__PURE__*/React.createElement(TitleBoxFooter, {
|
|
28
28
|
hasIconOverlap: !!titleBoxIcon
|
|
29
29
|
}, createdAt !== undefined && isValidTimestamp(createdAt) ? formatDate(createdAt, (_intl$locale = intl === null || intl === void 0 ? void 0 : intl.locale) !== null && _intl$locale !== void 0 ? _intl$locale : 'en') : placeholderText), titleBoxIcon === 'LockFilledIcon' && /*#__PURE__*/React.createElement(TitleBoxIcon, null, /*#__PURE__*/React.createElement(LockFilledIcon, {
|
|
30
|
+
color: "currentColor",
|
|
30
31
|
label: "",
|
|
31
|
-
|
|
32
|
+
LEGACY_size: "small"
|
|
32
33
|
})));
|
|
33
34
|
}, {
|
|
34
35
|
enforceContext: false
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
-
import {
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { errorMessageWrapperStyles, newTitleBoxIconStyles, titleBoxFooterStyles, titleBoxHeaderStyles, titleBoxIconStyles, titleBoxWrapperStyles } from './styles';
|
|
8
9
|
export const TitleBoxWrapper = props => {
|
|
9
10
|
const {
|
|
10
11
|
breakpoint,
|
|
@@ -54,10 +55,12 @@ export const TitleBoxFooter = props => {
|
|
|
54
55
|
export const TitleBoxIcon = props => {
|
|
55
56
|
return jsx("div", {
|
|
56
57
|
id: "titleBoxIcon",
|
|
57
|
-
"data-testid": "title-box-icon"
|
|
58
|
+
"data-testid": "title-box-icon",
|
|
59
|
+
css: fg('platform.design-system-team.enable-new-icons') ?
|
|
58
60
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
59
|
-
|
|
60
|
-
css
|
|
61
|
+
newTitleBoxIconStyles :
|
|
62
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
63
|
+
titleBoxIconStyles
|
|
61
64
|
}, props.children);
|
|
62
65
|
};
|
|
63
66
|
export const ErrorMessageWrapper = props => {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Component } from 'react';
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
|
-
import WarningIcon from '@atlaskit/icon/
|
|
8
|
+
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
9
9
|
import { N20, N800, Y500 } from '@atlaskit/theme/colors';
|
|
10
10
|
import { center, borderRadius } from '@atlaskit/media-ui';
|
|
11
11
|
import { defaultImageCardDimensions } from '../../../utils';
|
|
@@ -74,8 +74,9 @@ export class UnhandledErrorCard extends Component {
|
|
|
74
74
|
onClick: onClick
|
|
75
75
|
}, jsx(WarningIcon, {
|
|
76
76
|
label: "Error",
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
color: `var(--ds-icon-warning, ${Y500})`,
|
|
78
|
+
LEGACY_size: "medium",
|
|
79
|
+
spacing: "spacious"
|
|
79
80
|
}), jsx("p", null, "We couldn't load this content"))
|
|
80
81
|
);
|
|
81
82
|
}
|
|
@@ -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: "78.
|
|
40
|
+
packageName: "78.5.0",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
4
|
import { B300, R300, N30A, N900 } from '@atlaskit/theme/colors';
|
|
5
|
-
import WarningIcon from '@atlaskit/icon/
|
|
5
|
+
import WarningIcon from '@atlaskit/icon/utility/migration/warning';
|
|
6
6
|
import { fireMediaCardEvent } from '../utils/analytics';
|
|
7
7
|
const ErrorBoundaryComponent = ({
|
|
8
8
|
message,
|
|
@@ -34,7 +34,9 @@ const ErrorBoundaryComponent = ({
|
|
|
34
34
|
padding: `${"var(--ds-space-025, 2px)"} ${"var(--ds-space-050, 4px)"}`,
|
|
35
35
|
marginRight: "var(--ds-space-negative-025, -2px)",
|
|
36
36
|
WebkitBoxDecorationBreak: 'clone',
|
|
37
|
-
display: 'inline',
|
|
37
|
+
display: 'inline-flex',
|
|
38
|
+
gap: "var(--ds-space-050, 4px)",
|
|
39
|
+
alignItems: 'center',
|
|
38
40
|
borderRadius: '3px',
|
|
39
41
|
color: `var(--ds-text, ${N900})`,
|
|
40
42
|
backgroundColor: `var(--ds-background-neutral, ${N30A})`,
|
|
@@ -53,9 +55,10 @@ const ErrorBoundaryComponent = ({
|
|
|
53
55
|
React.createElement("span", {
|
|
54
56
|
style: style
|
|
55
57
|
}, /*#__PURE__*/React.createElement(WarningIcon, {
|
|
58
|
+
LEGACY_margin: `0 ${"var(--ds-space-negative-050, -4px)"} 0 0`,
|
|
56
59
|
label: "error",
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
LEGACY_size: "small",
|
|
61
|
+
color: `var(--ds-icon-danger, ${R300})`
|
|
59
62
|
}), message)
|
|
60
63
|
);
|
|
61
64
|
};
|
|
@@ -6,7 +6,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
8
|
import { Component } from 'react';
|
|
9
|
-
import WarningIcon from '@atlaskit/icon/
|
|
9
|
+
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
10
10
|
import { errorIconWrapperStyles } from './styles';
|
|
11
11
|
export class ErrorIcon extends Component {
|
|
12
12
|
render() {
|
|
@@ -18,8 +18,9 @@ export class ErrorIcon extends Component {
|
|
|
18
18
|
jsx("div", {
|
|
19
19
|
css: errorIconWrapperStyles
|
|
20
20
|
}, jsx(WarningIcon, {
|
|
21
|
+
color: "currentColor",
|
|
21
22
|
label: "Error",
|
|
22
|
-
|
|
23
|
+
LEGACY_size: size
|
|
23
24
|
}))
|
|
24
25
|
);
|
|
25
26
|
}
|
|
@@ -5,7 +5,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
5
5
|
import { MediaCardError } from '../errors';
|
|
6
6
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
7
7
|
const packageName = "@atlaskit/media-card";
|
|
8
|
-
const packageVersion = "78.
|
|
8
|
+
const packageVersion = "78.5.0";
|
|
9
9
|
let concurrentExperience;
|
|
10
10
|
const getExperience = id => {
|
|
11
11
|
if (!concurrentExperience) {
|
package/dist/esm/card/card.js
CHANGED
|
@@ -11,7 +11,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
|
|
|
11
11
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
var packageName = "@atlaskit/media-card";
|
|
14
|
-
var packageVersion = "78.
|
|
14
|
+
var packageVersion = "78.5.0";
|
|
15
15
|
export var CardBase = function CardBase(_ref) {
|
|
16
16
|
var identifier = _ref.identifier,
|
|
17
17
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -11,7 +11,7 @@ import { jsx } from '@emotion/react';
|
|
|
11
11
|
import React, { useEffect, useState, useRef, useMemo } from 'react';
|
|
12
12
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
13
13
|
import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
|
|
14
|
-
import
|
|
14
|
+
import CardSpinner from './ui/cardSpinner/cardSpinner';
|
|
15
15
|
import Tooltip from '@atlaskit/tooltip';
|
|
16
16
|
import { messages } from '@atlaskit/media-ui';
|
|
17
17
|
import { createAndFireMediaCardEvent } from '../utils/analytics';
|
|
@@ -114,7 +114,7 @@ export var CardViewBase = function CardViewBase(_ref) {
|
|
|
114
114
|
var isZeroSize = metadata && metadata.size === 0;
|
|
115
115
|
var defaultConfig = {
|
|
116
116
|
renderTypeIcon: !didImageRender,
|
|
117
|
-
renderImageRenderer:
|
|
117
|
+
renderImageRenderer: true,
|
|
118
118
|
renderPlayButton: !!cardPreview && mediaType === 'video',
|
|
119
119
|
renderBlanket: !disableOverlay,
|
|
120
120
|
renderTitleBox: !disableOverlay,
|
|
@@ -242,10 +242,10 @@ export var CardViewBase = function CardViewBase(_ref) {
|
|
|
242
242
|
}), iconMessage), renderSpinner && jsx(IconWrapper, {
|
|
243
243
|
breakpoint: breakpoint,
|
|
244
244
|
hasTitleBox: hasVisibleTitleBox
|
|
245
|
-
}, jsx(
|
|
245
|
+
}, jsx(CardSpinner, {
|
|
246
246
|
testId: "media-card-loading",
|
|
247
247
|
interactionName: "media-card-loading"
|
|
248
|
-
})), renderImageRenderer &&
|
|
248
|
+
})), renderImageRenderer && jsx(ImageRenderer, {
|
|
249
249
|
cardPreview: cardPreview,
|
|
250
250
|
mediaType: (metadata === null || metadata === void 0 ? void 0 : metadata.mediaType) || 'unknown',
|
|
251
251
|
alt: alt !== null && alt !== void 0 ? alt : name,
|
|
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
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; }
|
|
5
5
|
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) { _defineProperty(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; }
|
|
6
6
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
|
-
import DownloadIcon from '@atlaskit/icon/
|
|
7
|
+
import DownloadIcon from '@atlaskit/icon/core/migration/download';
|
|
8
8
|
import { globalMediaEventEmitter, RECENTS_COLLECTION, imageResizeModeToFileImageMode, isProcessedFileState } from '@atlaskit/media-client';
|
|
9
9
|
import { MediaFileStateError, useFileState, useMediaClient } from '@atlaskit/media-client-react';
|
|
10
10
|
import { getRandomHex, isMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
|
|
@@ -240,6 +240,8 @@ export var FileCard = function FileCard(_ref) {
|
|
|
240
240
|
var downloadAction = {
|
|
241
241
|
label: 'Download',
|
|
242
242
|
icon: /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
243
|
+
color: "currentColor",
|
|
244
|
+
spacing: "spacious",
|
|
243
245
|
label: "Download"
|
|
244
246
|
}),
|
|
245
247
|
handler: function handler() {
|
|
@@ -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 = "78.
|
|
86
|
+
var packageVersion = "78.5.0";
|
|
87
87
|
|
|
88
88
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
89
89
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
@@ -115,7 +115,7 @@ export var SvgViewBase = function SvgViewBase(_ref) {
|
|
|
115
115
|
visibility: didSvgRender ? 'visible' : 'hidden'
|
|
116
116
|
}, svgDimensions),
|
|
117
117
|
ref: imgRef
|
|
118
|
-
}),
|
|
118
|
+
}), !didSvgRender && jsx(ImageRenderer, {
|
|
119
119
|
cardPreview: cardPreview,
|
|
120
120
|
onImageLoad: onPreviewLoad,
|
|
121
121
|
mediaType: 'image',
|
|
@@ -10,7 +10,7 @@ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function
|
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { Component } from 'react';
|
|
13
|
-
import MoreIcon from '@atlaskit/icon/
|
|
13
|
+
import MoreIcon from '@atlaskit/icon/core/migration/show-more-horizontal--more';
|
|
14
14
|
import DropdownMenu, { DropdownItemGroup, DropdownItem } from '@atlaskit/dropdown-menu';
|
|
15
15
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
16
16
|
import { createAndFireMediaCardEvent } from '../../../../utils/analytics';
|
|
@@ -84,6 +84,8 @@ export var CardActionsDropdownMenu = /*#__PURE__*/function (_Component) {
|
|
|
84
84
|
},
|
|
85
85
|
ref: triggerRef
|
|
86
86
|
}, providedProps), /*#__PURE__*/React.createElement(MoreIcon, {
|
|
87
|
+
color: "currentColor",
|
|
88
|
+
spacing: "spacious",
|
|
87
89
|
label: "more"
|
|
88
90
|
}))
|
|
89
91
|
);
|