@atlaskit/media-client 25.0.3 → 25.1.0
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/dist/cjs/test-helpers/MockedMediaApi/MockedMediaApi.js +449 -0
- package/dist/cjs/test-helpers/MockedMediaApi/helpers.js +184 -0
- package/dist/cjs/test-helpers/MockedMediaApi/index.js +55 -0
- package/dist/cjs/test-helpers/index.js +49 -0
- package/dist/es2019/test-helpers/MockedMediaApi/MockedMediaApi.js +164 -0
- package/dist/es2019/test-helpers/MockedMediaApi/helpers.js +166 -0
- package/dist/es2019/test-helpers/MockedMediaApi/index.js +2 -0
- package/dist/es2019/test-helpers/index.js +2 -1
- package/dist/esm/test-helpers/MockedMediaApi/MockedMediaApi.js +442 -0
- package/dist/esm/test-helpers/MockedMediaApi/helpers.js +176 -0
- package/dist/esm/test-helpers/MockedMediaApi/index.js +2 -0
- package/dist/esm/test-helpers/index.js +2 -1
- package/dist/types/test-helpers/MockedMediaApi/MockedMediaApi.d.ts +16 -0
- package/dist/types/test-helpers/MockedMediaApi/helpers.d.ts +23 -0
- package/dist/types/test-helpers/MockedMediaApi/index.d.ts +3 -0
- package/dist/types/test-helpers/index.d.ts +2 -0
- package/dist/types-ts4.5/test-helpers/MockedMediaApi/MockedMediaApi.d.ts +16 -0
- package/dist/types-ts4.5/test-helpers/MockedMediaApi/helpers.d.ts +23 -0
- package/dist/types-ts4.5/test-helpers/MockedMediaApi/index.d.ts +3 -0
- package/dist/types-ts4.5/test-helpers/index.d.ts +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MediaApi, ResponseFileItem } from '../../client/media-store';
|
|
2
|
+
export interface SetFileItems {
|
|
3
|
+
(fileItems: ResponseFileItem | ResponseFileItem[]): void;
|
|
4
|
+
}
|
|
5
|
+
export interface GetFileItem {
|
|
6
|
+
(id: string): ResponseFileItem | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface CreateMockedMediaApiResult {
|
|
9
|
+
mediaApi: MediaApi;
|
|
10
|
+
setFileItems: SetFileItems;
|
|
11
|
+
getFileItem: GetFileItem;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Mocked Media API
|
|
15
|
+
*/
|
|
16
|
+
export declare const createMockedMediaApi: (initialFileItems?: ResponseFileItem | ResponseFileItem[]) => CreateMockedMediaApiResult;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UploadingFileState, ErrorFileState, FileState } from '@atlaskit/media-state';
|
|
2
|
+
import { MediaFile } from '../../models/media';
|
|
3
|
+
import { ResponseFileItem } from '../../client/media-store/types';
|
|
4
|
+
import type { FileIdentifier } from '../../identifier';
|
|
5
|
+
export declare const normaliseInput: <T>(input?: T | T[] | undefined) => T[];
|
|
6
|
+
export declare const getMediaFile: (fileItem: ResponseFileItem) => MediaFile;
|
|
7
|
+
export declare const createEmptyFileItem: (id: string, collection?: string) => ResponseFileItem;
|
|
8
|
+
/**
|
|
9
|
+
* Simulates the processing of the file by updating the processing status of the artifacts by a percentage
|
|
10
|
+
* Percent must be between 0 and 1
|
|
11
|
+
*/
|
|
12
|
+
export declare const createProcessingFileItem: (fileItem: ResponseFileItem, percent: number) => ResponseFileItem;
|
|
13
|
+
/**
|
|
14
|
+
* Makes a copy of the provided file item with a random file id
|
|
15
|
+
* */
|
|
16
|
+
export declare const copy: (fileItem: ResponseFileItem) => ResponseFileItem;
|
|
17
|
+
/**
|
|
18
|
+
* Extracts the file identifier from the provided file item
|
|
19
|
+
*/
|
|
20
|
+
export declare const getIdentifier: (fileItem: ResponseFileItem) => FileIdentifier;
|
|
21
|
+
export declare const createFileState: ({ id, details: { name, size, mediaType, mimeType, createdAt, processingStatus, artifacts, representations, }, }: ResponseFileItem) => FileState;
|
|
22
|
+
export declare const createUploadingFileState: ({ id, details: { name, size, mediaType, mimeType, createdAt }, }: ResponseFileItem, progress: number) => UploadingFileState;
|
|
23
|
+
export declare const createErrorFileState: ({ id, }: ResponseFileItem) => ErrorFileState;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { CreateMockedMediaApiResult, SetFileItems, GetFileItem, } from './MockedMediaApi';
|
|
2
|
+
export { createMockedMediaApi } from './MockedMediaApi';
|
|
3
|
+
export { copy, getIdentifier, createEmptyFileItem, createUploadingFileState, createErrorFileState, createFileState, createProcessingFileItem, } from './helpers';
|
|
@@ -5,3 +5,5 @@ export { animatedFileId, archiveFileId, atlassianLogoUrl, audioFileDetails, audi
|
|
|
5
5
|
export declare const authProviderBaseURL = "https://media.dev.atl-paas.net";
|
|
6
6
|
export { mediaPickerAuthProvider, defaultMediaPickerAuthProvider, } from './mediaPickerAuthProvider';
|
|
7
7
|
export { fakeMediaClient } from './fakeMediaClient';
|
|
8
|
+
export type { CreateMockedMediaApiResult, SetFileItems, GetFileItem, } from './MockedMediaApi';
|
|
9
|
+
export { createMockedMediaApi, copy, getIdentifier, createProcessingFileItem, createEmptyFileItem, createUploadingFileState, createFileState, createErrorFileState, } from './MockedMediaApi';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "25.0
|
|
3
|
+
"version": "25.1.0",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@atlaskit/media-core": "^34.1.0",
|
|
59
59
|
"@atlaskit/media-state": "^1.0.0",
|
|
60
60
|
"@atlaskit/ssr": "*",
|
|
61
|
-
"@atlaskit/tokens": "^1.
|
|
61
|
+
"@atlaskit/tokens": "^1.29.0",
|
|
62
62
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
63
63
|
"@emotion/react": "^11.7.1",
|
|
64
64
|
"@types/deep-equal": "^1.0.1",
|