@atlaskit/media-card 77.7.7 → 77.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 +10 -0
- package/dist/cjs/card/card.js +10 -1
- package/dist/cjs/card/cardView.js +11 -3
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/openMediaViewerButton/openMediaViewerButton.js +38 -0
- package/dist/cjs/card/ui/wrapper/styles.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/cardViewV2.js +12 -4
- package/dist/cjs/card/v2/cardviews/cardViewWrapper.js +12 -4
- package/dist/cjs/card/v2/cardviews/index.js +6 -2
- package/dist/cjs/card/v2/fileCard.js +15 -0
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +10 -1
- package/dist/es2019/card/cardView.js +10 -3
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/openMediaViewerButton/openMediaViewerButton.js +37 -0
- package/dist/es2019/card/ui/wrapper/styles.js +5 -1
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/card/v2/cardViewV2.js +11 -4
- package/dist/es2019/card/v2/cardviews/cardViewWrapper.js +10 -3
- package/dist/es2019/card/v2/cardviews/index.js +6 -2
- package/dist/es2019/card/v2/fileCard.js +15 -0
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +10 -1
- package/dist/esm/card/cardView.js +11 -3
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/openMediaViewerButton/openMediaViewerButton.js +31 -0
- package/dist/esm/card/ui/wrapper/styles.js +2 -2
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/card/v2/cardViewV2.js +12 -4
- package/dist/esm/card/v2/cardviews/cardViewWrapper.js +12 -4
- package/dist/esm/card/v2/cardviews/index.js +6 -2
- package/dist/esm/card/v2/fileCard.js +15 -0
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/card.d.ts +4 -2
- package/dist/types/card/cardView.d.ts +3 -1
- package/dist/types/card/ui/openMediaViewerButton/openMediaViewerButton.d.ts +13 -0
- package/dist/types/card/v2/cardViewV2.d.ts +4 -2
- package/dist/types/card/v2/cardviews/cardViewWrapper.d.ts +3 -1
- package/dist/types/card/v2/cardviews/index.d.ts +4 -2
- package/dist/types-ts4.5/card/card.d.ts +4 -2
- package/dist/types-ts4.5/card/cardView.d.ts +3 -1
- package/dist/types-ts4.5/card/ui/openMediaViewerButton/openMediaViewerButton.d.ts +13 -0
- package/dist/types-ts4.5/card/v2/cardViewV2.d.ts +4 -2
- package/dist/types-ts4.5/card/v2/cardviews/cardViewWrapper.d.ts +3 -1
- package/dist/types-ts4.5/card/v2/cardviews/index.d.ts +4 -2
- package/example-helpers/styles.ts +0 -2
- package/package.json +4 -4
|
@@ -38,7 +38,9 @@ export const CardViewsBase = ({
|
|
|
38
38
|
titleBoxBgColor,
|
|
39
39
|
titleBoxIcon,
|
|
40
40
|
error,
|
|
41
|
-
disableAnimation
|
|
41
|
+
disableAnimation,
|
|
42
|
+
shouldOpenMediaViewer,
|
|
43
|
+
openMediaViewerButtonRef
|
|
42
44
|
}) => {
|
|
43
45
|
const [didImageRender, setDidImageRender] = useState(false);
|
|
44
46
|
const divRef = useRef(null);
|
|
@@ -94,7 +96,9 @@ export const CardViewsBase = ({
|
|
|
94
96
|
onClick,
|
|
95
97
|
onMouseEnter,
|
|
96
98
|
mediaCardCursor,
|
|
97
|
-
innerRef
|
|
99
|
+
innerRef,
|
|
100
|
+
shouldOpenMediaViewer,
|
|
101
|
+
openMediaViewerButtonRef
|
|
98
102
|
};
|
|
99
103
|
switch (status) {
|
|
100
104
|
case 'uploading':
|
|
@@ -97,6 +97,7 @@ export const FileCard = ({
|
|
|
97
97
|
wasStatusUploading: false,
|
|
98
98
|
wasStatusProcessing: false
|
|
99
99
|
});
|
|
100
|
+
const mediaViewerButtonRef = useRef(null);
|
|
100
101
|
|
|
101
102
|
// Generate unique traceId for file
|
|
102
103
|
const traceContext = useMemo(() => ({
|
|
@@ -247,6 +248,18 @@ export const FileCard = ({
|
|
|
247
248
|
});
|
|
248
249
|
});
|
|
249
250
|
|
|
251
|
+
//----------------------------------------------------------------//
|
|
252
|
+
//--------------------- Focus on Close Viewer -------------------//
|
|
253
|
+
//----------------------------------------------------------------//
|
|
254
|
+
|
|
255
|
+
const wasViewerPreviouslyOpen = usePrevious(mediaViewerSelectedItem);
|
|
256
|
+
useEffect(() => {
|
|
257
|
+
if (wasViewerPreviouslyOpen && !mediaViewerSelectedItem) {
|
|
258
|
+
var _mediaViewerButtonRef;
|
|
259
|
+
(_mediaViewerButtonRef = mediaViewerButtonRef.current) === null || _mediaViewerButtonRef === void 0 ? void 0 : _mediaViewerButtonRef.focus();
|
|
260
|
+
}
|
|
261
|
+
}, [wasViewerPreviouslyOpen, mediaViewerSelectedItem]);
|
|
262
|
+
|
|
250
263
|
//----------------------------------------------------------------//
|
|
251
264
|
//---------------------- Callbacks & Handlers -------------------//
|
|
252
265
|
//----------------------------------------------------------------//
|
|
@@ -473,6 +486,8 @@ export const FileCard = ({
|
|
|
473
486
|
actions: computedActions,
|
|
474
487
|
selectable: selectable,
|
|
475
488
|
selected: selected,
|
|
489
|
+
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
490
|
+
openMediaViewerButtonRef: mediaViewerButtonRef,
|
|
476
491
|
onClick: withCallbacks ? onCardViewClick : undefined,
|
|
477
492
|
onMouseEnter: withCallbacks ? event => {
|
|
478
493
|
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({
|
|
@@ -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: "77.
|
|
40
|
+
packageName: "77.8.0",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -4,7 +4,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
4
4
|
import { MediaCardError } from '../errors';
|
|
5
5
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
6
6
|
const packageName = "@atlaskit/media-card";
|
|
7
|
-
const packageVersion = "77.
|
|
7
|
+
const packageVersion = "77.8.0";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
package/dist/esm/card/card.js
CHANGED
|
@@ -41,7 +41,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
|
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
43
43
|
var packageName = "@atlaskit/media-card";
|
|
44
|
-
var packageVersion = "77.
|
|
44
|
+
var packageVersion = "77.8.0";
|
|
45
45
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
46
46
|
_inherits(CardBase, _Component);
|
|
47
47
|
var _super = _createSuper(CardBase);
|
|
@@ -53,6 +53,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
53
53
|
// of Cards regardless of whether it shares the same file (either internal or external)
|
|
54
54
|
_defineProperty(_assertThisInitialized(_this), "internalOccurrenceKey", generateUniqueId());
|
|
55
55
|
_defineProperty(_assertThisInitialized(_this), "hasBeenMounted", false);
|
|
56
|
+
_defineProperty(_assertThisInitialized(_this), "mediaViewerButtonRef", null);
|
|
56
57
|
_defineProperty(_assertThisInitialized(_this), "fileStateFlags", {
|
|
57
58
|
wasStatusUploading: false,
|
|
58
59
|
wasStatusProcessing: false
|
|
@@ -440,6 +441,9 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
440
441
|
cardRef: cardRef
|
|
441
442
|
});
|
|
442
443
|
});
|
|
444
|
+
_defineProperty(_assertThisInitialized(_this), "setMediaViewerButtonRef", function (buttonRef) {
|
|
445
|
+
_this.mediaViewerButtonRef = buttonRef;
|
|
446
|
+
});
|
|
443
447
|
_defineProperty(_assertThisInitialized(_this), "renderInlinePlayer", function () {
|
|
444
448
|
var _this$props6 = _this.props,
|
|
445
449
|
identifier = _this$props6.identifier,
|
|
@@ -473,6 +477,9 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
473
477
|
_defineProperty(_assertThisInitialized(_this), "onMediaViewerClose", function () {
|
|
474
478
|
_this.setState({
|
|
475
479
|
mediaViewerSelectedItem: undefined
|
|
480
|
+
}, function () {
|
|
481
|
+
var _this$mediaViewerButt;
|
|
482
|
+
(_this$mediaViewerButt = _this.mediaViewerButtonRef) === null || _this$mediaViewerButt === void 0 || _this$mediaViewerButt.focus();
|
|
476
483
|
});
|
|
477
484
|
});
|
|
478
485
|
_defineProperty(_assertThisInitialized(_this), "onDisplayImage", function () {
|
|
@@ -574,12 +581,14 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
574
581
|
actions: actions,
|
|
575
582
|
selectable: selectable,
|
|
576
583
|
selected: selected,
|
|
584
|
+
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
577
585
|
onClick: withCallbacks ? onCardViewClick : undefined,
|
|
578
586
|
onMouseEnter: withCallbacks ? onMouseEnter : undefined,
|
|
579
587
|
disableOverlay: disableOverlay,
|
|
580
588
|
progress: progress,
|
|
581
589
|
onDisplayImage: withCallbacks ? onDisplayImage : undefined,
|
|
582
590
|
innerRef: _this.setRef,
|
|
591
|
+
openMediaViewerButtonRef: _this.setMediaViewerButtonRef,
|
|
583
592
|
testId: testId,
|
|
584
593
|
featureFlags: featureFlags,
|
|
585
594
|
titleBoxBgColor: titleBoxBgColor,
|
|
@@ -37,6 +37,7 @@ import { isUploadError, isRateLimitedError, isPollingError } from '../errors';
|
|
|
37
37
|
import { Wrapper } from './ui/wrapper';
|
|
38
38
|
import { fileCardImageViewSelector } from './classnames';
|
|
39
39
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
40
|
+
import OpenMediaViewerButton from './ui/openMediaViewerButton/openMediaViewerButton';
|
|
40
41
|
/**
|
|
41
42
|
* This is classic vanilla CardView class. To create an instance of class one would need to supply
|
|
42
43
|
* `createAnalyticsEvent` prop to satisfy it's Analytics Events needs.
|
|
@@ -402,7 +403,10 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
402
403
|
disableOverlay = _this$props8.disableOverlay,
|
|
403
404
|
cardPreview = _this$props8.cardPreview,
|
|
404
405
|
mediaCardCursor = _this$props8.mediaCardCursor,
|
|
405
|
-
shouldHideTooltip = _this$props8.shouldHideTooltip
|
|
406
|
+
shouldHideTooltip = _this$props8.shouldHideTooltip,
|
|
407
|
+
_this$props8$openMedi = _this$props8.openMediaViewerButtonRef,
|
|
408
|
+
openMediaViewerButtonRef = _this$props8$openMedi === void 0 ? null : _this$props8$openMedi,
|
|
409
|
+
shouldOpenMediaViewer = _this$props8.shouldOpenMediaViewer;
|
|
406
410
|
var _ref9 = metadata || {},
|
|
407
411
|
name = _ref9.name;
|
|
408
412
|
var shouldDisplayBackground = !cardPreview || !disableOverlay || status === 'error' || status === 'failed-processing';
|
|
@@ -410,7 +414,11 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
410
414
|
var isTickBoxSelectable = !disableOverlay && !!selectable && !selected;
|
|
411
415
|
// Disable tooltip for Media Single
|
|
412
416
|
var shouldDisplayTooltip = !disableOverlay && !shouldHideTooltip;
|
|
413
|
-
return jsx(
|
|
417
|
+
return jsx(React.Fragment, null, shouldOpenMediaViewer && jsx(OpenMediaViewerButton, {
|
|
418
|
+
fileName: name !== null && name !== void 0 ? name : '',
|
|
419
|
+
innerRef: openMediaViewerButtonRef,
|
|
420
|
+
onClick: onClick
|
|
421
|
+
}), jsx(Wrapper, {
|
|
414
422
|
testId: testId || 'media-card-view',
|
|
415
423
|
dimensions: dimensions,
|
|
416
424
|
appearance: appearance,
|
|
@@ -429,7 +437,7 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
429
437
|
content: name,
|
|
430
438
|
position: "bottom",
|
|
431
439
|
tag: 'div'
|
|
432
|
-
}, this.renderContents()) : this.renderContents());
|
|
440
|
+
}, this.renderContents()) : this.renderContents()));
|
|
433
441
|
}
|
|
434
442
|
}]);
|
|
435
443
|
return CardViewBase;
|
|
@@ -83,7 +83,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
83
83
|
}(React.Component);
|
|
84
84
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
85
85
|
var packageName = "@atlaskit/media-card";
|
|
86
|
-
var packageVersion = "77.
|
|
86
|
+
var packageVersion = "77.8.0";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
|
+
var _excluded = ["fileName", "innerRef"];
|
|
5
|
+
var _templateObject;
|
|
6
|
+
/** @jsx jsx */
|
|
7
|
+
import { jsx, css } from '@emotion/react';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { injectIntl, IntlProvider, useIntl } from 'react-intl-next';
|
|
10
|
+
import { messages } from '@atlaskit/media-ui';
|
|
11
|
+
export var visuallyHiddenStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 1px;\n height: 1px;\n padding: 0;\n position: fixed;\n border: 0;\n clip: rect(1px, 1px, 1px, 1px);\n overflow: hidden;\n white-space: nowrap;\n"])));
|
|
12
|
+
var OpenMediaViewerButton = function OpenMediaViewerButton(_ref) {
|
|
13
|
+
var fileName = _ref.fileName,
|
|
14
|
+
innerRef = _ref.innerRef,
|
|
15
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
var intl = useIntl();
|
|
17
|
+
return jsx("button", _extends({
|
|
18
|
+
ref: innerRef,
|
|
19
|
+
css: visuallyHiddenStyles
|
|
20
|
+
}, props), intl.formatMessage(messages.open_file_in_viewer, {
|
|
21
|
+
name: fileName
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
var OpenMediaViewerButtonWrapper = function OpenMediaViewerButtonWrapper(props) {
|
|
25
|
+
return props.intl ? jsx(OpenMediaViewerButton, props) : jsx(IntlProvider, {
|
|
26
|
+
locale: "en"
|
|
27
|
+
}, jsx(OpenMediaViewerButton, props));
|
|
28
|
+
};
|
|
29
|
+
export default injectIntl(OpenMediaViewerButtonWrapper, {
|
|
30
|
+
enforceContext: false
|
|
31
|
+
});
|
|
@@ -3,7 +3,7 @@ var _templateObject;
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { fontFamily } from '@atlaskit/theme/constants';
|
|
5
5
|
import { borderRadius } from '@atlaskit/media-ui';
|
|
6
|
-
import { N20 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { N20, B100 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { hideNativeBrowserTextSelectionStyles } from '@atlaskit/editor-shared-styles/selection';
|
|
8
8
|
import { transition } from '../styles';
|
|
9
9
|
import { fixedBlanketStyles, blanketClassName } from '../blanket/styles';
|
|
@@ -20,6 +20,6 @@ export var wrapperStyles = function wrapperStyles(_ref) {
|
|
|
20
20
|
isTickBoxSelectable = _ref.isTickBoxSelectable,
|
|
21
21
|
shouldDisplayTooltip = _ref.shouldDisplayTooltip,
|
|
22
22
|
mediaCardCursor = _ref.mediaCardCursor;
|
|
23
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n position: relative;\n font-family: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n\n /* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */\n ", "\n ", "\n &:hover .", " {\n ", "\n }\n &:hover .", " {\n ", "\n }\n\n /* Tooltip does not support percentage dimensions. We enforce them here */\n ", "\n"])), transition(), fontFamily(), getWrapperDimensions(dimensions, appearance), displayBackground && "background: ".concat("var(--ds-background-neutral, ".concat(N20, ")"), ";"), borderRadius, getCursorStyle(mediaCardCursor), getWrapperShadow(disableOverlay, selected), generateResponsiveStyles(breakpoint), hideNativeBrowserTextSelectionStyles, getClickablePlayButtonStyles(isPlayButtonClickable), getSelectableTickBoxStyles(isTickBoxSelectable), blanketClassName, fixedBlanketStyles, actionsBarClassName, fixedActionBarStyles, shouldDisplayTooltip && "> div { width: 100%; height: 100%; }");
|
|
23
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n position: relative;\n font-family: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n\n /* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */\n ", "\n ", "\n &:hover .", " {\n ", "\n }\n &:hover .", " {\n ", "\n }\n\n /* Tooltip does not support percentage dimensions. We enforce them here */\n ", "\n\n button:focus + & {\n outline: solid 2px ", ";\n }\n"])), transition(), fontFamily(), getWrapperDimensions(dimensions, appearance), displayBackground && "background: ".concat("var(--ds-background-neutral, ".concat(N20, ")"), ";"), borderRadius, getCursorStyle(mediaCardCursor), getWrapperShadow(disableOverlay, selected), generateResponsiveStyles(breakpoint), hideNativeBrowserTextSelectionStyles, getClickablePlayButtonStyles(isPlayButtonClickable), getSelectableTickBoxStyles(isTickBoxSelectable), blanketClassName, fixedBlanketStyles, actionsBarClassName, fixedActionBarStyles, shouldDisplayTooltip && "> div { width: 100%; height: 100%; }", "var(--ds-border-focused, ".concat(B100, ")"));
|
|
24
24
|
};
|
|
25
25
|
wrapperStyles.displayName = 'NewFileExperienceWrapper';
|
|
@@ -9,7 +9,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
9
9
|
import { ExternalImageCard } from './externalImageCard';
|
|
10
10
|
import { FileCard } from './fileCard';
|
|
11
11
|
var packageName = "@atlaskit/media-card";
|
|
12
|
-
var packageVersion = "77.
|
|
12
|
+
var packageVersion = "77.8.0";
|
|
13
13
|
export var CardV2Base = function CardV2Base(_ref) {
|
|
14
14
|
var identifier = _ref.identifier,
|
|
15
15
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -27,6 +27,7 @@ import { isUploadError, isRateLimitedError, isPollingError } from '../../errors'
|
|
|
27
27
|
import { Wrapper } from '../ui/wrapper';
|
|
28
28
|
import { fileCardImageViewSelector } from '../classnames';
|
|
29
29
|
import { useBreakpoint } from '../useBreakpoint';
|
|
30
|
+
import OpenMediaViewerButton from '../ui/openMediaViewerButton/openMediaViewerButton';
|
|
30
31
|
export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
31
32
|
var innerRef = _ref.innerRef,
|
|
32
33
|
onImageLoad = _ref.onImageLoad,
|
|
@@ -53,7 +54,10 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
53
54
|
titleBoxBgColor = _ref.titleBoxBgColor,
|
|
54
55
|
titleBoxIcon = _ref.titleBoxIcon,
|
|
55
56
|
error = _ref.error,
|
|
56
|
-
disableAnimation = _ref.disableAnimation
|
|
57
|
+
disableAnimation = _ref.disableAnimation,
|
|
58
|
+
_ref$openMediaViewerB = _ref.openMediaViewerButtonRef,
|
|
59
|
+
openMediaViewerButtonRef = _ref$openMediaViewerB === void 0 ? null : _ref$openMediaViewerB,
|
|
60
|
+
shouldOpenMediaViewer = _ref.shouldOpenMediaViewer;
|
|
57
61
|
var _useState = useState(false),
|
|
58
62
|
_useState2 = _slicedToArray(_useState, 2),
|
|
59
63
|
didImageRender = _useState2[0],
|
|
@@ -196,7 +200,7 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
196
200
|
name = _ref5.name,
|
|
197
201
|
createdAt = _ref5.createdAt;
|
|
198
202
|
var actionsWithDetails = metadata && actions ? attachDetailsToActions(actions, metadata) : [];
|
|
199
|
-
var
|
|
203
|
+
var contents = jsx(React.Fragment, null, jsx("div", {
|
|
200
204
|
css: cardImageContainerStyles,
|
|
201
205
|
className: fileCardImageViewSelector,
|
|
202
206
|
"data-testid": fileCardImageViewSelector,
|
|
@@ -251,7 +255,11 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
251
255
|
})), disableOverlay || !actions || actions.length === 0 ? null : jsx(ActionsBar, {
|
|
252
256
|
actions: actionsWithDetails
|
|
253
257
|
}));
|
|
254
|
-
return jsx(
|
|
258
|
+
return jsx(React.Fragment, null, shouldOpenMediaViewer && jsx(OpenMediaViewerButton, {
|
|
259
|
+
fileName: name !== null && name !== void 0 ? name : '',
|
|
260
|
+
innerRef: openMediaViewerButtonRef,
|
|
261
|
+
onClick: onClick
|
|
262
|
+
}), jsx(Wrapper, {
|
|
255
263
|
testId: testId || 'media-card-view',
|
|
256
264
|
dimensions: dimensions,
|
|
257
265
|
onClick: onClick,
|
|
@@ -269,7 +277,7 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
269
277
|
content: name,
|
|
270
278
|
position: "bottom",
|
|
271
279
|
tag: "div"
|
|
272
|
-
},
|
|
280
|
+
}, contents) : contents));
|
|
273
281
|
};
|
|
274
282
|
export var CardViewV2 = withAnalyticsEvents({
|
|
275
283
|
onClick: createAndFireMediaCardEvent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["cardPreview", "testId", "dimensions", "appearance", "metadata", "selected", "selectable", "actions", "breakpoint", "disableOverlay", "titleBoxBgColor", "titleBoxIcon", "shouldHideTooltip", "children", "onClick", "onMouseEnter", "mediaCardCursor", "customBlanket", "customTitleBox", "progressBar"];
|
|
3
|
+
var _excluded = ["cardPreview", "testId", "dimensions", "appearance", "metadata", "selected", "selectable", "actions", "breakpoint", "disableOverlay", "titleBoxBgColor", "titleBoxIcon", "shouldHideTooltip", "children", "onClick", "onMouseEnter", "mediaCardCursor", "customBlanket", "customTitleBox", "progressBar", "shouldOpenMediaViewer", "openMediaViewerButtonRef"];
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import React from 'react';
|
|
@@ -13,6 +13,7 @@ import { TickBox } from '../../ui/tickBox/tickBox';
|
|
|
13
13
|
import { Blanket } from '../../ui/blanket/blanket';
|
|
14
14
|
import { ActionsBar } from '../../ui/actionsBar/actionsBar';
|
|
15
15
|
import { fileCardImageViewSelector } from '../../classnames';
|
|
16
|
+
import OpenMediaViewerButton from '../../ui/openMediaViewerButton/openMediaViewerButton';
|
|
16
17
|
export var CardViewWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
17
18
|
var cardPreview = _ref.cardPreview,
|
|
18
19
|
testId = _ref.testId,
|
|
@@ -35,6 +36,9 @@ export var CardViewWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
35
36
|
customBlanket = _ref.customBlanket,
|
|
36
37
|
customTitleBox = _ref.customTitleBox,
|
|
37
38
|
progressBar = _ref.progressBar,
|
|
39
|
+
shouldOpenMediaViewer = _ref.shouldOpenMediaViewer,
|
|
40
|
+
_ref$openMediaViewerB = _ref.openMediaViewerButtonRef,
|
|
41
|
+
openMediaViewerButtonRef = _ref$openMediaViewerB === void 0 ? null : _ref$openMediaViewerB,
|
|
38
42
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
39
43
|
var _ref2 = metadata || {},
|
|
40
44
|
name = _ref2.name,
|
|
@@ -49,7 +53,7 @@ export var CardViewWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
49
53
|
titleBoxIcon: titleBoxIcon,
|
|
50
54
|
titleBoxBgColor: titleBoxBgColor
|
|
51
55
|
});
|
|
52
|
-
var
|
|
56
|
+
var contents = jsx(React.Fragment, null, jsx("div", _extends({
|
|
53
57
|
css: cardImageContainerStyles,
|
|
54
58
|
className: fileCardImageViewSelector,
|
|
55
59
|
"data-testid": fileCardImageViewSelector,
|
|
@@ -70,7 +74,11 @@ export var CardViewWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
70
74
|
var isTickBoxSelectable = !disableOverlay && !!selectable && !selected;
|
|
71
75
|
var shouldDisplayTooltip = !disableOverlay && !shouldHideTooltip;
|
|
72
76
|
var shouldDisplayBackground = !cardPreview || !disableOverlay;
|
|
73
|
-
return jsx(
|
|
77
|
+
return jsx(React.Fragment, null, shouldOpenMediaViewer && jsx(OpenMediaViewerButton, {
|
|
78
|
+
fileName: name !== null && name !== void 0 ? name : '',
|
|
79
|
+
innerRef: openMediaViewerButtonRef,
|
|
80
|
+
onClick: onClick
|
|
81
|
+
}), jsx(Wrapper, {
|
|
74
82
|
testId: testId || 'media-card-view',
|
|
75
83
|
dimensions: dimensions,
|
|
76
84
|
appearance: appearance,
|
|
@@ -89,5 +97,5 @@ export var CardViewWrapper = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
89
97
|
content: name,
|
|
90
98
|
position: "bottom",
|
|
91
99
|
tag: "div"
|
|
92
|
-
},
|
|
100
|
+
}, contents) : contents));
|
|
93
101
|
});
|
|
@@ -40,7 +40,9 @@ export var CardViewsBase = function CardViewsBase(_ref) {
|
|
|
40
40
|
titleBoxBgColor = _ref.titleBoxBgColor,
|
|
41
41
|
titleBoxIcon = _ref.titleBoxIcon,
|
|
42
42
|
error = _ref.error,
|
|
43
|
-
disableAnimation = _ref.disableAnimation
|
|
43
|
+
disableAnimation = _ref.disableAnimation,
|
|
44
|
+
shouldOpenMediaViewer = _ref.shouldOpenMediaViewer,
|
|
45
|
+
openMediaViewerButtonRef = _ref.openMediaViewerButtonRef;
|
|
44
46
|
var _useState = useState(false),
|
|
45
47
|
_useState2 = _slicedToArray(_useState, 2),
|
|
46
48
|
didImageRender = _useState2[0],
|
|
@@ -97,7 +99,9 @@ export var CardViewsBase = function CardViewsBase(_ref) {
|
|
|
97
99
|
onClick: onClick,
|
|
98
100
|
onMouseEnter: onMouseEnter,
|
|
99
101
|
mediaCardCursor: mediaCardCursor,
|
|
100
|
-
innerRef: innerRef
|
|
102
|
+
innerRef: innerRef,
|
|
103
|
+
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
104
|
+
openMediaViewerButtonRef: openMediaViewerButtonRef
|
|
101
105
|
};
|
|
102
106
|
switch (status) {
|
|
103
107
|
case 'uploading':
|
|
@@ -117,6 +117,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
117
117
|
wasStatusUploading: false,
|
|
118
118
|
wasStatusProcessing: false
|
|
119
119
|
});
|
|
120
|
+
var mediaViewerButtonRef = useRef(null);
|
|
120
121
|
|
|
121
122
|
// Generate unique traceId for file
|
|
122
123
|
var traceContext = useMemo(function () {
|
|
@@ -285,6 +286,18 @@ export var FileCard = function FileCard(_ref) {
|
|
|
285
286
|
});
|
|
286
287
|
});
|
|
287
288
|
|
|
289
|
+
//----------------------------------------------------------------//
|
|
290
|
+
//--------------------- Focus on Close Viewer -------------------//
|
|
291
|
+
//----------------------------------------------------------------//
|
|
292
|
+
|
|
293
|
+
var wasViewerPreviouslyOpen = usePrevious(mediaViewerSelectedItem);
|
|
294
|
+
useEffect(function () {
|
|
295
|
+
if (wasViewerPreviouslyOpen && !mediaViewerSelectedItem) {
|
|
296
|
+
var _mediaViewerButtonRef;
|
|
297
|
+
(_mediaViewerButtonRef = mediaViewerButtonRef.current) === null || _mediaViewerButtonRef === void 0 || _mediaViewerButtonRef.focus();
|
|
298
|
+
}
|
|
299
|
+
}, [wasViewerPreviouslyOpen, mediaViewerSelectedItem]);
|
|
300
|
+
|
|
288
301
|
//----------------------------------------------------------------//
|
|
289
302
|
//---------------------- Callbacks & Handlers -------------------//
|
|
290
303
|
//----------------------------------------------------------------//
|
|
@@ -511,6 +524,8 @@ export var FileCard = function FileCard(_ref) {
|
|
|
511
524
|
actions: computedActions,
|
|
512
525
|
selectable: selectable,
|
|
513
526
|
selected: selected,
|
|
527
|
+
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
528
|
+
openMediaViewerButtonRef: mediaViewerButtonRef,
|
|
514
529
|
onClick: withCallbacks ? onCardViewClick : undefined,
|
|
515
530
|
onMouseEnter: withCallbacks ? function (event) {
|
|
516
531
|
onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter({
|
|
@@ -103,7 +103,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
103
103
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
104
104
|
var analyticsContext = {
|
|
105
105
|
packageVersion: "@atlaskit/media-card",
|
|
106
|
-
packageName: "77.
|
|
106
|
+
packageName: "77.8.0",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -7,7 +7,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
7
7
|
import { MediaCardError } from '../errors';
|
|
8
8
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
9
9
|
var packageName = "@atlaskit/media-card";
|
|
10
|
-
var packageVersion = "77.
|
|
10
|
+
var packageVersion = "77.8.0";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
|
@@ -10,6 +10,7 @@ export type CardBaseProps = CardProps & WithAnalyticsEventsProps & Partial<Wrapp
|
|
|
10
10
|
export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
11
11
|
private internalOccurrenceKey;
|
|
12
12
|
private hasBeenMounted;
|
|
13
|
+
private mediaViewerButtonRef;
|
|
13
14
|
private fileStateFlags;
|
|
14
15
|
private ssrReliability;
|
|
15
16
|
private timeElapsedTillCommenced;
|
|
@@ -49,9 +50,10 @@ export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
|
49
50
|
private safeSetState;
|
|
50
51
|
unsubscribe: () => void;
|
|
51
52
|
get actions(): CardAction[];
|
|
52
|
-
onCardViewClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
53
|
+
onCardViewClick: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
53
54
|
onInlinePlayerError: (e: Error) => void;
|
|
54
55
|
setRef: (cardRef: HTMLDivElement | null) => void;
|
|
56
|
+
setMediaViewerButtonRef: (buttonRef: HTMLButtonElement | null) => void;
|
|
55
57
|
renderInlinePlayer: () => JSX.Element;
|
|
56
58
|
onMediaViewerClose: () => void;
|
|
57
59
|
private onDisplayImage;
|
|
@@ -60,7 +62,7 @@ export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
|
60
62
|
private storeSSRData;
|
|
61
63
|
render(): JSX.Element;
|
|
62
64
|
private onCardInViewport;
|
|
63
|
-
onClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
65
|
+
onClick: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
64
66
|
onMouseEnter: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
65
67
|
}
|
|
66
68
|
export declare const Card: React.ComponentType<CardBaseProps>;
|
|
@@ -14,12 +14,14 @@ export interface CardViewOwnProps extends SharedCardProps {
|
|
|
14
14
|
readonly mediaCardCursor?: MediaCardCursor;
|
|
15
15
|
readonly metadata?: FileDetails;
|
|
16
16
|
readonly error?: MediaCardError;
|
|
17
|
-
readonly
|
|
17
|
+
readonly shouldOpenMediaViewer: boolean;
|
|
18
|
+
readonly onClick?: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
18
19
|
readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
19
20
|
readonly onDisplayImage?: () => void;
|
|
20
21
|
readonly cardPreview?: CardPreview;
|
|
21
22
|
readonly progress?: number;
|
|
22
23
|
readonly innerRef?: (instance: HTMLDivElement | null) => void;
|
|
24
|
+
readonly openMediaViewerButtonRef?: React.Ref<HTMLButtonElement>;
|
|
23
25
|
readonly onImageLoad: (cardPreview: CardPreview) => void;
|
|
24
26
|
readonly onImageError: (cardPreview: CardPreview) => void;
|
|
25
27
|
readonly nativeLazyLoad?: boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
export declare const visuallyHiddenStyles: import("@emotion/react").SerializedStyles;
|
|
4
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
|
|
5
|
+
fileName: string;
|
|
6
|
+
innerRef: React.Ref<HTMLButtonElement>;
|
|
7
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & WrappedComponentProps<"intl">>> & {
|
|
8
|
+
WrappedComponent: React.ComponentType<{
|
|
9
|
+
fileName: string;
|
|
10
|
+
innerRef: React.Ref<HTMLButtonElement>;
|
|
11
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & WrappedComponentProps<"intl">>;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -24,7 +24,9 @@ export interface CardViewV2Props {
|
|
|
24
24
|
readonly mediaCardCursor?: MediaCardCursor;
|
|
25
25
|
readonly metadata?: FileDetails;
|
|
26
26
|
readonly error?: MediaCardError;
|
|
27
|
-
readonly onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
27
|
+
readonly onClick?: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
28
|
+
readonly openMediaViewerButtonRef?: React.Ref<HTMLButtonElement>;
|
|
29
|
+
readonly shouldOpenMediaViewer?: boolean;
|
|
28
30
|
readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
29
31
|
readonly onDisplayImage?: () => void;
|
|
30
32
|
readonly cardPreview?: MediaFilePreview;
|
|
@@ -52,5 +54,5 @@ export interface RenderConfigByStatusV2 {
|
|
|
52
54
|
renderTickBox?: boolean;
|
|
53
55
|
customTitleMessage?: MessageDescriptor;
|
|
54
56
|
}
|
|
55
|
-
export declare const CardViewV2Base: ({ 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, }: CardViewV2BaseProps) => jsx.JSX.Element;
|
|
57
|
+
export declare const CardViewV2Base: ({ 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, }: CardViewV2BaseProps) => jsx.JSX.Element;
|
|
56
58
|
export declare const CardViewV2: React.ForwardRefExoticComponent<Omit<CardViewV2BaseProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
@@ -9,7 +9,9 @@ export type SharedCardViewProps = {
|
|
|
9
9
|
readonly cardPreview?: MediaFilePreview;
|
|
10
10
|
readonly testId?: string;
|
|
11
11
|
readonly dimensions?: CardDimensions;
|
|
12
|
-
readonly
|
|
12
|
+
readonly openMediaViewerButtonRef?: React.Ref<HTMLButtonElement>;
|
|
13
|
+
readonly shouldOpenMediaViewer?: boolean;
|
|
14
|
+
readonly onClick?: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
13
15
|
readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
14
16
|
readonly appearance?: CardAppearance;
|
|
15
17
|
readonly disableOverlay?: boolean;
|
|
@@ -13,7 +13,7 @@ export interface CardViewsOwnProps extends SharedCardProps {
|
|
|
13
13
|
readonly mediaCardCursor?: MediaCardCursor;
|
|
14
14
|
readonly metadata?: FileDetails;
|
|
15
15
|
readonly error?: MediaCardError;
|
|
16
|
-
readonly onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
16
|
+
readonly onClick?: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
17
17
|
readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
18
18
|
readonly onDisplayImage?: () => void;
|
|
19
19
|
readonly cardPreview?: MediaFilePreview;
|
|
@@ -25,6 +25,8 @@ export interface CardViewsOwnProps extends SharedCardProps {
|
|
|
25
25
|
readonly forceSyncDisplay?: boolean;
|
|
26
26
|
disableAnimation?: boolean;
|
|
27
27
|
shouldHideTooltip?: boolean;
|
|
28
|
+
readonly openMediaViewerButtonRef?: React.Ref<HTMLButtonElement>;
|
|
29
|
+
readonly shouldOpenMediaViewer?: boolean;
|
|
28
30
|
}
|
|
29
31
|
export type CardViewV2Props = CardViewsOwnProps & WithAnalyticsEventsProps;
|
|
30
32
|
export interface RenderConfigByStatusV2 {
|
|
@@ -41,5 +43,5 @@ export interface RenderConfigByStatusV2 {
|
|
|
41
43
|
renderTickBox?: boolean;
|
|
42
44
|
customTitleMessage?: MessageDescriptor;
|
|
43
45
|
}
|
|
44
|
-
export declare const CardViewsBase: ({ innerRef, onImageLoad, onImageError, dimensions, appearance, onClick, onMouseEnter, testId, metadata, status, selected, selectable, cardPreview, mediaCardCursor, shouldHideTooltip, progress, alt, resizeMode, onDisplayImage, nativeLazyLoad, forceSyncDisplay, actions, disableOverlay, titleBoxBgColor, titleBoxIcon, error, disableAnimation, }: CardViewV2Props) => jsx.JSX.Element;
|
|
46
|
+
export declare const CardViewsBase: ({ innerRef, onImageLoad, onImageError, dimensions, appearance, onClick, onMouseEnter, testId, metadata, status, selected, selectable, cardPreview, mediaCardCursor, shouldHideTooltip, progress, alt, resizeMode, onDisplayImage, nativeLazyLoad, forceSyncDisplay, actions, disableOverlay, titleBoxBgColor, titleBoxIcon, error, disableAnimation, shouldOpenMediaViewer, openMediaViewerButtonRef, }: CardViewV2Props) => jsx.JSX.Element;
|
|
45
47
|
export declare const CardViews: React.ForwardRefExoticComponent<Omit<CardViewV2Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
@@ -10,6 +10,7 @@ export type CardBaseProps = CardProps & WithAnalyticsEventsProps & Partial<Wrapp
|
|
|
10
10
|
export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
11
11
|
private internalOccurrenceKey;
|
|
12
12
|
private hasBeenMounted;
|
|
13
|
+
private mediaViewerButtonRef;
|
|
13
14
|
private fileStateFlags;
|
|
14
15
|
private ssrReliability;
|
|
15
16
|
private timeElapsedTillCommenced;
|
|
@@ -49,9 +50,10 @@ export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
|
49
50
|
private safeSetState;
|
|
50
51
|
unsubscribe: () => void;
|
|
51
52
|
get actions(): CardAction[];
|
|
52
|
-
onCardViewClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
53
|
+
onCardViewClick: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
53
54
|
onInlinePlayerError: (e: Error) => void;
|
|
54
55
|
setRef: (cardRef: HTMLDivElement | null) => void;
|
|
56
|
+
setMediaViewerButtonRef: (buttonRef: HTMLButtonElement | null) => void;
|
|
55
57
|
renderInlinePlayer: () => JSX.Element;
|
|
56
58
|
onMediaViewerClose: () => void;
|
|
57
59
|
private onDisplayImage;
|
|
@@ -60,7 +62,7 @@ export declare class CardBase extends Component<CardBaseProps, CardState> {
|
|
|
60
62
|
private storeSSRData;
|
|
61
63
|
render(): JSX.Element;
|
|
62
64
|
private onCardInViewport;
|
|
63
|
-
onClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
65
|
+
onClick: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
64
66
|
onMouseEnter: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
65
67
|
}
|
|
66
68
|
export declare const Card: React.ComponentType<CardBaseProps>;
|
|
@@ -14,12 +14,14 @@ export interface CardViewOwnProps extends SharedCardProps {
|
|
|
14
14
|
readonly mediaCardCursor?: MediaCardCursor;
|
|
15
15
|
readonly metadata?: FileDetails;
|
|
16
16
|
readonly error?: MediaCardError;
|
|
17
|
-
readonly
|
|
17
|
+
readonly shouldOpenMediaViewer: boolean;
|
|
18
|
+
readonly onClick?: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
18
19
|
readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
19
20
|
readonly onDisplayImage?: () => void;
|
|
20
21
|
readonly cardPreview?: CardPreview;
|
|
21
22
|
readonly progress?: number;
|
|
22
23
|
readonly innerRef?: (instance: HTMLDivElement | null) => void;
|
|
24
|
+
readonly openMediaViewerButtonRef?: React.Ref<HTMLButtonElement>;
|
|
23
25
|
readonly onImageLoad: (cardPreview: CardPreview) => void;
|
|
24
26
|
readonly onImageError: (cardPreview: CardPreview) => void;
|
|
25
27
|
readonly nativeLazyLoad?: boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
export declare const visuallyHiddenStyles: import("@emotion/react").SerializedStyles;
|
|
4
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
|
|
5
|
+
fileName: string;
|
|
6
|
+
innerRef: React.Ref<HTMLButtonElement>;
|
|
7
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & WrappedComponentProps<"intl">>> & {
|
|
8
|
+
WrappedComponent: React.ComponentType<{
|
|
9
|
+
fileName: string;
|
|
10
|
+
innerRef: React.Ref<HTMLButtonElement>;
|
|
11
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & WrappedComponentProps<"intl">>;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -24,7 +24,9 @@ export interface CardViewV2Props {
|
|
|
24
24
|
readonly mediaCardCursor?: MediaCardCursor;
|
|
25
25
|
readonly metadata?: FileDetails;
|
|
26
26
|
readonly error?: MediaCardError;
|
|
27
|
-
readonly onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
27
|
+
readonly onClick?: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
28
|
+
readonly openMediaViewerButtonRef?: React.Ref<HTMLButtonElement>;
|
|
29
|
+
readonly shouldOpenMediaViewer?: boolean;
|
|
28
30
|
readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
29
31
|
readonly onDisplayImage?: () => void;
|
|
30
32
|
readonly cardPreview?: MediaFilePreview;
|
|
@@ -52,5 +54,5 @@ export interface RenderConfigByStatusV2 {
|
|
|
52
54
|
renderTickBox?: boolean;
|
|
53
55
|
customTitleMessage?: MessageDescriptor;
|
|
54
56
|
}
|
|
55
|
-
export declare const CardViewV2Base: ({ 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, }: CardViewV2BaseProps) => jsx.JSX.Element;
|
|
57
|
+
export declare const CardViewV2Base: ({ 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, }: CardViewV2BaseProps) => jsx.JSX.Element;
|
|
56
58
|
export declare const CardViewV2: React.ForwardRefExoticComponent<Omit<CardViewV2BaseProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|