@atlaskit/media-test-helpers 29.0.1 → 29.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 +15 -0
- package/dist/cjs/MockGlobalImage.js +3 -1
- package/dist/cjs/clipboardEventMocks.js +1 -1
- package/dist/cjs/example-mediaFeatureFlags.js +2 -2
- package/dist/cjs/featureFlagsWrapper/dropdown.js +5 -5
- package/dist/cjs/featureFlagsWrapper/helpers.js +2 -2
- package/dist/cjs/fileReader.js +5 -4
- package/dist/cjs/fileStateFactory/createFileState.js +93 -0
- package/dist/cjs/fileStateFactory/factory.js +174 -0
- package/dist/cjs/fileStateFactory/helpers.js +110 -0
- package/dist/cjs/fileStateFactory/index.js +41 -0
- package/dist/cjs/index.js +39 -1
- package/dist/cjs/keyboardEventWithKeyCode.js +5 -3
- package/dist/cjs/mediaClientErrors.js +10 -4
- package/dist/cjs/mediaPickerMocks.js +2 -2
- package/dist/cjs/mockData/index.js +4 -3
- package/dist/cjs/mockLoadImage.js +2 -2
- package/dist/cjs/mocks/fileAndDirectoriesUtils.js +2 -2
- package/dist/cjs/mocks/routers/api-router.js +2 -2
- package/dist/cjs/mocks/websockets/remote-upload-server.js +4 -2
- package/dist/cjs/mountWithIntlContext.js +7 -4
- package/dist/cjs/renderWithIntl.js +22 -0
- package/dist/cjs/smart-card-state.js +108 -0
- package/dist/cjs/story-styles.js +2 -2
- package/dist/cjs/styled.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/featureFlagsWrapper/dropdown.js +2 -2
- package/dist/es2019/fileStateFactory/createFileState.js +78 -0
- package/dist/es2019/fileStateFactory/factory.js +87 -0
- package/dist/es2019/fileStateFactory/helpers.js +86 -0
- package/dist/es2019/fileStateFactory/index.js +3 -0
- package/dist/es2019/index.js +3 -2
- package/dist/es2019/mediaClientErrors.js +3 -2
- package/dist/es2019/renderWithIntl.js +8 -0
- package/dist/es2019/smart-card-state.js +100 -0
- package/dist/es2019/story-styles.js +1 -1
- package/dist/es2019/styled.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/MockGlobalImage.js +2 -1
- package/dist/esm/clipboardEventMocks.js +1 -1
- package/dist/esm/example-mediaFeatureFlags.js +2 -2
- package/dist/esm/featureFlagsWrapper/dropdown.js +2 -2
- package/dist/esm/featureFlagsWrapper/helpers.js +2 -2
- package/dist/esm/fileReader.js +4 -3
- package/dist/esm/fileStateFactory/createFileState.js +80 -0
- package/dist/esm/fileStateFactory/factory.js +161 -0
- package/dist/esm/fileStateFactory/helpers.js +96 -0
- package/dist/esm/fileStateFactory/index.js +3 -0
- package/dist/esm/index.js +3 -2
- package/dist/esm/keyboardEventWithKeyCode.js +4 -3
- package/dist/esm/mediaClientErrors.js +6 -3
- package/dist/esm/mediaPickerMocks.js +2 -2
- package/dist/esm/mockData/index.js +3 -2
- package/dist/esm/mockLoadImage.js +2 -2
- package/dist/esm/mocks/fileAndDirectoriesUtils.js +2 -2
- package/dist/esm/mocks/routers/api-router.js +2 -2
- package/dist/esm/mocks/websockets/remote-upload-server.js +4 -2
- package/dist/esm/mountWithIntlContext.js +6 -4
- package/dist/esm/renderWithIntl.js +8 -0
- package/dist/esm/smart-card-state.js +100 -0
- package/dist/esm/story-styles.js +1 -1
- package/dist/esm/styled.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/featureFlagsWrapper/helpers.d.ts +1 -1
- package/dist/types/fileStateFactory/createFileState.d.ts +10 -0
- package/dist/types/fileStateFactory/factory.d.ts +42 -0
- package/dist/types/fileStateFactory/helpers.d.ts +7 -0
- package/dist/types/fileStateFactory/index.d.ts +4 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/mediaClientErrors.d.ts +2 -1
- package/dist/types/renderWithIntl.d.ts +3 -0
- package/dist/types/smart-card-state.d.ts +2 -0
- package/dist/types/story-styles.d.ts +2 -2
- package/dist/types/styled.d.ts +1 -1
- package/package.json +9 -7
- package/renderWithIntl/package.json +7 -0
- package/smart-card-state/package.json +7 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
4
|
import { RECENTS_COLLECTION } from '@atlaskit/media-client/constants';
|
|
4
5
|
export { exactMatch, exactMatchBody, exactMatchHeaders, exactMatchUrl, matchMethod } from './matchers';
|
|
5
6
|
export { dataURItoBlob, fillInResponse } from './utils';
|
|
6
7
|
export { copyWithToken, getFile, getFileImage, userCollectionFetch } from './handlers';
|
|
7
|
-
export var MockContext = function MockContext() {
|
|
8
|
+
export var MockContext = /*#__PURE__*/_createClass(function MockContext() {
|
|
8
9
|
_classCallCheck(this, MockContext);
|
|
9
10
|
|
|
10
11
|
_defineProperty(this, "userContext", {
|
|
@@ -26,4 +27,4 @@ export var MockContext = function MockContext() {
|
|
|
26
27
|
collection: [],
|
|
27
28
|
collectionName: 'MediaServicesSample'
|
|
28
29
|
});
|
|
29
|
-
};
|
|
30
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3
|
+
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; }
|
|
4
4
|
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
5
|
+
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) { _defineProperty(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; }
|
|
6
6
|
|
|
7
7
|
var getOrientationMock;
|
|
8
8
|
var loadImageMock; // so that jest doesn't hoist mock of media-ui and replaces actual module on every import of media-test-helpers
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3
|
+
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; }
|
|
4
4
|
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
5
|
+
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) { _defineProperty(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; }
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Some utilities and types around this API -
|
|
@@ -9,9 +9,9 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
9
9
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
10
10
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
11
11
|
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
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
|
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
14
|
+
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) { _defineProperty(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; }
|
|
15
15
|
|
|
16
16
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
17
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["type"],
|
|
5
|
+
_excluded2 = ["type"];
|
|
4
6
|
import { Server } from 'mock-socket';
|
|
5
7
|
import { Observable } from 'rxjs/Observable';
|
|
6
8
|
import { from } from 'rxjs/observable/from';
|
|
@@ -70,7 +72,7 @@ function createUserFile(database, fileId, name, collection) {
|
|
|
70
72
|
|
|
71
73
|
function sendDownstreamMessage(wsUrl, socket, database, message) {
|
|
72
74
|
var type = message.type,
|
|
73
|
-
payload = _objectWithoutProperties(message,
|
|
75
|
+
payload = _objectWithoutProperties(message, _excluded); // logs every message in console
|
|
74
76
|
|
|
75
77
|
|
|
76
78
|
logWsMessage({
|
|
@@ -134,7 +136,7 @@ export var RemoteUploadActivityServer = /*#__PURE__*/function () {
|
|
|
134
136
|
this.msgSubscription = getUpstreamMessages(this.wsServer).pipe(tap(function (_ref3) {
|
|
135
137
|
var _ref3$message = _ref3.message,
|
|
136
138
|
type = _ref3$message.type,
|
|
137
|
-
payload = _objectWithoutProperties(_ref3$message,
|
|
139
|
+
payload = _objectWithoutProperties(_ref3$message, _excluded2);
|
|
138
140
|
|
|
139
141
|
return logWsMessage({
|
|
140
142
|
url: wsUrl,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["context", "childContextTypes"],
|
|
4
|
+
_excluded2 = ["context"];
|
|
3
5
|
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
6
|
+
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; }
|
|
5
7
|
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
8
|
+
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) { _defineProperty(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; }
|
|
7
9
|
|
|
8
10
|
import React from 'react';
|
|
9
11
|
import { RawIntlProvider, createIntl, IntlProvider } from 'react-intl-next';
|
|
@@ -37,7 +39,7 @@ export var mountWithIntlContext = function mountWithIntlContext(node) {
|
|
|
37
39
|
context = _ref$context === void 0 ? {} : _ref$context,
|
|
38
40
|
_ref$childContextType = _ref.childContextTypes,
|
|
39
41
|
childContextTypes = _ref$childContextType === void 0 ? {} : _ref$childContextType,
|
|
40
|
-
additionalOptions = _objectWithoutProperties(_ref,
|
|
42
|
+
additionalOptions = _objectWithoutProperties(_ref, _excluded);
|
|
41
43
|
|
|
42
44
|
var intl = !!node.props.intl ? node.props.intl : mockIntl;
|
|
43
45
|
return mount(nodeWithIntlProp(node), _objectSpread({
|
|
@@ -51,7 +53,7 @@ export var shallowWithIntlContext = function shallowWithIntlContext(node) {
|
|
|
51
53
|
|
|
52
54
|
var _ref2$context = _ref2.context,
|
|
53
55
|
context = _ref2$context === void 0 ? {} : _ref2$context,
|
|
54
|
-
additionalOptions = _objectWithoutProperties(_ref2,
|
|
56
|
+
additionalOptions = _objectWithoutProperties(_ref2, _excluded2);
|
|
55
57
|
|
|
56
58
|
var intl = !!node.props.intl ? node.props.intl : mockIntl;
|
|
57
59
|
return shallow(nodeWithIntlProp(node), _objectSpread({
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IntlProvider } from 'react-intl-next';
|
|
3
|
+
import { render } from '@testing-library/react';
|
|
4
|
+
export var renderWithIntl = function renderWithIntl(component) {
|
|
5
|
+
return render( /*#__PURE__*/React.createElement(IntlProvider, {
|
|
6
|
+
locale: "en"
|
|
7
|
+
}, component));
|
|
8
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export var url = 'https://bitbucket.org/atlassian/incredible-monorepo/pull-requests/42';
|
|
2
|
+
export var cardState = {
|
|
3
|
+
status: 'resolved',
|
|
4
|
+
lastUpdatedAt: 1624877833614,
|
|
5
|
+
details: {
|
|
6
|
+
meta: {
|
|
7
|
+
access: 'granted',
|
|
8
|
+
visibility: 'restricted',
|
|
9
|
+
auth: [{
|
|
10
|
+
key: 'bitbucket',
|
|
11
|
+
displayName: 'Atlassian Links - Bitbucket',
|
|
12
|
+
url: 'https://id.stg.internal.atlassian.com/outboundAuth/start?containerId=4d6a1ee9-20b3-492f-a0b6-3bab6c763a8e_3f823978-fbc9-4baa-95e2-1b4c89a73027&serviceKey=bitbucket'
|
|
13
|
+
}],
|
|
14
|
+
definitionId: 'a2d59c5a-952f-4996-8cf6-1d0ad318731a',
|
|
15
|
+
key: 'bitbucket-object-provider',
|
|
16
|
+
resourceType: 'pull',
|
|
17
|
+
version: '2.0.2'
|
|
18
|
+
},
|
|
19
|
+
data: {
|
|
20
|
+
'@id': url,
|
|
21
|
+
'@context': {
|
|
22
|
+
'@vocab': 'https://www.w3.org/ns/activitystreams#',
|
|
23
|
+
atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
|
|
24
|
+
schema: 'http://schema.org/'
|
|
25
|
+
},
|
|
26
|
+
'@type': ['Object', 'atlassian:SourceCodePullRequest'],
|
|
27
|
+
url: url,
|
|
28
|
+
attributedTo: {
|
|
29
|
+
'@type': 'Person',
|
|
30
|
+
name: 'Matt Turner',
|
|
31
|
+
image: 'https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/MT-4.png'
|
|
32
|
+
},
|
|
33
|
+
'schema:dateCreated': '2019-12-12T03:20:14.858Z',
|
|
34
|
+
generator: {
|
|
35
|
+
'@type': 'Application',
|
|
36
|
+
name: 'Bitbucket',
|
|
37
|
+
icon: {
|
|
38
|
+
'@type': 'Image',
|
|
39
|
+
url: 'https://wac-cdn.atlassian.com/assets/img/favicons/bitbucket/favicon-32x32.png'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
icon: {
|
|
43
|
+
'@type': 'Image',
|
|
44
|
+
url: 'https://wac-cdn.atlassian.com/assets/img/favicons/bitbucket/favicon-32x32.png'
|
|
45
|
+
},
|
|
46
|
+
name: 'Normalise package config',
|
|
47
|
+
summary: '',
|
|
48
|
+
'atlassian:mergeSource': {
|
|
49
|
+
'@type': 'Link',
|
|
50
|
+
href: 'https://bitbucket.org/atlassian/incredible-monorepo/branch/normalise-package-config'
|
|
51
|
+
},
|
|
52
|
+
'atlassian:mergeDestination': {
|
|
53
|
+
'@type': 'Link',
|
|
54
|
+
href: 'https://bitbucket.org/atlassian/incredible-monorepo/branch/master'
|
|
55
|
+
},
|
|
56
|
+
updated: '2019-12-12T03:40:43.420Z',
|
|
57
|
+
'atlassian:mergeCommit': {
|
|
58
|
+
'@type': 'Link',
|
|
59
|
+
href: 'https://bitbucket.org/atlassian/incredible-monorepo/commits/56139bbc3793'
|
|
60
|
+
},
|
|
61
|
+
'atlassian:internalId': '42',
|
|
62
|
+
'atlassian:isMerged': true,
|
|
63
|
+
'atlassian:state': 'MERGED',
|
|
64
|
+
'atlassian:mergedBy': {
|
|
65
|
+
'@type': 'Person',
|
|
66
|
+
name: 'Matt Turner',
|
|
67
|
+
image: 'https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/MT-4.png'
|
|
68
|
+
},
|
|
69
|
+
'atlassian:reviewer': [{
|
|
70
|
+
'@type': 'Person',
|
|
71
|
+
name: 'ᴄᴏsᴍᴏ',
|
|
72
|
+
image: 'https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/default-avatar-1.png'
|
|
73
|
+
}],
|
|
74
|
+
'atlassian:reviewedBy': [{
|
|
75
|
+
'@type': 'Person',
|
|
76
|
+
name: 'ᴄᴏsᴍᴏ',
|
|
77
|
+
image: 'https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/default-avatar-1.png'
|
|
78
|
+
}],
|
|
79
|
+
'atlassian:updatedBy': {
|
|
80
|
+
'@type': 'Person',
|
|
81
|
+
name: 'Matt Turner',
|
|
82
|
+
image: 'https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/MT-4.png'
|
|
83
|
+
},
|
|
84
|
+
audience: [{
|
|
85
|
+
'@type': 'Person',
|
|
86
|
+
name: 'Matt Turner',
|
|
87
|
+
image: 'https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/MT-4.png'
|
|
88
|
+
}, {
|
|
89
|
+
'@type': 'Person',
|
|
90
|
+
name: 'ᴄᴏsᴍᴏ',
|
|
91
|
+
image: 'https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/default-avatar-1.png'
|
|
92
|
+
}],
|
|
93
|
+
context: {
|
|
94
|
+
'@type': 'atlassian:SourceCodeRepository',
|
|
95
|
+
name: 'incredible-monorepo',
|
|
96
|
+
url: 'https://bitbucket.org/atlassian/incredible-monorepo'
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
package/dist/esm/story-styles.js
CHANGED
|
@@ -2,5 +2,5 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import styled from 'styled
|
|
5
|
+
import styled from '@emotion/styled';
|
|
6
6
|
export var Matrix = styled.table(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n thead {\n td {\n text-align: center;\n font-weight: bold;\n font-size: 20px;\n }\n }\n\n tbody {\n td {\n padding: 25px 10px;\n }\n }\n\n td {\n margin: auto;\n text-align: center;\n vertical-align: middle;\n\n &:first-child {\n font-weight: bold;\n font-size: 20px;\n }\n\n > div {\n display: flex;\n justify-content: center;\n text-align: left;\n }\n }\n"])));
|
package/dist/esm/styled.js
CHANGED
|
@@ -2,5 +2,5 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import styled from 'styled
|
|
5
|
+
import styled from '@emotion/styled';
|
|
6
6
|
export var LocaleSelectorWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: fixed;\n right: 20px;\n top: 20px;\n width: 200px;\n border: 1px solid #ccc;\n padding: 10px;\n border-radius: 3px;\n background-color: white;\n\n h2 {\n margin-bottom: 10px;\n }\n"])));
|
package/dist/esm/version.json
CHANGED
|
@@ -2,4 +2,4 @@ import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
|
2
2
|
export declare const setLocalFeatureFlag: (key: keyof MediaFeatureFlags, value: number | boolean | string | Object) => void;
|
|
3
3
|
export declare const clearLocalFeatureFlag: (key: keyof MediaFeatureFlags) => void;
|
|
4
4
|
export declare const clearAllLocalFeatureFlags: () => void;
|
|
5
|
-
export declare const getMediaFeatureFlags: (filter?: ("newCardExperience" | "captions" | "mediaInline" | "folderUploads")[] | undefined) => MediaFeatureFlags;
|
|
5
|
+
export declare const getMediaFeatureFlags: (filter?: ("newCardExperience" | "captions" | "mediaInline" | "folderUploads" | "timestampOnVideo" | "observedWidth")[] | undefined) => MediaFeatureFlags;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileState, FileDetails } from '@atlaskit/media-client';
|
|
2
|
+
export declare type FileStateStatus = FileState['status'];
|
|
3
|
+
export declare type CreateFileStateOptions = {
|
|
4
|
+
withRemotePreview?: boolean;
|
|
5
|
+
withLocalPreview?: boolean;
|
|
6
|
+
withBrokenLocalPreview?: boolean;
|
|
7
|
+
uploadProgress?: number;
|
|
8
|
+
fileDetails?: Partial<FileDetails>;
|
|
9
|
+
};
|
|
10
|
+
export declare const createFileState: (id: string, status: FileStateStatus, { withRemotePreview, withLocalPreview, withBrokenLocalPreview, uploadProgress, fileDetails, }?: CreateFileStateOptions) => FileState;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FileIdentifier, FileState, MediaClient, FileDetails } from '@atlaskit/media-client';
|
|
2
|
+
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
3
|
+
import { MediaClientConfig } from '@atlaskit/media-core';
|
|
4
|
+
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
5
|
+
import { CreateFileStateOptions, FileStateStatus } from './createFileState';
|
|
6
|
+
export declare type MediaClientMockOptions = {
|
|
7
|
+
getImageDelay?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare class MediaClientMock extends MediaClient {
|
|
10
|
+
private observable;
|
|
11
|
+
private options;
|
|
12
|
+
constructor(observable: ReplaySubject<FileState>, mediaClientConfig: MediaClientConfig, featureFlags?: MediaFeatureFlags, options?: MediaClientMockOptions);
|
|
13
|
+
updateObserbable: (newObservable: ReplaySubject<FileState>) => void;
|
|
14
|
+
getImage: () => Promise<Blob>;
|
|
15
|
+
private mockFileFetcher;
|
|
16
|
+
}
|
|
17
|
+
export declare type FileStateFactoryOptions = {
|
|
18
|
+
fileDetails?: Partial<FileDetails>;
|
|
19
|
+
mediaClientConfig?: MediaClientConfig;
|
|
20
|
+
featureFlags?: MediaFeatureFlags;
|
|
21
|
+
mediaClientMockOptions?: MediaClientMockOptions;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A fake Media Client that provides a backdoor to inject
|
|
25
|
+
* simulated file states. With this class, we can test several scenarios
|
|
26
|
+
* without having to recreate them all in the backend.
|
|
27
|
+
*/
|
|
28
|
+
export declare class FileStateFactory {
|
|
29
|
+
private identifier;
|
|
30
|
+
private fileDetails?;
|
|
31
|
+
mediaClient: MediaClientMock;
|
|
32
|
+
private observable;
|
|
33
|
+
constructor(identifier: FileIdentifier, { fileDetails, mediaClientConfig, featureFlags, mediaClientMockOptions, }?: FileStateFactoryOptions);
|
|
34
|
+
updateIdentifier: (identifier: FileIdentifier, fileDetails?: Partial<FileDetails> | undefined) => void;
|
|
35
|
+
subscription: {
|
|
36
|
+
next: (fileState: FileState) => void;
|
|
37
|
+
error: (error: Error) => void;
|
|
38
|
+
};
|
|
39
|
+
createFileState: (status: FileStateStatus, options?: CreateFileStateOptions | undefined) => FileState;
|
|
40
|
+
next: (status: FileStateStatus, options?: CreateFileStateOptions | undefined) => void;
|
|
41
|
+
error: (error: Error) => void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FileIdentifier, FileDetails, MediaType } from '@atlaskit/media-client';
|
|
2
|
+
export declare const defaultFileDetails: Partial<FileDetails>;
|
|
3
|
+
export declare const createIdentifier: ({ collectionName, occurrenceKey, }?: {
|
|
4
|
+
occurrenceKey?: string | undefined;
|
|
5
|
+
collectionName?: string | undefined;
|
|
6
|
+
}) => FileIdentifier;
|
|
7
|
+
export declare const createFileDetails: (id: string, mediaType?: MediaType) => FileDetails;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -43,5 +43,7 @@ export { enableMockGlobalImage, disableMockGlobalImage, } from './MockGlobalImag
|
|
|
43
43
|
export { exampleMediaFeatureFlags } from './example-mediaFeatureFlags';
|
|
44
44
|
export { dataURItoBlob } from './mockData/utils';
|
|
45
45
|
export { mapDataUriToBlob } from './utils/index';
|
|
46
|
-
export { createPollingMaxAttemptsError, createRateLimitedError, } from './mediaClientErrors';
|
|
46
|
+
export { createPollingMaxAttemptsError, createRateLimitedError, createMediaStoreError, } from './mediaClientErrors';
|
|
47
47
|
export { default as FeatureFlagsWrapper } from './featureFlagsWrapper';
|
|
48
|
+
export { FileStateFactory, MediaClientMock, createIdentifier, createFileDetails, createFileState, } from './fileStateFactory';
|
|
49
|
+
export type { FileStateFactoryOptions, MediaClientMockOptions, } from './fileStateFactory';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { RequestError, RequestErrorMetadata, PollingError } from '@atlaskit/media-client';
|
|
1
|
+
import { RequestError, RequestErrorMetadata, PollingError, MediaStoreError } from '@atlaskit/media-client';
|
|
2
2
|
export declare const createRateLimitedError: (metadata?: RequestErrorMetadata) => RequestError;
|
|
3
3
|
export declare const createPollingMaxAttemptsError: (attempts?: number) => PollingError;
|
|
4
|
+
export declare const createMediaStoreError: () => MediaStoreError;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Matrix:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Matrix: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, Pick<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "id" | "style" | "summary" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "cellPadding" | "cellSpacing">, any>;
|
package/dist/types/styled.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const LocaleSelectorWrapper: import("styled-
|
|
2
|
+
export declare const LocaleSelectorWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "id" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css">, any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-test-helpers",
|
|
3
|
-
"version": "29.0
|
|
3
|
+
"version": "29.1.0",
|
|
4
4
|
"description": "Collection of test helpers used in media component stories and specs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -21,17 +21,19 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@atlaskit/button": "^16.0.0",
|
|
23
23
|
"@atlaskit/checkbox": "^12.2.0",
|
|
24
|
-
"@atlaskit/icon": "^21.
|
|
24
|
+
"@atlaskit/icon": "^21.10.0",
|
|
25
25
|
"@atlaskit/locale": "^2.1.0",
|
|
26
26
|
"@atlaskit/media-client": "^14.3.0",
|
|
27
27
|
"@atlaskit/media-common": "^2.10.0",
|
|
28
28
|
"@atlaskit/media-core": "^32.2.0",
|
|
29
29
|
"@atlaskit/media-picker": "^59.0.0",
|
|
30
|
-
"@atlaskit/media-ui": "^
|
|
31
|
-
"@atlaskit/popup": "^1.
|
|
30
|
+
"@atlaskit/media-ui": "^19.0.0",
|
|
31
|
+
"@atlaskit/popup": "^1.3.0",
|
|
32
32
|
"@atlaskit/textfield": "^5.0.1",
|
|
33
33
|
"@atlaskit/tooltip": "^17.5.0",
|
|
34
34
|
"@babel/runtime": "^7.0.0",
|
|
35
|
+
"@emotion/styled": "^10.0.7",
|
|
36
|
+
"@testing-library/react": "^8.0.1",
|
|
35
37
|
"enzyme": "^3.10.0",
|
|
36
38
|
"exenv": "^1.2.2",
|
|
37
39
|
"kakapo": "^4.0.6",
|
|
@@ -39,14 +41,12 @@
|
|
|
39
41
|
"mock-socket": "^9.0.3",
|
|
40
42
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
41
43
|
"react-redux": "^5.1.2",
|
|
42
|
-
"styled-components": "^3.2.6",
|
|
43
44
|
"uuid": "^3.1.0",
|
|
44
45
|
"xhr-mock": "^2.4.0"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
48
|
"react": "^16.8.0",
|
|
48
|
-
"rxjs": "^5.5.0"
|
|
49
|
-
"styled-components": "^3.2.6"
|
|
49
|
+
"rxjs": "^5.5.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -55,6 +55,8 @@
|
|
|
55
55
|
"typescript": "3.9.6"
|
|
56
56
|
},
|
|
57
57
|
"af:exports": {
|
|
58
|
+
"./renderWithIntl": "./src/renderWithIntl.tsx",
|
|
59
|
+
"./smart-card-state": "./src/smart-card-state.ts",
|
|
58
60
|
"./fakeMediaClient": "./src/fakeMediaClient.ts",
|
|
59
61
|
"./media-mock": "./src/mocks/media-mock.ts",
|
|
60
62
|
"./images": "./src/images.tsx",
|