@atlaskit/media-client 23.2.0 → 24.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 +93 -74
- package/dist/cjs/client/file-fetcher/error.js +1 -2
- package/dist/cjs/client/file-fetcher/index.js +113 -38
- package/dist/cjs/client/media-client.js +20 -9
- package/dist/cjs/client/media-store/error.js +1 -2
- package/dist/cjs/client/media-store/index.js +5 -9
- package/dist/cjs/client/media-store/resolveAuth.js +4 -7
- package/dist/cjs/client/mobile-upload.js +40 -5
- package/dist/cjs/client/stargate-client.js +2 -3
- package/dist/cjs/constants.js +6 -12
- package/dist/cjs/file-streams-cache.js +3 -5
- package/dist/cjs/globalMediaEventEmitter.js +2 -3
- package/dist/cjs/identifier.js +4 -7
- package/dist/cjs/index.js +17 -20
- package/dist/cjs/models/artifacts.js +2 -3
- package/dist/cjs/models/errors/index.js +2 -3
- package/dist/cjs/models/file-state.js +10 -19
- package/dist/cjs/models/media.js +3 -5
- package/dist/cjs/test-helpers/authProvider.js +2 -3
- package/dist/cjs/test-helpers/collectionNames.js +5 -10
- package/dist/cjs/test-helpers/exampleMediaItems.js +48 -91
- package/dist/cjs/test-helpers/fakeMediaClient.js +3 -5
- package/dist/cjs/test-helpers/index.js +1 -2
- package/dist/cjs/test-helpers/mediaClientProvider.js +7 -13
- package/dist/cjs/test-helpers/mediaPickerAuthProvider.js +4 -7
- package/dist/cjs/upload-controller.js +2 -3
- package/dist/cjs/uploader/calculateChunkSize.js +4 -5
- package/dist/cjs/uploader/error.js +1 -2
- package/dist/cjs/uploader/index.js +3 -4
- package/dist/cjs/utils/checkWebpSupport.js +2 -3
- package/dist/cjs/utils/convertBase64ToBlob.js +2 -3
- package/dist/cjs/utils/createFileDataLoader.js +2 -4
- package/dist/cjs/utils/detectEmptyFile.js +2 -2
- package/dist/cjs/utils/getDimensionsFromBlob.js +2 -3
- package/dist/cjs/utils/getImageDimensionsFromBlob.js +2 -3
- package/dist/cjs/utils/getMediaTypeFromUploadableFile.js +2 -3
- package/dist/cjs/utils/getVideoDimensionsFromBlob.js +2 -3
- package/dist/cjs/utils/hashing/hasherCreator.js +3 -5
- package/dist/cjs/utils/hashing/simpleHasher.js +4 -4
- package/dist/cjs/utils/hashing/workerHasher.js +2 -3
- package/dist/cjs/utils/imageResizeModeToFileImageMode.js +2 -3
- package/dist/cjs/utils/isImageRemote.js +2 -3
- package/dist/cjs/utils/mediaSubscribable/toPromise.js +2 -3
- package/dist/cjs/utils/mobileUpload/error.js +1 -2
- package/dist/cjs/utils/mobileUpload/helpers.js +3 -5
- package/dist/cjs/utils/mobileUpload/stateMachine/index.js +1 -2
- package/dist/cjs/utils/mobileUpload/stateMachine/states/error.js +2 -3
- package/dist/cjs/utils/mobileUpload/stateMachine/states/processed.js +2 -3
- package/dist/cjs/utils/mobileUpload/stateMachine/states/processing.js +2 -3
- package/dist/cjs/utils/mobileUpload/stateMachine/states/processingFailed.js +2 -3
- package/dist/cjs/utils/mobileUpload/stateMachine/states/uploading.js +2 -3
- package/dist/cjs/utils/overrideMediaTypeIfUnknown.js +2 -3
- package/dist/cjs/utils/polling/errors.js +1 -2
- package/dist/cjs/utils/polling/index.js +3 -5
- package/dist/cjs/utils/request/errors.js +1 -2
- package/dist/cjs/utils/request/helpers.js +4 -5
- package/dist/cjs/utils/safeUnsubscribe.js +2 -3
- package/dist/cjs/utils/setTimeoutPromise.js +3 -5
- package/dist/cjs/utils/url.js +5 -9
- package/dist/cjs/utils/with-media-client-hoc.js +9 -19
- package/dist/es2019/client/file-fetcher/index.js +101 -28
- package/dist/es2019/client/media-client.js +15 -7
- package/dist/es2019/client/media-store/index.js +1 -2
- package/dist/es2019/client/mobile-upload.js +33 -2
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/utils/hashing/simpleHasher.js +2 -1
- package/dist/es2019/utils/request/helpers.js +1 -1
- package/dist/es2019/utils/with-media-client-hoc.js +8 -16
- package/dist/esm/client/file-fetcher/index.js +107 -31
- package/dist/esm/client/media-client.js +19 -7
- package/dist/esm/client/media-store/index.js +1 -2
- package/dist/esm/client/mobile-upload.js +38 -2
- package/dist/esm/index.js +1 -0
- package/dist/esm/uploader/index.js +2 -2
- package/dist/esm/utils/hashing/simpleHasher.js +2 -1
- package/dist/esm/utils/request/helpers.js +1 -1
- package/dist/esm/utils/with-media-client-hoc.js +8 -16
- package/dist/types/client/events.d.ts +1 -1
- package/dist/types/client/file-fetcher/index.d.ts +10 -6
- package/dist/types/client/media-client.d.ts +10 -5
- package/dist/types/client/media-store/index.d.ts +3 -4
- package/dist/types/client/mobile-upload.d.ts +6 -2
- package/dist/types/file-streams-cache.d.ts +1 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/models/artifacts.d.ts +1 -14
- package/dist/types/models/file-state.d.ts +4 -73
- package/dist/types/models/media.d.ts +1 -1
- package/dist/types/models/mobile-upload.d.ts +1 -1
- package/dist/types/utils/createMediaSubject.d.ts +1 -1
- package/dist/types/utils/mediaSubscribable/fromObservable.d.ts +1 -1
- package/dist/types/utils/mediaSubscribable/toPromise.d.ts +1 -1
- package/dist/types/utils/mediaSubscribable/types.d.ts +1 -1
- package/dist/types/utils/mobileUpload/helpers.d.ts +1 -1
- package/dist/types/utils/mobileUpload/stateMachine/index.d.ts +1 -1
- package/dist/types/utils/mobileUpload/stateMachine/types.d.ts +1 -1
- package/dist/types/utils/overrideMediaTypeIfUnknown.d.ts +1 -1
- package/dist/types/utils/shouldFetchRemoteFileStates.d.ts +1 -1
- package/dist/types/utils/with-media-client-hoc.d.ts +2 -3
- package/package.json +5 -3
- package/report.api.md +51 -168
- package/dist/types-ts4.5/client/__mocks__/collection-fetcher.d.ts +0 -8
- package/dist/types-ts4.5/client/__mocks__/file-fetcher.d.ts +0 -10
- package/dist/types-ts4.5/client/__mocks__/media-client.d.ts +0 -11
- package/dist/types-ts4.5/client/events.d.ts +0 -14
- package/dist/types-ts4.5/client/file-fetcher/error.d.ts +0 -29
- package/dist/types-ts4.5/client/file-fetcher/index.d.ts +0 -58
- package/dist/types-ts4.5/client/media-client.d.ts +0 -27
- package/dist/types-ts4.5/client/media-store/error.d.ts +0 -16
- package/dist/types-ts4.5/client/media-store/index.d.ts +0 -169
- package/dist/types-ts4.5/client/media-store/resolveAuth.d.ts +0 -4
- package/dist/types-ts4.5/client/mobile-upload.d.ts +0 -11
- package/dist/types-ts4.5/client/stargate-client.d.ts +0 -15
- package/dist/types-ts4.5/constants.d.ts +0 -6
- package/dist/types-ts4.5/file-streams-cache.d.ts +0 -15
- package/dist/types-ts4.5/globalMediaEventEmitter.d.ts +0 -6
- package/dist/types-ts4.5/identifier.d.ts +0 -15
- package/dist/types-ts4.5/index.d.ts +0 -87
- package/dist/types-ts4.5/models/artifacts.d.ts +0 -15
- package/dist/types-ts4.5/models/auth-headers.d.ts +0 -11
- package/dist/types-ts4.5/models/auth-query-parameters.d.ts +0 -11
- package/dist/types-ts4.5/models/errors/helpers.d.ts +0 -6
- package/dist/types-ts4.5/models/errors/index.d.ts +0 -11
- package/dist/types-ts4.5/models/errors/types.d.ts +0 -15
- package/dist/types-ts4.5/models/file-state.d.ts +0 -94
- package/dist/types-ts4.5/models/item.d.ts +0 -25
- package/dist/types-ts4.5/models/media.d.ts +0 -48
- package/dist/types-ts4.5/models/mobile-upload.d.ts +0 -28
- package/dist/types-ts4.5/test-helpers/_numbers.d.ts +0 -1
- package/dist/types-ts4.5/test-helpers/authProvider.d.ts +0 -6
- package/dist/types-ts4.5/test-helpers/collectionNames.d.ts +0 -5
- package/dist/types-ts4.5/test-helpers/exampleMediaItems.d.ts +0 -53
- package/dist/types-ts4.5/test-helpers/fakeMediaClient.d.ts +0 -4
- package/dist/types-ts4.5/test-helpers/index.d.ts +0 -7
- package/dist/types-ts4.5/test-helpers/mediaClientProvider.d.ts +0 -23
- package/dist/types-ts4.5/test-helpers/mediaPickerAuthProvider.d.ts +0 -5
- package/dist/types-ts4.5/upload-controller.d.ts +0 -7
- package/dist/types-ts4.5/uploader/calculateChunkSize.d.ts +0 -11
- package/dist/types-ts4.5/uploader/error.d.ts +0 -29
- package/dist/types-ts4.5/uploader/index.d.ts +0 -23
- package/dist/types-ts4.5/utils/checkWebpSupport.d.ts +0 -1
- package/dist/types-ts4.5/utils/convertBase64ToBlob.d.ts +0 -1
- package/dist/types-ts4.5/utils/createFileDataLoader.d.ts +0 -30
- package/dist/types-ts4.5/utils/createMediaSubject.d.ts +0 -3
- package/dist/types-ts4.5/utils/detectEmptyFile.d.ts +0 -16
- package/dist/types-ts4.5/utils/getDimensionsFromBlob.d.ts +0 -6
- package/dist/types-ts4.5/utils/getImageDimensionsFromBlob.d.ts +0 -5
- package/dist/types-ts4.5/utils/getMediaTypeFromUploadableFile.d.ts +0 -3
- package/dist/types-ts4.5/utils/getVideoDimensionsFromBlob.d.ts +0 -5
- package/dist/types-ts4.5/utils/hashing/hasher.d.ts +0 -3
- package/dist/types-ts4.5/utils/hashing/hasherCreator.d.ts +0 -3
- package/dist/types-ts4.5/utils/hashing/simpleHasher.d.ts +0 -4
- package/dist/types-ts4.5/utils/hashing/workerHasher.d.ts +0 -16
- package/dist/types-ts4.5/utils/imageResizeModeToFileImageMode.d.ts +0 -3
- package/dist/types-ts4.5/utils/isImageRemote.d.ts +0 -1
- package/dist/types-ts4.5/utils/mediaSubscribable/fromObservable.d.ts +0 -5
- package/dist/types-ts4.5/utils/mediaSubscribable/index.d.ts +0 -3
- package/dist/types-ts4.5/utils/mediaSubscribable/toPromise.d.ts +0 -10
- package/dist/types-ts4.5/utils/mediaSubscribable/types.d.ts +0 -17
- package/dist/types-ts4.5/utils/mobileUpload/error.d.ts +0 -29
- package/dist/types-ts4.5/utils/mobileUpload/helpers.d.ts +0 -8
- package/dist/types-ts4.5/utils/mobileUpload/index.d.ts +0 -5
- package/dist/types-ts4.5/utils/mobileUpload/servicesCache.d.ts +0 -4
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/index.d.ts +0 -7
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/error.d.ts +0 -3
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/processed.d.ts +0 -3
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/processing.d.ts +0 -3
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/processingFailed.d.ts +0 -3
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/uploading.d.ts +0 -3
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/types.d.ts +0 -69
- package/dist/types-ts4.5/utils/overrideMediaTypeIfUnknown.d.ts +0 -5
- package/dist/types-ts4.5/utils/polling/errors.d.ts +0 -12
- package/dist/types-ts4.5/utils/polling/index.d.ts +0 -33
- package/dist/types-ts4.5/utils/polling/types.d.ts +0 -7
- package/dist/types-ts4.5/utils/request/errors.d.ts +0 -20
- package/dist/types-ts4.5/utils/request/helpers.d.ts +0 -46
- package/dist/types-ts4.5/utils/request/index.d.ts +0 -5
- package/dist/types-ts4.5/utils/request/types.d.ts +0 -46
- package/dist/types-ts4.5/utils/safeUnsubscribe.d.ts +0 -2
- package/dist/types-ts4.5/utils/setTimeoutPromise.d.ts +0 -2
- package/dist/types-ts4.5/utils/shouldFetchRemoteFileStates.d.ts +0 -14
- package/dist/types-ts4.5/utils/url.d.ts +0 -17
- package/dist/types-ts4.5/utils/with-media-client-hoc.d.ts +0 -16
- package/tmp/api-report-tmp.d.ts +0 -1334
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import { MediaStore } from '@atlaskit/media-state';
|
|
1
2
|
import { MobileUpload, MobileUploadStartEvent, MobileUploadProgressEvent, MobileUploadEndEvent, MobileUploadErrorEvent } from '../models/mobile-upload';
|
|
2
|
-
import { MediaStore } from './media-store';
|
|
3
|
+
import { MediaStore as MediaApi } from './media-store';
|
|
3
4
|
export declare class MobileUploadImpl implements MobileUpload {
|
|
5
|
+
private readonly store;
|
|
4
6
|
private readonly dataloader;
|
|
5
7
|
private readonly servicesCache;
|
|
6
|
-
constructor(
|
|
8
|
+
constructor(mediaApi: MediaApi, store?: MediaStore);
|
|
7
9
|
notifyUploadStart(event: MobileUploadStartEvent): void;
|
|
8
10
|
notifyUploadProgress(event: MobileUploadProgressEvent): void;
|
|
9
11
|
notifyUploadEnd(event: MobileUploadEndEvent): void;
|
|
10
12
|
notifyUploadError(event: MobileUploadErrorEvent): void;
|
|
13
|
+
private getErrorFileState;
|
|
14
|
+
private setFileState;
|
|
11
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LRUMap } from 'lru_map';
|
|
2
2
|
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
3
|
-
import { FileState } from '
|
|
3
|
+
import { FileState } from '@atlaskit/media-state';
|
|
4
4
|
export declare class StreamsCache<T> {
|
|
5
5
|
private readonly streams;
|
|
6
6
|
constructor(streams: LRUMap<string, ReplaySubject<T>>);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ export type { MediaItemType, FileItem, FileProcessingStatus, MediaArtifact, Arti
|
|
|
6
6
|
export { isPreviewableType } from './models/media';
|
|
7
7
|
export type { MediaFileProcessingStatus, MediaType, MediaFile, MediaRepresentations, MediaItemDetails, MediaUpload, MediaChunksProbe, } from './models/media';
|
|
8
8
|
export { getArtifactUrl } from './models/artifacts';
|
|
9
|
-
export type { MediaFileArtifact, MediaFileArtifacts } from './models/artifacts';
|
|
10
9
|
export { isMediaClientError, getMediaClientErrorReason } from './models/errors';
|
|
11
10
|
export type { MediaClientError, MediaClientErrorReason, MediaClientErrorAttributes, } from './models/errors';
|
|
12
11
|
export { isUploadingFileState, isProcessingFileState, isProcessedFileState, isErrorFileState, isPreviewableFileState, isFinalFileState, isImageRepresentationReady, mapMediaFileToFileState, mapMediaItemToFileState, } from './models/file-state';
|
|
13
|
-
export type { FileStatus,
|
|
12
|
+
export type { FileStatus, PreviewOptions, GetFileOptions, NonErrorFileState, PreviewableFileState, } from './models/file-state';
|
|
13
|
+
export type { FileState, FilePreview, ErrorFileState, UploadingFileState, ProcessingFileState, ProcessedFileState, ProcessingFailedState, MediaFileArtifact, MediaFileArtifacts, } from '@atlaskit/media-state';
|
|
14
14
|
export type { MobileUpload, MobileUploadStartEvent, MobileUploadProgressEvent, MobileUploadEndEvent, MobileUploadErrorEvent, } from './models/mobile-upload';
|
|
15
15
|
export { uploadFile } from './uploader';
|
|
16
16
|
export type { UploadableFile, UploadableFileUpfrontIds, UploadFileCallbacks, UploadFileResult, } from './uploader';
|
|
@@ -39,12 +39,14 @@ export type { Identifier, FileIdentifier, ExternalImageIdentifier, } from './ide
|
|
|
39
39
|
export type { EventPayloadListener, UploadEventPayloadMap, MediaViewedEventPayload, } from './client/events';
|
|
40
40
|
export { withMediaClient, getMediaClient } from './utils/with-media-client-hoc';
|
|
41
41
|
export type { WithMediaClientConfig, WithMediaClientConfigProps, WithMediaClientFunction, WithMediaClient, } from './utils/with-media-client-hoc';
|
|
42
|
+
export type { MediaClientConfig } from '@atlaskit/media-core';
|
|
42
43
|
export { globalMediaEventEmitter } from './globalMediaEventEmitter';
|
|
43
44
|
export { isMediaBlobUrl, getAttrsFromUrl, addFileAttrsToUrl, objectToQueryString, } from './utils/url';
|
|
44
45
|
export type { MediaBlobUrlAttrs } from './utils/url';
|
|
45
46
|
export { createMediaSubscribable, fromObservable, } from './utils/mediaSubscribable';
|
|
46
47
|
export type { MediaSubscribable, MediaSubscription, MediaObserver, } from './utils/mediaSubscribable';
|
|
47
48
|
export { RECENTS_COLLECTION, MAX_RESOLUTION } from './constants';
|
|
49
|
+
export { getFileStreamsCache } from './file-streams-cache';
|
|
48
50
|
/**
|
|
49
51
|
* @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
|
|
50
52
|
*/
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export type MediaFileArtifact = {
|
|
3
|
-
readonly url: string;
|
|
4
|
-
readonly processingStatus: MediaFileProcessingStatus;
|
|
5
|
-
};
|
|
6
|
-
export interface MediaFileArtifacts {
|
|
7
|
-
'video_1280.mp4'?: MediaFileArtifact;
|
|
8
|
-
'video_640.mp4'?: MediaFileArtifact;
|
|
9
|
-
'document.pdf'?: MediaFileArtifact;
|
|
10
|
-
'audio.mp3'?: MediaFileArtifact;
|
|
11
|
-
'thumb.jpg'?: MediaFileArtifact;
|
|
12
|
-
'image.png'?: MediaFileArtifact;
|
|
13
|
-
'image.jpg'?: MediaFileArtifact;
|
|
14
|
-
}
|
|
1
|
+
import { MediaFileArtifacts } from '@atlaskit/media-state';
|
|
15
2
|
export declare const getArtifactUrl: (artifacts: MediaFileArtifacts, prop: keyof MediaFileArtifacts) => string | undefined;
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import { FileStatus as CommonFileStatus
|
|
1
|
+
import { FileStatus as CommonFileStatus } from '@atlaskit/media-common';
|
|
2
2
|
import { MediaStoreResponse } from '../client/media-store';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export type BaseFileState = {
|
|
6
|
-
metadataTraceContext?: MediaTraceContext;
|
|
7
|
-
};
|
|
3
|
+
import { MediaItemDetails, MediaFile } from './media';
|
|
4
|
+
import { FilePreview, FileState, ErrorFileState, UploadingFileState, ProcessingFileState, ProcessedFileState, ProcessingFailedState } from '@atlaskit/media-state';
|
|
8
5
|
export type FileStatus = CommonFileStatus;
|
|
9
|
-
export interface FilePreview {
|
|
10
|
-
value: Blob | string;
|
|
11
|
-
origin?: 'local' | 'remote';
|
|
12
|
-
originalDimensions?: {
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
6
|
export interface PreviewOptions {
|
|
18
7
|
}
|
|
19
8
|
export interface GetFileOptions {
|
|
@@ -21,74 +10,16 @@ export interface GetFileOptions {
|
|
|
21
10
|
collectionName?: string;
|
|
22
11
|
occurrenceKey?: string;
|
|
23
12
|
}
|
|
24
|
-
export interface UploadingFileState extends BaseFileState {
|
|
25
|
-
status: 'uploading';
|
|
26
|
-
id: string;
|
|
27
|
-
occurrenceKey?: string;
|
|
28
|
-
name: string;
|
|
29
|
-
size: number;
|
|
30
|
-
progress: number;
|
|
31
|
-
mediaType: MediaType;
|
|
32
|
-
mimeType: string;
|
|
33
|
-
preview?: FilePreview | Promise<FilePreview>;
|
|
34
|
-
createdAt?: number;
|
|
35
|
-
}
|
|
36
13
|
export interface PreviewableFileState {
|
|
37
14
|
preview: FilePreview | Promise<FilePreview>;
|
|
38
15
|
}
|
|
39
|
-
export interface ProcessingFileState extends BaseFileState {
|
|
40
|
-
status: 'processing';
|
|
41
|
-
id: string;
|
|
42
|
-
occurrenceKey?: string;
|
|
43
|
-
name: string;
|
|
44
|
-
size: number;
|
|
45
|
-
artifacts?: MediaFileArtifacts;
|
|
46
|
-
mediaType: MediaType;
|
|
47
|
-
mimeType: string;
|
|
48
|
-
preview?: FilePreview | Promise<FilePreview>;
|
|
49
|
-
representations?: MediaRepresentations;
|
|
50
|
-
createdAt?: number;
|
|
51
|
-
}
|
|
52
|
-
export interface ProcessedFileState extends BaseFileState {
|
|
53
|
-
status: 'processed';
|
|
54
|
-
id: string;
|
|
55
|
-
occurrenceKey?: string;
|
|
56
|
-
name: string;
|
|
57
|
-
size: number;
|
|
58
|
-
artifacts: MediaFileArtifacts;
|
|
59
|
-
mediaType: MediaType;
|
|
60
|
-
mimeType: string;
|
|
61
|
-
preview?: FilePreview | Promise<FilePreview>;
|
|
62
|
-
representations?: MediaRepresentations;
|
|
63
|
-
createdAt?: number;
|
|
64
|
-
}
|
|
65
|
-
export interface ProcessingFailedState extends BaseFileState {
|
|
66
|
-
status: 'failed-processing';
|
|
67
|
-
id: string;
|
|
68
|
-
occurrenceKey?: string;
|
|
69
|
-
name: string;
|
|
70
|
-
size: number;
|
|
71
|
-
artifacts: Object;
|
|
72
|
-
mediaType: MediaType;
|
|
73
|
-
mimeType: string;
|
|
74
|
-
preview?: FilePreview | Promise<FilePreview>;
|
|
75
|
-
representations?: MediaRepresentations;
|
|
76
|
-
createdAt?: number;
|
|
77
|
-
}
|
|
78
|
-
export interface ErrorFileState extends BaseFileState {
|
|
79
|
-
status: 'error';
|
|
80
|
-
id: string;
|
|
81
|
-
occurrenceKey?: string;
|
|
82
|
-
message?: string;
|
|
83
|
-
}
|
|
84
|
-
export type FileState = UploadingFileState | ProcessingFileState | ProcessedFileState | ErrorFileState | ProcessingFailedState;
|
|
85
16
|
export type NonErrorFileState = Exclude<FileState, ErrorFileState>;
|
|
86
17
|
export declare const isUploadingFileState: (fileState: FileState) => fileState is UploadingFileState;
|
|
87
18
|
export declare const isProcessingFileState: (fileState: FileState) => fileState is ProcessingFileState;
|
|
88
19
|
export declare const isProcessedFileState: (fileState: FileState) => fileState is ProcessedFileState;
|
|
89
20
|
export declare const isErrorFileState: (fileState: FileState) => fileState is ErrorFileState;
|
|
90
21
|
export declare const isPreviewableFileState: (fileState: FileState) => fileState is (UploadingFileState | ProcessingFileState | ProcessedFileState | ProcessingFailedState) & PreviewableFileState;
|
|
91
|
-
export declare const isFinalFileState: (fileState: FileState) => fileState is ProcessedFileState |
|
|
22
|
+
export declare const isFinalFileState: (fileState: FileState) => fileState is ProcessedFileState | ErrorFileState | ProcessingFailedState;
|
|
92
23
|
export declare const isImageRepresentationReady: (fileState: FileState) => boolean;
|
|
93
24
|
export declare const mapMediaFileToFileState: (mediaFile: MediaStoreResponse<MediaFile>) => FileState;
|
|
94
25
|
export declare const mapMediaItemToFileState: (id: string, item: MediaItemDetails) => FileState;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MediaTraceContext, MediaType } from '@atlaskit/media-common';
|
|
2
|
-
import
|
|
2
|
+
import { MediaFileArtifacts } from '@atlaskit/media-state';
|
|
3
3
|
export type MediaFileProcessingStatus = 'pending' | 'succeeded' | 'failed';
|
|
4
4
|
export type { MediaType } from '@atlaskit/media-common';
|
|
5
5
|
export declare const isPreviewableType: (type: MediaType) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
2
|
-
import { FileState } from '
|
|
2
|
+
import { FileState } from '@atlaskit/media-state';
|
|
3
3
|
import { MediaSubscribable } from './types';
|
|
4
4
|
export declare function fromObservable(observable: ReplaySubject<FileState>): MediaSubscribable;
|
|
5
5
|
export declare function createMediaSubscribable(item?: FileState | Error): MediaSubscribable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Subscription } from 'rxjs/Subscription';
|
|
2
2
|
import { MediaSubscribable } from './types';
|
|
3
|
-
import { FileState } from '
|
|
3
|
+
import { FileState } from '@atlaskit/media-state';
|
|
4
4
|
/**
|
|
5
5
|
* This is a helper to transform the first value emitted by an MediaSubscribable into a Promise.
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Dataloader from 'dataloader';
|
|
2
2
|
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
3
3
|
import { Interpreter } from 'xstate';
|
|
4
|
-
import { FileState } from '
|
|
4
|
+
import { FileState } from '@atlaskit/media-state';
|
|
5
5
|
import { DataloaderKey, DataloaderResult } from '../createFileDataLoader';
|
|
6
6
|
import { StateMachineContext, StateMachineEvent, StateMachineTypestate } from './stateMachine/types';
|
|
7
7
|
export declare const createMobileFileStateSubject: (service: Interpreter<StateMachineContext, any, StateMachineEvent, StateMachineTypestate>) => ReplaySubject<FileState>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import DataLoader from 'dataloader';
|
|
2
2
|
import { Interpreter, StateMachine } from 'xstate';
|
|
3
|
-
import { UploadingFileState } from '
|
|
3
|
+
import { UploadingFileState } from '@atlaskit/media-state';
|
|
4
4
|
import { DataloaderKey, DataloaderResult } from '../../createFileDataLoader';
|
|
5
5
|
import { StateMachineContext, StateMachineEvent, StateMachineSchema, StateMachineTypestate } from './types';
|
|
6
6
|
export declare const createMobileUploadStateMachine: (dataloader: DataLoader<DataloaderKey, DataloaderResult>, initialState: UploadingFileState, collectionName?: string) => StateMachine<StateMachineContext, any, StateMachineEvent, StateMachineTypestate>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StateSchema } from 'xstate';
|
|
2
|
-
import { FileState, UploadingFileState, ProcessingFileState, ProcessedFileState, ErrorFileState, ProcessingFailedState } from '
|
|
2
|
+
import { FileState, UploadingFileState, ProcessingFileState, ProcessedFileState, ErrorFileState, ProcessingFailedState } from '@atlaskit/media-state';
|
|
3
3
|
export type StateMachineContext = {
|
|
4
4
|
currentFileState: FileState;
|
|
5
5
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileState } from '
|
|
1
|
+
import { FileState } from '@atlaskit/media-state';
|
|
2
2
|
import { MediaType } from '../models/media';
|
|
3
3
|
export declare const overrideMediaTypeIfUnknown: (fileState: FileState, mediaType?: MediaType) => {
|
|
4
4
|
mediaType?: MediaType | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MediaClientConfig } from '@atlaskit/media-core';
|
|
3
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
4
3
|
import { MediaClient } from '../client/media-client';
|
|
5
4
|
import { Identifier } from '../identifier';
|
|
6
5
|
export interface WithMediaClientConfig {
|
|
@@ -10,7 +9,7 @@ export interface WithMediaClient {
|
|
|
10
9
|
mediaClient: MediaClient;
|
|
11
10
|
identifier?: Identifier;
|
|
12
11
|
}
|
|
13
|
-
export declare const getMediaClient: (mediaClientConfig: MediaClientConfig
|
|
12
|
+
export declare const getMediaClient: (mediaClientConfig: MediaClientConfig) => MediaClient;
|
|
14
13
|
export type WithMediaClientConfigProps<P extends WithMediaClient> = Omit<P, 'mediaClient'> & WithMediaClientConfig;
|
|
15
|
-
export type WithMediaClientFunction = <P extends WithMediaClient>(Component: React.ComponentType<P
|
|
14
|
+
export type WithMediaClientFunction = <P extends WithMediaClient>(Component: React.ComponentType<P>) => React.ComponentType<WithMediaClientConfigProps<P>>;
|
|
16
15
|
export declare const withMediaClient: WithMediaClientFunction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.0.1",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@atlaskit/chunkinator": "^4.2.0",
|
|
40
|
-
"@atlaskit/media-common": "^
|
|
40
|
+
"@atlaskit/media-common": "^9.0.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
42
42
|
"dataloader": "^2.0.0",
|
|
43
43
|
"deep-equal": "^1.0.1",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@atlaskit/media-core": "^34.1.2",
|
|
55
|
+
"@atlaskit/media-state": "^1.0.0",
|
|
55
56
|
"@emotion/react": "^11.7.1",
|
|
56
57
|
"enzyme": ">=3.10.0",
|
|
57
58
|
"react": "^16.8.0"
|
|
@@ -64,8 +65,9 @@
|
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@atlaskit/media-core": "^34.1.0",
|
|
68
|
+
"@atlaskit/media-state": "^1.0.0",
|
|
67
69
|
"@atlaskit/ssr": "*",
|
|
68
|
-
"@atlaskit/tokens": "^1.
|
|
70
|
+
"@atlaskit/tokens": "^1.25.0",
|
|
69
71
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
70
72
|
"@emotion/react": "^11.7.1",
|
|
71
73
|
"@types/deep-equal": "^1.0.1",
|
package/report.api.md
CHANGED
|
@@ -21,14 +21,24 @@ import { AuthContext } from '@atlaskit/media-core';
|
|
|
21
21
|
import { AuthProvider } from '@atlaskit/media-core';
|
|
22
22
|
import { ChunkinatorFile } from '@atlaskit/chunkinator';
|
|
23
23
|
import { ClientAltBasedAuth } from '@atlaskit/media-core';
|
|
24
|
+
import { ErrorFileState } from '@atlaskit/media-state';
|
|
25
|
+
import { FilePreview } from '@atlaskit/media-state';
|
|
26
|
+
import { FileState } from '@atlaskit/media-state';
|
|
24
27
|
import { FileStatus as FileStatus_2 } from '@atlaskit/media-common';
|
|
28
|
+
import { LRUMap } from 'lru_map';
|
|
25
29
|
import { MediaApiConfig } from '@atlaskit/media-core';
|
|
26
30
|
import { MediaClientConfig } from '@atlaskit/media-core';
|
|
27
|
-
import {
|
|
31
|
+
import { MediaFileArtifact } from '@atlaskit/media-state';
|
|
32
|
+
import { MediaFileArtifacts } from '@atlaskit/media-state';
|
|
33
|
+
import { MediaStore as MediaStore_2 } from '@atlaskit/media-state';
|
|
28
34
|
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
29
35
|
import { MediaType } from '@atlaskit/media-common';
|
|
36
|
+
import { ProcessedFileState } from '@atlaskit/media-state';
|
|
37
|
+
import { ProcessingFailedState } from '@atlaskit/media-state';
|
|
38
|
+
import { ProcessingFileState } from '@atlaskit/media-state';
|
|
30
39
|
import { default as React_2 } from 'react';
|
|
31
40
|
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
41
|
+
import { UploadingFileState } from '@atlaskit/media-state';
|
|
32
42
|
|
|
33
43
|
// @public (undocumented)
|
|
34
44
|
export type AbortFunction = () => void;
|
|
@@ -51,11 +61,6 @@ export type Artifacts = {
|
|
|
51
61
|
[name: string]: MediaArtifact;
|
|
52
62
|
};
|
|
53
63
|
|
|
54
|
-
// @public (undocumented)
|
|
55
|
-
type BaseFileState = {
|
|
56
|
-
metadataTraceContext?: MediaTraceContext;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
64
|
// @public
|
|
60
65
|
abstract class BaseMediaClientError<
|
|
61
66
|
Attributes extends MediaClientErrorAttributes,
|
|
@@ -170,17 +175,7 @@ export interface EmptyFile {
|
|
|
170
175
|
readonly id: string;
|
|
171
176
|
}
|
|
172
177
|
|
|
173
|
-
|
|
174
|
-
export interface ErrorFileState extends BaseFileState {
|
|
175
|
-
// (undocumented)
|
|
176
|
-
id: string;
|
|
177
|
-
// (undocumented)
|
|
178
|
-
message?: string;
|
|
179
|
-
// (undocumented)
|
|
180
|
-
occurrenceKey?: string;
|
|
181
|
-
// (undocumented)
|
|
182
|
-
status: 'error';
|
|
183
|
-
}
|
|
178
|
+
export { ErrorFileState };
|
|
184
179
|
|
|
185
180
|
// @public (undocumented)
|
|
186
181
|
type ErrorObserver = PartialObserver & Required<Pick<PartialObserver, 'error'>>;
|
|
@@ -337,7 +332,7 @@ export type FileFetcherErrorReason =
|
|
|
337
332
|
|
|
338
333
|
// @public (undocumented)
|
|
339
334
|
export class FileFetcherImpl implements FileFetcher {
|
|
340
|
-
constructor(
|
|
335
|
+
constructor(mediaApi: MediaStore, store?: MediaStore_2);
|
|
341
336
|
// (undocumented)
|
|
342
337
|
copyFile(
|
|
343
338
|
source: CopySourceFile,
|
|
@@ -404,18 +399,7 @@ export interface FileItem {
|
|
|
404
399
|
type: 'file';
|
|
405
400
|
}
|
|
406
401
|
|
|
407
|
-
|
|
408
|
-
export interface FilePreview {
|
|
409
|
-
// (undocumented)
|
|
410
|
-
origin?: 'local' | 'remote';
|
|
411
|
-
// (undocumented)
|
|
412
|
-
originalDimensions?: {
|
|
413
|
-
width: number;
|
|
414
|
-
height: number;
|
|
415
|
-
};
|
|
416
|
-
// (undocumented)
|
|
417
|
-
value: Blob | string;
|
|
418
|
-
}
|
|
402
|
+
export { FilePreview };
|
|
419
403
|
|
|
420
404
|
// @public (undocumented)
|
|
421
405
|
export type FileProcessingStatus =
|
|
@@ -424,13 +408,7 @@ export type FileProcessingStatus =
|
|
|
424
408
|
| 'running'
|
|
425
409
|
| 'succeeded';
|
|
426
410
|
|
|
427
|
-
|
|
428
|
-
export type FileState =
|
|
429
|
-
| ErrorFileState
|
|
430
|
-
| ProcessedFileState
|
|
431
|
-
| ProcessingFailedState
|
|
432
|
-
| ProcessingFileState
|
|
433
|
-
| UploadingFileState;
|
|
411
|
+
export { FileState };
|
|
434
412
|
|
|
435
413
|
// @public (undocumented)
|
|
436
414
|
export type FileStatus = FileStatus_2;
|
|
@@ -467,10 +445,12 @@ export interface GetFileOptions {
|
|
|
467
445
|
preview?: PreviewOptions;
|
|
468
446
|
}
|
|
469
447
|
|
|
448
|
+
// @public (undocumented)
|
|
449
|
+
export const getFileStreamsCache: () => StreamsCache<FileState>;
|
|
450
|
+
|
|
470
451
|
// @public (undocumented)
|
|
471
452
|
export const getMediaClient: (
|
|
472
453
|
mediaClientConfig: MediaClientConfig,
|
|
473
|
-
featureFlags?: MediaFeatureFlags,
|
|
474
454
|
) => MediaClient;
|
|
475
455
|
|
|
476
456
|
// @public (undocumented)
|
|
@@ -720,8 +700,11 @@ export type MediaChunksProbe = {
|
|
|
720
700
|
export class MediaClient {
|
|
721
701
|
constructor(
|
|
722
702
|
mediaClientConfig: MediaClientConfig,
|
|
723
|
-
|
|
703
|
+
store?: MediaStore_2,
|
|
704
|
+
mediaApi?: MediaStore,
|
|
724
705
|
);
|
|
706
|
+
// @internal (undocumented)
|
|
707
|
+
__DO_NOT_USE__getMediaStore(): MediaStore_2;
|
|
725
708
|
// (undocumented)
|
|
726
709
|
readonly config: MediaClientConfig;
|
|
727
710
|
// (undocumented)
|
|
@@ -730,8 +713,6 @@ export class MediaClient {
|
|
|
730
713
|
payload: UploadEventPayloadMap[E],
|
|
731
714
|
): boolean;
|
|
732
715
|
// (undocumented)
|
|
733
|
-
readonly featureFlags?: MediaFeatureFlags | undefined;
|
|
734
|
-
// (undocumented)
|
|
735
716
|
readonly file: FileFetcher;
|
|
736
717
|
// (undocumented)
|
|
737
718
|
getImage(
|
|
@@ -780,6 +761,8 @@ export class MediaClient {
|
|
|
780
761
|
readonly stargate: StargateClient;
|
|
781
762
|
}
|
|
782
763
|
|
|
764
|
+
export { MediaClientConfig };
|
|
765
|
+
|
|
783
766
|
// @public
|
|
784
767
|
export interface MediaClientError<Attributes extends MediaClientErrorAttributes>
|
|
785
768
|
extends Error {
|
|
@@ -834,29 +817,9 @@ export type MediaFile = {
|
|
|
834
817
|
readonly metadataTraceContext?: MediaTraceContext;
|
|
835
818
|
};
|
|
836
819
|
|
|
837
|
-
|
|
838
|
-
export type MediaFileArtifact = {
|
|
839
|
-
readonly url: string;
|
|
840
|
-
readonly processingStatus: MediaFileProcessingStatus;
|
|
841
|
-
};
|
|
820
|
+
export { MediaFileArtifact };
|
|
842
821
|
|
|
843
|
-
|
|
844
|
-
export interface MediaFileArtifacts {
|
|
845
|
-
// (undocumented)
|
|
846
|
-
'audio.mp3'?: MediaFileArtifact;
|
|
847
|
-
// (undocumented)
|
|
848
|
-
'document.pdf'?: MediaFileArtifact;
|
|
849
|
-
// (undocumented)
|
|
850
|
-
'image.jpg'?: MediaFileArtifact;
|
|
851
|
-
// (undocumented)
|
|
852
|
-
'image.png'?: MediaFileArtifact;
|
|
853
|
-
// (undocumented)
|
|
854
|
-
'thumb.jpg'?: MediaFileArtifact;
|
|
855
|
-
// (undocumented)
|
|
856
|
-
'video_1280.mp4'?: MediaFileArtifact;
|
|
857
|
-
// (undocumented)
|
|
858
|
-
'video_640.mp4'?: MediaFileArtifact;
|
|
859
|
-
}
|
|
822
|
+
export { MediaFileArtifacts };
|
|
860
823
|
|
|
861
824
|
// @public (undocumented)
|
|
862
825
|
export type MediaFileProcessingStatus = 'failed' | 'pending' | 'succeeded';
|
|
@@ -891,10 +854,7 @@ export type MediaRepresentations = {
|
|
|
891
854
|
|
|
892
855
|
// @public (undocumented)
|
|
893
856
|
export class MediaStore {
|
|
894
|
-
constructor(
|
|
895
|
-
config: MediaApiConfig,
|
|
896
|
-
featureFlags?: MediaFeatureFlags | undefined,
|
|
897
|
-
);
|
|
857
|
+
constructor(config: MediaApiConfig);
|
|
898
858
|
// (undocumented)
|
|
899
859
|
appendChunksToUpload(
|
|
900
860
|
uploadId: string,
|
|
@@ -921,8 +881,6 @@ export class MediaStore {
|
|
|
921
881
|
traceContext?: MediaTraceContext,
|
|
922
882
|
): Promise<MediaStoreResponse<MediaUpload[]>>;
|
|
923
883
|
// (undocumented)
|
|
924
|
-
readonly featureFlags?: MediaFeatureFlags | undefined;
|
|
925
|
-
// (undocumented)
|
|
926
884
|
getArtifactURL(
|
|
927
885
|
artifacts: MediaFileArtifacts,
|
|
928
886
|
artifactName: keyof MediaFileArtifacts,
|
|
@@ -1298,83 +1256,11 @@ export interface PreviewableFileState {
|
|
|
1298
1256
|
// @public (undocumented)
|
|
1299
1257
|
export interface PreviewOptions {}
|
|
1300
1258
|
|
|
1301
|
-
|
|
1302
|
-
export interface ProcessedFileState extends BaseFileState {
|
|
1303
|
-
// (undocumented)
|
|
1304
|
-
artifacts: MediaFileArtifacts;
|
|
1305
|
-
// (undocumented)
|
|
1306
|
-
createdAt?: number;
|
|
1307
|
-
// (undocumented)
|
|
1308
|
-
id: string;
|
|
1309
|
-
// (undocumented)
|
|
1310
|
-
mediaType: MediaType;
|
|
1311
|
-
// (undocumented)
|
|
1312
|
-
mimeType: string;
|
|
1313
|
-
// (undocumented)
|
|
1314
|
-
name: string;
|
|
1315
|
-
// (undocumented)
|
|
1316
|
-
occurrenceKey?: string;
|
|
1317
|
-
// (undocumented)
|
|
1318
|
-
preview?: FilePreview | Promise<FilePreview>;
|
|
1319
|
-
// (undocumented)
|
|
1320
|
-
representations?: MediaRepresentations;
|
|
1321
|
-
// (undocumented)
|
|
1322
|
-
size: number;
|
|
1323
|
-
// (undocumented)
|
|
1324
|
-
status: 'processed';
|
|
1325
|
-
}
|
|
1259
|
+
export { ProcessedFileState };
|
|
1326
1260
|
|
|
1327
|
-
|
|
1328
|
-
export interface ProcessingFailedState extends BaseFileState {
|
|
1329
|
-
// (undocumented)
|
|
1330
|
-
artifacts: Object;
|
|
1331
|
-
// (undocumented)
|
|
1332
|
-
createdAt?: number;
|
|
1333
|
-
// (undocumented)
|
|
1334
|
-
id: string;
|
|
1335
|
-
// (undocumented)
|
|
1336
|
-
mediaType: MediaType;
|
|
1337
|
-
// (undocumented)
|
|
1338
|
-
mimeType: string;
|
|
1339
|
-
// (undocumented)
|
|
1340
|
-
name: string;
|
|
1341
|
-
// (undocumented)
|
|
1342
|
-
occurrenceKey?: string;
|
|
1343
|
-
// (undocumented)
|
|
1344
|
-
preview?: FilePreview | Promise<FilePreview>;
|
|
1345
|
-
// (undocumented)
|
|
1346
|
-
representations?: MediaRepresentations;
|
|
1347
|
-
// (undocumented)
|
|
1348
|
-
size: number;
|
|
1349
|
-
// (undocumented)
|
|
1350
|
-
status: 'failed-processing';
|
|
1351
|
-
}
|
|
1261
|
+
export { ProcessingFailedState };
|
|
1352
1262
|
|
|
1353
|
-
|
|
1354
|
-
export interface ProcessingFileState extends BaseFileState {
|
|
1355
|
-
// (undocumented)
|
|
1356
|
-
artifacts?: MediaFileArtifacts;
|
|
1357
|
-
// (undocumented)
|
|
1358
|
-
createdAt?: number;
|
|
1359
|
-
// (undocumented)
|
|
1360
|
-
id: string;
|
|
1361
|
-
// (undocumented)
|
|
1362
|
-
mediaType: MediaType;
|
|
1363
|
-
// (undocumented)
|
|
1364
|
-
mimeType: string;
|
|
1365
|
-
// (undocumented)
|
|
1366
|
-
name: string;
|
|
1367
|
-
// (undocumented)
|
|
1368
|
-
occurrenceKey?: string;
|
|
1369
|
-
// (undocumented)
|
|
1370
|
-
preview?: FilePreview | Promise<FilePreview>;
|
|
1371
|
-
// (undocumented)
|
|
1372
|
-
representations?: MediaRepresentations;
|
|
1373
|
-
// (undocumented)
|
|
1374
|
-
size: number;
|
|
1375
|
-
// (undocumented)
|
|
1376
|
-
status: 'processing';
|
|
1377
|
-
}
|
|
1263
|
+
export { ProcessingFileState };
|
|
1378
1264
|
|
|
1379
1265
|
// @public (undocumented)
|
|
1380
1266
|
export const RECENTS_COLLECTION = 'recents';
|
|
@@ -1534,6 +1420,25 @@ export class StargateClient {
|
|
|
1534
1420
|
isTokenExpired(token: EdgeData): boolean;
|
|
1535
1421
|
}
|
|
1536
1422
|
|
|
1423
|
+
// @public (undocumented)
|
|
1424
|
+
class StreamsCache<T> {
|
|
1425
|
+
constructor(streams: LRUMap<string, ReplaySubject<T>>);
|
|
1426
|
+
// (undocumented)
|
|
1427
|
+
get(id: string): ReplaySubject<T> | undefined;
|
|
1428
|
+
// (undocumented)
|
|
1429
|
+
getOrInsert(id: string, callback: () => ReplaySubject<T>): ReplaySubject<T>;
|
|
1430
|
+
// (undocumented)
|
|
1431
|
+
has(id: string): boolean;
|
|
1432
|
+
// (undocumented)
|
|
1433
|
+
remove(id: string): void;
|
|
1434
|
+
// (undocumented)
|
|
1435
|
+
removeAll(): void;
|
|
1436
|
+
// (undocumented)
|
|
1437
|
+
set(id: string, stream: ReplaySubject<T>): void;
|
|
1438
|
+
// (undocumented)
|
|
1439
|
+
get size(): number;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1537
1442
|
// @public (undocumented)
|
|
1538
1443
|
export type TouchedFiles = {
|
|
1539
1444
|
created: CreatedTouchedFile[];
|
|
@@ -1610,29 +1515,7 @@ export interface UploadFileResult {
|
|
|
1610
1515
|
cancel: () => void;
|
|
1611
1516
|
}
|
|
1612
1517
|
|
|
1613
|
-
|
|
1614
|
-
export interface UploadingFileState extends BaseFileState {
|
|
1615
|
-
// (undocumented)
|
|
1616
|
-
createdAt?: number;
|
|
1617
|
-
// (undocumented)
|
|
1618
|
-
id: string;
|
|
1619
|
-
// (undocumented)
|
|
1620
|
-
mediaType: MediaType;
|
|
1621
|
-
// (undocumented)
|
|
1622
|
-
mimeType: string;
|
|
1623
|
-
// (undocumented)
|
|
1624
|
-
name: string;
|
|
1625
|
-
// (undocumented)
|
|
1626
|
-
occurrenceKey?: string;
|
|
1627
|
-
// (undocumented)
|
|
1628
|
-
preview?: FilePreview | Promise<FilePreview>;
|
|
1629
|
-
// (undocumented)
|
|
1630
|
-
progress: number;
|
|
1631
|
-
// (undocumented)
|
|
1632
|
-
size: number;
|
|
1633
|
-
// (undocumented)
|
|
1634
|
-
status: 'uploading';
|
|
1635
|
-
}
|
|
1518
|
+
export { UploadingFileState };
|
|
1636
1519
|
|
|
1637
1520
|
// @public (undocumented)
|
|
1638
1521
|
export interface WithMediaClient {
|
|
@@ -1661,7 +1544,6 @@ export type WithMediaClientConfigProps<P extends WithMediaClient> = Omit<
|
|
|
1661
1544
|
// @public (undocumented)
|
|
1662
1545
|
export type WithMediaClientFunction = <P extends WithMediaClient>(
|
|
1663
1546
|
Component: React_2.ComponentType<P>,
|
|
1664
|
-
featureFlags?: MediaFeatureFlags,
|
|
1665
1547
|
) => React_2.ComponentType<WithMediaClientConfigProps<P>>;
|
|
1666
1548
|
|
|
1667
1549
|
// (No @packageDocumentation comment for this package)
|
|
@@ -1676,6 +1558,7 @@ export type WithMediaClientFunction = <P extends WithMediaClient>(
|
|
|
1676
1558
|
```json
|
|
1677
1559
|
{
|
|
1678
1560
|
"@atlaskit/media-core": "^34.1.2",
|
|
1561
|
+
"@atlaskit/media-state": "^1.0.0",
|
|
1679
1562
|
"@emotion/react": "^11.7.1",
|
|
1680
1563
|
"enzyme": ">=3.10.0",
|
|
1681
1564
|
"react": "^16.8.0"
|