@atlaskit/media-file-preview 0.0.1
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 +1 -0
- package/LICENSE.md +13 -0
- package/README.md +9 -0
- package/dist/cjs/analytics.js +50 -0
- package/dist/cjs/errors.js +143 -0
- package/dist/cjs/getPreview/cache.js +39 -0
- package/dist/cjs/getPreview/getPreview.js +119 -0
- package/dist/cjs/getPreview/helpers.js +167 -0
- package/dist/cjs/getPreview/index.js +56 -0
- package/dist/cjs/getPreview/objectURLCache.js +85 -0
- package/dist/cjs/getPreview/videoSnapshot.js +63 -0
- package/dist/cjs/globalScope/getSSRData.js +14 -0
- package/dist/cjs/globalScope/globalScope.js +66 -0
- package/dist/cjs/globalScope/index.js +37 -0
- package/dist/cjs/globalScope/printScript.js +32 -0
- package/dist/cjs/globalScope/types.js +5 -0
- package/dist/cjs/helpers.js +56 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/useFilePreview.js +355 -0
- package/dist/es2019/analytics.js +44 -0
- package/dist/es2019/errors.js +90 -0
- package/dist/es2019/getPreview/cache.js +30 -0
- package/dist/es2019/getPreview/getPreview.js +75 -0
- package/dist/es2019/getPreview/helpers.js +77 -0
- package/dist/es2019/getPreview/index.js +3 -0
- package/dist/es2019/getPreview/objectURLCache.js +44 -0
- package/dist/es2019/getPreview/videoSnapshot.js +41 -0
- package/dist/es2019/globalScope/getSSRData.js +8 -0
- package/dist/es2019/globalScope/globalScope.js +48 -0
- package/dist/es2019/globalScope/index.js +2 -0
- package/dist/es2019/globalScope/printScript.js +16 -0
- package/dist/es2019/globalScope/types.js +1 -0
- package/dist/es2019/helpers.js +53 -0
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/useFilePreview.js +333 -0
- package/dist/esm/analytics.js +44 -0
- package/dist/esm/errors.js +133 -0
- package/dist/esm/getPreview/cache.js +32 -0
- package/dist/esm/getPreview/getPreview.js +112 -0
- package/dist/esm/getPreview/helpers.js +161 -0
- package/dist/esm/getPreview/index.js +3 -0
- package/dist/esm/getPreview/objectURLCache.js +78 -0
- package/dist/esm/getPreview/videoSnapshot.js +56 -0
- package/dist/esm/globalScope/getSSRData.js +8 -0
- package/dist/esm/globalScope/globalScope.js +56 -0
- package/dist/esm/globalScope/index.js +2 -0
- package/dist/esm/globalScope/printScript.js +25 -0
- package/dist/esm/globalScope/types.js +1 -0
- package/dist/esm/helpers.js +49 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/useFilePreview.js +348 -0
- package/dist/types/analytics.d.ts +28 -0
- package/dist/types/errors.d.ts +42 -0
- package/dist/types/getPreview/cache.d.ts +21 -0
- package/dist/types/getPreview/getPreview.d.ts +9 -0
- package/dist/types/getPreview/helpers.d.ts +10 -0
- package/dist/types/getPreview/index.d.ts +3 -0
- package/dist/types/getPreview/objectURLCache.d.ts +12 -0
- package/dist/types/getPreview/videoSnapshot.d.ts +1 -0
- package/dist/types/globalScope/getSSRData.d.ts +3 -0
- package/dist/types/globalScope/globalScope.d.ts +15 -0
- package/dist/types/globalScope/index.d.ts +4 -0
- package/dist/types/globalScope/printScript.d.ts +2 -0
- package/dist/types/globalScope/types.d.ts +8 -0
- package/dist/types/helpers.d.ts +10 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/types.d.ts +12 -0
- package/dist/types/useFilePreview.d.ts +33 -0
- package/dist/types-ts4.5/analytics.d.ts +28 -0
- package/dist/types-ts4.5/errors.d.ts +42 -0
- package/dist/types-ts4.5/getPreview/cache.d.ts +21 -0
- package/dist/types-ts4.5/getPreview/getPreview.d.ts +9 -0
- package/dist/types-ts4.5/getPreview/helpers.d.ts +10 -0
- package/dist/types-ts4.5/getPreview/index.d.ts +3 -0
- package/dist/types-ts4.5/getPreview/objectURLCache.d.ts +12 -0
- package/dist/types-ts4.5/getPreview/videoSnapshot.d.ts +1 -0
- package/dist/types-ts4.5/globalScope/getSSRData.d.ts +3 -0
- package/dist/types-ts4.5/globalScope/globalScope.d.ts +15 -0
- package/dist/types-ts4.5/globalScope/index.d.ts +4 -0
- package/dist/types-ts4.5/globalScope/printScript.d.ts +2 -0
- package/dist/types-ts4.5/globalScope/types.d.ts +8 -0
- package/dist/types-ts4.5/helpers.d.ts +10 -0
- package/dist/types-ts4.5/index.d.ts +2 -0
- package/dist/types-ts4.5/types.d.ts +12 -0
- package/dist/types-ts4.5/useFilePreview.d.ts +33 -0
- package/package.json +98 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MediaClientErrorReason } from '@atlaskit/media-client';
|
|
2
|
+
import { MediaTraceContext, SuccessAttributes } from '@atlaskit/media-common';
|
|
3
|
+
import { MediaFilePreviewError, MediaFilePreviewErrorPrimaryReason } from './errors';
|
|
4
|
+
export type FailedErrorFailReason = MediaFilePreviewErrorPrimaryReason | 'nativeError';
|
|
5
|
+
export type MediaFilePreviewErrorInfo = {
|
|
6
|
+
failReason: FailedErrorFailReason;
|
|
7
|
+
error: MediaClientErrorReason | 'nativeError';
|
|
8
|
+
errorDetail: string;
|
|
9
|
+
metadataTraceContext?: MediaTraceContext;
|
|
10
|
+
};
|
|
11
|
+
export type SSRStatusFail = MediaFilePreviewErrorInfo & {
|
|
12
|
+
status: 'fail';
|
|
13
|
+
};
|
|
14
|
+
type SSRStatusSuccess = SuccessAttributes;
|
|
15
|
+
type SSRStatusUnknown = {
|
|
16
|
+
status: 'unknown';
|
|
17
|
+
};
|
|
18
|
+
type SSRStatusAttributes = SSRStatusSuccess | SSRStatusFail | SSRStatusUnknown;
|
|
19
|
+
export type SSRStatus = {
|
|
20
|
+
server: SSRStatusAttributes;
|
|
21
|
+
client: SSRStatusAttributes;
|
|
22
|
+
};
|
|
23
|
+
export declare const getErrorTraceContext: (error: MediaFilePreviewError) => MediaTraceContext | undefined;
|
|
24
|
+
export declare const getRenderErrorFailReason: (error: MediaFilePreviewError) => FailedErrorFailReason;
|
|
25
|
+
export declare const getRenderErrorErrorReason: (error: MediaFilePreviewError) => MediaClientErrorReason | 'nativeError';
|
|
26
|
+
export declare const getRenderErrorErrorDetail: (error: MediaFilePreviewError) => string;
|
|
27
|
+
export declare const extractErrorInfo: (error: MediaFilePreviewError, metadataTraceContext?: MediaTraceContext) => MediaFilePreviewErrorInfo;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { MediaClientErrorReason } from '@atlaskit/media-client';
|
|
2
|
+
import { MediaFileStateError } from '@atlaskit/media-client-react';
|
|
3
|
+
import { MediaFilePreview } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Primary reason is logged through Data Portal.
|
|
6
|
+
* Make sure all the values are whitelisted in Measure -> Event Regitry -> "mediaCardRender failed" event
|
|
7
|
+
*/
|
|
8
|
+
export type MediaFilePreviewErrorPrimaryReason = 'upload' | 'metadata-fetch' | 'error-file-state' | RemotePreviewPrimaryReason | LocalPreviewPrimaryReason | ImageLoadPrimaryReason | SsrPreviewPrimaryReason | 'missing-error-data' | 'preview-fetch';
|
|
9
|
+
export type ImageLoadPrimaryReason = 'cache-remote-uri' | 'cache-local-uri' | 'local-uri' | 'remote-uri' | 'external-uri' | 'unknown-uri';
|
|
10
|
+
export type RemotePreviewPrimaryReason = 'remote-preview-fetch' | 'remote-preview-not-ready' | 'remote-preview-fetch-ssr';
|
|
11
|
+
export type LocalPreviewPrimaryReason = 'local-preview-get' | 'local-preview-unsupported' | 'local-preview-rejected' | 'local-preview-image' | 'local-preview-video';
|
|
12
|
+
export type SsrPreviewPrimaryReason = 'ssr-client-uri' | 'ssr-client-load' | 'ssr-server-uri' | 'ssr-server-load';
|
|
13
|
+
export declare class MediaFilePreviewError extends Error {
|
|
14
|
+
readonly primaryReason: MediaFilePreviewErrorPrimaryReason;
|
|
15
|
+
readonly secondaryError?: Error | undefined;
|
|
16
|
+
constructor(primaryReason: MediaFilePreviewErrorPrimaryReason, secondaryError?: Error | undefined);
|
|
17
|
+
}
|
|
18
|
+
export declare class LocalPreviewError extends MediaFilePreviewError {
|
|
19
|
+
readonly primaryReason: LocalPreviewPrimaryReason;
|
|
20
|
+
readonly secondaryError?: Error | undefined;
|
|
21
|
+
constructor(primaryReason: LocalPreviewPrimaryReason, secondaryError?: Error | undefined);
|
|
22
|
+
}
|
|
23
|
+
export declare class RemotePreviewError extends MediaFilePreviewError {
|
|
24
|
+
readonly primaryReason: RemotePreviewPrimaryReason;
|
|
25
|
+
readonly secondaryError?: Error | undefined;
|
|
26
|
+
constructor(primaryReason: RemotePreviewPrimaryReason, secondaryError?: Error | undefined);
|
|
27
|
+
}
|
|
28
|
+
export declare class SsrPreviewError extends MediaFilePreviewError {
|
|
29
|
+
readonly primaryReason: SsrPreviewPrimaryReason;
|
|
30
|
+
readonly secondaryError?: Error | undefined;
|
|
31
|
+
constructor(primaryReason: SsrPreviewPrimaryReason, secondaryError?: Error | undefined);
|
|
32
|
+
}
|
|
33
|
+
export declare class ImageLoadError extends MediaFilePreviewError {
|
|
34
|
+
constructor(source?: MediaFilePreview['source']);
|
|
35
|
+
}
|
|
36
|
+
export declare function isMediaFilePreviewError(err: Error): err is MediaFilePreviewError;
|
|
37
|
+
export declare const isLocalPreviewError: (err: Error) => err is LocalPreviewError;
|
|
38
|
+
export declare const isRemotePreviewError: (err: Error) => err is RemotePreviewError;
|
|
39
|
+
export declare const isUnsupportedLocalPreviewError: (err: Error) => boolean;
|
|
40
|
+
export declare const ensureMediaFilePreviewError: (primaryReason: MediaFilePreviewErrorPrimaryReason, error: Error, updatePrimaryReason?: boolean) => MediaFilePreviewError;
|
|
41
|
+
export declare function isMediaFileStateError(err: Error): err is MediaFileStateError;
|
|
42
|
+
export declare function getFileStateErrorReason(err: MediaFileStateError): MediaClientErrorReason | 'unknown';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ImageResizeMode } from '@atlaskit/media-client';
|
|
2
|
+
import { MediaFilePreview } from '../types';
|
|
3
|
+
import { ObjectURLCache } from './objectURLCache';
|
|
4
|
+
type Mode = ImageResizeMode | undefined;
|
|
5
|
+
export declare const getCacheKey: (id: string, mode: Mode) => string;
|
|
6
|
+
export interface MediaFilePreviewCache {
|
|
7
|
+
get(id: string, mode: Mode): MediaFilePreview | undefined;
|
|
8
|
+
set(id: string, mode: Mode, cardPreview: MediaFilePreview): void;
|
|
9
|
+
remove(id: string, mode: Mode): void;
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class CardPreviewCacheImpl implements MediaFilePreviewCache {
|
|
13
|
+
private previewCache;
|
|
14
|
+
constructor(previewCache: ObjectURLCache);
|
|
15
|
+
get: (id: string, mode: Mode) => MediaFilePreview | undefined;
|
|
16
|
+
set: (id: string, mode: Mode, cardPreview: MediaFilePreview) => void;
|
|
17
|
+
remove: (id: string, mode: Mode) => void;
|
|
18
|
+
clear: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const mediaFilePreviewCache: CardPreviewCacheImpl;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FilePreview, MediaBlobUrlAttrs, MediaClient, MediaStoreGetFileImageParams } from '@atlaskit/media-client';
|
|
2
|
+
import { MediaTraceContext, SSR } from '@atlaskit/media-common';
|
|
3
|
+
import { MediaFilePreview, MediaFilePreviewDimensions } from '../types';
|
|
4
|
+
export declare const getSSRPreview: (ssr: SSR, mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs) => MediaFilePreview;
|
|
5
|
+
export declare const isLocalPreview: (preview: MediaFilePreview) => boolean;
|
|
6
|
+
export declare const isSSRClientPreview: (preview: MediaFilePreview) => boolean;
|
|
7
|
+
export declare const isSSRDataPreview: (preview: MediaFilePreview) => boolean;
|
|
8
|
+
export declare const getAndCacheRemotePreview: (mediaClient: MediaClient, id: string, dimensions: MediaFilePreviewDimensions, params: MediaStoreGetFileImageParams, mediaBlobUrlAttrs?: MediaBlobUrlAttrs, traceContext?: MediaTraceContext) => Promise<MediaFilePreview>;
|
|
9
|
+
export declare const getAndCacheLocalPreview: (id: string, filePreview: FilePreview | Promise<FilePreview>, dimensions: MediaFilePreviewDimensions, mode: MediaStoreGetFileImageParams['mode'], mediaBlobUrlAttrs?: MediaBlobUrlAttrs) => Promise<MediaFilePreview>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FilePreview, MediaClient, MediaStoreGetFileImageParams, MediaType } from '@atlaskit/media-client';
|
|
2
|
+
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
3
|
+
import { MediaFilePreview } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* This method tells the support for the media
|
|
6
|
+
* types covered in getCardPreviewFromFilePreview
|
|
7
|
+
*/
|
|
8
|
+
export declare const isSupportedLocalPreview: (mediaType?: MediaType) => boolean;
|
|
9
|
+
export declare const getLocalPreview: (filePreview: FilePreview | Promise<FilePreview>) => Promise<MediaFilePreview>;
|
|
10
|
+
export declare const getRemotePreview: (mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams, traceContext?: MediaTraceContext) => Promise<MediaFilePreview>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MediaFilePreview } 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): MediaFilePreview | undefined;
|
|
8
|
+
set(key: string, value: MediaFilePreview): void;
|
|
9
|
+
remove(key: string): void;
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const createObjectURLCache: () => ObjectURLCache;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const takeSnapshot: (blob: Blob) => Promise<string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FileIdentifier } from '@atlaskit/media-client';
|
|
3
|
+
import { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
4
|
+
import { MediaFilePreviewErrorInfo } from '../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?: Partial<NumericalCardDimensions>, error?: MediaFilePreviewErrorInfo, globalScope?: any) => void;
|
|
15
|
+
export declare const generateScriptProps: (identifier: FileIdentifier, dataURI?: string, dimensions?: Partial<NumericalCardDimensions>, error?: MediaFilePreviewErrorInfo) => React.ScriptHTMLAttributes<HTMLScriptElement>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { GLOBAL_MEDIA_NAMESPACE, GLOBAL_MEDIA_CARD_SSR, generateScriptProps, getKey, } from './globalScope';
|
|
2
|
+
export { getSSRData } from './getSSRData';
|
|
3
|
+
export type { MediaCardSsrData, MediaCardSsr } from './types';
|
|
4
|
+
export type { MediaGlobalScope } from './globalScope';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
2
|
+
import { MediaFilePreviewErrorInfo } from '../analytics';
|
|
3
|
+
export type MediaCardSsrData = {
|
|
4
|
+
dataURI?: string;
|
|
5
|
+
dimensions?: Partial<NumericalCardDimensions>;
|
|
6
|
+
error?: MediaFilePreviewErrorInfo;
|
|
7
|
+
};
|
|
8
|
+
export type MediaCardSsr = Record<string, MediaCardSsrData>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { MediaFilePreviewDimensions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Checks if at least one of next dimensions is bigger than current
|
|
5
|
+
* If a single dimension is undefined, returns false
|
|
6
|
+
*/
|
|
7
|
+
export declare const isBigger: (current?: MediaFilePreviewDimensions, next?: MediaFilePreviewDimensions) => boolean;
|
|
8
|
+
export declare const createRequestDimensions: (dimensions: Partial<MediaFilePreviewDimensions>) => Partial<MediaFilePreviewDimensions> | undefined;
|
|
9
|
+
/** Stores the provided value in a ref object to avoid "component rerenders" when the value is used as a hook dependency */
|
|
10
|
+
export declare function useCurrentValueRef<T>(value: T): MutableRefObject<T>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type MediaFilePreviewSource = 'local' | 'remote' | 'ssr-server' | 'ssr-client' | 'ssr-data' | 'cache-local' | 'cache-remote' | 'cache-ssr-client' | 'cache-ssr-server' | 'external';
|
|
2
|
+
export type MediaFilePreviewDimensions = {
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
};
|
|
6
|
+
export interface MediaFilePreview {
|
|
7
|
+
dataURI: string;
|
|
8
|
+
orientation?: number;
|
|
9
|
+
dimensions?: MediaFilePreviewDimensions;
|
|
10
|
+
source: MediaFilePreviewSource;
|
|
11
|
+
}
|
|
12
|
+
export type MediaFilePreviewStatus = 'uploading' | 'loading' | 'processing' | 'loading-preview' | 'complete' | 'error' | 'failed-processing';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FileIdentifier, ImageResizeMode, MediaBlobUrlAttrs } from '@atlaskit/media-client';
|
|
3
|
+
import { MediaTraceContext, SSR } from '@atlaskit/media-common';
|
|
4
|
+
import { SSRStatus } from './analytics';
|
|
5
|
+
import { MediaFilePreviewError } from './errors';
|
|
6
|
+
import { MediaFilePreview, MediaFilePreviewDimensions } from './types';
|
|
7
|
+
export interface UseFilePreviewParams {
|
|
8
|
+
/** Instance of file identifier. */
|
|
9
|
+
readonly identifier: FileIdentifier;
|
|
10
|
+
/** Resize the media to 'crop' | 'fit' | 'full-fit' | 'stretchy-fit' */
|
|
11
|
+
readonly resizeMode?: ImageResizeMode;
|
|
12
|
+
/** Dimensions to be requested to the server. Will be scaled x2 in Retina Displays */
|
|
13
|
+
readonly dimensions?: MediaFilePreviewDimensions;
|
|
14
|
+
/** Server-Side-Rendering modes are "server" and "client" */
|
|
15
|
+
readonly ssr?: SSR;
|
|
16
|
+
/** Attributes to attach to the created Blob Url */
|
|
17
|
+
readonly mediaBlobUrlAttrs?: MediaBlobUrlAttrs;
|
|
18
|
+
/** Trace context to be passed to the backend requests */
|
|
19
|
+
readonly traceContext?: MediaTraceContext;
|
|
20
|
+
/** Notify the hook that the preview successfully rendered */
|
|
21
|
+
readonly previewDidRender?: boolean;
|
|
22
|
+
/** Do not fetch a remote preview. Helpful for lazy loading */
|
|
23
|
+
readonly skipRemote?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const useFilePreview: ({ resizeMode, identifier, ssr, dimensions, traceContext, previewDidRender, skipRemote, mediaBlobUrlAttrs, }: UseFilePreviewParams) => {
|
|
26
|
+
preview: MediaFilePreview | undefined;
|
|
27
|
+
error: MediaFilePreviewError | undefined;
|
|
28
|
+
nonCriticalError: MediaFilePreviewError | undefined;
|
|
29
|
+
ssrReliabilityRef: import("react").MutableRefObject<SSRStatus>;
|
|
30
|
+
onImageError: (newPreview?: MediaFilePreview) => void;
|
|
31
|
+
onImageLoad: (newPreview?: MediaFilePreview) => void;
|
|
32
|
+
getScriptProps: () => import("react").ScriptHTMLAttributes<HTMLScriptElement>;
|
|
33
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/media-file-preview",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A React Hook to fetch and render file previews. It's overloaded with fancy features like SSR, lazy loading, memory cache and local preview.",
|
|
5
|
+
"author": "Atlassian Pty Ltd",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
10
|
+
"atlassian": {
|
|
11
|
+
"team": "Media Experience",
|
|
12
|
+
"inPublicMirror": false,
|
|
13
|
+
"releaseModel": "continuous",
|
|
14
|
+
"website": {
|
|
15
|
+
"name": "MediaFilePreview",
|
|
16
|
+
"category": "Components"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
20
|
+
"main": "dist/cjs/index.js",
|
|
21
|
+
"module": "dist/esm/index.js",
|
|
22
|
+
"module:es2019": "dist/es2019/index.js",
|
|
23
|
+
"types": "dist/types/index.d.ts",
|
|
24
|
+
"typesVersions": {
|
|
25
|
+
">=4.5 <4.9": {
|
|
26
|
+
"*": [
|
|
27
|
+
"dist/types-ts4.5/*",
|
|
28
|
+
"dist/types-ts4.5/index.d.ts"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"sideEffects": false,
|
|
33
|
+
"atlaskit:src": "src/index.ts",
|
|
34
|
+
"af:exports": {
|
|
35
|
+
".": "./src/index.ts"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@atlaskit/media-client": "^26.1.0",
|
|
39
|
+
"@atlaskit/media-client-react": "^2.0.1",
|
|
40
|
+
"@atlaskit/media-common": "^11.0.0",
|
|
41
|
+
"@atlaskit/media-ui": "^25.0.12",
|
|
42
|
+
"@babel/runtime": "^7.0.0",
|
|
43
|
+
"eventemitter2": "^4.1.0",
|
|
44
|
+
"lru_map": "^0.4.1"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^16.8.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@af/integration-testing": "*",
|
|
51
|
+
"@af/visual-regression": "*",
|
|
52
|
+
"@atlaskit/section-message": "^6.4.17",
|
|
53
|
+
"@atlaskit/ssr": "*",
|
|
54
|
+
"@atlaskit/visual-regression": "*",
|
|
55
|
+
"@atlaskit/webdriver-runner": "*",
|
|
56
|
+
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
57
|
+
"@testing-library/react": "^12.1.5",
|
|
58
|
+
"react-dom": "^16.8.0",
|
|
59
|
+
"typescript": "~4.9.5",
|
|
60
|
+
"wait-for-expect": "^1.2.0"
|
|
61
|
+
},
|
|
62
|
+
"techstack": {
|
|
63
|
+
"@atlassian/frontend": {
|
|
64
|
+
"import-structure": [
|
|
65
|
+
"atlassian-conventions"
|
|
66
|
+
],
|
|
67
|
+
"circular-dependencies": [
|
|
68
|
+
"file-and-folder-level"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"@repo/internal": {
|
|
72
|
+
"dom-events": "use-bind-event-listener",
|
|
73
|
+
"analytics": [
|
|
74
|
+
"analytics-next"
|
|
75
|
+
],
|
|
76
|
+
"design-tokens": [
|
|
77
|
+
"color"
|
|
78
|
+
],
|
|
79
|
+
"theming": [
|
|
80
|
+
"react-context"
|
|
81
|
+
],
|
|
82
|
+
"ui-components": [
|
|
83
|
+
"lite-mode"
|
|
84
|
+
],
|
|
85
|
+
"deprecation": [
|
|
86
|
+
"no-deprecated-imports"
|
|
87
|
+
],
|
|
88
|
+
"styling": [
|
|
89
|
+
"static",
|
|
90
|
+
"emotion"
|
|
91
|
+
],
|
|
92
|
+
"imports": [
|
|
93
|
+
"import-no-extraneous-disable-for-examples-and-docs"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
98
|
+
}
|