@atlaskit/media-card 77.6.2 → 77.6.4
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 +12 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/fileCard.js +8 -8
- package/dist/cjs/card/v2/useFilePreview/getPreview/getPreview.js +2 -2
- package/dist/cjs/card/v2/useFilePreview/getPreview/index.js +2 -2
- package/dist/cjs/card/v2/useFilePreview/useFilePreview.js +234 -235
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/inline/mediaInlineCard.js +7 -7
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/card/v2/fileCard.js +8 -8
- package/dist/es2019/card/v2/useFilePreview/getPreview/getPreview.js +1 -1
- package/dist/es2019/card/v2/useFilePreview/getPreview/index.js +1 -1
- package/dist/es2019/card/v2/useFilePreview/useFilePreview.js +194 -197
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/inline/mediaInlineCard.js +8 -8
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/card/v2/fileCard.js +8 -8
- package/dist/esm/card/v2/useFilePreview/getPreview/getPreview.js +1 -1
- package/dist/esm/card/v2/useFilePreview/getPreview/index.js +1 -1
- package/dist/esm/card/v2/useFilePreview/useFilePreview.js +236 -237
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/inline/mediaInlineCard.js +8 -8
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/v2/useFilePreview/getPreview/getPreview.d.ts +1 -1
- package/dist/types/card/v2/useFilePreview/getPreview/index.d.ts +1 -1
- package/dist/types/card/v2/useFilePreview/useFilePreview.d.ts +6 -6
- package/dist/types/inline/mediaInlineCard.d.ts +1 -1
- package/dist/types-ts4.5/card/v2/useFilePreview/getPreview/getPreview.d.ts +1 -1
- package/dist/types-ts4.5/card/v2/useFilePreview/getPreview/index.d.ts +1 -1
- package/dist/types-ts4.5/card/v2/useFilePreview/useFilePreview.d.ts +6 -6
- package/dist/types-ts4.5/inline/mediaInlineCard.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
2
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
3
|
import { FileFetcherError } from '@atlaskit/media-client';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { MediaInlineCardErroredView, MediaInlineCardLoadedView, MediaInlineCardLoadingView, messages } from '@atlaskit/media-ui';
|
|
5
|
+
import { formatDate } from '@atlaskit/media-ui/formatDate';
|
|
7
6
|
import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
|
|
8
7
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
9
8
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
9
|
+
import React, { useEffect, useState } from 'react';
|
|
10
|
+
import ReactDOM from 'react-dom';
|
|
11
|
+
import { createIntl, injectIntl, IntlProvider } from 'react-intl-next';
|
|
13
12
|
import { MediaCardError } from '../errors';
|
|
13
|
+
import { fireMediaCardEvent } from '../utils/analytics';
|
|
14
14
|
import { getErrorStatusPayload, getFailedProcessingStatusPayload, getSucceededStatusPayload } from './mediaInlineCardAnalytics';
|
|
15
15
|
// UI component which renders an inline link in the appropiate state based on a media file
|
|
16
16
|
export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
|
|
@@ -104,7 +104,7 @@ export var MediaInlineCardInternal = function MediaInlineCardInternal(_ref) {
|
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
return function () {
|
|
107
|
-
subscription.unsubscribe();
|
|
107
|
+
subscription === null || subscription === void 0 || subscription.unsubscribe();
|
|
108
108
|
};
|
|
109
109
|
}, [identifier.collectionName, identifier.id, mediaClient.file]);
|
|
110
110
|
if (subscribeError) {
|
|
@@ -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.6.
|
|
10
|
+
var packageVersion = "77.6.4";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MediaClient, MediaStoreGetFileImageParams, MediaBlobUrlAttrs, FilePreview } from '@atlaskit/media-client';
|
|
2
2
|
import { SSR, MediaTraceContext } from '@atlaskit/media-common';
|
|
3
3
|
import { MediaFilePreviewDimensions, MediaFilePreview } from '../types';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const getSSRPreview: (ssr: SSR, mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs) => MediaFilePreview;
|
|
5
5
|
export declare const isLocalPreview: (preview: MediaFilePreview) => boolean;
|
|
6
6
|
export declare const isSSRClientPreview: (preview: MediaFilePreview) => boolean;
|
|
7
7
|
export declare const isSSRDataPreview: (preview: MediaFilePreview) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { mediaFilePreviewCache } from './cache';
|
|
2
2
|
export { isPreviewableStatus, extractFilePreviewStatus, } from './filePreviewStatus';
|
|
3
|
-
export {
|
|
3
|
+
export { getSSRPreview, isLocalPreview, isSSRClientPreview, isSSRDataPreview, getAndCacheRemotePreview, getAndCacheLocalPreview, } from './getPreview';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FileIdentifier, ImageResizeMode, MediaBlobUrlAttrs } from '@atlaskit/media-client';
|
|
3
|
-
import { MediaTraceContext,
|
|
3
|
+
import { MediaTraceContext, SSR } from '@atlaskit/media-common';
|
|
4
4
|
import { MediaFilePreviewError } from './errors';
|
|
5
|
-
import { MediaFilePreview } from './types';
|
|
5
|
+
import { MediaFilePreview, MediaFilePreviewDimensions } from './types';
|
|
6
6
|
import { SSRStatus } from './analytics';
|
|
7
7
|
export interface UseFilePreviewParams {
|
|
8
8
|
/** Instance of file identifier. */
|
|
@@ -10,7 +10,7 @@ export interface UseFilePreviewParams {
|
|
|
10
10
|
/** Resize the media to 'crop' | 'fit' | 'full-fit' | 'stretchy-fit' */
|
|
11
11
|
readonly resizeMode?: ImageResizeMode;
|
|
12
12
|
/** Dimensions to be requested to the server. Will be scaled x2 in Retina Displays */
|
|
13
|
-
readonly dimensions?:
|
|
13
|
+
readonly dimensions?: MediaFilePreviewDimensions;
|
|
14
14
|
/** Server-Side-Rendering modes are "server" and "client" */
|
|
15
15
|
readonly ssr?: SSR;
|
|
16
16
|
/** Attributes to attach to the created Blob Url */
|
|
@@ -23,11 +23,11 @@ export interface UseFilePreviewParams {
|
|
|
23
23
|
readonly skipRemote?: boolean;
|
|
24
24
|
}
|
|
25
25
|
export declare const useFilePreview: ({ resizeMode, identifier, ssr, dimensions, traceContext, previewDidRender, skipRemote, mediaBlobUrlAttrs, }: UseFilePreviewParams) => {
|
|
26
|
-
|
|
26
|
+
preview: MediaFilePreview | undefined;
|
|
27
27
|
error: MediaFilePreviewError | undefined;
|
|
28
28
|
nonCriticalError: MediaFilePreviewError | undefined;
|
|
29
29
|
ssrReliabilityRef: import("react").MutableRefObject<SSRStatus>;
|
|
30
|
-
onImageError: (
|
|
31
|
-
onImageLoad: (
|
|
30
|
+
onImageError: (newPreview?: MediaFilePreview) => void;
|
|
31
|
+
onImageLoad: (newPreview?: MediaFilePreview) => void;
|
|
32
32
|
getScriptProps: () => import("react").ScriptHTMLAttributes<HTMLScriptElement>;
|
|
33
33
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
1
|
import { FileIdentifier, Identifier, MediaClient } from '@atlaskit/media-client';
|
|
2
|
+
import React, { FC } from 'react';
|
|
3
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import { InlineCardOnClickCallback } from '../types';
|
|
5
5
|
export interface MediaInlineCardProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MediaClient, MediaStoreGetFileImageParams, MediaBlobUrlAttrs, FilePreview } from '@atlaskit/media-client';
|
|
2
2
|
import { SSR, MediaTraceContext } from '@atlaskit/media-common';
|
|
3
3
|
import { MediaFilePreviewDimensions, MediaFilePreview } from '../types';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const getSSRPreview: (ssr: SSR, mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs) => MediaFilePreview;
|
|
5
5
|
export declare const isLocalPreview: (preview: MediaFilePreview) => boolean;
|
|
6
6
|
export declare const isSSRClientPreview: (preview: MediaFilePreview) => boolean;
|
|
7
7
|
export declare const isSSRDataPreview: (preview: MediaFilePreview) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { mediaFilePreviewCache } from './cache';
|
|
2
2
|
export { isPreviewableStatus, extractFilePreviewStatus, } from './filePreviewStatus';
|
|
3
|
-
export {
|
|
3
|
+
export { getSSRPreview, isLocalPreview, isSSRClientPreview, isSSRDataPreview, getAndCacheRemotePreview, getAndCacheLocalPreview, } from './getPreview';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FileIdentifier, ImageResizeMode, MediaBlobUrlAttrs } from '@atlaskit/media-client';
|
|
3
|
-
import { MediaTraceContext,
|
|
3
|
+
import { MediaTraceContext, SSR } from '@atlaskit/media-common';
|
|
4
4
|
import { MediaFilePreviewError } from './errors';
|
|
5
|
-
import { MediaFilePreview } from './types';
|
|
5
|
+
import { MediaFilePreview, MediaFilePreviewDimensions } from './types';
|
|
6
6
|
import { SSRStatus } from './analytics';
|
|
7
7
|
export interface UseFilePreviewParams {
|
|
8
8
|
/** Instance of file identifier. */
|
|
@@ -10,7 +10,7 @@ export interface UseFilePreviewParams {
|
|
|
10
10
|
/** Resize the media to 'crop' | 'fit' | 'full-fit' | 'stretchy-fit' */
|
|
11
11
|
readonly resizeMode?: ImageResizeMode;
|
|
12
12
|
/** Dimensions to be requested to the server. Will be scaled x2 in Retina Displays */
|
|
13
|
-
readonly dimensions?:
|
|
13
|
+
readonly dimensions?: MediaFilePreviewDimensions;
|
|
14
14
|
/** Server-Side-Rendering modes are "server" and "client" */
|
|
15
15
|
readonly ssr?: SSR;
|
|
16
16
|
/** Attributes to attach to the created Blob Url */
|
|
@@ -23,11 +23,11 @@ export interface UseFilePreviewParams {
|
|
|
23
23
|
readonly skipRemote?: boolean;
|
|
24
24
|
}
|
|
25
25
|
export declare const useFilePreview: ({ resizeMode, identifier, ssr, dimensions, traceContext, previewDidRender, skipRemote, mediaBlobUrlAttrs, }: UseFilePreviewParams) => {
|
|
26
|
-
|
|
26
|
+
preview: MediaFilePreview | undefined;
|
|
27
27
|
error: MediaFilePreviewError | undefined;
|
|
28
28
|
nonCriticalError: MediaFilePreviewError | undefined;
|
|
29
29
|
ssrReliabilityRef: import("react").MutableRefObject<SSRStatus>;
|
|
30
|
-
onImageError: (
|
|
31
|
-
onImageLoad: (
|
|
30
|
+
onImageError: (newPreview?: MediaFilePreview) => void;
|
|
31
|
+
onImageLoad: (newPreview?: MediaFilePreview) => void;
|
|
32
32
|
getScriptProps: () => import("react").ScriptHTMLAttributes<HTMLScriptElement>;
|
|
33
33
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
1
|
import { FileIdentifier, Identifier, MediaClient } from '@atlaskit/media-client';
|
|
2
|
+
import React, { FC } from 'react';
|
|
3
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import { InlineCardOnClickCallback } from '../types';
|
|
5
5
|
export interface MediaInlineCardProps {
|
package/package.json
CHANGED