@atlaskit/media-card 77.1.1 → 77.1.2

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.
Files changed (142) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/card/card.js +17 -13
  3. package/dist/cjs/card/cardState.js +1 -1
  4. package/dist/cjs/card/getCardPreview/index.js +2 -5
  5. package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
  6. package/dist/cjs/card/v2/cardV2.js +20 -16
  7. package/dist/cjs/inline/loader.js +1 -1
  8. package/dist/cjs/utils/ufoExperiences.js +18 -14
  9. package/dist/es2019/card/card.js +18 -16
  10. package/dist/es2019/card/cardState.js +1 -1
  11. package/dist/es2019/card/getCardPreview/index.js +0 -5
  12. package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
  13. package/dist/es2019/card/v2/cardV2.js +21 -19
  14. package/dist/es2019/inline/loader.js +1 -1
  15. package/dist/es2019/utils/ufoExperiences.js +18 -9
  16. package/dist/esm/card/card.js +18 -14
  17. package/dist/esm/card/cardState.js +1 -1
  18. package/dist/esm/card/getCardPreview/index.js +2 -5
  19. package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
  20. package/dist/esm/card/v2/cardV2.js +21 -17
  21. package/dist/esm/inline/loader.js +1 -1
  22. package/dist/esm/utils/ufoExperiences.js +17 -13
  23. package/dist/types/card/card.d.ts +1 -0
  24. package/dist/types/card/cardState.d.ts +1 -2
  25. package/dist/types/card/getCardPreview/index.d.ts +4 -10
  26. package/dist/types/card/v2/cardV2.d.ts +3 -2
  27. package/dist/types/utils/ufoExperiences.d.ts +7 -0
  28. package/package.json +2 -2
  29. package/dist/types-ts4.5/card/actions.d.ts +0 -9
  30. package/dist/types-ts4.5/card/card.d.ts +0 -63
  31. package/dist/types-ts4.5/card/cardAnalytics.d.ts +0 -10
  32. package/dist/types-ts4.5/card/cardConstants.d.ts +0 -1
  33. package/dist/types-ts4.5/card/cardLoader.d.ts +0 -6
  34. package/dist/types-ts4.5/card/cardState.d.ts +0 -10
  35. package/dist/types-ts4.5/card/cardSwitcher.d.ts +0 -4
  36. package/dist/types-ts4.5/card/cardView.d.ts +0 -78
  37. package/dist/types-ts4.5/card/classnames.d.ts +0 -2
  38. package/dist/types-ts4.5/card/getCardPreview/cache.d.ts +0 -21
  39. package/dist/types-ts4.5/card/getCardPreview/filePreviewStatus.d.ts +0 -4
  40. package/dist/types-ts4.5/card/getCardPreview/helpers.d.ts +0 -10
  41. package/dist/types-ts4.5/card/getCardPreview/index.d.ts +0 -59
  42. package/dist/types-ts4.5/card/getCardStatus.d.ts +0 -4
  43. package/dist/types-ts4.5/card/index.d.ts +0 -1
  44. package/dist/types-ts4.5/card/inlinePlayer.d.ts +0 -52
  45. package/dist/types-ts4.5/card/inlinePlayerLazy.d.ts +0 -2
  46. package/dist/types-ts4.5/card/inlinePlayerWrapper.d.ts +0 -4
  47. package/dist/types-ts4.5/card/inlinePlayerWrapperStyles.d.ts +0 -6
  48. package/dist/types-ts4.5/card/media-card-analytics-error-boundary.d.ts +0 -14
  49. package/dist/types-ts4.5/card/types.d.ts +0 -13
  50. package/dist/types-ts4.5/card/ui/actionsBar/actionsBar.d.ts +0 -5
  51. package/dist/types-ts4.5/card/ui/actionsBar/actionsBarWrapper.d.ts +0 -4
  52. package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionButton.d.ts +0 -3
  53. package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionIconButton.d.ts +0 -12
  54. package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.d.ts +0 -14
  55. package/dist/types-ts4.5/card/ui/actionsBar/cardActions/cardActionsView.d.ts +0 -16
  56. package/dist/types-ts4.5/card/ui/actionsBar/cardActions/index.d.ts +0 -7
  57. package/dist/types-ts4.5/card/ui/actionsBar/cardActions/styles.d.ts +0 -18
  58. package/dist/types-ts4.5/card/ui/actionsBar/styles.d.ts +0 -6
  59. package/dist/types-ts4.5/card/ui/actionsBar/types.d.ts +0 -10
  60. package/dist/types-ts4.5/card/ui/blanket/blanket.d.ts +0 -6
  61. package/dist/types-ts4.5/card/ui/blanket/styles.d.ts +0 -6
  62. package/dist/types-ts4.5/card/ui/common.d.ts +0 -23
  63. package/dist/types-ts4.5/card/ui/iconMessage/iconMessageWrapper.d.ts +0 -4
  64. package/dist/types-ts4.5/card/ui/iconMessage/index.d.ts +0 -8
  65. package/dist/types-ts4.5/card/ui/iconMessage/styles.d.ts +0 -5
  66. package/dist/types-ts4.5/card/ui/iconMessage/types.d.ts +0 -19
  67. package/dist/types-ts4.5/card/ui/iconWrapper/iconWrapper.d.ts +0 -4
  68. package/dist/types-ts4.5/card/ui/iconWrapper/styles.d.ts +0 -7
  69. package/dist/types-ts4.5/card/ui/iconWrapper/types.d.ts +0 -6
  70. package/dist/types-ts4.5/card/ui/imageRenderer/imageRenderer.d.ts +0 -15
  71. package/dist/types-ts4.5/card/ui/imageRenderer/resizeModeToMediaImageProps.d.ts +0 -5
  72. package/dist/types-ts4.5/card/ui/playButton/playButton.d.ts +0 -2
  73. package/dist/types-ts4.5/card/ui/playButton/playButtonBackground.d.ts +0 -3
  74. package/dist/types-ts4.5/card/ui/playButton/playButtonWrapper.d.ts +0 -3
  75. package/dist/types-ts4.5/card/ui/playButton/styles.d.ts +0 -5
  76. package/dist/types-ts4.5/card/ui/progressBar/progressBar.d.ts +0 -10
  77. package/dist/types-ts4.5/card/ui/progressBar/styledBar.d.ts +0 -4
  78. package/dist/types-ts4.5/card/ui/progressBar/styles.d.ts +0 -7
  79. package/dist/types-ts4.5/card/ui/progressBar/types.d.ts +0 -7
  80. package/dist/types-ts4.5/card/ui/styles.d.ts +0 -13
  81. package/dist/types-ts4.5/card/ui/tickBox/styles.d.ts +0 -7
  82. package/dist/types-ts4.5/card/ui/tickBox/tickBox.d.ts +0 -3
  83. package/dist/types-ts4.5/card/ui/tickBox/tickBoxWrapper.d.ts +0 -4
  84. package/dist/types-ts4.5/card/ui/tickBox/types.d.ts +0 -4
  85. package/dist/types-ts4.5/card/ui/titleBox/failedTitleBox.d.ts +0 -3
  86. package/dist/types-ts4.5/card/ui/titleBox/styles.d.ts +0 -15
  87. package/dist/types-ts4.5/card/ui/titleBox/titleBox.d.ts +0 -4
  88. package/dist/types-ts4.5/card/ui/titleBox/titleBoxComponents.d.ts +0 -8
  89. package/dist/types-ts4.5/card/ui/titleBox/types.d.ts +0 -34
  90. package/dist/types-ts4.5/card/ui/unhandledErrorCard/index.d.ts +0 -7
  91. package/dist/types-ts4.5/card/ui/unhandledErrorCard/types.d.ts +0 -6
  92. package/dist/types-ts4.5/card/ui/wrapper/index.d.ts +0 -1
  93. package/dist/types-ts4.5/card/ui/wrapper/styles.d.ts +0 -5
  94. package/dist/types-ts4.5/card/ui/wrapper/types.d.ts +0 -25
  95. package/dist/types-ts4.5/card/ui/wrapper/wrapper.d.ts +0 -4
  96. package/dist/types-ts4.5/card/v2/cardV2.d.ts +0 -62
  97. package/dist/types-ts4.5/card/v2/cardV2Loader.d.ts +0 -4
  98. package/dist/types-ts4.5/card/v2/cardViewV2.d.ts +0 -44
  99. package/dist/types-ts4.5/classnames.d.ts +0 -5
  100. package/dist/types-ts4.5/errors.d.ts +0 -53
  101. package/dist/types-ts4.5/index.d.ts +0 -15
  102. package/dist/types-ts4.5/inline/index.d.ts +0 -1
  103. package/dist/types-ts4.5/inline/loader.d.ts +0 -26
  104. package/dist/types-ts4.5/inline/mediaInlineAnalyticsErrorBoundary.d.ts +0 -12
  105. package/dist/types-ts4.5/inline/mediaInlineCard.d.ts +0 -15
  106. package/dist/types-ts4.5/inline/mediaInlineCardAnalytics.d.ts +0 -6
  107. package/dist/types-ts4.5/types.d.ts +0 -105
  108. package/dist/types-ts4.5/utils/analytics.d.ts +0 -101
  109. package/dist/types-ts4.5/utils/cardDimensions.d.ts +0 -14
  110. package/dist/types-ts4.5/utils/containsPixelUnit.d.ts +0 -1
  111. package/dist/types-ts4.5/utils/dimensionComparer.d.ts +0 -3
  112. package/dist/types-ts4.5/utils/document.d.ts +0 -2
  113. package/dist/types-ts4.5/utils/generateUniqueId.d.ts +0 -1
  114. package/dist/types-ts4.5/utils/getCSSUnitValue.d.ts +0 -1
  115. package/dist/types-ts4.5/utils/getDataURIDimension.d.ts +0 -9
  116. package/dist/types-ts4.5/utils/getElementDimension.d.ts +0 -2
  117. package/dist/types-ts4.5/utils/getMediaCardCursor.d.ts +0 -6
  118. package/dist/types-ts4.5/utils/globalScope/getSSRData.d.ts +0 -3
  119. package/dist/types-ts4.5/utils/globalScope/globalScope.d.ts +0 -21
  120. package/dist/types-ts4.5/utils/globalScope/index.d.ts +0 -4
  121. package/dist/types-ts4.5/utils/globalScope/types.d.ts +0 -8
  122. package/dist/types-ts4.5/utils/index.d.ts +0 -6
  123. package/dist/types-ts4.5/utils/isRetina.d.ts +0 -1
  124. package/dist/types-ts4.5/utils/isValidPercentageUnit.d.ts +0 -1
  125. package/dist/types-ts4.5/utils/lightCards/cardError.d.ts +0 -12
  126. package/dist/types-ts4.5/utils/lightCards/cardLoading.d.ts +0 -5
  127. package/dist/types-ts4.5/utils/lightCards/errorIcon/index.d.ts +0 -12
  128. package/dist/types-ts4.5/utils/lightCards/errorIcon/styles.d.ts +0 -1
  129. package/dist/types-ts4.5/utils/lightCards/getDimensionsWithDefault.d.ts +0 -2
  130. package/dist/types-ts4.5/utils/lightCards/lightCardWrappers.d.ts +0 -4
  131. package/dist/types-ts4.5/utils/lightCards/styles.d.ts +0 -2
  132. package/dist/types-ts4.5/utils/lightCards/types.d.ts +0 -15
  133. package/dist/types-ts4.5/utils/metadata.d.ts +0 -2
  134. package/dist/types-ts4.5/utils/mockIntersectionObserver.d.ts +0 -20
  135. package/dist/types-ts4.5/utils/objectURLCache.d.ts +0 -12
  136. package/dist/types-ts4.5/utils/preventClickThrough.d.ts +0 -8
  137. package/dist/types-ts4.5/utils/printScript.d.ts +0 -2
  138. package/dist/types-ts4.5/utils/ufoExperiences.d.ts +0 -7
  139. package/dist/types-ts4.5/utils/videoIsPlayable.d.ts +0 -2
  140. package/dist/types-ts4.5/utils/videoSnapshot.d.ts +0 -1
  141. package/dist/types-ts4.5/utils/viewportDetector.d.ts +0 -6
  142. package/tmp/api-report-tmp.d.ts +0 -345
