@atlaskit/emoji 73.4.7 → 73.4.9
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 +16 -0
- package/dist/cjs/components/common/EmojiActions.js +24 -3
- package/dist/cjs/components/picker/CategorySelector.compiled.css +6 -2
- package/dist/cjs/components/picker/CategorySelector.js +3 -1
- package/dist/cjs/util/analytics/createEvent.js +1 -1
- package/dist/es2019/components/common/EmojiActions.js +24 -3
- package/dist/es2019/components/picker/CategorySelector.compiled.css +6 -2
- package/dist/es2019/components/picker/CategorySelector.js +3 -1
- package/dist/es2019/util/analytics/createEvent.js +1 -1
- package/dist/esm/components/common/EmojiActions.js +24 -3
- package/dist/esm/components/picker/CategorySelector.compiled.css +6 -2
- package/dist/esm/components/picker/CategorySelector.js +3 -1
- package/dist/esm/util/analytics/createEvent.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/emoji
|
|
2
2
|
|
|
3
|
+
## 73.4.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d9151fc03c40e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d9151fc03c40e) -
|
|
8
|
+
Inset the emoji category focus outline so it stays clear of the picker edge.
|
|
9
|
+
|
|
10
|
+
## 73.4.8
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`0194650c85835`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0194650c85835) -
|
|
15
|
+
Closes the productivity colour selector on Escape and restores focus to its trigger behind the
|
|
16
|
+
`platform_emoji_color_picker_escape_focus` feature gate.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 73.4.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -42,6 +42,7 @@ var ProductivityColorPopupContent = function ProductivityColorPopupContent(_ref)
|
|
|
42
42
|
var colorPreviewEmojis = _ref.colorPreviewEmojis,
|
|
43
43
|
focusSelectedColorOnMount = _ref.focusSelectedColorOnMount,
|
|
44
44
|
onColorSelected = _ref.onColorSelected,
|
|
45
|
+
onEscape = _ref.onEscape,
|
|
45
46
|
selectedColor = _ref.selectedColor;
|
|
46
47
|
var popupRef = (0, _react.useRef)(null);
|
|
47
48
|
(0, _react.useEffect)(function () {
|
|
@@ -64,12 +65,20 @@ var ProductivityColorPopupContent = function ProductivityColorPopupContent(_ref)
|
|
|
64
65
|
}
|
|
65
66
|
event.stopPropagation();
|
|
66
67
|
};
|
|
68
|
+
var handleEscape = function handleEscape(event) {
|
|
69
|
+
if ((0, _fg.fg)('platform_emoji_color_picker_escape_focus') && (event.key === 'Escape' || event.key === 'Esc')) {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
onEscape();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
67
75
|
window.addEventListener('pointerdown', stopNonInputDismissalBeforeDocument, true);
|
|
68
76
|
window.addEventListener('mousedown', stopNonInputDismissalBeforeDocument, true);
|
|
69
77
|
window.addEventListener('click', stopNonInputDismissalBeforeDocument, true);
|
|
70
78
|
popupElement.addEventListener('pointerdown', stopNonInputDismissal);
|
|
71
79
|
popupElement.addEventListener('mousedown', stopNonInputDismissal);
|
|
72
80
|
popupElement.addEventListener('click', stopNonInputDismissal);
|
|
81
|
+
popupElement.addEventListener('keydown', handleEscape);
|
|
73
82
|
return function () {
|
|
74
83
|
window.removeEventListener('pointerdown', stopNonInputDismissalBeforeDocument, true);
|
|
75
84
|
window.removeEventListener('mousedown', stopNonInputDismissalBeforeDocument, true);
|
|
@@ -77,8 +86,9 @@ var ProductivityColorPopupContent = function ProductivityColorPopupContent(_ref)
|
|
|
77
86
|
popupElement.removeEventListener('pointerdown', stopNonInputDismissal);
|
|
78
87
|
popupElement.removeEventListener('mousedown', stopNonInputDismissal);
|
|
79
88
|
popupElement.removeEventListener('click', stopNonInputDismissal);
|
|
89
|
+
popupElement.removeEventListener('keydown', handleEscape);
|
|
80
90
|
};
|
|
81
|
-
}, []);
|
|
91
|
+
}, [onEscape]);
|
|
82
92
|
return /*#__PURE__*/React.createElement("div", {
|
|
83
93
|
ref: popupRef,
|
|
84
94
|
className: (0, _runtime.ax)(["_19itia51 _2rkofajl _bfhk1bhr _16qs130s _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7"])
|
|
@@ -140,6 +150,10 @@ var TonesWrapper = function TonesWrapper(props) {
|
|
|
140
150
|
onToneClose();
|
|
141
151
|
setFocusSelectedProductivityColorOnMount(false);
|
|
142
152
|
}, [onProductivityColorSelected, onToneClose]);
|
|
153
|
+
var onProductivityColorEscape = (0, _react.useCallback)(function () {
|
|
154
|
+
onToneClose();
|
|
155
|
+
setFocusTonePreviewButton(true);
|
|
156
|
+
}, [onToneClose]);
|
|
143
157
|
var onProductivityColorToggle = (0, _react.useCallback)(function (event) {
|
|
144
158
|
var isKeyboardClick = (event === null || event === void 0 ? void 0 : event.detail) === 0;
|
|
145
159
|
setFocusSelectedProductivityColorOnMount(!showToneSelector && (openProductivityColorSelectorWithKeyboard.current || isKeyboardClick));
|
|
@@ -147,10 +161,16 @@ var TonesWrapper = function TonesWrapper(props) {
|
|
|
147
161
|
onToneToggle();
|
|
148
162
|
}, [onToneToggle, showToneSelector]);
|
|
149
163
|
var onProductivityColorPreviewKeyDown = (0, _react.useCallback)(function (event) {
|
|
164
|
+
if (showToneSelector && (0, _fg.fg)('platform_emoji_color_picker_escape_focus') && (event.key === 'Escape' || event.key === 'Esc')) {
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
event.stopPropagation();
|
|
167
|
+
onProductivityColorEscape();
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
150
170
|
if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {
|
|
151
171
|
openProductivityColorSelectorWithKeyboard.current = true;
|
|
152
172
|
}
|
|
153
|
-
}, []);
|
|
173
|
+
}, [onProductivityColorEscape, showToneSelector]);
|
|
154
174
|
var shouldShowProductivityColorSelector = !!(activeCategoryId === 'ATLASSIAN' && activeAtlassianSubcategory && atlassianSubcategoriesWithProductivityColorSelector.includes(activeAtlassianSubcategory) && productivityColorPreviewEmojis && selectedProductivityColor && onProductivityColorSelected);
|
|
155
175
|
if (shouldShowProductivityColorSelector) {
|
|
156
176
|
var previewEmoji = (productivityColorPreviewEmojis === null || productivityColorPreviewEmojis === void 0 ? void 0 : productivityColorPreviewEmojis[selectedProductivityColor]) || Object.values(productivityColorPreviewEmojis || {})[0];
|
|
@@ -176,7 +196,8 @@ var TonesWrapper = function TonesWrapper(props) {
|
|
|
176
196
|
colorPreviewEmojis: productivityColorPreviewEmojis,
|
|
177
197
|
focusSelectedColorOnMount: focusSelectedProductivityColorOnMount,
|
|
178
198
|
selectedColor: selectedProductivityColor,
|
|
179
|
-
onColorSelected: onProductivityColorSelectedHandler
|
|
199
|
+
onColorSelected: onProductivityColorSelectedHandler,
|
|
200
|
+
onEscape: onProductivityColorEscape
|
|
180
201
|
}))));
|
|
181
202
|
}
|
|
182
203
|
if (!toneEmoji) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
._v564h5h4{transition:color .2s ease}
|
|
2
|
-
._189eidpf{border-width:0}
|
|
2
|
+
._189eidpf{border-width:0}
|
|
3
|
+
._13li1mok{border-top-left-radius:var(--ds-radius-large,8px)}
|
|
3
4
|
._16jlidpf{flex-grow:0}
|
|
4
5
|
._19bv12x7{padding-left:var(--ds-space-075,6px)}
|
|
5
6
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
@@ -28,7 +29,10 @@
|
|
|
28
29
|
._syaz1rpy{color:var(--ds-text-subtlest,#6b6e76)}
|
|
29
30
|
._syaz6x5g{color:var(--ds-text-selected,#1868db)}
|
|
30
31
|
._u5f312x7{padding-right:var(--ds-space-075,6px)}
|
|
31
|
-
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
32
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
|
|
33
|
+
._1ah31i6y:focus-visible{outline-offset:var(--ds-space-negative-025,-2px)}
|
|
34
|
+
._mizu1v1w:focus-visible{outline-color:var(--ds-border-focused,#4688ec)}
|
|
35
|
+
._ra3xnqa1:focus-visible{outline-style:solid}
|
|
32
36
|
._1jc41ihb:hover{border-bottom-color:var(--ds-border-bold,#7d818a)}
|
|
33
37
|
._1jc4a755:hover{border-bottom-color:var(--ds-border-brand,#1868db)}
|
|
34
38
|
._30l31rpy:hover{color:var(--ds-text-subtlest,#6b6e76)}
|
|
@@ -14,6 +14,7 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
15
|
var _reactIntl = require("react-intl");
|
|
16
16
|
var _css = require("@atlaskit/css");
|
|
17
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
17
18
|
var _pressable = require("@atlaskit/primitives/compiled/pressable");
|
|
18
19
|
var _Tooltip = _interopRequireDefault(require("@atlaskit/tooltip/Tooltip"));
|
|
19
20
|
var _usePrevious = require("../../hooks/usePrevious");
|
|
@@ -28,6 +29,7 @@ var styles = {
|
|
|
28
29
|
commonCategoryNew: "_v564h5h4 _189eidpf _bfhksm61 _ca0qu2gc _n3tdu2gc _19bv12x7 _u5f312x7 _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
29
30
|
defaultCategoryNew: "_syaz1rpy _1doc1dm9 _1il9nqa1 _1o3i1j28 _30l31rpy _1jc41ihb",
|
|
30
31
|
activeCategoryNew: "_syaz6x5g _1doc1dm9 _1il9nqa1 _1o3ia755 _30l36x5g _1jc4a755",
|
|
32
|
+
focusedCategoryNew: "_mizu1v1w _ra3xnqa1 _128mdkaa _1ah31i6y",
|
|
31
33
|
disabledCategory: "_syaz1rpy"
|
|
32
34
|
};
|
|
33
35
|
var categorySelectorNew = null;
|
|
@@ -152,7 +154,7 @@ var CategorySelector = function CategorySelector(props) {
|
|
|
152
154
|
"aria-label": categoryName,
|
|
153
155
|
"aria-controls": currentFocus === index ? _EmojiPickerList.RENDER_EMOJI_PICKER_LIST_TESTID : undefined,
|
|
154
156
|
"aria-selected": categoryId === activeCategoryId,
|
|
155
|
-
xcss: (0, _css.cx)(styles.commonCategoryNew, styles.defaultCategoryNew, categoryId === activeCategoryId && styles.activeCategoryNew, disableCategories && styles.disabledCategory),
|
|
157
|
+
xcss: (0, _css.cx)(styles.commonCategoryNew, styles.defaultCategoryNew, (0, _fg.fg)('platform_ally_emoji_fixes_various') && styles.focusedCategoryNew, categoryId === activeCategoryId && styles.activeCategoryNew, disableCategories && styles.disabledCategory),
|
|
156
158
|
isDisabled: disableCategories,
|
|
157
159
|
onClick: handleClick(categoryId, index),
|
|
158
160
|
testId: (0, _categorySelectorCategoryTestId.categorySelectorCategoryTestId)(categoryId),
|
|
@@ -17,7 +17,7 @@ var createEvent = exports.createEvent = function createEvent(eventType, action,
|
|
|
17
17
|
actionSubjectId: actionSubjectId,
|
|
18
18
|
attributes: _objectSpread({
|
|
19
19
|
packageName: "@atlaskit/emoji",
|
|
20
|
-
packageVersion: "73.4.
|
|
20
|
+
packageVersion: "73.4.8"
|
|
21
21
|
}, attributes)
|
|
22
22
|
};
|
|
23
23
|
};
|
|
@@ -32,6 +32,7 @@ const ProductivityColorPopupContent = ({
|
|
|
32
32
|
colorPreviewEmojis,
|
|
33
33
|
focusSelectedColorOnMount,
|
|
34
34
|
onColorSelected,
|
|
35
|
+
onEscape,
|
|
35
36
|
selectedColor
|
|
36
37
|
}) => {
|
|
37
38
|
const popupRef = useRef(null);
|
|
@@ -53,12 +54,20 @@ const ProductivityColorPopupContent = ({
|
|
|
53
54
|
}
|
|
54
55
|
event.stopPropagation();
|
|
55
56
|
};
|
|
57
|
+
const handleEscape = event => {
|
|
58
|
+
if (fg('platform_emoji_color_picker_escape_focus') && (event.key === 'Escape' || event.key === 'Esc')) {
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
event.stopPropagation();
|
|
61
|
+
onEscape();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
56
64
|
window.addEventListener('pointerdown', stopNonInputDismissalBeforeDocument, true);
|
|
57
65
|
window.addEventListener('mousedown', stopNonInputDismissalBeforeDocument, true);
|
|
58
66
|
window.addEventListener('click', stopNonInputDismissalBeforeDocument, true);
|
|
59
67
|
popupElement.addEventListener('pointerdown', stopNonInputDismissal);
|
|
60
68
|
popupElement.addEventListener('mousedown', stopNonInputDismissal);
|
|
61
69
|
popupElement.addEventListener('click', stopNonInputDismissal);
|
|
70
|
+
popupElement.addEventListener('keydown', handleEscape);
|
|
62
71
|
return () => {
|
|
63
72
|
window.removeEventListener('pointerdown', stopNonInputDismissalBeforeDocument, true);
|
|
64
73
|
window.removeEventListener('mousedown', stopNonInputDismissalBeforeDocument, true);
|
|
@@ -66,8 +75,9 @@ const ProductivityColorPopupContent = ({
|
|
|
66
75
|
popupElement.removeEventListener('pointerdown', stopNonInputDismissal);
|
|
67
76
|
popupElement.removeEventListener('mousedown', stopNonInputDismissal);
|
|
68
77
|
popupElement.removeEventListener('click', stopNonInputDismissal);
|
|
78
|
+
popupElement.removeEventListener('keydown', handleEscape);
|
|
69
79
|
};
|
|
70
|
-
}, []);
|
|
80
|
+
}, [onEscape]);
|
|
71
81
|
return /*#__PURE__*/React.createElement("div", {
|
|
72
82
|
ref: popupRef,
|
|
73
83
|
className: ax(["_19itia51 _2rkofajl _bfhk1bhr _16qs130s _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7"])
|
|
@@ -130,6 +140,10 @@ const TonesWrapper = props => {
|
|
|
130
140
|
onToneClose();
|
|
131
141
|
setFocusSelectedProductivityColorOnMount(false);
|
|
132
142
|
}, [onProductivityColorSelected, onToneClose]);
|
|
143
|
+
const onProductivityColorEscape = useCallback(() => {
|
|
144
|
+
onToneClose();
|
|
145
|
+
setFocusTonePreviewButton(true);
|
|
146
|
+
}, [onToneClose]);
|
|
133
147
|
const onProductivityColorToggle = useCallback(event => {
|
|
134
148
|
const isKeyboardClick = (event === null || event === void 0 ? void 0 : event.detail) === 0;
|
|
135
149
|
setFocusSelectedProductivityColorOnMount(!showToneSelector && (openProductivityColorSelectorWithKeyboard.current || isKeyboardClick));
|
|
@@ -137,10 +151,16 @@ const TonesWrapper = props => {
|
|
|
137
151
|
onToneToggle();
|
|
138
152
|
}, [onToneToggle, showToneSelector]);
|
|
139
153
|
const onProductivityColorPreviewKeyDown = useCallback(event => {
|
|
154
|
+
if (showToneSelector && fg('platform_emoji_color_picker_escape_focus') && (event.key === 'Escape' || event.key === 'Esc')) {
|
|
155
|
+
event.preventDefault();
|
|
156
|
+
event.stopPropagation();
|
|
157
|
+
onProductivityColorEscape();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
140
160
|
if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {
|
|
141
161
|
openProductivityColorSelectorWithKeyboard.current = true;
|
|
142
162
|
}
|
|
143
|
-
}, []);
|
|
163
|
+
}, [onProductivityColorEscape, showToneSelector]);
|
|
144
164
|
const shouldShowProductivityColorSelector = !!(activeCategoryId === 'ATLASSIAN' && activeAtlassianSubcategory && atlassianSubcategoriesWithProductivityColorSelector.includes(activeAtlassianSubcategory) && productivityColorPreviewEmojis && selectedProductivityColor && onProductivityColorSelected);
|
|
145
165
|
if (shouldShowProductivityColorSelector) {
|
|
146
166
|
const previewEmoji = (productivityColorPreviewEmojis === null || productivityColorPreviewEmojis === void 0 ? void 0 : productivityColorPreviewEmojis[selectedProductivityColor]) || Object.values(productivityColorPreviewEmojis || {})[0];
|
|
@@ -166,7 +186,8 @@ const TonesWrapper = props => {
|
|
|
166
186
|
colorPreviewEmojis: productivityColorPreviewEmojis,
|
|
167
187
|
focusSelectedColorOnMount: focusSelectedProductivityColorOnMount,
|
|
168
188
|
selectedColor: selectedProductivityColor,
|
|
169
|
-
onColorSelected: onProductivityColorSelectedHandler
|
|
189
|
+
onColorSelected: onProductivityColorSelectedHandler,
|
|
190
|
+
onEscape: onProductivityColorEscape
|
|
170
191
|
}))));
|
|
171
192
|
}
|
|
172
193
|
if (!toneEmoji) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
._v564h5h4{transition:color .2s ease}
|
|
2
|
-
._189eidpf{border-width:0}
|
|
2
|
+
._189eidpf{border-width:0}
|
|
3
|
+
._13li1mok{border-top-left-radius:var(--ds-radius-large,8px)}
|
|
3
4
|
._16jlidpf{flex-grow:0}
|
|
4
5
|
._19bv12x7{padding-left:var(--ds-space-075,6px)}
|
|
5
6
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
@@ -28,7 +29,10 @@
|
|
|
28
29
|
._syaz1rpy{color:var(--ds-text-subtlest,#6b6e76)}
|
|
29
30
|
._syaz6x5g{color:var(--ds-text-selected,#1868db)}
|
|
30
31
|
._u5f312x7{padding-right:var(--ds-space-075,6px)}
|
|
31
|
-
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
32
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
|
|
33
|
+
._1ah31i6y:focus-visible{outline-offset:var(--ds-space-negative-025,-2px)}
|
|
34
|
+
._mizu1v1w:focus-visible{outline-color:var(--ds-border-focused,#4688ec)}
|
|
35
|
+
._ra3xnqa1:focus-visible{outline-style:solid}
|
|
32
36
|
._1jc41ihb:hover{border-bottom-color:var(--ds-border-bold,#7d818a)}
|
|
33
37
|
._1jc4a755:hover{border-bottom-color:var(--ds-border-brand,#1868db)}
|
|
34
38
|
._30l31rpy:hover{color:var(--ds-text-subtlest,#6b6e76)}
|
|
@@ -5,6 +5,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
import { cx } from '@atlaskit/css';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
9
|
import { Pressable } from '@atlaskit/primitives/compiled/pressable';
|
|
9
10
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
10
11
|
import { usePrevious } from '../../hooks/usePrevious';
|
|
@@ -18,6 +19,7 @@ const styles = {
|
|
|
18
19
|
commonCategoryNew: "_v564h5h4 _189eidpf _bfhksm61 _ca0qu2gc _n3tdu2gc _19bv12x7 _u5f312x7 _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
19
20
|
defaultCategoryNew: "_syaz1rpy _1doc1dm9 _1il9nqa1 _1o3i1j28 _30l31rpy _1jc41ihb",
|
|
20
21
|
activeCategoryNew: "_syaz6x5g _1doc1dm9 _1il9nqa1 _1o3ia755 _30l36x5g _1jc4a755",
|
|
22
|
+
focusedCategoryNew: "_mizu1v1w _ra3xnqa1 _128mdkaa _1ah31i6y",
|
|
21
23
|
disabledCategory: "_syaz1rpy"
|
|
22
24
|
};
|
|
23
25
|
const categorySelectorNew = null;
|
|
@@ -135,7 +137,7 @@ const CategorySelector = props => {
|
|
|
135
137
|
"aria-label": categoryName,
|
|
136
138
|
"aria-controls": currentFocus === index ? RENDER_EMOJI_PICKER_LIST_TESTID : undefined,
|
|
137
139
|
"aria-selected": categoryId === activeCategoryId,
|
|
138
|
-
xcss: cx(styles.commonCategoryNew, styles.defaultCategoryNew, categoryId === activeCategoryId && styles.activeCategoryNew, disableCategories && styles.disabledCategory),
|
|
140
|
+
xcss: cx(styles.commonCategoryNew, styles.defaultCategoryNew, fg('platform_ally_emoji_fixes_various') && styles.focusedCategoryNew, categoryId === activeCategoryId && styles.activeCategoryNew, disableCategories && styles.disabledCategory),
|
|
139
141
|
isDisabled: disableCategories,
|
|
140
142
|
onClick: handleClick(categoryId, index),
|
|
141
143
|
testId: categorySelectorCategoryTestId(categoryId),
|
|
@@ -33,6 +33,7 @@ var ProductivityColorPopupContent = function ProductivityColorPopupContent(_ref)
|
|
|
33
33
|
var colorPreviewEmojis = _ref.colorPreviewEmojis,
|
|
34
34
|
focusSelectedColorOnMount = _ref.focusSelectedColorOnMount,
|
|
35
35
|
onColorSelected = _ref.onColorSelected,
|
|
36
|
+
onEscape = _ref.onEscape,
|
|
36
37
|
selectedColor = _ref.selectedColor;
|
|
37
38
|
var popupRef = useRef(null);
|
|
38
39
|
useEffect(function () {
|
|
@@ -55,12 +56,20 @@ var ProductivityColorPopupContent = function ProductivityColorPopupContent(_ref)
|
|
|
55
56
|
}
|
|
56
57
|
event.stopPropagation();
|
|
57
58
|
};
|
|
59
|
+
var handleEscape = function handleEscape(event) {
|
|
60
|
+
if (fg('platform_emoji_color_picker_escape_focus') && (event.key === 'Escape' || event.key === 'Esc')) {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
event.stopPropagation();
|
|
63
|
+
onEscape();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
58
66
|
window.addEventListener('pointerdown', stopNonInputDismissalBeforeDocument, true);
|
|
59
67
|
window.addEventListener('mousedown', stopNonInputDismissalBeforeDocument, true);
|
|
60
68
|
window.addEventListener('click', stopNonInputDismissalBeforeDocument, true);
|
|
61
69
|
popupElement.addEventListener('pointerdown', stopNonInputDismissal);
|
|
62
70
|
popupElement.addEventListener('mousedown', stopNonInputDismissal);
|
|
63
71
|
popupElement.addEventListener('click', stopNonInputDismissal);
|
|
72
|
+
popupElement.addEventListener('keydown', handleEscape);
|
|
64
73
|
return function () {
|
|
65
74
|
window.removeEventListener('pointerdown', stopNonInputDismissalBeforeDocument, true);
|
|
66
75
|
window.removeEventListener('mousedown', stopNonInputDismissalBeforeDocument, true);
|
|
@@ -68,8 +77,9 @@ var ProductivityColorPopupContent = function ProductivityColorPopupContent(_ref)
|
|
|
68
77
|
popupElement.removeEventListener('pointerdown', stopNonInputDismissal);
|
|
69
78
|
popupElement.removeEventListener('mousedown', stopNonInputDismissal);
|
|
70
79
|
popupElement.removeEventListener('click', stopNonInputDismissal);
|
|
80
|
+
popupElement.removeEventListener('keydown', handleEscape);
|
|
71
81
|
};
|
|
72
|
-
}, []);
|
|
82
|
+
}, [onEscape]);
|
|
73
83
|
return /*#__PURE__*/React.createElement("div", {
|
|
74
84
|
ref: popupRef,
|
|
75
85
|
className: ax(["_19itia51 _2rkofajl _bfhk1bhr _16qs130s _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7"])
|
|
@@ -131,6 +141,10 @@ var TonesWrapper = function TonesWrapper(props) {
|
|
|
131
141
|
onToneClose();
|
|
132
142
|
setFocusSelectedProductivityColorOnMount(false);
|
|
133
143
|
}, [onProductivityColorSelected, onToneClose]);
|
|
144
|
+
var onProductivityColorEscape = useCallback(function () {
|
|
145
|
+
onToneClose();
|
|
146
|
+
setFocusTonePreviewButton(true);
|
|
147
|
+
}, [onToneClose]);
|
|
134
148
|
var onProductivityColorToggle = useCallback(function (event) {
|
|
135
149
|
var isKeyboardClick = (event === null || event === void 0 ? void 0 : event.detail) === 0;
|
|
136
150
|
setFocusSelectedProductivityColorOnMount(!showToneSelector && (openProductivityColorSelectorWithKeyboard.current || isKeyboardClick));
|
|
@@ -138,10 +152,16 @@ var TonesWrapper = function TonesWrapper(props) {
|
|
|
138
152
|
onToneToggle();
|
|
139
153
|
}, [onToneToggle, showToneSelector]);
|
|
140
154
|
var onProductivityColorPreviewKeyDown = useCallback(function (event) {
|
|
155
|
+
if (showToneSelector && fg('platform_emoji_color_picker_escape_focus') && (event.key === 'Escape' || event.key === 'Esc')) {
|
|
156
|
+
event.preventDefault();
|
|
157
|
+
event.stopPropagation();
|
|
158
|
+
onProductivityColorEscape();
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
141
161
|
if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {
|
|
142
162
|
openProductivityColorSelectorWithKeyboard.current = true;
|
|
143
163
|
}
|
|
144
|
-
}, []);
|
|
164
|
+
}, [onProductivityColorEscape, showToneSelector]);
|
|
145
165
|
var shouldShowProductivityColorSelector = !!(activeCategoryId === 'ATLASSIAN' && activeAtlassianSubcategory && atlassianSubcategoriesWithProductivityColorSelector.includes(activeAtlassianSubcategory) && productivityColorPreviewEmojis && selectedProductivityColor && onProductivityColorSelected);
|
|
146
166
|
if (shouldShowProductivityColorSelector) {
|
|
147
167
|
var previewEmoji = (productivityColorPreviewEmojis === null || productivityColorPreviewEmojis === void 0 ? void 0 : productivityColorPreviewEmojis[selectedProductivityColor]) || Object.values(productivityColorPreviewEmojis || {})[0];
|
|
@@ -167,7 +187,8 @@ var TonesWrapper = function TonesWrapper(props) {
|
|
|
167
187
|
colorPreviewEmojis: productivityColorPreviewEmojis,
|
|
168
188
|
focusSelectedColorOnMount: focusSelectedProductivityColorOnMount,
|
|
169
189
|
selectedColor: selectedProductivityColor,
|
|
170
|
-
onColorSelected: onProductivityColorSelectedHandler
|
|
190
|
+
onColorSelected: onProductivityColorSelectedHandler,
|
|
191
|
+
onEscape: onProductivityColorEscape
|
|
171
192
|
}))));
|
|
172
193
|
}
|
|
173
194
|
if (!toneEmoji) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
._v564h5h4{transition:color .2s ease}
|
|
2
|
-
._189eidpf{border-width:0}
|
|
2
|
+
._189eidpf{border-width:0}
|
|
3
|
+
._13li1mok{border-top-left-radius:var(--ds-radius-large,8px)}
|
|
3
4
|
._16jlidpf{flex-grow:0}
|
|
4
5
|
._19bv12x7{padding-left:var(--ds-space-075,6px)}
|
|
5
6
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
@@ -28,7 +29,10 @@
|
|
|
28
29
|
._syaz1rpy{color:var(--ds-text-subtlest,#6b6e76)}
|
|
29
30
|
._syaz6x5g{color:var(--ds-text-selected,#1868db)}
|
|
30
31
|
._u5f312x7{padding-right:var(--ds-space-075,6px)}
|
|
31
|
-
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
32
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
|
|
33
|
+
._1ah31i6y:focus-visible{outline-offset:var(--ds-space-negative-025,-2px)}
|
|
34
|
+
._mizu1v1w:focus-visible{outline-color:var(--ds-border-focused,#4688ec)}
|
|
35
|
+
._ra3xnqa1:focus-visible{outline-style:solid}
|
|
32
36
|
._1jc41ihb:hover{border-bottom-color:var(--ds-border-bold,#7d818a)}
|
|
33
37
|
._1jc4a755:hover{border-bottom-color:var(--ds-border-brand,#1868db)}
|
|
34
38
|
._30l31rpy:hover{color:var(--ds-text-subtlest,#6b6e76)}
|
|
@@ -6,6 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
7
7
|
import { useIntl } from 'react-intl';
|
|
8
8
|
import { cx } from '@atlaskit/css';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
10
|
import { Pressable } from '@atlaskit/primitives/compiled/pressable';
|
|
10
11
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
11
12
|
import { usePrevious } from '../../hooks/usePrevious';
|
|
@@ -19,6 +20,7 @@ var styles = {
|
|
|
19
20
|
commonCategoryNew: "_v564h5h4 _189eidpf _bfhksm61 _ca0qu2gc _n3tdu2gc _19bv12x7 _u5f312x7 _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
20
21
|
defaultCategoryNew: "_syaz1rpy _1doc1dm9 _1il9nqa1 _1o3i1j28 _30l31rpy _1jc41ihb",
|
|
21
22
|
activeCategoryNew: "_syaz6x5g _1doc1dm9 _1il9nqa1 _1o3ia755 _30l36x5g _1jc4a755",
|
|
23
|
+
focusedCategoryNew: "_mizu1v1w _ra3xnqa1 _128mdkaa _1ah31i6y",
|
|
22
24
|
disabledCategory: "_syaz1rpy"
|
|
23
25
|
};
|
|
24
26
|
var categorySelectorNew = null;
|
|
@@ -143,7 +145,7 @@ var CategorySelector = function CategorySelector(props) {
|
|
|
143
145
|
"aria-label": categoryName,
|
|
144
146
|
"aria-controls": currentFocus === index ? RENDER_EMOJI_PICKER_LIST_TESTID : undefined,
|
|
145
147
|
"aria-selected": categoryId === activeCategoryId,
|
|
146
|
-
xcss: cx(styles.commonCategoryNew, styles.defaultCategoryNew, categoryId === activeCategoryId && styles.activeCategoryNew, disableCategories && styles.disabledCategory),
|
|
148
|
+
xcss: cx(styles.commonCategoryNew, styles.defaultCategoryNew, fg('platform_ally_emoji_fixes_various') && styles.focusedCategoryNew, categoryId === activeCategoryId && styles.activeCategoryNew, disableCategories && styles.disabledCategory),
|
|
147
149
|
isDisabled: disableCategories,
|
|
148
150
|
onClick: handleClick(categoryId, index),
|
|
149
151
|
testId: categorySelectorCategoryTestId(categoryId),
|
|
@@ -10,7 +10,7 @@ export var createEvent = function createEvent(eventType, action, actionSubject,
|
|
|
10
10
|
actionSubjectId: actionSubjectId,
|
|
11
11
|
attributes: _objectSpread({
|
|
12
12
|
packageName: "@atlaskit/emoji",
|
|
13
|
-
packageVersion: "73.4.
|
|
13
|
+
packageVersion: "73.4.8"
|
|
14
14
|
}, attributes)
|
|
15
15
|
};
|
|
16
16
|
};
|