@atlaskit/media-card 77.7.7 → 77.9.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 +16 -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/index.js +19 -0
- package/dist/cjs/inline/index.js +14 -1
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/inline/mediaInlineCardAnalytics.js +13 -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/index.js +2 -1
- package/dist/es2019/inline/index.js +2 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/inline/mediaInlineCardAnalytics.js +10 -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/index.js +2 -1
- package/dist/esm/inline/index.js +2 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/inline/mediaInlineCardAnalytics.js +13 -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/index.d.ts +2 -1
- package/dist/types/inline/index.d.ts +1 -0
- package/dist/types/inline/mediaInlineCardAnalytics.d.ts +3 -0
- 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/dist/types-ts4.5/index.d.ts +2 -1
- package/dist/types-ts4.5/inline/index.d.ts +1 -0
- package/dist/types-ts4.5/inline/mediaInlineCardAnalytics.d.ts +3 -0
- package/example-helpers/styles.ts +0 -2
- package/package.json +4 -4
|
@@ -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>>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export type { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
|
6
6
|
export type { CardAction, CardEventHandler } from './card/actions';
|
|
7
7
|
export type { CardStatus, CardAppearance, CardDimensionValue, CardPreview, TitleBoxIcon, CardEvent, InlineCardEvent, SharedCardProps, CardOnClickCallback, InlineCardOnClickCallback, CardProps, CardState, CardDimensions, } from './types';
|
|
8
8
|
export { Card } from './card';
|
|
9
|
-
export { MediaInlineCard } from './inline';
|
|
9
|
+
export { MediaInlineCard, fireFailedMediaInlineEvent, fireSucceededMediaInlineEvent, } from './inline';
|
|
10
|
+
export { MediaCardError } from './errors';
|
|
10
11
|
export { CardLoading } from './utils/lightCards/cardLoading';
|
|
11
12
|
export { CardError } from './utils/lightCards/cardError';
|
|
12
13
|
export { defaultImageCardDimensions } from './utils/cardDimensions';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { FileState } from '@atlaskit/media-client';
|
|
2
2
|
import { RenderInlineCardFailedEventPayload, RenderInlineCardSucceededEventPayload } from '../utils/analytics';
|
|
3
3
|
import { MediaCardError } from '../errors';
|
|
4
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
5
|
export declare const getSucceededStatusPayload: (fileState?: FileState) => RenderInlineCardSucceededEventPayload;
|
|
5
6
|
export declare const getErrorStatusPayload: (error: MediaCardError, fileState?: FileState) => RenderInlineCardFailedEventPayload;
|
|
6
7
|
export declare const getFailedProcessingStatusPayload: (fileState?: FileState) => RenderInlineCardFailedEventPayload;
|
|
8
|
+
export declare const fireFailedOperationalEvent: (fileState: FileState, error?: MediaCardError, failReason?: 'failed-processing', createAnalyticsEvent?: CreateUIAnalyticsEvent) => void;
|
|
9
|
+
export declare const fireSucceededOperationalEvent: (fileState: FileState, createAnalyticsEvent?: CreateUIAnalyticsEvent) => void;
|
|
@@ -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>>;
|
|
@@ -6,7 +6,8 @@ export type { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
|
6
6
|
export type { CardAction, CardEventHandler } from './card/actions';
|
|
7
7
|
export type { CardStatus, CardAppearance, CardDimensionValue, CardPreview, TitleBoxIcon, CardEvent, InlineCardEvent, SharedCardProps, CardOnClickCallback, InlineCardOnClickCallback, CardProps, CardState, CardDimensions, } from './types';
|
|
8
8
|
export { Card } from './card';
|
|
9
|
-
export { MediaInlineCard } from './inline';
|
|
9
|
+
export { MediaInlineCard, fireFailedMediaInlineEvent, fireSucceededMediaInlineEvent, } from './inline';
|
|
10
|
+
export { MediaCardError } from './errors';
|
|
10
11
|
export { CardLoading } from './utils/lightCards/cardLoading';
|
|
11
12
|
export { CardError } from './utils/lightCards/cardError';
|
|
12
13
|
export { defaultImageCardDimensions } from './utils/cardDimensions';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { FileState } from '@atlaskit/media-client';
|
|
2
2
|
import { RenderInlineCardFailedEventPayload, RenderInlineCardSucceededEventPayload } from '../utils/analytics';
|
|
3
3
|
import { MediaCardError } from '../errors';
|
|
4
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
5
|
export declare const getSucceededStatusPayload: (fileState?: FileState) => RenderInlineCardSucceededEventPayload;
|
|
5
6
|
export declare const getErrorStatusPayload: (error: MediaCardError, fileState?: FileState) => RenderInlineCardFailedEventPayload;
|
|
6
7
|
export declare const getFailedProcessingStatusPayload: (fileState?: FileState) => RenderInlineCardFailedEventPayload;
|
|
8
|
+
export declare const fireFailedOperationalEvent: (fileState: FileState, error?: MediaCardError, failReason?: 'failed-processing', createAnalyticsEvent?: CreateUIAnalyticsEvent) => void;
|
|
9
|
+
export declare const fireSucceededOperationalEvent: (fileState: FileState, createAnalyticsEvent?: CreateUIAnalyticsEvent) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "77.
|
|
3
|
+
"version": "77.9.0",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
40
|
-
"@atlaskit/dropdown-menu": "^12.
|
|
40
|
+
"@atlaskit/dropdown-menu": "^12.5.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
42
42
|
"@atlaskit/icon": "^22.0.0",
|
|
43
43
|
"@atlaskit/media-client": "^26.1.0",
|
|
44
44
|
"@atlaskit/media-client-react": "^2.0.0",
|
|
45
45
|
"@atlaskit/media-common": "^11.0.0",
|
|
46
46
|
"@atlaskit/media-file-preview": "^0.4.0",
|
|
47
|
-
"@atlaskit/media-ui": "^25.
|
|
47
|
+
"@atlaskit/media-ui": "^25.1.0",
|
|
48
48
|
"@atlaskit/media-viewer": "^48.2.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.2",
|
|
50
50
|
"@atlaskit/spinner": "^16.0.0",
|
|
51
51
|
"@atlaskit/theme": "^12.6.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
+
"@atlaskit/tokens": "^1.36.0",
|
|
53
53
|
"@atlaskit/tooltip": "^18.1.0",
|
|
54
54
|
"@atlaskit/ufo": "^0.2.0",
|
|
55
55
|
"@babel/runtime": "^7.0.0",
|