@atlaskit/media-avatar-picker 24.2.0 → 24.2.1
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 +7 -0
- package/dist/cjs/avatar-picker-dialog/avatar-picker-dialog-loader.js +1 -3
- package/dist/cjs/image-cropper/index.js +1 -2
- package/dist/cjs/image-cropper/styles.js +2 -4
- package/dist/cjs/image-navigator/index.js +3 -2
- package/dist/cjs/image-navigator/styles.js +5 -7
- package/dist/cjs/image-placer/imageProcessor.js +5 -1
- package/dist/cjs/image-placer/styles.js +3 -5
- package/dist/cjs/predefined-avatar-view/styles.js +1 -3
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/viewport/viewport-render.js +2 -2
- package/dist/es2019/avatar-picker-dialog/avatar-picker-dialog-loader.js +1 -2
- package/dist/es2019/image-cropper/index.js +1 -2
- package/dist/es2019/image-cropper/styles.js +3 -4
- package/dist/es2019/image-navigator/index.js +3 -2
- package/dist/es2019/image-navigator/styles.js +5 -6
- package/dist/es2019/image-placer/imageProcessor.js +5 -1
- package/dist/es2019/image-placer/styles.js +6 -7
- package/dist/es2019/predefined-avatar-view/styles.js +1 -2
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/viewport/viewport-render.js +2 -2
- package/dist/esm/avatar-picker-dialog/avatar-picker-dialog-loader.js +1 -2
- package/dist/esm/image-cropper/index.js +1 -2
- package/dist/esm/image-cropper/styles.js +2 -3
- package/dist/esm/image-navigator/index.js +3 -2
- package/dist/esm/image-navigator/styles.js +5 -6
- package/dist/esm/image-placer/imageProcessor.js +5 -1
- package/dist/esm/image-placer/styles.js +3 -4
- package/dist/esm/predefined-avatar-view/styles.js +1 -2
- package/dist/esm/version.json +1 -1
- package/dist/esm/viewport/viewport-render.js +2 -2
- package/package.json +3 -2
- package/report.api.md +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/media-avatar-picker
|
|
2
2
|
|
|
3
|
+
## 24.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`564b251839c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/564b251839c) - [ux] Fixed avatar picker not showing correct orientation for images with exif data
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 24.2.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -29,8 +29,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
29
29
|
|
|
30
30
|
var _react = _interopRequireDefault(require("react"));
|
|
31
31
|
|
|
32
|
-
var _tokens = require("@atlaskit/tokens");
|
|
33
|
-
|
|
34
32
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
35
33
|
|
|
36
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); }
|
|
@@ -121,7 +119,7 @@ var AsyncAvatarPickerDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
121
119
|
}
|
|
122
120
|
|
|
123
121
|
return /*#__PURE__*/_react.default.createElement(_mediaUi.ModalSpinner, {
|
|
124
|
-
blankedColor: "
|
|
122
|
+
blankedColor: "var(--ds-blanket, rgba(255, 255, 255, 0.53))",
|
|
125
123
|
invertSpinnerColor: false
|
|
126
124
|
});
|
|
127
125
|
}
|
|
@@ -104,7 +104,6 @@ var ImageCropper = /*#__PURE__*/function (_Component) {
|
|
|
104
104
|
imageHeight = _this$props3.imageHeight,
|
|
105
105
|
imageSource = _this$props3.imageSource,
|
|
106
106
|
onRemoveImage = _this$props3.onRemoveImage,
|
|
107
|
-
imageOrientation = _this$props3.imageOrientation,
|
|
108
107
|
onImageLoaded = _this$props3.onImageLoaded,
|
|
109
108
|
formatMessage = _this$props3.intl.formatMessage;
|
|
110
109
|
var containerStyle = {
|
|
@@ -141,7 +140,7 @@ var ImageCropper = /*#__PURE__*/function (_Component) {
|
|
|
141
140
|
dataURI: imageSource,
|
|
142
141
|
crop: false,
|
|
143
142
|
stretch: true,
|
|
144
|
-
previewOrientation:
|
|
143
|
+
previewOrientation: "from-image",
|
|
145
144
|
onImageLoad: onImageLoaded,
|
|
146
145
|
onImageError: this.onImageError
|
|
147
146
|
})), isCircularMask ? (0, _react.jsx)("div", {
|
|
@@ -9,8 +9,6 @@ exports.removeImageContainerStyles = exports.removeImageButtonStyles = exports.r
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var _tokens = require("@atlaskit/tokens");
|
|
13
|
-
|
|
14
12
|
var _react = require("@emotion/react");
|
|
15
13
|
|
|
16
14
|
var _constants = require("@atlaskit/theme/constants");
|
|
@@ -25,7 +23,7 @@ var imageContainerStyles = (0, _react.css)(_templateObject2 || (_templateObject2
|
|
|
25
23
|
exports.imageContainerStyles = imageContainerStyles;
|
|
26
24
|
var CONTAINER_PADDING = 28;
|
|
27
25
|
exports.CONTAINER_PADDING = CONTAINER_PADDING;
|
|
28
|
-
var maskStyles = (0, _react.css)(_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\n ", ";\n opacity: ", ";\n"])), CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING, (
|
|
26
|
+
var maskStyles = (0, _react.css)(_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\n ", ";\n opacity: ", ";\n"])), CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING, "var(--ds-surface-overlay, rgba(255, 255, 255))", "var(--ds-opacity-disabled, 0.5)");
|
|
29
27
|
var rectMaskStyles = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n border-radius: ", "px;\n"])), maskStyles, (0, _constants.borderRadius)());
|
|
30
28
|
exports.rectMaskStyles = rectMaskStyles;
|
|
31
29
|
var circularMaskStyles = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n border-radius: 500px;\n"])), maskStyles);
|
|
@@ -34,5 +32,5 @@ var dragOverlayStyles = (0, _react.css)(_templateObject6 || (_templateObject6 =
|
|
|
34
32
|
exports.dragOverlayStyles = dragOverlayStyles;
|
|
35
33
|
var removeImageContainerStyles = (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n right: 4px;\n top: 4px;\n"])));
|
|
36
34
|
exports.removeImageContainerStyles = removeImageContainerStyles;
|
|
37
|
-
var removeImageButtonStyles = (0, _react.css)(_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)(), (
|
|
35
|
+
var removeImageButtonStyles = (0, _react.css)(_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)(), "var(--ds-background-neutral-hovered, ".concat(_colors.N50A, ")"));
|
|
38
36
|
exports.removeImageButtonStyles = removeImageButtonStyles;
|
|
@@ -144,7 +144,7 @@ var ImageNavigator = /*#__PURE__*/function (_Component) {
|
|
|
144
144
|
var width = image.naturalWidth,
|
|
145
145
|
height = image.naturalHeight;
|
|
146
146
|
|
|
147
|
-
if ((0, _mediaUi.isRotated)(_this.state.imageOrientation)) {
|
|
147
|
+
if (!CSS.supports('image-orientation', 'from-image') && (0, _mediaUi.isRotated)(_this.state.imageOrientation)) {
|
|
148
148
|
var _ref = [height, width];
|
|
149
149
|
width = _ref[0];
|
|
150
150
|
height = _ref[1];
|
|
@@ -396,7 +396,8 @@ var ImageNavigator = /*#__PURE__*/function (_Component) {
|
|
|
396
396
|
css: _styles.paddedBreakStyles
|
|
397
397
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, errorMessage ? _mediaUi.messages.try_again : _mediaUi.messages.or)), (0, _react2.jsx)(_customThemeButton.default, {
|
|
398
398
|
onClick: this.onUploadButtonClick,
|
|
399
|
-
isDisabled: isLoading
|
|
399
|
+
isDisabled: isLoading,
|
|
400
|
+
testId: "upload-button"
|
|
400
401
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _mediaUi.messages.upload_photo), (0, _react2.jsx)("input", {
|
|
401
402
|
css: _styles.fileInputStyles,
|
|
402
403
|
type: "file",
|
|
@@ -9,8 +9,6 @@ exports.sliderWrapperStyles = exports.sliderContainerStyles = exports.selectionB
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var _tokens = require("@atlaskit/tokens");
|
|
13
|
-
|
|
14
12
|
var _react = require("@emotion/react");
|
|
15
13
|
|
|
16
14
|
var _constants = require("@atlaskit/theme/constants");
|
|
@@ -28,20 +26,20 @@ var imageBgStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0,
|
|
|
28
26
|
exports.imageBgStyles = imageBgStyles;
|
|
29
27
|
var containerStyles = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n box-sizing: border-box;\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n position: relative;\n"])), (0, _constants.gridSize)() * 32);
|
|
30
28
|
exports.containerStyles = containerStyles;
|
|
31
|
-
var sliderContainerStyles = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n justify-content: center;\n display: flex;\n flex-direction: row;\n margin-top: ", "px;\n\n input {\n box-sizing: content-box;\n padding: 0;\n }\n background-color: ", ";\n"])), (0, _constants.gridSize)(), (
|
|
29
|
+
var sliderContainerStyles = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n justify-content: center;\n display: flex;\n flex-direction: row;\n margin-top: ", "px;\n\n input {\n box-sizing: content-box;\n padding: 0;\n }\n background-color: ", ";\n"])), (0, _constants.gridSize)(), "var(--ds-surface-overlay, #fff)");
|
|
32
30
|
exports.sliderContainerStyles = sliderContainerStyles;
|
|
33
31
|
var fileInputStyles = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: none;\n"])));
|
|
34
32
|
exports.fileInputStyles = fileInputStyles;
|
|
35
33
|
var imageUploaderStyles = (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n margin: 0 10px 20px 10px;\n"])));
|
|
36
34
|
exports.imageUploaderStyles = imageUploaderStyles;
|
|
37
|
-
var droppingAnimation = (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n border-color: ", ";\n animation: ", " 8s linear infinite;\n"])), (
|
|
35
|
+
var droppingAnimation = (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n border-color: ", ";\n animation: ", " 8s linear infinite;\n"])), "var(--ds-border-information, #0e56c4)", spin);
|
|
38
36
|
|
|
39
37
|
var getBorder = function getBorder(showBorder) {
|
|
40
|
-
return "".concat(showBorder ? "2px dashed ".concat((
|
|
38
|
+
return "".concat(showBorder ? "2px dashed ".concat("var(--ds-border, #d0d6d0)") : 'none');
|
|
41
39
|
};
|
|
42
40
|
|
|
43
41
|
var getDroppingAnimation = function getDroppingAnimation(isDroppingFile) {
|
|
44
|
-
return isDroppingFile ? (0, _react.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n\n &:after {\n ", "\n }\n "])), (
|
|
42
|
+
return isDroppingFile ? (0, _react.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n\n &:after {\n ", "\n }\n "])), "var(--ds-background-information-hovered, #ddecfe)", droppingAnimation) : '';
|
|
45
43
|
};
|
|
46
44
|
|
|
47
45
|
var dragZoneStyles = function dragZoneStyles(props) {
|
|
@@ -58,7 +56,7 @@ var getWidth = function getWidth(isFullSize) {
|
|
|
58
56
|
};
|
|
59
57
|
|
|
60
58
|
var dragZoneTextStyles = function dragZoneTextStyles(props) {
|
|
61
|
-
return (0, _react.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n text-align: center;\n color: ", ";\n ", ";\n"])), (
|
|
59
|
+
return (0, _react.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n text-align: center;\n color: ", ";\n ", ";\n"])), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), getWidth(props.isFullSize));
|
|
62
60
|
};
|
|
63
61
|
|
|
64
62
|
exports.dragZoneTextStyles = dragZoneTextStyles;
|
|
@@ -101,7 +101,11 @@ function _initialiseImagePreview() {
|
|
|
101
101
|
|
|
102
102
|
case 4:
|
|
103
103
|
result = _context.sent;
|
|
104
|
-
|
|
104
|
+
|
|
105
|
+
if (!CSS.supports('image-orientation', 'from-image')) {
|
|
106
|
+
orientation = result[0];
|
|
107
|
+
}
|
|
108
|
+
|
|
105
109
|
img = result[1];
|
|
106
110
|
_context.next = 12;
|
|
107
111
|
break;
|
|
@@ -9,8 +9,6 @@ exports.marginWrapperSquareStyles = exports.marginWrapperCircleStyles = exports.
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var _tokens = require("@atlaskit/tokens");
|
|
13
|
-
|
|
14
12
|
var _react = require("@emotion/react");
|
|
15
13
|
|
|
16
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
@@ -25,7 +23,7 @@ var imagePlacerWrapperStyles = function imagePlacerWrapperStyles(props) {
|
|
|
25
23
|
};
|
|
26
24
|
|
|
27
25
|
exports.imagePlacerWrapperStyles = imagePlacerWrapperStyles;
|
|
28
|
-
var imagePlacerErrorWrapperStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n color: ", ";\n width: 100%;\n height: 100%;\n text-align: center;\n padding-top: 45%;\n"])), (
|
|
26
|
+
var imagePlacerErrorWrapperStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n color: ", ";\n width: 100%;\n height: 100%;\n text-align: center;\n padding-top: 45%;\n"])), "var(--ds-background-danger-bold, ".concat(_colors.R500, ")"), "var(--ds-text-inverse, white)");
|
|
29
27
|
exports.imagePlacerErrorWrapperStyles = imagePlacerErrorWrapperStyles;
|
|
30
28
|
|
|
31
29
|
var containerWrapperStyles = function containerWrapperStyles(_ref) {
|
|
@@ -54,7 +52,7 @@ var marginWrapperSquareStyles = function marginWrapperSquareStyles(_ref3) {
|
|
|
54
52
|
var width = _ref3.width,
|
|
55
53
|
height = _ref3.height,
|
|
56
54
|
size = _ref3.size;
|
|
57
|
-
return (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n left: 0;\n top: 0;\n border-style: solid;\n border-color: ", ";\n border-width: ", "px;\n width: ", "px;\n height: ", "px;\n opacity: ", ";\n"])), (
|
|
55
|
+
return (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n left: 0;\n top: 0;\n border-style: solid;\n border-color: ", ";\n border-width: ", "px;\n width: ", "px;\n height: ", "px;\n opacity: ", ";\n"])), "var(--ds-surface-overlay, rgba(255, 255, 255))", size, width, height, "var(--ds-opacity-disabled, 0.3)");
|
|
58
56
|
};
|
|
59
57
|
|
|
60
58
|
exports.marginWrapperSquareStyles = marginWrapperSquareStyles;
|
|
@@ -63,7 +61,7 @@ var marginWrapperCircleStyles = function marginWrapperCircleStyles(_ref4) {
|
|
|
63
61
|
var width = _ref4.width,
|
|
64
62
|
height = _ref4.height,
|
|
65
63
|
size = _ref4.size;
|
|
66
|
-
return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n overflow: hidden;\n left: 0px;\n top: 0px;\n width: ", "px;\n height: ", "px;\n\n &:after {\n content: '';\n position: absolute;\n left: ", "px;\n top: ", "px;\n border-radius: 100%;\n width: ", "px;\n height: ", "px;\n box-shadow: 0px 0px 0px ", "px\n ", ";\n opacity: ", ";\n }\n"])), width + size * 2, height + size * 2, size, size, width, height, Math.max(width, height), (
|
|
64
|
+
return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n overflow: hidden;\n left: 0px;\n top: 0px;\n width: ", "px;\n height: ", "px;\n\n &:after {\n content: '';\n position: absolute;\n left: ", "px;\n top: ", "px;\n border-radius: 100%;\n width: ", "px;\n height: ", "px;\n box-shadow: 0px 0px 0px ", "px\n ", ";\n opacity: ", ";\n }\n"])), width + size * 2, height + size * 2, size, size, width, height, Math.max(width, height), "var(--ds-surface-overlay, rgba(255, 255, 255))", "var(--ds-opacity-disabled, 0.3)");
|
|
67
65
|
};
|
|
68
66
|
|
|
69
67
|
exports.marginWrapperCircleStyles = marginWrapperCircleStyles;
|
|
@@ -9,8 +9,6 @@ exports.smallAvatarImageStyles = exports.predefinedAvatarViewWrapperStyles = exp
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var _tokens = require("@atlaskit/tokens");
|
|
13
|
-
|
|
14
12
|
var _constants = require("@atlaskit/theme/constants");
|
|
15
13
|
|
|
16
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
@@ -20,7 +18,7 @@ var _react = require("@emotion/react");
|
|
|
20
18
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
21
19
|
|
|
22
20
|
var avatarImageStyles = function avatarImageStyles(props) {
|
|
23
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", ";\n cursor: pointer;\n ", ";\n"])), (0, _constants.borderRadius)(), props.isSelected ? " box-shadow: 0px 0px 0px 1px ".concat((
|
|
21
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", ";\n cursor: pointer;\n ", ";\n"])), (0, _constants.borderRadius)(), props.isSelected ? " box-shadow: 0px 0px 0px 1px ".concat("var(--ds-border-inverse, white)", ", 0px 0px 0px 3px ", "var(--ds-border-selected, ".concat(_colors.B200, ")"), "; ") : '');
|
|
24
22
|
};
|
|
25
23
|
|
|
26
24
|
var largeAvatarImageStyles = function largeAvatarImageStyles(props) {
|
package/dist/cjs/version.json
CHANGED
|
@@ -16,9 +16,9 @@ var renderViewport = function renderViewport(viewport, image) {
|
|
|
16
16
|
var outputSize = arguments.length > 3 ? arguments[3] : undefined;
|
|
17
17
|
var visibleSourceBounds = viewport.visibleSourceBounds,
|
|
18
18
|
innerBounds = viewport.innerBounds,
|
|
19
|
-
itemSourceBounds = viewport.itemSourceBounds
|
|
20
|
-
orientation = viewport.orientation;
|
|
19
|
+
itemSourceBounds = viewport.itemSourceBounds;
|
|
21
20
|
var sourceBounds = visibleSourceBounds;
|
|
21
|
+
var orientation = CSS.supports('image-orientation', 'from-image') ? 1 : viewport.orientation;
|
|
22
22
|
var width = innerBounds.width,
|
|
23
23
|
height = innerBounds.height;
|
|
24
24
|
var targetSizeActual = outputSize !== null && outputSize !== void 0 ? outputSize : width;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { token } from '@atlaskit/tokens';
|
|
4
3
|
import { ModalSpinner } from '@atlaskit/media-ui';
|
|
5
4
|
export default class AsyncAvatarPickerDialog extends React.PureComponent {
|
|
6
5
|
constructor(...args) {
|
|
@@ -38,7 +37,7 @@ export default class AsyncAvatarPickerDialog extends React.PureComponent {
|
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
return /*#__PURE__*/React.createElement(ModalSpinner, {
|
|
41
|
-
blankedColor: `${
|
|
40
|
+
blankedColor: `${"var(--ds-blanket, rgba(255, 255, 255, 0.53))"}`,
|
|
42
41
|
invertSpinnerColor: false
|
|
43
42
|
});
|
|
44
43
|
}
|
|
@@ -58,7 +58,6 @@ export class ImageCropper extends Component {
|
|
|
58
58
|
imageHeight,
|
|
59
59
|
imageSource,
|
|
60
60
|
onRemoveImage,
|
|
61
|
-
imageOrientation,
|
|
62
61
|
onImageLoaded,
|
|
63
62
|
intl: {
|
|
64
63
|
formatMessage
|
|
@@ -98,7 +97,7 @@ export class ImageCropper extends Component {
|
|
|
98
97
|
dataURI: imageSource,
|
|
99
98
|
crop: false,
|
|
100
99
|
stretch: true,
|
|
101
|
-
previewOrientation:
|
|
100
|
+
previewOrientation: "from-image",
|
|
102
101
|
onImageLoad: onImageLoaded,
|
|
103
102
|
onImageError: this.onImageError
|
|
104
103
|
})), isCircularMask ? jsx("div", {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { token } from '@atlaskit/tokens';
|
|
2
1
|
import { css } from '@emotion/react';
|
|
3
2
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
4
3
|
import { N50A } from '@atlaskit/theme/colors'; // Using module augmentation to add crossOrigin attribute as it does not exist yet, PR has been opened in
|
|
@@ -26,8 +25,8 @@ const maskStyles = css`
|
|
|
26
25
|
left: ${CONTAINER_PADDING}px;
|
|
27
26
|
right: ${CONTAINER_PADDING}px;
|
|
28
27
|
box-shadow: 0 0 0 100px
|
|
29
|
-
${
|
|
30
|
-
opacity: ${
|
|
28
|
+
${"var(--ds-surface-overlay, rgba(255, 255, 255))"};
|
|
29
|
+
opacity: ${"var(--ds-opacity-disabled, 0.5)"};
|
|
31
30
|
`;
|
|
32
31
|
export const rectMaskStyles = css`
|
|
33
32
|
${maskStyles};
|
|
@@ -64,6 +63,6 @@ export const removeImageButtonStyles = css`
|
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
&:hover {
|
|
67
|
-
background-color: ${
|
|
66
|
+
background-color: ${`var(--ds-background-neutral-hovered, ${N50A})`};
|
|
68
67
|
}
|
|
69
68
|
`;
|
|
@@ -84,7 +84,7 @@ export class ImageNavigator extends Component {
|
|
|
84
84
|
naturalHeight: height
|
|
85
85
|
} = image;
|
|
86
86
|
|
|
87
|
-
if (isRotated(this.state.imageOrientation)) {
|
|
87
|
+
if (!CSS.supports('image-orientation', 'from-image') && isRotated(this.state.imageOrientation)) {
|
|
88
88
|
[width, height] = [height, width];
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -319,7 +319,8 @@ export class ImageNavigator extends Component {
|
|
|
319
319
|
css: paddedBreakStyles
|
|
320
320
|
}, jsx(FormattedMessage, errorMessage ? messages.try_again : messages.or)), jsx(Button, {
|
|
321
321
|
onClick: this.onUploadButtonClick,
|
|
322
|
-
isDisabled: isLoading
|
|
322
|
+
isDisabled: isLoading,
|
|
323
|
+
testId: "upload-button"
|
|
323
324
|
}, jsx(FormattedMessage, messages.upload_photo), jsx("input", {
|
|
324
325
|
css: fileInputStyles,
|
|
325
326
|
type: "file",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { token } from '@atlaskit/tokens';
|
|
2
1
|
import { css, keyframes } from '@emotion/react';
|
|
3
2
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
4
3
|
import { N200 } from '@atlaskit/theme/colors';
|
|
@@ -38,7 +37,7 @@ export const sliderContainerStyles = css`
|
|
|
38
37
|
box-sizing: content-box;
|
|
39
38
|
padding: 0;
|
|
40
39
|
}
|
|
41
|
-
background-color: ${
|
|
40
|
+
background-color: ${"var(--ds-surface-overlay, #fff)"};
|
|
42
41
|
`;
|
|
43
42
|
export const fileInputStyles = css`
|
|
44
43
|
display: none;
|
|
@@ -51,14 +50,14 @@ export const imageUploaderStyles = css`
|
|
|
51
50
|
margin: 0 10px 20px 10px;
|
|
52
51
|
`;
|
|
53
52
|
const droppingAnimation = css`
|
|
54
|
-
border-color: ${
|
|
53
|
+
border-color: ${"var(--ds-border-information, #0e56c4)"};
|
|
55
54
|
animation: ${spin} 8s linear infinite;
|
|
56
55
|
`;
|
|
57
56
|
|
|
58
|
-
const getBorder = showBorder => `${showBorder ? `2px dashed ${
|
|
57
|
+
const getBorder = showBorder => `${showBorder ? `2px dashed ${"var(--ds-border, #d0d6d0)"}` : 'none'}`;
|
|
59
58
|
|
|
60
59
|
const getDroppingAnimation = isDroppingFile => isDroppingFile ? css`
|
|
61
|
-
background-color: ${
|
|
60
|
+
background-color: ${"var(--ds-background-information-hovered, #ddecfe)"};
|
|
62
61
|
|
|
63
62
|
&:after {
|
|
64
63
|
${droppingAnimation}
|
|
@@ -100,7 +99,7 @@ const getWidth = isFullSize => `${isFullSize ? `width:${AVATAR_DIALOG_WIDTH - gr
|
|
|
100
99
|
|
|
101
100
|
export const dragZoneTextStyles = props => css`
|
|
102
101
|
text-align: center;
|
|
103
|
-
color: ${
|
|
102
|
+
color: ${`var(--ds-text-subtlest, ${N200})`};
|
|
104
103
|
${getWidth(props.isFullSize)};
|
|
105
104
|
`;
|
|
106
105
|
export const selectionBlockerStyles = css`
|
|
@@ -70,7 +70,11 @@ export async function initialiseImagePreview(fileInfo, containerRect, maxZoom) {
|
|
|
70
70
|
|
|
71
71
|
try {
|
|
72
72
|
const result = await Promise.all([getOrientation(fileInfo.file), loadImage(fileInfo.src)]);
|
|
73
|
-
|
|
73
|
+
|
|
74
|
+
if (!CSS.supports('image-orientation', 'from-image')) {
|
|
75
|
+
orientation = result[0];
|
|
76
|
+
}
|
|
77
|
+
|
|
74
78
|
img = result[1];
|
|
75
79
|
} catch (e) {
|
|
76
80
|
return null;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { token } from '@atlaskit/tokens';
|
|
2
1
|
import { css } from '@emotion/react';
|
|
3
2
|
import { R500 } from '@atlaskit/theme/colors';
|
|
4
3
|
export const checkeredBg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAA6hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxOC0xMC0zMFQxMjoxMDo5MjwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAzLjcuNTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpDb21wcmVzc2lvbj4wPC90aWZmOkNvbXByZXNzaW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpZUmVzb2x1dGlvbj43MjwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6WFJlc29sdXRpb24+NzI8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4xMDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MTA8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KX+XPjwAAACtJREFUGBljPHv27H8GNGBsbMyIJsTAhC6Aiz+ACjEcDXIjNg8OoBuJthoAzy0HeT3Qcc0AAAAASUVORK5CYII=';
|
|
@@ -7,8 +6,8 @@ export const imagePlacerWrapperStyles = props => css`
|
|
|
7
6
|
display: inline-block;
|
|
8
7
|
`;
|
|
9
8
|
export const imagePlacerErrorWrapperStyles = css`
|
|
10
|
-
background-color: ${
|
|
11
|
-
color: ${
|
|
9
|
+
background-color: ${`var(--ds-background-danger-bold, ${R500})`};
|
|
10
|
+
color: ${"var(--ds-text-inverse, white)"};
|
|
12
11
|
width: 100%;
|
|
13
12
|
height: 100%;
|
|
14
13
|
text-align: center;
|
|
@@ -56,11 +55,11 @@ export const marginWrapperSquareStyles = ({
|
|
|
56
55
|
left: 0;
|
|
57
56
|
top: 0;
|
|
58
57
|
border-style: solid;
|
|
59
|
-
border-color: ${
|
|
58
|
+
border-color: ${"var(--ds-surface-overlay, rgba(255, 255, 255))"};
|
|
60
59
|
border-width: ${size}px;
|
|
61
60
|
width: ${width}px;
|
|
62
61
|
height: ${height}px;
|
|
63
|
-
opacity: ${
|
|
62
|
+
opacity: ${"var(--ds-opacity-disabled, 0.3)"};
|
|
64
63
|
`;
|
|
65
64
|
export const marginWrapperCircleStyles = ({
|
|
66
65
|
width,
|
|
@@ -83,7 +82,7 @@ export const marginWrapperCircleStyles = ({
|
|
|
83
82
|
width: ${width}px;
|
|
84
83
|
height: ${height}px;
|
|
85
84
|
box-shadow: 0px 0px 0px ${Math.max(width, height)}px
|
|
86
|
-
${
|
|
87
|
-
opacity: ${
|
|
85
|
+
${"var(--ds-surface-overlay, rgba(255, 255, 255))"};
|
|
86
|
+
opacity: ${"var(--ds-opacity-disabled, 0.3)"};
|
|
88
87
|
}
|
|
89
88
|
`;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { token } from '@atlaskit/tokens';
|
|
2
1
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
3
2
|
import { B200 } from '@atlaskit/theme/colors';
|
|
4
3
|
import { css } from '@emotion/react';
|
|
@@ -6,7 +5,7 @@ import { css } from '@emotion/react';
|
|
|
6
5
|
const avatarImageStyles = props => css`
|
|
7
6
|
border-radius: ${borderRadius()};
|
|
8
7
|
cursor: pointer;
|
|
9
|
-
${props.isSelected ? ` box-shadow: 0px 0px 0px 1px ${
|
|
8
|
+
${props.isSelected ? ` box-shadow: 0px 0px 0px 1px ${"var(--ds-border-inverse, white)"}, 0px 0px 0px 3px ${`var(--ds-border-selected, ${B200})`}; ` : ''};
|
|
10
9
|
`;
|
|
11
10
|
|
|
12
11
|
export const largeAvatarImageStyles = props => css`
|
package/dist/es2019/version.json
CHANGED
|
@@ -3,10 +3,10 @@ export const renderViewport = (viewport, image, canvas = document.createElement(
|
|
|
3
3
|
const {
|
|
4
4
|
visibleSourceBounds,
|
|
5
5
|
innerBounds,
|
|
6
|
-
itemSourceBounds
|
|
7
|
-
orientation
|
|
6
|
+
itemSourceBounds
|
|
8
7
|
} = viewport;
|
|
9
8
|
let sourceBounds = visibleSourceBounds;
|
|
9
|
+
const orientation = CSS.supports('image-orientation', 'from-image') ? 1 : viewport.orientation;
|
|
10
10
|
const {
|
|
11
11
|
width,
|
|
12
12
|
height
|
|
@@ -13,7 +13,6 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
13
13
|
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; } }
|
|
14
14
|
|
|
15
15
|
import React from 'react';
|
|
16
|
-
import { token } from '@atlaskit/tokens';
|
|
17
16
|
import { ModalSpinner } from '@atlaskit/media-ui';
|
|
18
17
|
|
|
19
18
|
var AsyncAvatarPickerDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -98,7 +97,7 @@ var AsyncAvatarPickerDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
return /*#__PURE__*/React.createElement(ModalSpinner, {
|
|
101
|
-
blankedColor: "
|
|
100
|
+
blankedColor: "var(--ds-blanket, rgba(255, 255, 255, 0.53))",
|
|
102
101
|
invertSpinnerColor: false
|
|
103
102
|
});
|
|
104
103
|
}
|
|
@@ -79,7 +79,6 @@ export var ImageCropper = /*#__PURE__*/function (_Component) {
|
|
|
79
79
|
imageHeight = _this$props3.imageHeight,
|
|
80
80
|
imageSource = _this$props3.imageSource,
|
|
81
81
|
onRemoveImage = _this$props3.onRemoveImage,
|
|
82
|
-
imageOrientation = _this$props3.imageOrientation,
|
|
83
82
|
onImageLoaded = _this$props3.onImageLoaded,
|
|
84
83
|
formatMessage = _this$props3.intl.formatMessage;
|
|
85
84
|
var containerStyle = {
|
|
@@ -116,7 +115,7 @@ export var ImageCropper = /*#__PURE__*/function (_Component) {
|
|
|
116
115
|
dataURI: imageSource,
|
|
117
116
|
crop: false,
|
|
118
117
|
stretch: true,
|
|
119
|
-
previewOrientation:
|
|
118
|
+
previewOrientation: "from-image",
|
|
120
119
|
onImageLoad: onImageLoaded,
|
|
121
120
|
onImageError: this.onImageError
|
|
122
121
|
})), isCircularMask ? jsx("div", {
|
|
@@ -2,7 +2,6 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
4
4
|
|
|
5
|
-
import { token } from '@atlaskit/tokens';
|
|
6
5
|
import { css } from '@emotion/react';
|
|
7
6
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
8
7
|
import { N50A } from '@atlaskit/theme/colors'; // Using module augmentation to add crossOrigin attribute as it does not exist yet, PR has been opened in
|
|
@@ -11,9 +10,9 @@ import { N50A } from '@atlaskit/theme/colors'; // Using module augmentation to a
|
|
|
11
10
|
export var containerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n border-radius: ", "px;\n"])), borderRadius());
|
|
12
11
|
export var imageContainerStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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"])), borderRadius());
|
|
13
12
|
export var CONTAINER_PADDING = 28;
|
|
14
|
-
var maskStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: ", "px;\n bottom: ", "px;\n left: ", "px;\n right: ", "px;\n box-shadow: 0 0 0 100px\n ", ";\n opacity: ", ";\n"])), CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING,
|
|
13
|
+
var maskStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: ", "px;\n bottom: ", "px;\n left: ", "px;\n right: ", "px;\n box-shadow: 0 0 0 100px\n ", ";\n opacity: ", ";\n"])), CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING, CONTAINER_PADDING, "var(--ds-surface-overlay, rgba(255, 255, 255))", "var(--ds-opacity-disabled, 0.5)");
|
|
15
14
|
export var rectMaskStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n border-radius: ", "px;\n"])), maskStyles, borderRadius());
|
|
16
15
|
export var circularMaskStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n ", ";\n border-radius: 500px;\n"])), maskStyles);
|
|
17
16
|
export var dragOverlayStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: absolute;\n width: 100%;\n height: 100%;\n cursor: move;\n"])));
|
|
18
17
|
export var removeImageContainerStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: absolute;\n right: 4px;\n top: 4px;\n"])));
|
|
19
|
-
export var removeImageButtonStyles = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\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"])), borderRadius(),
|
|
18
|
+
export var removeImageButtonStyles = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\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"])), borderRadius(), "var(--ds-background-neutral-hovered, ".concat(N50A, ")"));
|
|
@@ -110,7 +110,7 @@ export var ImageNavigator = /*#__PURE__*/function (_Component) {
|
|
|
110
110
|
var width = image.naturalWidth,
|
|
111
111
|
height = image.naturalHeight;
|
|
112
112
|
|
|
113
|
-
if (isRotated(_this.state.imageOrientation)) {
|
|
113
|
+
if (!CSS.supports('image-orientation', 'from-image') && isRotated(_this.state.imageOrientation)) {
|
|
114
114
|
var _ref = [height, width];
|
|
115
115
|
width = _ref[0];
|
|
116
116
|
height = _ref[1];
|
|
@@ -372,7 +372,8 @@ export var ImageNavigator = /*#__PURE__*/function (_Component) {
|
|
|
372
372
|
css: paddedBreakStyles
|
|
373
373
|
}, jsx(FormattedMessage, errorMessage ? messages.try_again : messages.or)), jsx(Button, {
|
|
374
374
|
onClick: this.onUploadButtonClick,
|
|
375
|
-
isDisabled: isLoading
|
|
375
|
+
isDisabled: isLoading,
|
|
376
|
+
testId: "upload-button"
|
|
376
377
|
}, jsx(FormattedMessage, messages.upload_photo), jsx("input", {
|
|
377
378
|
css: fileInputStyles,
|
|
378
379
|
type: "file",
|
|
@@ -2,7 +2,6 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14;
|
|
4
4
|
|
|
5
|
-
import { token } from '@atlaskit/tokens';
|
|
6
5
|
import { css, keyframes } from '@emotion/react';
|
|
7
6
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
8
7
|
import { N200 } from '@atlaskit/theme/colors';
|
|
@@ -11,17 +10,17 @@ import { AVATAR_DIALOG_WIDTH } from '../avatar-picker-dialog/layout-const';
|
|
|
11
10
|
var spin = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n"])));
|
|
12
11
|
export var imageBgStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n width: 256px;\n height: 256px;\n background: url('", "');\n border-radius: ", ";\n"])), checkeredBg, borderRadius());
|
|
13
12
|
export var containerStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: ", "px;\n box-sizing: border-box;\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n position: relative;\n"])), gridSize() * 32);
|
|
14
|
-
export var sliderContainerStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n align-items: center;\n justify-content: center;\n display: flex;\n flex-direction: row;\n margin-top: ", "px;\n\n input {\n box-sizing: content-box;\n padding: 0;\n }\n background-color: ", ";\n"])), gridSize(),
|
|
13
|
+
export var sliderContainerStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n align-items: center;\n justify-content: center;\n display: flex;\n flex-direction: row;\n margin-top: ", "px;\n\n input {\n box-sizing: content-box;\n padding: 0;\n }\n background-color: ", ";\n"])), gridSize(), "var(--ds-surface-overlay, #fff)");
|
|
15
14
|
export var fileInputStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: none;\n"])));
|
|
16
15
|
export var imageUploaderStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n margin: 0 10px 20px 10px;\n"])));
|
|
17
|
-
var droppingAnimation = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n border-color: ", ";\n animation: ", " 8s linear infinite;\n"])),
|
|
16
|
+
var droppingAnimation = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n border-color: ", ";\n animation: ", " 8s linear infinite;\n"])), "var(--ds-border-information, #0e56c4)", spin);
|
|
18
17
|
|
|
19
18
|
var getBorder = function getBorder(showBorder) {
|
|
20
|
-
return "".concat(showBorder ? "2px dashed ".concat(
|
|
19
|
+
return "".concat(showBorder ? "2px dashed ".concat("var(--ds-border, #d0d6d0)") : 'none');
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
var getDroppingAnimation = function getDroppingAnimation(isDroppingFile) {
|
|
24
|
-
return isDroppingFile ? css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n background-color: ", ";\n\n &:after {\n ", "\n }\n "])),
|
|
23
|
+
return isDroppingFile ? css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n background-color: ", ";\n\n &:after {\n ", "\n }\n "])), "var(--ds-background-information-hovered, #ddecfe)", droppingAnimation) : '';
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
export var dragZoneStyles = function dragZoneStyles(props) {
|
|
@@ -35,7 +34,7 @@ var getWidth = function getWidth(isFullSize) {
|
|
|
35
34
|
};
|
|
36
35
|
|
|
37
36
|
export var dragZoneTextStyles = function dragZoneTextStyles(props) {
|
|
38
|
-
return css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n text-align: center;\n color: ", ";\n ", ";\n"])),
|
|
37
|
+
return css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n text-align: center;\n color: ", ";\n ", ";\n"])), "var(--ds-text-subtlest, ".concat(N200, ")"), getWidth(props.isFullSize));
|
|
39
38
|
};
|
|
40
39
|
export var selectionBlockerStyles = css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n position: fixed;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n background-color: transparent;\n user-select: none;\n"])));
|
|
41
40
|
export var paddedBreakStyles = css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n margin-top: 10px !important;\n margin-bottom: 10px;\n"])));
|
|
@@ -84,7 +84,11 @@ function _initialiseImagePreview() {
|
|
|
84
84
|
|
|
85
85
|
case 4:
|
|
86
86
|
result = _context.sent;
|
|
87
|
-
|
|
87
|
+
|
|
88
|
+
if (!CSS.supports('image-orientation', 'from-image')) {
|
|
89
|
+
orientation = result[0];
|
|
90
|
+
}
|
|
91
|
+
|
|
88
92
|
img = result[1];
|
|
89
93
|
_context.next = 12;
|
|
90
94
|
break;
|
|
@@ -2,14 +2,13 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
4
4
|
|
|
5
|
-
import { token } from '@atlaskit/tokens';
|
|
6
5
|
import { css } from '@emotion/react';
|
|
7
6
|
import { R500 } from '@atlaskit/theme/colors';
|
|
8
7
|
export var checkeredBg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAA6hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxOC0xMC0zMFQxMjoxMDo5MjwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+UGl4ZWxtYXRvciAzLjcuNTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpDb21wcmVzc2lvbj4wPC90aWZmOkNvbXByZXNzaW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpZUmVzb2x1dGlvbj43MjwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6WFJlc29sdXRpb24+NzI8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4xMDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MTA8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KX+XPjwAAACtJREFUGBljPHv27H8GNGBsbMyIJsTAhC6Aiz+ACjEcDXIjNg8OoBuJthoAzy0HeT3Qcc0AAAAASUVORK5CYII=';
|
|
9
8
|
export var imagePlacerWrapperStyles = function imagePlacerWrapperStyles(props) {
|
|
10
9
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n display: inline-block;\n"])), props.backgroundColor);
|
|
11
10
|
};
|
|
12
|
-
export var imagePlacerErrorWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n color: ", ";\n width: 100%;\n height: 100%;\n text-align: center;\n padding-top: 45%;\n"])),
|
|
11
|
+
export var imagePlacerErrorWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n color: ", ";\n width: 100%;\n height: 100%;\n text-align: center;\n padding-top: 45%;\n"])), "var(--ds-background-danger-bold, ".concat(R500, ")"), "var(--ds-text-inverse, white)");
|
|
13
12
|
export var containerWrapperStyles = function containerWrapperStyles(_ref) {
|
|
14
13
|
var width = _ref.width,
|
|
15
14
|
height = _ref.height,
|
|
@@ -29,11 +28,11 @@ export var marginWrapperSquareStyles = function marginWrapperSquareStyles(_ref3)
|
|
|
29
28
|
var width = _ref3.width,
|
|
30
29
|
height = _ref3.height,
|
|
31
30
|
size = _ref3.size;
|
|
32
|
-
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n left: 0;\n top: 0;\n border-style: solid;\n border-color: ", ";\n border-width: ", "px;\n width: ", "px;\n height: ", "px;\n opacity: ", ";\n"])),
|
|
31
|
+
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n left: 0;\n top: 0;\n border-style: solid;\n border-color: ", ";\n border-width: ", "px;\n width: ", "px;\n height: ", "px;\n opacity: ", ";\n"])), "var(--ds-surface-overlay, rgba(255, 255, 255))", size, width, height, "var(--ds-opacity-disabled, 0.3)");
|
|
33
32
|
};
|
|
34
33
|
export var marginWrapperCircleStyles = function marginWrapperCircleStyles(_ref4) {
|
|
35
34
|
var width = _ref4.width,
|
|
36
35
|
height = _ref4.height,
|
|
37
36
|
size = _ref4.size;
|
|
38
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: absolute;\n overflow: hidden;\n left: 0px;\n top: 0px;\n width: ", "px;\n height: ", "px;\n\n &:after {\n content: '';\n position: absolute;\n left: ", "px;\n top: ", "px;\n border-radius: 100%;\n width: ", "px;\n height: ", "px;\n box-shadow: 0px 0px 0px ", "px\n ", ";\n opacity: ", ";\n }\n"])), width + size * 2, height + size * 2, size, size, width, height, Math.max(width, height),
|
|
37
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: absolute;\n overflow: hidden;\n left: 0px;\n top: 0px;\n width: ", "px;\n height: ", "px;\n\n &:after {\n content: '';\n position: absolute;\n left: ", "px;\n top: ", "px;\n border-radius: 100%;\n width: ", "px;\n height: ", "px;\n box-shadow: 0px 0px 0px ", "px\n ", ";\n opacity: ", ";\n }\n"])), width + size * 2, height + size * 2, size, size, width, height, Math.max(width, height), "var(--ds-surface-overlay, rgba(255, 255, 255))", "var(--ds-opacity-disabled, 0.3)");
|
|
39
38
|
};
|
|
@@ -2,13 +2,12 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
4
|
|
|
5
|
-
import { token } from '@atlaskit/tokens';
|
|
6
5
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
7
6
|
import { B200 } from '@atlaskit/theme/colors';
|
|
8
7
|
import { css } from '@emotion/react';
|
|
9
8
|
|
|
10
9
|
var avatarImageStyles = function avatarImageStyles(props) {
|
|
11
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", ";\n cursor: pointer;\n ", ";\n"])), borderRadius(), props.isSelected ? " box-shadow: 0px 0px 0px 1px ".concat(
|
|
10
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", ";\n cursor: pointer;\n ", ";\n"])), borderRadius(), props.isSelected ? " box-shadow: 0px 0px 0px 1px ".concat("var(--ds-border-inverse, white)", ", 0px 0px 0px 3px ", "var(--ds-border-selected, ".concat(B200, ")"), "; ") : '');
|
|
12
11
|
};
|
|
13
12
|
|
|
14
13
|
export var largeAvatarImageStyles = function largeAvatarImageStyles(props) {
|
package/dist/esm/version.json
CHANGED
|
@@ -6,9 +6,9 @@ export var renderViewport = function renderViewport(viewport, image) {
|
|
|
6
6
|
var outputSize = arguments.length > 3 ? arguments[3] : undefined;
|
|
7
7
|
var visibleSourceBounds = viewport.visibleSourceBounds,
|
|
8
8
|
innerBounds = viewport.innerBounds,
|
|
9
|
-
itemSourceBounds = viewport.itemSourceBounds
|
|
10
|
-
orientation = viewport.orientation;
|
|
9
|
+
itemSourceBounds = viewport.itemSourceBounds;
|
|
11
10
|
var sourceBounds = visibleSourceBounds;
|
|
11
|
+
var orientation = CSS.supports('image-orientation', 'from-image') ? 1 : viewport.orientation;
|
|
12
12
|
var width = innerBounds.width,
|
|
13
13
|
height = innerBounds.height;
|
|
14
14
|
var targetSizeActual = outputSize !== null && outputSize !== void 0 ? outputSize : width;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-avatar-picker",
|
|
3
|
-
"version": "24.2.
|
|
3
|
+
"version": "24.2.1",
|
|
4
4
|
"description": "A component to select, drag and resize image avatars. It also provides a default list of predefined avatars.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@atlaskit/button": "^16.5.0",
|
|
30
30
|
"@atlaskit/icon": "^21.11.0",
|
|
31
|
-
"@atlaskit/media-ui": "^22.
|
|
31
|
+
"@atlaskit/media-ui": "^22.3.0",
|
|
32
32
|
"@atlaskit/modal-dialog": "^12.4.0",
|
|
33
33
|
"@atlaskit/range": "^7.0.0",
|
|
34
34
|
"@atlaskit/spinner": "^15.3.0",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@atlaskit/media-core": "^34.0.0",
|
|
48
48
|
"@atlaskit/media-test-helpers": "^30.1.0",
|
|
49
49
|
"@atlaskit/page": "^12.2.0",
|
|
50
|
+
"@atlaskit/visual-regression": "*",
|
|
50
51
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
51
52
|
"@types/enzyme": "^3.1.15",
|
|
52
53
|
"enzyme": "^3.10.0",
|
package/report.api.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
### Table of contents
|
|
9
9
|
|
|
10
10
|
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
11
12
|
|
|
12
13
|
### Main Entry Types
|
|
13
14
|
|
|
@@ -126,3 +127,17 @@ export type OnLoadHandler = (params: LoadParameters) => void;
|
|
|
126
127
|
```
|
|
127
128
|
|
|
128
129
|
<!--SECTION END: Main Entry Types-->
|
|
130
|
+
|
|
131
|
+
### Peer Dependencies
|
|
132
|
+
|
|
133
|
+
<!--SECTION START: Peer Dependencies-->
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"@emotion/react": "^11.7.1",
|
|
138
|
+
"react": "^16.8.0",
|
|
139
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
<!--SECTION END: Peer Dependencies-->
|