@atlaskit/media-avatar-picker 24.6.5 → 24.6.6
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 +6 -0
- package/compass.yml +3 -2
- package/dist/cjs/avatar-list/index.js +4 -1
- package/dist/cjs/avatar-list/styles.js +6 -0
- package/dist/cjs/avatar-picker-dialog/SubmitErrorDialog.js +17 -13
- package/dist/cjs/avatar-picker-dialog/index.js +9 -6
- package/dist/cjs/avatar-picker-dialog/styles.js +10 -0
- package/dist/cjs/image-cropper/index.js +14 -1
- package/dist/cjs/image-navigator/dragZone.js +2 -0
- package/dist/cjs/image-navigator/index.js +24 -18
- package/dist/cjs/image-navigator/slider.js +30 -27
- package/dist/cjs/image-navigator/styles.js +32 -2
- package/dist/cjs/image-placer/containerWrapper.js +4 -0
- package/dist/cjs/image-placer/imagePlacerErrorWrapper.js +7 -3
- package/dist/cjs/image-placer/imageWrapper.js +12 -8
- package/dist/cjs/image-placer/index.js +29 -26
- package/dist/cjs/image-placer/margin.js +3 -1
- package/dist/cjs/image-placer/styles.js +20 -0
- package/dist/cjs/predefined-avatar-list/index.js +24 -20
- package/dist/cjs/predefined-avatar-list/styles.js +2 -2
- package/dist/cjs/predefined-avatar-view/index.js +27 -23
- package/dist/cjs/predefined-avatar-view/styles.js +13 -0
- package/dist/cjs/styles.js +9 -0
- package/dist/es2019/avatar-list/index.js +4 -1
- package/dist/es2019/avatar-list/styles.js +6 -0
- package/dist/es2019/avatar-picker-dialog/SubmitErrorDialog.js +17 -13
- package/dist/es2019/avatar-picker-dialog/index.js +9 -5
- package/dist/es2019/avatar-picker-dialog/styles.js +10 -0
- package/dist/es2019/image-cropper/index.js +14 -0
- package/dist/es2019/image-navigator/dragZone.js +2 -0
- package/dist/es2019/image-navigator/index.js +24 -17
- package/dist/es2019/image-navigator/slider.js +26 -22
- package/dist/es2019/image-navigator/styles.js +32 -2
- package/dist/es2019/image-placer/containerWrapper.js +4 -0
- package/dist/es2019/image-placer/imagePlacerErrorWrapper.js +4 -1
- package/dist/es2019/image-placer/imageWrapper.js +4 -1
- package/dist/es2019/image-placer/index.js +29 -25
- package/dist/es2019/image-placer/margin.js +3 -0
- package/dist/es2019/image-placer/styles.js +19 -0
- package/dist/es2019/predefined-avatar-list/index.js +24 -20
- package/dist/es2019/predefined-avatar-list/styles.js +2 -1
- package/dist/es2019/predefined-avatar-view/index.js +27 -23
- package/dist/es2019/predefined-avatar-view/styles.js +13 -0
- package/dist/es2019/styles.js +9 -0
- package/dist/esm/avatar-list/index.js +4 -1
- package/dist/esm/avatar-list/styles.js +6 -0
- package/dist/esm/avatar-picker-dialog/SubmitErrorDialog.js +17 -13
- package/dist/esm/avatar-picker-dialog/index.js +9 -5
- package/dist/esm/avatar-picker-dialog/styles.js +10 -0
- package/dist/esm/image-cropper/index.js +14 -0
- package/dist/esm/image-navigator/dragZone.js +2 -0
- package/dist/esm/image-navigator/index.js +24 -17
- package/dist/esm/image-navigator/slider.js +30 -26
- package/dist/esm/image-navigator/styles.js +32 -2
- package/dist/esm/image-placer/containerWrapper.js +4 -0
- package/dist/esm/image-placer/imagePlacerErrorWrapper.js +7 -3
- package/dist/esm/image-placer/imageWrapper.js +12 -8
- package/dist/esm/image-placer/index.js +29 -25
- package/dist/esm/image-placer/margin.js +3 -0
- package/dist/esm/image-placer/styles.js +19 -0
- package/dist/esm/predefined-avatar-list/index.js +24 -20
- package/dist/esm/predefined-avatar-list/styles.js +2 -1
- package/dist/esm/predefined-avatar-view/index.js +27 -23
- package/dist/esm/predefined-avatar-view/styles.js +13 -0
- package/dist/esm/styles.js +9 -0
- package/example-helpers/StatefulAvatarPickerDialog.tsx +2 -0
- package/example-helpers/styles.ts +9 -0
- package/package.json +77 -77
package/dist/es2019/styles.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css } from '@emotion/react';
|
|
2
3
|
import { B200, B100 } from '@atlaskit/theme/colors';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
3
6
|
export const avatarImageStyles = css({
|
|
4
7
|
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
5
8
|
cursor: 'pointer'
|
|
6
9
|
});
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
7
12
|
export const visuallyHiddenRadioStyles = css({
|
|
8
13
|
width: '1px',
|
|
9
14
|
height: '1px',
|
|
@@ -14,9 +19,13 @@ export const visuallyHiddenRadioStyles = css({
|
|
|
14
19
|
overflow: 'hidden',
|
|
15
20
|
whiteSpace: 'nowrap'
|
|
16
21
|
});
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
17
24
|
export const selectedShadow = css({
|
|
18
25
|
boxShadow: `0px 0px 0px 1px ${"var(--ds-border-inverse, white)"}, 0px 0px 0px 3px ${`var(--ds-border-selected, ${B200})`}`
|
|
19
26
|
});
|
|
27
|
+
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
20
29
|
export const focusedShadow = css({
|
|
21
30
|
boxShadow: `0px 0px 0px 1px ${"var(--ds-border-inverse, white)"}, 0px 0px 0px 3px ${`var(--ds-border-focused, ${B100})`}`
|
|
22
31
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
4
|
import { useIntl } from 'react-intl-next';
|
|
4
5
|
import { messages } from '@atlaskit/media-ui';
|
|
@@ -36,7 +37,9 @@ export var AvatarList = function AvatarList(_ref) {
|
|
|
36
37
|
});
|
|
37
38
|
return jsx("div", {
|
|
38
39
|
role: "radiogroup",
|
|
39
|
-
"aria-label": selectAvatarLabel || intl.formatMessage(messages.select_an_avatar)
|
|
40
|
+
"aria-label": selectAvatarLabel || intl.formatMessage(messages.select_an_avatar)
|
|
41
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
42
|
+
,
|
|
40
43
|
css: avatarListWrapperStyles
|
|
41
44
|
}, cards);
|
|
42
45
|
};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css } from '@emotion/react';
|
|
2
3
|
import { avatarImageStyles } from '../styles';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
3
6
|
export var smallAvatarImageStyles = css(avatarImageStyles, {
|
|
4
7
|
width: "var(--ds-space-500, 40px)",
|
|
5
8
|
height: "var(--ds-space-500, 40px)"
|
|
6
9
|
});
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
7
12
|
export var avatarListWrapperStyles = css({
|
|
8
13
|
display: 'flex',
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
9
15
|
label: {
|
|
10
16
|
paddingRight: "var(--ds-space-050, 4px)",
|
|
11
17
|
display: 'inline-flex'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
4
|
import { useRef, useEffect } from 'react';
|
|
4
5
|
import { R400 } from '@atlaskit/theme/colors';
|
|
@@ -15,17 +16,20 @@ export var SubmitErrorDialog = function SubmitErrorDialog() {
|
|
|
15
16
|
flagContainerRef.current.children[0].focus();
|
|
16
17
|
}
|
|
17
18
|
}, []);
|
|
18
|
-
return
|
|
19
|
-
css
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
return (
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
21
|
+
jsx("div", {
|
|
22
|
+
css: avatarPickerErrorStyles,
|
|
23
|
+
ref: flagContainerRef
|
|
24
|
+
}, jsx(Flag, {
|
|
25
|
+
appearance: "error",
|
|
26
|
+
icon: jsx(ErrorIcon, {
|
|
27
|
+
label: "Error",
|
|
28
|
+
secondaryColor: "var(--ds-background-danger-bold, ".concat(R400, ")")
|
|
29
|
+
}),
|
|
30
|
+
id: "avatar-picker-error",
|
|
31
|
+
key: "error",
|
|
32
|
+
title: intl.formatMessage(messages.or_select_default_avatars)
|
|
33
|
+
}))
|
|
34
|
+
);
|
|
31
35
|
};
|
|
@@ -12,6 +12,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
13
|
/** @jsx jsx */
|
|
14
14
|
import React, { Fragment } from 'react';
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
16
|
import { jsx } from '@emotion/react';
|
|
16
17
|
import { PureComponent } from 'react';
|
|
17
18
|
import ModalDialog, { ModalFooter, ModalBody, useModal } from '@atlaskit/modal-dialog';
|
|
@@ -47,11 +48,14 @@ export var fixedCrop = {
|
|
|
47
48
|
var HeaderContent = function HeaderContent(_ref) {
|
|
48
49
|
var title = _ref.title;
|
|
49
50
|
var modal = useModal();
|
|
50
|
-
return
|
|
51
|
-
css
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
return (
|
|
52
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
53
|
+
jsx("h1", {
|
|
54
|
+
css: modalHeaderStyles,
|
|
55
|
+
"data-test-id": "modal-header",
|
|
56
|
+
id: modal.titleId
|
|
57
|
+
}, title || jsx(FormattedMessage, messages.upload_an_avatar))
|
|
58
|
+
);
|
|
55
59
|
};
|
|
56
60
|
var altTextFieldStyles = xcss({
|
|
57
61
|
paddingTop: 'space.100',
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css } from '@emotion/react';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
2
5
|
export var avatarPickerErrorStyles = css({
|
|
3
6
|
margin: "0 ".concat("var(--ds-space-200, 16px)", " ", "var(--ds-space-200, 16px)")
|
|
4
7
|
});
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
5
10
|
export var formStyles = css({
|
|
6
11
|
margin: 0
|
|
7
12
|
});
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
8
15
|
export var avatarPickerViewWrapperStyles = css({
|
|
9
16
|
display: 'flex',
|
|
10
17
|
justifyContent: 'center',
|
|
@@ -12,8 +19,11 @@ export var avatarPickerViewWrapperStyles = css({
|
|
|
12
19
|
textAlign: 'center',
|
|
13
20
|
minHeight: '339px'
|
|
14
21
|
});
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
15
24
|
export var modalHeaderStyles = css({
|
|
16
25
|
// Using `&` twice to increase specificity
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
17
27
|
'&&': {
|
|
18
28
|
margin: "var(--ds-space-200, 16px)",
|
|
19
29
|
fontWeight: 500,
|
|
@@ -8,6 +8,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
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
|
/** @jsx jsx */
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
12
|
import { jsx } from '@emotion/react';
|
|
12
13
|
import React from 'react';
|
|
13
14
|
import { Component } from 'react';
|
|
@@ -17,6 +18,7 @@ import { messages, MediaImage } from '@atlaskit/media-ui';
|
|
|
17
18
|
import { isImageRemote } from './isImageRemote';
|
|
18
19
|
import { CONTAINER_PADDING } from './styles';
|
|
19
20
|
import { N50A } from '@atlaskit/theme/colors';
|
|
21
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
20
22
|
import { css } from '@emotion/react';
|
|
21
23
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
22
24
|
import { ERROR } from '../avatar-picker-dialog';
|
|
@@ -29,6 +31,7 @@ var removeImageButtonStyles = css({
|
|
|
29
31
|
border: 'none',
|
|
30
32
|
cursor: 'pointer',
|
|
31
33
|
padding: 0,
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
32
35
|
svg: {
|
|
33
36
|
position: 'absolute',
|
|
34
37
|
top: "var(--ds-space-050, 4px)",
|
|
@@ -54,9 +57,13 @@ var maskShadow = {
|
|
|
54
57
|
};
|
|
55
58
|
var maskStyles = xcss({
|
|
56
59
|
position: 'absolute',
|
|
60
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
57
61
|
top: "".concat(CONTAINER_PADDING, "px"),
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
58
63
|
bottom: "".concat(CONTAINER_PADDING, "px"),
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
59
65
|
left: "".concat(CONTAINER_PADDING, "px"),
|
|
66
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
60
67
|
right: "".concat(CONTAINER_PADDING, "px"),
|
|
61
68
|
opacity: 'opacity.disabled'
|
|
62
69
|
});
|
|
@@ -127,16 +134,23 @@ export var ImageCropper = /*#__PURE__*/function (_Component) {
|
|
|
127
134
|
onImageLoaded = _this$props3.onImageLoaded,
|
|
128
135
|
formatMessage = _this$props3.intl.formatMessage;
|
|
129
136
|
var containerDimensions = xcss({
|
|
137
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
130
138
|
width: "".concat(containerSize, "px"),
|
|
139
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
131
140
|
height: "".concat(containerSize, "px")
|
|
132
141
|
});
|
|
133
142
|
var width = imageWidth ? "".concat(imageWidth, "px") : 'auto';
|
|
134
143
|
var height = imageHeight ? "".concat(imageHeight, "px") : 'auto';
|
|
135
144
|
var imageContainerDynamicStyles = xcss({
|
|
145
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
136
146
|
width: width,
|
|
147
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
137
148
|
height: height,
|
|
149
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
138
150
|
display: width === 'auto' ? 'none' : 'block',
|
|
151
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
139
152
|
top: "".concat(top, "px"),
|
|
153
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
140
154
|
left: "".concat(left, "px")
|
|
141
155
|
});
|
|
142
156
|
var crossOrigin;
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["showBorder", "isDroppingFile", "children"];
|
|
4
4
|
/**@jsx jsx */
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
6
|
import { jsx } from '@emotion/react';
|
|
6
7
|
import { dragZoneStyles } from './styles';
|
|
7
8
|
export var DragZone = function DragZone(_ref) {
|
|
@@ -10,6 +11,7 @@ export var DragZone = function DragZone(_ref) {
|
|
|
10
11
|
children = _ref.children,
|
|
11
12
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
13
|
return jsx("div", _extends({
|
|
14
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
13
15
|
css: dragZoneStyles({
|
|
14
16
|
showBorder: showBorder,
|
|
15
17
|
isDroppingFile: isDroppingFile
|
|
@@ -12,6 +12,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
13
|
/** @jsx jsx */
|
|
14
14
|
import React from 'react';
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
16
|
import { jsx } from '@emotion/react';
|
|
16
17
|
import { Component } from 'react';
|
|
17
18
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
@@ -311,23 +312,27 @@ export var ImageNavigator = /*#__PURE__*/function (_Component) {
|
|
|
311
312
|
var _this$props3 = this.props,
|
|
312
313
|
errorMessage = _this$props3.errorMessage,
|
|
313
314
|
isLoading = _this$props3.isLoading;
|
|
314
|
-
return
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
315
|
+
return (
|
|
316
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
317
|
+
jsx("div", {
|
|
318
|
+
id: "image-uploader",
|
|
319
|
+
css: imageUploaderStyles
|
|
320
|
+
}, this.renderDragZone(), isLoading ? null : jsx("div", null, jsx("p", {
|
|
321
|
+
id: "padded-break",
|
|
322
|
+
css: paddedBreakStyles
|
|
323
|
+
}, jsx(FormattedMessage, errorMessage ? messages.try_again : messages.or)), jsx(Button, {
|
|
324
|
+
onClick: this.onUploadButtonClick,
|
|
325
|
+
isDisabled: isLoading,
|
|
326
|
+
testId: "upload-button"
|
|
327
|
+
}, jsx(FormattedMessage, messages.upload_photo), jsx("input", {
|
|
328
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
329
|
+
css: fileInputStyles,
|
|
330
|
+
type: "file",
|
|
331
|
+
id: "image-input",
|
|
332
|
+
onChange: this.onFileChange,
|
|
333
|
+
accept: ACCEPT.join(',')
|
|
334
|
+
}))))
|
|
335
|
+
);
|
|
331
336
|
}
|
|
332
337
|
}, {
|
|
333
338
|
key: "renderImageCropper",
|
|
@@ -383,6 +388,8 @@ export var ImageNavigator = /*#__PURE__*/function (_Component) {
|
|
|
383
388
|
var isLoading = this.props.isLoading;
|
|
384
389
|
var dataURI = this.dataURI;
|
|
385
390
|
var content = dataURI && !isLoading ? this.renderImageCropper(dataURI) : this.renderImageUploader();
|
|
391
|
+
|
|
392
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
386
393
|
return jsx("div", {
|
|
387
394
|
css: containerStyles
|
|
388
395
|
}, content);
|
|
@@ -7,6 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
/** @jsx jsx */
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
11
|
import { jsx } from '@emotion/react';
|
|
11
12
|
import { Component } from 'react';
|
|
12
13
|
import FieldRange from '@atlaskit/range';
|
|
@@ -30,32 +31,35 @@ export var Slider = /*#__PURE__*/function (_Component) {
|
|
|
30
31
|
var _this$props = this.props,
|
|
31
32
|
value = _this$props.value,
|
|
32
33
|
onChange = _this$props.onChange;
|
|
33
|
-
return
|
|
34
|
-
css
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
34
|
+
return (
|
|
35
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
36
|
+
jsx("div", {
|
|
37
|
+
css: sliderWrapperStyles
|
|
38
|
+
}, jsx(Button
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
40
|
+
, {
|
|
41
|
+
className: "zoom_button zoom_button_small",
|
|
42
|
+
iconAfter: jsx(ScaleSmallIcon, {
|
|
43
|
+
label: "scale-small-icon"
|
|
44
|
+
}),
|
|
45
|
+
onClick: function onClick() {
|
|
46
|
+
return onChange(0);
|
|
47
|
+
}
|
|
48
|
+
}), jsx(FieldRange, {
|
|
49
|
+
value: value,
|
|
50
|
+
onChange: onChange
|
|
51
|
+
}), jsx(Button
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
53
|
+
, {
|
|
54
|
+
className: "zoom_button zoom_button_large",
|
|
55
|
+
iconAfter: jsx(ScaleLargeIcon, {
|
|
56
|
+
label: "scale-large-icon"
|
|
57
|
+
}),
|
|
58
|
+
onClick: function onClick() {
|
|
59
|
+
return onChange(100);
|
|
60
|
+
}
|
|
61
|
+
}))
|
|
62
|
+
);
|
|
59
63
|
}
|
|
60
64
|
}]);
|
|
61
65
|
return Slider;
|
|
@@ -1,38 +1,52 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
1
2
|
import { css, keyframes } from '@emotion/react';
|
|
2
3
|
import { N200 } from '@atlaskit/theme/colors';
|
|
3
4
|
import { checkeredBg } from './images';
|
|
4
5
|
import { AVATAR_DIALOG_WIDTH } from '../avatar-picker-dialog/layout-const';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
5
8
|
export var imageBgStyles = css({
|
|
6
9
|
position: 'absolute',
|
|
7
10
|
top: 0,
|
|
8
11
|
left: 0,
|
|
9
12
|
width: '256px',
|
|
10
13
|
height: '256px',
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
11
15
|
background: "url('".concat(checkeredBg, "')"),
|
|
12
16
|
borderRadius: "var(--ds-border-radius, 3px)"
|
|
13
17
|
});
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
14
20
|
export var containerStyles = css({
|
|
15
21
|
boxSizing: 'border-box',
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
16
23
|
'*, *::before, *::after': {
|
|
17
24
|
boxSizing: 'border-box'
|
|
18
25
|
},
|
|
19
26
|
position: 'relative'
|
|
20
27
|
});
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
21
30
|
export var sliderContainerStyles = css({
|
|
22
31
|
alignItems: 'center',
|
|
23
32
|
justifyContent: 'center',
|
|
24
33
|
display: 'flex',
|
|
25
34
|
flexDirection: 'row',
|
|
26
35
|
marginTop: "var(--ds-space-100, 8px)",
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
27
37
|
input: {
|
|
28
38
|
boxSizing: 'content-box',
|
|
29
39
|
padding: 0
|
|
30
40
|
},
|
|
31
41
|
backgroundColor: "var(--ds-surface-overlay, #fff)"
|
|
32
42
|
});
|
|
43
|
+
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
33
45
|
export var fileInputStyles = css({
|
|
34
46
|
display: 'none'
|
|
35
47
|
});
|
|
48
|
+
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
36
50
|
export var imageUploaderStyles = css({
|
|
37
51
|
display: 'flex',
|
|
38
52
|
flexDirection: 'column',
|
|
@@ -58,6 +72,7 @@ var getBorder = function getBorder(showBorder) {
|
|
|
58
72
|
var getDroppingAnimation = function getDroppingAnimation(isDroppingFile) {
|
|
59
73
|
return isDroppingFile ? css({
|
|
60
74
|
backgroundColor: "var(--ds-background-information-hovered, #ddecfe)",
|
|
75
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
61
76
|
'&:after': droppingAnimation
|
|
62
77
|
}) : '';
|
|
63
78
|
};
|
|
@@ -75,6 +90,7 @@ export var dragZoneStyles = function dragZoneStyles(props) {
|
|
|
75
90
|
transition: 'background-color 0.3s cubic-bezier(0.215, 0.61, 0.355, 1)',
|
|
76
91
|
'&::after': {
|
|
77
92
|
content: "''",
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
78
94
|
border: getBorder(props.showBorder),
|
|
79
95
|
borderRadius: '100%',
|
|
80
96
|
position: 'absolute',
|
|
@@ -84,9 +100,13 @@ export var dragZoneStyles = function dragZoneStyles(props) {
|
|
|
84
100
|
height: '100%',
|
|
85
101
|
transition: 'border-color 0.3s cubic-bezier(0.19, 1, 0.22, 1)'
|
|
86
102
|
}
|
|
87
|
-
},
|
|
103
|
+
},
|
|
104
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
105
|
+
getDroppingAnimation(props.isDroppingFile));
|
|
88
106
|
};
|
|
89
107
|
dragZoneStyles.displayName = 'DragZone';
|
|
108
|
+
|
|
109
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
90
110
|
export var dragZoneImageStyles = css({
|
|
91
111
|
width: '100px'
|
|
92
112
|
});
|
|
@@ -97,8 +117,12 @@ export var dragZoneTextStyles = function dragZoneTextStyles(props) {
|
|
|
97
117
|
return css({
|
|
98
118
|
textAlign: 'center',
|
|
99
119
|
color: "var(--ds-text-subtlest, ".concat(N200, ")")
|
|
100
|
-
},
|
|
120
|
+
},
|
|
121
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
122
|
+
getWidth(props.isFullSize));
|
|
101
123
|
};
|
|
124
|
+
|
|
125
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
102
126
|
export var selectionBlockerStyles = css({
|
|
103
127
|
position: 'fixed',
|
|
104
128
|
left: 0,
|
|
@@ -108,15 +132,21 @@ export var selectionBlockerStyles = css({
|
|
|
108
132
|
backgroundColor: 'transparent',
|
|
109
133
|
userSelect: 'none'
|
|
110
134
|
});
|
|
135
|
+
|
|
136
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
111
137
|
export var paddedBreakStyles = css({
|
|
138
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
112
139
|
marginTop: "var(--ds-space-100, 10px)".concat(" !important"),
|
|
113
140
|
marginBottom: "var(--ds-space-100, 10px)",
|
|
114
141
|
textAlign: 'center'
|
|
115
142
|
});
|
|
143
|
+
|
|
144
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
116
145
|
export var sliderWrapperStyles = css({
|
|
117
146
|
display: 'flex',
|
|
118
147
|
alignItems: 'center',
|
|
119
148
|
width: '100%',
|
|
149
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
120
150
|
'.zoom_button svg': {
|
|
121
151
|
position: 'relative',
|
|
122
152
|
left: "var(--ds-space-negative-025, -2px)"
|
|
@@ -2,10 +2,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["width", "height", "margin", "children"];
|
|
4
4
|
/**@jsx jsx */
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
6
|
import { jsx } from '@emotion/react';
|
|
6
7
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
8
|
import { checkeredBg } from './styles';
|
|
8
9
|
var containerWrapperStyles = xcss({
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
9
11
|
background: "url('".concat(checkeredBg, "')"),
|
|
10
12
|
position: "relative",
|
|
11
13
|
cursor: "move",
|
|
@@ -19,7 +21,9 @@ export var ContainerWrapper = function ContainerWrapper(_ref) {
|
|
|
19
21
|
children = _ref.children,
|
|
20
22
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
23
|
var containerWrapperDimensions = xcss({
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
22
25
|
width: "".concat(width !== undefined ? width + margin * 2 : 0, "px"),
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
23
27
|
height: "".concat(height !== undefined ? height + margin * 2 : 0, "px")
|
|
24
28
|
});
|
|
25
29
|
return jsx(Box, _extends({
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/**@jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
4
|
import { imagePlacerErrorWrapperStyles } from './styles';
|
|
4
5
|
export var ImagePlacerErrorWrapper = function ImagePlacerErrorWrapper(_ref) {
|
|
5
6
|
var children = _ref.children;
|
|
6
|
-
return
|
|
7
|
-
css
|
|
8
|
-
|
|
7
|
+
return (
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
9
|
+
jsx("div", {
|
|
10
|
+
css: imagePlacerErrorWrapperStyles
|
|
11
|
+
}, children)
|
|
12
|
+
);
|
|
9
13
|
};
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["x", "y", "width", "height"];
|
|
4
4
|
/**@jsx jsx */
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
6
|
import { jsx } from '@emotion/react';
|
|
6
7
|
import { imageWrapperStyles } from './styles';
|
|
7
8
|
export var ImageWrapper = function ImageWrapper(_ref) {
|
|
@@ -10,12 +11,15 @@ export var ImageWrapper = function ImageWrapper(_ref) {
|
|
|
10
11
|
width = _ref.width,
|
|
11
12
|
height = _ref.height,
|
|
12
13
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
-
return
|
|
14
|
-
css
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
return (
|
|
15
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
16
|
+
jsx("img", _extends({
|
|
17
|
+
css: imageWrapperStyles({
|
|
18
|
+
x: x,
|
|
19
|
+
y: y,
|
|
20
|
+
width: width,
|
|
21
|
+
height: height
|
|
22
|
+
})
|
|
23
|
+
}, props))
|
|
24
|
+
);
|
|
21
25
|
};
|
|
@@ -11,6 +11,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
13
|
/**@jsx jsx */
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
15
|
import { jsx } from '@emotion/react';
|
|
15
16
|
import React from 'react';
|
|
16
17
|
import { Rectangle, Vector2, Bounds, dataURItoFile, getFileInfo, getFileInfoFromSrc } from '@atlaskit/media-ui';
|
|
@@ -503,31 +504,34 @@ export var ImagePlacer = /*#__PURE__*/function (_React$Component) {
|
|
|
503
504
|
src = _this$state6.src;
|
|
504
505
|
var imageBounds = this.imageBounds;
|
|
505
506
|
var imgSrc = typeof src === 'string' ? src : undefined;
|
|
506
|
-
return
|
|
507
|
-
css
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
507
|
+
return (
|
|
508
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
509
|
+
jsx("div", {
|
|
510
|
+
css: imagePlacerWrapperStyles({
|
|
511
|
+
backgroundColor: backgroundColor
|
|
512
|
+
})
|
|
513
|
+
}, jsx(ImagePlacerContainer, {
|
|
514
|
+
width: containerWidth,
|
|
515
|
+
height: containerHeight,
|
|
516
|
+
margin: margin,
|
|
517
|
+
onDragStart: this.onDragStart,
|
|
518
|
+
onDragMove: this.onDragMove,
|
|
519
|
+
onWheel: this.onWheel
|
|
520
|
+
}, errorMessage ? jsx(ImagePlacerErrorWrapper, null, onRenderError ? onRenderError(errorMessage) : errorMessage) : jsx("div", null, jsx(ImagePlacerImage, {
|
|
521
|
+
src: imgSrc,
|
|
522
|
+
x: imageBounds.x,
|
|
523
|
+
y: imageBounds.y,
|
|
524
|
+
width: imageBounds.width,
|
|
525
|
+
height: imageBounds.height,
|
|
526
|
+
onLoad: this.onImageLoad,
|
|
527
|
+
onError: this.onImageError
|
|
528
|
+
}), jsx(Margin, {
|
|
529
|
+
width: containerWidth,
|
|
530
|
+
height: containerHeight,
|
|
531
|
+
circular: isCircular,
|
|
532
|
+
size: margin
|
|
533
|
+
}))))
|
|
534
|
+
);
|
|
531
535
|
}
|
|
532
536
|
}]);
|
|
533
537
|
return ImagePlacer;
|