@atlaskit/media-card 80.7.5 → 80.8.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 +21 -0
- package/dist/cjs/card/ai-generating-overlay/AIGeneratingOverlay.compiled.css +1 -1
- package/dist/cjs/card/ai-generating-overlay/AIGeneratingOverlay.js +1 -1
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/cardView.js +7 -2
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/loadingBar/loadingBar.compiled.css +13 -0
- package/dist/cjs/card/ui/loadingBar/loadingBar.js +91 -0
- package/dist/cjs/card/ui/wrapper/wrapper-compiled.compiled.css +1 -1
- package/dist/cjs/card/ui/wrapper/wrapper-compiled.js +1 -1
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/lightCards/cardLoading.js +20 -36
- package/dist/cjs/utils/lightCards/styles.js +2 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/ai-generating-overlay/AIGeneratingOverlay.compiled.css +1 -1
- package/dist/es2019/card/ai-generating-overlay/AIGeneratingOverlay.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/cardView.js +7 -2
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/loadingBar/loadingBar.compiled.css +13 -0
- package/dist/es2019/card/ui/loadingBar/loadingBar.js +74 -0
- package/dist/es2019/card/ui/wrapper/wrapper-compiled.compiled.css +1 -1
- package/dist/es2019/card/ui/wrapper/wrapper-compiled.js +1 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/lightCards/cardLoading.js +20 -20
- package/dist/es2019/utils/lightCards/styles.js +2 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/ai-generating-overlay/AIGeneratingOverlay.compiled.css +1 -1
- package/dist/esm/card/ai-generating-overlay/AIGeneratingOverlay.js +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/cardView.js +7 -2
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/loadingBar/loadingBar.compiled.css +13 -0
- package/dist/esm/card/ui/loadingBar/loadingBar.js +82 -0
- package/dist/esm/card/ui/wrapper/wrapper-compiled.compiled.css +1 -1
- package/dist/esm/card/ui/wrapper/wrapper-compiled.js +1 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/lightCards/cardLoading.js +19 -34
- package/dist/esm/utils/lightCards/styles.js +2 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/ui/loadingBar/loadingBar.d.ts +11 -0
- package/dist/types/utils/lightCards/cardLoading.d.ts +1 -4
- package/dist/types-ts4.5/card/ui/loadingBar/loadingBar.d.ts +11 -0
- package/dist/types-ts4.5/utils/lightCards/cardLoading.d.ts +1 -4
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 80.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`a826d67f22cc9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a826d67f22cc9) -
|
|
8
|
+
Replace the legacy circular spinner in `CardView` and `CardLoading` with a bottom-aligned grey
|
|
9
|
+
loading bar when `cc-maui-ai-edit-loading-experiment.isEnabled` is on. The bar is 6px to match the
|
|
10
|
+
native-embed loading bar, and the media card loading/placeholder background now uses
|
|
11
|
+
`elevation.surface.sunken`. Registers `cc-maui-ai-edit-loading-experiment` in
|
|
12
|
+
`@atlaskit/tmp-editor-statsig`.
|
|
13
|
+
|
|
14
|
+
Round the ends (pill radius) of the MAUI loading bars so the media-card loading bar, native-embed
|
|
15
|
+
loading bar, and AI generating overlay bars are visually consistent.
|
|
16
|
+
|
|
17
|
+
The loading bar now holds a named UFO interaction while shown (matching the spinner's
|
|
18
|
+
`interactionName`) so media loading stays attributed in performance metrics.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 80.7.5
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -34,7 +34,7 @@ function AIGeneratingOverlay(_ref) {
|
|
|
34
34
|
"aria-valuemin": 0,
|
|
35
35
|
"aria-valuemax": 100,
|
|
36
36
|
"data-testid": "ai-generating-overlay-progress-bar",
|
|
37
|
-
className: (0, _runtime.ax)(["
|
|
37
|
+
className: (0, _runtime.ax)(["_2rko1rr0 _1reo15vq _18m915vq _1bsb1lk2 _4t3ii2wt _kqswh2mm _bfhk15uy"])
|
|
38
38
|
}, /*#__PURE__*/React.createElement("div", {
|
|
39
39
|
"data-testid": "ai-generating-overlay-train",
|
|
40
40
|
className: (0, _runtime.ax)(["_y44v15mx _1e0c1txw _kqswstnw _154iidpf _4t3i1osq"]),
|
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.7.
|
|
23
|
+
var packageVersion = "80.7.5";
|
|
24
24
|
var CardBase = exports.CardBase = function CardBase(_ref) {
|
|
25
25
|
var identifier = _ref.identifier,
|
|
26
26
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -21,6 +21,7 @@ var _analytics = require("../utils/analytics");
|
|
|
21
21
|
var _imageRenderer = require("./ui/imageRenderer");
|
|
22
22
|
var _titleBox = require("./ui/titleBox/titleBox");
|
|
23
23
|
var _failedTitleBox = require("./ui/titleBox/failedTitleBox");
|
|
24
|
+
var _loadingBar = require("./ui/loadingBar/loadingBar");
|
|
24
25
|
var _progressBar = require("./ui/progressBar/progressBar");
|
|
25
26
|
var _playButton = require("./ui/playButton/playButton");
|
|
26
27
|
var _tickBox = require("./ui/tickBox/tickBox");
|
|
@@ -301,13 +302,17 @@ var CardViewBase = exports.CardViewBase = function CardViewBase(_ref) {
|
|
|
301
302
|
mediaType: mediaType,
|
|
302
303
|
mimeType: mimeType,
|
|
303
304
|
name: name
|
|
304
|
-
}), iconMessage), renderSpinner && /*#__PURE__*/_react.default.createElement(
|
|
305
|
+
}), iconMessage), renderSpinner && ((0, _expValEquals.expValEquals)('cc-maui-ai-edit-loading-experiment', 'isEnabled', true) ? /*#__PURE__*/_react.default.createElement(_loadingBar.LoadingBar, {
|
|
306
|
+
animationDisabled: disableAnimation,
|
|
307
|
+
testId: "media-card-loading",
|
|
308
|
+
interactionName: "media-card-loading"
|
|
309
|
+
}) : /*#__PURE__*/_react.default.createElement(_iconWrapper.IconWrapper, {
|
|
305
310
|
breakpoint: breakpoint,
|
|
306
311
|
hasTitleBox: hasVisibleTitleBox
|
|
307
312
|
}, /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
308
313
|
testId: "media-card-loading",
|
|
309
314
|
interactionName: "media-card-loading"
|
|
310
|
-
})), renderSvgView && identifier && (0, _mediaClient.isFileIdentifier)(identifier) && /*#__PURE__*/_react.default.createElement(_svgView.SvgView, {
|
|
315
|
+
}))), renderSvgView && identifier && (0, _mediaClient.isFileIdentifier)(identifier) && /*#__PURE__*/_react.default.createElement(_svgView.SvgView, {
|
|
311
316
|
identifier: identifier,
|
|
312
317
|
resizeMode: resizeMode || 'crop',
|
|
313
318
|
onError: onSvgError,
|
|
@@ -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.7.
|
|
90
|
+
var packageVersion = "80.7.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,13 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko1rr0{border-radius:var(--ds-radius-full,9999px)}
|
|
3
|
+
._v564aq9m{transition:width .8s}._18m915vq{overflow-y:hidden}
|
|
4
|
+
._1bsb1lk2{width:95%}
|
|
5
|
+
._1e0c1ule{display:block}
|
|
6
|
+
._1ltv1ghs{left:2.5%}
|
|
7
|
+
._1reo15vq{overflow-x:hidden}
|
|
8
|
+
._4t3i1osq{height:100%}
|
|
9
|
+
._4t3ii2wt{height:6px}
|
|
10
|
+
._94n5u2gc{bottom:var(--ds-space-100,8px)}
|
|
11
|
+
._bfhk10ef{background-color:var(--ds-background-accent-gray-subtler-hovered,#b7b9be)}
|
|
12
|
+
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
13
|
+
._kqswstnw{position:absolute}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/* loadingBar.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.LoadingBar = void 0;
|
|
10
|
+
require("./loadingBar.compiled.css");
|
|
11
|
+
var _runtime = require("@compiled/react/runtime");
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _reactIntl = require("react-intl");
|
|
15
|
+
var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-context"));
|
|
16
|
+
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); }
|
|
17
|
+
var TICK_INTERVAL_MS = 1000;
|
|
18
|
+
var STATIC_PROGRESS_VALUE = 0.9;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* `useLayoutEffect` is being used in SSR safe form. On the server, this work doesn’t need to run.
|
|
22
|
+
* `useEffect` is used in-place, because `useEffect` is not run on the server and it matches types
|
|
23
|
+
* which makes things simpler than doing an `isServer` check or a `null` check.
|
|
24
|
+
*
|
|
25
|
+
* @see https://hello.atlassian.net/wiki/spaces/DST/pages/2081696628/DSTDACI-010+-+Interaction+Tracing+hooks+in+DS+components
|
|
26
|
+
*/
|
|
27
|
+
var useLayoutEffect = typeof window === 'undefined' ? _react.useEffect : _react.useLayoutEffect;
|
|
28
|
+
var messages = (0, _reactIntl.defineMessages)({
|
|
29
|
+
loadingBarLabel: {
|
|
30
|
+
id: 'fabric.media.loading_bar_label',
|
|
31
|
+
defaultMessage: 'Loading',
|
|
32
|
+
description: 'Aria label for the loading bar shown while a media card is loading'
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
var trackStyles = null;
|
|
36
|
+
var fillStyles = null;
|
|
37
|
+
var clampToPercent = function clampToPercent(progress) {
|
|
38
|
+
return Math.min(1, Math.max(0, progress)) * 100;
|
|
39
|
+
};
|
|
40
|
+
var LoadingBar = exports.LoadingBar = function LoadingBar(_ref) {
|
|
41
|
+
var _ref$animationDisable = _ref.animationDisabled,
|
|
42
|
+
animationDisabled = _ref$animationDisable === void 0 ? false : _ref$animationDisable,
|
|
43
|
+
testId = _ref.testId,
|
|
44
|
+
interactionName = _ref.interactionName;
|
|
45
|
+
var intl = (0, _reactIntl.useIntl)();
|
|
46
|
+
var _useState = (0, _react.useState)(animationDisabled ? STATIC_PROGRESS_VALUE : 0),
|
|
47
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
48
|
+
progress = _useState2[0],
|
|
49
|
+
setProgress = _useState2[1];
|
|
50
|
+
var intervalRef = (0, _react.useRef)();
|
|
51
|
+
var interactionContext = (0, _react.useContext)(_interactionContext.default);
|
|
52
|
+
useLayoutEffect(function () {
|
|
53
|
+
if (interactionContext != null) {
|
|
54
|
+
return interactionContext.hold(interactionName);
|
|
55
|
+
}
|
|
56
|
+
}, [interactionContext, interactionName]);
|
|
57
|
+
(0, _react.useEffect)(function () {
|
|
58
|
+
if (animationDisabled) {
|
|
59
|
+
setProgress(STATIC_PROGRESS_VALUE);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
intervalRef.current = setInterval(function () {
|
|
63
|
+
setProgress(function (prev) {
|
|
64
|
+
if (prev < 0.1) {
|
|
65
|
+
return prev + 0.1;
|
|
66
|
+
} else if (prev < 0.6) {
|
|
67
|
+
return prev + 0.35;
|
|
68
|
+
} else if (prev < 0.9) {
|
|
69
|
+
return prev + 0.1;
|
|
70
|
+
}
|
|
71
|
+
clearInterval(intervalRef.current);
|
|
72
|
+
return prev;
|
|
73
|
+
});
|
|
74
|
+
}, TICK_INTERVAL_MS);
|
|
75
|
+
return function () {
|
|
76
|
+
return clearInterval(intervalRef.current);
|
|
77
|
+
};
|
|
78
|
+
}, [animationDisabled]);
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
80
|
+
role: "progressbar",
|
|
81
|
+
"aria-valuenow": progress,
|
|
82
|
+
"aria-label": intl.formatMessage(messages.loadingBarLabel),
|
|
83
|
+
"data-testid": testId,
|
|
84
|
+
className: (0, _runtime.ax)(["_1reo15vq _18m915vq _2rko1rr0 _kqswstnw _94n5u2gc _1bsb1lk2 _1ltv1ghs _4t3ii2wt _bfhki8nm"])
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
86
|
+
style: {
|
|
87
|
+
width: "".concat(clampToPercent(progress), "%")
|
|
88
|
+
},
|
|
89
|
+
className: (0, _runtime.ax)(["_2rko1rr0 _v564aq9m _1e0c1ule _4t3i1osq _bfhk10ef"])
|
|
90
|
+
}));
|
|
91
|
+
};
|
|
@@ -18,7 +18,7 @@ button:focus+._1hlmd0i9{outline:solid var(--ds-border-width-focused,2px) var(--d
|
|
|
18
18
|
._4t3ine4n{height:var(--media-wrapper-height)}
|
|
19
19
|
._5sb1v00u [data-cursor=wait]{cursor:wait}
|
|
20
20
|
._9m3z1osq>div{width:100%}
|
|
21
|
-
.
|
|
21
|
+
._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
|
|
22
22
|
._c71l1osq{max-height:100%}
|
|
23
23
|
._ect4ttxp{font-family:var(--ds-font-family-body,"Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
24
24
|
._eg541i5c:hover .media-card-blanket{background-color:var(--ds-blanket,#050c1f75)}
|
|
@@ -80,7 +80,7 @@ var Wrapper = exports.Wrapper = function Wrapper(props) {
|
|
|
80
80
|
id: "newFileExperienceWrapper"
|
|
81
81
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
82
82
|
,
|
|
83
|
-
className: (0, _runtime.ax)([wrapperStyles.default, "_yfmhtlke _5sb1v00u", displayBackground && "
|
|
83
|
+
className: (0, _runtime.ax)([wrapperStyles.default, "_yfmhtlke _5sb1v00u", displayBackground && "_bfhkhfxm", wrapperShadowKey && shadowStyleMap[wrapperShadowKey], selected && "_1p1y1j28 _1rk81j28 _14r11j28 _1np21j28", isPlayButtonClickable && "_1y898vuz _19zy8vuz", isTickBoxSelectable && "_1yf91j9a _1xp5dgkc", shouldDisplayTooltip && "_9m3z1osq _10pb1osq", _cardConstants.newFileExperienceClassName]),
|
|
84
84
|
"data-testid": testId,
|
|
85
85
|
style: _objectSpread((0, _defineProperty2.default)((0, _defineProperty2.default)({}, LOCAL_WIDTH_VARIABLE, width), LOCAL_HEIGHT_VARIABLE, height), getResponsiveStyles(breakpoint)),
|
|
86
86
|
ref: innerRef,
|
|
@@ -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.7.
|
|
119
|
+
packageName: "80.7.5",
|
|
120
120
|
componentName: 'mediaInlineCard',
|
|
121
121
|
component: 'mediaInlineCard'
|
|
122
122
|
};
|
|
@@ -1,45 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.CardLoading = void 0;
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
10
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
|
+
var _loadingBar = require("../../card/ui/loadingBar/loadingBar");
|
|
15
12
|
var _getDimensionsWithDefault = require("./getDimensionsWithDefault");
|
|
16
13
|
var _lightCardWrappers = require("./lightCardWrappers");
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
interactionName = _this$props.interactionName;
|
|
34
|
-
var dimensions = (0, _getDimensionsWithDefault.getDimensionsWithDefault)(dimensionsProp);
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement(_lightCardWrappers.Wrapper, {
|
|
36
|
-
"data-testid": testId || 'media-card-loading',
|
|
37
|
-
"data-test-loading": true,
|
|
38
|
-
dimensions: dimensions,
|
|
39
|
-
"data-vc": "media-card-loading"
|
|
40
|
-
}, /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
41
|
-
interactionName: interactionName || 'media-card-loading'
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
}]);
|
|
45
|
-
}(_react.Component);
|
|
14
|
+
var CardLoading = exports.CardLoading = function CardLoading(_ref) {
|
|
15
|
+
var dimensionsProp = _ref.dimensions,
|
|
16
|
+
testId = _ref.testId,
|
|
17
|
+
interactionName = _ref.interactionName;
|
|
18
|
+
var dimensions = (0, _getDimensionsWithDefault.getDimensionsWithDefault)(dimensionsProp);
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_lightCardWrappers.Wrapper, {
|
|
20
|
+
"data-testid": testId || 'media-card-loading',
|
|
21
|
+
"data-test-loading": true,
|
|
22
|
+
dimensions: dimensions,
|
|
23
|
+
"data-vc": "media-card-loading"
|
|
24
|
+
}, (0, _expValEquals.expValEquals)('cc-maui-ai-edit-loading-experiment', 'isEnabled', true) ? /*#__PURE__*/_react.default.createElement(_loadingBar.LoadingBar, {
|
|
25
|
+
interactionName: interactionName || 'media-card-loading'
|
|
26
|
+
}) : /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
27
|
+
interactionName: interactionName || 'media-card-loading'
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
@@ -13,7 +13,8 @@ var wrapperStyles = exports.wrapperStyles = function wrapperStyles(_ref) {
|
|
|
13
13
|
return (0, _react.css)(
|
|
14
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
15
15
|
_mediaUi.center, {
|
|
16
|
-
|
|
16
|
+
position: 'relative',
|
|
17
|
+
background: "var(--ds-surface-sunken, #F8F8F8)",
|
|
17
18
|
color: "var(--ds-icon, #292A2E)"
|
|
18
19
|
},
|
|
19
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -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.7.
|
|
22
|
+
var packageVersion = "80.7.5";
|
|
23
23
|
var SAMPLE_RATE = 0.05;
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -27,7 +27,7 @@ export function AIGeneratingOverlay({
|
|
|
27
27
|
"aria-valuemin": 0,
|
|
28
28
|
"aria-valuemax": 100,
|
|
29
29
|
"data-testid": "ai-generating-overlay-progress-bar",
|
|
30
|
-
className: ax(["
|
|
30
|
+
className: ax(["_2rko1rr0 _1reo15vq _18m915vq _1bsb1lk2 _4t3ii2wt _kqswh2mm _bfhk15uy"])
|
|
31
31
|
}, /*#__PURE__*/React.createElement("div", {
|
|
32
32
|
"data-testid": "ai-generating-overlay-train",
|
|
33
33
|
className: ax(["_y44v1j9w _1e0c1txw _kqswstnw _154iidpf _4t3i1osq"])
|
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.7.
|
|
12
|
+
const packageVersion = "80.7.5";
|
|
13
13
|
export const CardBase = ({
|
|
14
14
|
identifier,
|
|
15
15
|
...otherProps
|
|
@@ -11,6 +11,7 @@ import { createAndFireMediaCardEvent } from '../utils/analytics';
|
|
|
11
11
|
import { ImageRenderer } from './ui/imageRenderer';
|
|
12
12
|
import { TitleBox } from './ui/titleBox/titleBox';
|
|
13
13
|
import { FailedTitleBox } from './ui/titleBox/failedTitleBox';
|
|
14
|
+
import { LoadingBar } from './ui/loadingBar/loadingBar';
|
|
14
15
|
import { ProgressBar } from './ui/progressBar/progressBar';
|
|
15
16
|
import { PlayButton } from './ui/playButton/playButton';
|
|
16
17
|
import { TickBox } from './ui/tickBox/tickBox';
|
|
@@ -290,13 +291,17 @@ export const CardViewBase = ({
|
|
|
290
291
|
mediaType: mediaType,
|
|
291
292
|
mimeType: mimeType,
|
|
292
293
|
name: name
|
|
293
|
-
}), iconMessage), renderSpinner && /*#__PURE__*/React.createElement(
|
|
294
|
+
}), iconMessage), renderSpinner && (expValEquals('cc-maui-ai-edit-loading-experiment', 'isEnabled', true) ? /*#__PURE__*/React.createElement(LoadingBar, {
|
|
295
|
+
animationDisabled: disableAnimation,
|
|
296
|
+
testId: "media-card-loading",
|
|
297
|
+
interactionName: "media-card-loading"
|
|
298
|
+
}) : /*#__PURE__*/React.createElement(IconWrapper, {
|
|
294
299
|
breakpoint: breakpoint,
|
|
295
300
|
hasTitleBox: hasVisibleTitleBox
|
|
296
301
|
}, /*#__PURE__*/React.createElement(SpinnerIcon, {
|
|
297
302
|
testId: "media-card-loading",
|
|
298
303
|
interactionName: "media-card-loading"
|
|
299
|
-
})), renderSvgView && identifier && isFileIdentifier(identifier) && /*#__PURE__*/React.createElement(SvgView, {
|
|
304
|
+
}))), renderSvgView && identifier && isFileIdentifier(identifier) && /*#__PURE__*/React.createElement(SvgView, {
|
|
300
305
|
identifier: identifier,
|
|
301
306
|
resizeMode: resizeMode || 'crop',
|
|
302
307
|
onError: onSvgError,
|
|
@@ -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.7.
|
|
69
|
+
const packageVersion = "80.7.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,13 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko1rr0{border-radius:var(--ds-radius-full,9999px)}
|
|
3
|
+
._v564aq9m{transition:width .8s}._18m915vq{overflow-y:hidden}
|
|
4
|
+
._1bsb1lk2{width:95%}
|
|
5
|
+
._1e0c1ule{display:block}
|
|
6
|
+
._1ltv1ghs{left:2.5%}
|
|
7
|
+
._1reo15vq{overflow-x:hidden}
|
|
8
|
+
._4t3i1osq{height:100%}
|
|
9
|
+
._4t3ii2wt{height:6px}
|
|
10
|
+
._94n5u2gc{bottom:var(--ds-space-100,8px)}
|
|
11
|
+
._bfhk10ef{background-color:var(--ds-background-accent-gray-subtler-hovered,#b7b9be)}
|
|
12
|
+
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
13
|
+
._kqswstnw{position:absolute}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* loadingBar.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import "./loadingBar.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React, { useContext, useEffect, useLayoutEffect as useRealLayoutEffect, useRef, useState } from 'react';
|
|
5
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
6
|
+
import InteractionContext from '@atlaskit/interaction-context';
|
|
7
|
+
const TICK_INTERVAL_MS = 1000;
|
|
8
|
+
const STATIC_PROGRESS_VALUE = 0.9;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* `useLayoutEffect` is being used in SSR safe form. On the server, this work doesn’t need to run.
|
|
12
|
+
* `useEffect` is used in-place, because `useEffect` is not run on the server and it matches types
|
|
13
|
+
* which makes things simpler than doing an `isServer` check or a `null` check.
|
|
14
|
+
*
|
|
15
|
+
* @see https://hello.atlassian.net/wiki/spaces/DST/pages/2081696628/DSTDACI-010+-+Interaction+Tracing+hooks+in+DS+components
|
|
16
|
+
*/
|
|
17
|
+
const useLayoutEffect = typeof window === 'undefined' ? useEffect : useRealLayoutEffect;
|
|
18
|
+
const messages = defineMessages({
|
|
19
|
+
loadingBarLabel: {
|
|
20
|
+
id: 'fabric.media.loading_bar_label',
|
|
21
|
+
defaultMessage: 'Loading',
|
|
22
|
+
description: 'Aria label for the loading bar shown while a media card is loading'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const trackStyles = null;
|
|
26
|
+
const fillStyles = null;
|
|
27
|
+
const clampToPercent = progress => Math.min(1, Math.max(0, progress)) * 100;
|
|
28
|
+
export const LoadingBar = ({
|
|
29
|
+
animationDisabled = false,
|
|
30
|
+
testId,
|
|
31
|
+
interactionName
|
|
32
|
+
}) => {
|
|
33
|
+
const intl = useIntl();
|
|
34
|
+
const [progress, setProgress] = useState(animationDisabled ? STATIC_PROGRESS_VALUE : 0);
|
|
35
|
+
const intervalRef = useRef();
|
|
36
|
+
const interactionContext = useContext(InteractionContext);
|
|
37
|
+
useLayoutEffect(() => {
|
|
38
|
+
if (interactionContext != null) {
|
|
39
|
+
return interactionContext.hold(interactionName);
|
|
40
|
+
}
|
|
41
|
+
}, [interactionContext, interactionName]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (animationDisabled) {
|
|
44
|
+
setProgress(STATIC_PROGRESS_VALUE);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
intervalRef.current = setInterval(() => {
|
|
48
|
+
setProgress(prev => {
|
|
49
|
+
if (prev < 0.1) {
|
|
50
|
+
return prev + 0.1;
|
|
51
|
+
} else if (prev < 0.6) {
|
|
52
|
+
return prev + 0.35;
|
|
53
|
+
} else if (prev < 0.9) {
|
|
54
|
+
return prev + 0.1;
|
|
55
|
+
}
|
|
56
|
+
clearInterval(intervalRef.current);
|
|
57
|
+
return prev;
|
|
58
|
+
});
|
|
59
|
+
}, TICK_INTERVAL_MS);
|
|
60
|
+
return () => clearInterval(intervalRef.current);
|
|
61
|
+
}, [animationDisabled]);
|
|
62
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
role: "progressbar",
|
|
64
|
+
"aria-valuenow": progress,
|
|
65
|
+
"aria-label": intl.formatMessage(messages.loadingBarLabel),
|
|
66
|
+
"data-testid": testId,
|
|
67
|
+
className: ax(["_1reo15vq _18m915vq _2rko1rr0 _kqswstnw _94n5u2gc _1bsb1lk2 _1ltv1ghs _4t3ii2wt _bfhki8nm"])
|
|
68
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
style: {
|
|
70
|
+
width: `${clampToPercent(progress)}%`
|
|
71
|
+
},
|
|
72
|
+
className: ax(["_2rko1rr0 _v564aq9m _1e0c1ule _4t3i1osq _bfhk10ef"])
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
@@ -18,7 +18,7 @@ button:focus+._1hlmd0i9{outline:solid var(--ds-border-width-focused,2px) var(--d
|
|
|
18
18
|
._4t3ine4n{height:var(--media-wrapper-height)}
|
|
19
19
|
._5sb1v00u [data-cursor=wait]{cursor:wait}
|
|
20
20
|
._9m3z1osq>div{width:100%}
|
|
21
|
-
.
|
|
21
|
+
._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
|
|
22
22
|
._c71l1osq{max-height:100%}
|
|
23
23
|
._ect4ttxp{font-family:var(--ds-font-family-body,"Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
24
24
|
._eg541i5c:hover .media-card-blanket{background-color:var(--ds-blanket,#050c1f75)}
|
|
@@ -76,7 +76,7 @@ export const Wrapper = props => {
|
|
|
76
76
|
id: "newFileExperienceWrapper"
|
|
77
77
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
78
78
|
,
|
|
79
|
-
className: ax([wrapperStyles.default, "_yfmhtlke _5sb1v00u", displayBackground && "
|
|
79
|
+
className: ax([wrapperStyles.default, "_yfmhtlke _5sb1v00u", displayBackground && "_bfhkhfxm", wrapperShadowKey && shadowStyleMap[wrapperShadowKey], selected && "_1p1y1j28 _1rk81j28 _14r11j28 _1np21j28", isPlayButtonClickable && "_1y898vuz _19zy8vuz", isTickBoxSelectable && "_1yf91j9a _1xp5dgkc", shouldDisplayTooltip && "_9m3z1osq _10pb1osq", newFileExperienceClassName]),
|
|
80
80
|
"data-testid": testId,
|
|
81
81
|
style: {
|
|
82
82
|
[LOCAL_WIDTH_VARIABLE]: width,
|
|
@@ -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.7.
|
|
40
|
+
packageName: "80.7.5",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import SpinnerIcon from '@atlaskit/spinner';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
|
+
import { LoadingBar } from '../../card/ui/loadingBar/loadingBar';
|
|
3
5
|
import { getDimensionsWithDefault } from './getDimensionsWithDefault';
|
|
4
6
|
import { Wrapper } from './lightCardWrappers';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
}
|
|
7
|
+
export const CardLoading = ({
|
|
8
|
+
dimensions: dimensionsProp,
|
|
9
|
+
testId,
|
|
10
|
+
interactionName
|
|
11
|
+
}) => {
|
|
12
|
+
const dimensions = getDimensionsWithDefault(dimensionsProp);
|
|
13
|
+
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
14
|
+
"data-testid": testId || 'media-card-loading',
|
|
15
|
+
"data-test-loading": true,
|
|
16
|
+
dimensions: dimensions,
|
|
17
|
+
"data-vc": "media-card-loading"
|
|
18
|
+
}, expValEquals('cc-maui-ai-edit-loading-experiment', 'isEnabled', true) ? /*#__PURE__*/React.createElement(LoadingBar, {
|
|
19
|
+
interactionName: interactionName || 'media-card-loading'
|
|
20
|
+
}) : /*#__PURE__*/React.createElement(SpinnerIcon, {
|
|
21
|
+
interactionName: interactionName || 'media-card-loading'
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
@@ -6,7 +6,8 @@ export const wrapperStyles = ({
|
|
|
6
6
|
}) => css(
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
8
8
|
center, {
|
|
9
|
-
|
|
9
|
+
position: 'relative',
|
|
10
|
+
background: "var(--ds-surface-sunken, #F8F8F8)",
|
|
10
11
|
color: "var(--ds-icon, #292A2E)"
|
|
11
12
|
},
|
|
12
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -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.7.
|
|
12
|
+
const packageVersion = "80.7.5";
|
|
13
13
|
const SAMPLE_RATE = 0.05;
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -26,7 +26,7 @@ export function AIGeneratingOverlay(_ref) {
|
|
|
26
26
|
"aria-valuemin": 0,
|
|
27
27
|
"aria-valuemax": 100,
|
|
28
28
|
"data-testid": "ai-generating-overlay-progress-bar",
|
|
29
|
-
className: ax(["
|
|
29
|
+
className: ax(["_2rko1rr0 _1reo15vq _18m915vq _1bsb1lk2 _4t3ii2wt _kqswh2mm _bfhk15uy"])
|
|
30
30
|
}, /*#__PURE__*/React.createElement("div", {
|
|
31
31
|
"data-testid": "ai-generating-overlay-train",
|
|
32
32
|
className: ax(["_y44v15mx _1e0c1txw _kqswstnw _154iidpf _4t3i1osq"]),
|
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.7.
|
|
14
|
+
var packageVersion = "80.7.5";
|
|
15
15
|
export var CardBase = function CardBase(_ref) {
|
|
16
16
|
var identifier = _ref.identifier,
|
|
17
17
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -15,6 +15,7 @@ import { createAndFireMediaCardEvent } from '../utils/analytics';
|
|
|
15
15
|
import { ImageRenderer } from './ui/imageRenderer';
|
|
16
16
|
import { TitleBox } from './ui/titleBox/titleBox';
|
|
17
17
|
import { FailedTitleBox } from './ui/titleBox/failedTitleBox';
|
|
18
|
+
import { LoadingBar } from './ui/loadingBar/loadingBar';
|
|
18
19
|
import { ProgressBar } from './ui/progressBar/progressBar';
|
|
19
20
|
import { PlayButton } from './ui/playButton/playButton';
|
|
20
21
|
import { TickBox } from './ui/tickBox/tickBox';
|
|
@@ -292,13 +293,17 @@ export var CardViewBase = function CardViewBase(_ref) {
|
|
|
292
293
|
mediaType: mediaType,
|
|
293
294
|
mimeType: mimeType,
|
|
294
295
|
name: name
|
|
295
|
-
}), iconMessage), renderSpinner && /*#__PURE__*/React.createElement(
|
|
296
|
+
}), iconMessage), renderSpinner && (expValEquals('cc-maui-ai-edit-loading-experiment', 'isEnabled', true) ? /*#__PURE__*/React.createElement(LoadingBar, {
|
|
297
|
+
animationDisabled: disableAnimation,
|
|
298
|
+
testId: "media-card-loading",
|
|
299
|
+
interactionName: "media-card-loading"
|
|
300
|
+
}) : /*#__PURE__*/React.createElement(IconWrapper, {
|
|
296
301
|
breakpoint: breakpoint,
|
|
297
302
|
hasTitleBox: hasVisibleTitleBox
|
|
298
303
|
}, /*#__PURE__*/React.createElement(SpinnerIcon, {
|
|
299
304
|
testId: "media-card-loading",
|
|
300
305
|
interactionName: "media-card-loading"
|
|
301
|
-
})), renderSvgView && identifier && isFileIdentifier(identifier) && /*#__PURE__*/React.createElement(SvgView, {
|
|
306
|
+
}))), renderSvgView && identifier && isFileIdentifier(identifier) && /*#__PURE__*/React.createElement(SvgView, {
|
|
302
307
|
identifier: identifier,
|
|
303
308
|
resizeMode: resizeMode || 'crop',
|
|
304
309
|
onError: onSvgError,
|
|
@@ -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.7.
|
|
83
|
+
var packageVersion = "80.7.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,13 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko1rr0{border-radius:var(--ds-radius-full,9999px)}
|
|
3
|
+
._v564aq9m{transition:width .8s}._18m915vq{overflow-y:hidden}
|
|
4
|
+
._1bsb1lk2{width:95%}
|
|
5
|
+
._1e0c1ule{display:block}
|
|
6
|
+
._1ltv1ghs{left:2.5%}
|
|
7
|
+
._1reo15vq{overflow-x:hidden}
|
|
8
|
+
._4t3i1osq{height:100%}
|
|
9
|
+
._4t3ii2wt{height:6px}
|
|
10
|
+
._94n5u2gc{bottom:var(--ds-space-100,8px)}
|
|
11
|
+
._bfhk10ef{background-color:var(--ds-background-accent-gray-subtler-hovered,#b7b9be)}
|
|
12
|
+
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
13
|
+
._kqswstnw{position:absolute}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* loadingBar.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import "./loadingBar.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import React, { useContext, useEffect, useLayoutEffect as useRealLayoutEffect, useRef, useState } from 'react';
|
|
6
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
7
|
+
import InteractionContext from '@atlaskit/interaction-context';
|
|
8
|
+
var TICK_INTERVAL_MS = 1000;
|
|
9
|
+
var STATIC_PROGRESS_VALUE = 0.9;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* `useLayoutEffect` is being used in SSR safe form. On the server, this work doesn’t need to run.
|
|
13
|
+
* `useEffect` is used in-place, because `useEffect` is not run on the server and it matches types
|
|
14
|
+
* which makes things simpler than doing an `isServer` check or a `null` check.
|
|
15
|
+
*
|
|
16
|
+
* @see https://hello.atlassian.net/wiki/spaces/DST/pages/2081696628/DSTDACI-010+-+Interaction+Tracing+hooks+in+DS+components
|
|
17
|
+
*/
|
|
18
|
+
var useLayoutEffect = typeof window === 'undefined' ? useEffect : useRealLayoutEffect;
|
|
19
|
+
var messages = defineMessages({
|
|
20
|
+
loadingBarLabel: {
|
|
21
|
+
id: 'fabric.media.loading_bar_label',
|
|
22
|
+
defaultMessage: 'Loading',
|
|
23
|
+
description: 'Aria label for the loading bar shown while a media card is loading'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var trackStyles = null;
|
|
27
|
+
var fillStyles = null;
|
|
28
|
+
var clampToPercent = function clampToPercent(progress) {
|
|
29
|
+
return Math.min(1, Math.max(0, progress)) * 100;
|
|
30
|
+
};
|
|
31
|
+
export var LoadingBar = function LoadingBar(_ref) {
|
|
32
|
+
var _ref$animationDisable = _ref.animationDisabled,
|
|
33
|
+
animationDisabled = _ref$animationDisable === void 0 ? false : _ref$animationDisable,
|
|
34
|
+
testId = _ref.testId,
|
|
35
|
+
interactionName = _ref.interactionName;
|
|
36
|
+
var intl = useIntl();
|
|
37
|
+
var _useState = useState(animationDisabled ? STATIC_PROGRESS_VALUE : 0),
|
|
38
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
+
progress = _useState2[0],
|
|
40
|
+
setProgress = _useState2[1];
|
|
41
|
+
var intervalRef = useRef();
|
|
42
|
+
var interactionContext = useContext(InteractionContext);
|
|
43
|
+
useLayoutEffect(function () {
|
|
44
|
+
if (interactionContext != null) {
|
|
45
|
+
return interactionContext.hold(interactionName);
|
|
46
|
+
}
|
|
47
|
+
}, [interactionContext, interactionName]);
|
|
48
|
+
useEffect(function () {
|
|
49
|
+
if (animationDisabled) {
|
|
50
|
+
setProgress(STATIC_PROGRESS_VALUE);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
intervalRef.current = setInterval(function () {
|
|
54
|
+
setProgress(function (prev) {
|
|
55
|
+
if (prev < 0.1) {
|
|
56
|
+
return prev + 0.1;
|
|
57
|
+
} else if (prev < 0.6) {
|
|
58
|
+
return prev + 0.35;
|
|
59
|
+
} else if (prev < 0.9) {
|
|
60
|
+
return prev + 0.1;
|
|
61
|
+
}
|
|
62
|
+
clearInterval(intervalRef.current);
|
|
63
|
+
return prev;
|
|
64
|
+
});
|
|
65
|
+
}, TICK_INTERVAL_MS);
|
|
66
|
+
return function () {
|
|
67
|
+
return clearInterval(intervalRef.current);
|
|
68
|
+
};
|
|
69
|
+
}, [animationDisabled]);
|
|
70
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
role: "progressbar",
|
|
72
|
+
"aria-valuenow": progress,
|
|
73
|
+
"aria-label": intl.formatMessage(messages.loadingBarLabel),
|
|
74
|
+
"data-testid": testId,
|
|
75
|
+
className: ax(["_1reo15vq _18m915vq _2rko1rr0 _kqswstnw _94n5u2gc _1bsb1lk2 _1ltv1ghs _4t3ii2wt _bfhki8nm"])
|
|
76
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
style: {
|
|
78
|
+
width: "".concat(clampToPercent(progress), "%")
|
|
79
|
+
},
|
|
80
|
+
className: ax(["_2rko1rr0 _v564aq9m _1e0c1ule _4t3i1osq _bfhk10ef"])
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
@@ -18,7 +18,7 @@ button:focus+._1hlmd0i9{outline:solid var(--ds-border-width-focused,2px) var(--d
|
|
|
18
18
|
._4t3ine4n{height:var(--media-wrapper-height)}
|
|
19
19
|
._5sb1v00u [data-cursor=wait]{cursor:wait}
|
|
20
20
|
._9m3z1osq>div{width:100%}
|
|
21
|
-
.
|
|
21
|
+
._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
|
|
22
22
|
._c71l1osq{max-height:100%}
|
|
23
23
|
._ect4ttxp{font-family:var(--ds-font-family-body,"Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
24
24
|
._eg541i5c:hover .media-card-blanket{background-color:var(--ds-blanket,#050c1f75)}
|
|
@@ -71,7 +71,7 @@ export var Wrapper = function Wrapper(props) {
|
|
|
71
71
|
id: "newFileExperienceWrapper"
|
|
72
72
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
73
73
|
,
|
|
74
|
-
className: ax([wrapperStyles.default, "_yfmhtlke _5sb1v00u", displayBackground && "
|
|
74
|
+
className: ax([wrapperStyles.default, "_yfmhtlke _5sb1v00u", displayBackground && "_bfhkhfxm", wrapperShadowKey && shadowStyleMap[wrapperShadowKey], selected && "_1p1y1j28 _1rk81j28 _14r11j28 _1np21j28", isPlayButtonClickable && "_1y898vuz _19zy8vuz", isTickBoxSelectable && "_1yf91j9a _1xp5dgkc", shouldDisplayTooltip && "_9m3z1osq _10pb1osq", newFileExperienceClassName]),
|
|
75
75
|
"data-testid": testId,
|
|
76
76
|
style: _objectSpread(_defineProperty(_defineProperty({}, LOCAL_WIDTH_VARIABLE, width), LOCAL_HEIGHT_VARIABLE, height), getResponsiveStyles(breakpoint)),
|
|
77
77
|
ref: innerRef,
|
|
@@ -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.7.
|
|
104
|
+
packageName: "80.7.5",
|
|
105
105
|
componentName: 'mediaInlineCard',
|
|
106
106
|
component: 'mediaInlineCard'
|
|
107
107
|
};
|
|
@@ -1,37 +1,22 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
1
|
import React from 'react';
|
|
9
|
-
import
|
|
2
|
+
import SpinnerIcon from '@atlaskit/spinner';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
|
+
import { LoadingBar } from '../../card/ui/loadingBar/loadingBar';
|
|
10
5
|
import { getDimensionsWithDefault } from './getDimensionsWithDefault';
|
|
11
6
|
import { Wrapper } from './lightCardWrappers';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"data-testid": testId || 'media-card-loading',
|
|
29
|
-
"data-test-loading": true,
|
|
30
|
-
dimensions: dimensions,
|
|
31
|
-
"data-vc": "media-card-loading"
|
|
32
|
-
}, /*#__PURE__*/React.createElement(SpinnerIcon, {
|
|
33
|
-
interactionName: interactionName || 'media-card-loading'
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
}]);
|
|
37
|
-
}(Component);
|
|
7
|
+
export var CardLoading = function CardLoading(_ref) {
|
|
8
|
+
var dimensionsProp = _ref.dimensions,
|
|
9
|
+
testId = _ref.testId,
|
|
10
|
+
interactionName = _ref.interactionName;
|
|
11
|
+
var dimensions = getDimensionsWithDefault(dimensionsProp);
|
|
12
|
+
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
13
|
+
"data-testid": testId || 'media-card-loading',
|
|
14
|
+
"data-test-loading": true,
|
|
15
|
+
dimensions: dimensions,
|
|
16
|
+
"data-vc": "media-card-loading"
|
|
17
|
+
}, expValEquals('cc-maui-ai-edit-loading-experiment', 'isEnabled', true) ? /*#__PURE__*/React.createElement(LoadingBar, {
|
|
18
|
+
interactionName: interactionName || 'media-card-loading'
|
|
19
|
+
}) : /*#__PURE__*/React.createElement(SpinnerIcon, {
|
|
20
|
+
interactionName: interactionName || 'media-card-loading'
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
@@ -6,7 +6,8 @@ export var wrapperStyles = function wrapperStyles(_ref) {
|
|
|
6
6
|
return css(
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
8
8
|
center, {
|
|
9
|
-
|
|
9
|
+
position: 'relative',
|
|
10
|
+
background: "var(--ds-surface-sunken, #F8F8F8)",
|
|
10
11
|
color: "var(--ds-icon, #292A2E)"
|
|
11
12
|
},
|
|
12
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -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.7.
|
|
16
|
+
var packageVersion = "80.7.5";
|
|
17
17
|
var SAMPLE_RATE = 0.05;
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export type LoadingBarProps = {
|
|
7
|
+
animationDisabled?: boolean;
|
|
8
|
+
testId?: string;
|
|
9
|
+
interactionName?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const LoadingBar: ({ animationDisabled, testId, interactionName, }: LoadingBarProps) => React.JSX.Element;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Component } from 'react';
|
|
3
2
|
import { type StaticCardProps } from './types';
|
|
4
|
-
export declare
|
|
5
|
-
render(): React.JSX.Element;
|
|
6
|
-
}
|
|
3
|
+
export declare const CardLoading: ({ dimensions: dimensionsProp, testId, interactionName, }: StaticCardProps) => React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export type LoadingBarProps = {
|
|
7
|
+
animationDisabled?: boolean;
|
|
8
|
+
testId?: string;
|
|
9
|
+
interactionName?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const LoadingBar: ({ animationDisabled, testId, interactionName, }: LoadingBarProps) => React.JSX.Element;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Component } from 'react';
|
|
3
2
|
import { type StaticCardProps } from './types';
|
|
4
|
-
export declare
|
|
5
|
-
render(): React.JSX.Element;
|
|
6
|
-
}
|
|
3
|
+
export declare const CardLoading: ({ dimensions: dimensionsProp, testId, interactionName, }: StaticCardProps) => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "80.
|
|
3
|
+
"version": "80.8.0",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@atlaskit/dropdown-menu": "^16.10.0",
|
|
43
43
|
"@atlaskit/editor-shared-styles": "^3.11.0",
|
|
44
44
|
"@atlaskit/icon": "^35.4.0",
|
|
45
|
+
"@atlaskit/interaction-context": "^3.1.0",
|
|
45
46
|
"@atlaskit/link": "^3.4.0",
|
|
46
47
|
"@atlaskit/media-client": "^36.3.0",
|
|
47
48
|
"@atlaskit/media-client-react": "^5.2.0",
|
|
@@ -54,11 +55,11 @@
|
|
|
54
55
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
55
56
|
"@atlaskit/primitives": "^19.0.0",
|
|
56
57
|
"@atlaskit/progress-bar": "^4.2.0",
|
|
57
|
-
"@atlaskit/react-ufo": "^6.
|
|
58
|
+
"@atlaskit/react-ufo": "^6.7.0",
|
|
58
59
|
"@atlaskit/spinner": "^19.1.0",
|
|
59
60
|
"@atlaskit/theme": "^25.0.0",
|
|
60
|
-
"@atlaskit/tmp-editor-statsig": "^89.
|
|
61
|
-
"@atlaskit/tokens": "^13.
|
|
61
|
+
"@atlaskit/tmp-editor-statsig": "^89.2.0",
|
|
62
|
+
"@atlaskit/tokens": "^13.2.0",
|
|
62
63
|
"@atlaskit/tooltip": "^22.6.0",
|
|
63
64
|
"@atlaskit/ufo": "^0.5.0",
|
|
64
65
|
"@atlaskit/visually-hidden": "^3.1.0",
|