@atlaskit/media-avatar-picker 26.2.2 → 26.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/avatar-picker-dialog/index.js +7 -1
- package/dist/cjs/predefined-avatar-view/index.js +3 -2
- package/dist/es2019/avatar-picker-dialog/index.js +7 -1
- package/dist/es2019/predefined-avatar-view/index.js +5 -4
- package/dist/esm/avatar-picker-dialog/index.js +7 -1
- package/dist/esm/predefined-avatar-view/index.js +4 -3
- package/dist/types/avatar-picker-dialog/index.d.ts +1 -0
- package/dist/types/predefined-avatar-view/index.d.ts +1 -1
- package/dist/types-ts4.5/avatar-picker-dialog/index.d.ts +1 -0
- package/dist/types-ts4.5/predefined-avatar-view/index.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/media-avatar-picker
|
|
2
2
|
|
|
3
|
+
## 26.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`68012a7424ed5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/68012a7424ed5) -
|
|
8
|
+
Bring the focus to the Go Back icon when coming to Predefined Avatars List view
|
|
9
|
+
|
|
10
|
+
## 26.2.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 26.2.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -70,6 +70,7 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
70
70
|
}
|
|
71
71
|
_this = _callSuper(this, AvatarPickerDialog, [].concat(args));
|
|
72
72
|
(0, _defineProperty2.default)(_this, "moreRef", /*#__PURE__*/(0, _react.createRef)());
|
|
73
|
+
(0, _defineProperty2.default)(_this, "goBackRef", /*#__PURE__*/(0, _react.createRef)());
|
|
73
74
|
(0, _defineProperty2.default)(_this, "state", {
|
|
74
75
|
mode: _types.Mode.Cropping,
|
|
75
76
|
selectedAvatar: _this.props.defaultSelectedAvatar,
|
|
@@ -179,6 +180,10 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
179
180
|
mode: _types.Mode.PredefinedAvatars,
|
|
180
181
|
isSubmitted: false
|
|
181
182
|
});
|
|
183
|
+
requestAnimationFrame(function () {
|
|
184
|
+
var _this$goBackRef$curre;
|
|
185
|
+
(_this$goBackRef$curre = _this.goBackRef.current) === null || _this$goBackRef$curre === void 0 || _this$goBackRef$curre.focus();
|
|
186
|
+
});
|
|
182
187
|
});
|
|
183
188
|
(0, _defineProperty2.default)(_this, "onGoBack", function () {
|
|
184
189
|
_this.clearErrorState();
|
|
@@ -405,7 +410,8 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
405
410
|
onAvatarSelected: this.setSelectedAvatarState,
|
|
406
411
|
onGoBack: this.onGoBack,
|
|
407
412
|
selectedAvatar: selectedAvatar,
|
|
408
|
-
predefinedAvatarsText: predefinedAvatarsText
|
|
413
|
+
predefinedAvatarsText: predefinedAvatarsText,
|
|
414
|
+
ref: this.goBackRef
|
|
409
415
|
}), requireAltText && this.renderAltTextField());
|
|
410
416
|
}
|
|
411
417
|
}
|
|
@@ -30,7 +30,7 @@ var labelStyles = null;
|
|
|
30
30
|
var headerStyles = null;
|
|
31
31
|
var descriptionStyles = null;
|
|
32
32
|
var backButtonStyles = null;
|
|
33
|
-
var PredefinedAvatarView = exports.PredefinedAvatarView = function
|
|
33
|
+
var PredefinedAvatarView = exports.PredefinedAvatarView = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, goBackRef) {
|
|
34
34
|
var _ref$avatars = _ref.avatars,
|
|
35
35
|
avatars = _ref$avatars === void 0 ? [] : _ref$avatars,
|
|
36
36
|
onAvatarSelected = _ref.onAvatarSelected,
|
|
@@ -92,6 +92,7 @@ var PredefinedAvatarView = exports.PredefinedAvatarView = function PredefinedAva
|
|
|
92
92
|
label: ""
|
|
93
93
|
}),
|
|
94
94
|
onClick: onGoBack,
|
|
95
|
+
ref: goBackRef,
|
|
95
96
|
className: (0, _runtime.ax)(["_2rko1q77 _19pkidpf _2hwxidpf _otyridpf _18u0idpf _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bsbzwfg _4t3izwfg _4cvr1h6o _1bah1h6o"])
|
|
96
97
|
}), /*#__PURE__*/React.createElement("h2", {
|
|
97
98
|
className: (0, _runtime.ax)(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _11c82smr _19bvu2gc"])
|
|
@@ -100,4 +101,4 @@ var PredefinedAvatarView = exports.PredefinedAvatarView = function PredefinedAva
|
|
|
100
101
|
"aria-label": selectAvatarLabel || intl.formatMessage(_mediaUi.messages.select_an_avatar),
|
|
101
102
|
className: (0, _runtime.ax)(["_2lx2vrvc _1n261g80 _19pkidpf _2hwxidpf _otyridpf _18u0idpf _1e0c1txw _1bsb1665 _c71lgrxc _18m91wug _ca0qu2gc _u5f3idpf _n3tdidpf _19bvidpf"])
|
|
102
103
|
}, cards));
|
|
103
|
-
};
|
|
104
|
+
});
|
|
@@ -49,6 +49,7 @@ export class AvatarPickerDialog extends PureComponent {
|
|
|
49
49
|
constructor(...args) {
|
|
50
50
|
super(...args);
|
|
51
51
|
_defineProperty(this, "moreRef", /*#__PURE__*/createRef());
|
|
52
|
+
_defineProperty(this, "goBackRef", /*#__PURE__*/createRef());
|
|
52
53
|
_defineProperty(this, "state", {
|
|
53
54
|
mode: Mode.Cropping,
|
|
54
55
|
selectedAvatar: this.props.defaultSelectedAvatar,
|
|
@@ -141,6 +142,10 @@ export class AvatarPickerDialog extends PureComponent {
|
|
|
141
142
|
mode: Mode.PredefinedAvatars,
|
|
142
143
|
isSubmitted: false
|
|
143
144
|
});
|
|
145
|
+
requestAnimationFrame(() => {
|
|
146
|
+
var _this$goBackRef$curre;
|
|
147
|
+
(_this$goBackRef$curre = this.goBackRef.current) === null || _this$goBackRef$curre === void 0 ? void 0 : _this$goBackRef$curre.focus();
|
|
148
|
+
});
|
|
144
149
|
});
|
|
145
150
|
_defineProperty(this, "onGoBack", () => {
|
|
146
151
|
this.clearErrorState();
|
|
@@ -361,7 +366,8 @@ export class AvatarPickerDialog extends PureComponent {
|
|
|
361
366
|
onAvatarSelected: this.setSelectedAvatarState,
|
|
362
367
|
onGoBack: this.onGoBack,
|
|
363
368
|
selectedAvatar: selectedAvatar,
|
|
364
|
-
predefinedAvatarsText: predefinedAvatarsText
|
|
369
|
+
predefinedAvatarsText: predefinedAvatarsText,
|
|
370
|
+
ref: this.goBackRef
|
|
365
371
|
}), requireAltText && this.renderAltTextField());
|
|
366
372
|
}
|
|
367
373
|
}
|
|
@@ -7,7 +7,7 @@ import { messages } from '@atlaskit/media-ui';
|
|
|
7
7
|
import ArrowLeftIcon from '@atlaskit/icon/core/migration/arrow-left';
|
|
8
8
|
import Button from '@atlaskit/button/standard-button';
|
|
9
9
|
import { B200, B100 } from '@atlaskit/theme/colors';
|
|
10
|
-
import { useState } from 'react';
|
|
10
|
+
import { forwardRef, useState } from 'react';
|
|
11
11
|
const largeAvatarImageStyles = null;
|
|
12
12
|
const largeAvatarImageCheckedStyles = null;
|
|
13
13
|
const largeAvatarImageFocusedStyles = null;
|
|
@@ -17,14 +17,14 @@ const labelStyles = null;
|
|
|
17
17
|
const headerStyles = null;
|
|
18
18
|
const descriptionStyles = null;
|
|
19
19
|
const backButtonStyles = null;
|
|
20
|
-
export const PredefinedAvatarView = ({
|
|
20
|
+
export const PredefinedAvatarView = /*#__PURE__*/forwardRef(({
|
|
21
21
|
avatars = [],
|
|
22
22
|
onAvatarSelected,
|
|
23
23
|
selectedAvatar,
|
|
24
24
|
onGoBack,
|
|
25
25
|
predefinedAvatarsText,
|
|
26
26
|
selectAvatarLabel
|
|
27
|
-
}) => {
|
|
27
|
+
}, goBackRef) => {
|
|
28
28
|
const intl = useIntl();
|
|
29
29
|
const [isFocused, setIsFocused] = useState(Object.fromEntries(avatars.map(avatar => [avatar.dataURI, false])));
|
|
30
30
|
const createOnItemClickHandler = avatar => {
|
|
@@ -72,6 +72,7 @@ export const PredefinedAvatarView = ({
|
|
|
72
72
|
label: ""
|
|
73
73
|
}),
|
|
74
74
|
onClick: onGoBack,
|
|
75
|
+
ref: goBackRef,
|
|
75
76
|
className: ax(["_2rko1q77 _19pkidpf _2hwxidpf _otyridpf _18u0idpf _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bsbzwfg _4t3izwfg _4cvr1h6o _1bah1h6o"])
|
|
76
77
|
}), /*#__PURE__*/React.createElement("h2", {
|
|
77
78
|
className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _11c82smr _19bvu2gc"])
|
|
@@ -80,4 +81,4 @@ export const PredefinedAvatarView = ({
|
|
|
80
81
|
"aria-label": selectAvatarLabel || intl.formatMessage(messages.select_an_avatar),
|
|
81
82
|
className: ax(["_2lx2vrvc _1n261g80 _19pkidpf _2hwxidpf _otyridpf _18u0idpf _1e0c1txw _1bsb1665 _c71lgrxc _18m91wug _ca0qu2gc _u5f3idpf _n3tdidpf _19bvidpf"])
|
|
82
83
|
}, cards));
|
|
83
|
-
};
|
|
84
|
+
});
|
|
@@ -63,6 +63,7 @@ export var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
63
63
|
}
|
|
64
64
|
_this = _callSuper(this, AvatarPickerDialog, [].concat(args));
|
|
65
65
|
_defineProperty(_this, "moreRef", /*#__PURE__*/createRef());
|
|
66
|
+
_defineProperty(_this, "goBackRef", /*#__PURE__*/createRef());
|
|
66
67
|
_defineProperty(_this, "state", {
|
|
67
68
|
mode: Mode.Cropping,
|
|
68
69
|
selectedAvatar: _this.props.defaultSelectedAvatar,
|
|
@@ -172,6 +173,10 @@ export var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
172
173
|
mode: Mode.PredefinedAvatars,
|
|
173
174
|
isSubmitted: false
|
|
174
175
|
});
|
|
176
|
+
requestAnimationFrame(function () {
|
|
177
|
+
var _this$goBackRef$curre;
|
|
178
|
+
(_this$goBackRef$curre = _this.goBackRef.current) === null || _this$goBackRef$curre === void 0 || _this$goBackRef$curre.focus();
|
|
179
|
+
});
|
|
175
180
|
});
|
|
176
181
|
_defineProperty(_this, "onGoBack", function () {
|
|
177
182
|
_this.clearErrorState();
|
|
@@ -398,7 +403,8 @@ export var AvatarPickerDialog = /*#__PURE__*/function (_PureComponent) {
|
|
|
398
403
|
onAvatarSelected: this.setSelectedAvatarState,
|
|
399
404
|
onGoBack: this.onGoBack,
|
|
400
405
|
selectedAvatar: selectedAvatar,
|
|
401
|
-
predefinedAvatarsText: predefinedAvatarsText
|
|
406
|
+
predefinedAvatarsText: predefinedAvatarsText,
|
|
407
|
+
ref: this.goBackRef
|
|
402
408
|
}), requireAltText && this.renderAltTextField());
|
|
403
409
|
}
|
|
404
410
|
}
|
|
@@ -11,7 +11,7 @@ import { messages } from '@atlaskit/media-ui';
|
|
|
11
11
|
import ArrowLeftIcon from '@atlaskit/icon/core/migration/arrow-left';
|
|
12
12
|
import Button from '@atlaskit/button/standard-button';
|
|
13
13
|
import { B200, B100 } from '@atlaskit/theme/colors';
|
|
14
|
-
import { useState } from 'react';
|
|
14
|
+
import { forwardRef, useState } from 'react';
|
|
15
15
|
var largeAvatarImageStyles = null;
|
|
16
16
|
var largeAvatarImageCheckedStyles = null;
|
|
17
17
|
var largeAvatarImageFocusedStyles = null;
|
|
@@ -21,7 +21,7 @@ var labelStyles = null;
|
|
|
21
21
|
var headerStyles = null;
|
|
22
22
|
var descriptionStyles = null;
|
|
23
23
|
var backButtonStyles = null;
|
|
24
|
-
export var PredefinedAvatarView = function
|
|
24
|
+
export var PredefinedAvatarView = /*#__PURE__*/forwardRef(function (_ref, goBackRef) {
|
|
25
25
|
var _ref$avatars = _ref.avatars,
|
|
26
26
|
avatars = _ref$avatars === void 0 ? [] : _ref$avatars,
|
|
27
27
|
onAvatarSelected = _ref.onAvatarSelected,
|
|
@@ -83,6 +83,7 @@ export var PredefinedAvatarView = function PredefinedAvatarView(_ref) {
|
|
|
83
83
|
label: ""
|
|
84
84
|
}),
|
|
85
85
|
onClick: onGoBack,
|
|
86
|
+
ref: goBackRef,
|
|
86
87
|
className: ax(["_2rko1q77 _19pkidpf _2hwxidpf _otyridpf _18u0idpf _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bsbzwfg _4t3izwfg _4cvr1h6o _1bah1h6o"])
|
|
87
88
|
}), /*#__PURE__*/React.createElement("h2", {
|
|
88
89
|
className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _11c82smr _19bvu2gc"])
|
|
@@ -91,4 +92,4 @@ export var PredefinedAvatarView = function PredefinedAvatarView(_ref) {
|
|
|
91
92
|
"aria-label": selectAvatarLabel || intl.formatMessage(messages.select_an_avatar),
|
|
92
93
|
className: ax(["_2lx2vrvc _1n261g80 _19pkidpf _2hwxidpf _otyridpf _18u0idpf _1e0c1txw _1bsb1665 _c71lgrxc _18m91wug _ca0qu2gc _u5f3idpf _n3tdidpf _19bvidpf"])
|
|
93
94
|
}, cards));
|
|
94
|
-
};
|
|
95
|
+
});
|
|
@@ -23,6 +23,7 @@ export declare class AvatarPickerDialog extends PureComponent<AvatarPickerDialog
|
|
|
23
23
|
avatars: never[];
|
|
24
24
|
};
|
|
25
25
|
moreRef: React.RefObject<HTMLButtonElement>;
|
|
26
|
+
goBackRef: React.RefObject<HTMLButtonElement>;
|
|
26
27
|
state: AvatarPickerDialogState;
|
|
27
28
|
setSelectedImageState: (selectedImage: File) => Promise<void>;
|
|
28
29
|
setSelectedAvatarState: (avatar: Avatar) => void;
|
|
@@ -7,4 +7,4 @@ export interface PredefinedAvatarViewProps {
|
|
|
7
7
|
predefinedAvatarsText?: string;
|
|
8
8
|
selectAvatarLabel?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const PredefinedAvatarView: (
|
|
10
|
+
export declare const PredefinedAvatarView: import("react").ForwardRefExoticComponent<PredefinedAvatarViewProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -23,6 +23,7 @@ export declare class AvatarPickerDialog extends PureComponent<AvatarPickerDialog
|
|
|
23
23
|
avatars: never[];
|
|
24
24
|
};
|
|
25
25
|
moreRef: React.RefObject<HTMLButtonElement>;
|
|
26
|
+
goBackRef: React.RefObject<HTMLButtonElement>;
|
|
26
27
|
state: AvatarPickerDialogState;
|
|
27
28
|
setSelectedImageState: (selectedImage: File) => Promise<void>;
|
|
28
29
|
setSelectedAvatarState: (avatar: Avatar) => void;
|
|
@@ -7,4 +7,4 @@ export interface PredefinedAvatarViewProps {
|
|
|
7
7
|
predefinedAvatarsText?: string;
|
|
8
8
|
selectAvatarLabel?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const PredefinedAvatarView: (
|
|
10
|
+
export declare const PredefinedAvatarView: import("react").ForwardRefExoticComponent<PredefinedAvatarViewProps & import("react").RefAttributes<HTMLButtonElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-avatar-picker",
|
|
3
|
-
"version": "26.2.
|
|
3
|
+
"version": "26.2.4",
|
|
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/"
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@atlaskit/button": "^23.4.0",
|
|
38
38
|
"@atlaskit/css": "^0.12.0",
|
|
39
39
|
"@atlaskit/flag": "^17.3.0",
|
|
40
|
-
"@atlaskit/form": "^12.
|
|
41
|
-
"@atlaskit/icon": "^
|
|
40
|
+
"@atlaskit/form": "^12.2.0",
|
|
41
|
+
"@atlaskit/icon": "^28.0.0",
|
|
42
42
|
"@atlaskit/media-ui": "^28.6.0",
|
|
43
43
|
"@atlaskit/modal-dialog": "^14.3.0",
|
|
44
44
|
"@atlaskit/primitives": "^14.11.0",
|