@atlaskit/media-card 80.1.4 → 80.2.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 +25 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/cardView.js +32 -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/ui/aiBorder/aiBorder.compiled.css +16 -0
- package/dist/cjs/card/ui/aiBorder/aiBorder.js +79 -0
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/cardView.js +32 -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/ui/aiBorder/aiBorder.compiled.css +16 -0
- package/dist/es2019/card/ui/aiBorder/aiBorder.js +83 -0
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/cardView.js +32 -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/ui/aiBorder/aiBorder.compiled.css +16 -0
- package/dist/esm/card/ui/aiBorder/aiBorder.js +71 -0
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/cardView.d.ts +3 -1
- package/dist/types/card/fileCard.d.ts +3 -1
- package/dist/types/card/ui/aiBorder/aiBorder.d.ts +3 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types-ts4.5/card/cardView.d.ts +3 -1
- package/dist/types-ts4.5/card/fileCard.d.ts +3 -1
- package/dist/types-ts4.5/card/ui/aiBorder/aiBorder.d.ts +3 -0
- package/dist/types-ts4.5/types.d.ts +1 -0
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 80.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`a0b1822615d7e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a0b1822615d7e) -
|
|
8
|
+
Refactor inline editor AI image generation loading state to use ProseMirror decorations:
|
|
9
|
+
- Add AI generating decoration plugin to editor-plugin-media for transient visual state tracking
|
|
10
|
+
via ProseMirror decorations instead of ADF schema attributes
|
|
11
|
+
- Remove \_\_isAIGenerating transient attribute from ADF media node schema
|
|
12
|
+
- Update editor-rovo-bridge to dispatch decoration meta instead of mutating node attributes
|
|
13
|
+
- Media NodeView reads decoration state and passes isAIGenerating prop to media-card
|
|
14
|
+
- AIBorder component with pulsing gradient border and translucent blanket during AI image
|
|
15
|
+
generation
|
|
16
|
+
- Internationalized AI generating progress bar aria label
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
22
|
+
## 80.1.5
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 80.1.4
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
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 = "80.1.
|
|
23
|
+
var packageVersion = "80.1.5";
|
|
24
24
|
var CardBase = exports.CardBase = function CardBase(_ref) {
|
|
25
25
|
var identifier = _ref.identifier,
|
|
26
26
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -25,6 +25,8 @@ var _progressBar = require("./ui/progressBar/progressBar");
|
|
|
25
25
|
var _playButton = require("./ui/playButton/playButton");
|
|
26
26
|
var _tickBox = require("./ui/tickBox/tickBox");
|
|
27
27
|
var _blanket = require("./ui/blanket/blanket");
|
|
28
|
+
var _progressBar2 = require("@atlaskit/progress-bar");
|
|
29
|
+
var _aiBorder = require("./ui/aiBorder/aiBorder");
|
|
28
30
|
var _actionsBar = require("./ui/actionsBar/actionsBar");
|
|
29
31
|
var _iconWrapper = require("./ui/iconWrapper/iconWrapper");
|
|
30
32
|
var _iconMessage2 = require("./ui/iconMessage");
|
|
@@ -45,8 +47,21 @@ var i18n = (0, _reactIntl.defineMessages)({
|
|
|
45
47
|
id: 'fabric.media.trace_id_tooltip',
|
|
46
48
|
defaultMessage: 'Use Trace ID {traceId} when reaching out to support.',
|
|
47
49
|
description: 'Tooltip content showing the trace identifier for troubleshooting file preview errors'
|
|
50
|
+
},
|
|
51
|
+
aiGeneratingImage: {
|
|
52
|
+
id: 'fabric.media.ai_generating_image',
|
|
53
|
+
defaultMessage: 'AI generating image',
|
|
54
|
+
description: 'Accessible label for the progress bar shown while AI is generating an image on the media card'
|
|
48
55
|
}
|
|
49
56
|
});
|
|
57
|
+
var aiProgressBarWrapperStyle = {
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
top: '50%',
|
|
60
|
+
left: '50%',
|
|
61
|
+
transform: 'translate(-50%, -50%)',
|
|
62
|
+
width: '60%',
|
|
63
|
+
zIndex: 2
|
|
64
|
+
};
|
|
50
65
|
var CardViewBase = exports.CardViewBase = function CardViewBase(_ref) {
|
|
51
66
|
var identifier = _ref.identifier,
|
|
52
67
|
_ref$innerRef = _ref.innerRef,
|
|
@@ -82,7 +97,8 @@ var CardViewBase = exports.CardViewBase = function CardViewBase(_ref) {
|
|
|
82
97
|
overriddenCreationDate = _ref.overriddenCreationDate,
|
|
83
98
|
onSvgError = _ref.onSvgError,
|
|
84
99
|
onSvgLoad = _ref.onSvgLoad,
|
|
85
|
-
traceId = _ref.traceId
|
|
100
|
+
traceId = _ref.traceId,
|
|
101
|
+
isAIGenerating = _ref.isAIGenerating;
|
|
86
102
|
var intl = (0, _reactIntl.useIntl)();
|
|
87
103
|
var _useState = (0, _react.useState)(false),
|
|
88
104
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -156,7 +172,7 @@ var CardViewBase = exports.CardViewBase = function CardViewBase(_ref) {
|
|
|
156
172
|
return _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
157
173
|
renderBlanket: !disableOverlay || mediaType !== 'video',
|
|
158
174
|
isFixedBlanket: true,
|
|
159
|
-
renderProgressBar:
|
|
175
|
+
renderProgressBar: !isAIGenerating
|
|
160
176
|
});
|
|
161
177
|
case 'processing':
|
|
162
178
|
return _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
@@ -229,6 +245,11 @@ var CardViewBase = exports.CardViewBase = function CardViewBase(_ref) {
|
|
|
229
245
|
isFixedBlanket = _getRenderConfigBySta.isFixedBlanket,
|
|
230
246
|
customTitleMessage = _getRenderConfigBySta.customTitleMessage,
|
|
231
247
|
traceTooltipVariant = _getRenderConfigBySta.traceTooltipVariant;
|
|
248
|
+
|
|
249
|
+
// When AI is generating, always show the AI border.
|
|
250
|
+
// The AI generating decoration is cleared when the replacement upload completes,
|
|
251
|
+
// so we don't need to check status here.
|
|
252
|
+
var renderAIBorderOverride = !!isAIGenerating && (0, _platformFeatureFlags.fg)('platform_editor_maui_edit');
|
|
232
253
|
var shouldDisplayBackground = !cardPreview || !disableOverlay || status === 'error' || status === 'failed-processing';
|
|
233
254
|
var isPlayButtonClickable = shouldRenderPlayButton() && !!disableOverlay;
|
|
234
255
|
var isTickBoxSelectable = !disableOverlay && !!selectable && !selected;
|
|
@@ -314,7 +335,14 @@ var CardViewBase = exports.CardViewBase = function CardViewBase(_ref) {
|
|
|
314
335
|
}), renderPlayButton && /*#__PURE__*/_react.default.createElement(_iconWrapper.IconWrapper, {
|
|
315
336
|
breakpoint: breakpoint,
|
|
316
337
|
hasTitleBox: hasVisibleTitleBox
|
|
317
|
-
}, /*#__PURE__*/_react.default.createElement(_playButton.PlayButton, null)),
|
|
338
|
+
}, /*#__PURE__*/_react.default.createElement(_playButton.PlayButton, null)), renderAIBorderOverride ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_blanket.Blanket, {
|
|
339
|
+
isFixed: true
|
|
340
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
341
|
+
style: aiProgressBarWrapperStyle
|
|
342
|
+
}, /*#__PURE__*/_react.default.createElement(_progressBar2.TransparentProgressBar, {
|
|
343
|
+
isIndeterminate: true,
|
|
344
|
+
ariaLabel: intl.formatMessage(i18n.aiGeneratingImage)
|
|
345
|
+
}))) : renderBlanket && /*#__PURE__*/_react.default.createElement(_blanket.Blanket, {
|
|
318
346
|
isFixed: isFixedBlanket
|
|
319
347
|
}), renderTitleBox && /*#__PURE__*/_react.default.createElement(_titleBox.TitleBox, {
|
|
320
348
|
name: name,
|
|
@@ -332,7 +360,7 @@ var CardViewBase = exports.CardViewBase = function CardViewBase(_ref) {
|
|
|
332
360
|
positionBottom: !hasVisibleTitleBox
|
|
333
361
|
}), renderTickBox && /*#__PURE__*/_react.default.createElement(_tickBox.TickBox, {
|
|
334
362
|
selected: selected
|
|
335
|
-
})), disableOverlay || !actions || actions.length === 0 ? null : /*#__PURE__*/_react.default.createElement(_actionsBar.ActionsBar, {
|
|
363
|
+
})), renderAIBorderOverride && /*#__PURE__*/_react.default.createElement(_aiBorder.AIBorder, null), disableOverlay || !actions || actions.length === 0 ? null : /*#__PURE__*/_react.default.createElement(_actionsBar.ActionsBar, {
|
|
336
364
|
filename: name,
|
|
337
365
|
actions: actionsWithDetails
|
|
338
366
|
}));
|
|
@@ -85,6 +85,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
85
85
|
testId = _ref.testId,
|
|
86
86
|
titleBoxBgColor = _ref.titleBoxBgColor,
|
|
87
87
|
titleBoxIcon = _ref.titleBoxIcon,
|
|
88
|
+
isAIGenerating = _ref.isAIGenerating,
|
|
88
89
|
shouldHideTooltip = _ref.shouldHideTooltip,
|
|
89
90
|
mediaViewerItems = _ref.mediaViewerItems,
|
|
90
91
|
onClick = _ref.onClick,
|
|
@@ -737,7 +738,8 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
737
738
|
traceId: traceContext.traceId,
|
|
738
739
|
mediaCardCursor: mediaCardCursor,
|
|
739
740
|
shouldHideTooltip: shouldHideTooltip,
|
|
740
|
-
overriddenCreationDate: overridenDate
|
|
741
|
+
overriddenCreationDate: overridenDate,
|
|
742
|
+
isAIGenerating: isAIGenerating
|
|
741
743
|
});
|
|
742
744
|
return isLazyWithOverride ? /*#__PURE__*/_react.default.createElement(_viewportDetector.ViewportDetector, {
|
|
743
745
|
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 = "80.1.
|
|
90
|
+
var packageVersion = "80.1.5";
|
|
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)({
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko16zz{border-radius:calc(var(--ds-radius-large, 3px) + 2px)}._154i12gs{top:-2px}
|
|
3
|
+
._19bvv77o{padding-left:var(--ds-space-025,2px)}
|
|
4
|
+
._1bsb1pbc{width:calc(100% + 4px)}
|
|
5
|
+
._1ltv12gs{left:-2px}
|
|
6
|
+
._1pbykb7n{z-index:1}
|
|
7
|
+
._31mtepuu{-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0)}
|
|
8
|
+
._4t3i1pbc{height:calc(100% + 4px)}
|
|
9
|
+
._8tnt1p67{-webkit-mask-composite:xor;mask-composite:exclude}
|
|
10
|
+
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
11
|
+
._g3cmkvto{-webkit-mask-composite:xor}
|
|
12
|
+
._kqswstnw{position:absolute}
|
|
13
|
+
._lcxvglyw{pointer-events:none}
|
|
14
|
+
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
15
|
+
._u5f3v77o{padding-right:var(--ds-space-025,2px)}
|
|
16
|
+
@media (prefers-reduced-motion){._1pldglyw{animation-name:none}}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* aiBorder.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.AIBorder = void 0;
|
|
9
|
+
require("./aiBorder.compiled.css");
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var React = _react;
|
|
12
|
+
var _runtime = require("@compiled/react/runtime");
|
|
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
|
+
// ── Rovo gradient animation setup ───────────────────────────────────────────
|
|
15
|
+
// Mirrors the shared rovo-gradient component but self-contained to avoid
|
|
16
|
+
// circular dependency (media-card cannot depend on rovo-platform-ui-components).
|
|
17
|
+
|
|
18
|
+
var propertyRegistered = false;
|
|
19
|
+
function ensureGradientAngleRegistered() {
|
|
20
|
+
if (propertyRegistered) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (typeof window === 'undefined' || typeof CSS === 'undefined') {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
propertyRegistered = true;
|
|
27
|
+
try {
|
|
28
|
+
if (typeof CSS.registerProperty === 'function') {
|
|
29
|
+
CSS.registerProperty({
|
|
30
|
+
name: '--gradient-angle',
|
|
31
|
+
syntax: '<angle>',
|
|
32
|
+
initialValue: '270deg',
|
|
33
|
+
inherits: false
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
} catch (_unused) {
|
|
37
|
+
// Already registered or unsupported
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
var GRADIENT_BACKGROUND = "conic-gradient(\n\tfrom var(--gradient-angle, 45deg),\n\t#FCA700 0%,\n\t#6A9A23 25%,\n\t#1868DB 50%,\n\t#AF59E0 75%,\n\t#FCA700 100%\n)";
|
|
41
|
+
var KEYFRAMES_CSS = "\n@keyframes rovoGradientRotation {\n\t0% { --gradient-angle: 0deg; }\n\t100% { --gradient-angle: 360deg; }\n}\n";
|
|
42
|
+
|
|
43
|
+
// ── Component ───────────────────────────────────────────────────────────────
|
|
44
|
+
|
|
45
|
+
var borderStyles = null;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* AIBorder renders an animated rainbow border as a positioned overlay.
|
|
49
|
+
* Uses the same Rovo gradient colors as rovo-platform-ui-components for
|
|
50
|
+
* consistent branding across all AI-related border animations.
|
|
51
|
+
*
|
|
52
|
+
* Must be placed inside a positioned container with no overflow:hidden.
|
|
53
|
+
* Uses CSS mask to show only the border ring (not the fill).
|
|
54
|
+
*/
|
|
55
|
+
var AIBorderComponent = function AIBorderComponent() {
|
|
56
|
+
(0, _react.useEffect)(function () {
|
|
57
|
+
ensureGradientAngleRegistered();
|
|
58
|
+
}, []);
|
|
59
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
"data-testid": "media-card-ai-border"
|
|
61
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- pointerEvents cannot be set via css prop on a wrapper div without compiled
|
|
62
|
+
,
|
|
63
|
+
style: {
|
|
64
|
+
pointerEvents: 'none'
|
|
65
|
+
}
|
|
66
|
+
}, /*#__PURE__*/React.createElement("style", {
|
|
67
|
+
dangerouslySetInnerHTML: {
|
|
68
|
+
__html: KEYFRAMES_CSS
|
|
69
|
+
}
|
|
70
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
style: {
|
|
72
|
+
background: GRADIENT_BACKGROUND,
|
|
73
|
+
animation: 'rovoGradientRotation linear 2s infinite'
|
|
74
|
+
},
|
|
75
|
+
className: (0, _runtime.ax)(["_2rko16zz _kqswstnw _154i12gs _1ltv12gs _1bsb1pbc _4t3i1pbc _lcxvglyw _1pbykb7n _31mtepuu _g3cmkvto _8tnt1p67 _ca0qv77o _u5f3v77o _n3tdv77o _19bvv77o _1pldglyw"])
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
78
|
+
AIBorderComponent.displayName = 'AIBorder';
|
|
79
|
+
var AIBorder = exports.AIBorder = AIBorderComponent;
|
|
@@ -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: "80.1.
|
|
119
|
+
packageName: "80.1.5",
|
|
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 = "80.1.
|
|
22
|
+
var packageVersion = "80.1.5";
|
|
23
23
|
var SAMPLE_RATE = 0.05;
|
|
24
24
|
|
|
25
25
|
/**
|
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 = "80.1.
|
|
12
|
+
const packageVersion = "80.1.5";
|
|
13
13
|
export const CardBase = ({
|
|
14
14
|
identifier,
|
|
15
15
|
...otherProps
|
|
@@ -15,6 +15,8 @@ import { ProgressBar } from './ui/progressBar/progressBar';
|
|
|
15
15
|
import { PlayButton } from './ui/playButton/playButton';
|
|
16
16
|
import { TickBox } from './ui/tickBox/tickBox';
|
|
17
17
|
import { Blanket } from './ui/blanket/blanket';
|
|
18
|
+
import { TransparentProgressBar } from '@atlaskit/progress-bar';
|
|
19
|
+
import { AIBorder } from './ui/aiBorder/aiBorder';
|
|
18
20
|
import { ActionsBar } from './ui/actionsBar/actionsBar';
|
|
19
21
|
import { IconWrapper } from './ui/iconWrapper/iconWrapper';
|
|
20
22
|
import { PreviewUnavailable, CreatingPreview, FailedToUpload, FailedToLoad, CheckInternetConnection } from './ui/iconMessage';
|
|
@@ -32,8 +34,21 @@ const i18n = defineMessages({
|
|
|
32
34
|
id: 'fabric.media.trace_id_tooltip',
|
|
33
35
|
defaultMessage: 'Use Trace ID {traceId} when reaching out to support.',
|
|
34
36
|
description: 'Tooltip content showing the trace identifier for troubleshooting file preview errors'
|
|
37
|
+
},
|
|
38
|
+
aiGeneratingImage: {
|
|
39
|
+
id: 'fabric.media.ai_generating_image',
|
|
40
|
+
defaultMessage: 'AI generating image',
|
|
41
|
+
description: 'Accessible label for the progress bar shown while AI is generating an image on the media card'
|
|
35
42
|
}
|
|
36
43
|
});
|
|
44
|
+
const aiProgressBarWrapperStyle = {
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
top: '50%',
|
|
47
|
+
left: '50%',
|
|
48
|
+
transform: 'translate(-50%, -50%)',
|
|
49
|
+
width: '60%',
|
|
50
|
+
zIndex: 2
|
|
51
|
+
};
|
|
37
52
|
export const CardViewBase = ({
|
|
38
53
|
identifier,
|
|
39
54
|
innerRef = null,
|
|
@@ -67,7 +82,8 @@ export const CardViewBase = ({
|
|
|
67
82
|
overriddenCreationDate,
|
|
68
83
|
onSvgError,
|
|
69
84
|
onSvgLoad,
|
|
70
|
-
traceId
|
|
85
|
+
traceId,
|
|
86
|
+
isAIGenerating
|
|
71
87
|
}) => {
|
|
72
88
|
const intl = useIntl();
|
|
73
89
|
const [didSvgRender, setDidSvgRender] = useState(false);
|
|
@@ -140,7 +156,7 @@ export const CardViewBase = ({
|
|
|
140
156
|
...defaultConfig,
|
|
141
157
|
renderBlanket: !disableOverlay || mediaType !== 'video',
|
|
142
158
|
isFixedBlanket: true,
|
|
143
|
-
renderProgressBar:
|
|
159
|
+
renderProgressBar: !isAIGenerating
|
|
144
160
|
};
|
|
145
161
|
case 'processing':
|
|
146
162
|
return {
|
|
@@ -218,6 +234,11 @@ export const CardViewBase = ({
|
|
|
218
234
|
customTitleMessage,
|
|
219
235
|
traceTooltipVariant
|
|
220
236
|
} = getRenderConfigByStatus();
|
|
237
|
+
|
|
238
|
+
// When AI is generating, always show the AI border.
|
|
239
|
+
// The AI generating decoration is cleared when the replacement upload completes,
|
|
240
|
+
// so we don't need to check status here.
|
|
241
|
+
const renderAIBorderOverride = !!isAIGenerating && fg('platform_editor_maui_edit');
|
|
221
242
|
const shouldDisplayBackground = !cardPreview || !disableOverlay || status === 'error' || status === 'failed-processing';
|
|
222
243
|
const isPlayButtonClickable = shouldRenderPlayButton() && !!disableOverlay;
|
|
223
244
|
const isTickBoxSelectable = !disableOverlay && !!selectable && !selected;
|
|
@@ -303,7 +324,14 @@ export const CardViewBase = ({
|
|
|
303
324
|
}), renderPlayButton && /*#__PURE__*/React.createElement(IconWrapper, {
|
|
304
325
|
breakpoint: breakpoint,
|
|
305
326
|
hasTitleBox: hasVisibleTitleBox
|
|
306
|
-
}, /*#__PURE__*/React.createElement(PlayButton, null)),
|
|
327
|
+
}, /*#__PURE__*/React.createElement(PlayButton, null)), renderAIBorderOverride ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Blanket, {
|
|
328
|
+
isFixed: true
|
|
329
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
330
|
+
style: aiProgressBarWrapperStyle
|
|
331
|
+
}, /*#__PURE__*/React.createElement(TransparentProgressBar, {
|
|
332
|
+
isIndeterminate: true,
|
|
333
|
+
ariaLabel: intl.formatMessage(i18n.aiGeneratingImage)
|
|
334
|
+
}))) : renderBlanket && /*#__PURE__*/React.createElement(Blanket, {
|
|
307
335
|
isFixed: isFixedBlanket
|
|
308
336
|
}), renderTitleBox && /*#__PURE__*/React.createElement(TitleBox, {
|
|
309
337
|
name: name,
|
|
@@ -321,7 +349,7 @@ export const CardViewBase = ({
|
|
|
321
349
|
positionBottom: !hasVisibleTitleBox
|
|
322
350
|
}), renderTickBox && /*#__PURE__*/React.createElement(TickBox, {
|
|
323
351
|
selected: selected
|
|
324
|
-
})), disableOverlay || !actions || actions.length === 0 ? null : /*#__PURE__*/React.createElement(ActionsBar, {
|
|
352
|
+
})), renderAIBorderOverride && /*#__PURE__*/React.createElement(AIBorder, null), disableOverlay || !actions || actions.length === 0 ? null : /*#__PURE__*/React.createElement(ActionsBar, {
|
|
325
353
|
filename: name,
|
|
326
354
|
actions: actionsWithDetails
|
|
327
355
|
}));
|
|
@@ -66,6 +66,7 @@ export const FileCard = ({
|
|
|
66
66
|
testId,
|
|
67
67
|
titleBoxBgColor,
|
|
68
68
|
titleBoxIcon,
|
|
69
|
+
isAIGenerating,
|
|
69
70
|
shouldHideTooltip,
|
|
70
71
|
mediaViewerItems,
|
|
71
72
|
onClick,
|
|
@@ -657,7 +658,8 @@ export const FileCard = ({
|
|
|
657
658
|
traceId: traceContext.traceId,
|
|
658
659
|
mediaCardCursor: mediaCardCursor,
|
|
659
660
|
shouldHideTooltip: shouldHideTooltip,
|
|
660
|
-
overriddenCreationDate: overridenDate
|
|
661
|
+
overriddenCreationDate: overridenDate,
|
|
662
|
+
isAIGenerating: isAIGenerating
|
|
661
663
|
});
|
|
662
664
|
return isLazyWithOverride ? /*#__PURE__*/React.createElement(ViewportDetector, {
|
|
663
665
|
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 = "80.1.
|
|
69
|
+
const packageVersion = "80.1.5";
|
|
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({
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko16zz{border-radius:calc(var(--ds-radius-large, 3px) + 2px)}._154i12gs{top:-2px}
|
|
3
|
+
._19bvv77o{padding-left:var(--ds-space-025,2px)}
|
|
4
|
+
._1bsb1pbc{width:calc(100% + 4px)}
|
|
5
|
+
._1ltv12gs{left:-2px}
|
|
6
|
+
._1pbykb7n{z-index:1}
|
|
7
|
+
._31mtepuu{-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0)}
|
|
8
|
+
._4t3i1pbc{height:calc(100% + 4px)}
|
|
9
|
+
._8tnt1p67{-webkit-mask-composite:xor;mask-composite:exclude}
|
|
10
|
+
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
11
|
+
._g3cmkvto{-webkit-mask-composite:xor}
|
|
12
|
+
._kqswstnw{position:absolute}
|
|
13
|
+
._lcxvglyw{pointer-events:none}
|
|
14
|
+
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
15
|
+
._u5f3v77o{padding-right:var(--ds-space-025,2px)}
|
|
16
|
+
@media (prefers-reduced-motion){._1pldglyw{animation-name:none}}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* aiBorder.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import "./aiBorder.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { useEffect } from 'react';
|
|
6
|
+
// ── Rovo gradient animation setup ───────────────────────────────────────────
|
|
7
|
+
// Mirrors the shared rovo-gradient component but self-contained to avoid
|
|
8
|
+
// circular dependency (media-card cannot depend on rovo-platform-ui-components).
|
|
9
|
+
|
|
10
|
+
let propertyRegistered = false;
|
|
11
|
+
function ensureGradientAngleRegistered() {
|
|
12
|
+
if (propertyRegistered) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (typeof window === 'undefined' || typeof CSS === 'undefined') {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
propertyRegistered = true;
|
|
19
|
+
try {
|
|
20
|
+
if (typeof CSS.registerProperty === 'function') {
|
|
21
|
+
CSS.registerProperty({
|
|
22
|
+
name: '--gradient-angle',
|
|
23
|
+
syntax: '<angle>',
|
|
24
|
+
initialValue: '270deg',
|
|
25
|
+
inherits: false
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
// Already registered or unsupported
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const GRADIENT_BACKGROUND = `conic-gradient(
|
|
33
|
+
from var(--gradient-angle, 45deg),
|
|
34
|
+
#FCA700 0%,
|
|
35
|
+
#6A9A23 25%,
|
|
36
|
+
#1868DB 50%,
|
|
37
|
+
#AF59E0 75%,
|
|
38
|
+
#FCA700 100%
|
|
39
|
+
)`;
|
|
40
|
+
const KEYFRAMES_CSS = `
|
|
41
|
+
@keyframes rovoGradientRotation {
|
|
42
|
+
0% { --gradient-angle: 0deg; }
|
|
43
|
+
100% { --gradient-angle: 360deg; }
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
// ── Component ───────────────────────────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
const borderStyles = null;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* AIBorder renders an animated rainbow border as a positioned overlay.
|
|
53
|
+
* Uses the same Rovo gradient colors as rovo-platform-ui-components for
|
|
54
|
+
* consistent branding across all AI-related border animations.
|
|
55
|
+
*
|
|
56
|
+
* Must be placed inside a positioned container with no overflow:hidden.
|
|
57
|
+
* Uses CSS mask to show only the border ring (not the fill).
|
|
58
|
+
*/
|
|
59
|
+
const AIBorderComponent = () => {
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
ensureGradientAngleRegistered();
|
|
62
|
+
}, []);
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
"data-testid": "media-card-ai-border"
|
|
65
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- pointerEvents cannot be set via css prop on a wrapper div without compiled
|
|
66
|
+
,
|
|
67
|
+
style: {
|
|
68
|
+
pointerEvents: 'none'
|
|
69
|
+
}
|
|
70
|
+
}, /*#__PURE__*/React.createElement("style", {
|
|
71
|
+
dangerouslySetInnerHTML: {
|
|
72
|
+
__html: KEYFRAMES_CSS
|
|
73
|
+
}
|
|
74
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
style: {
|
|
76
|
+
background: GRADIENT_BACKGROUND,
|
|
77
|
+
animation: 'rovoGradientRotation linear 2s infinite'
|
|
78
|
+
},
|
|
79
|
+
className: ax(["_2rko16zz _kqswstnw _154i12gs _1ltv12gs _1bsb1pbc _4t3i1pbc _lcxvglyw _1pbykb7n _31mtepuu _g3cmkvto _8tnt1p67 _ca0qv77o _u5f3v77o _n3tdv77o _19bvv77o _1pldglyw"])
|
|
80
|
+
}));
|
|
81
|
+
};
|
|
82
|
+
AIBorderComponent.displayName = 'AIBorder';
|
|
83
|
+
export const AIBorder = AIBorderComponent;
|
|
@@ -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: "80.1.
|
|
40
|
+
packageName: "80.1.5",
|
|
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 = "80.1.
|
|
12
|
+
const packageVersion = "80.1.5";
|
|
13
13
|
const SAMPLE_RATE = 0.05;
|
|
14
14
|
|
|
15
15
|
/**
|
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 = "80.1.
|
|
14
|
+
var packageVersion = "80.1.5";
|
|
15
15
|
export var CardBase = function CardBase(_ref) {
|
|
16
16
|
var identifier = _ref.identifier,
|
|
17
17
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -19,6 +19,8 @@ import { ProgressBar } from './ui/progressBar/progressBar';
|
|
|
19
19
|
import { PlayButton } from './ui/playButton/playButton';
|
|
20
20
|
import { TickBox } from './ui/tickBox/tickBox';
|
|
21
21
|
import { Blanket } from './ui/blanket/blanket';
|
|
22
|
+
import { TransparentProgressBar } from '@atlaskit/progress-bar';
|
|
23
|
+
import { AIBorder } from './ui/aiBorder/aiBorder';
|
|
22
24
|
import { ActionsBar } from './ui/actionsBar/actionsBar';
|
|
23
25
|
import { IconWrapper } from './ui/iconWrapper/iconWrapper';
|
|
24
26
|
import { PreviewUnavailable, CreatingPreview, FailedToUpload, FailedToLoad, CheckInternetConnection } from './ui/iconMessage';
|
|
@@ -36,8 +38,21 @@ var i18n = defineMessages({
|
|
|
36
38
|
id: 'fabric.media.trace_id_tooltip',
|
|
37
39
|
defaultMessage: 'Use Trace ID {traceId} when reaching out to support.',
|
|
38
40
|
description: 'Tooltip content showing the trace identifier for troubleshooting file preview errors'
|
|
41
|
+
},
|
|
42
|
+
aiGeneratingImage: {
|
|
43
|
+
id: 'fabric.media.ai_generating_image',
|
|
44
|
+
defaultMessage: 'AI generating image',
|
|
45
|
+
description: 'Accessible label for the progress bar shown while AI is generating an image on the media card'
|
|
39
46
|
}
|
|
40
47
|
});
|
|
48
|
+
var aiProgressBarWrapperStyle = {
|
|
49
|
+
position: 'absolute',
|
|
50
|
+
top: '50%',
|
|
51
|
+
left: '50%',
|
|
52
|
+
transform: 'translate(-50%, -50%)',
|
|
53
|
+
width: '60%',
|
|
54
|
+
zIndex: 2
|
|
55
|
+
};
|
|
41
56
|
export var CardViewBase = function CardViewBase(_ref) {
|
|
42
57
|
var identifier = _ref.identifier,
|
|
43
58
|
_ref$innerRef = _ref.innerRef,
|
|
@@ -73,7 +88,8 @@ export var CardViewBase = function CardViewBase(_ref) {
|
|
|
73
88
|
overriddenCreationDate = _ref.overriddenCreationDate,
|
|
74
89
|
onSvgError = _ref.onSvgError,
|
|
75
90
|
onSvgLoad = _ref.onSvgLoad,
|
|
76
|
-
traceId = _ref.traceId
|
|
91
|
+
traceId = _ref.traceId,
|
|
92
|
+
isAIGenerating = _ref.isAIGenerating;
|
|
77
93
|
var intl = useIntl();
|
|
78
94
|
var _useState = useState(false),
|
|
79
95
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -147,7 +163,7 @@ export var CardViewBase = function CardViewBase(_ref) {
|
|
|
147
163
|
return _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
148
164
|
renderBlanket: !disableOverlay || mediaType !== 'video',
|
|
149
165
|
isFixedBlanket: true,
|
|
150
|
-
renderProgressBar:
|
|
166
|
+
renderProgressBar: !isAIGenerating
|
|
151
167
|
});
|
|
152
168
|
case 'processing':
|
|
153
169
|
return _objectSpread(_objectSpread({}, defaultConfig), {}, {
|
|
@@ -220,6 +236,11 @@ export var CardViewBase = function CardViewBase(_ref) {
|
|
|
220
236
|
isFixedBlanket = _getRenderConfigBySta.isFixedBlanket,
|
|
221
237
|
customTitleMessage = _getRenderConfigBySta.customTitleMessage,
|
|
222
238
|
traceTooltipVariant = _getRenderConfigBySta.traceTooltipVariant;
|
|
239
|
+
|
|
240
|
+
// When AI is generating, always show the AI border.
|
|
241
|
+
// The AI generating decoration is cleared when the replacement upload completes,
|
|
242
|
+
// so we don't need to check status here.
|
|
243
|
+
var renderAIBorderOverride = !!isAIGenerating && fg('platform_editor_maui_edit');
|
|
223
244
|
var shouldDisplayBackground = !cardPreview || !disableOverlay || status === 'error' || status === 'failed-processing';
|
|
224
245
|
var isPlayButtonClickable = shouldRenderPlayButton() && !!disableOverlay;
|
|
225
246
|
var isTickBoxSelectable = !disableOverlay && !!selectable && !selected;
|
|
@@ -305,7 +326,14 @@ export var CardViewBase = function CardViewBase(_ref) {
|
|
|
305
326
|
}), renderPlayButton && /*#__PURE__*/React.createElement(IconWrapper, {
|
|
306
327
|
breakpoint: breakpoint,
|
|
307
328
|
hasTitleBox: hasVisibleTitleBox
|
|
308
|
-
}, /*#__PURE__*/React.createElement(PlayButton, null)),
|
|
329
|
+
}, /*#__PURE__*/React.createElement(PlayButton, null)), renderAIBorderOverride ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Blanket, {
|
|
330
|
+
isFixed: true
|
|
331
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
332
|
+
style: aiProgressBarWrapperStyle
|
|
333
|
+
}, /*#__PURE__*/React.createElement(TransparentProgressBar, {
|
|
334
|
+
isIndeterminate: true,
|
|
335
|
+
ariaLabel: intl.formatMessage(i18n.aiGeneratingImage)
|
|
336
|
+
}))) : renderBlanket && /*#__PURE__*/React.createElement(Blanket, {
|
|
309
337
|
isFixed: isFixedBlanket
|
|
310
338
|
}), renderTitleBox && /*#__PURE__*/React.createElement(TitleBox, {
|
|
311
339
|
name: name,
|
|
@@ -323,7 +351,7 @@ export var CardViewBase = function CardViewBase(_ref) {
|
|
|
323
351
|
positionBottom: !hasVisibleTitleBox
|
|
324
352
|
}), renderTickBox && /*#__PURE__*/React.createElement(TickBox, {
|
|
325
353
|
selected: selected
|
|
326
|
-
})), disableOverlay || !actions || actions.length === 0 ? null : /*#__PURE__*/React.createElement(ActionsBar, {
|
|
354
|
+
})), renderAIBorderOverride && /*#__PURE__*/React.createElement(AIBorder, null), disableOverlay || !actions || actions.length === 0 ? null : /*#__PURE__*/React.createElement(ActionsBar, {
|
|
327
355
|
filename: name,
|
|
328
356
|
actions: actionsWithDetails
|
|
329
357
|
}));
|
|
@@ -77,6 +77,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
77
77
|
testId = _ref.testId,
|
|
78
78
|
titleBoxBgColor = _ref.titleBoxBgColor,
|
|
79
79
|
titleBoxIcon = _ref.titleBoxIcon,
|
|
80
|
+
isAIGenerating = _ref.isAIGenerating,
|
|
80
81
|
shouldHideTooltip = _ref.shouldHideTooltip,
|
|
81
82
|
mediaViewerItems = _ref.mediaViewerItems,
|
|
82
83
|
onClick = _ref.onClick,
|
|
@@ -729,7 +730,8 @@ export var FileCard = function FileCard(_ref) {
|
|
|
729
730
|
traceId: traceContext.traceId,
|
|
730
731
|
mediaCardCursor: mediaCardCursor,
|
|
731
732
|
shouldHideTooltip: shouldHideTooltip,
|
|
732
|
-
overriddenCreationDate: overridenDate
|
|
733
|
+
overriddenCreationDate: overridenDate,
|
|
734
|
+
isAIGenerating: isAIGenerating
|
|
733
735
|
});
|
|
734
736
|
return isLazyWithOverride ? /*#__PURE__*/React.createElement(ViewportDetector, {
|
|
735
737
|
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 = "80.1.
|
|
83
|
+
var packageVersion = "80.1.5";
|
|
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({
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko16zz{border-radius:calc(var(--ds-radius-large, 3px) + 2px)}._154i12gs{top:-2px}
|
|
3
|
+
._19bvv77o{padding-left:var(--ds-space-025,2px)}
|
|
4
|
+
._1bsb1pbc{width:calc(100% + 4px)}
|
|
5
|
+
._1ltv12gs{left:-2px}
|
|
6
|
+
._1pbykb7n{z-index:1}
|
|
7
|
+
._31mtepuu{-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0)}
|
|
8
|
+
._4t3i1pbc{height:calc(100% + 4px)}
|
|
9
|
+
._8tnt1p67{-webkit-mask-composite:xor;mask-composite:exclude}
|
|
10
|
+
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
11
|
+
._g3cmkvto{-webkit-mask-composite:xor}
|
|
12
|
+
._kqswstnw{position:absolute}
|
|
13
|
+
._lcxvglyw{pointer-events:none}
|
|
14
|
+
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
15
|
+
._u5f3v77o{padding-right:var(--ds-space-025,2px)}
|
|
16
|
+
@media (prefers-reduced-motion){._1pldglyw{animation-name:none}}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* aiBorder.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import "./aiBorder.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { useEffect } from 'react';
|
|
6
|
+
// ── Rovo gradient animation setup ───────────────────────────────────────────
|
|
7
|
+
// Mirrors the shared rovo-gradient component but self-contained to avoid
|
|
8
|
+
// circular dependency (media-card cannot depend on rovo-platform-ui-components).
|
|
9
|
+
|
|
10
|
+
var propertyRegistered = false;
|
|
11
|
+
function ensureGradientAngleRegistered() {
|
|
12
|
+
if (propertyRegistered) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (typeof window === 'undefined' || typeof CSS === 'undefined') {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
propertyRegistered = true;
|
|
19
|
+
try {
|
|
20
|
+
if (typeof CSS.registerProperty === 'function') {
|
|
21
|
+
CSS.registerProperty({
|
|
22
|
+
name: '--gradient-angle',
|
|
23
|
+
syntax: '<angle>',
|
|
24
|
+
initialValue: '270deg',
|
|
25
|
+
inherits: false
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
} catch (_unused) {
|
|
29
|
+
// Already registered or unsupported
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
var GRADIENT_BACKGROUND = "conic-gradient(\n\tfrom var(--gradient-angle, 45deg),\n\t#FCA700 0%,\n\t#6A9A23 25%,\n\t#1868DB 50%,\n\t#AF59E0 75%,\n\t#FCA700 100%\n)";
|
|
33
|
+
var KEYFRAMES_CSS = "\n@keyframes rovoGradientRotation {\n\t0% { --gradient-angle: 0deg; }\n\t100% { --gradient-angle: 360deg; }\n}\n";
|
|
34
|
+
|
|
35
|
+
// ── Component ───────────────────────────────────────────────────────────────
|
|
36
|
+
|
|
37
|
+
var borderStyles = null;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* AIBorder renders an animated rainbow border as a positioned overlay.
|
|
41
|
+
* Uses the same Rovo gradient colors as rovo-platform-ui-components for
|
|
42
|
+
* consistent branding across all AI-related border animations.
|
|
43
|
+
*
|
|
44
|
+
* Must be placed inside a positioned container with no overflow:hidden.
|
|
45
|
+
* Uses CSS mask to show only the border ring (not the fill).
|
|
46
|
+
*/
|
|
47
|
+
var AIBorderComponent = function AIBorderComponent() {
|
|
48
|
+
useEffect(function () {
|
|
49
|
+
ensureGradientAngleRegistered();
|
|
50
|
+
}, []);
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
"data-testid": "media-card-ai-border"
|
|
53
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- pointerEvents cannot be set via css prop on a wrapper div without compiled
|
|
54
|
+
,
|
|
55
|
+
style: {
|
|
56
|
+
pointerEvents: 'none'
|
|
57
|
+
}
|
|
58
|
+
}, /*#__PURE__*/React.createElement("style", {
|
|
59
|
+
dangerouslySetInnerHTML: {
|
|
60
|
+
__html: KEYFRAMES_CSS
|
|
61
|
+
}
|
|
62
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
style: {
|
|
64
|
+
background: GRADIENT_BACKGROUND,
|
|
65
|
+
animation: 'rovoGradientRotation linear 2s infinite'
|
|
66
|
+
},
|
|
67
|
+
className: ax(["_2rko16zz _kqswstnw _154i12gs _1ltv12gs _1bsb1pbc _4t3i1pbc _lcxvglyw _1pbykb7n _31mtepuu _g3cmkvto _8tnt1p67 _ca0qv77o _u5f3v77o _n3tdv77o _19bvv77o _1pldglyw"])
|
|
68
|
+
}));
|
|
69
|
+
};
|
|
70
|
+
AIBorderComponent.displayName = 'AIBorder';
|
|
71
|
+
export var AIBorder = AIBorderComponent;
|
|
@@ -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: "80.1.
|
|
104
|
+
packageName: "80.1.5",
|
|
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 = "80.1.
|
|
16
|
+
var packageVersion = "80.1.5";
|
|
17
17
|
var SAMPLE_RATE = 0.05;
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -41,6 +41,7 @@ export interface CardViewProps {
|
|
|
41
41
|
disableAnimation?: boolean;
|
|
42
42
|
shouldHideTooltip?: boolean;
|
|
43
43
|
overriddenCreationDate?: number;
|
|
44
|
+
readonly isAIGenerating?: boolean;
|
|
44
45
|
}
|
|
45
46
|
export type CardViewBaseProps = CardViewProps & WithAnalyticsEventsProps;
|
|
46
47
|
type TraceTooltipVariant = 'preview-unavailable' | 'failed-to-load';
|
|
@@ -54,12 +55,13 @@ export interface RenderConfigByStatus {
|
|
|
54
55
|
renderBlanket?: boolean;
|
|
55
56
|
isFixedBlanket?: boolean;
|
|
56
57
|
renderProgressBar?: boolean;
|
|
58
|
+
renderAIBorder?: boolean;
|
|
57
59
|
renderSpinner?: boolean;
|
|
58
60
|
renderFailedTitleBox?: boolean;
|
|
59
61
|
renderTickBox?: boolean;
|
|
60
62
|
customTitleMessage?: MessageDescriptor;
|
|
61
63
|
traceTooltipVariant?: TraceTooltipVariant;
|
|
62
64
|
}
|
|
63
|
-
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, }: CardViewBaseProps) => React.JSX.Element;
|
|
65
|
+
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, }: CardViewBaseProps) => React.JSX.Element;
|
|
64
66
|
export declare const CardView: React.ForwardRefExoticComponent<Omit<CardViewProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
65
67
|
export {};
|
|
@@ -33,6 +33,8 @@ export interface FileCardProps extends CardEventProps {
|
|
|
33
33
|
readonly titleBoxBgColor?: string;
|
|
34
34
|
/** Sets the title box icon. */
|
|
35
35
|
readonly titleBoxIcon?: TitleBoxIcon;
|
|
36
|
+
/** Indicates the media card is being generated by AI (e.g. Rovo image-create). */
|
|
37
|
+
readonly isAIGenerating?: boolean;
|
|
36
38
|
/** Instance of file identifier. */
|
|
37
39
|
readonly identifier: FileIdentifier;
|
|
38
40
|
/** Lazy loads the media file. */
|
|
@@ -62,4 +64,4 @@ export interface FileCardProps extends CardEventProps {
|
|
|
62
64
|
/** Extensions for the media viewer (e.g. comment button in header). */
|
|
63
65
|
readonly mediaViewerExtensions?: MediaViewerExtensions;
|
|
64
66
|
}
|
|
65
|
-
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, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
|
|
67
|
+
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, isAIGenerating, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ export interface SharedCardProps {
|
|
|
66
66
|
readonly testId?: string;
|
|
67
67
|
readonly titleBoxBgColor?: string;
|
|
68
68
|
readonly titleBoxIcon?: TitleBoxIcon;
|
|
69
|
+
readonly isAIGenerating?: boolean;
|
|
69
70
|
readonly viewerOptions?: ViewerOptionsProps;
|
|
70
71
|
/** Sets options for viewer **/
|
|
71
72
|
readonly includeHashForDuplicateFiles?: boolean;
|
|
@@ -41,6 +41,7 @@ export interface CardViewProps {
|
|
|
41
41
|
disableAnimation?: boolean;
|
|
42
42
|
shouldHideTooltip?: boolean;
|
|
43
43
|
overriddenCreationDate?: number;
|
|
44
|
+
readonly isAIGenerating?: boolean;
|
|
44
45
|
}
|
|
45
46
|
export type CardViewBaseProps = CardViewProps & WithAnalyticsEventsProps;
|
|
46
47
|
type TraceTooltipVariant = 'preview-unavailable' | 'failed-to-load';
|
|
@@ -54,12 +55,13 @@ export interface RenderConfigByStatus {
|
|
|
54
55
|
renderBlanket?: boolean;
|
|
55
56
|
isFixedBlanket?: boolean;
|
|
56
57
|
renderProgressBar?: boolean;
|
|
58
|
+
renderAIBorder?: boolean;
|
|
57
59
|
renderSpinner?: boolean;
|
|
58
60
|
renderFailedTitleBox?: boolean;
|
|
59
61
|
renderTickBox?: boolean;
|
|
60
62
|
customTitleMessage?: MessageDescriptor;
|
|
61
63
|
traceTooltipVariant?: TraceTooltipVariant;
|
|
62
64
|
}
|
|
63
|
-
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, }: CardViewBaseProps) => React.JSX.Element;
|
|
65
|
+
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, }: CardViewBaseProps) => React.JSX.Element;
|
|
64
66
|
export declare const CardView: React.ForwardRefExoticComponent<Omit<CardViewProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
65
67
|
export {};
|
|
@@ -33,6 +33,8 @@ export interface FileCardProps extends CardEventProps {
|
|
|
33
33
|
readonly titleBoxBgColor?: string;
|
|
34
34
|
/** Sets the title box icon. */
|
|
35
35
|
readonly titleBoxIcon?: TitleBoxIcon;
|
|
36
|
+
/** Indicates the media card is being generated by AI (e.g. Rovo image-create). */
|
|
37
|
+
readonly isAIGenerating?: boolean;
|
|
36
38
|
/** Instance of file identifier. */
|
|
37
39
|
readonly identifier: FileIdentifier;
|
|
38
40
|
/** Lazy loads the media file. */
|
|
@@ -62,4 +64,4 @@ export interface FileCardProps extends CardEventProps {
|
|
|
62
64
|
/** Extensions for the media viewer (e.g. comment button in header). */
|
|
63
65
|
readonly mediaViewerExtensions?: MediaViewerExtensions;
|
|
64
66
|
}
|
|
65
|
-
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, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
|
|
67
|
+
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, isAIGenerating, shouldHideTooltip, mediaViewerItems, onClick, onMouseEnter, videoControlsWrapperRef, viewerOptions, includeHashForDuplicateFiles, ssrItemDetails, onError, mediaViewerExtensions, }: FileCardProps) => React.JSX.Element;
|
|
@@ -66,6 +66,7 @@ export interface SharedCardProps {
|
|
|
66
66
|
readonly testId?: string;
|
|
67
67
|
readonly titleBoxBgColor?: string;
|
|
68
68
|
readonly titleBoxIcon?: TitleBoxIcon;
|
|
69
|
+
readonly isAIGenerating?: boolean;
|
|
69
70
|
readonly viewerOptions?: ViewerOptionsProps;
|
|
70
71
|
/** Sets options for viewer **/
|
|
71
72
|
readonly includeHashForDuplicateFiles?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "80.
|
|
3
|
+
"version": "80.2.0",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -46,12 +46,13 @@
|
|
|
46
46
|
"@atlaskit/media-viewer": "^53.0.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
48
|
"@atlaskit/primitives": "^19.0.0",
|
|
49
|
+
"@atlaskit/progress-bar": "^4.2.0",
|
|
49
50
|
"@atlaskit/react-ufo": "^5.16.0",
|
|
50
51
|
"@atlaskit/spinner": "^19.1.0",
|
|
51
52
|
"@atlaskit/theme": "^23.1.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
53
|
+
"@atlaskit/tmp-editor-statsig": "^68.0.0",
|
|
53
54
|
"@atlaskit/tokens": "^13.0.0",
|
|
54
|
-
"@atlaskit/tooltip": "^21.
|
|
55
|
+
"@atlaskit/tooltip": "^21.2.0",
|
|
55
56
|
"@atlaskit/ufo": "^0.4.0",
|
|
56
57
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
57
58
|
"@babel/runtime": "^7.0.0",
|
|
@@ -101,6 +102,9 @@
|
|
|
101
102
|
"wait-for-expect": "^1.2.0"
|
|
102
103
|
},
|
|
103
104
|
"platform-feature-flags": {
|
|
105
|
+
"platform_editor_maui_edit": {
|
|
106
|
+
"type": "boolean"
|
|
107
|
+
},
|
|
104
108
|
"enable_sampling_mediacardrender_succeeded": {
|
|
105
109
|
"type": "boolean"
|
|
106
110
|
},
|