@atlaskit/media-card 81.5.2 → 81.6.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 +14 -0
- package/dist/cjs/card/ai-generating-overlay/AIGeneratingOverlay.compiled.css +1 -0
- package/dist/cjs/card/ai-generating-overlay/AIGeneratingOverlay.js +7 -2
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/cardView.js +4 -0
- package/dist/cjs/card/fileCard.js +3 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/ai-generating-overlay/AIGeneratingOverlay.compiled.css +1 -0
- package/dist/es2019/card/ai-generating-overlay/AIGeneratingOverlay.js +7 -2
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/cardView.js +4 -0
- package/dist/es2019/card/fileCard.js +3 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/ai-generating-overlay/AIGeneratingOverlay.compiled.css +1 -0
- package/dist/esm/card/ai-generating-overlay/AIGeneratingOverlay.js +7 -2
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/cardView.js +4 -0
- package/dist/esm/card/fileCard.js +3 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/ai-generating-overlay/AIGeneratingOverlay.d.ts +3 -1
- package/dist/types/card/cardView.d.ts +2 -1
- package/dist/types/card/fileCard.d.ts +3 -1
- package/dist/types/types.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 81.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`8043a37357f34`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8043a37357f34) -
|
|
8
|
+
Added an `isCWR` prop to the media `Card`/`FileCard`. When set, the AI-generating loading state
|
|
9
|
+
renders an opaque `elevation.surface.sunken` overlay (instead of the translucent blanket) so the
|
|
10
|
+
generic media type icon isn't shown while a create-with-Rovo infographic streams in. Behaviour is
|
|
11
|
+
gated by the `aifc_page_create_with_rovo_include_infographics` experiment.
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
<FileCard identifier={identifier} isAIGenerating isCWR />
|
|
15
|
+
```
|
|
16
|
+
|
|
3
17
|
## 81.5.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
|
|
16
16
|
._bfhk15uy{background-color:var(--ds-background-neutral,hsla(0,0%,100%,.3))}
|
|
17
17
|
._bfhk1e9t{background-color:var(--ds-blanket,rgba(9,30,66,.36))}
|
|
18
|
+
._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
|
|
18
19
|
._i0dl1x1l{flex-basis:25%}
|
|
19
20
|
._kqswh2mm{position:relative}
|
|
20
21
|
._kqswstnw{position:absolute}
|
|
@@ -12,6 +12,10 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
14
14
|
var overlayStyles = null;
|
|
15
|
+
var backgroundStyles = {
|
|
16
|
+
blanket: "_bfhk1e9t",
|
|
17
|
+
sunken: "_bfhkhfxm"
|
|
18
|
+
};
|
|
15
19
|
var progressBarTrackStyles = null;
|
|
16
20
|
var RAINBOW_TRAIN_COLORS = ["var(--ds-chart-categorical-4, #F68909)", // orange
|
|
17
21
|
"var(--ds-chart-categorical-2, #82B536)", // green
|
|
@@ -23,11 +27,12 @@ var trainStyles = null;
|
|
|
23
27
|
var trainBlockStyles = null;
|
|
24
28
|
function AIGeneratingOverlay(_ref) {
|
|
25
29
|
var label = _ref.label,
|
|
26
|
-
testId = _ref.testId
|
|
30
|
+
testId = _ref.testId,
|
|
31
|
+
isOpaque = _ref.isOpaque;
|
|
27
32
|
return /*#__PURE__*/React.createElement("div", {
|
|
28
33
|
"data-testid": testId !== null && testId !== void 0 ? testId : 'ai-generating-overlay',
|
|
29
34
|
role: "presentation",
|
|
30
|
-
className: (0, _runtime.ax)(["_1r04idpf _kqswstnw _1e0c1txw _4cvresu3 _1bah1h6o _85i5utpp _lcxv1wug
|
|
35
|
+
className: (0, _runtime.ax)(["_1r04idpf _kqswstnw _1e0c1txw _4cvresu3 _1bah1h6o _85i5utpp _lcxv1wug _1pbyqfx8", backgroundStyles[isOpaque ? 'sunken' : 'blanket']])
|
|
31
36
|
}, /*#__PURE__*/React.createElement("div", {
|
|
32
37
|
role: "progressbar",
|
|
33
38
|
"aria-label": label,
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -20,7 +20,7 @@ var _label = _interopRequireDefault(require("@atlaskit/react-ufo/label"));
|
|
|
20
20
|
var _excluded = ["identifier"];
|
|
21
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
22
22
|
var packageName = "@atlaskit/media-card";
|
|
23
|
-
var packageVersion = "81.5.
|
|
23
|
+
var packageVersion = "81.5.2";
|
|
24
24
|
var CardBase = exports.CardBase = function CardBase(_ref) {
|
|
25
25
|
var identifier = _ref.identifier,
|
|
26
26
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -92,6 +92,7 @@ var CardViewBase = exports.CardViewBase = function CardViewBase(_ref) {
|
|
|
92
92
|
onSvgLoad = _ref.onSvgLoad,
|
|
93
93
|
traceId = _ref.traceId,
|
|
94
94
|
isAIGenerating = _ref.isAIGenerating,
|
|
95
|
+
isCWR = _ref.isCWR,
|
|
95
96
|
backgroundColor = _ref.backgroundColor;
|
|
96
97
|
var intl = (0, _reactIntl.useIntl)();
|
|
97
98
|
var _useState = (0, _react.useState)(false),
|
|
@@ -338,6 +339,9 @@ var CardViewBase = exports.CardViewBase = function CardViewBase(_ref) {
|
|
|
338
339
|
}, /*#__PURE__*/_react.default.createElement(_playButton.PlayButton, null)), renderAIBorderOverride ? /*#__PURE__*/_react.default.createElement(_aiGeneratingOverlay.AIGeneratingOverlay, {
|
|
339
340
|
label: intl.formatMessage(i18n.aiGeneratingImage),
|
|
340
341
|
testId: "media-card-ai-generating-overlay"
|
|
342
|
+
// CWR renders the overlay opaque so it also masks the generic type icon.
|
|
343
|
+
,
|
|
344
|
+
isOpaque: isCWR
|
|
341
345
|
}) : renderBlanket && /*#__PURE__*/_react.default.createElement(_blanket.Blanket, {
|
|
342
346
|
isFixed: isFixedBlanket
|
|
343
347
|
}), renderTitleBox && /*#__PURE__*/_react.default.createElement(_titleBox.TitleBox, {
|
|
@@ -88,6 +88,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
88
88
|
titleBoxIcon = _ref.titleBoxIcon,
|
|
89
89
|
backgroundColor = _ref.backgroundColor,
|
|
90
90
|
isAIGenerating = _ref.isAIGenerating,
|
|
91
|
+
isCWR = _ref.isCWR,
|
|
91
92
|
onPreviewRender = _ref.onPreviewRender,
|
|
92
93
|
shouldHideTooltip = _ref.shouldHideTooltip,
|
|
93
94
|
mediaViewerItems = _ref.mediaViewerItems,
|
|
@@ -778,7 +779,8 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
778
779
|
mediaCardCursor: mediaCardCursor,
|
|
779
780
|
shouldHideTooltip: shouldHideTooltip,
|
|
780
781
|
overriddenCreationDate: overridenDate,
|
|
781
|
-
isAIGenerating: isAIGenerating
|
|
782
|
+
isAIGenerating: isAIGenerating,
|
|
783
|
+
isCWR: isCWR
|
|
782
784
|
});
|
|
783
785
|
return isLazyWithOverride ? /*#__PURE__*/_react.default.createElement(_viewportDetector.ViewportDetector, {
|
|
784
786
|
cardEl: cardElement,
|
|
@@ -87,7 +87,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
87
87
|
}(_react.default.Component);
|
|
88
88
|
(0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
89
89
|
var packageName = "@atlaskit/media-card";
|
|
90
|
-
var packageVersion = "81.5.
|
|
90
|
+
var packageVersion = "81.5.2";
|
|
91
91
|
|
|
92
92
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
93
93
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
@@ -116,7 +116,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
116
116
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
117
117
|
var analyticsContext = {
|
|
118
118
|
packageVersion: "@atlaskit/media-card",
|
|
119
|
-
packageName: "81.5.
|
|
119
|
+
packageName: "81.5.2",
|
|
120
120
|
componentName: 'mediaInlineCard',
|
|
121
121
|
component: 'mediaInlineCard'
|
|
122
122
|
};
|
|
@@ -19,7 +19,7 @@ var _globalScope = require("./globalScope/globalScope");
|
|
|
19
19
|
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; }
|
|
20
20
|
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; }
|
|
21
21
|
var packageName = "@atlaskit/media-card";
|
|
22
|
-
var packageVersion = "81.5.
|
|
22
|
+
var packageVersion = "81.5.2";
|
|
23
23
|
var SAMPLE_RATE = 0.05;
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
|
|
16
16
|
._bfhk15uy{background-color:var(--ds-background-neutral,hsla(0,0%,100%,.3))}
|
|
17
17
|
._bfhk1e9t{background-color:var(--ds-blanket,rgba(9,30,66,.36))}
|
|
18
|
+
._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
|
|
18
19
|
._i0dl1x1l{flex-basis:25%}
|
|
19
20
|
._kqswh2mm{position:relative}
|
|
20
21
|
._kqswstnw{position:absolute}
|
|
@@ -4,6 +4,10 @@ import "./AIGeneratingOverlay.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
const overlayStyles = null;
|
|
7
|
+
const backgroundStyles = {
|
|
8
|
+
blanket: "_bfhk1e9t",
|
|
9
|
+
sunken: "_bfhkhfxm"
|
|
10
|
+
};
|
|
7
11
|
const progressBarTrackStyles = null;
|
|
8
12
|
const RAINBOW_TRAIN_COLORS = ["var(--ds-chart-categorical-4, #F68909)", // orange
|
|
9
13
|
"var(--ds-chart-categorical-2, #82B536)", // green
|
|
@@ -15,12 +19,13 @@ const trainStyles = null;
|
|
|
15
19
|
const trainBlockStyles = null;
|
|
16
20
|
export function AIGeneratingOverlay({
|
|
17
21
|
label,
|
|
18
|
-
testId
|
|
22
|
+
testId,
|
|
23
|
+
isOpaque
|
|
19
24
|
}) {
|
|
20
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
21
26
|
"data-testid": testId !== null && testId !== void 0 ? testId : 'ai-generating-overlay',
|
|
22
27
|
role: "presentation",
|
|
23
|
-
className: ax(["_1r04idpf _kqswstnw _1e0c1txw _4cvresu3 _1bah1h6o _85i5utpp _lcxv1wug
|
|
28
|
+
className: ax(["_1r04idpf _kqswstnw _1e0c1txw _4cvresu3 _1bah1h6o _85i5utpp _lcxv1wug _1pbyqfx8", backgroundStyles[isOpaque ? 'sunken' : 'blanket']])
|
|
24
29
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25
30
|
role: "progressbar",
|
|
26
31
|
"aria-label": label,
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -9,7 +9,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
|
|
|
9
9
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
10
|
import UFOLabel from '@atlaskit/react-ufo/label';
|
|
11
11
|
const packageName = "@atlaskit/media-card";
|
|
12
|
-
const packageVersion = "81.5.
|
|
12
|
+
const packageVersion = "81.5.2";
|
|
13
13
|
export const CardBase = ({
|
|
14
14
|
identifier,
|
|
15
15
|
...otherProps
|
|
@@ -77,6 +77,7 @@ export const CardViewBase = ({
|
|
|
77
77
|
onSvgLoad,
|
|
78
78
|
traceId,
|
|
79
79
|
isAIGenerating,
|
|
80
|
+
isCWR,
|
|
80
81
|
backgroundColor
|
|
81
82
|
}) => {
|
|
82
83
|
const intl = useIntl();
|
|
@@ -327,6 +328,9 @@ export const CardViewBase = ({
|
|
|
327
328
|
}, /*#__PURE__*/React.createElement(PlayButton, null)), renderAIBorderOverride ? /*#__PURE__*/React.createElement(AIGeneratingOverlay, {
|
|
328
329
|
label: intl.formatMessage(i18n.aiGeneratingImage),
|
|
329
330
|
testId: "media-card-ai-generating-overlay"
|
|
331
|
+
// CWR renders the overlay opaque so it also masks the generic type icon.
|
|
332
|
+
,
|
|
333
|
+
isOpaque: isCWR
|
|
330
334
|
}) : renderBlanket && /*#__PURE__*/React.createElement(Blanket, {
|
|
331
335
|
isFixed: isFixedBlanket
|
|
332
336
|
}), renderTitleBox && /*#__PURE__*/React.createElement(TitleBox, {
|
|
@@ -69,6 +69,7 @@ export const FileCard = ({
|
|
|
69
69
|
titleBoxIcon,
|
|
70
70
|
backgroundColor,
|
|
71
71
|
isAIGenerating,
|
|
72
|
+
isCWR,
|
|
72
73
|
onPreviewRender,
|
|
73
74
|
shouldHideTooltip,
|
|
74
75
|
mediaViewerItems,
|
|
@@ -695,7 +696,8 @@ export const FileCard = ({
|
|
|
695
696
|
mediaCardCursor: mediaCardCursor,
|
|
696
697
|
shouldHideTooltip: shouldHideTooltip,
|
|
697
698
|
overriddenCreationDate: overridenDate,
|
|
698
|
-
isAIGenerating: isAIGenerating
|
|
699
|
+
isAIGenerating: isAIGenerating,
|
|
700
|
+
isCWR: isCWR
|
|
699
701
|
});
|
|
700
702
|
return isLazyWithOverride ? /*#__PURE__*/React.createElement(ViewportDetector, {
|
|
701
703
|
cardEl: cardElement,
|
|
@@ -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 = "81.5.
|
|
69
|
+
const packageVersion = "81.5.2";
|
|
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({
|
|
@@ -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: "81.5.
|
|
40
|
+
packageName: "81.5.2",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -9,7 +9,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
|
9
9
|
import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
10
10
|
import { getMediaGlobalScope } from './globalScope/globalScope';
|
|
11
11
|
const packageName = "@atlaskit/media-card";
|
|
12
|
-
const packageVersion = "81.5.
|
|
12
|
+
const packageVersion = "81.5.2";
|
|
13
13
|
const SAMPLE_RATE = 0.05;
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
._85i5utpp{padding-block-end:var(--ds-space-150,9pt)}
|
|
16
16
|
._bfhk15uy{background-color:var(--ds-background-neutral,hsla(0,0%,100%,.3))}
|
|
17
17
|
._bfhk1e9t{background-color:var(--ds-blanket,rgba(9,30,66,.36))}
|
|
18
|
+
._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
|
|
18
19
|
._i0dl1x1l{flex-basis:25%}
|
|
19
20
|
._kqswh2mm{position:relative}
|
|
20
21
|
._kqswstnw{position:absolute}
|
|
@@ -4,6 +4,10 @@ import "./AIGeneratingOverlay.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
var overlayStyles = null;
|
|
7
|
+
var backgroundStyles = {
|
|
8
|
+
blanket: "_bfhk1e9t",
|
|
9
|
+
sunken: "_bfhkhfxm"
|
|
10
|
+
};
|
|
7
11
|
var progressBarTrackStyles = null;
|
|
8
12
|
var RAINBOW_TRAIN_COLORS = ["var(--ds-chart-categorical-4, #F68909)", // orange
|
|
9
13
|
"var(--ds-chart-categorical-2, #82B536)", // green
|
|
@@ -15,11 +19,12 @@ var trainStyles = null;
|
|
|
15
19
|
var trainBlockStyles = null;
|
|
16
20
|
export function AIGeneratingOverlay(_ref) {
|
|
17
21
|
var label = _ref.label,
|
|
18
|
-
testId = _ref.testId
|
|
22
|
+
testId = _ref.testId,
|
|
23
|
+
isOpaque = _ref.isOpaque;
|
|
19
24
|
return /*#__PURE__*/React.createElement("div", {
|
|
20
25
|
"data-testid": testId !== null && testId !== void 0 ? testId : 'ai-generating-overlay',
|
|
21
26
|
role: "presentation",
|
|
22
|
-
className: ax(["_1r04idpf _kqswstnw _1e0c1txw _4cvresu3 _1bah1h6o _85i5utpp _lcxv1wug
|
|
27
|
+
className: ax(["_1r04idpf _kqswstnw _1e0c1txw _4cvresu3 _1bah1h6o _85i5utpp _lcxv1wug _1pbyqfx8", backgroundStyles[isOpaque ? 'sunken' : 'blanket']])
|
|
23
28
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24
29
|
role: "progressbar",
|
|
25
30
|
"aria-label": label,
|
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 UFOLabel from '@atlaskit/react-ufo/label';
|
|
13
13
|
var packageName = "@atlaskit/media-card";
|
|
14
|
-
var packageVersion = "81.5.
|
|
14
|
+
var packageVersion = "81.5.2";
|
|
15
15
|
export var CardBase = function CardBase(_ref) {
|
|
16
16
|
var identifier = _ref.identifier,
|
|
17
17
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -83,6 +83,7 @@ export var CardViewBase = function CardViewBase(_ref) {
|
|
|
83
83
|
onSvgLoad = _ref.onSvgLoad,
|
|
84
84
|
traceId = _ref.traceId,
|
|
85
85
|
isAIGenerating = _ref.isAIGenerating,
|
|
86
|
+
isCWR = _ref.isCWR,
|
|
86
87
|
backgroundColor = _ref.backgroundColor;
|
|
87
88
|
var intl = useIntl();
|
|
88
89
|
var _useState = useState(false),
|
|
@@ -329,6 +330,9 @@ export var CardViewBase = function CardViewBase(_ref) {
|
|
|
329
330
|
}, /*#__PURE__*/React.createElement(PlayButton, null)), renderAIBorderOverride ? /*#__PURE__*/React.createElement(AIGeneratingOverlay, {
|
|
330
331
|
label: intl.formatMessage(i18n.aiGeneratingImage),
|
|
331
332
|
testId: "media-card-ai-generating-overlay"
|
|
333
|
+
// CWR renders the overlay opaque so it also masks the generic type icon.
|
|
334
|
+
,
|
|
335
|
+
isOpaque: isCWR
|
|
332
336
|
}) : renderBlanket && /*#__PURE__*/React.createElement(Blanket, {
|
|
333
337
|
isFixed: isFixedBlanket
|
|
334
338
|
}), renderTitleBox && /*#__PURE__*/React.createElement(TitleBox, {
|
|
@@ -80,6 +80,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
80
80
|
titleBoxIcon = _ref.titleBoxIcon,
|
|
81
81
|
backgroundColor = _ref.backgroundColor,
|
|
82
82
|
isAIGenerating = _ref.isAIGenerating,
|
|
83
|
+
isCWR = _ref.isCWR,
|
|
83
84
|
onPreviewRender = _ref.onPreviewRender,
|
|
84
85
|
shouldHideTooltip = _ref.shouldHideTooltip,
|
|
85
86
|
mediaViewerItems = _ref.mediaViewerItems,
|
|
@@ -770,7 +771,8 @@ export var FileCard = function FileCard(_ref) {
|
|
|
770
771
|
mediaCardCursor: mediaCardCursor,
|
|
771
772
|
shouldHideTooltip: shouldHideTooltip,
|
|
772
773
|
overriddenCreationDate: overridenDate,
|
|
773
|
-
isAIGenerating: isAIGenerating
|
|
774
|
+
isAIGenerating: isAIGenerating,
|
|
775
|
+
isCWR: isCWR
|
|
774
776
|
});
|
|
775
777
|
return isLazyWithOverride ? /*#__PURE__*/React.createElement(ViewportDetector, {
|
|
776
778
|
cardEl: cardElement,
|
|
@@ -80,7 +80,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
80
80
|
}(React.Component);
|
|
81
81
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
82
82
|
var packageName = "@atlaskit/media-card";
|
|
83
|
-
var packageVersion = "81.5.
|
|
83
|
+
var packageVersion = "81.5.2";
|
|
84
84
|
|
|
85
85
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
86
86
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
@@ -101,7 +101,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
101
101
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
102
102
|
var analyticsContext = {
|
|
103
103
|
packageVersion: "@atlaskit/media-card",
|
|
104
|
-
packageName: "81.5.
|
|
104
|
+
packageName: "81.5.2",
|
|
105
105
|
componentName: 'mediaInlineCard',
|
|
106
106
|
component: 'mediaInlineCard'
|
|
107
107
|
};
|
|
@@ -13,7 +13,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
|
13
13
|
import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
14
14
|
import { getMediaGlobalScope } from './globalScope/globalScope';
|
|
15
15
|
var packageName = "@atlaskit/media-card";
|
|
16
|
-
var packageVersion = "81.5.
|
|
16
|
+
var packageVersion = "81.5.2";
|
|
17
17
|
var SAMPLE_RATE = 0.05;
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -8,5 +8,7 @@ export type AIGeneratingOverlayProps = {
|
|
|
8
8
|
label: string;
|
|
9
9
|
/** Optional test id for the overlay root element. Defaults to `'ai-generating-overlay'`. */
|
|
10
10
|
testId?: string;
|
|
11
|
+
/** Renders an opaque sunken surface instead of the translucent blanket. */
|
|
12
|
+
isOpaque?: boolean;
|
|
11
13
|
};
|
|
12
|
-
export declare function AIGeneratingOverlay({ label, testId }: AIGeneratingOverlayProps): JSX.Element;
|
|
14
|
+
export declare function AIGeneratingOverlay({ label, testId, isOpaque, }: AIGeneratingOverlayProps): JSX.Element;
|
|
@@ -43,6 +43,7 @@ export interface CardViewProps {
|
|
|
43
43
|
shouldHideTooltip?: boolean;
|
|
44
44
|
overriddenCreationDate?: number;
|
|
45
45
|
readonly isAIGenerating?: boolean;
|
|
46
|
+
readonly isCWR?: boolean;
|
|
46
47
|
}
|
|
47
48
|
export type CardViewBaseProps = CardViewProps & WithAnalyticsEventsProps;
|
|
48
49
|
type TraceTooltipVariant = 'preview-unavailable' | 'failed-to-load';
|
|
@@ -63,6 +64,6 @@ export interface RenderConfigByStatus {
|
|
|
63
64
|
customTitleMessage?: MessageDescriptor;
|
|
64
65
|
traceTooltipVariant?: TraceTooltipVariant;
|
|
65
66
|
}
|
|
66
|
-
export declare const CardViewBase: ({ identifier, innerRef, onImageLoad, onImageError, dimensions, onClick, onMouseEnter, testId, metadata, status, selected, selectable, cardPreview, mediaCardCursor, shouldHideTooltip, progress, alt, resizeMode, onDisplayImage, nativeLazyLoad, forceSyncDisplay, actions, disableOverlay, titleBoxBgColor, titleBoxIcon, error, disableAnimation, openMediaViewerButtonRef, shouldOpenMediaViewer, overriddenCreationDate, onSvgError, onSvgLoad, traceId, isAIGenerating, backgroundColor, }: CardViewBaseProps) => React.JSX.Element;
|
|
67
|
+
export declare const CardViewBase: ({ identifier, innerRef, onImageLoad, onImageError, dimensions, onClick, onMouseEnter, testId, metadata, status, selected, selectable, cardPreview, mediaCardCursor, shouldHideTooltip, progress, alt, resizeMode, onDisplayImage, nativeLazyLoad, forceSyncDisplay, actions, disableOverlay, titleBoxBgColor, titleBoxIcon, error, disableAnimation, openMediaViewerButtonRef, shouldOpenMediaViewer, overriddenCreationDate, onSvgError, onSvgLoad, traceId, isAIGenerating, isCWR, backgroundColor, }: CardViewBaseProps) => React.JSX.Element;
|
|
67
68
|
export declare const CardView: React.ForwardRefExoticComponent<Omit<CardViewProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
68
69
|
export {};
|
|
@@ -37,6 +37,8 @@ export interface FileCardProps extends CardEventProps {
|
|
|
37
37
|
readonly backgroundColor?: React.CSSProperties['backgroundColor'];
|
|
38
38
|
/** Indicates the media card is being generated by AI (e.g. Rovo image-create). */
|
|
39
39
|
readonly isAIGenerating?: boolean;
|
|
40
|
+
/** Marks the card as part of the CWR (create-with-Rovo) infographics flow. */
|
|
41
|
+
readonly isCWR?: boolean;
|
|
40
42
|
/** Callback fired when the media card's image preview has rendered. */
|
|
41
43
|
readonly onPreviewRender?: (fileId: string) => void;
|
|
42
44
|
/** Instance of file identifier. */
|
|
@@ -84,4 +86,4 @@ export interface FileCardProps extends CardEventProps {
|
|
|
84
86
|
*/
|
|
85
87
|
readonly fallbackMediaNameFetcher?: (id: string) => Promise<string>;
|
|
86
88
|
}
|
|
87
|
-
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, backgroundColor, isAIGenerating, onPreviewRender, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, ssrFileState, onError, mediaViewerExtensions, fallbackMediaNameFetcher, }: FileCardProps) => React.JSX.Element;
|
|
89
|
+
export declare const FileCard: ({ appearance, resizeMode, isLazy, disableOverlay, featureFlags, identifier, ssr, dimensions, originalDimensions, contextId, alt, actions, shouldEnableDownloadButton, useInlinePlayer, shouldOpenMediaViewer, onFullscreenChange, selectable, selected, testId, titleBoxBgColor, titleBoxIcon, backgroundColor, isAIGenerating, isCWR, onPreviewRender, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, ssrFileState, onError, mediaViewerExtensions, fallbackMediaNameFetcher, }: FileCardProps) => React.JSX.Element;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export interface SharedCardProps {
|
|
|
68
68
|
readonly backgroundColor?: React.CSSProperties['backgroundColor'];
|
|
69
69
|
readonly titleBoxIcon?: TitleBoxIcon;
|
|
70
70
|
readonly isAIGenerating?: boolean;
|
|
71
|
+
readonly isCWR?: boolean;
|
|
71
72
|
readonly onPreviewRender?: (fileId: string) => void;
|
|
72
73
|
readonly viewerOptions?: ViewerOptionsProps;
|
|
73
74
|
/** Sets options for viewer **/
|
package/package.json
CHANGED