@@ -1,9 +0,0 @@
1
- import { CardDimensions } from '../types';
2
- import { ElementDimension } from './getElementDimension';
3
- import { NumericalCardDimensions } from '@atlaskit/media-common';
4
- export type getDataURIDimensionOptions = {
5
- element?: Element | null;
6
- dimensions?: CardDimensions;
7
- };
8
- export declare const getDataURIDimension: (dimension: ElementDimension, options: getDataURIDimensionOptions) => number;
9
- export declare const getRequestedDimensions: (options: getDataURIDimensionOptions) => NumericalCardDimensions;
@@ -1,2 +0,0 @@
1
- export type ElementDimension = 'height' | 'width';
2
- export declare const getElementDimension: (element: Element, dimension: ElementDimension) => number;
@@ -1,6 +0,0 @@
1
- import { MediaCardCursor } from '../types';
2
- import { MediaType } from '@atlaskit/media-client';
3
- /**
4
- * When the returned value is undefined, we'd expect the media card to take the parent's cursor style.
5
- */
6
- export declare const getMediaCardCursor: (useInlinePlayer: boolean, useMediaViewer: boolean, isErrorStatus: boolean, hasCardPreview: boolean, mediaType?: MediaType) => MediaCardCursor | undefined;
@@ -1,3 +0,0 @@
1
- import type { MediaCardSsrData } from './types';
2
- import { FileIdentifier } from '@atlaskit/media-client';
3
- export declare const getSSRData: (identifier: FileIdentifier) => MediaCardSsrData | undefined;
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { FileIdentifier } from '@atlaskit/media-client';
3
- import { NumericalCardDimensions } from '@atlaskit/media-common';
4
- import { MediaCardErrorInfo } from '../../utils/analytics';
5
- import { MediaCardSsr } from './types';
6
- export declare const GLOBAL_MEDIA_CARD_SSR = "mediaCardSsr";
7
- export declare const GLOBAL_MEDIA_NAMESPACE = "__MEDIA_INTERNAL";
8
- export type MediaGlobalScope = {
9
- [GLOBAL_MEDIA_CARD_SSR]?: MediaCardSsr;
10
- };
11
- export declare function getMediaGlobalScope(globalScope?: any): MediaGlobalScope;
12
- export declare function getMediaCardSSR(globalScope?: any): MediaCardSsr;
13
- export declare const getKey: ({ id, collectionName, occurrenceKey }: FileIdentifier) => string;
14
- export declare const storeDataURI: (key: string, dataURI?: string, dimensions?: NumericalCardDimensions, error?: MediaCardErrorInfo, globalScope?: any) => void;
15
- export type StoreSSRDataScriptProps = {
16
- identifier: FileIdentifier;
17
- dataURI?: string;
18
- dimensions?: NumericalCardDimensions;
19
- error?: MediaCardErrorInfo;
20
- };
21
- export declare const StoreSSRDataScript: React.FC<StoreSSRDataScriptProps>;
@@ -1,4 +0,0 @@
1
- export { StoreSSRDataScript, GLOBAL_MEDIA_NAMESPACE, GLOBAL_MEDIA_CARD_SSR, getKey, } from './globalScope';
2
- export { getSSRData } from './getSSRData';
3
- export type { MediaCardSsrData, MediaCardSsr } from './types';
4
- export type { MediaGlobalScope } from './globalScope';
@@ -1,8 +0,0 @@
1
- import { NumericalCardDimensions } from '@atlaskit/media-common';
2
- import { MediaCardErrorInfo } from '../../utils/analytics';
3
- export type MediaCardSsrData = {
4
- dataURI?: string;
5
- dimensions?: NumericalCardDimensions;
6
- error?: MediaCardErrorInfo;
7
- };
8
- export type MediaCardSsr = Record<string, MediaCardSsrData>;
@@ -1,6 +0,0 @@
1
- export { isRetina } from './isRetina';
2
- export { defaultHorizontalCardDimensions, defaultImageCardDimensions, defaultSquareCardDimensions, getDefaultCardDimensions, } from './cardDimensions';
3
- export { isValidPercentageUnit } from './isValidPercentageUnit';
4
- export { getElementDimension } from './getElementDimension';
5
- export type { ElementDimension } from './getElementDimension';
6
- export { containsPixelUnit } from './containsPixelUnit';
@@ -1 +0,0 @@
1
- export declare function isRetina(): boolean;
@@ -1 +0,0 @@
1
- export declare const isValidPercentageUnit: (value: string | number) => boolean;
@@ -1,12 +0,0 @@
1
- import { Component } from 'react';
2
- import { StaticCardProps } from './types';
3
- export interface ErrorCardProps extends StaticCardProps {
4
- readonly size: 'small' | 'medium' | 'large' | 'xlarge';
5
- }
6
- export declare class CardError extends Component<ErrorCardProps, {}> {
7
- static defaultProps: {
8
- size: string;
9
- };
10
- render(): JSX.Element;
11
- get icon(): JSX.Element;
12
- }
@@ -1,5 +0,0 @@
1
- import { Component } from 'react';
2
- import { StaticCardProps } from './types';
3
- export declare class CardLoading extends Component<StaticCardProps, {}> {
4
- render(): JSX.Element;
5
- }
@@ -1,12 +0,0 @@
1
- /**@jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { Component } from 'react';
4
- export interface ErrorIconProps {
5
- readonly size: 'small' | 'medium' | 'large' | 'xlarge';
6
- }
7
- export declare class ErrorIcon extends Component<ErrorIconProps, {}> {
8
- static defaultProps: {
9
- size: string;
10
- };
11
- render(): jsx.JSX.Element;
12
- }
@@ -1 +0,0 @@
1
- export declare const errorIconWrapperStyles: import("@emotion/react").SerializedStyles;
@@ -1,2 +0,0 @@
1
- import { CardDimensions } from '../../types';
2
- export declare const getDimensionsWithDefault: (dimensions?: CardDimensions) => CardDimensions;
@@ -1,4 +0,0 @@
1
- /**@jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { WrapperProps } from './types';
4
- export declare const Wrapper: (props: WrapperProps) => jsx.JSX.Element;
@@ -1,2 +0,0 @@
1
- import { WrapperProps } from './types';
2
- export declare const wrapperStyles: ({ dimensions, theme }: WrapperProps) => import("@emotion/react").SerializedStyles;
@@ -1,15 +0,0 @@
1
- /// <reference types="react" />
2
- import { CardDimensions } from '../../types';
3
- import { MediaFeatureFlags } from '@atlaskit/media-common';
4
- import { GlobalThemeTokens } from '@atlaskit/theme/components';
5
- export interface StaticCardProps {
6
- dimensions?: CardDimensions;
7
- testId?: string;
8
- featureFlags?: MediaFeatureFlags;
9
- }
10
- export interface WrapperProps {
11
- dimensions: CardDimensions;
12
- testId?: string;
13
- children?: JSX.Element;
14
- theme?: GlobalThemeTokens;
15
- }
@@ -1,2 +0,0 @@
1
- import { FileState, FileDetails, Identifier } from '@atlaskit/media-client';
2
- export declare const getFileDetails: (identifier: Identifier, fileState?: FileState) => FileDetails;
@@ -1,20 +0,0 @@
1
- type NestedPartial<T> = {
2
- [K in keyof T]?: Partial<T[K]>;
3
- };
4
- type SetupOptions = {
5
- observe?: () => void;
6
- disconnect?: () => void;
7
- };
8
- export declare class MockIntersectionObserver {
9
- private callback;
10
- private originalObserver?;
11
- private mockObserver?;
12
- private mockObserverInstance?;
13
- private storeMockObserver;
14
- private addMockObserverToWindow;
15
- private removeMockObserverFromWindow;
16
- setup(options?: SetupOptions): void;
17
- cleanup(): void;
18
- triggerIntersect(entry: NestedPartial<IntersectionObserverEntry>): void;
19
- }
20
- export {};
@@ -1,12 +0,0 @@
1
- import { CardPreview } from '../types';
2
- export declare const PREVIEW_CACHE_LRU_SIZE = 50;
3
- export declare class ObjectURLCache {
4
- private readonly cache;
5
- constructor(size: number);
6
- has(key: string): boolean;
7
- get(key: string): CardPreview | undefined;
8
- set(key: string, value: CardPreview): void;
9
- remove(key: string): void;
10
- clear(): void;
11
- }
12
- export declare const createObjectURLCache: () => ObjectURLCache;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { ReactNode } from 'react';
3
- export type PreventClickThroughProps = {
4
- readonly children?: ReactNode;
5
- };
6
- export declare function PreventClickThrough({ children, }: PreventClickThroughProps): JSX.Element;
7
- export type CreatePreventClickThrough = <T>(onClick: () => void) => (event: React.MouseEvent<T, MouseEvent>) => void;
8
- export declare const createPreventClickThrough: CreatePreventClickThrough;
@@ -1,2 +0,0 @@
1
- export declare const printFunctionCall: <T extends any[]>(fn: (...args: T) => void, ...args: T) => string;
2
- export declare const printScript: (statements: string[]) => string;
@@ -1,7 +0,0 @@
1
- import { CardStatus } from '../types';
2
- import { FileAttributes } from '@atlaskit/media-common';
3
- import { SSRStatus } from './analytics';
4
- import { MediaCardError } from '../errors';
5
- import { FileStateFlags } from '../types';
6
- export declare const startUfoExperience: (id: string) => void;
7
- export declare const completeUfoExperience: (id: string, status: CardStatus, fileAttributes: FileAttributes, fileStateFlags: FileStateFlags, ssrReliability: SSRStatus, error?: MediaCardError) => void;
@@ -1,2 +0,0 @@
1
- import { FileState } from '@atlaskit/media-client';
2
- export declare const videoIsPlayable: (isBannedLocalPreview: boolean, fileState?: FileState, mimeType?: string) => boolean;
@@ -1 +0,0 @@
1
- export declare const takeSnapshot: (blob: Blob) => Promise<string>;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export type ViewportDetectorProps = {
3
- cardEl: HTMLElement | null;
4
- onVisible: () => void;
5
- };
6
- export declare const ViewportDetector: React.FC<ViewportDetectorProps>;
@@ -1,345 +0,0 @@
1
- ## API Report File for "@atlaskit/media-card"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- /// <reference types="react" />
8
-
9
- import { Component } from 'react';
10
- import { FileDetails } from '@atlaskit/media-client';
11
- import { FileIdentifier } from '@atlaskit/media-client';
12
- import { FileItem } from '@atlaskit/media-client';
13
- import { FileState } from '@atlaskit/media-client';
14
- import { Identifier } from '@atlaskit/media-client';
15
- import { ImageResizeMode } from '@atlaskit/media-client';
16
- import { MediaClient } from '@atlaskit/media-client';
17
- import { MediaFeatureFlags } from '@atlaskit/media-common';
18
- import { MouseEvent as MouseEvent_2 } from 'react';
19
- import { NumericalCardDimensions } from '@atlaskit/media-common';
20
- import { default as React_2 } from 'react';
21
- import { ReactNode } from 'react';
22
- import { SSR } from '@atlaskit/media-common';
23
- import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
24
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
25
- import { WithMediaClientConfigProps } from '@atlaskit/media-client';
26
- import { WrappedComponentProps } from 'react-intl-next';
27
-
28
- // @public (undocumented)
29
- export function Card(props: CardWithMediaClientConfigProps): JSX.Element;
30
-
31
- // @public (undocumented)
32
- export interface CardAction {
33
- // (undocumented)
34
- handler: CardEventHandler;
35
- // (undocumented)
36
- icon?: ReactNode;
37
- // (undocumented)
38
- label?: string;
39
- }
40
-
41
- // @public (undocumented)
42
- export type CardAppearance = 'auto' | 'horizontal' | 'image' | 'square';
43
-
44
- // @public (undocumented)
45
- type CardBaseProps = CardProps & WithAnalyticsEventsProps & Partial<WrappedComponentProps>;
46
-
47
- // @public (undocumented)
48
- export interface CardDimensions {
49
- // (undocumented)
50
- height?: CardDimensionValue;
51
- // (undocumented)
52
- width?: CardDimensionValue;
53
- }
54
-
55
- // @public (undocumented)
56
- export type CardDimensionValue = number | string;
57
-
58
- // @public (undocumented)
59
- export class CardError extends Component<ErrorCardProps, {}> {
60
- // (undocumented)
61
- static defaultProps: {
62
- size: string;
63
- };
64
- // (undocumented)
65
- get icon(): JSX.Element;
66
- // (undocumented)
67
- render(): JSX.Element;
68
- }
69
-
70
- // @public (undocumented)
71
- export interface CardEvent {
72
- // (undocumented)
73
- event: MouseEvent_2<HTMLElement>;
74
- // (undocumented)
75
- mediaItemDetails?: FileDetails;
76
- }
77
-
78
- // @public (undocumented)
79
- export type CardEventHandler = (item?: FileItem, event?: Event) => void;
80
-
81
- // @public (undocumented)
82
- interface CardEventProps {
83
- // (undocumented)
84
- readonly onClick?: CardOnClickCallback;
85
- readonly onFullscreenChange?: (fullscreen: boolean) => void;
86
- // (undocumented)
87
- readonly onMouseEnter?: (result: CardEvent) => void;
88
- }
89
-
90
- // @public (undocumented)
91
- export class CardLoading extends Component<StaticCardProps, {}> {
92
- // (undocumented)
93
- render(): JSX.Element;
94
- }
95
-
96
- // @public (undocumented)
97
- export interface CardOnClickCallback {
98
- // (undocumented)
99
- (result: CardEvent, analyticsEvent?: UIAnalyticsEvent): void;
100
- }
101
-
102
- // @public (undocumented)
103
- export interface CardPreview {
104
- // (undocumented)
105
- dataURI: string;
106
- // (undocumented)
107
- dimensions?: CardDimensions;
108
- // (undocumented)
109
- orientation?: number;
110
- // (undocumented)
111
- source: CardPreviewSource;
112
- }
113
-
114
- // @public (undocumented)
115
- type CardPreviewSource = 'cache-local' | 'cache-remote' | 'cache-ssr-client' | 'cache-ssr-server' | 'external' | 'local' | 'remote' | 'ssr-client' | 'ssr-data' | 'ssr-server';
116
-
117
- // @public (undocumented)
118
- export interface CardProps extends SharedCardProps, CardEventProps {
119
- // (undocumented)
120
- readonly contextId?: string;
121
- // (undocumented)
122
- readonly identifier: Identifier;
123
- // (undocumented)
124
- readonly isLazy?: boolean;
125
- // (undocumented)
126
- readonly mediaClient: MediaClient;
127
- // (undocumented)
128
- readonly mediaViewerItems?: Identifier[];
129
- // (undocumented)
130
- readonly shouldEnableDownloadButton?: boolean;
131
- // (undocumented)
132
- readonly shouldHideTooltip?: boolean;
133
- // (undocumented)
134
- readonly shouldOpenMediaViewer?: boolean;
135
- // (undocumented)
136
- readonly ssr?: SSR;
137
- // (undocumented)
138
- readonly useInlinePlayer?: boolean;
139
- }
140
-
141
- // @public (undocumented)
142
- export interface CardState {
143
- // (undocumented)
144
- cardPreview?: CardPreview;
145
- // (undocumented)
146
- cardRef: HTMLDivElement | null;
147
- // (undocumented)
148
- error?: MediaCardError;
149
- // (undocumented)
150
- fileState?: FileState;
151
- // (undocumented)
152
- isBannedLocalPreview: boolean;
153
- // (undocumented)
154
- isCardVisible: boolean;
155
- // (undocumented)
156
- isPlayingFile: boolean;
157
- // (undocumented)
158
- mediaViewerSelectedItem?: Identifier;
159
- // (undocumented)
160
- previewDidRender: boolean;
161
- // (undocumented)
162
- progress?: number;
163
- // (undocumented)
164
- shouldAutoplay?: boolean;
165
- // (undocumented)
166
- shouldUpdateStateForIdentifier?: boolean;
167
- // (undocumented)
168
- status: CardStatus;
169
- // (undocumented)
170
- wasResolvedUpfrontPreview: boolean;
171
- }
172
-
173
- // @public (undocumented)
174
- export type CardStatus = 'complete' | 'error' | 'failed-processing' | 'loading' | 'loading-preview' | 'processing' | 'uploading';
175
-
176
- // @public (undocumented)
177
- type CardWithMediaClientConfigProps = WithMediaClientConfigProps<CardBaseProps>;
178
-
179
- // @public (undocumented)
180
- export const defaultImageCardDimensions: {
181
- width: number;
182
- height: number;
183
- };
184
-
185
- // @public (undocumented)
186
- type ErrorBoundaryComponent = React_2.ComponentType<{
187
- data?: {
188
- [k: string]: any;
189
- };
190
- isSelected?: boolean;
191
- }>;
192
-
193
- // @public (undocumented)
194
- interface ErrorCardProps extends StaticCardProps {
195
- // (undocumented)
196
- readonly size: 'large' | 'medium' | 'small' | 'xlarge';
197
- }
198
-
199
- // @public (undocumented)
200
- export const fileCardImageViewSelector = "media-file-card-view";
201
-
202
- // @public (undocumented)
203
- type ImageLoadPrimaryReason = 'cache-local-uri' | 'cache-remote-uri' | 'external-uri' | 'local-uri' | 'remote-uri' | 'unknown-uri';
204
-
205
- // @public (undocumented)
206
- export interface InlineCardEvent {
207
- // (undocumented)
208
- event: MouseEvent_2<HTMLElement> | React.KeyboardEvent;
209
- // (undocumented)
210
- mediaItemDetails?: FileDetails;
211
- }
212
-
213
- // @public (undocumented)
214
- export interface InlineCardOnClickCallback {
215
- // (undocumented)
216
- (result: InlineCardEvent, analyticsEvent?: UIAnalyticsEvent): void;
217
- }
218
-
219
- // @public (undocumented)
220
- export const inlinePlayerClassName = "media-card-inline-player";
221
-
222
- // @public (undocumented)
223
- type LocalPreviewPrimaryReason = 'local-preview-get' | 'local-preview-image' | 'local-preview-rejected' | 'local-preview-unsupported' | 'local-preview-video';
224
-
225
- // @public (undocumented)
226
- class MediaCardError extends Error {
227
- constructor(primaryReason: MediaCardErrorPrimaryReason, secondaryError?: Error | undefined);
228
- // (undocumented)
229
- readonly primaryReason: MediaCardErrorPrimaryReason;
230
- // (undocumented)
231
- readonly secondaryError?: Error | undefined;
232
- }
233
-
234
- // @public
235
- type MediaCardErrorPrimaryReason = 'error-file-state' | 'metadata-fetch' | 'missing-error-data' | 'preview-fetch' | 'upload' | ImageLoadPrimaryReason | LocalPreviewPrimaryReason | RemotePreviewPrimaryReason | SsrPreviewPrimaryReason;
236
-
237
- // @public (undocumented)
238
- export class MediaInlineCard extends React_2.PureComponent<MediaInlineCardWithMediaClientConfigProps & MediaInlineCardLoaderState, MediaInlineCardLoaderState> {
239
- // (undocumented)
240
- componentDidMount(): Promise<void>;
241
- // (undocumented)
242
- componentWillUnmount(): Promise<void>;
243
- // (undocumented)
244
- static displayName: string;
245
- // (undocumented)
246
- static ErrorBoundary?: ErrorBoundaryComponent;
247
- // (undocumented)
248
- static MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
249
- // (undocumented)
250
- mounted: boolean;
251
- // (undocumented)
252
- render(): JSX.Element;
253
- // (undocumented)
254
- state: MediaInlineCardLoaderState;
255
- }
256
-
257
- // @public (undocumented)
258
- interface MediaInlineCardLoaderState {
259
- // (undocumented)
260
- ErrorBoundary?: ErrorBoundaryComponent;
261
- // (undocumented)
262
- MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
263
- }
264
-
265
- // @public (undocumented)
266
- interface MediaInlineCardProps {
267
- // (undocumented)
268
- identifier: FileIdentifier;
269
- // (undocumented)
270
- isSelected?: boolean;
271
- // (undocumented)
272
- mediaClient: MediaClient;
273
- // (undocumented)
274
- mediaViewerItems?: Identifier[];
275
- // (undocumented)
276
- onClick?: InlineCardOnClickCallback;
277
- // (undocumented)
278
- shouldDisplayToolTip?: boolean;
279
- // (undocumented)
280
- shouldOpenMediaViewer?: boolean;
281
- }
282
-
283
- // @public (undocumented)
284
- type MediaInlineCardWithMediaClientConfigComponent = React_2.ComponentType<MediaInlineCardWithMediaClientConfigProps>;
285
-
286
- // @public (undocumented)
287
- type MediaInlineCardWithMediaClientConfigProps = WithMediaClientConfigProps<MediaInlineCardProps>;
288
-
289
- // @public (undocumented)
290
- export const newFileExperienceClassName = "new-file-experience-wrapper";
291
-
292
- export { NumericalCardDimensions }
293
-
294
- // @public (undocumented)
295
- type RemotePreviewPrimaryReason = 'remote-preview-fetch' | 'remote-preview-fetch-ssr' | 'remote-preview-not-ready';
296
-
297
- // @public (undocumented)
298
- export interface SharedCardProps {
299
- // (undocumented)
300
- readonly actions?: Array<CardAction>;
301
- // (undocumented)
302
- readonly alt?: string;
303
- // (undocumented)
304
- readonly appearance?: CardAppearance;
305
- // (undocumented)
306
- readonly dimensions?: CardDimensions;
307
- // (undocumented)
308
- readonly disableOverlay?: boolean;
309
- // (undocumented)
310
- readonly featureFlags?: MediaFeatureFlags;
311
- // (undocumented)
312
- readonly originalDimensions?: NumericalCardDimensions;
313
- // (undocumented)
314
- readonly resizeMode?: ImageResizeMode;
315
- // (undocumented)
316
- readonly selectable?: boolean;
317
- // (undocumented)
318
- readonly selected?: boolean;
319
- // (undocumented)
320
- readonly testId?: string;
321
- // (undocumented)
322
- readonly titleBoxBgColor?: string;
323
- // (undocumented)
324
- readonly titleBoxIcon?: TitleBoxIcon;
325
- }
326
-
327
- // @public (undocumented)
328
- type SsrPreviewPrimaryReason = 'ssr-client-load' | 'ssr-client-uri' | 'ssr-server-load' | 'ssr-server-uri';
329
-
330
- // @public (undocumented)
331
- interface StaticCardProps {
332
- // (undocumented)
333
- dimensions?: CardDimensions;
334
- // (undocumented)
335
- featureFlags?: MediaFeatureFlags;
336
- // (undocumented)
337
- testId?: string;
338
- }
339
-
340
- // @public (undocumented)
341
- export type TitleBoxIcon = 'LockFilledIcon';
342
-
343
- // (No @packageDocumentation comment for this package)
344
-
345
- ```