@atlaskit/media-test-helpers 40.0.6 → 40.0.8
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/I18nWrapper.js +5 -4
- package/dist/cjs/flushPromises.js +6 -3
- package/dist/cjs/story-styles.js +3 -0
- package/dist/es2019/I18nWrapper.js +2 -1
- package/dist/es2019/flushPromises.js +3 -1
- package/dist/es2019/story-styles.js +4 -0
- package/dist/esm/I18nWrapper.js +2 -1
- package/dist/esm/flushPromises.js +6 -3
- package/dist/esm/story-styles.js +4 -0
- package/dist/types/collectionNames.d.ts +1 -1
- package/dist/types/jestHelpers.d.ts +1 -1
- package/dist/types/mediaClientProvider.d.ts +1 -1
- package/dist/types/mockCanvas.d.ts +2 -1
- package/dist/types/nextTick.d.ts +1 -1
- package/dist/types/story-styles.d.ts +6 -3
- package/dist/types-ts4.5/collectionNames.d.ts +1 -1
- package/dist/types-ts4.5/jestHelpers.d.ts +1 -1
- package/dist/types-ts4.5/mediaClientProvider.d.ts +1 -1
- package/dist/types-ts4.5/mockCanvas.d.ts +2 -1
- package/dist/types-ts4.5/nextTick.d.ts +1 -1
- package/dist/types-ts4.5/story-styles.d.ts +6 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
package/dist/cjs/I18nWrapper.js
CHANGED
|
@@ -9,7 +9,8 @@ exports.I18NWrapper = void 0;
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
|
-
var _LocaleSelect =
|
|
12
|
+
var _LocaleSelect = _interopRequireDefault(require("@atlaskit/locale/LocaleSelect"));
|
|
13
|
+
var _defaultLocales = _interopRequireDefault(require("@atlaskit/locale/default-locales"));
|
|
13
14
|
var _locales = require("@atlaskit/media-ui/locales");
|
|
14
15
|
var _primitives = require("@atlaskit/primitives");
|
|
15
16
|
var _form = require("@atlaskit/form");
|
|
@@ -22,13 +23,13 @@ function getMessages(localeValue) {
|
|
|
22
23
|
return _locales.locales[langWithRegion] || _locales.locales[lang];
|
|
23
24
|
}
|
|
24
25
|
var findLocale = function findLocale(initialLocale) {
|
|
25
|
-
return
|
|
26
|
+
return _defaultLocales.default.find(function (locale) {
|
|
26
27
|
return locale.value === initialLocale;
|
|
27
|
-
}) || initialLocale &&
|
|
28
|
+
}) || initialLocale && _defaultLocales.default.find(function (locale) {
|
|
28
29
|
return locale.value.includes(initialLocale);
|
|
29
30
|
});
|
|
30
31
|
};
|
|
31
|
-
var defaultLocale =
|
|
32
|
+
var defaultLocale = _defaultLocales.default[0];
|
|
32
33
|
var I18NWrapper = exports.I18NWrapper = function I18NWrapper(_ref) {
|
|
33
34
|
var children = _ref.children,
|
|
34
35
|
initialLocale = _ref.initialLocale;
|
|
@@ -7,7 +7,10 @@ exports.flushPromises = void 0;
|
|
|
7
7
|
/** deprecated Use React Testing Library's waitFor like method instead */
|
|
8
8
|
// eslint-disable-next-line @atlaskit/platform/no-set-immediate
|
|
9
9
|
var flushPromises = exports.flushPromises = function flushPromises() {
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
return (
|
|
11
|
+
// eslint-disable-next-line @atlaskit/platform/no-set-immediate
|
|
12
|
+
new Promise(function (resolve) {
|
|
13
|
+
return setImmediate(resolve);
|
|
14
|
+
})
|
|
15
|
+
);
|
|
13
16
|
};
|
package/dist/cjs/story-styles.js
CHANGED
|
@@ -6,6 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.Matrix = void 0;
|
|
8
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
|
+
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled, @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles */
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
|
+
|
|
9
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
13
|
|
|
11
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { IntlProvider } from 'react-intl-next';
|
|
3
|
-
import LocaleSelect
|
|
3
|
+
import LocaleSelect from '@atlaskit/locale/LocaleSelect';
|
|
4
|
+
import defaultLocales from '@atlaskit/locale/default-locales';
|
|
4
5
|
import { locales } from '@atlaskit/media-ui/locales';
|
|
5
6
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
6
7
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/** deprecated Use React Testing Library's waitFor like method instead */
|
|
2
2
|
// eslint-disable-next-line @atlaskit/platform/no-set-immediate
|
|
3
|
-
export const flushPromises = () =>
|
|
3
|
+
export const flushPromises = () =>
|
|
4
|
+
// eslint-disable-next-line @atlaskit/platform/no-set-immediate
|
|
5
|
+
new Promise(resolve => setImmediate(resolve));
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled, @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles */
|
|
1
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import styled from '@emotion/styled';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
+
|
|
3
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
4
8
|
export const Matrix = styled.table({
|
|
5
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
package/dist/esm/I18nWrapper.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { IntlProvider } from 'react-intl-next';
|
|
4
|
-
import LocaleSelect
|
|
4
|
+
import LocaleSelect from '@atlaskit/locale/LocaleSelect';
|
|
5
|
+
import defaultLocales from '@atlaskit/locale/default-locales';
|
|
5
6
|
import { locales } from '@atlaskit/media-ui/locales';
|
|
6
7
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
7
8
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/** deprecated Use React Testing Library's waitFor like method instead */
|
|
2
2
|
// eslint-disable-next-line @atlaskit/platform/no-set-immediate
|
|
3
3
|
export var flushPromises = function flushPromises() {
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
return (
|
|
5
|
+
// eslint-disable-next-line @atlaskit/platform/no-set-immediate
|
|
6
|
+
new Promise(function (resolve) {
|
|
7
|
+
return setImmediate(resolve);
|
|
8
|
+
})
|
|
9
|
+
);
|
|
7
10
|
};
|
package/dist/esm/story-styles.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled, @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles */
|
|
1
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import styled from '@emotion/styled';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
+
|
|
3
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
4
8
|
export var Matrix = styled.table({
|
|
5
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const defaultCollectionName = "MediaServicesSample";
|
|
2
2
|
export declare const onlyAnimatedGifsCollectionName = "only-animated-gifs";
|
|
3
|
-
export declare const fileCollectionName
|
|
3
|
+
export declare const fileCollectionName: 'MediaServicesSampleFiles';
|
|
4
4
|
export declare const defaultMediaPickerCollectionName = "mediapicker-test";
|
|
5
5
|
export declare const collectionNames: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const asMock: (fn: Function) => jest.Mock;
|
|
2
2
|
export declare const asMockFunction: <T extends (...args: any[]) => any>(fn: T) => jest.MockedFunction<T>;
|
|
3
|
-
export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock
|
|
3
|
+
export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock;
|
|
4
4
|
export declare const asMockFunctionReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.MockedFunction<T>;
|
|
5
5
|
export declare const asMockFunctionResolvedValue: <T extends (...args: any[]) => any>(fn: T, resolveValue: jest.ResolvedValue<ReturnType<T>>) => jest.MockedFunction<T>;
|
|
6
6
|
export declare const expectToEqual: <T>(actual: T, expected: T) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MediaClient } from '@atlaskit/media-client';
|
|
2
2
|
import { type MediaClientConfig } from '@atlaskit/media-core';
|
|
3
3
|
import { type MediaEnv } from './mediaPickerAuthProvider';
|
|
4
|
-
export declare const defaultBaseUrl
|
|
4
|
+
export declare const defaultBaseUrl: 'https://media.staging.atl-paas.net';
|
|
5
5
|
export declare const defaultParams: {
|
|
6
6
|
clientId: string;
|
|
7
7
|
asapIssuer: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { type MockStub } from './getJest';
|
|
1
2
|
export declare function mockCanvas(width?: number, height?: number): {
|
|
2
3
|
canvas: {
|
|
3
4
|
width: number;
|
|
4
5
|
height: number;
|
|
5
|
-
toDataURL: jest.Mock<any, any, any> |
|
|
6
|
+
toDataURL: jest.Mock<any, any, any> | MockStub<unknown, unknown>;
|
|
6
7
|
getContext: unknown;
|
|
7
8
|
};
|
|
8
9
|
context: Partial<CanvasRenderingContext2D>;
|
package/dist/types/nextTick.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const nextTick: () => Promise<void>;
|
|
2
|
-
export declare const sleep: (time?: number) => Promise<
|
|
2
|
+
export declare const sleep: (time?: number) => Promise<void>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { type StyledComponent } from '@emotion/styled';
|
|
2
|
+
import type { Theme } from '@emotion/react';
|
|
3
|
+
import type { DetailedHTMLProps, TableHTMLAttributes } from 'react';
|
|
4
|
+
export declare const Matrix: StyledComponent<{
|
|
5
|
+
theme?: Theme;
|
|
3
6
|
as?: React.ElementType;
|
|
4
|
-
},
|
|
7
|
+
}, DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, {}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const defaultCollectionName = "MediaServicesSample";
|
|
2
2
|
export declare const onlyAnimatedGifsCollectionName = "only-animated-gifs";
|
|
3
|
-
export declare const fileCollectionName
|
|
3
|
+
export declare const fileCollectionName: 'MediaServicesSampleFiles';
|
|
4
4
|
export declare const defaultMediaPickerCollectionName = "mediapicker-test";
|
|
5
5
|
export declare const collectionNames: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const asMock: (fn: Function) => jest.Mock;
|
|
2
2
|
export declare const asMockFunction: <T extends (...args: any[]) => any>(fn: T) => jest.MockedFunction<T>;
|
|
3
|
-
export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock
|
|
3
|
+
export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock;
|
|
4
4
|
export declare const asMockFunctionReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.MockedFunction<T>;
|
|
5
5
|
export declare const asMockFunctionResolvedValue: <T extends (...args: any[]) => any>(fn: T, resolveValue: jest.ResolvedValue<ReturnType<T>>) => jest.MockedFunction<T>;
|
|
6
6
|
export declare const expectToEqual: <T>(actual: T, expected: T) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MediaClient } from '@atlaskit/media-client';
|
|
2
2
|
import { type MediaClientConfig } from '@atlaskit/media-core';
|
|
3
3
|
import { type MediaEnv } from './mediaPickerAuthProvider';
|
|
4
|
-
export declare const defaultBaseUrl
|
|
4
|
+
export declare const defaultBaseUrl: 'https://media.staging.atl-paas.net';
|
|
5
5
|
export declare const defaultParams: {
|
|
6
6
|
clientId: string;
|
|
7
7
|
asapIssuer: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { type MockStub } from './getJest';
|
|
1
2
|
export declare function mockCanvas(width?: number, height?: number): {
|
|
2
3
|
canvas: {
|
|
3
4
|
width: number;
|
|
4
5
|
height: number;
|
|
5
|
-
toDataURL: jest.Mock<any, any, any> |
|
|
6
|
+
toDataURL: jest.Mock<any, any, any> | MockStub<unknown, unknown>;
|
|
6
7
|
getContext: unknown;
|
|
7
8
|
};
|
|
8
9
|
context: Partial<CanvasRenderingContext2D>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const nextTick: () => Promise<void>;
|
|
2
|
-
export declare const sleep: (time?: number) => Promise<
|
|
2
|
+
export declare const sleep: (time?: number) => Promise<void>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { type StyledComponent } from '@emotion/styled';
|
|
2
|
+
import type { Theme } from '@emotion/react';
|
|
3
|
+
import type { DetailedHTMLProps, TableHTMLAttributes } from 'react';
|
|
4
|
+
export declare const Matrix: StyledComponent<{
|
|
5
|
+
theme?: Theme;
|
|
3
6
|
as?: React.ElementType;
|
|
4
|
-
},
|
|
7
|
+
}, DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, {}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-test-helpers",
|
|
3
|
-
"version": "40.0.
|
|
3
|
+
"version": "40.0.8",
|
|
4
4
|
"description": "Collection of test helpers used in media component stories and specs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -25,21 +25,21 @@
|
|
|
25
25
|
"team": "Media Exif"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@atlaskit/button": "^23.
|
|
28
|
+
"@atlaskit/button": "^23.11.0",
|
|
29
29
|
"@atlaskit/checkbox": "^17.3.0",
|
|
30
30
|
"@atlaskit/form": "^15.5.0",
|
|
31
31
|
"@atlaskit/icon": "^34.0.0",
|
|
32
|
-
"@atlaskit/locale": "^
|
|
32
|
+
"@atlaskit/locale": "^4.0.0",
|
|
33
33
|
"@atlaskit/media-client": "^36.0.0",
|
|
34
34
|
"@atlaskit/media-common": "^13.0.0",
|
|
35
35
|
"@atlaskit/media-state": "^2.0.0",
|
|
36
36
|
"@atlaskit/media-ui": "^28.7.0",
|
|
37
37
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
38
38
|
"@atlaskit/popup": "^4.16.0",
|
|
39
|
-
"@atlaskit/primitives": "^
|
|
39
|
+
"@atlaskit/primitives": "^19.0.0",
|
|
40
40
|
"@atlaskit/tabs": "^19.0.0",
|
|
41
|
-
"@atlaskit/textfield": "^8.
|
|
42
|
-
"@atlaskit/tokens": "^
|
|
41
|
+
"@atlaskit/textfield": "^8.3.0",
|
|
42
|
+
"@atlaskit/tokens": "^13.0.0",
|
|
43
43
|
"@atlaskit/tooltip": "^21.1.0",
|
|
44
44
|
"@atlaskit/ufo": "^0.4.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|