@atlaskit/media-common 9.0.2 → 10.0.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 +12 -0
- package/dist/cjs/mediaFeatureFlags/mediaFeatureFlags.js +1 -2
- package/dist/cjs/mediaFeatureFlags/productKeys.js +2 -4
- package/dist/cjs/test-helpers/jestHelpers.js +2 -0
- package/dist/es2019/mediaFeatureFlags/mediaFeatureFlags.js +1 -2
- package/dist/es2019/mediaFeatureFlags/productKeys.js +2 -4
- package/dist/es2019/test-helpers/jestHelpers.js +2 -0
- package/dist/esm/mediaFeatureFlags/mediaFeatureFlags.js +1 -2
- package/dist/esm/mediaFeatureFlags/productKeys.js +2 -4
- package/dist/esm/test-helpers/jestHelpers.js +2 -0
- package/dist/types/mediaFeatureFlags/types.d.ts +0 -1
- package/dist/types-ts4.5/analytics/constants.d.ts +1 -0
- package/dist/types-ts4.5/analytics/index.d.ts +3 -0
- package/dist/types-ts4.5/analytics/types.d.ts +81 -0
- package/dist/types-ts4.5/analytics/withMediaAnalyticsContext.d.ts +15 -0
- package/dist/types-ts4.5/docs/index.d.ts +3 -0
- package/dist/types-ts4.5/docs/media-use-only.d.ts +5 -0
- package/dist/types-ts4.5/docs/rxjs-notice.d.ts +2 -0
- package/dist/types-ts4.5/docs/singleton-notice.d.ts +2 -0
- package/dist/types-ts4.5/downloadUrl.d.ts +4 -0
- package/dist/types-ts4.5/index.d.ts +19 -0
- package/dist/types-ts4.5/mediaFeatureFlag-local.d.ts +1 -0
- package/dist/types-ts4.5/mediaFeatureFlags/genericFeatureFlag.d.ts +7 -0
- package/dist/types-ts4.5/mediaFeatureFlags/index.d.ts +2 -0
- package/dist/types-ts4.5/mediaFeatureFlags/mediaFeatureFlags.d.ts +30 -0
- package/dist/types-ts4.5/mediaFeatureFlags/productKeys.d.ts +2 -0
- package/dist/types-ts4.5/mediaFeatureFlags/types.d.ts +20 -0
- package/dist/types-ts4.5/mediaTypeUtils/index.d.ts +4 -0
- package/dist/types-ts4.5/mediaTypeUtils/isArchive.d.ts +1 -0
- package/dist/types-ts4.5/mediaTypeUtils/isMimeTypeSupportedByBrowser.d.ts +14 -0
- package/dist/types-ts4.5/mediaTypeUtils/isMimeTypeSupportedByServer.d.ts +6 -0
- package/dist/types-ts4.5/test-helpers/await-error.d.ts +1 -0
- package/dist/types-ts4.5/test-helpers/dataURIs/smallImageURI.d.ts +1 -0
- package/dist/types-ts4.5/test-helpers/dataURIs/smallTransparentImageURI.d.ts +1 -0
- package/dist/types-ts4.5/test-helpers/dataURIs/tallImageURI.d.ts +1 -0
- package/dist/types-ts4.5/test-helpers/dataURIs/videoPreviewURI.d.ts +1 -0
- package/dist/types-ts4.5/test-helpers/dataURIs/videoURI.d.ts +1 -0
- package/dist/types-ts4.5/test-helpers/dataURIs/vr_test_small_image.d.ts +1 -0
- package/dist/types-ts4.5/test-helpers/dataURIs/wideImageURI.d.ts +1 -0
- package/dist/types-ts4.5/test-helpers/dataURIs/wideTransparentImageURI.d.ts +1 -0
- package/dist/types-ts4.5/test-helpers/flushPromises.d.ts +1 -0
- package/dist/types-ts4.5/test-helpers/getJest.d.ts +16 -0
- package/dist/types-ts4.5/test-helpers/index.d.ts +15 -0
- package/dist/types-ts4.5/test-helpers/jestHelpers.d.ts +13 -0
- package/dist/types-ts4.5/test-helpers/nextTick.d.ts +2 -0
- package/dist/types-ts4.5/test-helpers/timeoutPromise.d.ts +1 -0
- package/dist/types-ts4.5/utils/helpers.d.ts +10 -0
- package/package.json +1 -1
- package/report.api.md +0 -2
- package/tmp/api-report-tmp.d.ts +252 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/media-common
|
|
2
2
|
|
|
3
|
+
## 10.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#42757](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42757) [`73c66d2c6db`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73c66d2c6db) - remove media securedClipboard FF
|
|
8
|
+
|
|
9
|
+
## 9.0.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#41501](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41501) [`b3cb749dc67`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b3cb749dc67) - Fix TS errors in AFM
|
|
14
|
+
|
|
3
15
|
## 9.0.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -57,8 +57,7 @@ var defaultMediaFeatureFlags = exports.defaultMediaFeatureFlags = {
|
|
|
57
57
|
mediaInline: false,
|
|
58
58
|
// We can't yet switch this feature on
|
|
59
59
|
// TODO https://product-fabric.atlassian.net/browse/MEX-104
|
|
60
|
-
folderUploads: false
|
|
61
|
-
securedClipboard: false
|
|
60
|
+
folderUploads: false
|
|
62
61
|
};
|
|
63
62
|
|
|
64
63
|
/**
|
|
@@ -11,15 +11,13 @@ var productKeys = {
|
|
|
11
11
|
*/
|
|
12
12
|
captions: 'confluence.frontend.fabric.editor.media.captions',
|
|
13
13
|
mediaInline: 'confluence.frontend.fabric.editor.media.inline',
|
|
14
|
-
folderUploads: 'confluence.frontend.media.picker.folder.uploads'
|
|
15
|
-
securedClipboard: 'confluence.frontend.media.picker.secured.clipboard'
|
|
14
|
+
folderUploads: 'confluence.frontend.media.picker.folder.uploads'
|
|
16
15
|
},
|
|
17
16
|
jira: {
|
|
18
17
|
captions: 'issue.details.editor.media.captions',
|
|
19
18
|
// Manged by Linking Platform. No Rollout plan found for Jira
|
|
20
19
|
mediaInline: '',
|
|
21
|
-
folderUploads: 'issue.details.media-picker-folder-upload'
|
|
22
|
-
securedClipboard: 'issue.details.media-picker-secured-clipboard'
|
|
20
|
+
folderUploads: 'issue.details.media-picker-folder-upload'
|
|
23
21
|
}
|
|
24
22
|
};
|
|
25
23
|
var getProductKeys = exports.getProductKeys = function getProductKeys() {
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.expectToEqual = exports.expectFunctionToHaveBeenCalledWith = exports.expectConstructorToHaveBeenCalledWith = exports.asMockReturnValue = exports.asMockFunctionReturnValue = exports.asMockFunctionResolvedValue = exports.asMockFunction = exports.asMock = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
/// <reference types="jest" />
|
|
10
|
+
|
|
9
11
|
var asMock = exports.asMock = function asMock(fn) {
|
|
10
12
|
return fn;
|
|
11
13
|
};
|
|
@@ -36,8 +36,7 @@ export const defaultMediaFeatureFlags = {
|
|
|
36
36
|
mediaInline: false,
|
|
37
37
|
// We can't yet switch this feature on
|
|
38
38
|
// TODO https://product-fabric.atlassian.net/browse/MEX-104
|
|
39
|
-
folderUploads: false
|
|
40
|
-
securedClipboard: false
|
|
39
|
+
folderUploads: false
|
|
41
40
|
};
|
|
42
41
|
|
|
43
42
|
/**
|
|
@@ -5,15 +5,13 @@ const productKeys = {
|
|
|
5
5
|
*/
|
|
6
6
|
captions: 'confluence.frontend.fabric.editor.media.captions',
|
|
7
7
|
mediaInline: 'confluence.frontend.fabric.editor.media.inline',
|
|
8
|
-
folderUploads: 'confluence.frontend.media.picker.folder.uploads'
|
|
9
|
-
securedClipboard: 'confluence.frontend.media.picker.secured.clipboard'
|
|
8
|
+
folderUploads: 'confluence.frontend.media.picker.folder.uploads'
|
|
10
9
|
},
|
|
11
10
|
jira: {
|
|
12
11
|
captions: 'issue.details.editor.media.captions',
|
|
13
12
|
// Manged by Linking Platform. No Rollout plan found for Jira
|
|
14
13
|
mediaInline: '',
|
|
15
|
-
folderUploads: 'issue.details.media-picker-folder-upload'
|
|
16
|
-
securedClipboard: 'issue.details.media-picker-secured-clipboard'
|
|
14
|
+
folderUploads: 'issue.details.media-picker-folder-upload'
|
|
17
15
|
}
|
|
18
16
|
};
|
|
19
17
|
export const getProductKeys = () => productKeys;
|
|
@@ -49,8 +49,7 @@ export var defaultMediaFeatureFlags = {
|
|
|
49
49
|
mediaInline: false,
|
|
50
50
|
// We can't yet switch this feature on
|
|
51
51
|
// TODO https://product-fabric.atlassian.net/browse/MEX-104
|
|
52
|
-
folderUploads: false
|
|
53
|
-
securedClipboard: false
|
|
52
|
+
folderUploads: false
|
|
54
53
|
};
|
|
55
54
|
|
|
56
55
|
/**
|
|
@@ -5,15 +5,13 @@ var productKeys = {
|
|
|
5
5
|
*/
|
|
6
6
|
captions: 'confluence.frontend.fabric.editor.media.captions',
|
|
7
7
|
mediaInline: 'confluence.frontend.fabric.editor.media.inline',
|
|
8
|
-
folderUploads: 'confluence.frontend.media.picker.folder.uploads'
|
|
9
|
-
securedClipboard: 'confluence.frontend.media.picker.secured.clipboard'
|
|
8
|
+
folderUploads: 'confluence.frontend.media.picker.folder.uploads'
|
|
10
9
|
},
|
|
11
10
|
jira: {
|
|
12
11
|
captions: 'issue.details.editor.media.captions',
|
|
13
12
|
// Manged by Linking Platform. No Rollout plan found for Jira
|
|
14
13
|
mediaInline: '',
|
|
15
|
-
folderUploads: 'issue.details.media-picker-folder-upload'
|
|
16
|
-
securedClipboard: 'issue.details.media-picker-secured-clipboard'
|
|
14
|
+
folderUploads: 'issue.details.media-picker-folder-upload'
|
|
17
15
|
}
|
|
18
16
|
};
|
|
19
17
|
export var getProductKeys = function getProductKeys() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ANALYTICS_MEDIA_CHANNEL = "media";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { PackageAttributes, WithFileAttributes, FileAttributes, SuccessAttributes, FailureAttributes, OperationalAttributes, OperationalEventPayload, UIAttributes, UIEventPayload, ScreenAttributes, ScreenEventPayload, TrackAttributes, TrackEventPayload, ContextPublicAttributes, ContextStaticProps, } from './types';
|
|
2
|
+
export { withMediaAnalyticsContext } from './withMediaAnalyticsContext';
|
|
3
|
+
export { ANALYTICS_MEDIA_CHANNEL } from './constants';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { GasCorePayload } from '@atlaskit/analytics-gas-types';
|
|
2
|
+
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context/MediaAnalyticsContext';
|
|
3
|
+
import { MediaType, FileStatus, WithMediaFeatureFlags, MediaTraceContext } from '..';
|
|
4
|
+
export type BaseAttributes = {};
|
|
5
|
+
export type PackageAttributes = {
|
|
6
|
+
packageName: string;
|
|
7
|
+
packageVersion: string;
|
|
8
|
+
componentName: string;
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
export type BaseEventPayload<Attributes extends BaseAttributes> = Omit<GasCorePayload, 'attributes'> & {
|
|
12
|
+
attributes: Attributes;
|
|
13
|
+
};
|
|
14
|
+
export type FileAttributes = {
|
|
15
|
+
fileId: string;
|
|
16
|
+
fileSize?: number;
|
|
17
|
+
fileMediatype?: MediaType;
|
|
18
|
+
fileMimetype?: string;
|
|
19
|
+
fileSource?: string;
|
|
20
|
+
fileStatus?: FileStatus;
|
|
21
|
+
};
|
|
22
|
+
export type PerformanceAttributes = {
|
|
23
|
+
overall: {
|
|
24
|
+
durationSincePageStart: number;
|
|
25
|
+
durationSinceCommenced?: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type WithFileAttributes = {
|
|
29
|
+
fileAttributes: FileAttributes;
|
|
30
|
+
};
|
|
31
|
+
export type WithPerformanceAttributes = {
|
|
32
|
+
performanceAttributes?: PerformanceAttributes;
|
|
33
|
+
};
|
|
34
|
+
export type WithTraceContext = {
|
|
35
|
+
traceContext?: MediaTraceContext;
|
|
36
|
+
metadataTraceContext?: MediaTraceContext;
|
|
37
|
+
};
|
|
38
|
+
export type SuccessAttributes = {
|
|
39
|
+
status: 'success';
|
|
40
|
+
fileMediatype?: MediaType;
|
|
41
|
+
};
|
|
42
|
+
export type FailureAttributes = {
|
|
43
|
+
status: 'fail';
|
|
44
|
+
failReason: string;
|
|
45
|
+
error?: string;
|
|
46
|
+
errorDetail?: string;
|
|
47
|
+
};
|
|
48
|
+
export type StatusAttributes = SuccessAttributes | FailureAttributes;
|
|
49
|
+
export type OperationalAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes & WithPerformanceAttributes & WithTraceContext);
|
|
50
|
+
export type OperationalEventPayload<Attributes extends OperationalAttributes, Action extends string, ActionSubject extends string, ActionSubjectId extends string = string> = BaseEventPayload<Attributes> & {
|
|
51
|
+
eventType: 'operational';
|
|
52
|
+
action: Action;
|
|
53
|
+
actionSubject: ActionSubject;
|
|
54
|
+
actionSubjectId?: ActionSubjectId;
|
|
55
|
+
};
|
|
56
|
+
export type UIAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes);
|
|
57
|
+
export type UIEventPayload<Attributes extends UIAttributes, Action extends string, ActionSubject extends string> = BaseEventPayload<Attributes> & {
|
|
58
|
+
eventType: 'ui';
|
|
59
|
+
action: Action;
|
|
60
|
+
actionSubject: ActionSubject;
|
|
61
|
+
actionSubjectId?: string;
|
|
62
|
+
};
|
|
63
|
+
export type ScreenAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes);
|
|
64
|
+
export type ScreenEventPayload<Attributes extends ScreenAttributes, ActionSubject extends string> = BaseEventPayload<Attributes> & {
|
|
65
|
+
eventType: 'screen';
|
|
66
|
+
actionSubject: ActionSubject;
|
|
67
|
+
name: ActionSubject;
|
|
68
|
+
};
|
|
69
|
+
export type TrackAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes);
|
|
70
|
+
export type TrackEventPayload<Attributes extends TrackAttributes, Action extends string, ActionSubject extends string, ActionSubjectId extends string = string> = BaseEventPayload<Attributes> & {
|
|
71
|
+
eventType: 'track';
|
|
72
|
+
action: Action;
|
|
73
|
+
actionSubject: ActionSubject;
|
|
74
|
+
actionSubjectId?: ActionSubjectId;
|
|
75
|
+
};
|
|
76
|
+
export type ContextPublicAttributes = PackageAttributes;
|
|
77
|
+
export type ContextPrivateAttributes = WithMediaFeatureFlags;
|
|
78
|
+
export type ContextStaticProps = WithMediaFeatureFlags;
|
|
79
|
+
export type ContextData = ContextPublicAttributes & {
|
|
80
|
+
[MEDIA_CONTEXT]: ContextPrivateAttributes;
|
|
81
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ContextPublicAttributes } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* HOC for attaching MediaAnalyticsContext to a top-level React Component.
|
|
5
|
+
*
|
|
6
|
+
* Similar than "packages/analytics/analytics-next/src/hocs/withAnalyticsContext.tsx",
|
|
7
|
+
* except that we restrict attributes put in this context using ContextPublicAttributes and ContextPrivateAttributes.
|
|
8
|
+
*
|
|
9
|
+
* As a constraint, the wrapped React Component's props must extend ContextStaticProps.
|
|
10
|
+
*
|
|
11
|
+
* @param {ContextPublicAttributes} attributes public attributes to put in context
|
|
12
|
+
*
|
|
13
|
+
* @see packages/analytics/analytics-next/src/hocs/withAnalyticsContext.tsx
|
|
14
|
+
*/
|
|
15
|
+
export declare const withMediaAnalyticsContext: (contextPublicAttributes: ContextPublicAttributes) => <Props extends import("..").WithMediaFeatureFlags, Component extends React.ComponentType<Props>>(WrappedComponent: React.JSXElementConstructor<Props> & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Props>> & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { downloadUrl } from './downloadUrl';
|
|
2
|
+
export type MediaType = 'doc' | 'audio' | 'video' | 'image' | 'archive' | 'unknown';
|
|
3
|
+
export type FileStatus = 'uploading' | 'processing' | 'processed' | 'error' | 'failed-processing';
|
|
4
|
+
export { getMediaFeatureFlag, defaultMediaFeatureFlags, filterFeatureFlagNames, getFeatureFlagKeysAllProducts, } from './mediaFeatureFlags';
|
|
5
|
+
export type { MediaFeatureFlags, WithMediaFeatureFlags, } from './mediaFeatureFlags';
|
|
6
|
+
export interface NumericalCardDimensions {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
10
|
+
export type { PackageAttributes, WithFileAttributes, WithPerformanceAttributes, WithTraceContext, FileAttributes, PerformanceAttributes, SuccessAttributes, FailureAttributes, OperationalAttributes, OperationalEventPayload, UIAttributes, UIEventPayload, ScreenAttributes, ScreenEventPayload, TrackAttributes, TrackEventPayload, ContextPublicAttributes, ContextStaticProps, } from './analytics/types';
|
|
11
|
+
export { withMediaAnalyticsContext } from './analytics/withMediaAnalyticsContext';
|
|
12
|
+
export { ANALYTICS_MEDIA_CHANNEL } from './analytics/constants';
|
|
13
|
+
export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer, } from './mediaTypeUtils';
|
|
14
|
+
export type SSR = 'client' | 'server';
|
|
15
|
+
export { isUndefined, pick, omitBy, debounce, matches, getRandomHex, } from './utils/helpers';
|
|
16
|
+
export type MediaTraceContext = {
|
|
17
|
+
traceId: string;
|
|
18
|
+
spanId?: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getLocalMediaFeatureFlag: (key: string) => string | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the first value for the flagName found in this priority
|
|
3
|
+
* 1: local storage
|
|
4
|
+
* 2: featureFlags parameter
|
|
5
|
+
* 3: defaults parameter
|
|
6
|
+
*/
|
|
7
|
+
export declare function getGenericFeatureFlag<T, K extends string, M extends Record<K, any>>(flagName: K, defaults: M, featureFlags?: Partial<M>): T;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RequiredMediaFeatureFlags, MediaFeatureFlags } from './types';
|
|
2
|
+
export declare const filterFeatureFlagNames: (flags: RequiredMediaFeatureFlags) => Array<keyof MediaFeatureFlags>;
|
|
3
|
+
/**
|
|
4
|
+
* Takes a record of {Media Feature Flag Names → boolean}.
|
|
5
|
+
* Returns the Launch Darkly Keys from all products for each of the flags set as true in the input record.
|
|
6
|
+
* */
|
|
7
|
+
export declare const getFeatureFlagKeysAllProducts: () => Array<string>;
|
|
8
|
+
/**
|
|
9
|
+
* defaultMediaFeatureFlags set default values used by the getter function getMediaFeatureFlag
|
|
10
|
+
*
|
|
11
|
+
* *************************************
|
|
12
|
+
* ************* IMPORTANT *************
|
|
13
|
+
* *************************************
|
|
14
|
+
* Only in exceptional cases a FF should be 'true' by default.
|
|
15
|
+
* Making a flag default to 'true' can lead to confusing and unexpected scenarios.
|
|
16
|
+
* If you must set a flag default = true, whenever you remove that flag
|
|
17
|
+
* that change should be released as a MAJOR, because it's a breaking change.
|
|
18
|
+
*/
|
|
19
|
+
export declare const defaultMediaFeatureFlags: Required<MediaFeatureFlags>;
|
|
20
|
+
/**
|
|
21
|
+
* Public accessor from components to fallback to defaults if flags not passed,
|
|
22
|
+
* otherwise whatever product has set will be returned.
|
|
23
|
+
*
|
|
24
|
+
* To override locally for testing:
|
|
25
|
+
* - `localStorage[flagName] = true` to enable locally,
|
|
26
|
+
* - `delete localStorage[flagName]` to remove.
|
|
27
|
+
*
|
|
28
|
+
* (you will see a warning in console if override used)
|
|
29
|
+
* */
|
|
30
|
+
export declare function getMediaFeatureFlag<T = boolean>(flagName: keyof MediaFeatureFlags, featureFlags?: MediaFeatureFlags): T;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface MediaFeatureFlags {
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* @deprecated Use media option `allowCaptions` instead.
|
|
5
|
+
*/
|
|
6
|
+
captions?: boolean;
|
|
7
|
+
mediaInline?: boolean;
|
|
8
|
+
folderUploads?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface WithMediaFeatureFlags {
|
|
11
|
+
featureFlags?: MediaFeatureFlags;
|
|
12
|
+
}
|
|
13
|
+
export type RequiredMediaFeatureFlags = Record<keyof Required<MediaFeatureFlags>, boolean>;
|
|
14
|
+
export type MediaFeatureFlagsMap = Record<keyof Required<MediaFeatureFlags>, string>;
|
|
15
|
+
export declare const supportedProducts: readonly [
|
|
16
|
+
"confluence",
|
|
17
|
+
"jira"
|
|
18
|
+
];
|
|
19
|
+
export type SupportedProduct = (typeof supportedProducts)[number];
|
|
20
|
+
export type ProductKeys = Record<SupportedProduct, MediaFeatureFlagsMap>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MediaType } from '..';
|
|
2
|
+
export { isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isAudioMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, } from './isMimeTypeSupportedByBrowser';
|
|
3
|
+
export { isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer, } from './isMimeTypeSupportedByServer';
|
|
4
|
+
export declare const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isArchive: (mimeType: string) => boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const isImageMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
2
|
+
export declare const isDocumentMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
3
|
+
export declare const isAudioMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
4
|
+
/**
|
|
5
|
+
* For backward compatilbity, we assume MP4/MOV is natively supported.
|
|
6
|
+
* TODO: Improve detection of supported video formats by the browser.
|
|
7
|
+
*
|
|
8
|
+
* See related tickets:
|
|
9
|
+
* - https://product-fabric.atlassian.net/browse/MPT-477
|
|
10
|
+
* - https://product-fabric.atlassian.net/browse/EDM-634
|
|
11
|
+
* - https://product-fabric.atlassian.net/browse/EDM-426
|
|
12
|
+
*/
|
|
13
|
+
export declare const isVideoMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
14
|
+
export declare const isMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const isImageMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
2
|
+
export declare const isDocumentMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
3
|
+
export declare const isAudioMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
4
|
+
export declare const isVideoMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
5
|
+
export declare const isUnknownMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
6
|
+
export declare const isMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function awaitError(response: Promise<Error>, expectedMessage: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const smallImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAMAAAAbzM5ZAAAACVBMVEWs3t4AVFpMkZTmA5phAAAAUElEQVQokWNgxAIYGBkwAPUEGRkxBcG2oglC3YIiCHchkiCSu+GCKL4hYOYAC+IIJTRBsE4mIAKxmBB+hyIkmpAgDu0MyIIQi8hxJxZBLAAAEuQA45SJc9sAAAAASUVORK5CYII=";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const smallTransparentImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAABkCAYAAAD0ZHJ6AAALZUlEQVRogcWbf6wdRRXHP+d609Ta1PpCmqapdzd3tcFKDGAFExErFsWm8QeJIUERJA1KU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