@atlaskit/media-avatar-picker 22.1.7 → 22.3.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 +33 -0
- package/dist/cjs/avatar-list/index.js +7 -3
- package/dist/cjs/avatar-list/styled.js +2 -10
- package/dist/cjs/avatar-picker-dialog/avatar-picker-dialog-loader.js +8 -4
- package/dist/cjs/avatar-picker-dialog/index.js +36 -34
- package/dist/cjs/avatar-picker-dialog/styled.js +5 -43
- package/dist/cjs/image-cropper/index.js +7 -3
- package/dist/cjs/image-cropper/styled.js +9 -87
- package/dist/cjs/image-navigator/index.js +15 -11
- package/dist/cjs/image-navigator/slider.js +7 -3
- package/dist/cjs/image-navigator/styled.js +17 -131
- package/dist/cjs/image-placer/container.js +11 -11
- package/dist/cjs/image-placer/image.js +1 -1
- package/dist/cjs/image-placer/index.js +70 -70
- package/dist/cjs/image-placer/margin.js +1 -1
- package/dist/cjs/image-placer/styled.js +7 -65
- package/dist/cjs/index.js +9 -1
- package/dist/cjs/predefined-avatar-list/index.js +8 -4
- package/dist/cjs/predefined-avatar-list/styled.js +2 -10
- package/dist/cjs/predefined-avatar-view/index.js +7 -3
- package/dist/cjs/predefined-avatar-view/styled.js +5 -43
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/viewport/viewport.js +67 -67
- package/dist/es2019/avatar-picker-dialog/index.js +6 -8
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/avatar-list/index.js +1 -1
- package/dist/esm/avatar-list/styled.js +2 -10
- package/dist/esm/avatar-picker-dialog/avatar-picker-dialog-loader.js +1 -1
- package/dist/esm/avatar-picker-dialog/index.js +31 -33
- package/dist/esm/avatar-picker-dialog/styled.js +5 -43
- package/dist/esm/image-cropper/index.js +1 -1
- package/dist/esm/image-cropper/styled.js +9 -87
- package/dist/esm/image-navigator/index.js +9 -9
- package/dist/esm/image-navigator/slider.js +1 -1
- package/dist/esm/image-navigator/styled.js +13 -131
- package/dist/esm/image-placer/container.js +11 -11
- package/dist/esm/image-placer/image.js +1 -1
- package/dist/esm/image-placer/index.js +70 -70
- package/dist/esm/image-placer/margin.js +1 -1
- package/dist/esm/image-placer/styled.js +7 -65
- package/dist/esm/index.js +2 -1
- package/dist/esm/predefined-avatar-list/index.js +2 -2
- package/dist/esm/predefined-avatar-list/styled.js +2 -10
- package/dist/esm/predefined-avatar-view/index.js +1 -1
- package/dist/esm/predefined-avatar-view/styled.js +5 -43
- package/dist/esm/version.json +1 -1
- package/dist/esm/viewport/viewport.js +67 -67
- package/dist/types/index.d.ts +2 -0
- package/example-helpers/StatefulAvatarPickerDialog.tsx +2 -2
- package/example-helpers/index.ts +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @atlaskit/media-avatar-picker
|
|
2
2
|
|
|
3
|
+
## 22.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`e01dd6e92ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e01dd6e92ec) - Made component ImageNavigator publicly available
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 22.2.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
19
|
+
## 22.2.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- [`5e6fa1c70a5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5e6fa1c70a5) - fix unit tests for modal dialog
|
|
24
|
+
- [`9c0241362a6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9c0241362a6) - [ux] Upgrade to the latest version of @atlaskit/modal-dialog. This change includes shifting the primary button in the footer of the modal to be on the right instead of the left.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
|
|
30
|
+
## 22.1.8
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
|
|
3
36
|
## 22.1.7
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -29,9 +29,13 @@ var _styled = require("./styled");
|
|
|
29
29
|
|
|
30
30
|
var _styled2 = require("../predefined-avatar-view/styled");
|
|
31
31
|
|
|
32
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
|
+
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
+
|
|
32
36
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
33
37
|
|
|
34
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
38
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
39
|
|
|
36
40
|
var AvatarList = /*#__PURE__*/function (_PureComponent) {
|
|
37
41
|
(0, _inherits2.default)(AvatarList, _PureComponent);
|
|
@@ -11,16 +11,8 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
11
11
|
|
|
12
12
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n ul {\n display: flex;\n\n padding: 0;\n margin: 0;\n\n list-style-type: none;\n\n li {\n padding-right: 5px;\n margin: 0;\n }\n }\n\n /* hide tickbox and file type icon in overlay\n * because those are not necessary for avatars */\n\n .tickbox {\n visibility: hidden;\n }\n\n .file-type-icon {\n visibility: hidden;\n }\n"]);
|
|
14
|
+
var _templateObject;
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
return data;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
return data;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
var AvatarListWrapper = _styledComponents.default.div(_templateObject());
|
|
16
|
+
var AvatarListWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ul {\n display: flex;\n\n padding: 0;\n margin: 0;\n\n list-style-type: none;\n\n li {\n padding-right: 5px;\n margin: 0;\n }\n }\n\n /* hide tickbox and file type icon in overlay\n * because those are not necessary for avatars */\n\n .tickbox {\n visibility: hidden;\n }\n\n .file-type-icon {\n visibility: hidden;\n }\n"])));
|
|
25
17
|
|
|
26
18
|
exports.AvatarListWrapper = AvatarListWrapper;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
@@ -9,8 +11,6 @@ exports.default = void 0;
|
|
|
9
11
|
|
|
10
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
13
|
|
|
12
|
-
var _interopRequireWildcard2 = _interopRequireDefault(require("@babel/runtime/helpers/interopRequireWildcard"));
|
|
13
|
-
|
|
14
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
15
|
|
|
16
16
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -31,9 +31,13 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
31
31
|
|
|
32
32
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
33
33
|
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
34
38
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
35
39
|
|
|
36
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
40
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
41
|
|
|
38
42
|
var AsyncAvatarPickerDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
39
43
|
(0, _inherits2.default)(AsyncAvatarPickerDialog, _React$PureComponent);
|
|
@@ -74,7 +78,7 @@ var AsyncAvatarPickerDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
74
78
|
_context.prev = 1;
|
|
75
79
|
_context.next = 4;
|
|
76
80
|
return Promise.resolve().then(function () {
|
|
77
|
-
return (
|
|
81
|
+
return _interopRequireWildcard(require('.'));
|
|
78
82
|
});
|
|
79
83
|
|
|
80
84
|
case 4:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -49,9 +49,13 @@ var _layoutConst = require("./layout-const");
|
|
|
49
49
|
|
|
50
50
|
var _types = require("./types");
|
|
51
51
|
|
|
52
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
53
|
+
|
|
54
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
55
|
+
|
|
52
56
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
53
57
|
|
|
54
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
58
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
55
59
|
|
|
56
60
|
var MAX_SIZE_MB = 10;
|
|
57
61
|
exports.MAX_SIZE_MB = MAX_SIZE_MB;
|
|
@@ -203,7 +207,9 @@ var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
203
207
|
});
|
|
204
208
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "headerContent", function () {
|
|
205
209
|
var title = _this.props.title;
|
|
206
|
-
return /*#__PURE__*/_react.default.createElement(_styled.ModalHeader,
|
|
210
|
+
return /*#__PURE__*/_react.default.createElement(_styled.ModalHeader, {
|
|
211
|
+
"data-test-id": "modal-header"
|
|
212
|
+
}, title || /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _mediaUi.messages.upload_an_avatar));
|
|
207
213
|
});
|
|
208
214
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "footerContent", function () {
|
|
209
215
|
var _this$props2 = _this.props,
|
|
@@ -232,18 +238,25 @@ var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
232
238
|
var content = /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
|
|
233
239
|
height: "".concat(_layoutConst.AVATAR_DIALOG_HEIGHT, "px"),
|
|
234
240
|
width: "".concat(_layoutConst.AVATAR_DIALOG_WIDTH, "px"),
|
|
235
|
-
|
|
236
|
-
components: {
|
|
237
|
-
Header: this.headerContent,
|
|
238
|
-
Footer: this.footerContent
|
|
239
|
-
},
|
|
241
|
+
shouldScrollInViewport: true,
|
|
240
242
|
onClose: this.props.onCancel
|
|
241
|
-
}, /*#__PURE__*/_react.default.createElement(_styled.AvatarPickerViewWrapper, null, this.renderBody()));
|
|
243
|
+
}, this.headerContent(), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_styled.AvatarPickerViewWrapper, null, this.renderBody())), this.footerContent());
|
|
242
244
|
|
|
243
245
|
return this.context.intl ? content : /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
|
|
244
246
|
locale: "en"
|
|
245
247
|
}, content);
|
|
246
248
|
}
|
|
249
|
+
}, {
|
|
250
|
+
key: "isDisabled",
|
|
251
|
+
get: function get() {
|
|
252
|
+
var _this$state2 = this.state,
|
|
253
|
+
selectedImage = _this$state2.selectedImage,
|
|
254
|
+
selectedAvatar = _this$state2.selectedAvatar;
|
|
255
|
+
var _this$props3 = this.props,
|
|
256
|
+
imageSource = _this$props3.imageSource,
|
|
257
|
+
isLoading = _this$props3.isLoading;
|
|
258
|
+
return isLoading || !(imageSource || selectedImage || selectedAvatar);
|
|
259
|
+
}
|
|
247
260
|
}, {
|
|
248
261
|
key: "getPredefinedAvatars",
|
|
249
262
|
value: function getPredefinedAvatars() {
|
|
@@ -261,10 +274,10 @@ var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
261
274
|
key: "renderPredefinedAvatarList",
|
|
262
275
|
value: function renderPredefinedAvatarList() {
|
|
263
276
|
var isLoading = this.props.isLoading;
|
|
264
|
-
var _this$
|
|
265
|
-
selectedAvatar = _this$
|
|
266
|
-
selectedImage = _this$
|
|
267
|
-
selectedImageSource = _this$
|
|
277
|
+
var _this$state3 = this.state,
|
|
278
|
+
selectedAvatar = _this$state3.selectedAvatar,
|
|
279
|
+
selectedImage = _this$state3.selectedImage,
|
|
280
|
+
selectedImageSource = _this$state3.selectedImageSource;
|
|
268
281
|
var avatars = this.getPredefinedAvatars();
|
|
269
282
|
|
|
270
283
|
if (isLoading || selectedImage || selectedImageSource || avatars.length === 0) {
|
|
@@ -281,15 +294,15 @@ var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
281
294
|
}, {
|
|
282
295
|
key: "renderBody",
|
|
283
296
|
value: function renderBody() {
|
|
284
|
-
var _this$
|
|
285
|
-
avatars = _this$
|
|
286
|
-
isLoading = _this$
|
|
287
|
-
predefinedAvatarsText = _this$
|
|
288
|
-
var _this$
|
|
289
|
-
mode = _this$
|
|
290
|
-
selectedImageSource = _this$
|
|
291
|
-
selectedAvatar = _this$
|
|
292
|
-
errorMessage = _this$
|
|
297
|
+
var _this$props4 = this.props,
|
|
298
|
+
avatars = _this$props4.avatars,
|
|
299
|
+
isLoading = _this$props4.isLoading,
|
|
300
|
+
predefinedAvatarsText = _this$props4.predefinedAvatarsText;
|
|
301
|
+
var _this$state4 = this.state,
|
|
302
|
+
mode = _this$state4.mode,
|
|
303
|
+
selectedImageSource = _this$state4.selectedImageSource,
|
|
304
|
+
selectedAvatar = _this$state4.selectedAvatar,
|
|
305
|
+
errorMessage = _this$state4.errorMessage;
|
|
293
306
|
|
|
294
307
|
switch (mode) {
|
|
295
308
|
case _types.Mode.Cropping:
|
|
@@ -314,17 +327,6 @@ var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
314
327
|
}));
|
|
315
328
|
}
|
|
316
329
|
}
|
|
317
|
-
}, {
|
|
318
|
-
key: "isDisabled",
|
|
319
|
-
get: function get() {
|
|
320
|
-
var _this$state4 = this.state,
|
|
321
|
-
selectedImage = _this$state4.selectedImage,
|
|
322
|
-
selectedAvatar = _this$state4.selectedAvatar;
|
|
323
|
-
var _this$props4 = this.props,
|
|
324
|
-
imageSource = _this$props4.imageSource,
|
|
325
|
-
isLoading = _this$props4.isLoading;
|
|
326
|
-
return isLoading || !(imageSource || selectedImage || selectedAvatar);
|
|
327
|
-
}
|
|
328
330
|
}]);
|
|
329
331
|
return AvatarPickerDialog;
|
|
330
332
|
}(_react.PureComponent);
|
|
@@ -11,58 +11,20 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
11
11
|
|
|
12
12
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n text-align: right;\n width: 100%;\n\n button:first-child {\n margin-right: 3px;\n }\n"]);
|
|
14
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
return data;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
return data;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function _templateObject3() {
|
|
25
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n user-select: none;\n\n * {\n user-select: none;\n }\n"]);
|
|
26
|
-
|
|
27
|
-
_templateObject3 = function _templateObject3() {
|
|
28
|
-
return data;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return data;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function _templateObject2() {
|
|
35
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n margin: 15px;\n font-weight: 500;\n font-size: 20px;\n"]);
|
|
36
|
-
|
|
37
|
-
_templateObject2 = function _templateObject2() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return data;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _templateObject() {
|
|
45
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n min-height: 339px;\n"]);
|
|
46
|
-
|
|
47
|
-
_templateObject = function _templateObject() {
|
|
48
|
-
return data;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return data;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
var AvatarPickerViewWrapper = _styledComponents.default.div(_templateObject());
|
|
16
|
+
var AvatarPickerViewWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n min-height: 339px;\n"])));
|
|
55
17
|
|
|
56
18
|
exports.AvatarPickerViewWrapper = AvatarPickerViewWrapper;
|
|
57
19
|
|
|
58
|
-
var ModalHeader = _styledComponents.default.div(_templateObject2());
|
|
20
|
+
var ModalHeader = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin: 15px;\n font-weight: 500;\n font-size: 20px;\n"])));
|
|
59
21
|
|
|
60
22
|
exports.ModalHeader = ModalHeader;
|
|
61
23
|
|
|
62
|
-
var CroppingWrapper = _styledComponents.default.div(_templateObject3());
|
|
24
|
+
var CroppingWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n user-select: none;\n\n * {\n user-select: none;\n }\n"])));
|
|
63
25
|
|
|
64
26
|
exports.CroppingWrapper = CroppingWrapper;
|
|
65
27
|
|
|
66
|
-
var ModalFooterButtons = _styledComponents.default.div(_templateObject4());
|
|
28
|
+
var ModalFooterButtons = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n text-align: right;\n width: 100%;\n\n button:first-child {\n margin-right: 3px;\n }\n"])));
|
|
67
29
|
|
|
68
30
|
exports.ModalFooterButtons = ModalFooterButtons;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -39,9 +39,13 @@ var _avatarPickerDialog = require("../avatar-picker-dialog");
|
|
|
39
39
|
|
|
40
40
|
var _layoutConst = require("../avatar-picker-dialog/layout-const");
|
|
41
41
|
|
|
42
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
43
|
+
|
|
44
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
45
|
+
|
|
42
46
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
43
47
|
|
|
44
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
48
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
49
|
|
|
46
50
|
var ImageCropper = /*#__PURE__*/function (_Component) {
|
|
47
51
|
(0, _inherits2.default)(ImageCropper, _Component);
|
|
@@ -15,111 +15,33 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
15
15
|
|
|
16
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", "px;\n background-color: transparent;\n width: 24px;\n height: 24px;\n border: none;\n cursor: pointer;\n padding: 0;\n\n svg {\n position: absolute;\n top: 4px;\n left: 4px;\n }\n\n &:hover {\n background-color: ", ";\n }\n"]);
|
|
18
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
return data;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return data;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function _templateObject7() {
|
|
29
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n right: 4px;\n top: 4px;\n"]);
|
|
30
|
-
|
|
31
|
-
_templateObject7 = function _templateObject7() {
|
|
32
|
-
return data;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
return data;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function _templateObject6() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 100%;\n height: 100%;\n cursor: move;\n"]);
|
|
40
|
-
|
|
41
|
-
_templateObject6 = function _templateObject6() {
|
|
42
|
-
return data;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _templateObject5() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 500px;\n"]);
|
|
50
|
-
|
|
51
|
-
_templateObject5 = function _templateObject5() {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return data;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _templateObject4() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", "px;\n"]);
|
|
60
|
-
|
|
61
|
-
_templateObject4 = function _templateObject4() {
|
|
62
|
-
return data;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
return data;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _templateObject3() {
|
|
69
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: ", "px;\n bottom: ", "px;\n left: ", "px;\n right: ", "px;\n box-shadow: 0 0 0 100px rgba(255, 255, 255, 0.5);\n"]);
|
|
70
|
-
|
|
71
|
-
_templateObject3 = function _templateObject3() {
|
|
72
|
-
return data;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return data;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function _templateObject2() {
|
|
79
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n /* Is needed so image is not selected, when dragged */\n -webkit-user-select: none; /* Chrome all / Safari all */\n -moz-user-select: none; /* Firefox all */\n -ms-user-select: none; /* IE 10+ */\n user-select: none; /* Likely future */\n border-radius: ", "px;\n"]);
|
|
80
|
-
|
|
81
|
-
_templateObject2 = function _templateObject2() {
|
|
82
|
-
return data;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return data;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function _templateObject() {
|
|
89
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n overflow: hidden;\n border-radius: ", "px;\n"]);
|
|
90
|
-
|
|
91
|
-
_templateObject = function _templateObject() {
|
|
92
|
-
return data;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
return data;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
var Container = _styledComponents.default.div(_templateObject(), (0, _constants.borderRadius)());
|
|
20
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n overflow: hidden;\n border-radius: ", "px;\n"])), (0, _constants.borderRadius)());
|
|
99
21
|
|
|
100
22
|
exports.Container = Container;
|
|
101
23
|
|
|
102
|
-
var ImageContainer = _styledComponents.default.div(_templateObject2(), (0, _constants.borderRadius)());
|
|
24
|
+
var ImageContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n /* Is needed so image is not selected, when dragged */\n -webkit-user-select: none; /* Chrome all / Safari all */\n -moz-user-select: none; /* Firefox all */\n -ms-user-select: none; /* IE 10+ */\n user-select: none; /* Likely future */\n border-radius: ", "px;\n"])), (0, _constants.borderRadius)());
|
|
103
25
|
|
|
104
26
|
exports.ImageContainer = ImageContainer;
|
|
105
27
|
var CONTAINER_PADDING = 28;
|
|
106
28
|
exports.CONTAINER_PADDING = CONTAINER_PADDING;
|
|
107
29
|
|
|
108
|
-
var Mask = _styledComponents.default.div(_templateObject3(), CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING);
|
|
30
|
+
var Mask = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n top: ", "px;\n bottom: ", "px;\n left: ", "px;\n right: ", "px;\n box-shadow: 0 0 0 100px rgba(255, 255, 255, 0.5);\n"])), CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING);
|
|
109
31
|
|
|
110
|
-
var RectMask = (0, _styledComponents.default)(Mask)(_templateObject4(), (0, _constants.borderRadius)());
|
|
32
|
+
var RectMask = (0, _styledComponents.default)(Mask)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", "px;\n"])), (0, _constants.borderRadius)());
|
|
111
33
|
exports.RectMask = RectMask;
|
|
112
|
-
var CircularMask = (0, _styledComponents.default)(Mask)(_templateObject5());
|
|
34
|
+
var CircularMask = (0, _styledComponents.default)(Mask)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 500px;\n"])));
|
|
113
35
|
exports.CircularMask = CircularMask;
|
|
114
36
|
|
|
115
|
-
var DragOverlay = _styledComponents.default.div(_templateObject6());
|
|
37
|
+
var DragOverlay = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n width: 100%;\n height: 100%;\n cursor: move;\n"])));
|
|
116
38
|
|
|
117
39
|
exports.DragOverlay = DragOverlay;
|
|
118
40
|
|
|
119
|
-
var RemoveImageContainer = _styledComponents.default.div(_templateObject7());
|
|
41
|
+
var RemoveImageContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n right: 4px;\n top: 4px;\n"])));
|
|
120
42
|
|
|
121
43
|
exports.RemoveImageContainer = RemoveImageContainer;
|
|
122
44
|
|
|
123
|
-
var RemoveImageButton = _styledComponents.default.button(_templateObject8(), (0, _constants.borderRadius)(), _colors.N50A);
|
|
45
|
+
var RemoveImageButton = _styledComponents.default.button(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", "px;\n background-color: transparent;\n width: 24px;\n height: 24px;\n border: none;\n cursor: pointer;\n padding: 0;\n\n svg {\n position: absolute;\n top: 4px;\n left: 4px;\n }\n\n &:hover {\n background-color: ", ";\n }\n"])), (0, _constants.borderRadius)(), _colors.N50A);
|
|
124
46
|
|
|
125
47
|
exports.RemoveImageButton = RemoveImageButton;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -57,9 +57,13 @@ var _slider = require("./slider");
|
|
|
57
57
|
|
|
58
58
|
var _layoutConst = require("../avatar-picker-dialog/layout-const");
|
|
59
59
|
|
|
60
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
61
|
+
|
|
62
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
63
|
+
|
|
60
64
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
61
65
|
|
|
62
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
66
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
63
67
|
|
|
64
68
|
var viewport = new _viewport2.Viewport(_layoutConst.CONTAINER_SIZE, _layoutConst.CONTAINER_SIZE, _layoutConst.CONTAINER_PADDING);
|
|
65
69
|
exports.viewport = viewport;
|
|
@@ -414,14 +418,6 @@ var ImageNavigator = /*#__PURE__*/function (_Component) {
|
|
|
414
418
|
})), isDragging ? /*#__PURE__*/_react.default.createElement(_styled.SelectionBlocker, null) : null);
|
|
415
419
|
} // We prioritize passed image rather than the one coming from the uploader
|
|
416
420
|
|
|
417
|
-
}, {
|
|
418
|
-
key: "render",
|
|
419
|
-
value: function render() {
|
|
420
|
-
var isLoading = this.props.isLoading;
|
|
421
|
-
var dataURI = this.dataURI;
|
|
422
|
-
var content = dataURI && !isLoading ? this.renderImageCropper(dataURI) : this.renderImageUploader();
|
|
423
|
-
return /*#__PURE__*/_react.default.createElement(_styled.Container, null, content);
|
|
424
|
-
}
|
|
425
421
|
}, {
|
|
426
422
|
key: "dataURI",
|
|
427
423
|
get: function get() {
|
|
@@ -431,6 +427,14 @@ var ImageNavigator = /*#__PURE__*/function (_Component) {
|
|
|
431
427
|
var fileImageSource = this.state.fileImageSource;
|
|
432
428
|
return errorMessage ? undefined : imageSource || fileImageSource;
|
|
433
429
|
}
|
|
430
|
+
}, {
|
|
431
|
+
key: "render",
|
|
432
|
+
value: function render() {
|
|
433
|
+
var isLoading = this.props.isLoading;
|
|
434
|
+
var dataURI = this.dataURI;
|
|
435
|
+
var content = dataURI && !isLoading ? this.renderImageCropper(dataURI) : this.renderImageUploader();
|
|
436
|
+
return /*#__PURE__*/_react.default.createElement(_styled.Container, null, content);
|
|
437
|
+
}
|
|
434
438
|
}]);
|
|
435
439
|
return ImageNavigator;
|
|
436
440
|
}(_react.Component);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -33,9 +33,13 @@ var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom
|
|
|
33
33
|
|
|
34
34
|
var _styled = require("./styled");
|
|
35
35
|
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
+
|
|
38
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
+
|
|
36
40
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
37
41
|
|
|
38
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
42
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
39
43
|
|
|
40
44
|
var defaultProps = {
|
|
41
45
|
value: 0
|