@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
|
@@ -0,0 +1,152 @@
|
|
|
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, ".concat(N500, ")") : "var(--ds-icon-inverse, ".concat(N0, ")");
|
|
23
|
+
}
|
|
24
|
+
var rotate = keyframes({
|
|
25
|
+
to: {
|
|
26
|
+
transform: 'rotate(360deg)'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
var rotateStyles = css({
|
|
30
|
+
animation: "".concat(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
|
+
var 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
|
+
var loadInStyles = css({
|
|
54
|
+
animation: "".concat(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
|
+
var wrapperStyles = css({
|
|
65
|
+
display: 'inline-flex',
|
|
66
|
+
/**
|
|
67
|
+
* Align better inline with text.
|
|
68
|
+
*/
|
|
69
|
+
verticalAlign: 'middle'
|
|
70
|
+
});
|
|
71
|
+
var 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
|
+
var CardSpinner = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Spinner(_ref, ref) {
|
|
93
|
+
var _ref$appearance = _ref.appearance,
|
|
94
|
+
appearance = _ref$appearance === void 0 ? 'inherit' : _ref$appearance,
|
|
95
|
+
_ref$delay = _ref.delay,
|
|
96
|
+
delay = _ref$delay === void 0 ? 0 : _ref$delay,
|
|
97
|
+
label = _ref.label,
|
|
98
|
+
_ref$size = _ref.size,
|
|
99
|
+
providedSize = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
100
|
+
testId = _ref.testId;
|
|
101
|
+
var size = typeof providedSize === 'number' ? providedSize : presetSizes[providedSize];
|
|
102
|
+
var animationDelay = "".concat(delay, "ms");
|
|
103
|
+
var stroke = getStrokeColor(appearance);
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The Spinner animation uses a combination of two
|
|
107
|
+
* css animations on two separate elements.
|
|
108
|
+
*/
|
|
109
|
+
return jsx("span", {
|
|
110
|
+
/**
|
|
111
|
+
* This span exists to off-load animations from the circle element,
|
|
112
|
+
* which were causing performance issues (style recalculations)
|
|
113
|
+
* on Safari and older versions of Chrome.
|
|
114
|
+
*
|
|
115
|
+
* This can be removed and styles placed back on the circle element once
|
|
116
|
+
* Safari fixes this bug and off-loads rendering to the GPU from the CPU.
|
|
117
|
+
*/
|
|
118
|
+
css: [wrapperStyles, rotateStyles],
|
|
119
|
+
"data-testid": testId && "".concat(testId, "-wrapper")
|
|
120
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
121
|
+
,
|
|
122
|
+
style: {
|
|
123
|
+
animationDelay: animationDelay,
|
|
124
|
+
width: size,
|
|
125
|
+
height: size
|
|
126
|
+
}
|
|
127
|
+
}, jsx("svg", {
|
|
128
|
+
height: size,
|
|
129
|
+
width: size,
|
|
130
|
+
viewBox: "0 0 16 16",
|
|
131
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
132
|
+
"data-testid": testId,
|
|
133
|
+
ref: ref,
|
|
134
|
+
"aria-label": label || undefined,
|
|
135
|
+
css: loadInStyles
|
|
136
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
137
|
+
,
|
|
138
|
+
style: {
|
|
139
|
+
animationDelay: animationDelay
|
|
140
|
+
},
|
|
141
|
+
role: label ? 'img' : 'none'
|
|
142
|
+
}, jsx("circle", {
|
|
143
|
+
cx: "8",
|
|
144
|
+
cy: "8",
|
|
145
|
+
r: "7",
|
|
146
|
+
css: circleStyles,
|
|
147
|
+
style: {
|
|
148
|
+
stroke: stroke
|
|
149
|
+
}
|
|
150
|
+
})));
|
|
151
|
+
}));
|
|
152
|
+
export default CardSpinner;
|
|
File without changes
|
|
@@ -22,15 +22,15 @@ export var ImageRenderer = function ImageRenderer(_ref) {
|
|
|
22
22
|
}
|
|
23
23
|
}, [mediaType, onDisplayImageRef]);
|
|
24
24
|
var onLoad = function onLoad() {
|
|
25
|
-
onImageLoad && onImageLoad(cardPreview);
|
|
25
|
+
onImageLoad && cardPreview && onImageLoad(cardPreview);
|
|
26
26
|
};
|
|
27
27
|
var onError = function onError() {
|
|
28
|
-
onImageError && onImageError(cardPreview);
|
|
28
|
+
onImageError && cardPreview && onImageError(cardPreview);
|
|
29
29
|
};
|
|
30
30
|
return /*#__PURE__*/React.createElement(MediaImage, _extends({
|
|
31
|
-
dataURI: cardPreview.dataURI,
|
|
31
|
+
dataURI: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI,
|
|
32
32
|
alt: alt,
|
|
33
|
-
previewOrientation: cardPreview.orientation,
|
|
33
|
+
previewOrientation: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.orientation,
|
|
34
34
|
onImageLoad: onLoad,
|
|
35
35
|
onImageError: onError,
|
|
36
36
|
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 var PlayButton = function 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,11 +1,12 @@
|
|
|
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 var TickBox = function TickBox(_ref) {
|
|
5
5
|
var selected = _ref.selected;
|
|
6
6
|
return /*#__PURE__*/React.createElement(TickBoxWrapper, {
|
|
7
7
|
selected: selected
|
|
8
8
|
}, /*#__PURE__*/React.createElement(TickIcon, {
|
|
9
|
+
color: "currentColor",
|
|
9
10
|
label: "tick"
|
|
10
11
|
}));
|
|
11
12
|
};
|
|
@@ -31,7 +31,9 @@ var wrapperStyles = function wrapperStyles(selected) {
|
|
|
31
31
|
svg: {
|
|
32
32
|
height: '14px'
|
|
33
33
|
}
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
|
+
display: 'grid',
|
|
36
|
+
placeItems: 'center'
|
|
35
37
|
},
|
|
36
38
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
37
39
|
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 var FailedTitleBox = function FailedTitleBox(_ref) {
|
|
|
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 ".concat("var(--ds-space-negative-025, -2px)"),
|
|
17
|
+
color: "var(--ds-text-danger, ".concat(R300, ")")
|
|
17
18
|
}), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, customMessage))));
|
|
18
19
|
};
|
|
@@ -68,11 +68,20 @@ export var titleBoxIconStyles = css({
|
|
|
68
68
|
bottom: '0px'
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
72
|
+
export var newTitleBoxIconStyles = css({
|
|
73
|
+
position: 'absolute',
|
|
74
|
+
right: "var(--ds-space-050, 4px)",
|
|
75
|
+
bottom: "var(--ds-space-050, 4px)"
|
|
76
|
+
});
|
|
77
|
+
|
|
71
78
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
72
79
|
export var errorMessageWrapperStyles = css({
|
|
73
80
|
display: 'flex',
|
|
74
81
|
alignItems: 'center',
|
|
75
82
|
justifyContent: 'flex-start',
|
|
83
|
+
paddingInlineStart: "var(--ds-space-025, 2px)",
|
|
84
|
+
gap: "var(--ds-space-025, 2px)",
|
|
76
85
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
77
86
|
span: {
|
|
78
87
|
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';
|
|
@@ -28,8 +28,9 @@ export var TitleBox = injectIntl(function (_ref) {
|
|
|
28
28
|
})), /*#__PURE__*/React.createElement(TitleBoxFooter, {
|
|
29
29
|
hasIconOverlap: !!titleBoxIcon
|
|
30
30
|
}, 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, {
|
|
31
|
+
color: "currentColor",
|
|
31
32
|
label: "",
|
|
32
|
-
|
|
33
|
+
LEGACY_size: "small"
|
|
33
34
|
})));
|
|
34
35
|
}, {
|
|
35
36
|
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 var TitleBoxWrapper = function TitleBoxWrapper(props) {
|
|
9
10
|
var breakpoint = props.breakpoint,
|
|
10
11
|
titleBoxBgColor = props.titleBoxBgColor,
|
|
@@ -48,10 +49,12 @@ export var TitleBoxFooter = function TitleBoxFooter(props) {
|
|
|
48
49
|
export var TitleBoxIcon = function TitleBoxIcon(props) {
|
|
49
50
|
return jsx("div", {
|
|
50
51
|
id: "titleBoxIcon",
|
|
51
|
-
"data-testid": "title-box-icon"
|
|
52
|
+
"data-testid": "title-box-icon",
|
|
53
|
+
css: fg('platform.design-system-team.enable-new-icons') ?
|
|
52
54
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
53
|
-
|
|
54
|
-
css
|
|
55
|
+
newTitleBoxIconStyles :
|
|
56
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
57
|
+
titleBoxIconStyles
|
|
55
58
|
}, props.children);
|
|
56
59
|
};
|
|
57
60
|
export var ErrorMessageWrapper = function ErrorMessageWrapper(props) {
|
|
@@ -12,7 +12,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
12
12
|
import { Component } from 'react';
|
|
13
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
14
|
import { css, jsx } from '@emotion/react';
|
|
15
|
-
import WarningIcon from '@atlaskit/icon/
|
|
15
|
+
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
16
16
|
import { N20, N800, Y500 } from '@atlaskit/theme/colors';
|
|
17
17
|
import { center, borderRadius } from '@atlaskit/media-ui';
|
|
18
18
|
import { defaultImageCardDimensions } from '../../../utils';
|
|
@@ -90,8 +90,9 @@ export var UnhandledErrorCard = /*#__PURE__*/function (_Component) {
|
|
|
90
90
|
onClick: onClick
|
|
91
91
|
}, jsx(WarningIcon, {
|
|
92
92
|
label: "Error",
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
color: "var(--ds-icon-warning, ".concat(Y500, ")"),
|
|
94
|
+
LEGACY_size: "medium",
|
|
95
|
+
spacing: "spacious"
|
|
95
96
|
}), jsx("p", null, "We couldn't load this content"))
|
|
96
97
|
);
|
|
97
98
|
}
|
|
@@ -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: "78.
|
|
106
|
+
packageName: "78.5.0",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -12,7 +12,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
14
14
|
import { B300, R300, N30A, N900 } from '@atlaskit/theme/colors';
|
|
15
|
-
import WarningIcon from '@atlaskit/icon/
|
|
15
|
+
import WarningIcon from '@atlaskit/icon/utility/migration/warning';
|
|
16
16
|
import { fireMediaCardEvent } from '../utils/analytics';
|
|
17
17
|
var ErrorBoundaryComponent = function ErrorBoundaryComponent(_ref) {
|
|
18
18
|
var message = _ref.message,
|
|
@@ -43,7 +43,9 @@ var ErrorBoundaryComponent = function ErrorBoundaryComponent(_ref) {
|
|
|
43
43
|
padding: "var(--ds-space-025, 2px)".concat(" ", "var(--ds-space-050, 4px)"),
|
|
44
44
|
marginRight: "var(--ds-space-negative-025, -2px)",
|
|
45
45
|
WebkitBoxDecorationBreak: 'clone',
|
|
46
|
-
display: 'inline',
|
|
46
|
+
display: 'inline-flex',
|
|
47
|
+
gap: "var(--ds-space-050, 4px)",
|
|
48
|
+
alignItems: 'center',
|
|
47
49
|
borderRadius: '3px',
|
|
48
50
|
color: "var(--ds-text, ".concat(N900, ")"),
|
|
49
51
|
backgroundColor: "var(--ds-background-neutral, ".concat(N30A, ")"),
|
|
@@ -59,9 +61,10 @@ var ErrorBoundaryComponent = function ErrorBoundaryComponent(_ref) {
|
|
|
59
61
|
React.createElement("span", {
|
|
60
62
|
style: style
|
|
61
63
|
}, /*#__PURE__*/React.createElement(WarningIcon, {
|
|
64
|
+
LEGACY_margin: "0 ".concat("var(--ds-space-negative-050, -4px)", " 0 0"),
|
|
62
65
|
label: "error",
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
LEGACY_size: "small",
|
|
67
|
+
color: "var(--ds-icon-danger, ".concat(R300, ")")
|
|
65
68
|
}), message)
|
|
66
69
|
);
|
|
67
70
|
};
|
|
@@ -13,7 +13,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
13
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
14
|
import { jsx } from '@emotion/react';
|
|
15
15
|
import { Component } from 'react';
|
|
16
|
-
import WarningIcon from '@atlaskit/icon/
|
|
16
|
+
import WarningIcon from '@atlaskit/icon/core/migration/warning--editor-warning';
|
|
17
17
|
import { errorIconWrapperStyles } from './styles';
|
|
18
18
|
export var ErrorIcon = /*#__PURE__*/function (_Component) {
|
|
19
19
|
_inherits(ErrorIcon, _Component);
|
|
@@ -31,8 +31,9 @@ export var ErrorIcon = /*#__PURE__*/function (_Component) {
|
|
|
31
31
|
jsx("div", {
|
|
32
32
|
css: errorIconWrapperStyles
|
|
33
33
|
}, jsx(WarningIcon, {
|
|
34
|
+
color: "currentColor",
|
|
34
35
|
label: "Error",
|
|
35
|
-
|
|
36
|
+
LEGACY_size: size
|
|
36
37
|
}))
|
|
37
38
|
);
|
|
38
39
|
}
|
|
@@ -8,7 +8,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
8
8
|
import { MediaCardError } from '../errors';
|
|
9
9
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
10
10
|
var packageName = "@atlaskit/media-card";
|
|
11
|
-
var packageVersion = "78.
|
|
11
|
+
var packageVersion = "78.5.0";
|
|
12
12
|
var concurrentExperience;
|
|
13
13
|
var getExperience = function getExperience(id) {
|
|
14
14
|
if (!concurrentExperience) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Note: CardSpinner is almost a direct copy of Spinner from '@atlaskit/spinner', the only difference
|
|
7
|
+
* being the removal of interaction tracing.
|
|
8
|
+
* Removing interaction tracing ensures that Media Card is not contributing to Jira's TTAI and TTVC metrics.
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { type SpinnerProps } from './types';
|
|
12
|
+
/**
|
|
13
|
+
* __Spinner__
|
|
14
|
+
*
|
|
15
|
+
* A spinner is an animated spinning icon that lets users know content is being loaded.
|
|
16
|
+
*
|
|
17
|
+
* - [Examples](https://atlassian.design/components/spinner/examples)
|
|
18
|
+
* - [Code](https://atlassian.design/components/spinner/code)
|
|
19
|
+
* - [Usage](https://atlassian.design/components/spinner/usage)
|
|
20
|
+
*/
|
|
21
|
+
declare const CardSpinner: React.MemoExoticComponent<React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<SVGSVGElement>>>;
|
|
22
|
+
export default CardSpinner;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type PresetSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
2
|
+
export type Size = PresetSize | number;
|
|
3
|
+
export type Appearance = 'inherit' | 'invert';
|
|
4
|
+
export type SpinnerProps = {
|
|
5
|
+
/**
|
|
6
|
+
* You can use this to invert the current theme.
|
|
7
|
+
* This is useful when you are displaying a spinner on a background that is not the same background color scheme as the main content.
|
|
8
|
+
*/
|
|
9
|
+
appearance?: Appearance;
|
|
10
|
+
/**
|
|
11
|
+
* Delay the intro animation of `Spinner`.
|
|
12
|
+
* This is not to be used to avoid quick flickering of `Spinner`.
|
|
13
|
+
* `Spinner` will automatically fade in and takes ~200ms to become partially visible.
|
|
14
|
+
* This prop can be helpful for **long delays** such as `500-1000ms` for when you want to not
|
|
15
|
+
* show a `Spinner` until some longer period of time has elapsed.
|
|
16
|
+
*/
|
|
17
|
+
delay?: number;
|
|
18
|
+
/**
|
|
19
|
+
* An optional `interactionName` used to identify when this component is holding an interaction.
|
|
20
|
+
*/
|
|
21
|
+
interactionName?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Describes what the spinner is doing for assistive technologies. For example, "loading", "submitting", or "processing".
|
|
24
|
+
*/
|
|
25
|
+
label?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Size of the spinner. The available sizes are `xsmall`, `small`, `medium`, `large`, and `xlarge`. For most use cases, we recommend `medium`.
|
|
28
|
+
*/
|
|
29
|
+
size?: Size;
|
|
30
|
+
/**
|
|
31
|
+
* A `testId` prop is provided for specified elements,
|
|
32
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
33
|
+
* serving as a hook for automated tests.
|
|
34
|
+
*/
|
|
35
|
+
testId?: string;
|
|
36
|
+
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { type MediaType, type ImageResizeMode } from '@atlaskit/media-client';
|
|
3
3
|
import { type CardPreview } from '../../../types';
|
|
4
4
|
export type ImageRendererProps = {
|
|
5
|
-
readonly cardPreview
|
|
5
|
+
readonly cardPreview?: CardPreview;
|
|
6
6
|
readonly mediaType: MediaType;
|
|
7
7
|
readonly alt?: string;
|
|
8
8
|
readonly resizeMode?: ImageResizeMode;
|
|
@@ -18,5 +18,6 @@ export declare const titleBoxFooterStyles: {
|
|
|
18
18
|
displayName: string;
|
|
19
19
|
};
|
|
20
20
|
export declare const titleBoxIconStyles: import("@emotion/react").SerializedStyles;
|
|
21
|
+
export declare const newTitleBoxIconStyles: import("@emotion/react").SerializedStyles;
|
|
21
22
|
export declare const errorMessageWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
22
23
|
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Note: CardSpinner is almost a direct copy of Spinner from '@atlaskit/spinner', the only difference
|
|
7
|
+
* being the removal of interaction tracing.
|
|
8
|
+
* Removing interaction tracing ensures that Media Card is not contributing to Jira's TTAI and TTVC metrics.
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { type SpinnerProps } from './types';
|
|
12
|
+
/**
|
|
13
|
+
* __Spinner__
|
|
14
|
+
*
|
|
15
|
+
* A spinner is an animated spinning icon that lets users know content is being loaded.
|
|
16
|
+
*
|
|
17
|
+
* - [Examples](https://atlassian.design/components/spinner/examples)
|
|
18
|
+
* - [Code](https://atlassian.design/components/spinner/code)
|
|
19
|
+
* - [Usage](https://atlassian.design/components/spinner/usage)
|
|
20
|
+
*/
|
|
21
|
+
declare const CardSpinner: React.MemoExoticComponent<React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<SVGSVGElement>>>;
|
|
22
|
+
export default CardSpinner;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type PresetSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
2
|
+
export type Size = PresetSize | number;
|
|
3
|
+
export type Appearance = 'inherit' | 'invert';
|
|
4
|
+
export type SpinnerProps = {
|
|
5
|
+
/**
|
|
6
|
+
* You can use this to invert the current theme.
|
|
7
|
+
* This is useful when you are displaying a spinner on a background that is not the same background color scheme as the main content.
|
|
8
|
+
*/
|
|
9
|
+
appearance?: Appearance;
|
|
10
|
+
/**
|
|
11
|
+
* Delay the intro animation of `Spinner`.
|
|
12
|
+
* This is not to be used to avoid quick flickering of `Spinner`.
|
|
13
|
+
* `Spinner` will automatically fade in and takes ~200ms to become partially visible.
|
|
14
|
+
* This prop can be helpful for **long delays** such as `500-1000ms` for when you want to not
|
|
15
|
+
* show a `Spinner` until some longer period of time has elapsed.
|
|
16
|
+
*/
|
|
17
|
+
delay?: number;
|
|
18
|
+
/**
|
|
19
|
+
* An optional `interactionName` used to identify when this component is holding an interaction.
|
|
20
|
+
*/
|
|
21
|
+
interactionName?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Describes what the spinner is doing for assistive technologies. For example, "loading", "submitting", or "processing".
|
|
24
|
+
*/
|
|
25
|
+
label?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Size of the spinner. The available sizes are `xsmall`, `small`, `medium`, `large`, and `xlarge`. For most use cases, we recommend `medium`.
|
|
28
|
+
*/
|
|
29
|
+
size?: Size;
|
|
30
|
+
/**
|
|
31
|
+
* A `testId` prop is provided for specified elements,
|
|
32
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
33
|
+
* serving as a hook for automated tests.
|
|
34
|
+
*/
|
|
35
|
+
testId?: string;
|
|
36
|
+
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { type MediaType, type ImageResizeMode } from '@atlaskit/media-client';
|
|
3
3
|
import { type CardPreview } from '../../../types';
|
|
4
4
|
export type ImageRendererProps = {
|
|
5
|
-
readonly cardPreview
|
|
5
|
+
readonly cardPreview?: CardPreview;
|
|
6
6
|
readonly mediaType: MediaType;
|
|
7
7
|
readonly alt?: string;
|
|
8
8
|
readonly resizeMode?: ImageResizeMode;
|
|
@@ -18,5 +18,6 @@ export declare const titleBoxFooterStyles: {
|
|
|
18
18
|
displayName: string;
|
|
19
19
|
};
|
|
20
20
|
export declare const titleBoxIconStyles: import("@emotion/react").SerializedStyles;
|
|
21
|
+
export declare const newTitleBoxIconStyles: import("@emotion/react").SerializedStyles;
|
|
21
22
|
export declare const errorMessageWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
22
23
|
export {};
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
createPollingMaxAttemptsError,
|
|
12
12
|
createRateLimitedError,
|
|
13
13
|
} from '@atlaskit/media-client/test-helpers';
|
|
14
|
-
import CrossIcon from '@atlaskit/icon/
|
|
14
|
+
import CrossIcon from '@atlaskit/icon/core/migration/close--cross';
|
|
15
15
|
import FabricAnalyticsListeners, { type AnalyticsWebClient } from '@atlaskit/analytics-listeners';
|
|
16
16
|
import { payloadPublisher } from '@atlassian/ufo';
|
|
17
17
|
|
|
@@ -79,7 +79,7 @@ export const deleteAction = {
|
|
|
79
79
|
handler: () => {
|
|
80
80
|
console.log('delete');
|
|
81
81
|
},
|
|
82
|
-
icon: <CrossIcon
|
|
82
|
+
icon: <CrossIcon color="currentColor" LEGACY_size="small" label="delete" />,
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
export const annotateCardAction: CardAction = {
|
|
@@ -87,10 +87,11 @@ export const annotateCardAction: CardAction = {
|
|
|
87
87
|
handler: () => {
|
|
88
88
|
console.log('annotate');
|
|
89
89
|
},
|
|
90
|
+
// eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO: no icon available (https://product-fabric.atlassian.net/browse/DSP-20852)
|
|
90
91
|
icon: <AnnotateIcon size="small" label="annotate" />,
|
|
91
92
|
};
|
|
92
93
|
|
|
93
|
-
export const actions = [openAction, closeAction,
|
|
94
|
+
export const actions = [openAction, closeAction, deleteAction, annotateCardAction];
|
|
94
95
|
|
|
95
96
|
export const anotherAction: CardAction = {
|
|
96
97
|
label: 'Some other action',
|