@atlaskit/media-viewer 47.6.0 → 47.6.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 +6 -0
- package/classnames/package.json +2 -2
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/analytics/ufoExperiences.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/analytics/ufoExperiences.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/analytics/ufoExperiences.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/events/index.d.ts +1 -1
- package/dist/types/analytics/events/operational/_mediaFile.d.ts +1 -1
- package/dist/types/analytics/events/operational/commenced.d.ts +2 -2
- package/dist/types/analytics/events/operational/loadFailed.d.ts +2 -2
- package/dist/types/analytics/events/operational/loadSucceeded.d.ts +3 -3
- package/dist/types/analytics/events/operational/previewUnsupported.d.ts +2 -2
- package/dist/types/analytics/events/operational/zipEntryLoadFailed.d.ts +3 -3
- package/dist/types/analytics/events/operational/zipEntryLoadSucceeded.d.ts +2 -2
- package/dist/types/analytics/events/screen/modal.d.ts +1 -1
- package/dist/types/analytics/events/ui/_clickedButton.d.ts +1 -1
- package/dist/types/analytics/events/ui/closed.d.ts +2 -2
- package/dist/types/analytics/events/ui/downloadButtonClicked.d.ts +2 -2
- package/dist/types/analytics/events/ui/failedPreviewDownloadButtonClicked.d.ts +2 -2
- package/dist/types/analytics/events/ui/navigated.d.ts +3 -3
- package/dist/types/analytics/events/ui/zoomInButtonClicked.d.ts +2 -2
- package/dist/types/analytics/events/ui/zoomOutButtonClicked.d.ts +1 -1
- package/dist/types/analytics/index.d.ts +1 -1
- package/dist/types/analytics/ufoExperiences.d.ts +4 -4
- package/dist/types/components/media-viewer-analytics-error-boundary.d.ts +1 -1
- package/dist/types/components/media-viewer-loader.d.ts +3 -3
- package/dist/types/components/normaliseInput.d.ts +1 -1
- package/dist/types/components/types.d.ts +1 -1
- package/dist/types/domain/outcome.d.ts +4 -4
- package/dist/types/download.d.ts +4 -4
- package/dist/types/errorMessage.d.ts +2 -2
- package/dist/types/errors.d.ts +4 -4
- package/dist/types/header.d.ts +2 -2
- package/dist/types/item-viewer.d.ts +3 -3
- package/dist/types/list.d.ts +2 -2
- package/dist/types/media-viewer.d.ts +3 -2
- package/dist/types/navigation.d.ts +3 -3
- package/dist/types/styleWrappers.d.ts +20 -20
- package/dist/types/styles.d.ts +4 -4
- package/dist/types/viewers/archiveSidebar/archive-sidebar-folder-entry.d.ts +1 -1
- package/dist/types/viewers/archiveSidebar/archive-sidebar-header.d.ts +1 -1
- package/dist/types/viewers/archiveSidebar/archive-sidebar.d.ts +1 -1
- package/dist/types/viewers/archiveSidebar/archive.d.ts +3 -3
- package/dist/types/viewers/archiveSidebar/archiveViewerLoader.d.ts +1 -1
- package/dist/types/viewers/archiveSidebar/styleWrappers.d.ts +2 -2
- package/dist/types/viewers/archiveSidebar/types.d.ts +1 -1
- package/dist/types/viewers/audio.d.ts +2 -2
- package/dist/types/viewers/base-viewer.d.ts +3 -3
- package/dist/types/viewers/codeViewer/codeViewerRenderer.d.ts +2 -2
- package/dist/types/viewers/codeViewer/index.d.ts +1 -1
- package/dist/types/viewers/doc/index.d.ts +2 -2
- package/dist/types/viewers/doc/pdfRenderer.d.ts +2 -2
- package/dist/types/viewers/image/index.d.ts +2 -2
- package/dist/types/viewers/image/interactive-img.d.ts +1 -1
- package/dist/types/viewers/video.d.ts +2 -2
- package/dist/types/zoomControls.d.ts +1 -1
- package/package.json +11 -3
package/CHANGELOG.md
CHANGED
package/classnames/package.json
CHANGED
|
@@ -12,7 +12,7 @@ var componentName = 'mediaViewer';
|
|
|
12
12
|
exports.component = exports.componentName = componentName;
|
|
13
13
|
var packageName = "@atlaskit/media-viewer";
|
|
14
14
|
exports.packageName = packageName;
|
|
15
|
-
var packageVersion = "47.6.
|
|
15
|
+
var packageVersion = "47.6.1";
|
|
16
16
|
exports.packageVersion = packageVersion;
|
|
17
17
|
function getFileAttributes(fileState) {
|
|
18
18
|
if (!fileState) {
|
|
@@ -12,7 +12,7 @@ var _mediaCommon = require("@atlaskit/media-common");
|
|
|
12
12
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
14
|
var packageName = "@atlaskit/media-viewer";
|
|
15
|
-
var packageVersion = "47.6.
|
|
15
|
+
var packageVersion = "47.6.1";
|
|
16
16
|
var ufoExperience;
|
|
17
17
|
var getExperience = function getExperience() {
|
|
18
18
|
if (!ufoExperience) {
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ANALYTICS_MEDIA_CHANNEL } from '@atlaskit/media-common';
|
|
2
2
|
const componentName = 'mediaViewer';
|
|
3
3
|
const packageName = "@atlaskit/media-viewer";
|
|
4
|
-
const packageVersion = "47.6.
|
|
4
|
+
const packageVersion = "47.6.1";
|
|
5
5
|
export { packageName, packageVersion, componentName, componentName as component };
|
|
6
6
|
export function getFileAttributes(fileState) {
|
|
7
7
|
if (!fileState) {
|
|
@@ -2,7 +2,7 @@ import { UFOExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atl
|
|
|
2
2
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
3
3
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
4
4
|
const packageName = "@atlaskit/media-viewer";
|
|
5
|
-
const packageVersion = "47.6.
|
|
5
|
+
const packageVersion = "47.6.1";
|
|
6
6
|
let ufoExperience;
|
|
7
7
|
const getExperience = () => {
|
|
8
8
|
if (!ufoExperience) {
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ANALYTICS_MEDIA_CHANNEL } from '@atlaskit/media-common';
|
|
2
2
|
var componentName = 'mediaViewer';
|
|
3
3
|
var packageName = "@atlaskit/media-viewer";
|
|
4
|
-
var packageVersion = "47.6.
|
|
4
|
+
var packageVersion = "47.6.1";
|
|
5
5
|
export { packageName, packageVersion, componentName, componentName as component };
|
|
6
6
|
export function getFileAttributes(fileState) {
|
|
7
7
|
if (!fileState) {
|
|
@@ -5,7 +5,7 @@ import { UFOExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atl
|
|
|
5
5
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
6
6
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
7
7
|
var packageName = "@atlaskit/media-viewer";
|
|
8
|
-
var packageVersion = "47.6.
|
|
8
|
+
var packageVersion = "47.6.1";
|
|
9
9
|
var ufoExperience;
|
|
10
10
|
var getExperience = function getExperience() {
|
|
11
11
|
if (!ufoExperience) {
|
package/dist/esm/version.json
CHANGED
|
@@ -11,4 +11,4 @@ import { FailedPreviewDownloadButtonClickedEventPayload } from './ui/failedPrevi
|
|
|
11
11
|
import { NavigatedEventPayload } from './ui/navigated';
|
|
12
12
|
import { ZoomInButtonClickEventPayload } from './ui/zoomInButtonClicked';
|
|
13
13
|
import { ZoomOutButtonClickEventPayload } from './ui/zoomOutButtonClicked';
|
|
14
|
-
export
|
|
14
|
+
export type MediaViewerEventPayload = CommencedEventPayload | LoadFailedEventPayload | LoadSucceededEventPayload | PreviewUnsupportedEventPayload | ZipEntryLoadFailedEventPayload | ZipEntryLoadSucceededEventPayload | ModalEventPayload | ClosedEventPayload | DownloadButtonClickedEventPayload | FailedPreviewDownloadButtonClickedEventPayload | NavigatedEventPayload | ZoomInButtonClickEventPayload | ZoomOutButtonClickEventPayload;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OperationalEventPayload, OperationalAttributes } from '@atlaskit/media-common';
|
|
2
2
|
/** common definition used by other mediaFile events */
|
|
3
|
-
export
|
|
3
|
+
export type MediaFileEventPayload<Attributes extends OperationalAttributes, Action extends 'commenced' | 'loadSucceeded' | 'loadFailed' | 'previewUnsupported' | 'zipEntryLoadSucceeded' | 'zipEntryLoadFailed'> = OperationalEventPayload<Attributes, Action, 'mediaFile'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MediaTraceContext, WithFileAttributes, WithTraceContext } from '@atlaskit/media-common';
|
|
2
2
|
import { MediaFileEventPayload } from './_mediaFile';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type CommencedAttributes = WithFileAttributes & WithTraceContext;
|
|
4
|
+
export type CommencedEventPayload = MediaFileEventPayload<CommencedAttributes, 'commenced'>;
|
|
5
5
|
export declare const createCommencedEvent: (fileId: string, traceContext: MediaTraceContext) => CommencedEventPayload;
|
|
@@ -3,5 +3,5 @@ import { MediaFileEventPayload } from './_mediaFile';
|
|
|
3
3
|
import { MediaViewerFailureAttributes } from '../..';
|
|
4
4
|
import { MediaViewerError } from '../../../errors';
|
|
5
5
|
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
6
|
-
export
|
|
7
|
-
export declare const createLoadFailedEvent: (fileId: string, error: MediaViewerError, fileState?: FileState
|
|
6
|
+
export type LoadFailedEventPayload = MediaFileEventPayload<MediaViewerFailureAttributes, 'loadFailed'>;
|
|
7
|
+
export declare const createLoadFailedEvent: (fileId: string, error: MediaViewerError, fileState?: FileState, traceContext?: MediaTraceContext) => LoadFailedEventPayload;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SuccessAttributes, WithFileAttributes, FileAttributes, MediaTraceContext, WithTraceContext } from '@atlaskit/media-common';
|
|
2
2
|
import { MediaFileEventPayload } from './_mediaFile';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export declare const createLoadSucceededEvent: ({ fileId, fileMediatype, fileMimetype, fileSize }: FileAttributes, traceContext?: MediaTraceContext
|
|
3
|
+
export type LoadSucceededAttributes = SuccessAttributes & WithFileAttributes & WithTraceContext;
|
|
4
|
+
export type LoadSucceededEventPayload = MediaFileEventPayload<LoadSucceededAttributes, 'loadSucceeded'>;
|
|
5
|
+
export declare const createLoadSucceededEvent: ({ fileId, fileMediatype, fileMimetype, fileSize }: FileAttributes, traceContext?: MediaTraceContext) => LoadSucceededEventPayload;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileState } from '@atlaskit/media-client';
|
|
2
2
|
import { WithFileAttributes } from '@atlaskit/media-common';
|
|
3
3
|
import { MediaFileEventPayload } from './_mediaFile';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type PreviewUnsupportedAttributes = WithFileAttributes;
|
|
5
|
+
export type PreviewUnsupportedEventPayload = MediaFileEventPayload<PreviewUnsupportedAttributes, 'previewUnsupported'>;
|
|
6
6
|
export declare const createPreviewUnsupportedEvent: (fileState: FileState) => PreviewUnsupportedEventPayload;
|
|
@@ -3,11 +3,11 @@ import { ZipEntry } from 'unzipit';
|
|
|
3
3
|
import { MediaFileEventPayload } from './_mediaFile';
|
|
4
4
|
import { MediaViewerFailureAttributes } from '../..';
|
|
5
5
|
import { MediaViewerError } from '../../../errors';
|
|
6
|
-
export
|
|
6
|
+
export type ZipEntryLoadFailedAttributes = MediaViewerFailureAttributes & {
|
|
7
7
|
size: number;
|
|
8
8
|
encrypted: boolean;
|
|
9
9
|
compressedSize: number;
|
|
10
10
|
mimeType: string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export declare const createZipEntryLoadFailedEvent: (fileState: FileState, error: MediaViewerError, zipEntry?: ZipEntry
|
|
12
|
+
export type ZipEntryLoadFailedEventPayload = MediaFileEventPayload<ZipEntryLoadFailedAttributes, 'zipEntryLoadFailed'>;
|
|
13
|
+
export declare const createZipEntryLoadFailedEvent: (fileState: FileState, error: MediaViewerError, zipEntry?: ZipEntry) => ZipEntryLoadFailedEventPayload;
|
|
@@ -2,11 +2,11 @@ import { FileState } from '@atlaskit/media-client';
|
|
|
2
2
|
import { SuccessAttributes, WithFileAttributes } from '@atlaskit/media-common/analytics';
|
|
3
3
|
import { ZipEntry } from 'unzipit';
|
|
4
4
|
import { MediaFileEventPayload } from './_mediaFile';
|
|
5
|
-
export
|
|
5
|
+
export type ZipEntryLoadSucceededAttributes = SuccessAttributes & WithFileAttributes & {
|
|
6
6
|
size: number;
|
|
7
7
|
encrypted: boolean;
|
|
8
8
|
compressedSize: number;
|
|
9
9
|
mimeType: string;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type ZipEntryLoadSucceededEventPayload = MediaFileEventPayload<ZipEntryLoadSucceededAttributes, 'zipEntryLoadSucceeded'>;
|
|
12
12
|
export declare const createZipEntryLoadSucceededEvent: (fileState: FileState, zipEntry: ZipEntry) => ZipEntryLoadSucceededEventPayload;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ScreenEventPayload, ScreenAttributes } from '@atlaskit/media-common';
|
|
2
|
-
export
|
|
2
|
+
export type ModalEventPayload = Omit<ScreenEventPayload<ScreenAttributes, 'mediaViewerModal'>, 'attributes'>;
|
|
3
3
|
export declare const createModalEvent: () => ModalEventPayload;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UIAttributes, UIEventPayload } from '@atlaskit/media-common';
|
|
2
|
-
export
|
|
2
|
+
export type ButtonClickEventPayload<Attributes extends UIAttributes> = UIEventPayload<Attributes, 'clicked', 'button'>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UIEventPayload } from '@atlaskit/media-common';
|
|
2
|
-
export
|
|
2
|
+
export type ClosedInputType = 'button' | 'blanket' | 'escKey';
|
|
3
3
|
export interface ClosedAttributes {
|
|
4
4
|
input: ClosedInputType;
|
|
5
5
|
sessionDurationMs: number;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type ClosedEventPayload = UIEventPayload<ClosedAttributes, 'closed', 'mediaViewer'>;
|
|
8
8
|
export declare const createClosedEvent: (input: ClosedInputType) => ClosedEventPayload;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WithFileAttributes } from '@atlaskit/media-common';
|
|
2
2
|
import { FileStatus, FileState } from '@atlaskit/media-client';
|
|
3
3
|
import { ButtonClickEventPayload } from './_clickedButton';
|
|
4
|
-
export
|
|
4
|
+
export type DownloadButtonClickedAttributes = WithFileAttributes & {
|
|
5
5
|
fileProcessingStatus: FileStatus;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type DownloadButtonClickedEventPayload = ButtonClickEventPayload<DownloadButtonClickedAttributes>;
|
|
8
8
|
export declare const createDownloadButtonClickedEvent: (fileState: FileState) => DownloadButtonClickedEventPayload;
|
|
@@ -2,9 +2,9 @@ import { WithFileAttributes } from '@atlaskit/media-common';
|
|
|
2
2
|
import { FileStatus, FileState } from '@atlaskit/media-client';
|
|
3
3
|
import { ButtonClickEventPayload } from './_clickedButton';
|
|
4
4
|
import { PrimaryErrorReason, MediaViewerError } from '../../../errors';
|
|
5
|
-
export
|
|
5
|
+
export type FailedPreviewDownloadButtonClickedAttributes = WithFileAttributes & {
|
|
6
6
|
fileProcessingStatus: FileStatus;
|
|
7
7
|
failReason: PrimaryErrorReason;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type FailedPreviewDownloadButtonClickedEventPayload = ButtonClickEventPayload<FailedPreviewDownloadButtonClickedAttributes>;
|
|
10
10
|
export declare const createFailedPreviewDownloadButtonClickedEvent: (fileState: FileState, error: MediaViewerError) => FailedPreviewDownloadButtonClickedEventPayload;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { UIEventPayload, UIAttributes, WithFileAttributes } from '@atlaskit/media-common';
|
|
2
2
|
import { Identifier } from '@atlaskit/media-client';
|
|
3
3
|
import { NavigationDirection, NavigationSource } from '../../../navigation';
|
|
4
|
-
export
|
|
4
|
+
export type NavigatedAttributes = UIAttributes & WithFileAttributes & {
|
|
5
5
|
input: 'button' | 'keys';
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type NavigatedEventPayload = UIEventPayload<NavigatedAttributes, 'navigated', 'file'> & {
|
|
8
8
|
actionSubjectId: 'next' | 'previous';
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type NavigatedInput = 'button' | 'keys';
|
|
11
11
|
export declare const inputFromSource: (source: NavigationSource) => NavigatedInput;
|
|
12
12
|
export declare const createNavigatedEvent: (direction: NavigationDirection, source: NavigationSource, identifier: Identifier) => NavigatedEventPayload;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ButtonClickEventPayload } from './_clickedButton';
|
|
2
|
-
export
|
|
2
|
+
export type ZoomButtonClickAttributes = {
|
|
3
3
|
zoomScale: number;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type ZoomInButtonClickEventPayload = ButtonClickEventPayload<ZoomButtonClickAttributes> & {
|
|
6
6
|
actionSubjectId: 'zoomIn';
|
|
7
7
|
};
|
|
8
8
|
export declare function createZoomInButtonClickEvent(zoomScale: number): ZoomInButtonClickEventPayload;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonClickEventPayload } from './_clickedButton';
|
|
2
2
|
import { ZoomButtonClickAttributes } from './zoomInButtonClicked';
|
|
3
|
-
export
|
|
3
|
+
export type ZoomOutButtonClickEventPayload = ButtonClickEventPayload<ZoomButtonClickAttributes> & {
|
|
4
4
|
actionSubjectId: 'zoomOut';
|
|
5
5
|
};
|
|
6
6
|
export declare function createZoomOutButtonClickedEvent(zoomScale: number): ZoomOutButtonClickEventPayload;
|
|
@@ -9,7 +9,7 @@ declare const packageVersion: string;
|
|
|
9
9
|
export { packageName, packageVersion, componentName, componentName as component, };
|
|
10
10
|
export declare function getFileAttributes(fileState?: FileState): FileAttributes;
|
|
11
11
|
/** This type takes FailureAttributes and redefines `failReason` to be the strong media-viewer type */
|
|
12
|
-
export
|
|
12
|
+
export type MediaViewerFailureAttributes = Omit<FailureAttributes, 'failReason'> & {
|
|
13
13
|
failReason: PrimaryErrorReason;
|
|
14
14
|
request?: RequestMetadata;
|
|
15
15
|
} & WithFileAttributes & WithTraceContext;
|
|
@@ -2,7 +2,7 @@ import { FileAttributes } from '@atlaskit/media-common';
|
|
|
2
2
|
import { RequestMetadata } from '@atlaskit/media-client';
|
|
3
3
|
import { PrimaryErrorReason } from '../errors';
|
|
4
4
|
import { FileStateFlags } from '../components/types';
|
|
5
|
-
export
|
|
5
|
+
export type UFOFailedEventPayload = {
|
|
6
6
|
failReason?: PrimaryErrorReason;
|
|
7
7
|
error?: string;
|
|
8
8
|
errorDetail?: string;
|
|
@@ -10,10 +10,10 @@ export declare type UFOFailedEventPayload = {
|
|
|
10
10
|
fileAttributes: FileAttributes;
|
|
11
11
|
fileStateFlags?: FileStateFlags;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type UFOSucceedEventPayload = {
|
|
14
14
|
fileAttributes: FileAttributes;
|
|
15
15
|
fileStateFlags?: FileStateFlags;
|
|
16
16
|
};
|
|
17
17
|
export declare const startMediaFileUfoExperience: () => void;
|
|
18
|
-
export declare const succeedMediaFileUfoExperience: (properties?: UFOSucceedEventPayload
|
|
19
|
-
export declare const failMediaFileUfoExperience: (properties?: UFOFailedEventPayload
|
|
18
|
+
export declare const succeedMediaFileUfoExperience: (properties?: UFOSucceedEventPayload) => void;
|
|
19
|
+
export declare const failMediaFileUfoExperience: (properties?: UFOFailedEventPayload) => void;
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import type { WithMediaClientConfigProps } from '@atlaskit/media-client';
|
|
3
3
|
import type { MediaViewerProps } from './types';
|
|
4
4
|
import type { MediaViewerAnalyticsErrorBoundaryProps } from './media-viewer-analytics-error-boundary';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export type MediaViewerWithMediaClientConfigProps = WithMediaClientConfigProps<MediaViewerProps>;
|
|
6
|
+
type MediaViewerWithMediaClientConfigComponent = React.ComponentType<MediaViewerWithMediaClientConfigProps>;
|
|
7
|
+
type MediaViewerErrorBoundaryComponent = React.ComponentType<MediaViewerAnalyticsErrorBoundaryProps>;
|
|
8
8
|
export interface AsyncMediaViewerState {
|
|
9
9
|
MediaViewer?: MediaViewerWithMediaClientConfigComponent;
|
|
10
10
|
MediaViewerErrorBoundary?: MediaViewerErrorBoundaryComponent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MediaViewerDataSource } from './types';
|
|
2
2
|
import { Identifier } from '@atlaskit/media-client';
|
|
3
|
-
|
|
3
|
+
type NormaliseInputParams = {
|
|
4
4
|
dataSource?: MediaViewerDataSource;
|
|
5
5
|
selectedItem: Identifier;
|
|
6
6
|
items?: Array<Identifier>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type PendingState = {
|
|
2
2
|
status: 'PENDING';
|
|
3
3
|
};
|
|
4
|
-
export
|
|
4
|
+
export type SuccessfulState<Data> = {
|
|
5
5
|
status: 'SUCCESSFUL';
|
|
6
6
|
data: Data;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type FailedState<Err> = {
|
|
9
9
|
status: 'FAILED';
|
|
10
10
|
err: Err;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type State<Data, Err> = PendingState | SuccessfulState<Data> | FailedState<Err>;
|
|
13
13
|
export declare class Outcome<Data, Err = Error> {
|
|
14
14
|
private readonly state;
|
|
15
15
|
private constructor();
|
package/dist/types/download.d.ts
CHANGED
|
@@ -2,19 +2,19 @@ import { FileState, Identifier, MediaClient } from '@atlaskit/media-client';
|
|
|
2
2
|
import { MediaButton } from '@atlaskit/media-ui';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { MediaViewerError } from './errors';
|
|
5
|
-
|
|
5
|
+
type DownloadButtonProps = React.ComponentProps<typeof MediaButton> & {
|
|
6
6
|
analyticspayload: Record<string, any>;
|
|
7
7
|
};
|
|
8
8
|
export declare function DownloadButton({ analyticspayload, onClick: providedOnClick, ...rest }: DownloadButtonProps): JSX.Element;
|
|
9
|
-
export declare const createItemDownloader: (file: FileState, mediaClient: MediaClient, collectionName?: string
|
|
10
|
-
export
|
|
9
|
+
export declare const createItemDownloader: (file: FileState, mediaClient: MediaClient, collectionName?: string) => () => Promise<void>;
|
|
10
|
+
export type ErrorViewDownloadButtonProps = {
|
|
11
11
|
fileState: FileState;
|
|
12
12
|
mediaClient: MediaClient;
|
|
13
13
|
error: MediaViewerError;
|
|
14
14
|
collectionName?: string;
|
|
15
15
|
};
|
|
16
16
|
export declare const ErrorViewDownloadButton: (props: ErrorViewDownloadButtonProps) => JSX.Element;
|
|
17
|
-
export
|
|
17
|
+
export type ToolbarDownloadButtonProps = {
|
|
18
18
|
state: FileState;
|
|
19
19
|
identifier: Identifier;
|
|
20
20
|
mediaClient: MediaClient;
|
|
@@ -6,7 +6,7 @@ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
|
6
6
|
import { PrimaryErrorReason, SecondaryErrorReason, MediaViewerError } from './errors';
|
|
7
7
|
import { FileStateFlags } from './components/types';
|
|
8
8
|
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
9
|
-
export
|
|
9
|
+
export type Props = Readonly<{
|
|
10
10
|
error: MediaViewerError;
|
|
11
11
|
supressAnalytics?: boolean;
|
|
12
12
|
fileId: string;
|
|
@@ -15,7 +15,7 @@ export declare type Props = Readonly<{
|
|
|
15
15
|
fileStateFlags?: FileStateFlags;
|
|
16
16
|
traceContext?: MediaTraceContext;
|
|
17
17
|
}>;
|
|
18
|
-
export
|
|
18
|
+
export type FormatMessageFn = (messageDescriptor: MessageDescriptor) => string;
|
|
19
19
|
export declare const errorReasonToMessages: Array<[
|
|
20
20
|
PrimaryErrorReason | SecondaryErrorReason,
|
|
21
21
|
MessageDescriptor
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -13,10 +13,10 @@ export declare class ArchiveViewerError extends MediaViewerError {
|
|
|
13
13
|
constructor(primaryReason: ArchiveViewerErrorReason, secondaryError?: Error | undefined, zipEntry?: ZipEntry | undefined);
|
|
14
14
|
}
|
|
15
15
|
export declare function isArchiveViewerError(err: Error): err is ArchiveViewerError;
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
16
|
+
export type MediaViewerErrorReason = 'collection-fetch-metadata' | 'header-fetch-metadata' | 'itemviewer-onerror' | 'itemviewer-fetch-metadata' | 'itemviewer-file-error-status' | 'itemviewer-file-failed-processing-status' | 'imageviewer-external-onerror' | 'imageviewer-fetch-url' | 'imageviewer-src-onerror' | 'audioviewer-fetch-url' | 'audioviewer-missing-artefact' | 'audioviewer-playback' | 'videoviewer-fetch-url' | 'videoviewer-missing-artefact' | 'videoviewer-playback' | 'docviewer-fetch-url' | 'docviewer-fetch-pdf' | 'codeviewer-fetch-src' | 'codeviewer-load-src' | 'codeviewer-file-size-exceeds' | 'codeviewer-parse-email' | 'unsupported';
|
|
17
|
+
export type ArchiveViewerErrorReason = 'archiveviewer-bundle-loader' | 'archiveviewer-read-binary' | 'archiveviewer-create-url' | 'archiveviewer-imageviewer-onerror' | 'archiveviewer-videoviewer-onerror' | 'archiveviewer-audioviewer-onerror' | 'archiveviewer-docviewer-onerror' | 'archiveviewer-codeviewer-onerror' | 'archiveviewer-codeviewer-file-size-exceeds' | 'archiveviewer-missing-name-src' | 'archiveviewer-unsupported' | 'archiveviewer-encrypted-entry';
|
|
18
|
+
export type PrimaryErrorReason = MediaViewerErrorReason | ArchiveViewerErrorReason;
|
|
19
|
+
export type SecondaryErrorReason = MediaClientErrorReason | 'unknown' | 'nativeError' | undefined;
|
|
20
20
|
export declare function getPrimaryErrorReason(error: MediaViewerError): PrimaryErrorReason;
|
|
21
21
|
export declare function getSecondaryErrorReason(error: MediaViewerError): SecondaryErrorReason;
|
|
22
22
|
export declare function getErrorDetail(error?: Error): string | undefined;
|
package/dist/types/header.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Outcome } from './domain';
|
|
|
5
5
|
import { MediaViewerExtensions } from './components/types';
|
|
6
6
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
7
7
|
import { MediaViewerError } from './errors';
|
|
8
|
-
export
|
|
8
|
+
export type Props = {
|
|
9
9
|
readonly identifier: Identifier;
|
|
10
10
|
readonly mediaClient: MediaClient;
|
|
11
11
|
readonly onClose?: () => void;
|
|
@@ -15,7 +15,7 @@ export declare type Props = {
|
|
|
15
15
|
readonly featureFlags?: MediaFeatureFlags;
|
|
16
16
|
readonly onSetArchiveSideBarVisible?: (isVisible: boolean) => void;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type State = {
|
|
19
19
|
item: Outcome<FileState, MediaViewerError>;
|
|
20
20
|
};
|
|
21
21
|
export declare class Header extends React.Component<Props & WrappedComponentProps, State> {
|
|
@@ -5,7 +5,7 @@ import { Outcome } from './domain';
|
|
|
5
5
|
import { MediaViewerError } from './errors';
|
|
6
6
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
7
7
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
8
|
-
export
|
|
8
|
+
export type Props = Readonly<{
|
|
9
9
|
identifier: Identifier;
|
|
10
10
|
mediaClient: MediaClient;
|
|
11
11
|
onClose?: () => void;
|
|
@@ -13,10 +13,10 @@ export declare type Props = Readonly<{
|
|
|
13
13
|
contextId?: string;
|
|
14
14
|
featureFlags?: MediaFeatureFlags;
|
|
15
15
|
}> & WithAnalyticsEventsProps & WithShowControlMethodProp;
|
|
16
|
-
export
|
|
16
|
+
export type FileItem = FileState | 'external-image';
|
|
17
17
|
export declare const isExternalImageItem: (fileItem: FileItem) => fileItem is "external-image";
|
|
18
18
|
export declare const isFileStateItem: (fileItem: FileItem) => fileItem is FileState;
|
|
19
|
-
export
|
|
19
|
+
export type State = {
|
|
20
20
|
item: Outcome<FileItem, MediaViewerError>;
|
|
21
21
|
};
|
|
22
22
|
export declare const MAX_FILE_SIZE_SUPPORTED_BY_CODEVIEWER: number;
|
package/dist/types/list.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { MediaClient, Identifier } from '@atlaskit/media-client';
|
|
|
3
3
|
import { WithShowControlMethodProp } from '@atlaskit/media-ui';
|
|
4
4
|
import { MediaViewerExtensions } from './components/types';
|
|
5
5
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
6
|
-
export
|
|
6
|
+
export type Props = Readonly<{
|
|
7
7
|
onClose?: () => void;
|
|
8
8
|
onNavigationChange?: (selectedItem: Identifier) => void;
|
|
9
9
|
defaultSelectedItem: Identifier;
|
|
@@ -15,7 +15,7 @@ export declare type Props = Readonly<{
|
|
|
15
15
|
contextId?: string;
|
|
16
16
|
featureFlags?: MediaFeatureFlags;
|
|
17
17
|
} & WithShowControlMethodProp>;
|
|
18
|
-
export
|
|
18
|
+
export type State = {
|
|
19
19
|
selectedItem: Identifier;
|
|
20
20
|
previewCount: number;
|
|
21
21
|
isArchiveSideBarVisible: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { SyntheticEvent } from 'react';
|
|
2
3
|
import { MediaClient, Identifier } from '@atlaskit/media-client';
|
|
3
4
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
4
5
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
5
6
|
import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
6
7
|
import { MediaViewerExtensions } from './components/types';
|
|
7
|
-
export
|
|
8
|
+
export type Props = {
|
|
8
9
|
onClose?: () => void;
|
|
9
10
|
selectedItem?: Identifier;
|
|
10
11
|
featureFlags?: MediaFeatureFlags;
|
|
@@ -25,7 +26,7 @@ export declare class MediaViewerComponent extends React.Component<Props & Wrappe
|
|
|
25
26
|
state: State;
|
|
26
27
|
UNSAFE_componentWillMount(): void;
|
|
27
28
|
onShortcutClosed: () => void;
|
|
28
|
-
onContentClose: (_e?:
|
|
29
|
+
onContentClose: (_e?: SyntheticEvent, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
29
30
|
private toggleSidebar;
|
|
30
31
|
private get defaultSelectedItem();
|
|
31
32
|
renderSidebar: () => JSX.Element | undefined;
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import { Identifier } from '@atlaskit/media-client';
|
|
4
4
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type NavigationDirection = 'prev' | 'next';
|
|
6
|
+
export type NavigationProps = Readonly<{
|
|
7
7
|
items: Identifier[];
|
|
8
8
|
selectedItem: Identifier;
|
|
9
9
|
onChange: (item: Identifier) => void;
|
|
@@ -11,7 +11,7 @@ export declare type NavigationProps = Readonly<{
|
|
|
11
11
|
}> & WithAnalyticsEventsProps;
|
|
12
12
|
export declare const nextNavButtonId = "media-viewer-navigation-next";
|
|
13
13
|
export declare const prevNavButtonId = "media-viewer-navigation-prev";
|
|
14
|
-
export
|
|
14
|
+
export type NavigationSource = 'keyboard' | 'mouse';
|
|
15
15
|
export declare class NavigationBase extends Component<NavigationProps, {}> {
|
|
16
16
|
private navigate;
|
|
17
17
|
get selectedIndex(): number;
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
4
4
|
import { MediaType } from '@atlaskit/media-client';
|
|
5
|
-
|
|
5
|
+
type Children = {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type ClassName = {
|
|
9
9
|
className: string;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type DataTestID = {
|
|
12
12
|
'data-testid'?: string | undefined;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
type BlanketProps = DataTestID & Children & ClassName;
|
|
15
15
|
export declare const Blanket: ({ "data-testid": datatestId, className, children, }: BlanketProps) => jsx.JSX.Element;
|
|
16
|
-
|
|
16
|
+
type HeaderWrapperProps = {
|
|
17
17
|
isArchiveSideBarVisible: boolean;
|
|
18
18
|
};
|
|
19
19
|
export declare const HeaderWrapper: {
|
|
@@ -26,7 +26,7 @@ export declare const ListWrapper: {
|
|
|
26
26
|
};
|
|
27
27
|
export declare const ArrowsWrapper: ({ children }: Children) => jsx.JSX.Element;
|
|
28
28
|
export declare const CloseButtonWrapper: ({ className, children, }: ClassName & Children) => jsx.JSX.Element;
|
|
29
|
-
|
|
29
|
+
type ContentWrapperProps = {
|
|
30
30
|
isSidebarVisible: boolean | undefined;
|
|
31
31
|
} & Children;
|
|
32
32
|
export declare const ContentWrapper: ({ isSidebarVisible, children, }: ContentWrapperProps) => jsx.JSX.Element;
|
|
@@ -35,14 +35,14 @@ export declare const ZoomControlsWrapper: ({ children }: Children) => jsx.JSX.El
|
|
|
35
35
|
export declare const ZoomLevelIndicator: ({ children }: Children) => jsx.JSX.Element;
|
|
36
36
|
export declare const HDIconGroupWrapper: ({ className, children, }: ClassName & Children) => jsx.JSX.Element;
|
|
37
37
|
export declare const HDIconWrapper: ({ children }: Children) => jsx.JSX.Element;
|
|
38
|
-
|
|
38
|
+
type ErrorMessageWrapperProps = DataTestID & Children;
|
|
39
39
|
export declare const ErrorMessageWrapper: ({ "data-testid": datatestId, children, }: ErrorMessageWrapperProps) => jsx.JSX.Element;
|
|
40
|
-
|
|
40
|
+
type ErrorImageProps = {
|
|
41
41
|
alt: string | undefined;
|
|
42
42
|
src: string;
|
|
43
43
|
};
|
|
44
44
|
export declare const ErrorImage: ({ src, alt }: ErrorImageProps) => jsx.JSX.Element;
|
|
45
|
-
|
|
45
|
+
type VideoProps = {
|
|
46
46
|
controls: boolean;
|
|
47
47
|
src: string;
|
|
48
48
|
autoPlay: boolean;
|
|
@@ -50,17 +50,17 @@ declare type VideoProps = {
|
|
|
50
50
|
export declare const Video: ({ autoPlay, controls, src }: VideoProps) => jsx.JSX.Element;
|
|
51
51
|
export declare const PDFWrapper: import("react").ForwardRefExoticComponent<DataTestID & Children & import("react").RefAttributes<unknown>>;
|
|
52
52
|
export declare const Arrow: ({ className, children }: ClassName & Children) => jsx.JSX.Element;
|
|
53
|
-
export
|
|
53
|
+
export type LeftWrapperProps = {
|
|
54
54
|
isArchiveSideBarVisible: boolean;
|
|
55
55
|
};
|
|
56
56
|
export declare const LeftWrapper: ({ children, isArchiveSideBarVisible, }: Children & LeftWrapperProps) => jsx.JSX.Element;
|
|
57
57
|
export declare const RightWrapper: ({ children }: Children) => jsx.JSX.Element;
|
|
58
|
-
export
|
|
58
|
+
export type HeaderProps = {
|
|
59
59
|
isArchiveSideBarVisible: boolean;
|
|
60
60
|
};
|
|
61
61
|
export declare const Header: ({ children, isArchiveSideBarVisible, className, }: Children & HeaderProps & ClassName) => jsx.JSX.Element;
|
|
62
62
|
export declare const LeftHeader: ({ children }: Children) => jsx.JSX.Element;
|
|
63
|
-
export
|
|
63
|
+
export type ImageWrapperProps = {
|
|
64
64
|
onClick: (event: MouseEvent<HTMLDivElement>) => void;
|
|
65
65
|
style: CSSProperties;
|
|
66
66
|
} & Children & DataTestID;
|
|
@@ -69,7 +69,7 @@ export declare const ImageWrapper: import("react").ForwardRefExoticComponent<{
|
|
|
69
69
|
style: CSSProperties;
|
|
70
70
|
} & Children & DataTestID & ClassName & import("react").RefAttributes<unknown>>;
|
|
71
71
|
export declare const BaselineExtend: () => jsx.JSX.Element;
|
|
72
|
-
export
|
|
72
|
+
export type ImgProps = {
|
|
73
73
|
canDrag: boolean;
|
|
74
74
|
isDragging: boolean;
|
|
75
75
|
shouldPixelate: boolean;
|
|
@@ -82,9 +82,9 @@ export declare type ImgProps = {
|
|
|
82
82
|
export declare const Img: ({ canDrag, isDragging, shouldPixelate, "data-testid": datatestId, src, style, onLoad, onError, onMouseDown, className, }: ImgProps) => jsx.JSX.Element;
|
|
83
83
|
export declare const MedatadataTextWrapper: ({ children }: Children) => jsx.JSX.Element;
|
|
84
84
|
export declare const MetadataWrapper: ({ children }: Children) => jsx.JSX.Element;
|
|
85
|
-
|
|
85
|
+
type MetadataFileNameProps = DataTestID & Children;
|
|
86
86
|
export declare const MetadataFileName: ({ "data-testid": datatestId, children, }: MetadataFileNameProps) => jsx.JSX.Element;
|
|
87
|
-
|
|
87
|
+
type MetadataSubTextProps = DataTestID & Children;
|
|
88
88
|
export declare const MetadataSubText: ({ "data-testid": datatestId, children, }: MetadataSubTextProps) => jsx.JSX.Element;
|
|
89
89
|
export declare const MetadataIconWrapper: ({ children }: Children) => jsx.JSX.Element;
|
|
90
90
|
export interface IconWrapperProps {
|
|
@@ -92,28 +92,28 @@ export interface IconWrapperProps {
|
|
|
92
92
|
}
|
|
93
93
|
export declare const RightHeader: ({ children }: Children) => jsx.JSX.Element;
|
|
94
94
|
export declare const CustomAudioPlayerWrapper: ({ children }: Children) => jsx.JSX.Element;
|
|
95
|
-
|
|
95
|
+
type AudioPlayerProps = DataTestID & Children;
|
|
96
96
|
export declare const AudioPlayer: {
|
|
97
97
|
({ "data-testid": datatestId, children, }: AudioPlayerProps): jsx.JSX.Element;
|
|
98
98
|
displayName: string;
|
|
99
99
|
};
|
|
100
|
-
|
|
100
|
+
type AudioProps = {
|
|
101
101
|
autoPlay: boolean;
|
|
102
102
|
controls: boolean;
|
|
103
103
|
src: string | undefined;
|
|
104
104
|
preload: string;
|
|
105
105
|
};
|
|
106
106
|
export declare const Audio: import("react").ForwardRefExoticComponent<AudioProps & import("react").RefAttributes<unknown>>;
|
|
107
|
-
|
|
107
|
+
type AudioCoverProps = {
|
|
108
108
|
alt: string | undefined;
|
|
109
109
|
src: string;
|
|
110
110
|
};
|
|
111
111
|
export declare const AudioCover: ({ src, alt }: AudioCoverProps) => jsx.JSX.Element;
|
|
112
112
|
export declare const DefaultCoverWrapper: ({ children }: Children) => jsx.JSX.Element;
|
|
113
113
|
export declare const DownloadButtonWrapper: ({ children }: Children) => jsx.JSX.Element;
|
|
114
|
-
|
|
114
|
+
type CustomVideoPlayerWrapperProps = DataTestID & Children;
|
|
115
115
|
export declare const CustomVideoPlayerWrapper: ({ "data-testid": datatestId, children, }: CustomVideoPlayerWrapperProps) => jsx.JSX.Element;
|
|
116
|
-
|
|
116
|
+
type SidebarWrapperProps = DataTestID & Children;
|
|
117
117
|
export declare const SidebarWrapper: ({ "data-testid": datatestId, children, }: SidebarWrapperProps) => jsx.JSX.Element;
|
|
118
118
|
export declare const SpinnerWrapper: ({ children }: Children) => jsx.JSX.Element;
|
|
119
119
|
export declare const FormattedMessageWrapper: ({ children }: Children) => jsx.JSX.Element;
|
package/dist/types/styles.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MediaType } from '@atlaskit/media-client';
|
|
2
2
|
export declare const blanketColor = "#22272B";
|
|
3
3
|
export declare const blanketStyles: import("@emotion/react").SerializedStyles;
|
|
4
|
-
export
|
|
4
|
+
export type HeaderWrapperProps = {
|
|
5
5
|
isArchiveSideBarVisible: boolean;
|
|
6
6
|
};
|
|
7
7
|
export declare const headerWrapperStyles: ({ isArchiveSideBarVisible, }: HeaderWrapperProps) => import("@emotion/react").SerializedStyles;
|
|
@@ -24,19 +24,19 @@ export declare const errorImageStyles: import("@emotion/react").SerializedStyles
|
|
|
24
24
|
export declare const videoStyles: import("@emotion/react").SerializedStyles;
|
|
25
25
|
export declare const pdfWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
26
26
|
export declare const arrowStyles: import("@emotion/react").SerializedStyles;
|
|
27
|
-
export
|
|
27
|
+
export type LeftWrapperProps = {
|
|
28
28
|
isArchiveSideBarVisible: boolean;
|
|
29
29
|
};
|
|
30
30
|
export declare const leftWrapperStyles: ({ isArchiveSideBarVisible, }: LeftWrapperProps) => import("@emotion/react").SerializedStyles;
|
|
31
31
|
export declare const rightWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
32
|
-
export
|
|
32
|
+
export type HeaderProps = {
|
|
33
33
|
isArchiveSideBarVisible: boolean;
|
|
34
34
|
};
|
|
35
35
|
export declare const headerStyles: ({ isArchiveSideBarVisible }: HeaderProps) => import("@emotion/react").SerializedStyles;
|
|
36
36
|
export declare const leftHeaderStyles: import("@emotion/react").SerializedStyles;
|
|
37
37
|
export declare const imageWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
38
38
|
export declare const baselineExtendStyles: import("@emotion/react").SerializedStyles;
|
|
39
|
-
export
|
|
39
|
+
export type ImgProps = {
|
|
40
40
|
cursor: string;
|
|
41
41
|
shouldPixelate: boolean;
|
|
42
42
|
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ZipEntry } from 'unzipit';
|
|
3
3
|
import { MediaClient } from '@atlaskit/media-client';
|
|
4
4
|
import { ArchiveViewerError } from '../../errors';
|
|
5
|
-
|
|
5
|
+
type Entries = {
|
|
6
6
|
[key: string]: ZipEntry;
|
|
7
7
|
};
|
|
8
8
|
export interface ArchiveSidebarFolderProps {
|
|
@@ -13,7 +13,7 @@ export interface ArchiveSidebarProps {
|
|
|
13
13
|
isArchiveEntryLoading: boolean;
|
|
14
14
|
onError: (error: ArchiveViewerError, entry?: ZipEntry) => void;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type ArchiveSidebarState = {
|
|
17
17
|
currentArchiveSidebarFolder: ArchiveSidebarFolderProps;
|
|
18
18
|
};
|
|
19
19
|
export declare class ArchiveSidebar extends React.Component<ArchiveSidebarProps, ArchiveSidebarState> {
|
|
@@ -6,8 +6,8 @@ import { BaseViewer } from '../base-viewer';
|
|
|
6
6
|
import { ArchiveViewerProps } from './types';
|
|
7
7
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
8
8
|
import { ArchiveViewerError } from '../../errors';
|
|
9
|
-
export
|
|
10
|
-
export
|
|
9
|
+
export type Props = ArchiveViewerProps & WithAnalyticsEventsProps;
|
|
10
|
+
export type Content = {
|
|
11
11
|
src?: string;
|
|
12
12
|
name?: string;
|
|
13
13
|
isDirectory?: boolean;
|
|
@@ -17,7 +17,7 @@ export declare type Content = {
|
|
|
17
17
|
codeViewerSrc?: string;
|
|
18
18
|
isCodeMimeType?: boolean;
|
|
19
19
|
};
|
|
20
|
-
export declare const getArchiveEntriesFromFileState: (fileState: FileState, mediaClient: MediaClient, collectionName?: string
|
|
20
|
+
export declare const getArchiveEntriesFromFileState: (fileState: FileState, mediaClient: MediaClient, collectionName?: string) => Promise<ZipInfo>;
|
|
21
21
|
export declare class ArchiveViewerBase extends BaseViewer<Content, Props> {
|
|
22
22
|
protected init(): Promise<void>;
|
|
23
23
|
protected get initialState(): {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ReactNode, MouseEvent, Key } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
|
|
4
|
+
type Children = {
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type OnClick = {
|
|
8
8
|
onClick: (event: MouseEvent<HTMLDivElement>) => void;
|
|
9
9
|
};
|
|
10
10
|
export declare const ArchiveItemViewerWrapper: ({ children }: Children) => jsx.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MediaClient, FileState, ErrorFileState } from '@atlaskit/media-client';
|
|
2
2
|
import { ArchiveViewerError } from '../../errors';
|
|
3
|
-
export
|
|
3
|
+
export type ArchiveViewerProps = {
|
|
4
4
|
item: Exclude<FileState, ErrorFileState>;
|
|
5
5
|
mediaClient: MediaClient;
|
|
6
6
|
collectionName?: string;
|
|
@@ -4,7 +4,7 @@ import { Outcome } from '../domain';
|
|
|
4
4
|
import { MediaViewerError } from '../errors';
|
|
5
5
|
import { BaseState, BaseViewer } from './base-viewer';
|
|
6
6
|
import { WithShowControlMethodProp } from '@atlaskit/media-ui';
|
|
7
|
-
export
|
|
7
|
+
export type Props = Readonly<{
|
|
8
8
|
item: FileState;
|
|
9
9
|
mediaClient: MediaClient;
|
|
10
10
|
collectionName?: string;
|
|
@@ -12,7 +12,7 @@ export declare type Props = Readonly<{
|
|
|
12
12
|
onCanPlay: () => void;
|
|
13
13
|
onError: (error: MediaViewerError) => void;
|
|
14
14
|
} & WithShowControlMethodProp>;
|
|
15
|
-
export
|
|
15
|
+
export type State = BaseState<string> & {
|
|
16
16
|
coverUrl?: string;
|
|
17
17
|
};
|
|
18
18
|
export declare class AudioViewer extends BaseViewer<string, Props, State> {
|
|
@@ -2,12 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { MediaClient, FileState } from '@atlaskit/media-client';
|
|
3
3
|
import { Outcome } from '../domain';
|
|
4
4
|
import { MediaViewerError } from '../errors';
|
|
5
|
-
export
|
|
5
|
+
export type BaseProps = {
|
|
6
6
|
mediaClient: MediaClient;
|
|
7
7
|
item: FileState;
|
|
8
8
|
collectionName?: string;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type BaseState<Content> = {
|
|
11
11
|
content: Outcome<Content, MediaViewerError>;
|
|
12
12
|
};
|
|
13
13
|
export declare abstract class BaseViewer<Content, Props extends BaseProps, State extends BaseState<Content> = BaseState<Content>> extends React.Component<Props, State> {
|
|
@@ -16,7 +16,7 @@ export declare abstract class BaseViewer<Content, Props extends BaseProps, State
|
|
|
16
16
|
componentWillUnmount(): void;
|
|
17
17
|
UNSAFE_componentWillReceiveProps(nextProps: Readonly<Props>): void;
|
|
18
18
|
componentDidUpdate(prevProps: Props): void;
|
|
19
|
-
render(): React.
|
|
19
|
+
render(): boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined;
|
|
20
20
|
private getInitialState;
|
|
21
21
|
private renderDownloadButton;
|
|
22
22
|
protected onMediaDisplayed: () => void;
|
|
@@ -10,7 +10,7 @@ export declare const CodeViewWrapper: ({ children, "data-testid": testId, }: {
|
|
|
10
10
|
'data-testid': string | undefined;
|
|
11
11
|
}) => jsx.JSX.Element;
|
|
12
12
|
export declare const CodeViewerHeaderBar: () => jsx.JSX.Element;
|
|
13
|
-
export
|
|
13
|
+
export type Props = {
|
|
14
14
|
item: Exclude<FileState, ErrorFileState>;
|
|
15
15
|
src: string;
|
|
16
16
|
language: SupportedLanguages;
|
|
@@ -19,7 +19,7 @@ export declare type Props = {
|
|
|
19
19
|
onSuccess?: () => void;
|
|
20
20
|
onError?: (error: MediaViewerError) => void;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type State = {
|
|
23
23
|
doc: Outcome<any, MediaViewerError>;
|
|
24
24
|
};
|
|
25
25
|
export declare class CodeViewRenderer extends Component<Props, State> {
|
|
@@ -4,7 +4,7 @@ import { Outcome } from '../../domain';
|
|
|
4
4
|
import { MediaViewerError } from '../../errors';
|
|
5
5
|
import { Props as RendererProps } from './codeViewerRenderer';
|
|
6
6
|
import { BaseViewer } from '../base-viewer';
|
|
7
|
-
export
|
|
7
|
+
export type Props = {
|
|
8
8
|
mediaClient: MediaClient;
|
|
9
9
|
item: Exclude<FileState, ErrorFileState>;
|
|
10
10
|
collectionName?: string;
|
|
@@ -4,7 +4,7 @@ import { MediaViewerError } from '../../errors';
|
|
|
4
4
|
import { Props as RendererProps } from './pdfRenderer';
|
|
5
5
|
import { ComponentClass } from 'react';
|
|
6
6
|
import { BaseViewer } from '../base-viewer';
|
|
7
|
-
export
|
|
7
|
+
export type Props = {
|
|
8
8
|
mediaClient: MediaClient;
|
|
9
9
|
item: FileState;
|
|
10
10
|
collectionName?: string;
|
|
@@ -12,7 +12,7 @@ export declare type Props = {
|
|
|
12
12
|
onError: (error: MediaViewerError) => void;
|
|
13
13
|
onSuccess: () => void;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type State = {
|
|
16
16
|
content: Outcome<string, MediaViewerError>;
|
|
17
17
|
};
|
|
18
18
|
export declare class DocViewer extends BaseViewer<string, Props> {
|
|
@@ -4,14 +4,14 @@ import { Outcome } from '../../domain';
|
|
|
4
4
|
import { MediaViewerError } from '../../errors';
|
|
5
5
|
import { ZoomLevel } from '../../domain/zoomLevel';
|
|
6
6
|
export declare const pdfViewerClassName = "pdfViewer";
|
|
7
|
-
export
|
|
7
|
+
export type Props = {
|
|
8
8
|
item: FileState;
|
|
9
9
|
src: string;
|
|
10
10
|
onClose?: () => void;
|
|
11
11
|
onSuccess?: () => void;
|
|
12
12
|
onError?: (error: MediaViewerError) => void;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type State = {
|
|
15
15
|
doc: Outcome<any, MediaViewerError>;
|
|
16
16
|
zoomLevel: ZoomLevel;
|
|
17
17
|
};
|
|
@@ -4,8 +4,8 @@ import { Outcome } from '../../domain';
|
|
|
4
4
|
import { MediaViewerError } from '../../errors';
|
|
5
5
|
import { BaseViewer } from '../base-viewer';
|
|
6
6
|
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type ObjectUrl = string;
|
|
8
|
+
export type ImageViewerProps = {
|
|
9
9
|
mediaClient: MediaClient;
|
|
10
10
|
item: FileState;
|
|
11
11
|
collectionName?: string;
|
|
@@ -4,7 +4,7 @@ import { WithShowControlMethodProp } from '@atlaskit/media-ui';
|
|
|
4
4
|
import { Outcome } from '../domain';
|
|
5
5
|
import { MediaViewerError } from '../errors';
|
|
6
6
|
import { BaseState, BaseViewer } from './base-viewer';
|
|
7
|
-
export
|
|
7
|
+
export type Props = Readonly<{
|
|
8
8
|
item: FileState;
|
|
9
9
|
mediaClient: MediaClient;
|
|
10
10
|
collectionName?: string;
|
|
@@ -12,7 +12,7 @@ export declare type Props = Readonly<{
|
|
|
12
12
|
onCanPlay: () => void;
|
|
13
13
|
onError: (error: MediaViewerError) => void;
|
|
14
14
|
} & WithShowControlMethodProp>;
|
|
15
|
-
export
|
|
15
|
+
export type State = BaseState<string> & {
|
|
16
16
|
isHDActive: boolean;
|
|
17
17
|
coverUrl?: string;
|
|
18
18
|
};
|
|
@@ -3,7 +3,7 @@ import { Component } from 'react';
|
|
|
3
3
|
import { ZoomLevel } from './domain/zoomLevel';
|
|
4
4
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
5
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
6
|
-
export
|
|
6
|
+
export type ZoomControlsProps = Readonly<{
|
|
7
7
|
onChange: (newZoomLevel: ZoomLevel) => void;
|
|
8
8
|
zoomLevel: ZoomLevel;
|
|
9
9
|
}> & WithAnalyticsEventsProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-viewer",
|
|
3
|
-
"version": "47.6.
|
|
3
|
+
"version": "47.6.1",
|
|
4
4
|
"description": "MediaViewer is Atlassian's powerful solution for viewing files on the web. It's both powerful and extendable yet easy-to-integrate",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
15
23
|
"sideEffects": false,
|
|
16
24
|
"atlaskit:src": "src/index.ts",
|
|
17
25
|
"af:exports": {
|
|
@@ -38,7 +46,7 @@
|
|
|
38
46
|
"@atlaskit/side-navigation": "^1.7.0",
|
|
39
47
|
"@atlaskit/spinner": "^15.5.0",
|
|
40
48
|
"@atlaskit/theme": "^12.5.0",
|
|
41
|
-
"@atlaskit/tokens": "^1.
|
|
49
|
+
"@atlaskit/tokens": "^1.4.0",
|
|
42
50
|
"@atlaskit/ufo": "^0.2.0",
|
|
43
51
|
"@babel/runtime": "^7.0.0",
|
|
44
52
|
"@kenjiuno/msgreader": "^1.2.6",
|
|
@@ -77,7 +85,7 @@
|
|
|
77
85
|
"react-dom": "^16.8.0",
|
|
78
86
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
79
87
|
"rxjs": "^5.5.0",
|
|
80
|
-
"typescript": "4.
|
|
88
|
+
"typescript": "~4.9.5",
|
|
81
89
|
"wait-for-expect": "^1.2.0"
|
|
82
90
|
},
|
|
83
91
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|