@atlaskit/media-picker 67.0.2 → 67.0.4
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/components/browser/browser.js +8 -11
- package/dist/cjs/components/browser/index.js +7 -10
- package/dist/cjs/components/clipboard/clipboard.js +9 -12
- package/dist/cjs/components/clipboard/index.js +6 -9
- package/dist/cjs/components/component.js +5 -7
- package/dist/cjs/components/dropzone/dropzone.js +13 -16
- package/dist/cjs/components/dropzone/index.js +6 -9
- package/dist/cjs/components/localUploadReact.js +18 -21
- package/dist/cjs/components/media-picker-analytics-error-boundary.js +5 -7
- package/dist/cjs/service/uploadServiceImpl.js +1 -2
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/cjs/util/eventEmitter.js +1 -2
- package/dist/cjs/util/ufoExperiences.js +1 -1
- package/dist/es2019/components/clipboard/clipboard.js +3 -3
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/es2019/util/ufoExperiences.js +1 -1
- package/dist/esm/components/browser/browser.js +8 -11
- package/dist/esm/components/browser/index.js +7 -10
- package/dist/esm/components/clipboard/clipboard.js +9 -12
- package/dist/esm/components/clipboard/index.js +6 -9
- package/dist/esm/components/component.js +5 -7
- package/dist/esm/components/dropzone/dropzone.js +13 -16
- package/dist/esm/components/dropzone/index.js +6 -9
- package/dist/esm/components/localUploadReact.js +18 -21
- package/dist/esm/components/media-picker-analytics-error-boundary.js +5 -7
- package/dist/esm/service/uploadServiceImpl.js +1 -2
- package/dist/esm/util/analytics.js +1 -1
- package/dist/esm/util/eventEmitter.js +1 -2
- package/dist/esm/util/ufoExperiences.js +1 -1
- package/package.json +10 -10
|
@@ -82,7 +82,7 @@ var UploadServiceImpl = exports.UploadServiceImpl = /*#__PURE__*/function () {
|
|
|
82
82
|
this.emitter = new _eventemitter.EventEmitter2();
|
|
83
83
|
this.cancellableFilesUploads = {};
|
|
84
84
|
}
|
|
85
|
-
(0, _createClass2.default)(UploadServiceImpl, [{
|
|
85
|
+
return (0, _createClass2.default)(UploadServiceImpl, [{
|
|
86
86
|
key: "setUploadParams",
|
|
87
87
|
value: function setUploadParams(uploadParams) {
|
|
88
88
|
this.tenantUploadParams = uploadParams;
|
|
@@ -411,5 +411,4 @@ var UploadServiceImpl = exports.UploadServiceImpl = /*#__PURE__*/function () {
|
|
|
411
411
|
this.fileRejectionHandler = handler;
|
|
412
412
|
}
|
|
413
413
|
}]);
|
|
414
|
-
return UploadServiceImpl;
|
|
415
414
|
}();
|
|
@@ -9,7 +9,7 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
9
9
|
// Component name will be prefixed with "media-picker-" in logs. Check ufoExperiences in utils files
|
|
10
10
|
|
|
11
11
|
var packageName = "@atlaskit/media-picker";
|
|
12
|
-
var packageVersion = "67.0.
|
|
12
|
+
var packageVersion = "67.0.4";
|
|
13
13
|
function getPackageAttributes(componentName) {
|
|
14
14
|
return {
|
|
15
15
|
packageName: packageName,
|
|
@@ -16,7 +16,7 @@ var GenericEventEmitter = exports.GenericEventEmitter = /*#__PURE__*/function ()
|
|
|
16
16
|
wildcard: true
|
|
17
17
|
}));
|
|
18
18
|
}
|
|
19
|
-
(0, _createClass2.default)(GenericEventEmitter, [{
|
|
19
|
+
return (0, _createClass2.default)(GenericEventEmitter, [{
|
|
20
20
|
key: "once",
|
|
21
21
|
value: function once(event, listener) {
|
|
22
22
|
this.emitter.once(event, listener);
|
|
@@ -62,5 +62,4 @@ var GenericEventEmitter = exports.GenericEventEmitter = /*#__PURE__*/function ()
|
|
|
62
62
|
return this.emitter.emit(event, payload);
|
|
63
63
|
}
|
|
64
64
|
}]);
|
|
65
|
-
return GenericEventEmitter;
|
|
66
65
|
}();
|
|
@@ -12,7 +12,7 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
var packageName = "@atlaskit/media-picker";
|
|
15
|
-
var packageVersion = "67.0.
|
|
15
|
+
var packageVersion = "67.0.4";
|
|
16
16
|
var ufoExperience;
|
|
17
17
|
var initExperience = function initExperience(id, componentName) {
|
|
18
18
|
if (!ufoExperience) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
var
|
|
2
|
+
var _ClipboardImpl;
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
5
|
import { ANALYTICS_MEDIA_CHANNEL, withMediaAnalyticsContext } from '@atlaskit/media-common';
|
|
@@ -119,7 +119,7 @@ class ClipboardImpl {
|
|
|
119
119
|
// Replaced with the new mechanism in https://product-fabric.atlassian.net/browse/MEX-2454
|
|
120
120
|
// Remove after product adoption / rollout
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
_ClipboardImpl = ClipboardImpl;
|
|
123
123
|
_defineProperty(ClipboardImpl, "instances", []);
|
|
124
124
|
_defineProperty(ClipboardImpl, "legacyHandleEvent", event => {
|
|
125
125
|
// From https://product-fabric.atlassian.net/browse/MEX-1281 ,disable the handler if event target is input
|
|
@@ -128,7 +128,7 @@ _defineProperty(ClipboardImpl, "legacyHandleEvent", event => {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
// last in, first served to support multiple instances listening at once
|
|
131
|
-
const instance =
|
|
131
|
+
const instance = _ClipboardImpl.latestInstance;
|
|
132
132
|
if (instance) {
|
|
133
133
|
/*
|
|
134
134
|
Browser behaviour for getting files from the clipboard is very inconsistent and buggy.
|
|
@@ -3,7 +3,7 @@ import { isRequestError } from '@atlaskit/media-client';
|
|
|
3
3
|
// Component name will be prefixed with "media-picker-" in logs. Check ufoExperiences in utils files
|
|
4
4
|
|
|
5
5
|
const packageName = "@atlaskit/media-picker";
|
|
6
|
-
const packageVersion = "67.0.
|
|
6
|
+
const packageVersion = "67.0.4";
|
|
7
7
|
export function getPackageAttributes(componentName) {
|
|
8
8
|
return {
|
|
9
9
|
packageName,
|
|
@@ -2,7 +2,7 @@ import { ConcurrentExperience, ExperiencePerformanceTypes, ExperienceTypes } fro
|
|
|
2
2
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
3
3
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
4
4
|
const packageName = "@atlaskit/media-picker";
|
|
5
|
-
const packageVersion = "67.0.
|
|
5
|
+
const packageVersion = "67.0.4";
|
|
6
6
|
let ufoExperience;
|
|
7
7
|
const initExperience = (id, componentName) => {
|
|
8
8
|
if (!ufoExperience) {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import React from 'react';
|
|
11
10
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -19,14 +18,12 @@ var defaultConfig = {
|
|
|
19
18
|
};
|
|
20
19
|
var COMPONENT_NAME = 'browser';
|
|
21
20
|
export var BrowserBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
22
|
-
_inherits(BrowserBase, _LocalUploadComponent);
|
|
23
|
-
var _super = _createSuper(BrowserBase);
|
|
24
21
|
function BrowserBase(props) {
|
|
25
22
|
var _this;
|
|
26
23
|
_classCallCheck(this, BrowserBase);
|
|
27
|
-
_this =
|
|
28
|
-
_defineProperty(
|
|
29
|
-
_defineProperty(
|
|
24
|
+
_this = _callSuper(this, BrowserBase, [props, COMPONENT_NAME]);
|
|
25
|
+
_defineProperty(_this, "browserRef", /*#__PURE__*/React.createRef());
|
|
26
|
+
_defineProperty(_this, "onFilePicked", function (event) {
|
|
30
27
|
if (!event.target) {
|
|
31
28
|
return;
|
|
32
29
|
}
|
|
@@ -47,7 +44,7 @@ export var BrowserBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
});
|
|
50
|
-
_defineProperty(
|
|
47
|
+
_defineProperty(_this, "browse", function () {
|
|
51
48
|
var onClose = _this.props.onClose;
|
|
52
49
|
if (!_this.browserRef.current) {
|
|
53
50
|
return;
|
|
@@ -85,7 +82,8 @@ export var BrowserBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
|
85
82
|
}
|
|
86
83
|
return _this;
|
|
87
84
|
}
|
|
88
|
-
|
|
85
|
+
_inherits(BrowserBase, _LocalUploadComponent);
|
|
86
|
+
return _createClass(BrowserBase, [{
|
|
89
87
|
key: "componentDidMount",
|
|
90
88
|
value: function componentDidMount() {
|
|
91
89
|
var _this$props = this.props,
|
|
@@ -138,7 +136,6 @@ export var BrowserBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
|
138
136
|
}));
|
|
139
137
|
}
|
|
140
138
|
}]);
|
|
141
|
-
return BrowserBase;
|
|
142
139
|
}(LocalUploadComponentReact);
|
|
143
140
|
_defineProperty(BrowserBase, "defaultProps", {
|
|
144
141
|
config: defaultConfig
|
|
@@ -2,32 +2,30 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
-
function
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
12
|
import React from 'react';
|
|
14
13
|
export var BrowserLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
15
|
-
_inherits(BrowserLoader, _React$PureComponent);
|
|
16
|
-
var _super = _createSuper(BrowserLoader);
|
|
17
14
|
function BrowserLoader() {
|
|
18
15
|
var _this;
|
|
19
16
|
_classCallCheck(this, BrowserLoader);
|
|
20
17
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
18
|
args[_key] = arguments[_key];
|
|
22
19
|
}
|
|
23
|
-
_this =
|
|
24
|
-
_defineProperty(
|
|
25
|
-
_defineProperty(
|
|
20
|
+
_this = _callSuper(this, BrowserLoader, [].concat(args));
|
|
21
|
+
_defineProperty(_this, "mounted", false);
|
|
22
|
+
_defineProperty(_this, "state", {
|
|
26
23
|
Browser: BrowserLoader.Browser
|
|
27
24
|
});
|
|
28
25
|
return _this;
|
|
29
26
|
}
|
|
30
|
-
|
|
27
|
+
_inherits(BrowserLoader, _React$PureComponent);
|
|
28
|
+
return _createClass(BrowserLoader, [{
|
|
31
29
|
key: "componentDidMount",
|
|
32
30
|
value: function componentDidMount() {
|
|
33
31
|
this.mounted = true;
|
|
@@ -83,6 +81,5 @@ export var BrowserLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
83
81
|
return /*#__PURE__*/React.createElement(this.state.Browser, this.props);
|
|
84
82
|
}
|
|
85
83
|
}]);
|
|
86
|
-
return BrowserLoader;
|
|
87
84
|
}(React.PureComponent);
|
|
88
85
|
_defineProperty(BrowserLoader, "displayName", 'AsyncBrowser');
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
2
1
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
3
2
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
5
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
var
|
|
8
|
-
function
|
|
7
|
+
var _ClipboardImpl;
|
|
8
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -65,7 +65,7 @@ var ClipboardImpl = /*#__PURE__*/function () {
|
|
|
65
65
|
this.createAnalyticsEvent = createAnalyticsEvent;
|
|
66
66
|
this.featureFlags = featureFlags;
|
|
67
67
|
}
|
|
68
|
-
_createClass(ClipboardImpl, [{
|
|
68
|
+
return _createClass(ClipboardImpl, [{
|
|
69
69
|
key: "activate",
|
|
70
70
|
value: function activate() {
|
|
71
71
|
this.deactivate();
|
|
@@ -138,9 +138,8 @@ var ClipboardImpl = /*#__PURE__*/function () {
|
|
|
138
138
|
return ClipboardImpl.instances[ClipboardImpl.instances.length - 1];
|
|
139
139
|
}
|
|
140
140
|
}]);
|
|
141
|
-
return ClipboardImpl;
|
|
142
141
|
}();
|
|
143
|
-
|
|
142
|
+
_ClipboardImpl = ClipboardImpl;
|
|
144
143
|
_defineProperty(ClipboardImpl, "instances", []);
|
|
145
144
|
_defineProperty(ClipboardImpl, "legacyHandleEvent", function (event) {
|
|
146
145
|
// From https://product-fabric.atlassian.net/browse/MEX-1281 ,disable the handler if event target is input
|
|
@@ -149,7 +148,7 @@ _defineProperty(ClipboardImpl, "legacyHandleEvent", function (event) {
|
|
|
149
148
|
}
|
|
150
149
|
|
|
151
150
|
// last in, first served to support multiple instances listening at once
|
|
152
|
-
var instance =
|
|
151
|
+
var instance = _ClipboardImpl.latestInstance;
|
|
153
152
|
if (instance) {
|
|
154
153
|
/*
|
|
155
154
|
Browser behaviour for getting files from the clipboard is very inconsistent and buggy.
|
|
@@ -174,16 +173,15 @@ _defineProperty(ClipboardImpl, "legacyHandleEvent", function (event) {
|
|
|
174
173
|
}
|
|
175
174
|
});
|
|
176
175
|
export var ClipboardBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
177
|
-
_inherits(ClipboardBase, _LocalUploadComponent);
|
|
178
|
-
var _super = _createSuper(ClipboardBase);
|
|
179
176
|
function ClipboardBase(props) {
|
|
180
177
|
var _this2;
|
|
181
178
|
_classCallCheck(this, ClipboardBase);
|
|
182
|
-
_this2 =
|
|
179
|
+
_this2 = _callSuper(this, ClipboardBase, [props, COMPONENT_NAME]);
|
|
183
180
|
_this2.clipboard = new ClipboardImpl(_this2.uploadService, _this2.props.config.container, _this2.props.config.onPaste, _this2.props.createAnalyticsEvent, props.featureFlags);
|
|
184
181
|
return _this2;
|
|
185
182
|
}
|
|
186
|
-
|
|
183
|
+
_inherits(ClipboardBase, _LocalUploadComponent);
|
|
184
|
+
return _createClass(ClipboardBase, [{
|
|
187
185
|
key: "componentDidMount",
|
|
188
186
|
value: function componentDidMount() {
|
|
189
187
|
this.clipboard.activate();
|
|
@@ -213,7 +211,6 @@ export var ClipboardBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
|
213
211
|
});
|
|
214
212
|
}
|
|
215
213
|
}]);
|
|
216
|
-
return ClipboardBase;
|
|
217
214
|
}(LocalUploadComponentReact);
|
|
218
215
|
_defineProperty(ClipboardBase, "defaultProps", {
|
|
219
216
|
config: defaultConfig
|
|
@@ -2,31 +2,29 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
-
function
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
12
|
import React from 'react';
|
|
14
13
|
export var ClipboardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
15
|
-
_inherits(ClipboardLoader, _React$PureComponent);
|
|
16
|
-
var _super = _createSuper(ClipboardLoader);
|
|
17
14
|
function ClipboardLoader() {
|
|
18
15
|
var _this;
|
|
19
16
|
_classCallCheck(this, ClipboardLoader);
|
|
20
17
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
18
|
args[_key] = arguments[_key];
|
|
22
19
|
}
|
|
23
|
-
_this =
|
|
24
|
-
_defineProperty(
|
|
20
|
+
_this = _callSuper(this, ClipboardLoader, [].concat(args));
|
|
21
|
+
_defineProperty(_this, "state", {
|
|
25
22
|
Clipboard: ClipboardLoader.Clipboard
|
|
26
23
|
});
|
|
27
24
|
return _this;
|
|
28
25
|
}
|
|
29
|
-
|
|
26
|
+
_inherits(ClipboardLoader, _React$PureComponent);
|
|
27
|
+
return _createClass(ClipboardLoader, [{
|
|
30
28
|
key: "UNSAFE_componentWillMount",
|
|
31
29
|
value: function () {
|
|
32
30
|
var _UNSAFE_componentWillMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
@@ -70,6 +68,5 @@ export var ClipboardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
70
68
|
return /*#__PURE__*/React.createElement(this.state.Clipboard, this.props);
|
|
71
69
|
}
|
|
72
70
|
}]);
|
|
73
|
-
return ClipboardLoader;
|
|
74
71
|
}(React.PureComponent);
|
|
75
72
|
_defineProperty(ClipboardLoader, "displayName", 'AsyncClipboard');
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { GenericEventEmitter } from '../util/eventEmitter';
|
|
9
9
|
export var UploadComponent = /*#__PURE__*/function (_ref) {
|
|
10
|
-
_inherits(UploadComponent, _ref);
|
|
11
|
-
var _super = _createSuper(UploadComponent);
|
|
12
10
|
function UploadComponent() {
|
|
13
11
|
_classCallCheck(this, UploadComponent);
|
|
14
|
-
return
|
|
12
|
+
return _callSuper(this, UploadComponent, arguments);
|
|
15
13
|
}
|
|
16
|
-
|
|
14
|
+
_inherits(UploadComponent, _ref);
|
|
15
|
+
return _createClass(UploadComponent, [{
|
|
17
16
|
key: "emitPluginItemsInserted",
|
|
18
17
|
value: function emitPluginItemsInserted(selectedPluginItems) {
|
|
19
18
|
var payload = selectedPluginItems.map(function (item) {
|
|
@@ -61,5 +60,4 @@ export var UploadComponent = /*#__PURE__*/function (_ref) {
|
|
|
61
60
|
});
|
|
62
61
|
}
|
|
63
62
|
}]);
|
|
64
|
-
return UploadComponent;
|
|
65
63
|
}(GenericEventEmitter);
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
|
-
function
|
|
9
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
11
|
import React from 'react';
|
|
13
12
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -24,14 +23,12 @@ function dragContainsFiles(event) {
|
|
|
24
23
|
}
|
|
25
24
|
var COMPONENT_NAME = 'dropzone';
|
|
26
25
|
export var DropzoneBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
27
|
-
_inherits(DropzoneBase, _LocalUploadComponent);
|
|
28
|
-
var _super = _createSuper(DropzoneBase);
|
|
29
26
|
function DropzoneBase(props) {
|
|
30
27
|
var _this;
|
|
31
28
|
_classCallCheck(this, DropzoneBase);
|
|
32
|
-
_this =
|
|
33
|
-
_defineProperty(
|
|
34
|
-
_defineProperty(
|
|
29
|
+
_this = _callSuper(this, DropzoneBase, [props, COMPONENT_NAME]);
|
|
30
|
+
_defineProperty(_this, "uiActive", false);
|
|
31
|
+
_defineProperty(_this, "addContainerListeners", function (container) {
|
|
35
32
|
var target = container !== null && container !== void 0 ? container : _this.getContainer();
|
|
36
33
|
// TODO: migrate this file to Pragmatic drag and drop
|
|
37
34
|
/* eslint-disable @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop */
|
|
@@ -40,13 +37,13 @@ export var DropzoneBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
|
40
37
|
target.addEventListener('drop', _this.onFileDropped);
|
|
41
38
|
/* eslint-enable @atlaskit/design-system/no-direct-use-of-web-platform-drag-and-drop */
|
|
42
39
|
});
|
|
43
|
-
_defineProperty(
|
|
40
|
+
_defineProperty(_this, "removeContainerListeners", function (container) {
|
|
44
41
|
var target = container !== null && container !== void 0 ? container : _this.getContainer();
|
|
45
42
|
target.removeEventListener('dragover', _this.onDragOver, false);
|
|
46
43
|
target.removeEventListener('dragleave', _this.onDragLeave, false);
|
|
47
44
|
target.removeEventListener('drop', _this.onFileDropped);
|
|
48
45
|
});
|
|
49
|
-
_defineProperty(
|
|
46
|
+
_defineProperty(_this, "onDragOver", function (event) {
|
|
50
47
|
event.preventDefault();
|
|
51
48
|
if (event.dataTransfer && dragContainsFiles(event)) {
|
|
52
49
|
var dataTransfer = event.dataTransfer;
|
|
@@ -64,7 +61,7 @@ export var DropzoneBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
|
64
61
|
});
|
|
65
62
|
}
|
|
66
63
|
});
|
|
67
|
-
_defineProperty(
|
|
64
|
+
_defineProperty(_this, "onDragLeave", function (e) {
|
|
68
65
|
if (e.dataTransfer) {
|
|
69
66
|
e.preventDefault();
|
|
70
67
|
var length = 0;
|
|
@@ -77,7 +74,7 @@ export var DropzoneBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
|
77
74
|
});
|
|
78
75
|
}
|
|
79
76
|
});
|
|
80
|
-
_defineProperty(
|
|
77
|
+
_defineProperty(_this, "onFileDropped", /*#__PURE__*/function () {
|
|
81
78
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(dragEvent) {
|
|
82
79
|
var files;
|
|
83
80
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -106,14 +103,14 @@ export var DropzoneBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
|
106
103
|
return _ref.apply(this, arguments);
|
|
107
104
|
};
|
|
108
105
|
}());
|
|
109
|
-
_defineProperty(
|
|
106
|
+
_defineProperty(_this, "onDrop", function (e) {
|
|
110
107
|
if (e.dataTransfer && dragContainsFiles(e)) {
|
|
111
108
|
var dataTransfer = e.dataTransfer;
|
|
112
109
|
var fileCount = _this.getDraggedItemsLength(dataTransfer);
|
|
113
110
|
_this.sendAnalyticsAndEmitDragLeave(fileCount);
|
|
114
111
|
}
|
|
115
112
|
});
|
|
116
|
-
_defineProperty(
|
|
113
|
+
_defineProperty(_this, "sendAnalyticsAndEmitDragLeave", function (fileCount) {
|
|
117
114
|
_this.fireAnalyticsEvent('droppedInto', fileCount);
|
|
118
115
|
if (_this.props.onDrop) {
|
|
119
116
|
_this.props.onDrop();
|
|
@@ -124,7 +121,8 @@ export var DropzoneBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
|
124
121
|
});
|
|
125
122
|
return _this;
|
|
126
123
|
}
|
|
127
|
-
|
|
124
|
+
_inherits(DropzoneBase, _LocalUploadComponent);
|
|
125
|
+
return _createClass(DropzoneBase, [{
|
|
128
126
|
key: "getContainer",
|
|
129
127
|
value: function getContainer() {
|
|
130
128
|
var container = this.props.config.container;
|
|
@@ -231,7 +229,6 @@ export var DropzoneBase = /*#__PURE__*/function (_LocalUploadComponent) {
|
|
|
231
229
|
});
|
|
232
230
|
}
|
|
233
231
|
}]);
|
|
234
|
-
return DropzoneBase;
|
|
235
232
|
}(LocalUploadComponentReact);
|
|
236
233
|
export default DropzoneBase;
|
|
237
234
|
export var Dropzone = withMediaAnalyticsContext(getPackageAttributes(COMPONENT_NAME))(withAnalyticsEvents()(DropzoneBase));
|
|
@@ -2,32 +2,30 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
-
function
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
12
|
import React from 'react';
|
|
14
13
|
export var DropzoneLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
15
|
-
_inherits(DropzoneLoader, _React$PureComponent);
|
|
16
|
-
var _super = _createSuper(DropzoneLoader);
|
|
17
14
|
function DropzoneLoader() {
|
|
18
15
|
var _this;
|
|
19
16
|
_classCallCheck(this, DropzoneLoader);
|
|
20
17
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
18
|
args[_key] = arguments[_key];
|
|
22
19
|
}
|
|
23
|
-
_this =
|
|
24
|
-
_defineProperty(
|
|
20
|
+
_this = _callSuper(this, DropzoneLoader, [].concat(args));
|
|
21
|
+
_defineProperty(_this, "state", {
|
|
25
22
|
Dropzone: DropzoneLoader.Dropzone,
|
|
26
23
|
MediaPickerErrorBoundary: DropzoneLoader.MediaPickerErrorBoundary
|
|
27
24
|
});
|
|
28
25
|
return _this;
|
|
29
26
|
}
|
|
30
|
-
|
|
27
|
+
_inherits(DropzoneLoader, _React$PureComponent);
|
|
28
|
+
return _createClass(DropzoneLoader, [{
|
|
31
29
|
key: "UNSAFE_componentWillMount",
|
|
32
30
|
value: function () {
|
|
33
31
|
var _UNSAFE_componentWillMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
@@ -83,6 +81,5 @@ export var DropzoneLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
83
81
|
return /*#__PURE__*/React.createElement(MediaPickerErrorBoundary, null, /*#__PURE__*/React.createElement(Dropzone, this.props));
|
|
84
82
|
}
|
|
85
83
|
}]);
|
|
86
|
-
return DropzoneLoader;
|
|
87
84
|
}(React.PureComponent);
|
|
88
85
|
_defineProperty(DropzoneLoader, "displayName", 'AsyncDropzone');
|
|
@@ -2,13 +2,12 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
-
function
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
12
|
import { Component } from 'react';
|
|
14
13
|
import { start, end } from 'perf-marks';
|
|
@@ -19,27 +18,25 @@ import { UploadServiceImpl } from '../service/uploadServiceImpl';
|
|
|
19
18
|
import { getRequestMetadata } from '../util/analytics';
|
|
20
19
|
import { startMediaUploadUfoExperience, succeedMediaUploadUfoExperience, failMediaUploadUfoExperience } from '../util/ufoExperiences';
|
|
21
20
|
export var LocalUploadComponentReact = /*#__PURE__*/function (_Component) {
|
|
22
|
-
_inherits(LocalUploadComponentReact, _Component);
|
|
23
|
-
var _super = _createSuper(LocalUploadComponentReact);
|
|
24
21
|
function LocalUploadComponentReact(props, componentName) {
|
|
25
22
|
var _this;
|
|
26
23
|
_classCallCheck(this, LocalUploadComponentReact);
|
|
27
|
-
_this =
|
|
28
|
-
_defineProperty(
|
|
29
|
-
_defineProperty(
|
|
24
|
+
_this = _callSuper(this, LocalUploadComponentReact, [props]);
|
|
25
|
+
_defineProperty(_this, "uploadComponent", new UploadComponent());
|
|
26
|
+
_defineProperty(_this, "state", {
|
|
30
27
|
errorFlags: []
|
|
31
28
|
});
|
|
32
|
-
_defineProperty(
|
|
29
|
+
_defineProperty(_this, "addErrorFlag", function (flagData) {
|
|
33
30
|
_this.setState({
|
|
34
31
|
errorFlags: [].concat(_toConsumableArray(_this.state.errorFlags), [flagData])
|
|
35
32
|
});
|
|
36
33
|
});
|
|
37
|
-
_defineProperty(
|
|
34
|
+
_defineProperty(_this, "dismissErrorFlag", function () {
|
|
38
35
|
_this.setState({
|
|
39
36
|
errorFlags: _this.state.errorFlags.slice(1)
|
|
40
37
|
});
|
|
41
38
|
});
|
|
42
|
-
_defineProperty(
|
|
39
|
+
_defineProperty(_this, "fireCommencedEvent", function (payload) {
|
|
43
40
|
var files = payload.files,
|
|
44
41
|
traceContext = payload.traceContext;
|
|
45
42
|
files.forEach(function (_ref) {
|
|
@@ -66,7 +63,7 @@ export var LocalUploadComponentReact = /*#__PURE__*/function (_Component) {
|
|
|
66
63
|
startMediaUploadUfoExperience(fileId, _this.componentName);
|
|
67
64
|
});
|
|
68
65
|
});
|
|
69
|
-
_defineProperty(
|
|
66
|
+
_defineProperty(_this, "fireUploadSucceeded", function (payload) {
|
|
70
67
|
var _payload$file = payload.file,
|
|
71
68
|
fileId = _payload$file.id,
|
|
72
69
|
fileSize = _payload$file.size,
|
|
@@ -99,7 +96,7 @@ export var LocalUploadComponentReact = /*#__PURE__*/function (_Component) {
|
|
|
99
96
|
fileMimetype: fileMimetype
|
|
100
97
|
});
|
|
101
98
|
});
|
|
102
|
-
_defineProperty(
|
|
99
|
+
_defineProperty(_this, "fireUploadFailed", /*#__PURE__*/function () {
|
|
103
100
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(payload) {
|
|
104
101
|
var fileId, _payload$error, errorName, rawError, traceContext, _end2, _end2$duration, uploadDurationMsec;
|
|
105
102
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -145,31 +142,31 @@ export var LocalUploadComponentReact = /*#__PURE__*/function (_Component) {
|
|
|
145
142
|
return _ref2.apply(this, arguments);
|
|
146
143
|
};
|
|
147
144
|
}());
|
|
148
|
-
_defineProperty(
|
|
145
|
+
_defineProperty(_this, "createAndFireAnalyticsEvent", function (payload) {
|
|
149
146
|
var createAnalyticsEvent = _this.props.createAnalyticsEvent;
|
|
150
147
|
if (createAnalyticsEvent) {
|
|
151
148
|
createAnalyticsEvent(payload).fire(ANALYTICS_MEDIA_CHANNEL);
|
|
152
149
|
}
|
|
153
150
|
});
|
|
154
|
-
_defineProperty(
|
|
151
|
+
_defineProperty(_this, "cancel", function (uniqueIdentifier) {
|
|
155
152
|
_this.uploadService.cancel(uniqueIdentifier);
|
|
156
153
|
});
|
|
157
|
-
_defineProperty(
|
|
154
|
+
_defineProperty(_this, "onFilesAdded", function (_ref3) {
|
|
158
155
|
var files = _ref3.files,
|
|
159
156
|
traceContext = _ref3.traceContext;
|
|
160
157
|
_this.uploadComponent.emitUploadsStart(files, traceContext);
|
|
161
158
|
});
|
|
162
|
-
_defineProperty(
|
|
159
|
+
_defineProperty(_this, "onFilePreviewUpdate", function (_ref4) {
|
|
163
160
|
var file = _ref4.file,
|
|
164
161
|
preview = _ref4.preview;
|
|
165
162
|
_this.uploadComponent.emitUploadPreviewUpdate(file, preview);
|
|
166
163
|
});
|
|
167
|
-
_defineProperty(
|
|
164
|
+
_defineProperty(_this, "onFileConverting", function (_ref5) {
|
|
168
165
|
var file = _ref5.file,
|
|
169
166
|
traceContext = _ref5.traceContext;
|
|
170
167
|
_this.uploadComponent.emitUploadEnd(file, traceContext);
|
|
171
168
|
});
|
|
172
|
-
_defineProperty(
|
|
169
|
+
_defineProperty(_this, "onUploadError", function (_ref6) {
|
|
173
170
|
var fileId = _ref6.fileId,
|
|
174
171
|
error = _ref6.error,
|
|
175
172
|
traceContext = _ref6.traceContext;
|
|
@@ -217,11 +214,11 @@ export var LocalUploadComponentReact = /*#__PURE__*/function (_Component) {
|
|
|
217
214
|
_this.uploadService.onFileEmpty(onFileRejection);
|
|
218
215
|
return _this;
|
|
219
216
|
}
|
|
220
|
-
|
|
217
|
+
_inherits(LocalUploadComponentReact, _Component);
|
|
218
|
+
return _createClass(LocalUploadComponentReact, [{
|
|
221
219
|
key: "setUploadParams",
|
|
222
220
|
value: function setUploadParams(uploadParams) {
|
|
223
221
|
this.uploadService.setUploadParams(uploadParams);
|
|
224
222
|
}
|
|
225
223
|
}]);
|
|
226
|
-
return LocalUploadComponentReact;
|
|
227
224
|
}(Component);
|