@atlaskit/media-test-helpers 41.1.0 → 42.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/AGENTS.md +58 -0
- package/CHANGELOG.md +37 -0
- package/I18nWrapper/package.json +1 -8
- package/MockGlobalImage/package.json +1 -8
- package/authProvider/package.json +1 -8
- package/await-error/package.json +1 -8
- package/clipboardEventMocks/package.json +1 -8
- package/collectionNames/package.json +1 -8
- package/createFileState/package.json +1 -8
- package/createMouseEvent/package.json +1 -8
- package/createTouchEvent/package.json +1 -8
- package/dist/cjs/authProvider.js +6 -6
- package/dist/cjs/await-error.js +13 -12
- package/dist/cjs/featureFlagsWrapper/dropdown.js +1 -2
- package/dist/cjs/fileStateFactory/factory/factory.js +7 -7
- package/dist/cjs/fileStateFactory/fileSimulation/simulations.js +66 -66
- package/dist/cjs/getAuthFromContextProvider.js +4 -4
- package/dist/cjs/getMediaAuthProvider.js +4 -4
- package/dist/cjs/mediaPickerAuthProvider.js +4 -4
- package/dist/cjs/mocks/routers/api-router.js +11 -11
- package/dist/cjs/waitUntil.js +2 -2
- package/dist/es2019/featureFlagsWrapper/dropdown.js +1 -2
- package/dist/esm/authProvider.js +6 -6
- package/dist/esm/await-error.js +13 -12
- package/dist/esm/featureFlagsWrapper/dropdown.js +1 -2
- package/dist/esm/fileStateFactory/factory/factory.js +7 -7
- package/dist/esm/fileStateFactory/fileSimulation/simulations.js +66 -66
- package/dist/esm/getAuthFromContextProvider.js +4 -4
- package/dist/esm/getMediaAuthProvider.js +4 -4
- package/dist/esm/mediaPickerAuthProvider.js +4 -4
- package/dist/esm/mocks/routers/api-router.js +11 -11
- package/dist/esm/waitUntil.js +2 -2
- package/docs-content-tabs/package.json +1 -8
- package/exampleMediaFeatureFlags/package.json +1 -8
- package/exampleMediaItems/package.json +1 -8
- package/factory/package.json +1 -8
- package/fakeI18n/package.json +1 -8
- package/fakeMediaClient/package.json +1 -8
- package/featureFlagsWrapper/package.json +1 -8
- package/fileReader/package.json +1 -8
- package/fileSimulation/package.json +1 -8
- package/flushPromises/package.json +1 -8
- package/getAuthFromContextProvider/package.json +1 -8
- package/getMediaAuthProvider/package.json +1 -8
- package/globalEventEmitterListeners/package.json +1 -8
- package/helpers/package.json +1 -8
- package/images/package.json +1 -8
- package/jestHelpers/package.json +1 -8
- package/keyboardEventWithKeyCode/package.json +1 -8
- package/media-mock/package.json +1 -8
- package/mediaBaseURLS/package.json +1 -8
- package/mediaClientProvider/package.json +1 -8
- package/mediaPickerAuthProvider/package.json +1 -8
- package/mock-data-utils/package.json +1 -8
- package/mockCanvas/package.json +1 -8
- package/mockData/package.json +1 -8
- package/mockLoadImage/package.json +1 -8
- package/nextTick/package.json +1 -8
- package/package.json +22 -33
- package/renderWithIntl/package.json +1 -8
- package/simulations/package.json +1 -8
- package/smallImageURI/package.json +1 -8
- package/smallTransparentImageURI/package.json +1 -8
- package/smart-card-state/package.json +1 -8
- package/story-list/package.json +1 -8
- package/story-styles/package.json +1 -8
- package/tallImageURI/package.json +1 -8
- package/timeoutPromise/package.json +1 -8
- package/ufoLogger/package.json +1 -8
- package/utils/package.json +1 -8
- package/videoPreviewURI/package.json +1 -8
- package/videoURI/package.json +1 -8
- package/vr-test-small-image/package.json +1 -8
- package/waitUntil/package.json +1 -8
- package/wideImageURI/package.json +1 -8
- package/wideTransparentImageURI/package.json +1 -8
- package/dist/types-ts4.5/I18nWrapper.d.ts +0 -10
- package/dist/types-ts4.5/MockGlobalImage.d.ts +0 -2
- package/dist/types-ts4.5/authProvider.d.ts +0 -6
- package/dist/types-ts4.5/await-error.d.ts +0 -1
- package/dist/types-ts4.5/clipboardEventMocks.d.ts +0 -122
- package/dist/types-ts4.5/collectionNames.d.ts +0 -5
- package/dist/types-ts4.5/createMouseEvent.d.ts +0 -8
- package/dist/types-ts4.5/createTouchEvent.d.ts +0 -4
- package/dist/types-ts4.5/dataURIs/smallImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/smallTransparentImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/tallImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/videoPreviewURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/videoURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/vr_test_small_image.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/wideImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/wideTransparentImageURI.d.ts +0 -1
- package/dist/types-ts4.5/docs-content-tabs.d.ts +0 -14
- package/dist/types-ts4.5/example-mediaFeatureFlags.d.ts +0 -2
- package/dist/types-ts4.5/exampleMediaItems.d.ts +0 -56
- package/dist/types-ts4.5/fakeI18n.d.ts +0 -1
- package/dist/types-ts4.5/fakeMediaClient.d.ts +0 -4
- package/dist/types-ts4.5/featureFlagsWrapper/dropdown.d.ts +0 -6
- package/dist/types-ts4.5/featureFlagsWrapper/helpers.d.ts +0 -5
- package/dist/types-ts4.5/featureFlagsWrapper/index.d.ts +0 -5
- package/dist/types-ts4.5/fileReader.d.ts +0 -19
- package/dist/types-ts4.5/fileStateFactory/factory/createFileState.d.ts +0 -10
- package/dist/types-ts4.5/fileStateFactory/factory/factory.d.ts +0 -45
- package/dist/types-ts4.5/fileStateFactory/factory/helpers.d.ts +0 -7
- package/dist/types-ts4.5/fileStateFactory/factory/index.d.ts +0 -4
- package/dist/types-ts4.5/fileStateFactory/fileSimulation/fileSimulation.d.ts +0 -18
- package/dist/types-ts4.5/fileStateFactory/fileSimulation/index.d.ts +0 -4
- package/dist/types-ts4.5/fileStateFactory/fileSimulation/simulations.d.ts +0 -36
- package/dist/types-ts4.5/fileStateFactory/index.d.ts +0 -8
- package/dist/types-ts4.5/flushPromises.d.ts +0 -2
- package/dist/types-ts4.5/getAuthFromContextProvider.d.ts +0 -1
- package/dist/types-ts4.5/getJest.d.ts +0 -15
- package/dist/types-ts4.5/getMediaAuthProvider.d.ts +0 -3
- package/dist/types-ts4.5/globalEventEmitterListeners.d.ts +0 -1
- package/dist/types-ts4.5/images.d.ts +0 -7
- package/dist/types-ts4.5/index.d.ts +0 -48
- package/dist/types-ts4.5/jestHelpers.d.ts +0 -12
- package/dist/types-ts4.5/keyboardEventWithKeyCode.d.ts +0 -2
- package/dist/types-ts4.5/mediaBaseURLS.d.ts +0 -2
- package/dist/types-ts4.5/mediaClientProvider.d.ts +0 -23
- package/dist/types-ts4.5/mediaPickerAuthProvider.d.ts +0 -3
- package/dist/types-ts4.5/mockCanvas.d.ts +0 -10
- package/dist/types-ts4.5/mockData/handlers/copyWithToken.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/getFile.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/getFileImage.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/index.d.ts +0 -5
- package/dist/types-ts4.5/mockData/handlers/tenantAuth.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/userCollectionFetch.d.ts +0 -3
- package/dist/types-ts4.5/mockData/index.d.ts +0 -50
- package/dist/types-ts4.5/mockData/matchers.d.ts +0 -7
- package/dist/types-ts4.5/mockData/staticCommon.d.ts +0 -4
- package/dist/types-ts4.5/mockData/utils.d.ts +0 -4
- package/dist/types-ts4.5/mockLoadImage.d.ts +0 -4
- package/dist/types-ts4.5/mocks/database/chunk.d.ts +0 -6
- package/dist/types-ts4.5/mocks/database/collection-item.d.ts +0 -29
- package/dist/types-ts4.5/mocks/database/collection.d.ts +0 -5
- package/dist/types-ts4.5/mocks/database/index.d.ts +0 -21
- package/dist/types-ts4.5/mocks/database/upload.d.ts +0 -6
- package/dist/types-ts4.5/mocks/fileAndDirectoriesUtils.d.ts +0 -16
- package/dist/types-ts4.5/mocks/media-mock.d.ts +0 -36
- package/dist/types-ts4.5/mocks/routers/api-router.d.ts +0 -3
- package/dist/types-ts4.5/mocks/routers/index.d.ts +0 -2
- package/dist/types-ts4.5/mocks/routers/media-playground-router.d.ts +0 -3
- package/dist/types-ts4.5/mocks/websockets/index.d.ts +0 -3
- package/dist/types-ts4.5/mocks/websockets/messages.d.ts +0 -34
- package/dist/types-ts4.5/mocks/websockets/remote-upload-server.d.ts +0 -14
- package/dist/types-ts4.5/mocks/websockets/types.d.ts +0 -4
- package/dist/types-ts4.5/nextTick.d.ts +0 -2
- package/dist/types-ts4.5/renderWithIntl.d.ts +0 -7
- package/dist/types-ts4.5/smart-card-state.d.ts +0 -4
- package/dist/types-ts4.5/story-list.d.ts +0 -13
- package/dist/types-ts4.5/story-styles.d.ts +0 -7
- package/dist/types-ts4.5/timeoutPromise.d.ts +0 -1
- package/dist/types-ts4.5/ufoLogger.d.ts +0 -5
- package/dist/types-ts4.5/utils/index.d.ts +0 -2
- package/dist/types-ts4.5/utils/logging.d.ts +0 -23
- package/dist/types-ts4.5/utils/mockData.d.ts +0 -11
- package/dist/types-ts4.5/waitUntil.d.ts +0 -2
|
@@ -18,16 +18,16 @@ var simulateProcessed = exports.simulateProcessed = function simulateProcessed()
|
|
|
18
18
|
return {
|
|
19
19
|
simulation: function () {
|
|
20
20
|
var _simulation = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(factory) {
|
|
21
|
-
return _regenerator.default.wrap(function
|
|
21
|
+
return _regenerator.default.wrap(function (_context) {
|
|
22
22
|
while (1) switch (_context.prev = _context.next) {
|
|
23
23
|
case 0:
|
|
24
|
-
_context.next =
|
|
24
|
+
_context.next = 1;
|
|
25
25
|
return (0, _nextTick.sleep)(speed);
|
|
26
|
-
case
|
|
26
|
+
case 1:
|
|
27
27
|
factory.next('processed', {
|
|
28
28
|
withRemotePreview: withRemotePreview
|
|
29
29
|
});
|
|
30
|
-
case
|
|
30
|
+
case 2:
|
|
31
31
|
case "end":
|
|
32
32
|
return _context.stop();
|
|
33
33
|
}
|
|
@@ -48,20 +48,20 @@ var simulateProcessing = exports.simulateProcessing = function simulateProcessin
|
|
|
48
48
|
description: "File is processing, then ".concat(suceeded ? 'succeeds' : 'fails', " ").concat(withRemotePreview ? 'with' : 'without', " remote preview"),
|
|
49
49
|
simulation: function () {
|
|
50
50
|
var _simulation2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(factory) {
|
|
51
|
-
return _regenerator.default.wrap(function
|
|
51
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
52
52
|
while (1) switch (_context2.prev = _context2.next) {
|
|
53
53
|
case 0:
|
|
54
|
-
_context2.next =
|
|
54
|
+
_context2.next = 1;
|
|
55
55
|
return (0, _nextTick.sleep)(speed);
|
|
56
|
-
case
|
|
56
|
+
case 1:
|
|
57
57
|
factory.next('processing');
|
|
58
|
-
_context2.next =
|
|
58
|
+
_context2.next = 2;
|
|
59
59
|
return (0, _nextTick.sleep)(speed);
|
|
60
|
-
case
|
|
60
|
+
case 2:
|
|
61
61
|
factory.next('processing');
|
|
62
|
-
_context2.next =
|
|
62
|
+
_context2.next = 3;
|
|
63
63
|
return (0, _nextTick.sleep)(speed * 0.5);
|
|
64
|
-
case
|
|
64
|
+
case 3:
|
|
65
65
|
if (!suceeded) {
|
|
66
66
|
factory.next('failed-processing', {
|
|
67
67
|
withRemotePreview: withRemotePreview
|
|
@@ -71,7 +71,7 @@ var simulateProcessing = exports.simulateProcessing = function simulateProcessin
|
|
|
71
71
|
withRemotePreview: withRemotePreview
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
case
|
|
74
|
+
case 4:
|
|
75
75
|
case "end":
|
|
76
76
|
return _context2.stop();
|
|
77
77
|
}
|
|
@@ -89,14 +89,14 @@ var simulateImmediateFailProcessing = exports.simulateImmediateFailProcessing =
|
|
|
89
89
|
description: 'The first sate is failed-processing with no preview',
|
|
90
90
|
simulation: function () {
|
|
91
91
|
var _simulation3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(factory) {
|
|
92
|
-
return _regenerator.default.wrap(function
|
|
92
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
93
93
|
while (1) switch (_context3.prev = _context3.next) {
|
|
94
94
|
case 0:
|
|
95
|
-
_context3.next =
|
|
95
|
+
_context3.next = 1;
|
|
96
96
|
return (0, _nextTick.sleep)(speed);
|
|
97
|
-
case
|
|
97
|
+
case 1:
|
|
98
98
|
factory.next('failed-processing');
|
|
99
|
-
case
|
|
99
|
+
case 2:
|
|
100
100
|
case "end":
|
|
101
101
|
return _context3.stop();
|
|
102
102
|
}
|
|
@@ -116,49 +116,49 @@ var simulateUpload = exports.simulateUpload = function simulateUpload(withLocalP
|
|
|
116
116
|
simulation: function () {
|
|
117
117
|
var _simulation4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(factory) {
|
|
118
118
|
var chunks, chunkUploadDelay, processingTime, uploadUpTo, index;
|
|
119
|
-
return _regenerator.default.wrap(function
|
|
119
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
120
120
|
while (1) switch (_context4.prev = _context4.next) {
|
|
121
121
|
case 0:
|
|
122
122
|
chunks = 3;
|
|
123
123
|
chunkUploadDelay = 500;
|
|
124
124
|
processingTime = speed;
|
|
125
|
-
_context4.next =
|
|
125
|
+
_context4.next = 1;
|
|
126
126
|
return (0, _nextTick.sleep)(speed);
|
|
127
|
-
case
|
|
127
|
+
case 1:
|
|
128
128
|
factory.next('uploading', {
|
|
129
129
|
withLocalPreview: withLocalPreview
|
|
130
130
|
});
|
|
131
131
|
uploadUpTo = !suceeded ? chunks / 2 : chunks;
|
|
132
132
|
index = 0;
|
|
133
|
-
case
|
|
133
|
+
case 2:
|
|
134
134
|
if (!(index <= uploadUpTo)) {
|
|
135
|
-
_context4.next =
|
|
135
|
+
_context4.next = 4;
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
138
|
factory.next('uploading', {
|
|
139
139
|
uploadProgress: index / chunks,
|
|
140
140
|
withLocalPreview: withLocalPreview
|
|
141
141
|
});
|
|
142
|
-
_context4.next =
|
|
142
|
+
_context4.next = 3;
|
|
143
143
|
return (0, _nextTick.sleep)(chunkUploadDelay);
|
|
144
|
-
case
|
|
144
|
+
case 3:
|
|
145
145
|
index++;
|
|
146
|
-
_context4.next =
|
|
146
|
+
_context4.next = 2;
|
|
147
147
|
break;
|
|
148
|
-
case
|
|
148
|
+
case 4:
|
|
149
149
|
if (!suceeded) {
|
|
150
150
|
factory.error(new Error('some-error'));
|
|
151
151
|
}
|
|
152
152
|
factory.next('processing', {
|
|
153
153
|
withLocalPreview: withLocalPreview
|
|
154
154
|
});
|
|
155
|
-
_context4.next =
|
|
155
|
+
_context4.next = 5;
|
|
156
156
|
return (0, _nextTick.sleep)(processingTime);
|
|
157
|
-
case
|
|
157
|
+
case 5:
|
|
158
158
|
factory.next('processed', {
|
|
159
159
|
withLocalPreview: withLocalPreview
|
|
160
160
|
});
|
|
161
|
-
case
|
|
161
|
+
case 6:
|
|
162
162
|
case "end":
|
|
163
163
|
return _context4.stop();
|
|
164
164
|
}
|
|
@@ -176,14 +176,14 @@ var simulateErrorState = exports.simulateErrorState = function simulateErrorStat
|
|
|
176
176
|
description: 'File state is error',
|
|
177
177
|
simulation: function () {
|
|
178
178
|
var _simulation5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(factory) {
|
|
179
|
-
return _regenerator.default.wrap(function
|
|
179
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
180
180
|
while (1) switch (_context5.prev = _context5.next) {
|
|
181
181
|
case 0:
|
|
182
|
-
_context5.next =
|
|
182
|
+
_context5.next = 1;
|
|
183
183
|
return (0, _nextTick.sleep)(speed);
|
|
184
|
-
case
|
|
184
|
+
case 1:
|
|
185
185
|
factory.next('error');
|
|
186
|
-
case
|
|
186
|
+
case 2:
|
|
187
187
|
case "end":
|
|
188
188
|
return _context5.stop();
|
|
189
189
|
}
|
|
@@ -201,14 +201,14 @@ var simulateError = exports.simulateError = function simulateError() {
|
|
|
201
201
|
description: 'Subscription throws an error through the observer',
|
|
202
202
|
simulation: function () {
|
|
203
203
|
var _simulation6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(factory) {
|
|
204
|
-
return _regenerator.default.wrap(function
|
|
204
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
205
205
|
while (1) switch (_context6.prev = _context6.next) {
|
|
206
206
|
case 0:
|
|
207
|
-
_context6.next =
|
|
207
|
+
_context6.next = 1;
|
|
208
208
|
return (0, _nextTick.sleep)(speed);
|
|
209
|
-
case
|
|
209
|
+
case 1:
|
|
210
210
|
factory.error(new Error('error thrown from client'));
|
|
211
|
-
case
|
|
211
|
+
case 2:
|
|
212
212
|
case "end":
|
|
213
213
|
return _context6.stop();
|
|
214
214
|
}
|
|
@@ -232,28 +232,28 @@ var simulateManyProcessed = exports.simulateManyProcessed = function simulateMan
|
|
|
232
232
|
description: '',
|
|
233
233
|
simulation: function () {
|
|
234
234
|
var _simulation7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(factory) {
|
|
235
|
-
return _regenerator.default.wrap(function
|
|
235
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
236
236
|
while (1) switch (_context7.prev = _context7.next) {
|
|
237
237
|
case 0:
|
|
238
|
-
_context7.next =
|
|
238
|
+
_context7.next = 1;
|
|
239
239
|
return (0, _nextTick.sleep)(speed);
|
|
240
|
-
case
|
|
240
|
+
case 1:
|
|
241
241
|
factory.next('processed', {
|
|
242
242
|
withRemotePreview: withRemotePreview
|
|
243
243
|
});
|
|
244
|
-
_context7.next =
|
|
244
|
+
_context7.next = 2;
|
|
245
245
|
return (0, _nextTick.sleep)(speed);
|
|
246
|
-
case
|
|
246
|
+
case 2:
|
|
247
247
|
factory.next('processed', {
|
|
248
248
|
withRemotePreview: withRemotePreview
|
|
249
249
|
});
|
|
250
|
-
_context7.next =
|
|
250
|
+
_context7.next = 3;
|
|
251
251
|
return (0, _nextTick.sleep)(speed);
|
|
252
|
-
case
|
|
252
|
+
case 3:
|
|
253
253
|
factory.next('processed', {
|
|
254
254
|
withRemotePreview: withRemotePreview
|
|
255
255
|
});
|
|
256
|
-
case
|
|
256
|
+
case 4:
|
|
257
257
|
case "end":
|
|
258
258
|
return _context7.stop();
|
|
259
259
|
}
|
|
@@ -272,19 +272,19 @@ var simulateEmptyDetails = exports.simulateEmptyDetails = function simulateEmpty
|
|
|
272
272
|
simulation: function () {
|
|
273
273
|
var _simulation8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(factory) {
|
|
274
274
|
var emptyDetails;
|
|
275
|
-
return _regenerator.default.wrap(function
|
|
275
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
276
276
|
while (1) switch (_context8.prev = _context8.next) {
|
|
277
277
|
case 0:
|
|
278
278
|
emptyDetails = {
|
|
279
279
|
createdAt: 1630986510989
|
|
280
280
|
};
|
|
281
|
-
_context8.next =
|
|
281
|
+
_context8.next = 1;
|
|
282
282
|
return (0, _nextTick.sleep)(speed);
|
|
283
|
-
case
|
|
283
|
+
case 1:
|
|
284
284
|
factory.next('processing', {
|
|
285
285
|
fileDetails: emptyDetails
|
|
286
286
|
});
|
|
287
|
-
case
|
|
287
|
+
case 2:
|
|
288
288
|
case "end":
|
|
289
289
|
return _context8.stop();
|
|
290
290
|
}
|
|
@@ -303,27 +303,27 @@ var simulateUpdateFileId = exports.simulateUpdateFileId = function simulateUpdat
|
|
|
303
303
|
simulation: function () {
|
|
304
304
|
var _simulation9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(factory, _ref) {
|
|
305
305
|
var updateIdentifier;
|
|
306
|
-
return _regenerator.default.wrap(function
|
|
306
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
307
307
|
while (1) switch (_context9.prev = _context9.next) {
|
|
308
308
|
case 0:
|
|
309
309
|
updateIdentifier = _ref.updateIdentifier;
|
|
310
|
-
_context9.next =
|
|
310
|
+
_context9.next = 1;
|
|
311
311
|
return (0, _nextTick.sleep)(speed);
|
|
312
|
-
case
|
|
312
|
+
case 1:
|
|
313
313
|
factory.next('failed-processing');
|
|
314
|
-
_context9.next =
|
|
314
|
+
_context9.next = 2;
|
|
315
315
|
return (0, _nextTick.sleep)(speed);
|
|
316
|
-
case
|
|
316
|
+
case 2:
|
|
317
317
|
updateIdentifier('doc');
|
|
318
|
-
_context9.next =
|
|
318
|
+
_context9.next = 3;
|
|
319
319
|
return (0, _nextTick.sleep)(speed);
|
|
320
|
-
case
|
|
320
|
+
case 3:
|
|
321
321
|
factory.next('processing');
|
|
322
|
-
_context9.next =
|
|
322
|
+
_context9.next = 4;
|
|
323
323
|
return (0, _nextTick.sleep)(speed);
|
|
324
|
-
case
|
|
324
|
+
case 4:
|
|
325
325
|
factory.next('processed');
|
|
326
|
-
case
|
|
326
|
+
case 5:
|
|
327
327
|
case "end":
|
|
328
328
|
return _context9.stop();
|
|
329
329
|
}
|
|
@@ -341,7 +341,7 @@ var simulateAlwaysLoading = exports.simulateAlwaysLoading = function simulateAlw
|
|
|
341
341
|
description: 'File state never fetched',
|
|
342
342
|
simulation: function () {
|
|
343
343
|
var _simulation0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
344
|
-
return _regenerator.default.wrap(function
|
|
344
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
345
345
|
while (1) switch (_context0.prev = _context0.next) {
|
|
346
346
|
case 0:
|
|
347
347
|
case "end":
|
|
@@ -361,20 +361,20 @@ var simulateAlwaysProcessing = exports.simulateAlwaysProcessing = function simul
|
|
|
361
361
|
description: 'File state is permanently processing',
|
|
362
362
|
simulation: function () {
|
|
363
363
|
var _simulation1 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee1(factory) {
|
|
364
|
-
return _regenerator.default.wrap(function
|
|
364
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
365
365
|
while (1) switch (_context1.prev = _context1.next) {
|
|
366
366
|
case 0:
|
|
367
|
-
_context1.next =
|
|
367
|
+
_context1.next = 1;
|
|
368
368
|
return (0, _nextTick.sleep)(speed);
|
|
369
|
-
case
|
|
369
|
+
case 1:
|
|
370
370
|
factory.next('processing');
|
|
371
|
-
_context1.next =
|
|
371
|
+
_context1.next = 2;
|
|
372
372
|
return (0, _nextTick.sleep)(speed);
|
|
373
|
-
case
|
|
373
|
+
case 2:
|
|
374
374
|
factory.next('processing');
|
|
375
|
-
_context1.next =
|
|
375
|
+
_context1.next = 3;
|
|
376
376
|
return (0, _nextTick.sleep)(speed * 0.5);
|
|
377
|
-
case
|
|
377
|
+
case 3:
|
|
378
378
|
case "end":
|
|
379
379
|
return _context1.stop();
|
|
380
380
|
}
|
|
@@ -20,7 +20,7 @@ var access = {
|
|
|
20
20
|
var getAuthFromContextProvider = exports.getAuthFromContextProvider = /*#__PURE__*/function () {
|
|
21
21
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
22
22
|
var url, body, headers, response;
|
|
23
|
-
return _regenerator.default.wrap(function
|
|
23
|
+
return _regenerator.default.wrap(function (_context) {
|
|
24
24
|
while (1) switch (_context.prev = _context.next) {
|
|
25
25
|
case 0:
|
|
26
26
|
url = 'https://media-playground.dev.atl-paas.net/token/tenant?environment=asap';
|
|
@@ -30,16 +30,16 @@ var getAuthFromContextProvider = exports.getAuthFromContextProvider = /*#__PURE_
|
|
|
30
30
|
headers = new Headers();
|
|
31
31
|
headers.append('Content-Type', 'application/json; charset=utf-8');
|
|
32
32
|
headers.append('Accept', 'text/plain, */*; q=0.01');
|
|
33
|
-
_context.next =
|
|
33
|
+
_context.next = 1;
|
|
34
34
|
return fetch(url, {
|
|
35
35
|
method: 'POST',
|
|
36
36
|
body: body,
|
|
37
37
|
headers: headers
|
|
38
38
|
});
|
|
39
|
-
case
|
|
39
|
+
case 1:
|
|
40
40
|
response = _context.sent;
|
|
41
41
|
return _context.abrupt("return", response.json());
|
|
42
|
-
case
|
|
42
|
+
case 2:
|
|
43
43
|
case "end":
|
|
44
44
|
return _context.stop();
|
|
45
45
|
}
|
|
@@ -20,7 +20,7 @@ var access = {
|
|
|
20
20
|
var requestMediaAuthProvider = exports.requestMediaAuthProvider = /*#__PURE__*/function () {
|
|
21
21
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
22
22
|
var url, body, headers, response;
|
|
23
|
-
return _regenerator.default.wrap(function
|
|
23
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
24
24
|
while (1) switch (_context2.prev = _context2.next) {
|
|
25
25
|
case 0:
|
|
26
26
|
url = "".concat(_mediaBaseURLS.MEDIA_PLAYGROUND_BASE_URL, "/token/tenant?environment=asap");
|
|
@@ -30,16 +30,16 @@ var requestMediaAuthProvider = exports.requestMediaAuthProvider = /*#__PURE__*/f
|
|
|
30
30
|
headers = new Headers();
|
|
31
31
|
headers.append('Content-Type', 'application/json; charset=utf-8');
|
|
32
32
|
headers.append('Accept', 'text/plain, */*; q=0.01');
|
|
33
|
-
_context2.next =
|
|
33
|
+
_context2.next = 1;
|
|
34
34
|
return fetch(url, {
|
|
35
35
|
method: 'POST',
|
|
36
36
|
body: body,
|
|
37
37
|
headers: headers
|
|
38
38
|
});
|
|
39
|
-
case
|
|
39
|
+
case 1:
|
|
40
40
|
response = _context2.sent;
|
|
41
41
|
return _context2.abrupt("return", response.json());
|
|
42
|
-
case
|
|
42
|
+
case 2:
|
|
43
43
|
case "end":
|
|
44
44
|
return _context2.stop();
|
|
45
45
|
}
|
|
@@ -37,7 +37,7 @@ var requestAuthProvider = /*#__PURE__*/function () {
|
|
|
37
37
|
headers,
|
|
38
38
|
response,
|
|
39
39
|
_args = arguments;
|
|
40
|
-
return _regenerator.default.wrap(function
|
|
40
|
+
return _regenerator.default.wrap(function (_context) {
|
|
41
41
|
while (1) switch (_context.prev = _context.next) {
|
|
42
42
|
case 0:
|
|
43
43
|
env = _args.length > 2 && _args[2] !== undefined ? _args[2] : 'staging';
|
|
@@ -50,16 +50,16 @@ var requestAuthProvider = /*#__PURE__*/function () {
|
|
|
50
50
|
headers = new Headers();
|
|
51
51
|
headers.append('Content-Type', 'application/json; charset=utf-8');
|
|
52
52
|
headers.append('Accept', 'text/plain, */*; q=0.01');
|
|
53
|
-
_context.next =
|
|
53
|
+
_context.next = 1;
|
|
54
54
|
return fetch(url, {
|
|
55
55
|
method: 'POST',
|
|
56
56
|
body: body,
|
|
57
57
|
headers: headers
|
|
58
58
|
});
|
|
59
|
-
case
|
|
59
|
+
case 1:
|
|
60
60
|
response = _context.sent;
|
|
61
61
|
return _context.abrupt("return", response.json());
|
|
62
|
-
case
|
|
62
|
+
case 2:
|
|
63
63
|
case "end":
|
|
64
64
|
return _context.stop();
|
|
65
65
|
}
|
|
@@ -171,8 +171,8 @@ function createApiRouter(isSlowServer, urlsReturnErrorsTo) {
|
|
|
171
171
|
});
|
|
172
172
|
router.get('/file/:fileId/image/metadata', /*#__PURE__*/function () {
|
|
173
173
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref5, database) {
|
|
174
|
-
var params, fileId, record, defaultDimensions, dimensions;
|
|
175
|
-
return _regenerator.default.wrap(function
|
|
174
|
+
var params, fileId, record, defaultDimensions, dimensions, _t, _t2, _t3;
|
|
175
|
+
return _regenerator.default.wrap(function (_context) {
|
|
176
176
|
while (1) switch (_context.prev = _context.next) {
|
|
177
177
|
case 0:
|
|
178
178
|
params = _ref5.params;
|
|
@@ -197,20 +197,20 @@ function createApiRouter(isSlowServer, urlsReturnErrorsTo) {
|
|
|
197
197
|
};
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
|
-
|
|
201
|
-
_context.next =
|
|
200
|
+
_t = {};
|
|
201
|
+
_context.next = 1;
|
|
202
202
|
return dimensions;
|
|
203
|
-
case
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
case 1:
|
|
204
|
+
_t2 = _context.sent;
|
|
205
|
+
_t3 = {
|
|
206
206
|
pending: false,
|
|
207
|
-
preview:
|
|
208
|
-
original:
|
|
207
|
+
preview: _t,
|
|
208
|
+
original: _t2
|
|
209
209
|
};
|
|
210
210
|
return _context.abrupt("return", {
|
|
211
|
-
metadata:
|
|
211
|
+
metadata: _t3
|
|
212
212
|
});
|
|
213
|
-
case
|
|
213
|
+
case 2:
|
|
214
214
|
case "end":
|
|
215
215
|
return _context.stop();
|
|
216
216
|
}
|
package/dist/cjs/waitUntil.js
CHANGED
|
@@ -16,7 +16,7 @@ function _waitUntil() {
|
|
|
16
16
|
var timeout,
|
|
17
17
|
maxRetries,
|
|
18
18
|
_args = arguments;
|
|
19
|
-
return _regenerator.default.wrap(function
|
|
19
|
+
return _regenerator.default.wrap(function (_context) {
|
|
20
20
|
while (1) switch (_context.prev = _context.next) {
|
|
21
21
|
case 0:
|
|
22
22
|
timeout = _args.length > 1 && _args[1] !== undefined ? _args[1] : 100;
|
|
@@ -35,7 +35,7 @@ function _waitUntil() {
|
|
|
35
35
|
};
|
|
36
36
|
_check(maxRetries);
|
|
37
37
|
}));
|
|
38
|
-
case
|
|
38
|
+
case 1:
|
|
39
39
|
case "end":
|
|
40
40
|
return _context.stop();
|
|
41
41
|
}
|
|
@@ -5,7 +5,6 @@ import { getMediaFeatureFlags, clearAllLocalFeatureFlags, setLocalFeatureFlag }
|
|
|
5
5
|
import SelectClearIcon from '@atlaskit/icon/core/cross-circle';
|
|
6
6
|
import HipchatChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
7
7
|
import Button from '@atlaskit/button/standard-button';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
10
9
|
import { Stack, xcss } from '@atlaskit/primitives';
|
|
11
10
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -118,7 +117,7 @@ const MediaFeatureFlagsDropdown = ({
|
|
|
118
117
|
size: "small"
|
|
119
118
|
})
|
|
120
119
|
}), "Media Feature Flags"),
|
|
121
|
-
shouldRenderToParent:
|
|
120
|
+
shouldRenderToParent: true
|
|
122
121
|
}), /*#__PURE__*/React.createElement(Tooltip, {
|
|
123
122
|
content: "Reset all flags"
|
|
124
123
|
}, /*#__PURE__*/React.createElement(Button
|
package/dist/esm/authProvider.js
CHANGED
|
@@ -16,7 +16,7 @@ export var StoryBookAuthProvider = /*#__PURE__*/function () {
|
|
|
16
16
|
var loadTenatAuth = /*#__PURE__*/function () {
|
|
17
17
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(collectionName) {
|
|
18
18
|
var environment, headers, config, url, response;
|
|
19
|
-
return _regeneratorRuntime.wrap(function
|
|
19
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
20
20
|
while (1) switch (_context.prev = _context.next) {
|
|
21
21
|
case 0:
|
|
22
22
|
environment = isAsapEnvironment ? 'asap' : '';
|
|
@@ -33,14 +33,14 @@ export var StoryBookAuthProvider = /*#__PURE__*/function () {
|
|
|
33
33
|
};
|
|
34
34
|
url = "".concat(MEDIA_PLAYGROUND_BASE_URL, "/token/tenant?collection=").concat(collectionName, "&environment=").concat(environment);
|
|
35
35
|
response = fetch(url, config); // We leverage the fact, that our internal /toke/tenant API returns data in the same format as Auth
|
|
36
|
-
_context.next =
|
|
36
|
+
_context.next = 1;
|
|
37
37
|
return response;
|
|
38
|
-
case
|
|
39
|
-
_context.next =
|
|
38
|
+
case 1:
|
|
39
|
+
_context.next = 2;
|
|
40
40
|
return _context.sent.json();
|
|
41
|
-
case
|
|
41
|
+
case 2:
|
|
42
42
|
return _context.abrupt("return", _context.sent);
|
|
43
|
-
case
|
|
43
|
+
case 3:
|
|
44
44
|
case "end":
|
|
45
45
|
return _context.stop();
|
|
46
46
|
}
|
package/dist/esm/await-error.js
CHANGED
|
@@ -5,28 +5,29 @@ export function awaitError(_x, _x2) {
|
|
|
5
5
|
}
|
|
6
6
|
function _awaitError() {
|
|
7
7
|
_awaitError = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(response, expectedMessage) {
|
|
8
|
-
|
|
8
|
+
var _t;
|
|
9
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
9
10
|
while (1) switch (_context.prev = _context.next) {
|
|
10
11
|
case 0:
|
|
11
12
|
_context.prev = 0;
|
|
12
|
-
_context.next =
|
|
13
|
+
_context.next = 1;
|
|
13
14
|
return response;
|
|
14
|
-
case
|
|
15
|
-
_context.next =
|
|
15
|
+
case 1:
|
|
16
|
+
_context.next = 3;
|
|
16
17
|
break;
|
|
17
|
-
case
|
|
18
|
-
_context.prev =
|
|
19
|
-
|
|
20
|
-
if (!(
|
|
21
|
-
_context.next =
|
|
18
|
+
case 2:
|
|
19
|
+
_context.prev = 2;
|
|
20
|
+
_t = _context["catch"](0);
|
|
21
|
+
if (!(_t instanceof Error && _t.message !== expectedMessage)) {
|
|
22
|
+
_context.next = 3;
|
|
22
23
|
break;
|
|
23
24
|
}
|
|
24
|
-
throw
|
|
25
|
-
case
|
|
25
|
+
throw _t;
|
|
26
|
+
case 3:
|
|
26
27
|
case "end":
|
|
27
28
|
return _context.stop();
|
|
28
29
|
}
|
|
29
|
-
}, _callee, null, [[0,
|
|
30
|
+
}, _callee, null, [[0, 2]]);
|
|
30
31
|
}));
|
|
31
32
|
return _awaitError.apply(this, arguments);
|
|
32
33
|
}
|
|
@@ -7,7 +7,6 @@ import { getMediaFeatureFlags, clearAllLocalFeatureFlags, setLocalFeatureFlag }
|
|
|
7
7
|
import SelectClearIcon from '@atlaskit/icon/core/cross-circle';
|
|
8
8
|
import HipchatChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
9
9
|
import Button from '@atlaskit/button/standard-button';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
12
11
|
import { Stack, xcss } from '@atlaskit/primitives';
|
|
13
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -134,7 +133,7 @@ var MediaFeatureFlagsDropdown = function MediaFeatureFlagsDropdown(_ref6) {
|
|
|
134
133
|
})
|
|
135
134
|
}), "Media Feature Flags");
|
|
136
135
|
},
|
|
137
|
-
shouldRenderToParent:
|
|
136
|
+
shouldRenderToParent: true
|
|
138
137
|
}), /*#__PURE__*/React.createElement(Tooltip, {
|
|
139
138
|
content: "Reset all flags"
|
|
140
139
|
}, /*#__PURE__*/React.createElement(Button
|
|
@@ -32,21 +32,21 @@ export var MediaClientMock = /*#__PURE__*/function (_MediaClient) {
|
|
|
32
32
|
});
|
|
33
33
|
_defineProperty(_this, "getImage", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
34
34
|
var _this$options$getImag, getImageDelay;
|
|
35
|
-
return _regeneratorRuntime.wrap(function
|
|
35
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
36
36
|
while (1) switch (_context.prev = _context.next) {
|
|
37
37
|
case 0:
|
|
38
38
|
_this$options$getImag = _this.options.getImageDelay, getImageDelay = _this$options$getImag === void 0 ? 0 : _this$options$getImag;
|
|
39
39
|
if (_this.hasPreview) {
|
|
40
|
-
_context.next =
|
|
40
|
+
_context.next = 1;
|
|
41
41
|
break;
|
|
42
42
|
}
|
|
43
43
|
throw new Error('some error');
|
|
44
|
-
case
|
|
45
|
-
_context.next =
|
|
44
|
+
case 1:
|
|
45
|
+
_context.next = 2;
|
|
46
46
|
return sleep(getImageDelay);
|
|
47
|
-
case
|
|
47
|
+
case 2:
|
|
48
48
|
return _context.abrupt("return", dataURItoBlob(tallImage));
|
|
49
|
-
case
|
|
49
|
+
case 3:
|
|
50
50
|
case "end":
|
|
51
51
|
return _context.stop();
|
|
52
52
|
}
|
|
@@ -69,7 +69,7 @@ export var MediaClientMock = /*#__PURE__*/function (_MediaClient) {
|
|
|
69
69
|
var mockConfig = {
|
|
70
70
|
authProvider: function () {
|
|
71
71
|
var _authProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
72
|
-
return _regeneratorRuntime.wrap(function
|
|
72
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
73
73
|
while (1) switch (_context2.prev = _context2.next) {
|
|
74
74
|
case 0:
|
|
75
75
|
return _context2.abrupt("return", {
|