@atlaskit/media-avatar-picker 24.3.18 → 24.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/avatar-picker-dialog/index.js +14 -10
- package/dist/es2019/avatar-picker-dialog/index.js +14 -11
- package/dist/esm/avatar-picker-dialog/index.js +15 -11
- package/dist/types/avatar-picker-dialog/index.d.ts +0 -1
- package/dist/types-ts4.5/avatar-picker-dialog/index.d.ts +0 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/media-avatar-picker
|
|
2
2
|
|
|
3
|
+
## 24.3.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#67778](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67778) [`70c7f71eb643`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/70c7f71eb643) - [ux] fix missing modal heading
|
|
8
|
+
|
|
9
|
+
## 24.3.19
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 24.3.18
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -47,6 +47,15 @@ var fixedCrop = exports.fixedCrop = {
|
|
|
47
47
|
y: 0,
|
|
48
48
|
size: _layoutConst.CONTAINER_INNER_SIZE
|
|
49
49
|
};
|
|
50
|
+
var HeaderContent = function HeaderContent(_ref) {
|
|
51
|
+
var title = _ref.title;
|
|
52
|
+
var modal = (0, _modalDialog.useModal)();
|
|
53
|
+
return (0, _react2.jsx)("h2", {
|
|
54
|
+
css: _styles.modalHeaderStyles,
|
|
55
|
+
"data-test-id": "modal-header",
|
|
56
|
+
id: modal.titleId
|
|
57
|
+
}, title || (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _mediaUi.messages.upload_an_avatar));
|
|
58
|
+
};
|
|
50
59
|
var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
51
60
|
(0, _inherits2.default)(AvatarPickerDialog, _PureComponent);
|
|
52
61
|
var _super = _createSuper(AvatarPickerDialog);
|
|
@@ -66,7 +75,7 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
66
75
|
isSubmitted: false
|
|
67
76
|
});
|
|
68
77
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setSelectedImageState", /*#__PURE__*/function () {
|
|
69
|
-
var
|
|
78
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(selectedImage) {
|
|
70
79
|
var dataURI;
|
|
71
80
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
72
81
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -94,7 +103,7 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
94
103
|
}, _callee, null, [[0, 8]]);
|
|
95
104
|
}));
|
|
96
105
|
return function (_x) {
|
|
97
|
-
return
|
|
106
|
+
return _ref2.apply(this, arguments);
|
|
98
107
|
};
|
|
99
108
|
}());
|
|
100
109
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setSelectedAvatarState", function (avatar) {
|
|
@@ -181,13 +190,6 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
181
190
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onImageError", function (errorMessage) {
|
|
182
191
|
_this.setErrorState(errorMessage);
|
|
183
192
|
});
|
|
184
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "headerContent", function () {
|
|
185
|
-
var title = _this.props.title;
|
|
186
|
-
return (0, _react2.jsx)("div", {
|
|
187
|
-
css: _styles.modalHeaderStyles,
|
|
188
|
-
"data-test-id": "modal-header"
|
|
189
|
-
}, title || (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _mediaUi.messages.upload_an_avatar));
|
|
190
|
-
});
|
|
191
193
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "footerContent", function () {
|
|
192
194
|
var _this$props2 = _this.props,
|
|
193
195
|
primaryButtonText = _this$props2.primaryButtonText,
|
|
@@ -214,7 +216,9 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
214
216
|
onClose: this.props.onCancel
|
|
215
217
|
}, this.props.avatars.length > 0 && (0, _react2.jsx)(_SRLiveTitle.SRLiveTitle, {
|
|
216
218
|
mode: this.state.mode
|
|
217
|
-
}),
|
|
219
|
+
}), (0, _react2.jsx)(HeaderContent, {
|
|
220
|
+
title: this.props.title
|
|
221
|
+
}), this.state.isSubmitted && (0, _react2.jsx)(_SubmitErrorDialog.SubmitErrorDialog, null), (0, _react2.jsx)("form", {
|
|
218
222
|
noValidate: true,
|
|
219
223
|
onSubmit: this.onSave,
|
|
220
224
|
css: _styles.formStyles
|
|
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import { PureComponent } from 'react';
|
|
6
|
-
import ModalDialog, { ModalFooter, ModalBody } from '@atlaskit/modal-dialog';
|
|
6
|
+
import ModalDialog, { ModalFooter, ModalBody, useModal } from '@atlaskit/modal-dialog';
|
|
7
7
|
import Button from '@atlaskit/button/standard-button';
|
|
8
8
|
import { FormattedMessage, IntlProvider, injectIntl } from 'react-intl-next';
|
|
9
9
|
import { fileToDataURI, dataURItoFile, messages } from '@atlaskit/media-ui';
|
|
@@ -30,6 +30,16 @@ export const fixedCrop = {
|
|
|
30
30
|
y: 0,
|
|
31
31
|
size: CONTAINER_INNER_SIZE
|
|
32
32
|
};
|
|
33
|
+
const HeaderContent = ({
|
|
34
|
+
title
|
|
35
|
+
}) => {
|
|
36
|
+
const modal = useModal();
|
|
37
|
+
return jsx("h2", {
|
|
38
|
+
css: modalHeaderStyles,
|
|
39
|
+
"data-test-id": "modal-header",
|
|
40
|
+
id: modal.titleId
|
|
41
|
+
}, title || jsx(FormattedMessage, messages.upload_an_avatar));
|
|
42
|
+
};
|
|
33
43
|
export class AvatarPickerDialog extends PureComponent {
|
|
34
44
|
constructor(...args) {
|
|
35
45
|
super(...args);
|
|
@@ -138,15 +148,6 @@ export class AvatarPickerDialog extends PureComponent {
|
|
|
138
148
|
_defineProperty(this, "onImageError", errorMessage => {
|
|
139
149
|
this.setErrorState(errorMessage);
|
|
140
150
|
});
|
|
141
|
-
_defineProperty(this, "headerContent", () => {
|
|
142
|
-
const {
|
|
143
|
-
title
|
|
144
|
-
} = this.props;
|
|
145
|
-
return jsx("div", {
|
|
146
|
-
css: modalHeaderStyles,
|
|
147
|
-
"data-test-id": "modal-header"
|
|
148
|
-
}, title || jsx(FormattedMessage, messages.upload_an_avatar));
|
|
149
|
-
});
|
|
150
151
|
_defineProperty(this, "footerContent", () => {
|
|
151
152
|
const {
|
|
152
153
|
primaryButtonText,
|
|
@@ -171,7 +172,9 @@ export class AvatarPickerDialog extends PureComponent {
|
|
|
171
172
|
onClose: this.props.onCancel
|
|
172
173
|
}, this.props.avatars.length > 0 && jsx(SRLiveTitle, {
|
|
173
174
|
mode: this.state.mode
|
|
174
|
-
}),
|
|
175
|
+
}), jsx(HeaderContent, {
|
|
176
|
+
title: this.props.title
|
|
177
|
+
}), this.state.isSubmitted && jsx(SubmitErrorDialog, null), jsx("form", {
|
|
175
178
|
noValidate: true,
|
|
176
179
|
onSubmit: this.onSave,
|
|
177
180
|
css: formStyles
|
|
@@ -13,7 +13,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { jsx } from '@emotion/react';
|
|
15
15
|
import { PureComponent } from 'react';
|
|
16
|
-
import ModalDialog, { ModalFooter, ModalBody } from '@atlaskit/modal-dialog';
|
|
16
|
+
import ModalDialog, { ModalFooter, ModalBody, useModal } from '@atlaskit/modal-dialog';
|
|
17
17
|
import Button from '@atlaskit/button/standard-button';
|
|
18
18
|
import { FormattedMessage, IntlProvider, injectIntl } from 'react-intl-next';
|
|
19
19
|
import { fileToDataURI, dataURItoFile, messages } from '@atlaskit/media-ui';
|
|
@@ -40,6 +40,15 @@ export var fixedCrop = {
|
|
|
40
40
|
y: 0,
|
|
41
41
|
size: CONTAINER_INNER_SIZE
|
|
42
42
|
};
|
|
43
|
+
var HeaderContent = function HeaderContent(_ref) {
|
|
44
|
+
var title = _ref.title;
|
|
45
|
+
var modal = useModal();
|
|
46
|
+
return jsx("h2", {
|
|
47
|
+
css: modalHeaderStyles,
|
|
48
|
+
"data-test-id": "modal-header",
|
|
49
|
+
id: modal.titleId
|
|
50
|
+
}, title || jsx(FormattedMessage, messages.upload_an_avatar));
|
|
51
|
+
};
|
|
43
52
|
export var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
44
53
|
_inherits(AvatarPickerDialog, _PureComponent);
|
|
45
54
|
var _super = _createSuper(AvatarPickerDialog);
|
|
@@ -59,7 +68,7 @@ export var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
59
68
|
isSubmitted: false
|
|
60
69
|
});
|
|
61
70
|
_defineProperty(_assertThisInitialized(_this), "setSelectedImageState", /*#__PURE__*/function () {
|
|
62
|
-
var
|
|
71
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selectedImage) {
|
|
63
72
|
var dataURI;
|
|
64
73
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
65
74
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -87,7 +96,7 @@ export var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
87
96
|
}, _callee, null, [[0, 8]]);
|
|
88
97
|
}));
|
|
89
98
|
return function (_x) {
|
|
90
|
-
return
|
|
99
|
+
return _ref2.apply(this, arguments);
|
|
91
100
|
};
|
|
92
101
|
}());
|
|
93
102
|
_defineProperty(_assertThisInitialized(_this), "setSelectedAvatarState", function (avatar) {
|
|
@@ -174,13 +183,6 @@ export var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
174
183
|
_defineProperty(_assertThisInitialized(_this), "onImageError", function (errorMessage) {
|
|
175
184
|
_this.setErrorState(errorMessage);
|
|
176
185
|
});
|
|
177
|
-
_defineProperty(_assertThisInitialized(_this), "headerContent", function () {
|
|
178
|
-
var title = _this.props.title;
|
|
179
|
-
return jsx("div", {
|
|
180
|
-
css: modalHeaderStyles,
|
|
181
|
-
"data-test-id": "modal-header"
|
|
182
|
-
}, title || jsx(FormattedMessage, messages.upload_an_avatar));
|
|
183
|
-
});
|
|
184
186
|
_defineProperty(_assertThisInitialized(_this), "footerContent", function () {
|
|
185
187
|
var _this$props2 = _this.props,
|
|
186
188
|
primaryButtonText = _this$props2.primaryButtonText,
|
|
@@ -207,7 +209,9 @@ export var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
207
209
|
onClose: this.props.onCancel
|
|
208
210
|
}, this.props.avatars.length > 0 && jsx(SRLiveTitle, {
|
|
209
211
|
mode: this.state.mode
|
|
210
|
-
}),
|
|
212
|
+
}), jsx(HeaderContent, {
|
|
213
|
+
title: this.props.title
|
|
214
|
+
}), this.state.isSubmitted && jsx(SubmitErrorDialog, null), jsx("form", {
|
|
211
215
|
noValidate: true,
|
|
212
216
|
onSubmit: this.onSave,
|
|
213
217
|
css: formStyles
|
|
@@ -38,7 +38,6 @@ export declare class AvatarPickerDialog extends PureComponent<AvatarPickerDialog
|
|
|
38
38
|
onImageUploaded: () => void;
|
|
39
39
|
onImageError: (errorMessage: string) => void;
|
|
40
40
|
render(): jsx.JSX.Element;
|
|
41
|
-
headerContent: () => jsx.JSX.Element;
|
|
42
41
|
footerContent: () => jsx.JSX.Element;
|
|
43
42
|
getPredefinedAvatars(): Avatar[];
|
|
44
43
|
renderPredefinedAvatarList(): jsx.JSX.Element | null;
|
|
@@ -38,7 +38,6 @@ export declare class AvatarPickerDialog extends PureComponent<AvatarPickerDialog
|
|
|
38
38
|
onImageUploaded: () => void;
|
|
39
39
|
onImageError: (errorMessage: string) => void;
|
|
40
40
|
render(): jsx.JSX.Element;
|
|
41
|
-
headerContent: () => jsx.JSX.Element;
|
|
42
41
|
footerContent: () => jsx.JSX.Element;
|
|
43
42
|
getPredefinedAvatars(): Avatar[];
|
|
44
43
|
renderPredefinedAvatarList(): jsx.JSX.Element | null;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-avatar-picker",
|
|
3
|
-
"version": "24.3.
|
|
3
|
+
"version": "24.3.20",
|
|
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/"
|
|
7
7
|
},
|
|
8
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
9
|
"author": "Atlassian Pty Ltd",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "dist/cjs/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@atlaskit/button": "^
|
|
37
|
+
"@atlaskit/button": "^17.2.0",
|
|
38
38
|
"@atlaskit/flag": "^15.2.0",
|
|
39
39
|
"@atlaskit/icon": "^22.0.0",
|
|
40
40
|
"@atlaskit/media-ui": "^25.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/range": "^7.1.0",
|
|
43
43
|
"@atlaskit/spinner": "^16.0.0",
|
|
44
44
|
"@atlaskit/theme": "^12.6.0",
|
|
45
|
-
"@atlaskit/tokens": "^1.
|
|
45
|
+
"@atlaskit/tokens": "^1.33.0",
|
|
46
46
|
"@atlaskit/visually-hidden": "^1.2.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"exenv": "^1.2.2"
|